| 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 // 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. | 7 // implemented by the embedder. |
| 8 // | 8 // |
| 9 // One of these objects will be created by WebKit for each request. WebKit | 9 // One of these objects will be created by WebKit for each request. WebKit |
| 10 // will own the pointer to the bridge, and will delete it when the request is | 10 // will own the pointer to the bridge, and will delete it when the request is |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #if defined(OS_POSIX) | 23 #if defined(OS_POSIX) |
| 24 #include "base/file_descriptor_posix.h" | 24 #include "base/file_descriptor_posix.h" |
| 25 #endif | 25 #endif |
| 26 #include "base/files/file_path.h" | 26 #include "base/files/file_path.h" |
| 27 #include "base/memory/ref_counted.h" | 27 #include "base/memory/ref_counted.h" |
| 28 #include "base/platform_file.h" | 28 #include "base/platform_file.h" |
| 29 #include "base/time.h" | 29 #include "base/time.h" |
| 30 #include "base/values.h" | 30 #include "base/values.h" |
| 31 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
| 32 #include "net/base/host_port_pair.h" | 32 #include "net/base/host_port_pair.h" |
| 33 #include "net/base/load_timing_info.h" |
| 33 #include "net/base/request_priority.h" | 34 #include "net/base/request_priority.h" |
| 34 #include "net/url_request/url_request_status.h" | 35 #include "net/url_request/url_request_status.h" |
| 35 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" | 36 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" |
| 36 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" | 37 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" |
| 37 #include "webkit/glue/resource_type.h" | 38 #include "webkit/glue/resource_type.h" |
| 38 #include "webkit/glue/webkit_glue_export.h" | 39 #include "webkit/glue/webkit_glue_export.h" |
| 39 | 40 |
| 40 namespace net { | 41 namespace net { |
| 41 class HttpResponseHeaders; | 42 class HttpResponseHeaders; |
| 42 } | 43 } |
| 43 | 44 |
| 44 namespace webkit_glue { | 45 namespace webkit_glue { |
| 45 class ResourceRequestBody; | 46 class ResourceRequestBody; |
| 46 | 47 |
| 47 // Structure containing timing information for the request. It addresses | |
| 48 // http://groups.google.com/group/http-archive-specification/web/har-1-1-spec | |
| 49 // and http://dev.w3.org/2006/webapi/WebTiming/ needs. | |
| 50 // | |
| 51 // All the values for starts and ends are given in milliseconds and are | |
| 52 // offsets with respect to the given base time. | |
| 53 struct ResourceLoadTimingInfo { | |
| 54 WEBKIT_GLUE_EXPORT ResourceLoadTimingInfo(); | |
| 55 WEBKIT_GLUE_EXPORT ~ResourceLoadTimingInfo(); | |
| 56 | |
| 57 // All the values in this struct are given as offsets in ticks wrt | |
| 58 // this base tick count. | |
| 59 base::TimeTicks base_ticks; | |
| 60 | |
| 61 // The value of Time::Now() when base_ticks was set. | |
| 62 base::Time base_time; | |
| 63 | |
| 64 // The time that proxy processing started. For requests with no proxy phase, | |
| 65 // this time is -1. | |
| 66 int32 proxy_start; | |
| 67 | |
| 68 // The time that proxy processing ended. For reused sockets this time | |
| 69 // is -1. | |
| 70 int32 proxy_end; | |
| 71 | |
| 72 // The time that DNS lookup started. For reused sockets this time is -1. | |
| 73 int32 dns_start; | |
| 74 | |
| 75 // The time that DNS lookup ended. For reused sockets this time is -1. | |
| 76 int32 dns_end; | |
| 77 | |
| 78 // The time that establishing connection started. Connect time includes | |
| 79 // DNS, blocking, TCP, TCP retries and SSL time. | |
| 80 int32 connect_start; | |
| 81 | |
| 82 // The time that establishing connection ended. Connect time includes | |
| 83 // DNS, blocking, TCP, TCP retries and SSL time. | |
| 84 int32 connect_end; | |
| 85 | |
| 86 // The time at which SSL handshake started. For non-HTTPS requests this | |
| 87 // is 0. | |
| 88 int32 ssl_start; | |
| 89 | |
| 90 // The time at which SSL handshake ended. For non-HTTPS requests this is 0. | |
| 91 int32 ssl_end; | |
| 92 | |
| 93 // The time that HTTP request started. For non-HTTP requests this is 0. | |
| 94 int32 send_start; | |
| 95 | |
| 96 // The time that HTTP request ended. For non-HTTP requests this is 0. | |
| 97 int32 send_end; | |
| 98 | |
| 99 // The time at which receiving HTTP headers started. For non-HTTP requests | |
| 100 // this is 0. | |
| 101 int32 receive_headers_start; | |
| 102 | |
| 103 // The time at which receiving HTTP headers ended. For non-HTTP requests | |
| 104 // this is 0. | |
| 105 int32 receive_headers_end; | |
| 106 }; | |
| 107 | |
| 108 struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> { | 48 struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> { |
| 109 typedef std::vector<std::pair<std::string, std::string> > | 49 typedef std::vector<std::pair<std::string, std::string> > |
| 110 HeadersVector; | 50 HeadersVector; |
| 111 | 51 |
| 112 WEBKIT_GLUE_EXPORT ResourceDevToolsInfo(); | 52 WEBKIT_GLUE_EXPORT ResourceDevToolsInfo(); |
| 113 | 53 |
| 114 int32 http_status_code; | 54 int32 http_status_code; |
| 115 std::string http_status_text; | 55 std::string http_status_text; |
| 116 HeadersVector request_headers; | 56 HeadersVector request_headers; |
| 117 HeadersVector response_headers; | 57 HeadersVector response_headers; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // no data, contains -1. | 96 // no data, contains -1. |
| 157 int64 encoded_data_length; | 97 int64 encoded_data_length; |
| 158 | 98 |
| 159 // The appcache this response was loaded from, or kNoCacheId. | 99 // The appcache this response was loaded from, or kNoCacheId. |
| 160 int64 appcache_id; | 100 int64 appcache_id; |
| 161 | 101 |
| 162 // The manifest url of the appcache this response was loaded from. | 102 // The manifest url of the appcache this response was loaded from. |
| 163 // Note: this value is only populated for main resource requests. | 103 // Note: this value is only populated for main resource requests. |
| 164 GURL appcache_manifest_url; | 104 GURL appcache_manifest_url; |
| 165 | 105 |
| 166 // Connection identifier from the underlying network stack. In case there | |
| 167 // is no associated connection, contains 0. | |
| 168 uint32 connection_id; | |
| 169 | |
| 170 // Determines whether physical connection reused. | |
| 171 bool connection_reused; | |
| 172 | |
| 173 // Detailed timing information used by the WebTiming, HAR and Developer | 106 // Detailed timing information used by the WebTiming, HAR and Developer |
| 174 // Tools. | 107 // Tools. Includes socket ID and socket reuse information. |
| 175 ResourceLoadTimingInfo load_timing; | 108 net::LoadTimingInfo load_timing; |
| 176 | 109 |
| 177 // Actual request and response headers, as obtained from the network stack. | 110 // Actual request and response headers, as obtained from the network stack. |
| 178 // Only present if request had LOAD_REPORT_RAW_HEADERS in load_flags, and | 111 // Only present if request had LOAD_REPORT_RAW_HEADERS in load_flags, and |
| 179 // requesting renderer had CanReadRowCookies permission. | 112 // requesting renderer had CanReadRowCookies permission. |
| 180 scoped_refptr<ResourceDevToolsInfo> devtools_info; | 113 scoped_refptr<ResourceDevToolsInfo> devtools_info; |
| 181 | 114 |
| 182 // The path to a file that will contain the response body. It may only | 115 // The path to a file that will contain the response body. It may only |
| 183 // contain a portion of the response body at the time that the ResponseInfo | 116 // contain a portion of the response body at the time that the ResponseInfo |
| 184 // becomes available. | 117 // becomes available. |
| 185 base::FilePath download_file_path; | 118 base::FilePath download_file_path; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // methods may be called to construct the body of the request. | 326 // methods may be called to construct the body of the request. |
| 394 WEBKIT_GLUE_EXPORT ResourceLoaderBridge(); | 327 WEBKIT_GLUE_EXPORT ResourceLoaderBridge(); |
| 395 | 328 |
| 396 private: | 329 private: |
| 397 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 330 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
| 398 }; | 331 }; |
| 399 | 332 |
| 400 } // namespace webkit_glue | 333 } // namespace webkit_glue |
| 401 | 334 |
| 402 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 335 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |