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

Unified Diff: content/common/navigation_params.cc

Issue 1222203004: PlzNavigate: Do not send synchronous navigations from the renderer to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment refactoring Created 5 years, 5 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
« no previous file with comments | « content/common/navigation_params.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/navigation_params.cc
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 8b70c8ffb9718acfc22352f71d3643591cad57c7..b9cd7d36e5166b9e1e0faada4dcd9ed6850667c9 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -4,10 +4,25 @@
#include "content/common/navigation_params.h"
+#include "base/command_line.h"
#include "base/memory/ref_counted_memory.h"
+#include "content/public/common/content_switches.h"
namespace content {
+// PlzNavigate
+bool ShouldMakeNetworkRequestForURL(const GURL& url) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
+
+ // Data URLs, Javascript URLs and about:blank should not send a request to the
+ // network stack.
+ // TODO(clamy): same document navigations should not send requests to the
+ // network stack. Neither should pushState/popState.
+ return !url.SchemeIs(url::kDataScheme) && url != GURL(url::kAboutBlankURL) &&
+ !url.SchemeIs(url::kJavaScriptScheme);
+}
+
CommonNavigationParams::CommonNavigationParams()
: transition(ui::PAGE_TRANSITION_LINK),
navigation_type(FrameMsg_Navigate_Type::NORMAL),
« no previous file with comments | « content/common/navigation_params.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698