Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 14 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 15 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 15 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 16 | 16 |
| 17 class DelayedResourceQueue; | 17 class DelayedResourceQueue; |
| 18 class DownloadRequestLimiter; | 18 class DownloadRequestLimiter; |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 class UserScriptListener; | 21 class UserScriptListener; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace safe_browsing { | 24 namespace safe_browsing { |
| 25 class SafeBrowsingService; | 25 class SafeBrowsingService; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace net { | |
| 29 class HostPortPair; | |
| 30 } | |
| 31 | |
| 28 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender | 32 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender |
| 29 // system to abort requests and add to the load flags when a request begins. | 33 // system to abort requests and add to the load flags when a request begins. |
| 30 class ChromeResourceDispatcherHostDelegate | 34 class ChromeResourceDispatcherHostDelegate |
| 31 : public content::ResourceDispatcherHostDelegate { | 35 : public content::ResourceDispatcherHostDelegate { |
| 32 public: | 36 public: |
| 33 ChromeResourceDispatcherHostDelegate(); | 37 ChromeResourceDispatcherHostDelegate(); |
| 34 ~ChromeResourceDispatcherHostDelegate() override; | 38 ~ChromeResourceDispatcherHostDelegate() override; |
| 35 | 39 |
| 36 // ResourceDispatcherHostDelegate implementation. | 40 // ResourceDispatcherHostDelegate implementation. |
| 37 bool ShouldBeginRequest(const std::string& method, | 41 bool ShouldBeginRequest(const std::string& method, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 IPC::Sender* sender) override; | 83 IPC::Sender* sender) override; |
| 80 void OnRequestRedirected(const GURL& redirect_url, | 84 void OnRequestRedirected(const GURL& redirect_url, |
| 81 net::URLRequest* request, | 85 net::URLRequest* request, |
| 82 content::ResourceContext* resource_context, | 86 content::ResourceContext* resource_context, |
| 83 content::ResourceResponse* response) override; | 87 content::ResourceResponse* response) override; |
| 84 void RequestComplete(net::URLRequest* url_request) override; | 88 void RequestComplete(net::URLRequest* url_request) override; |
| 85 bool ShouldEnableLoFiMode( | 89 bool ShouldEnableLoFiMode( |
| 86 const net::URLRequest& url_request, | 90 const net::URLRequest& url_request, |
| 87 content::ResourceContext* resource_context) override; | 91 content::ResourceContext* resource_context) override; |
| 88 | 92 |
| 93 bool WasFetchedViaDataReductionProxy( | |
| 94 const net::HostPortPair& proxy_server, | |
| 95 content::ResourceContext* resource_context) override; | |
|
bengr
2016/02/26 22:53:57
You should probably forward declare this.
RyanSturm
2016/03/01 19:36:04
Done.
| |
| 96 | |
| 89 // Called on the UI thread. Allows switching out the | 97 // Called on the UI thread. Allows switching out the |
| 90 // ExternalProtocolHandler::Delegate for testing code. | 98 // ExternalProtocolHandler::Delegate for testing code. |
| 91 static void SetExternalProtocolHandlerDelegateForTesting( | 99 static void SetExternalProtocolHandlerDelegateForTesting( |
| 92 ExternalProtocolHandler::Delegate* delegate); | 100 ExternalProtocolHandler::Delegate* delegate); |
| 93 | 101 |
| 94 private: | 102 private: |
| 95 #if defined(ENABLE_EXTENSIONS) | 103 #if defined(ENABLE_EXTENSIONS) |
| 96 struct StreamTargetInfo { | 104 struct StreamTargetInfo { |
| 97 std::string extension_id; | 105 std::string extension_id; |
| 98 std::string view_id; | 106 std::string view_id; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 109 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_; | 117 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_; |
| 110 #if defined(ENABLE_EXTENSIONS) | 118 #if defined(ENABLE_EXTENSIONS) |
| 111 scoped_refptr<extensions::UserScriptListener> user_script_listener_; | 119 scoped_refptr<extensions::UserScriptListener> user_script_listener_; |
| 112 std::map<net::URLRequest*, StreamTargetInfo> stream_target_info_; | 120 std::map<net::URLRequest*, StreamTargetInfo> stream_target_info_; |
| 113 #endif | 121 #endif |
| 114 | 122 |
| 115 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); | 123 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); |
| 116 }; | 124 }; |
| 117 | 125 |
| 118 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_ | 126 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_ |
| OLD | NEW |