diff options
Diffstat (limited to 'content/common')
| -rw-r--r-- | content/common/resource_dispatcher.cc | 6 | ||||
| -rw-r--r-- | content/common/resource_dispatcher.h | 5 | ||||
| -rw-r--r-- | content/common/resource_dispatcher_unittest.cc | 6 | ||||
| -rw-r--r-- | content/common/resource_messages.h | 30 | ||||
| -rw-r--r-- | content/common/resource_response.cc | 11 | ||||
| -rw-r--r-- | content/common/resource_response.h | 47 |
6 files changed, 23 insertions, 82 deletions
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc index 4afa078..4bde33b 100644 --- a/content/common/resource_dispatcher.cc +++ b/content/common/resource_dispatcher.cc @@ -15,8 +15,8 @@ #include "base/string_util.h" #include "content/common/request_extra_data.h" #include "content/common/resource_messages.h" -#include "content/common/resource_response.h" #include "content/public/common/resource_dispatcher_delegate.h" +#include "content/public/common/resource_response.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" #include "net/base/upload_data.h" @@ -215,7 +215,7 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { request_id_ = MakeRequestID(); - SyncLoadResult result; + content::SyncLoadResult result; IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(routing_id_, request_id_, request_, &result); // NOTE: This may pump events (see RenderThread::Send). @@ -332,7 +332,7 @@ void ResourceDispatcher::OnUploadProgress( } void ResourceDispatcher::OnReceivedResponse( - int request_id, const ResourceResponseHead& response_head) { + int request_id, const content::ResourceResponseHead& response_head) { PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); if (!request_info) return; diff --git a/content/common/resource_dispatcher.h b/content/common/resource_dispatcher.h index ba74b23..1b8e3a3 100644 --- a/content/common/resource_dispatcher.h +++ b/content/common/resource_dispatcher.h @@ -19,10 +19,9 @@ #include "ipc/ipc_channel.h" #include "webkit/glue/resource_loader_bridge.h" -struct ResourceResponseHead; - namespace content { class ResourceDispatcherDelegate; +struct ResourceResponseHead; } // This class serves as a communication interface between the @@ -105,7 +104,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { int request_id, int64 position, int64 size); - void OnReceivedResponse(int request_id, const ResourceResponseHead&); + void OnReceivedResponse(int request_id, const content::ResourceResponseHead&); void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data); void OnReceivedRedirect( const IPC::Message& message, diff --git a/content/common/resource_dispatcher_unittest.cc b/content/common/resource_dispatcher_unittest.cc index 2483ea1..e5c8a08 100644 --- a/content/common/resource_dispatcher_unittest.cc +++ b/content/common/resource_dispatcher_unittest.cc @@ -12,7 +12,7 @@ #include "content/common/request_extra_data.h" #include "content/common/resource_dispatcher.h" #include "content/common/resource_messages.h" -#include "content/common/resource_response.h" +#include "content/public/common/resource_response.h" #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" @@ -114,7 +114,7 @@ class ResourceDispatcherTest : public testing::Test, EXPECT_EQ(test_page_url, request.url.spec()); // received response message - ResourceResponseHead response; + content::ResourceResponseHead response; std::string raw_headers(test_page_headers); std::replace(raw_headers.begin(), raw_headers.end(), '\n', '\0'); response.headers = new net::HttpResponseHeaders(raw_headers); @@ -242,7 +242,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, void InitMessages() { set_defer_loading(true); - ResourceResponseHead response_head; + content::ResourceResponseHead response_head; response_head.status.set_status(net::URLRequestStatus::SUCCESS); IPC::Message* response_message = diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index a6982e6..854290a 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h @@ -6,8 +6,8 @@ // Multiply-included message file, hence no include guard. #include "base/shared_memory.h" -#include "content/common/resource_response.h" #include "content/public/common/common_param_traits.h" +#include "content/public/common/resource_response.h" #include "ipc/ipc_message_macros.h" #include "net/base/upload_data.h" @@ -15,6 +15,17 @@ #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT +IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead) + IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo) + IPC_STRUCT_TRAITS_MEMBER(status) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(content::SyncLoadResult) + IPC_STRUCT_TRAITS_PARENT(content::ResourceResponseHead) + IPC_STRUCT_TRAITS_MEMBER(final_url) + IPC_STRUCT_TRAITS_MEMBER(data) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(webkit_glue::ResourceResponseInfo) IPC_STRUCT_TRAITS_MEMBER(request_time) IPC_STRUCT_TRAITS_MEMBER(response_time) @@ -38,17 +49,6 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::ResourceResponseInfo) IPC_STRUCT_TRAITS_MEMBER(socket_address) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(ResourceResponseHead) - IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo) - IPC_STRUCT_TRAITS_MEMBER(status) -IPC_STRUCT_TRAITS_END() - -IPC_STRUCT_TRAITS_BEGIN(SyncLoadResult) - IPC_STRUCT_TRAITS_PARENT(ResourceResponseHead) - IPC_STRUCT_TRAITS_MEMBER(final_url) - IPC_STRUCT_TRAITS_MEMBER(data) -IPC_STRUCT_TRAITS_END() - // Parameters for a resource request. IPC_STRUCT_BEGIN(ResourceHostMsg_Request) // The request method: GET, POST, etc. @@ -118,7 +118,7 @@ IPC_STRUCT_END() // Sent when the headers are available for a resource request. IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedResponse, int /* request_id */, - ResourceResponseHead) + content::ResourceResponseHead) // Sent when cached metadata from a resource request is ready. IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedCachedMetadata, @@ -137,7 +137,7 @@ IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress, IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect, int /* request_id */, GURL /* new_url */, - ResourceResponseHead) + content::ResourceResponseHead) // Sent when some data from a resource request is ready. The handle should // already be mapped into the process that receives this message. @@ -190,7 +190,7 @@ IPC_MESSAGE_ROUTED3(ResourceHostMsg_FollowRedirect, IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad, int /* request_id */, ResourceHostMsg_Request, - SyncLoadResult) + content::SyncLoadResult) // Sent when the renderer process is done processing a DataReceived // message. diff --git a/content/common/resource_response.cc b/content/common/resource_response.cc deleted file mode 100644 index a5318f4..0000000 --- a/content/common/resource_response.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/common/resource_response.h" - -ResourceResponse::ResourceResponse() { -} - -ResourceResponse::~ResourceResponse() { -} diff --git a/content/common/resource_response.h b/content/common/resource_response.h deleted file mode 100644 index 8c949a3..0000000 --- a/content/common/resource_response.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// See http://dev.chromium.org/developers/design-documents/multi-process-resource-loading - -#ifndef CONTENT_COMMON_RESOURCE_RESPONSE_H_ -#define CONTENT_COMMON_RESOURCE_RESPONSE_H_ -#pragma once - -#include <string> - -#include "base/memory/ref_counted.h" -#include "content/common/content_export.h" -#include "googleurl/src/gurl.h" -#include "net/url_request/url_request_status.h" -#include "webkit/glue/resource_loader_bridge.h" - -// Parameters for a resource response header. -struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { - // The response status. - net::URLRequestStatus status; -}; - -// Parameters for a synchronous resource response. -struct SyncLoadResult : ResourceResponseHead { - // The final URL after any redirects. - GURL final_url; - - // The response data. - std::string data; -}; - -// Simple wrapper that refcounts ResourceResponseHead. -struct CONTENT_EXPORT ResourceResponse - : public base::RefCounted<ResourceResponse> { - ResourceResponse(); - - ResourceResponseHead response_head; - - private: - friend class base::RefCounted<ResourceResponse>; - - ~ResourceResponse(); -}; - -#endif // CONTENT_COMMON_RESOURCE_RESPONSE_H_ |
