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

Side by Side Diff: content/shell/browser/shell_network_delegate.h

Issue 2764363002: PlzNavigate: sanitize the referrer in NavigationRequest (Closed)
Patch Set: Addressed comments Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ 6 #define CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "net/base/network_delegate_impl.h" 10 #include "net/base/network_delegate_impl.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class ShellNetworkDelegate : public net::NetworkDelegateImpl { 14 class ShellNetworkDelegate : public net::NetworkDelegateImpl {
15 public: 15 public:
16 ShellNetworkDelegate(); 16 ShellNetworkDelegate();
17 ~ShellNetworkDelegate() override; 17 ~ShellNetworkDelegate() override;
18 18
19 static void SetBlockThirdPartyCookies(bool block); 19 static void SetBlockThirdPartyCookies(bool block);
20 static void SetCancelURLRequestWithPolicyViolatingReferrerHeader(bool cancel);
20 21
21 private: 22 private:
22 // net::NetworkDelegate implementation. 23 // net::NetworkDelegate implementation.
23 int OnBeforeURLRequest(net::URLRequest* request, 24 int OnBeforeURLRequest(net::URLRequest* request,
24 const net::CompletionCallback& callback, 25 const net::CompletionCallback& callback,
25 GURL* new_url) override; 26 GURL* new_url) override;
26 int OnBeforeStartTransaction(net::URLRequest* request, 27 int OnBeforeStartTransaction(net::URLRequest* request,
27 const net::CompletionCallback& callback, 28 const net::CompletionCallback& callback,
28 net::HttpRequestHeaders* headers) override; 29 net::HttpRequestHeaders* headers) override;
29 void OnStartTransaction(net::URLRequest* request, 30 void OnStartTransaction(net::URLRequest* request,
(...skipping 18 matching lines...) Expand all
48 const AuthCallback& callback, 49 const AuthCallback& callback,
49 net::AuthCredentials* credentials) override; 50 net::AuthCredentials* credentials) override;
50 bool OnCanGetCookies(const net::URLRequest& request, 51 bool OnCanGetCookies(const net::URLRequest& request,
51 const net::CookieList& cookie_list) override; 52 const net::CookieList& cookie_list) override;
52 bool OnCanSetCookie(const net::URLRequest& request, 53 bool OnCanSetCookie(const net::URLRequest& request,
53 const std::string& cookie_line, 54 const std::string& cookie_line,
54 net::CookieOptions* options) override; 55 net::CookieOptions* options) override;
55 bool OnCanAccessFile(const net::URLRequest& request, 56 bool OnCanAccessFile(const net::URLRequest& request,
56 const base::FilePath& path) const override; 57 const base::FilePath& path) const override;
57 bool OnAreExperimentalCookieFeaturesEnabled() const override; 58 bool OnAreExperimentalCookieFeaturesEnabled() const override;
59 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
60 const net::URLRequest& request,
61 const GURL& target_url,
62 const GURL& referrer_url) const override;
58 63
59 DISALLOW_COPY_AND_ASSIGN(ShellNetworkDelegate); 64 DISALLOW_COPY_AND_ASSIGN(ShellNetworkDelegate);
60 }; 65 };
61 66
62 } // namespace content 67 } // namespace content
63 68
64 #endif // CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_ 69 #endif // CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698