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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 387003008: ifdef extensions code in BrowserProcess, IOThread, and ChromeNetworkDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 4e81a7bd4a102768eda9b363b662cf17e70c37b6..a7d81e5a9cece514d0f14bc5e25364972e4ec9ad 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -42,7 +42,6 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_request_info.h"
-#include "extensions/common/constants.h"
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
@@ -72,6 +71,10 @@
#include "components/policy/core/browser/url_blacklist_manager.h"
#endif
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/common/constants.h"
+#endif
+
using content::BrowserThread;
using content::RenderViewHost;
using content::ResourceRequestInfo;
@@ -85,9 +88,11 @@ bool ChromeNetworkDelegate::g_allow_file_access_ = false;
bool ChromeNetworkDelegate::g_allow_file_access_ = true;
#endif
+#if defined(ENABLE_EXTENSIONS)
// This remains false unless the --disable-extensions-http-throttling
// flag is passed to the browser.
bool ChromeNetworkDelegate::g_never_throttle_requests_ = false;
+#endif
namespace {
@@ -338,9 +343,11 @@ void ChromeNetworkDelegate::SetEnableClientHints() {
}
// static
+#if defined(ENABLE_EXTENSIONS)
void ChromeNetworkDelegate::NeverThrottleRequests() {
g_never_throttle_requests_ = true;
}
+#endif
Ryan Sleevi 2014/07/16 20:23:44 Doesn't seem strictly necessary to #ifdef dance th
Lei Zhang 2014/07/18 01:34:24 All the throttle code here exists to support --dis
// static
void ChromeNetworkDelegate::InitializePrefsOnUIThread(
@@ -789,10 +796,14 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
bool ChromeNetworkDelegate::OnCanThrottleRequest(
const net::URLRequest& request) const {
+#if defined(ENABLE_EXTENSIONS)
if (g_never_throttle_requests_)
return false;
return request.first_party_for_cookies().scheme() ==
extensions::kExtensionScheme;
+#else
+ return false;
+#endif
}
bool ChromeNetworkDelegate::OnCanEnablePrivacyMode(

Powered by Google App Engine
This is Rietveld 408576698