blob: 368e410de9060b3328547b061c6fe4c79f8c4a28 [file] [log] [blame]
[email protected]7c927b62010-02-24 09:54:131// 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]32b76ef2010-07-26 23:08:249#pragma once
[email protected]7c927b62010-02-24 09:54:1310
11#include <string>
12
13#include "base/ref_counted.h"
[email protected]7c927b62010-02-24 09:54:1314#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.
19struct ResourceResponseHead
20 : webkit_glue::ResourceLoaderBridge::ResponseInfo {
[email protected]8a58f9a2010-05-18 18:38:0921 ResourceResponseHead() : replace_extension_localization_templates(false) {}
[email protected]7c927b62010-02-24 09:54:1322
23 // The response status.
24 URLRequestStatus status;
25
[email protected]8a58f9a2010-05-18 18:38:0926 // 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]7c927b62010-02-24 09:54:1330};
31
32// Parameters for a synchronous resource response.
33struct 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.
42struct 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_