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