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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2776523005: Plumbing devtools agent host id and request id between processes (Closed)
Patch Set: Full plumbing Created 3 years, 9 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: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index dc7074a67fd2b787f15412fb662a62a27b2bff9c..2bccff4d0d877f09d2cf0c2d94985513705933b8 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -70,6 +70,7 @@
#include "content/browser/streams/stream.h"
#include "content/browser/streams/stream_context.h"
#include "content/browser/streams/stream_registry.h"
+#include "content/common/net/url_request_devtools_user_data.h"
#include "content/common/net/url_request_service_worker_data.h"
#include "content/common/resource_messages.h"
#include "content/common/resource_request.h"
@@ -1367,6 +1368,11 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
new_request.get(), requester_info->blob_storage_context()
->context()
->GetBlobDataFromPublicURL(new_request->url()));
+ } else if (!request_data.devtools_agent_host_id.empty()) {
+ new_request->SetUserData(URLRequestDevtoolsUserData::kUserDataKey,
+ base::MakeUnique<URLRequestDevtoolsUserData>(
+ request_data.devtools_agent_host_id,
+ request_data.devtools_request_id));
}
// Initialize the service worker handler for the request. We don't use
@@ -2052,6 +2058,15 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
new_request.get(),
blob_context->GetBlobDataFromPublicURL(new_request->url()));
+ } else if (!info.devtools_agent_host_id.empty()) {
+ // Keep in sync with IdentifiersFactory::requestId. We don't necessarily
+ // know the browser PID yet so just specify zero.
Sami 2017/03/29 16:41:42 Do you mean the renderer pid?
alex clarke (OOO till 29th) 2017/03/30 16:56:55 Done.
+ std::string devtools_request_id =
+ base::StringPrintf("0.%u\n", info.devtools_request_id);
+ new_request->SetUserData(
+ URLRequestDevtoolsUserData::kUserDataKey,
+ base::MakeUnique<URLRequestDevtoolsUserData>(
+ info.devtools_agent_host_id, devtools_request_id));
}
RequestContextFrameType frame_type =

Powered by Google App Engine
This is Rietveld 408576698