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

Unified Diff: chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc

Issue 2413663003: Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: Addressed comments Created 4 years, 2 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: chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc
index ebd021d6fff295eb1c2f30dd5a65d48df15ad9b8..d8d7a28d1a0887e7f700b7bd2f424a8bfc06fe28 100644
--- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc
+++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_service.cc
@@ -155,12 +155,18 @@ void ChromeDataUseAscriberService::DidFinishNavigation(
if (!ascriber_)
return;
+ // In this case, is_success() will be false for the the main frame URLRequest
+ // and the pending navigation entry will be removed when URLRequest completes.
+ if (!navigation_handle->HasNetworkResponseStarted())
+ return;
+
content::WebContents* web_contents = navigation_handle->GetWebContents();
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(
&ChromeDataUseAscriber::DidFinishMainFrameNavigation,
base::Unretained(ascriber_), navigation_handle->GetURL(),
+ navigation_handle->GetGlobalRequestID(),
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetMainFrame()->GetRoutingID(),
!navigation_handle->HasCommitted() || navigation_handle->IsSamePage(),

Powered by Google App Engine
This is Rietveld 408576698