| 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 |
| 11 // will own the pointer to the bridge, and will delete it when the request is | 11 // will own the pointer to the bridge, and will delete it when the request is |
| 12 // no longer needed. | 12 // no longer needed. |
| 13 // | 13 // |
| 14 // In turn, the bridge's owner on the WebKit end will implement the Peer | 14 // In turn, the bridge's owner on the WebKit end will implement the Peer |
| 15 // interface, which we will use to communicate notifications back. | 15 // interface, which we will use to communicate notifications back. |
| 16 | 16 |
| 17 #ifndef WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 17 #ifndef WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| 18 #define WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 18 #define WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| 19 | 19 |
| 20 #include <utility> |
| 21 #include <vector> |
| 22 |
| 20 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 21 #if defined(OS_POSIX) | 24 #if defined(OS_POSIX) |
| 22 #include "base/file_descriptor_posix.h" | 25 #include "base/file_descriptor_posix.h" |
| 23 #endif | 26 #endif |
| 24 #include "base/file_path.h" | 27 #include "base/file_path.h" |
| 25 #include "base/platform_file.h" | 28 #include "base/platform_file.h" |
| 26 #include "base/ref_counted.h" | 29 #include "base/ref_counted.h" |
| 30 #include "base/scoped_ptr.h" |
| 27 #include "base/time.h" | 31 #include "base/time.h" |
| 32 #include "base/values.h" |
| 28 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 29 #include "net/url_request/url_request_status.h" | 34 #include "net/url_request/url_request_status.h" |
| 30 #include "webkit/glue/resource_type.h" | 35 #include "webkit/glue/resource_type.h" |
| 31 | 36 |
| 32 namespace net { | 37 namespace net { |
| 33 class HttpResponseHeaders; | 38 class HttpResponseHeaders; |
| 34 } | 39 } |
| 35 | 40 |
| 36 namespace webkit_glue { | 41 namespace webkit_glue { |
| 37 | 42 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 145 |
| 141 // The time at which receiving HTTP headers started. For non-HTTP requests | 146 // The time at which receiving HTTP headers started. For non-HTTP requests |
| 142 // this is 0. | 147 // this is 0. |
| 143 int32 receive_headers_start; | 148 int32 receive_headers_start; |
| 144 | 149 |
| 145 // The time at which receiving HTTP headers ended. For non-HTTP requests | 150 // The time at which receiving HTTP headers ended. For non-HTTP requests |
| 146 // this is 0. | 151 // this is 0. |
| 147 int32 receive_headers_end; | 152 int32 receive_headers_end; |
| 148 }; | 153 }; |
| 149 | 154 |
| 155 struct DevToolsInfo : base::RefCounted<DevToolsInfo> { |
| 156 typedef std::vector<std::pair<std::string, std::string> > |
| 157 HeadersVector; |
| 158 HeadersVector request_headers; |
| 159 HeadersVector response_headers; |
| 160 }; |
| 161 |
| 150 struct ResponseInfo { | 162 struct ResponseInfo { |
| 151 ResponseInfo(); | 163 ResponseInfo(); |
| 152 ~ResponseInfo(); | 164 ~ResponseInfo(); |
| 153 | 165 |
| 154 // The time at which the request was made that resulted in this response. | 166 // The time at which the request was made that resulted in this response. |
| 155 // For cached responses, this time could be "far" in the past. | 167 // For cached responses, this time could be "far" in the past. |
| 156 base::Time request_time; | 168 base::Time request_time; |
| 157 | 169 |
| 158 // The time at which the response headers were received. For cached | 170 // The time at which the response headers were received. For cached |
| 159 // responses, this time could be "far" in the past. | 171 // responses, this time could be "far" in the past. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 187 // is no associated connection, contains 0. | 199 // is no associated connection, contains 0. |
| 188 uint32 connection_id; | 200 uint32 connection_id; |
| 189 | 201 |
| 190 // Determines whether physical connection reused. | 202 // Determines whether physical connection reused. |
| 191 bool connection_reused; | 203 bool connection_reused; |
| 192 | 204 |
| 193 // Detailed timing information used by the WebTiming, HAR and Developer | 205 // Detailed timing information used by the WebTiming, HAR and Developer |
| 194 // Tools. | 206 // Tools. |
| 195 LoadTimingInfo load_timing; | 207 LoadTimingInfo load_timing; |
| 196 | 208 |
| 209 // Actual request and response headers, as obtained from the network stack. |
| 210 // Only present if request had LOAD_REPORT_RAW_HEADERS in load_flags, and |
| 211 // requesting renderer had CanReadRowCookies permission. |
| 212 scoped_refptr<DevToolsInfo> devtools_info; |
| 213 |
| 197 // The path to a file that will contain the response body. It may only | 214 // The path to a file that will contain the response body. It may only |
| 198 // contain a portion of the response body at the time that the ResponseInfo | 215 // contain a portion of the response body at the time that the ResponseInfo |
| 199 // becomes available. | 216 // becomes available. |
| 200 FilePath download_file_path; | 217 FilePath download_file_path; |
| 201 | 218 |
| 202 // True if the response was delivered using SPDY. | 219 // True if the response was delivered using SPDY. |
| 203 bool was_fetched_via_spdy; | 220 bool was_fetched_via_spdy; |
| 204 | 221 |
| 205 // True if the response was delivered after NPN is negotiated. | 222 // True if the response was delivered after NPN is negotiated. |
| 206 bool was_npn_negotiated; | 223 bool was_npn_negotiated; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // construction must go through Create() | 372 // construction must go through Create() |
| 356 ResourceLoaderBridge(); | 373 ResourceLoaderBridge(); |
| 357 | 374 |
| 358 private: | 375 private: |
| 359 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 376 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
| 360 }; | 377 }; |
| 361 | 378 |
| 362 } // namespace webkit_glue | 379 } // namespace webkit_glue |
| 363 | 380 |
| 364 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 381 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |