Class: WebkitRemote::Event::NetworkMemoryCacheHit
- Inherits:
-
WebkitRemote::Event
- Object
- WebkitRemote::Event
- WebkitRemote::Event::NetworkMemoryCacheHit
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Emitted when a resource is served from the local cache.
Instance Attribute Summary collapse
-
#cache_data ⇒ WebkitRemote::Client::NetworkCacheEntry
readonly
Cached information used to produce the resource.
-
#document_url ⇒ String
readonly
The URL of the document that caused this network request.
-
#initiator ⇒ WebkitRemote::Client::NetworkRequestInitiator
readonly
Cause for this network request.
-
#resource ⇒ WebkitRemote::Client::NetworkResource
readonly
Information about the resource fetched by this network operation.
-
#timestamp ⇒ Number
readonly
The event timestamp.
Attributes inherited from WebkitRemote::Event
Instance Method Summary collapse
-
#initialize(rpc_event, client) ⇒ NetworkMemoryCacheHit
constructor
A new instance of NetworkMemoryCacheHit.
Methods inherited from WebkitRemote::Event
can_reach?, can_receive?, class_for, for, #matches?, register, register_class
Constructor Details
#initialize(rpc_event, client) ⇒ NetworkMemoryCacheHit
Returns a new instance of NetworkMemoryCacheHit.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/webkit_remote/client/network_events.rb', line 130 def initialize(rpc_event, client) super if raw_data['resource'] @cache_data = WebkitRemote::Client::NetworkCacheEntry.new( raw_data['resource']) end @document_url = raw_data['documentURL'] if raw_data['initiator'] @initiator = WebkitRemote::Client::NetworkRequestInitiator.new( raw_data['initiator']) end @loader_id = raw_data['loaderId'] = raw_data['timestamp'] @resource = client.network_resource raw_data['requestId'] @resource.set_document_url @document_url @resource.set_initiator @initiator if @cache_data @resource.set_response @cache_data.response @resource.set_type @cache_data.type end @resource.add_event self end |
Instance Attribute Details
#cache_data ⇒ WebkitRemote::Client::NetworkCacheEntry (readonly)
Returns cached information used to produce the resource.
117 118 119 |
# File 'lib/webkit_remote/client/network_events.rb', line 117 def cache_data @cache_data end |
#document_url ⇒ String (readonly)
Returns the URL of the document that caused this network request.
120 121 122 |
# File 'lib/webkit_remote/client/network_events.rb', line 120 def document_url @document_url end |
#initiator ⇒ WebkitRemote::Client::NetworkRequestInitiator (readonly)
Returns cause for this network request.
124 125 126 |
# File 'lib/webkit_remote/client/network_events.rb', line 124 def initiator @initiator end |
#resource ⇒ WebkitRemote::Client::NetworkResource (readonly)
Returns information about the resource fetched by this network operation.
113 114 115 |
# File 'lib/webkit_remote/client/network_events.rb', line 113 def resource @resource end |
#timestamp ⇒ Number (readonly)
Returns the event timestamp.
127 128 129 |
# File 'lib/webkit_remote/client/network_events.rb', line 127 def end |