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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h

Issue 7660007: Factor out dependncy on download throttling from core download code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
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"
11 #include "content/browser/renderer_host/resource_dispatcher_host_delegate.h" 11 #include "content/browser/renderer_host/resource_dispatcher_host_delegate.h"
12 12
13 class DownloadRequestLimiter;
13 class ResourceDispatcherHost; 14 class ResourceDispatcherHost;
14 class SafeBrowsingService; 15 class SafeBrowsingService;
15 16
16 namespace prerender { 17 namespace prerender {
17 class PrerenderTracker; 18 class PrerenderTracker;
18 } 19 }
19 20
20 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender 21 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender
21 // system to abort requests and add to the load flags when a request begins. 22 // system to abort requests and add to the load flags when a request begins.
22 class ChromeResourceDispatcherHostDelegate 23 class ChromeResourceDispatcherHostDelegate
(...skipping 17 matching lines...) Expand all
40 virtual ResourceHandler* RequestBeginning( 41 virtual ResourceHandler* RequestBeginning(
41 ResourceHandler* handler, 42 ResourceHandler* handler,
42 net::URLRequest* request, 43 net::URLRequest* request,
43 const content::ResourceContext& resource_context, 44 const content::ResourceContext& resource_context,
44 bool is_subresource, 45 bool is_subresource,
45 int child_id, 46 int child_id,
46 int route_id) OVERRIDE; 47 int route_id) OVERRIDE;
47 virtual ResourceHandler* DownloadStarting( 48 virtual ResourceHandler* DownloadStarting(
48 ResourceHandler* handler, 49 ResourceHandler* handler,
49 const content::ResourceContext& resource_context, 50 const content::ResourceContext& resource_context,
51 net::URLRequest* request,
50 int child_id, 52 int child_id,
51 int route_id) OVERRIDE; 53 int route_id,
54 int request_id,
55 bool is_new_request,
56 bool in_complete) OVERRIDE;
52 virtual bool ShouldDeferStart( 57 virtual bool ShouldDeferStart(
53 net::URLRequest* request, 58 net::URLRequest* request,
54 const content::ResourceContext& resource_context) OVERRIDE; 59 const content::ResourceContext& resource_context) OVERRIDE;
55 virtual bool AcceptSSLClientCertificateRequest( 60 virtual bool AcceptSSLClientCertificateRequest(
56 net::URLRequest* request, 61 net::URLRequest* request,
57 net::SSLCertRequestInfo* cert_request_info) OVERRIDE; 62 net::SSLCertRequestInfo* cert_request_info) OVERRIDE;
58 virtual bool AcceptAuthRequest(net::URLRequest* request, 63 virtual bool AcceptAuthRequest(net::URLRequest* request,
59 net::AuthChallengeInfo* auth_info) OVERRIDE; 64 net::AuthChallengeInfo* auth_info) OVERRIDE;
60 virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( 65 virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
61 net::AuthChallengeInfo* auth_info, net::URLRequest* request) OVERRIDE; 66 net::AuthChallengeInfo* auth_info, net::URLRequest* request) OVERRIDE;
62 virtual void HandleExternalProtocol(const GURL& url, 67 virtual void HandleExternalProtocol(const GURL& url,
63 int child_id, 68 int child_id,
64 int route_id) OVERRIDE; 69 int route_id) OVERRIDE;
65 virtual bool ShouldForceDownloadResource( 70 virtual bool ShouldForceDownloadResource(
66 const GURL& url, const std::string& mime_type) OVERRIDE; 71 const GURL& url, const std::string& mime_type) OVERRIDE;
67 virtual void OnResponseStarted( 72 virtual void OnResponseStarted(
68 net::URLRequest* request, 73 net::URLRequest* request,
69 ResourceResponse* response, 74 ResourceResponse* response,
70 ResourceMessageFilter* filter) OVERRIDE; 75 ResourceMessageFilter* filter) OVERRIDE;
71 virtual void OnRequestRedirected( 76 virtual void OnRequestRedirected(
72 net::URLRequest* request, 77 net::URLRequest* request,
73 ResourceResponse* response, 78 ResourceResponse* response,
74 ResourceMessageFilter* filter) OVERRIDE; 79 ResourceMessageFilter* filter) OVERRIDE;
75 80
76 private: 81 private:
77 ResourceHandler* CreateSafeBrowsingResourceHandler( 82 ResourceHandler* CreateSafeBrowsingResourceHandler(
78 ResourceHandler* handler, int child_id, int route_id, bool subresource); 83 ResourceHandler* handler, int child_id, int route_id, bool subresource);
79 84
80 ResourceDispatcherHost* resource_dispatcher_host_; 85 ResourceDispatcherHost* resource_dispatcher_host_;
86 scoped_refptr<DownloadRequestLimiter> download_request_limiter_;
81 scoped_refptr<SafeBrowsingService> safe_browsing_; 87 scoped_refptr<SafeBrowsingService> safe_browsing_;
82 prerender::PrerenderTracker* prerender_tracker_; 88 prerender::PrerenderTracker* prerender_tracker_;
83 89
84 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); 90 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate);
85 }; 91 };
86 92
87 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_ 93 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698