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_COMMON_RESOURCE_RESPONSE_H_ | 7 #ifndef CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ |
8 #define CONTENT_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/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
16 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
17 #include "webkit/glue/resource_loader_bridge.h" | 18 #include "webkit/glue/resource_loader_bridge.h" |
18 | 19 |
| 20 namespace content { |
| 21 |
19 // Parameters for a resource response header. | 22 // Parameters for a resource response header. |
20 struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { | 23 struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { |
21 // The response status. | 24 // The response status. |
22 net::URLRequestStatus status; | 25 net::URLRequestStatus status; |
23 }; | 26 }; |
24 | 27 |
25 // Parameters for a synchronous resource response. | 28 // Parameters for a synchronous resource response. |
26 struct SyncLoadResult : ResourceResponseHead { | 29 struct SyncLoadResult : ResourceResponseHead { |
27 // The final URL after any redirects. | 30 // The final URL after any redirects. |
28 GURL final_url; | 31 GURL final_url; |
29 | 32 |
30 // The response data. | 33 // The response data. |
31 std::string data; | 34 std::string data; |
32 }; | 35 }; |
33 | 36 |
34 // Simple wrapper that refcounts ResourceResponseHead. | 37 // Simple wrapper that refcounts ResourceResponseHead. |
35 struct CONTENT_EXPORT ResourceResponse | 38 struct CONTENT_EXPORT ResourceResponse |
36 : public base::RefCounted<ResourceResponse> { | 39 : public NON_EXPORTED_BASE(ResourceResponseHead), |
37 ResourceResponse(); | 40 public base::RefCounted<ResourceResponse> { |
38 | |
39 ResourceResponseHead response_head; | |
40 | 41 |
41 private: | 42 private: |
42 friend class base::RefCounted<ResourceResponse>; | 43 friend class base::RefCounted<ResourceResponse>; |
43 | 44 |
44 ~ResourceResponse(); | 45 ~ResourceResponse() {} |
45 }; | 46 }; |
46 | 47 |
47 #endif // CONTENT_COMMON_RESOURCE_RESPONSE_H_ | 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_PUBLIC_COMMON_RESOURCE_RESPONSE_H_ |
OLD | NEW |