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

Unified Diff: content/test/test_navigation_url_loader.cc

Issue 2885453003: NavigationSimulator: add support for GlobalRequestIds (Closed)
Patch Set: dcheck Created 3 years, 7 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/test/test_navigation_url_loader.cc
diff --git a/content/test/test_navigation_url_loader.cc b/content/test/test_navigation_url_loader.cc
index 0ba5b7e13c740c0211a4e30bc72c0218942d7fd5..7b2a1ffbfdf51d8d16c4b15ee60e5fe58b62e001 100644
--- a/content/test/test_navigation_url_loader.cc
+++ b/content/test/test_navigation_url_loader.cc
@@ -9,8 +9,10 @@
#include "content/browser/loader/navigation_url_loader_delegate.h"
#include "content/public/browser/global_request_id.h"
#include "content/public/browser/navigation_data.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/browser/stream_handle.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/resource_response.h"
#include "net/url_request/redirect_info.h"
@@ -56,9 +58,15 @@ void TestNavigationURLLoader::CallOnResponseStarted(
const scoped_refptr<ResourceResponse>& response,
std::unique_ptr<StreamHandle> body,
std::unique_ptr<NavigationData> navigation_data) {
+ static int request_id = 0;
Charlie Reis 2017/05/15 20:07:43 Hmm, now it does look like there's a potential for
Charlie Harrison 2017/05/15 21:45:54 Yes, but the code I've changed in navigation_simul
Charlie Reis 2017/05/15 22:02:39 Ah, glad they're mutually exclusive. Can you add
Charlie Harrison 2017/05/16 03:41:42 I've added a DCHECK in the constructor.
+ int child_id =
+ WebContents::FromFrameTreeNodeId(request_info_->frame_tree_node_id)
+ ->GetRenderProcessHost()
+ ->GetID();
+ GlobalRequestID global_id(child_id, ++request_id);
delegate_->OnResponseStarted(
response, std::move(body), mojo::ScopedDataPipeConsumerHandle(),
- SSLStatus(), std::move(navigation_data), GlobalRequestID(), false, false);
+ SSLStatus(), std::move(navigation_data), global_id, false, false);
}
TestNavigationURLLoader::~TestNavigationURLLoader() {}
« content/public/test/navigation_simulator.cc ('K') | « content/public/test/navigation_simulator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698