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" |
11 #include "base/files/file_path.h" | |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "content/public/common/resource_type.h" | 14 #include "content/public/common/resource_type.h" |
14 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
15 | 16 |
16 class GURL; | 17 class GURL; |
17 template <class T> class ScopedVector; | 18 template <class T> class ScopedVector; |
18 | 19 |
19 namespace IPC { | 20 namespace IPC { |
20 class Sender; | 21 class Sender; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 // resource. | 90 // resource. |
90 // If true is returned, a new Stream will be created and OnStreamCreated() | 91 // If true is returned, a new Stream will be created and OnStreamCreated() |
91 // will be called with | 92 // will be called with |
92 // - a StreamHandle instance for the Stream. The handle contains the URL for | 93 // - a StreamHandle instance for the Stream. The handle contains the URL for |
93 // reading the Stream etc. | 94 // reading the Stream etc. |
94 // The Stream's origin will be set to |origin|. | 95 // The Stream's origin will be set to |origin|. |
95 // | 96 // |
96 // If the stream will be rendered in a BrowserPlugin, |payload| will contain | 97 // If the stream will be rendered in a BrowserPlugin, |payload| will contain |
97 // the data that should be given to the old ResourceHandler to forward to the | 98 // the data that should be given to the old ResourceHandler to forward to the |
98 // renderer process. | 99 // renderer process. |
99 virtual bool ShouldInterceptResourceAsStream(net::URLRequest* request, | 100 virtual bool ShouldInterceptResourceAsStream( |
100 const std::string& mime_type, | 101 net::URLRequest* request, |
101 GURL* origin, | 102 const base::FilePath& plugin_path, |
Sam McNally
2015/07/03 06:21:31
Please document |plugin_path|.
raymes
2015/07/06 02:30:04
Done.
| |
102 std::string* payload); | 103 const std::string& mime_type, |
104 GURL* origin, | |
105 std::string* payload); | |
103 | 106 |
104 // Informs the delegate that a Stream was created. The Stream can be read from | 107 // Informs the delegate that a Stream was created. The Stream can be read from |
105 // the blob URL of the Stream, but can only be read once. | 108 // the blob URL of the Stream, but can only be read once. |
106 virtual void OnStreamCreated(net::URLRequest* request, | 109 virtual void OnStreamCreated(net::URLRequest* request, |
107 scoped_ptr<content::StreamInfo> stream); | 110 scoped_ptr<content::StreamInfo> stream); |
108 | 111 |
109 // Informs the delegate that a response has started. | 112 // Informs the delegate that a response has started. |
110 virtual void OnResponseStarted(net::URLRequest* request, | 113 virtual void OnResponseStarted(net::URLRequest* request, |
111 ResourceContext* resource_context, | 114 ResourceContext* resource_context, |
112 ResourceResponse* response, | 115 ResourceResponse* response, |
113 IPC::Sender* sender); | 116 IPC::Sender* sender); |
114 | 117 |
115 // Informs the delegate that a request has been redirected. | 118 // Informs the delegate that a request has been redirected. |
116 virtual void OnRequestRedirected(const GURL& redirect_url, | 119 virtual void OnRequestRedirected(const GURL& redirect_url, |
117 net::URLRequest* request, | 120 net::URLRequest* request, |
118 ResourceContext* resource_context, | 121 ResourceContext* resource_context, |
119 ResourceResponse* response); | 122 ResourceResponse* response); |
120 | 123 |
121 // Notification that a request has completed. | 124 // Notification that a request has completed. |
122 virtual void RequestComplete(net::URLRequest* url_request); | 125 virtual void RequestComplete(net::URLRequest* url_request); |
123 | 126 |
124 protected: | 127 protected: |
125 ResourceDispatcherHostDelegate(); | 128 ResourceDispatcherHostDelegate(); |
126 virtual ~ResourceDispatcherHostDelegate(); | 129 virtual ~ResourceDispatcherHostDelegate(); |
127 }; | 130 }; |
128 | 131 |
129 } // namespace content | 132 } // namespace content |
130 | 133 |
131 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 134 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
OLD | NEW |