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

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

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 8 years, 10 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.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index 74b714628f1c3a8695e9a9d82c8cf0e0e9328f22..513c08cac53583239a997037f61329180b4bed26 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "net/base/network_delegate.h"
+class CookieSettings;
class ExtensionEventRouterForwarder;
class ExtensionInfoMap;
class PrefService;
@@ -26,16 +27,18 @@ class URLBlacklistManager;
// add hooks into the network stack.
class ChromeNetworkDelegate : public net::NetworkDelegate {
public:
- // If |profile| is NULL, events will be broadcasted to all profiles, otherwise
- // they will only be sent to the specified profile.
+ // If |profile| is NULL, events will be broadcasted to all profiles,
+ // otherwise they will only be sent to the specified profile.
// |enable_referrers| should be initialized on the UI thread (see below)
- // beforehand. This object's owner is responsible for cleaning it up
- // at shutdown.
+ // beforehand. This object's owner is responsible for cleaning it up at
+ // shutdown. If |cookie_settings| is NULL, all cookies are enabled,
+ // otherwise, the settings are enforced on all observed network requests.
ChromeNetworkDelegate(
ExtensionEventRouterForwarder* event_router,
ExtensionInfoMap* extension_info_map,
const policy::URLBlacklistManager* url_blacklist_manager,
void* profile,
+ CookieSettings* cookie_settings,
BooleanPrefMember* enable_referrers);
virtual ~ChromeNetworkDelegate();
@@ -74,9 +77,15 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
net::AuthCredentials* credentials) OVERRIDE;
+ virtual bool OnReadingCookies(const net::URLRequest* request,
+ const net::CookieList& cookie_list) OVERRIDE;
+ virtual bool OnSettingCookie(const net::URLRequest* request,
+ const std::string& cookie_line,
+ net::CookieOptions* options) OVERRIDE;
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
void* profile_;
+ scoped_refptr<CookieSettings> cookie_settings_;
scoped_refptr<ExtensionInfoMap> extension_info_map_;

Powered by Google App Engine
This is Rietveld 408576698