[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // See http://dev.chromium.org/developers/design-documents/multi-process-resource-loading |
| 6 | |
| 7 | #ifndef CHROME_COMMON_RESOURCE_RESPONSE_H_ |
| 8 | #define CHROME_COMMON_RESOURCE_RESPONSE_H_ |
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 9 | #pragma once |
[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 10 | |
| 11 | #include <string> |
| 12 | |
| 13 | #include "base/ref_counted.h" |
[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 14 | #include "googleurl/src/gurl.h" |
| 15 | #include "net/url_request/url_request_status.h" |
| 16 | #include "webkit/glue/resource_loader_bridge.h" |
| 17 | |
| 18 | // Parameters for a resource response header. |
| 19 | struct ResourceResponseHead |
| 20 | : webkit_glue::ResourceLoaderBridge::ResponseInfo { |
[email protected] | 8a58f9a | 2010-05-18 18:38:09 | [diff] [blame] | 21 | ResourceResponseHead() : replace_extension_localization_templates(false) {} |
[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 22 | |
| 23 | // The response status. |
| 24 | URLRequestStatus status; |
| 25 | |
[email protected] | 8a58f9a | 2010-05-18 18:38:09 | [diff] [blame] | 26 | // Whether we should apply a filter to this resource that replaces |
| 27 | // localization templates with the appropriate localized strings. This is set |
| 28 | // for CSS resources used by extensions. |
| 29 | bool replace_extension_localization_templates; |
[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | // Parameters for a synchronous resource response. |
| 33 | struct SyncLoadResult : ResourceResponseHead { |
| 34 | // The final URL after any redirects. |
| 35 | GURL final_url; |
| 36 | |
| 37 | // The response data. |
| 38 | std::string data; |
| 39 | }; |
| 40 | |
| 41 | // Simple wrapper that refcounts ResourceResponseHead. |
| 42 | struct ResourceResponse : public base::RefCounted<ResourceResponse> { |
| 43 | ResourceResponseHead response_head; |
| 44 | |
| 45 | private: |
| 46 | friend class base::RefCounted<ResourceResponse>; |
| 47 | |
| 48 | ~ResourceResponse() {} |
| 49 | }; |
| 50 | |
| 51 | #endif // CHROME_COMMON_RESOURCE_RESPONSE_H_ |