OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // The intent of this file is to provide a type-neutral abstraction between | 5 // The intent of this file is to provide a type-neutral abstraction between |
6 // Chrome and WebKit for resource loading. This pure-virtual interface is | 6 // Chrome and WebKit for resource loading. This pure-virtual interface is |
7 // implemented by the embedder, which also provides a factory method Create | 7 // implemented by the embedder, which also provides a factory method Create |
8 // to instantiate this object. | 8 // to instantiate this object. |
9 // | 9 // |
10 // One of these objects will be created by WebKit for each request. WebKit | 10 // One of these objects will be created by WebKit for each request. WebKit |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // response's mime type. This may be a derived value. | 60 // response's mime type. This may be a derived value. |
61 std::string charset; | 61 std::string charset; |
62 | 62 |
63 // An opaque string carrying security information pertaining to this | 63 // An opaque string carrying security information pertaining to this |
64 // response. This may include information about the SSL connection used. | 64 // response. This may include information about the SSL connection used. |
65 std::string security_info; | 65 std::string security_info; |
66 | 66 |
67 // Content length if available. -1 if not available | 67 // Content length if available. -1 if not available |
68 int64 content_length; | 68 int64 content_length; |
69 | 69 |
| 70 // The appcache this response was loaded from, or kNoAppCacheId. |
| 71 int64 app_cache_id; |
| 72 |
70 // A platform specific handle for a file that carries response data. This | 73 // A platform specific handle for a file that carries response data. This |
71 // entry is used if the resource request is of type ResourceType::MEDIA and | 74 // entry is used if the resource request is of type ResourceType::MEDIA and |
72 // the underlying cache layer keeps the response data in a standalone file. | 75 // the underlying cache layer keeps the response data in a standalone file. |
73 #if defined(OS_POSIX) | 76 #if defined(OS_POSIX) |
74 // If the response data file is available, the file handle is stored in | 77 // If the response data file is available, the file handle is stored in |
75 // response_data_file.fd, its value is base::kInvalidPlatformFileValue | 78 // response_data_file.fd, its value is base::kInvalidPlatformFileValue |
76 // otherwise. | 79 // otherwise. |
77 base::FileDescriptor response_data_file; | 80 base::FileDescriptor response_data_file; |
78 #elif defined(OS_WIN) | 81 #elif defined(OS_WIN) |
79 // An asynchronous file handle to the response data file, its value is | 82 // An asynchronous file handle to the response data file, its value is |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // be null if no extra request headers need to be set. | 167 // be null if no extra request headers need to be set. |
165 // | 168 // |
166 // policy_url is the URL of the document in the top-level window, which may be | 169 // policy_url is the URL of the document in the top-level window, which may be |
167 // checked by the third-party cookie blocking policy. | 170 // checked by the third-party cookie blocking policy. |
168 // | 171 // |
169 // load_flags is composed of the values defined in url_request_load_flags.h | 172 // load_flags is composed of the values defined in url_request_load_flags.h |
170 // | 173 // |
171 // request_type indicates if the current request is the main frame load, a | 174 // request_type indicates if the current request is the main frame load, a |
172 // sub-frame load, or a sub objects load. | 175 // sub-frame load, or a sub objects load. |
173 // | 176 // |
| 177 // app_cache_context_id identifies that app cache context this request is |
| 178 // associated with. |
| 179 // |
174 // routing_id passed to this function allows it to be associated with a | 180 // routing_id passed to this function allows it to be associated with a |
175 // frame's network context. | 181 // frame's network context. |
176 static ResourceLoaderBridge* Create(const std::string& method, | 182 static ResourceLoaderBridge* Create(const std::string& method, |
177 const GURL& url, | 183 const GURL& url, |
178 const GURL& policy_url, | 184 const GURL& policy_url, |
179 const GURL& referrer, | 185 const GURL& referrer, |
180 const std::string& frame_origin, | 186 const std::string& frame_origin, |
181 const std::string& main_frame_origin, | 187 const std::string& main_frame_origin, |
182 const std::string& headers, | 188 const std::string& headers, |
183 const std::string& default_mime_type, | 189 const std::string& default_mime_type, |
184 int load_flags, | 190 int load_flags, |
185 int requestor_pid, | 191 int requestor_pid, |
186 ResourceType::Type request_type, | 192 ResourceType::Type request_type, |
| 193 int app_cache_context_id, |
187 int routing_id); | 194 int routing_id); |
188 | 195 |
189 // Call this method before calling Start() to append a chunk of binary data | 196 // Call this method before calling Start() to append a chunk of binary data |
190 // to the request body. May only be used with HTTP(S) POST requests. | 197 // to the request body. May only be used with HTTP(S) POST requests. |
191 virtual void AppendDataToUpload(const char* data, int data_len) = 0; | 198 virtual void AppendDataToUpload(const char* data, int data_len) = 0; |
192 | 199 |
193 // Call this method before calling Start() to append the contents of a file | 200 // Call this method before calling Start() to append the contents of a file |
194 // to the request body. May only be used with HTTP(S) POST requests. | 201 // to the request body. May only be used with HTTP(S) POST requests. |
195 void AppendFileToUpload(const std::wstring& file_path) { | 202 void AppendFileToUpload(const std::wstring& file_path) { |
196 AppendFileRangeToUpload(file_path, 0, kuint64max); | 203 AppendFileRangeToUpload(file_path, 0, kuint64max); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // construction must go through Create() | 240 // construction must go through Create() |
234 ResourceLoaderBridge(); | 241 ResourceLoaderBridge(); |
235 | 242 |
236 private: | 243 private: |
237 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); | 244 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); |
238 }; | 245 }; |
239 | 246 |
240 } // namespace webkit_glue | 247 } // namespace webkit_glue |
241 | 248 |
242 #endif // RESOURCE_LOADER_BRIDGE_ | 249 #endif // RESOURCE_LOADER_BRIDGE_ |
OLD | NEW |