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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10828284: Regression test for anti-DDoS bugs in ChromeNetworkDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. 56 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
57 // This method should be called on the UI thread. 57 // This method should be called on the UI thread.
58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, 58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
59 PrefService* pref_service); 59 PrefService* pref_service);
60 60
61 // When called, all file:// URLs will now be accessible. If this is not 61 // When called, all file:// URLs will now be accessible. If this is not
62 // called, then some platforms restrict access to file:// paths. 62 // called, then some platforms restrict access to file:// paths.
63 static void AllowAccessToAllFiles(); 63 static void AllowAccessToAllFiles();
64 64
65 private: 65 private:
66 friend class ChromeNetworkDelegateTest;
67
66 // NetworkDelegate implementation. 68 // NetworkDelegate implementation.
67 virtual int OnBeforeURLRequest(net::URLRequest* request, 69 virtual int OnBeforeURLRequest(net::URLRequest* request,
68 const net::CompletionCallback& callback, 70 const net::CompletionCallback& callback,
69 GURL* new_url) OVERRIDE; 71 GURL* new_url) OVERRIDE;
70 virtual int OnBeforeSendHeaders(net::URLRequest* request, 72 virtual int OnBeforeSendHeaders(net::URLRequest* request,
71 const net::CompletionCallback& callback, 73 const net::CompletionCallback& callback,
72 net::HttpRequestHeaders* headers) OVERRIDE; 74 net::HttpRequestHeaders* headers) OVERRIDE;
73 virtual void OnSendHeaders(net::URLRequest* request, 75 virtual void OnSendHeaders(net::URLRequest* request,
74 const net::HttpRequestHeaders& headers) OVERRIDE; 76 const net::HttpRequestHeaders& headers) OVERRIDE;
75 virtual int OnHeadersReceived( 77 virtual int OnHeadersReceived(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // static anyway since it is based on a command-line flag. 132 // static anyway since it is based on a command-line flag.
131 static bool g_never_throttle_requests_; 133 static bool g_never_throttle_requests_;
132 134
133 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. 135 // Pointer to IOThread global, should outlive ChromeNetworkDelegate.
134 chrome_browser_net::CacheStats* cache_stats_; 136 chrome_browser_net::CacheStats* cache_stats_;
135 137
136 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 138 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
137 }; 139 };
138 140
139 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 141 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698