OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #ifndef CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ | 7 #ifndef CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ |
8 #define CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ | 8 #define CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
18 #include "webkit/glue/resource_loader_bridge.h" | 18 #include "webkit/glue/resource_loader_bridge.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 // Parameters for a resource response header. | 22 // Parameters for a resource response header. |
23 struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { | 23 struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { |
24 // The response status. | 24 // The response status. |
25 net::URLRequestStatus status; | 25 net::URLRequestStatus status; |
| 26 // TimeTicks::Now() when the browser received the request from the renderer. |
| 27 base::TimeTicks request_start; |
| 28 // TimeTicks::Now() when the browser sent the response to the renderer. |
| 29 base::TimeTicks response_start; |
26 }; | 30 }; |
27 | 31 |
28 // Parameters for a synchronous resource response. | 32 // Parameters for a synchronous resource response. |
29 struct SyncLoadResult : ResourceResponseHead { | 33 struct SyncLoadResult : ResourceResponseHead { |
30 // The final URL after any redirects. | 34 // The final URL after any redirects. |
31 GURL final_url; | 35 GURL final_url; |
32 | 36 |
33 // The response data. | 37 // The response data. |
34 std::string data; | 38 std::string data; |
35 }; | 39 }; |
36 | 40 |
37 // Simple wrapper that refcounts ResourceResponseHead. | 41 // Simple wrapper that refcounts ResourceResponseHead. |
38 struct CONTENT_EXPORT ResourceResponse | 42 struct CONTENT_EXPORT ResourceResponse |
39 : public NON_EXPORTED_BASE(ResourceResponseHead), | 43 : public NON_EXPORTED_BASE(ResourceResponseHead), |
40 public base::RefCounted<ResourceResponse> { | 44 public base::RefCounted<ResourceResponse> { |
41 | 45 |
42 private: | 46 private: |
43 friend class base::RefCounted<ResourceResponse>; | 47 friend class base::RefCounted<ResourceResponse>; |
44 | 48 |
45 ~ResourceResponse() {} | 49 ~ResourceResponse() {} |
46 }; | 50 }; |
47 | 51 |
48 } // namespace content | 52 } // namespace content |
49 | 53 |
50 #endif // CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ | 54 #endif // CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ |
OLD | NEW |