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

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: Review comments Created 5 years, 6 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/common/navigation_params.cc
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 8b70c8ffb9718acfc22352f71d3643591cad57c7..364df181f1d73b88f7c1d9edfb4dcf34b56f5ab1 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -4,10 +4,21 @@
#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 {
+bool ShouldMakeNetworkRequestForURL(const GURL& url) {
+ // Data and Javascript urls should not make network requests.
nasko 2015/07/06 11:06:16 If the comment is aiming to list the cases for no
Fabrice (no longer in Chrome) 2015/07/06 12:45:09 I modified the comment to clarify.
+ // TODO(clamy): same document navigations should not make network requests.
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
clamy 2015/07/03 15:02:23 nit: put the check above the comments, as they rel
Fabrice (no longer in Chrome) 2015/07/06 12:45:09 Done.
+ switches::kEnableBrowserSideNavigation));
+ 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),

Powered by Google App Engine
This is Rietveld 408576698