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 CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 // guarantee that the app successfully handled it. | 100 // guarantee that the app successfully handled it. |
101 virtual bool HandleExternalProtocol(const GURL& url, | 101 virtual bool HandleExternalProtocol(const GURL& url, |
102 int child_id, | 102 int child_id, |
103 int route_id); | 103 int route_id); |
104 | 104 |
105 // Returns true if we should force the given resource to be downloaded. | 105 // Returns true if we should force the given resource to be downloaded. |
106 // Otherwise, the content layer decides. | 106 // Otherwise, the content layer decides. |
107 virtual bool ShouldForceDownloadResource( | 107 virtual bool ShouldForceDownloadResource( |
108 const GURL& url, const std::string& mime_type); | 108 const GURL& url, const std::string& mime_type); |
109 | 109 |
110 // Returns true and sets |security_origin| and |target_id| if a Stream should | |
111 // be created for the resource. | |
darin (slow to review)
2013/03/16 17:23:51
please document the fact that OnStreamCreated will
Zachary Kuznia
2013/03/17 01:30:33
I expanded these comments to explain this behavior
| |
112 virtual bool ShouldInterceptResourceAsStream( | |
113 content::ResourceContext* resource_context, | |
114 const GURL& url, | |
115 const std::string& mime_type, | |
116 GURL* security_origin, | |
117 std::string* target_id); | |
118 | |
119 // Informs the delegate that a stream was created. | |
120 virtual void OnStreamCreated( | |
121 content::ResourceContext* resource_context, | |
122 int render_process_id, | |
123 int render_view_id, | |
124 const std::string& target_id, | |
125 const GURL& stream_url, | |
126 const std::string& mime_type, | |
127 const GURL& original_url); | |
128 | |
110 // Informs the delegate that a response has started. | 129 // Informs the delegate that a response has started. |
111 virtual void OnResponseStarted( | 130 virtual void OnResponseStarted( |
112 net::URLRequest* request, | 131 net::URLRequest* request, |
113 ResourceContext* resource_context, | 132 ResourceContext* resource_context, |
114 ResourceResponse* response, | 133 ResourceResponse* response, |
115 IPC::Sender* sender); | 134 IPC::Sender* sender); |
116 | 135 |
117 // Informs the delegate that a request has been redirected. | 136 // Informs the delegate that a request has been redirected. |
118 virtual void OnRequestRedirected( | 137 virtual void OnRequestRedirected( |
119 const GURL& redirect_url, | 138 const GURL& redirect_url, |
120 net::URLRequest* request, | 139 net::URLRequest* request, |
121 ResourceContext* resource_context, | 140 ResourceContext* resource_context, |
122 ResourceResponse* response); | 141 ResourceResponse* response); |
123 | 142 |
124 protected: | 143 protected: |
125 ResourceDispatcherHostDelegate(); | 144 ResourceDispatcherHostDelegate(); |
126 virtual ~ResourceDispatcherHostDelegate(); | 145 virtual ~ResourceDispatcherHostDelegate(); |
127 }; | 146 }; |
128 | 147 |
129 } // namespace content | 148 } // namespace content |
130 | 149 |
131 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 150 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
OLD | NEW |