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