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

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: Rebased Created 3 years, 8 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 e2bf1492e47e1b1d8807f68690ad91d13b7f5c37..27442418da044d9e34be03266ee8b3c8f981dd97 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -71,6 +71,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"
@@ -1372,6 +1373,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
@@ -2057,6 +2063,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 renderer PID yet so just specify zero.
+ std::string devtools_request_id =
+ base::StringPrintf("0.%d", info.devtools_request_id);
+ new_request->SetUserData(
+ URLRequestDevtoolsUserData::kUserDataKey,
+ base::MakeUnique<URLRequestDevtoolsUserData>(
+ info.devtools_agent_host_id, devtools_request_id));
}
RequestContextFrameType frame_type =
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698