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

Side by Side Diff: content/public/browser/resource_dispatcher_host.h

Issue 1542743002: [RDHI] Refactored blocked_loaders_map_ to key by render frame route id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix lambda return value Created 4 years, 11 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 (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 CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/download_interrupt_reasons.h" 12 #include "content/public/browser/download_interrupt_reasons.h"
13 13
14 namespace net { 14 namespace net {
15 class URLRequest; 15 class URLRequest;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 class DownloadItem; 20 class DownloadItem;
21 class ResourceContext; 21 class ResourceContext;
22 class ResourceDispatcherHostDelegate; 22 class ResourceDispatcherHostDelegate;
23 struct DownloadSaveInfo; 23 struct DownloadSaveInfo;
24 struct Referrer; 24 struct Referrer;
25 class RenderFrameHost;
25 26
26 class CONTENT_EXPORT ResourceDispatcherHost { 27 class CONTENT_EXPORT ResourceDispatcherHost {
27 public: 28 public:
28 typedef base::Callback<void(DownloadItem*, DownloadInterruptReason)> 29 typedef base::Callback<void(DownloadItem*, DownloadInterruptReason)>
29 DownloadStartedCallback; 30 DownloadStartedCallback;
30 31
31 // Returns the singleton instance of the ResourceDispatcherHost. 32 // Returns the singleton instance of the ResourceDispatcherHost.
32 static ResourceDispatcherHost* Get(); 33 static ResourceDispatcherHost* Get();
33 34
35 // Causes all new requests for the route identified by the RenderFrameHost to
nasko 2016/01/16 00:15:58 Does the "for the route identified by" bring any n
Charlie Harrison 2016/01/21 18:52:55 Simplified the comment.
36 // be blocked (not being started) until ResumeBlockedRequestsForRoute is
37 // called.
38 static void BlockRequestsForFrame(RenderFrameHost* frame_host);
39
40 // Resumes any blocked request for the specified RenderFrameHost.
41 static void ResumeBlockedRequestsForFrame(RenderFrameHost* frame_host);
42
34 // This does not take ownership of the delegate. It is expected that the 43 // This does not take ownership of the delegate. It is expected that the
35 // delegate have a longer lifetime than the ResourceDispatcherHost. 44 // delegate have a longer lifetime than the ResourceDispatcherHost.
36 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0; 45 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0;
37 46
38 // Controls whether third-party sub-content can pop-up HTTP basic auth 47 // Controls whether third-party sub-content can pop-up HTTP basic auth
39 // dialog boxes. 48 // dialog boxes.
40 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0; 49 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0;
41 50
42 // Initiates a download by explicit request of the renderer (e.g. due to 51 // Initiates a download by explicit request of the renderer (e.g. due to
43 // alt-clicking a link) or some other chrome subsystem. 52 // alt-clicking a link) or some other chrome subsystem.
(...skipping 15 matching lines...) Expand all
59 int render_frame_route_id, 68 int render_frame_route_id,
60 bool prefer_cache, 69 bool prefer_cache,
61 bool do_not_prompt_for_login, 70 bool do_not_prompt_for_login,
62 scoped_ptr<DownloadSaveInfo> save_info, 71 scoped_ptr<DownloadSaveInfo> save_info,
63 uint32_t download_id, 72 uint32_t download_id,
64 const DownloadStartedCallback& started_callback) = 0; 73 const DownloadStartedCallback& started_callback) = 0;
65 74
66 // Clears the ResourceDispatcherHostLoginDelegate associated with the request. 75 // Clears the ResourceDispatcherHostLoginDelegate associated with the request.
67 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0; 76 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0;
68 77
69 // Causes all new requests for the route identified by |child_id| and
70 // |route_id| to be blocked (not being started) until
71 // ResumeBlockedRequestsForRoute is called.
72 virtual void BlockRequestsForRoute(int child_id, int route_id) = 0;
73
74 // Resumes any blocked request for the specified route id.
75 virtual void ResumeBlockedRequestsForRoute(int child_id, int route_id) = 0;
76
77 protected: 78 protected:
78 virtual ~ResourceDispatcherHost() {} 79 virtual ~ResourceDispatcherHost() {}
79 }; 80 };
80 81
81 } // namespace content 82 } // namespace content
82 83
83 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 84 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698