Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h

Issue 2900613002: Support DevTools for off-main-thread-fetch (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h
index 33c7cff4bbfa62a3be7ae00d49379a25d3f34049..e9a8ed9d144c1fb13fdbb85a61281d7436ef5fcc 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h
@@ -57,15 +57,21 @@ class ResourceResponse;
class ThreadableLoaderClient;
class XHRReplayData;
class XMLHttpRequest;
-
class WebSocketHandshakeRequest;
class WebSocketHandshakeResponse;
+class WorkerGlobalScope;
class CORE_EXPORT InspectorNetworkAgent final
: public InspectorBaseAgent<protocol::Network::Metainfo> {
public:
static InspectorNetworkAgent* Create(InspectedFrames* inspected_frames) {
- return new InspectorNetworkAgent(inspected_frames);
+ return new InspectorNetworkAgent(inspected_frames, nullptr);
+ }
+ static InspectorNetworkAgent* CreateForWorker(
+ WorkerGlobalScope* worker_global_scope) {
+ // TODO(horo): Extract the logc for frames and for workers into different
+ // classes.
+ return new InspectorNetworkAgent(nullptr, worker_global_scope);
}
void Restore() override;
@@ -74,34 +80,32 @@ class CORE_EXPORT InspectorNetworkAgent final
DECLARE_VIRTUAL_TRACE();
// Probes.
- void DidBlockRequest(LocalFrame*,
+ void DidBlockRequest(ExecutionContext*,
const ResourceRequest&,
DocumentLoader*,
const FetchInitiatorInfo&,
ResourceRequestBlockedReason);
void DidChangeResourcePriority(unsigned long identifier,
ResourceLoadPriority);
- void WillSendRequest(LocalFrame*,
+ void WillSendRequest(ExecutionContext*,
unsigned long identifier,
DocumentLoader*,
ResourceRequest&,
const ResourceResponse& redirect_response,
const FetchInitiatorInfo&);
void MarkResourceAsCached(unsigned long identifier);
- void DidReceiveResourceResponse(LocalFrame*,
- unsigned long identifier,
+ void DidReceiveResourceResponse(unsigned long identifier,
DocumentLoader*,
const ResourceResponse&,
Resource*);
- void DidReceiveData(LocalFrame*,
- unsigned long identifier,
+ void DidReceiveData(unsigned long identifier,
+ DocumentLoader*,
const char* data,
int data_length);
- void DidReceiveEncodedDataLength(LocalFrame*,
- unsigned long identifier,
+ void DidReceiveEncodedDataLength(unsigned long identifier,
int encoded_data_length);
- void DidFinishLoading(LocalFrame*,
- unsigned long identifier,
+ void DidFinishLoading(unsigned long identifier,
+ DocumentLoader*,
double monotonic_finish_time,
int64_t encoded_data_length,
int64_t decoded_body_length);
@@ -230,10 +234,10 @@ class CORE_EXPORT InspectorNetworkAgent final
bool CacheDisabled();
private:
- explicit InspectorNetworkAgent(InspectedFrames*);
+ explicit InspectorNetworkAgent(InspectedFrames*, WorkerGlobalScope*);
void Enable(int total_buffer_size, int resource_buffer_size);
- void WillSendRequestInternal(LocalFrame*,
+ void WillSendRequestInternal(ExecutionContext*,
unsigned long identifier,
DocumentLoader*,
const ResourceRequest&,
@@ -253,7 +257,10 @@ class CORE_EXPORT InspectorNetworkAgent final
std::unique_ptr<GetResponseBodyCallback>);
void ClearPendingRequestData();
+ // This is null while inspecting workers.
Member<InspectedFrames> inspected_frames_;
+ // This is null while inspecting frames.
+ Member<WorkerGlobalScope> worker_global_scope_;
String host_id_;
Member<NetworkResourcesData> resources_data_;

Powered by Google App Engine
This is Rietveld 408576698