summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 00:46:33 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-19 00:46:33 +0000
commit46b0d4aacbf25108badc143e09f91064fc0b0472 (patch)
treed1ec74ba60c5c7ae6fd683ad7b685095434e6f03
parent08ae5f310a475f73807df520fa0b50cf7138c4f5 (diff)
downloadchromium_src-46b0d4aacbf25108badc143e09f91064fc0b0472.zip
chromium_src-46b0d4aacbf25108badc143e09f91064fc0b0472.tar.gz
chromium_src-46b0d4aacbf25108badc143e09f91064fc0b0472.tar.bz2
Add a CreateBridge method to the ChildThread.
The intent is to allow unit-tests that use render view to override ChildThread::CreateBridge() to provide their own resource loading. This is used by the upcoming translate unit-test. BUG=None TEST=None Review URL: http://codereview.chromium.org/503032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35014 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/child_thread.cc9
-rw-r--r--chrome/common/child_thread.h7
-rw-r--r--chrome/common/resource_dispatcher.cc82
-rw-r--r--chrome/common/resource_dispatcher.h19
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc20
-rw-r--r--chrome/plugin/chrome_plugin_host.cc29
-rw-r--r--chrome/renderer/renderer_glue.cc19
-rw-r--r--webkit/glue/media/media_resource_loader_bridge_factory.cc28
-rw-r--r--webkit/glue/resource_loader_bridge.cc12
-rw-r--r--webkit/glue/resource_loader_bridge.h88
-rw-r--r--webkit/glue/unittest_test_server.h27
-rw-r--r--webkit/glue/weburlloader_impl.cc28
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc45
13 files changed, 193 insertions, 220 deletions
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc
index cb145ae..e973554 100644
--- a/chrome/common/child_thread.cc
+++ b/chrome/common/child_thread.cc
@@ -95,6 +95,15 @@ void ChildThread::RemoveRoute(int32 routing_id) {
router_.RemoveRoute(routing_id);
}
+webkit_glue::ResourceLoaderBridge* ChildThread::CreateBridge(
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
+ int host_renderer_id,
+ int host_render_view_id) {
+ return resource_dispatcher()->
+ CreateBridge(request_info, host_renderer_id, host_render_view_id);
+}
+
+
void ChildThread::OnMessageReceived(const IPC::Message& msg) {
// Resource responses are sent to the resource dispatcher.
if (resource_dispatcher_->OnMessageReceived(msg))
diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h
index 63464fe..c731b45 100644
--- a/chrome/common/child_thread.h
+++ b/chrome/common/child_thread.h
@@ -32,6 +32,13 @@ class ChildThread : public IPC::Channel::Listener,
void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
void RemoveRoute(int32 routing_id);
+ // Creates a ResourceLoaderBridge.
+ // Tests can override this method if they want a custom loading behavior.
+ virtual webkit_glue::ResourceLoaderBridge* CreateBridge(
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
+ int host_renderer_id,
+ int host_render_view_id);
+
ResourceDispatcher* resource_dispatcher() {
return resource_dispatcher_.get();
}
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 5639f77..8eb74a5 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -44,21 +44,9 @@ namespace webkit_glue {
class IPCResourceLoaderBridge : public ResourceLoaderBridge {
public:
IPCResourceLoaderBridge(ResourceDispatcher* dispatcher,
- const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int origin_pid,
- ResourceType::Type resource_type,
- uint32 request_context,
- int appcache_host_id,
- int routing_id,
- int host_renderer_id,
- int host_render_view_id);
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
+ int host_renderer_id,
+ int host_render_view_id);
virtual ~IPCResourceLoaderBridge();
// ResourceLoaderBridge
@@ -109,40 +97,28 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
IPCResourceLoaderBridge::IPCResourceLoaderBridge(
ResourceDispatcher* dispatcher,
- const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int origin_child_id,
- ResourceType::Type resource_type,
- uint32 request_context,
- int appcache_host_id,
- int routing_id,
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
int host_renderer_id,
int host_render_view_id)
: peer_(NULL),
dispatcher_(dispatcher),
request_id_(-1),
- routing_id_(routing_id),
+ routing_id_(request_info.routing_id),
host_renderer_id_(host_renderer_id),
host_render_view_id_(host_render_view_id) {
DCHECK(dispatcher_) << "no resource dispatcher";
- request_.method = method;
- request_.url = url;
- request_.first_party_for_cookies = first_party_for_cookies;
- request_.referrer = referrer;
- request_.frame_origin = frame_origin;
- request_.main_frame_origin = main_frame_origin;
- request_.headers = headers;
- request_.load_flags = load_flags;
- request_.origin_child_id = origin_child_id;
- request_.resource_type = resource_type;
- request_.request_context = request_context;
- request_.appcache_host_id = appcache_host_id;
+ request_.method = request_info.method;
+ request_.url = request_info.url;
+ request_.first_party_for_cookies = request_info.first_party_for_cookies;
+ request_.referrer = request_info.referrer;
+ request_.frame_origin = request_info.frame_origin;
+ request_.main_frame_origin = request_info.main_frame_origin;
+ request_.headers = request_info.headers;
+ request_.load_flags = request_info.load_flags;
+ request_.origin_child_id = request_info.requestor_pid;
+ request_.resource_type = request_info.request_type;
+ request_.request_context = request_info.request_context;
+ request_.appcache_host_id = request_info.appcache_host_id;
request_.host_renderer_id = host_renderer_id_;
request_.host_render_view_id = host_render_view_id_;
@@ -577,30 +553,10 @@ void ResourceDispatcher::FlushDeferredMessages(int request_id) {
}
webkit_glue::ResourceLoaderBridge* ResourceDispatcher::CreateBridge(
- const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int flags,
- int origin_pid,
- ResourceType::Type resource_type,
- uint32 request_context,
- int appcache_host_id,
- int route_id,
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
int host_renderer_id,
int host_render_view_id) {
- return new webkit_glue::IPCResourceLoaderBridge(this, method, url,
- first_party_for_cookies,
- referrer, frame_origin,
- main_frame_origin, headers,
- flags, origin_pid,
- resource_type,
- request_context,
- appcache_host_id,
- route_id,
+ return new webkit_glue::IPCResourceLoaderBridge(this, request_info,
host_renderer_id,
host_render_view_id);
}
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 7a93024..1d3f25a 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -34,21 +34,10 @@ class ResourceDispatcher {
// Creates a ResourceLoaderBridge for this type of dispatcher, this is so
// this can be tested regardless of the ResourceLoaderBridge::Create
// implementation.
- webkit_glue::ResourceLoaderBridge* CreateBridge(const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int origin_pid,
- ResourceType::Type resource_type,
- uint32 request_context /* used for plugin->browser requests */,
- int appcache_host_id,
- int routing_id,
- int host_renderer_id,
- int host_render_view_id);
+ webkit_glue::ResourceLoaderBridge* CreateBridge(
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info,
+ int host_renderer_id,
+ int host_render_view_id);
// Adds a request from the pending_requests_ list, returning the new
// requests' ID
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index 67b9351..bf2ec19 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -148,11 +148,21 @@ class ResourceDispatcherTest : public testing::Test,
}
ResourceLoaderBridge* CreateBridge() {
- ResourceLoaderBridge* bridge = dispatcher_->CreateBridge(
- "GET", GURL(test_page_url), GURL(test_page_url), GURL(), "null",
- "null", std::string(), 0, 0, ResourceType::SUB_RESOURCE, 0,
- appcache::kNoHostId, MSG_ROUTING_CONTROL, -1, -1);
- return bridge;
+ webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ request_info.method = "GET";
+ request_info.url = GURL(test_page_url);
+ request_info.first_party_for_cookies = GURL(test_page_url);
+ request_info.referrer = GURL();
+ request_info.frame_origin = "null";
+ request_info.main_frame_origin = "null";
+ request_info.headers = std::string();
+ request_info.load_flags = 0;
+ request_info.requestor_pid = 0;
+ request_info.request_type = ResourceType::SUB_RESOURCE;
+ request_info.appcache_host_id = 0;
+ request_info.routing_id = appcache::kNoHostId;
+
+ return dispatcher_->CreateBridge(request_info, -1, -1);
}
std::vector<IPC::Message> message_queue_;
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 4e3a8cb..ab459f4 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -151,21 +151,24 @@ class PluginRequestHandlerProxy
}
CPError Start(int renderer_id, int render_view_id) {
+ webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ request_info.method = cprequest_->method;
+ request_info.url = GURL(cprequest_->url);
+ request_info.first_party_for_cookies =
+ GURL(cprequest_->url); // TODO(jackson): policy url?
+ request_info.referrer = GURL(); // TODO(mpcomplete): referrer?
+ request_info.frame_origin = "null";
+ request_info.main_frame_origin = "null";
+ request_info.headers = extra_headers_;
+ request_info.load_flags = load_flags_;
+ request_info.requestor_pid = base::GetCurrentProcId();
+ request_info.request_type = ResourceType::OBJECT;
+ request_info.request_context = cprequest_->context;
+ request_info.appcache_host_id = appcache::kNoHostId;
+ request_info.routing_id = MSG_ROUTING_CONTROL;
bridge_.reset(
PluginThread::current()->resource_dispatcher()->CreateBridge(
- cprequest_->method,
- GURL(cprequest_->url),
- GURL(cprequest_->url), // TODO(jackson): policy url?
- GURL(), // TODO(mpcomplete): referrer?
- "null", // frame_origin
- "null", // main_frame_origin
- extra_headers_,
- load_flags_,
- base::GetCurrentProcId(),
- ResourceType::OBJECT,
- cprequest_->context,
- appcache::kNoHostId,
- MSG_ROUTING_CONTROL,
+ request_info,
renderer_id,
render_view_id));
if (!bridge_.get())
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index 012a249..1f306db 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -218,23 +218,8 @@ bool IsProtocolSupportedForMedia(const GURL& url) {
// static factory function
ResourceLoaderBridge* ResourceLoaderBridge::Create(
- const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int origin_pid,
- ResourceType::Type resource_type,
- int appcache_host_id,
- int routing_id) {
- ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher();
- return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer,
- frame_origin, main_frame_origin, headers,
- load_flags, origin_pid, resource_type, 0,
- appcache_host_id, routing_id, -1 , -1);
+ const ResourceLoaderBridge::RequestInfo& request_info) {
+ return ChildThread::current()->CreateBridge(request_info, -1, -1);
}
// static factory function
diff --git a/webkit/glue/media/media_resource_loader_bridge_factory.cc b/webkit/glue/media/media_resource_loader_bridge_factory.cc
index 0c3d6ab..1961bcc 100644
--- a/webkit/glue/media/media_resource_loader_bridge_factory.cc
+++ b/webkit/glue/media/media_resource_loader_bridge_factory.cc
@@ -36,19 +36,21 @@ ResourceLoaderBridge* MediaResourceLoaderBridgeFactory::CreateBridge(
int load_flags,
int64 first_byte_position,
int64 last_byte_position) {
- return webkit_glue::ResourceLoaderBridge::Create(
- "GET",
- url,
- url,
- referrer_,
- frame_origin_,
- main_frame_origin_,
- GenerateHeaders(first_byte_position, last_byte_position),
- load_flags,
- origin_pid_,
- ResourceType::MEDIA,
- appcache_host_id_,
- routing_id_);
+ webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ request_info.method = "GET";
+ request_info.url = url;
+ request_info.first_party_for_cookies = url;
+ request_info.referrer = referrer_;
+ request_info.frame_origin = frame_origin_;
+ request_info.main_frame_origin = main_frame_origin_;
+ request_info.headers = GenerateHeaders(first_byte_position,
+ last_byte_position);
+ request_info.load_flags = load_flags;
+ request_info.requestor_pid = origin_pid_;
+ request_info.request_type = ResourceType::MEDIA;
+ request_info.appcache_host_id = appcache_host_id_;
+ request_info.routing_id = routing_id_;
+ return webkit_glue::ResourceLoaderBridge::Create(request_info);
}
// static
diff --git a/webkit/glue/resource_loader_bridge.cc b/webkit/glue/resource_loader_bridge.cc
index fd8eee3..8b22508 100644
--- a/webkit/glue/resource_loader_bridge.cc
+++ b/webkit/glue/resource_loader_bridge.cc
@@ -9,6 +9,18 @@
namespace webkit_glue {
+ResourceLoaderBridge::RequestInfo::RequestInfo()
+ : load_flags(0),
+ requestor_pid(0),
+ request_type(ResourceType::MAIN_FRAME),
+ request_context(0),
+ appcache_host_id(0),
+ routing_id(0) {
+}
+
+ResourceLoaderBridge::RequestInfo::~RequestInfo() {
+}
+
ResourceLoaderBridge::ResponseInfo::ResponseInfo() {
content_length = -1;
appcache_id = appcache::kNoCacheId;
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index aac2331..95ed6ac 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -38,6 +38,54 @@ namespace webkit_glue {
class ResourceLoaderBridge {
public:
+ // Structure used when calling ResourceLoaderBridge::Create().
+ struct RequestInfo {
+ RequestInfo();
+ ~RequestInfo();
+
+ // HTTP-style method name (e.g., "GET" or "POST").
+ std::string method;
+
+ // Absolute URL encoded in ASCII per the rules of RFC-2396.
+ GURL url;
+
+ // URL of the document in the top-level window, which may be checked by the
+ // third-party cookie blocking policy.
+ GURL first_party_for_cookies;
+
+ // Optional parameter, a URL with similar constraints in how it must be
+ // encoded as the url member.
+ GURL referrer;
+
+ std::string frame_origin;
+ std::string main_frame_origin;
+
+ // For HTTP(S) requests, the headers parameter can be a \r\n-delimited and
+ // \r\n-terminated list of MIME headers. They should be ASCII-encoded using
+ // the standard MIME header encoding rules. The headers parameter can also
+ // be null if no extra request headers need to be set.
+ std::string headers;
+
+ // Composed of the values defined in url_request_load_flags.h.
+ int load_flags;
+
+ // Process id of the process making the request.
+ int requestor_pid;
+
+ // Indicates if the current request is the main frame load, a sub-frame
+ // load, or a sub objects load.
+ ResourceType::Type request_type;
+
+ // Used for plugin to browser requests.
+ uint32 request_context;
+
+ // Identifies that appcache host this request is associated with.
+ int appcache_host_id;
+
+ // Used to associated the bridge with a frame's network context.
+ int routing_id;
+ };
+
struct ResponseInfo {
ResponseInfo();
~ResponseInfo();
@@ -144,45 +192,11 @@ class ResourceLoaderBridge {
// INCLUDING during processing of callbacks.
virtual ~ResourceLoaderBridge();
- // Call this method to make a new instance. The method name is a HTTP-style
- // method name (e.g., "GET" or "POST"). The URL should be an absolute URL
- // encoded in ASCII per the rules of RFC-2396. The referrer parameter is
- // optional (may be NULL) and is a URL with similar constraints in how it
- // must be encoded.
+ // Call this method to make a new instance.
//
// For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload
// methods may be called to construct the body of the request.
- //
- // For HTTP(S) requests, the headers parameter can be a \r\n-delimited and
- // \r\n-terminated list of MIME headers. They should be ASCII-encoded using
- // the standard MIME header encoding rules. The headers parameter can also
- // be null if no extra request headers need to be set.
- //
- // first_party_for_cookies is the URL of the document in the top-level
- // window, which may be checked by the third-party cookie blocking policy.
- //
- // load_flags is composed of the values defined in url_request_load_flags.h
- //
- // request_type indicates if the current request is the main frame load, a
- // sub-frame load, or a sub objects load.
- //
- // appcache_host_id identifies that appcache host this request is
- // associated with.
- //
- // routing_id passed to this function allows it to be associated with a
- // frame's network context.
- static ResourceLoaderBridge* Create(const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int requestor_pid,
- ResourceType::Type request_type,
- int appcache_host_id,
- int routing_id);
+ static ResourceLoaderBridge* Create(const RequestInfo& request_info);
// Call this method before calling Start() to append a chunk of binary data
// to the request body. May only be used with HTTP(S) POST requests.
@@ -232,7 +246,7 @@ class ResourceLoaderBridge {
ResourceLoaderBridge();
private:
- DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge);
+ DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge);
};
} // namespace webkit_glue
diff --git a/webkit/glue/unittest_test_server.h b/webkit/glue/unittest_test_server.h
index 44caa29..0b3c7d2 100644
--- a/webkit/glue/unittest_test_server.h
+++ b/webkit/glue/unittest_test_server.h
@@ -35,19 +35,22 @@ class UnittestTestServer : public HTTPTestServer {
virtual bool MakeGETRequest(const std::string& page_name) {
GURL url(TestServerPage(page_name));
+ webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ request_info.method = "GET";
+ request_info.url = url;
+ request_info.first_party_for_cookies = url;
+ request_info.referrer = GURL(); // No referrer.
+ request_info.frame_origin = "null";
+ request_info.main_frame_origin = "null";
+ request_info.headers = std::string(); // No extra headers.
+ request_info.load_flags = net::LOAD_NORMAL;
+ request_info.requestor_pid = 0;
+ request_info.request_type = ResourceType::SUB_RESOURCE;
+ request_info.request_context = 0;
+ request_info.appcache_host_id = appcache::kNoHostId;
+ request_info.routing_id = 0;
scoped_ptr<ResourceLoaderBridge> loader(
- ResourceLoaderBridge::Create("GET",
- url,
- url, // first_party_for_cookies
- GURL(), // no referrer
- std::string(), // no extra headers
- "null", // frame_origin
- "null", // main_frame_origin
- net::LOAD_NORMAL,
- 0,
- ResourceType::SUB_RESOURCE,
- appcache::kNoHostId,
- 0));
+ ResourceLoaderBridge::Create(request_info));
EXPECT_TRUE(loader.get());
ResourceLoaderBridge::SyncLoadResponse resp;
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 44d6f82..df2a601 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -338,19 +338,21 @@ void WebURLLoaderImpl::Context::Start(
// TODO(brettw) this should take parameter encoding into account when
// creating the GURLs.
- bridge_.reset(ResourceLoaderBridge::Create(
- method,
- url,
- request.firstPartyForCookies(),
- referrer_url,
- frame_origin,
- main_frame_origin,
- flattener.GetBuffer(),
- load_flags,
- requestor_pid,
- FromTargetType(request.targetType()),
- request.appCacheHostID(),
- request.requestorID()));
+
+ webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ request_info.method = method;
+ request_info.url = url;
+ request_info.first_party_for_cookies = request.firstPartyForCookies();
+ request_info.referrer = referrer_url;
+ request_info.frame_origin = frame_origin;
+ request_info.main_frame_origin = main_frame_origin;
+ request_info.headers = flattener.GetBuffer();
+ request_info.load_flags = load_flags;
+ request_info.requestor_pid = requestor_pid;
+ request_info.request_type = FromTargetType(request.targetType());
+ request_info.appcache_host_id = request.appCacheHostID();
+ request_info.routing_id = request.requestorID();
+ bridge_.reset(ResourceLoaderBridge::Create(request_info));
if (!request.httpBody().isNull()) {
// GET and HEAD requests shouldn't have http bodies.
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 512802a..2c0c124b 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -483,24 +483,18 @@ class SyncRequestProxy : public RequestProxy {
class ResourceLoaderBridgeImpl : public ResourceLoaderBridge {
public:
- ResourceLoaderBridgeImpl(const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& headers,
- int load_flags,
- ResourceType::Type request_type,
- int appcache_host_id)
+ ResourceLoaderBridgeImpl(
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info)
: params_(new RequestParams),
proxy_(NULL) {
- params_->method = method;
- params_->url = url;
- params_->first_party_for_cookies = first_party_for_cookies;
- params_->referrer = referrer;
- params_->headers = headers;
- params_->load_flags = load_flags;
- params_->request_type = request_type;
- params_->appcache_host_id = appcache_host_id;
+ params_->method = request_info.method;
+ params_->url = request_info.url;
+ params_->first_party_for_cookies = request_info.first_party_for_cookies;
+ params_->referrer = request_info.referrer;
+ params_->headers = request_info.headers;
+ params_->load_flags = request_info.load_flags;
+ params_->request_type = request_info.request_type;
+ params_->appcache_host_id = request_info.appcache_host_id;
}
virtual ~ResourceLoaderBridgeImpl() {
@@ -631,23 +625,10 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
namespace webkit_glue {
-// factory function
+// Factory function.
ResourceLoaderBridge* ResourceLoaderBridge::Create(
- const std::string& method,
- const GURL& url,
- const GURL& first_party_for_cookies,
- const GURL& referrer,
- const std::string& frame_origin,
- const std::string& main_frame_origin,
- const std::string& headers,
- int load_flags,
- int requestor_pid,
- ResourceType::Type request_type,
- int appcache_host_id,
- int routing_id) {
- return new ResourceLoaderBridgeImpl(method, url, first_party_for_cookies,
- referrer, headers, load_flags,
- request_type, appcache_host_id);
+ const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
+ return new ResourceLoaderBridgeImpl(request_info);
}
// Issue the proxy resolve request on the io thread, and wait