diff options
-rw-r--r-- | chrome/renderer/extensions/extension_localization_peer.h | 1 | ||||
-rw-r--r-- | chrome/renderer/security_filter_peer.h | 1 | ||||
-rw-r--r-- | content/child/npapi/plugin_url_fetcher.cc | 1 | ||||
-rw-r--r-- | content/child/resource_dispatcher.cc | 1 | ||||
-rw-r--r-- | content/child/sync_load_response.cc | 13 | ||||
-rw-r--r-- | content/child/sync_load_response.h | 34 | ||||
-rw-r--r-- | content/child/web_url_loader_impl.cc | 10 | ||||
-rw-r--r-- | content/content_child.gypi | 6 | ||||
-rw-r--r-- | webkit/child/resource_loader_bridge.cc | 4 | ||||
-rw-r--r-- | webkit/child/resource_loader_bridge.h | 23 |
10 files changed, 64 insertions, 30 deletions
diff --git a/chrome/renderer/extensions/extension_localization_peer.h b/chrome/renderer/extensions/extension_localization_peer.h index 78aab0c..f4c71b6 100644 --- a/chrome/renderer/extensions/extension_localization_peer.h +++ b/chrome/renderer/extensions/extension_localization_peer.h @@ -9,6 +9,7 @@ #include "ipc/ipc_sender.h" #include "webkit/child/resource_loader_bridge.h" +#include "webkit/common/resource_response_info.h" // The ExtensionLocalizationPeer is a proxy to a // webkit_glue::ResourceLoaderBridge::Peer instance. It is used to pre-process diff --git a/chrome/renderer/security_filter_peer.h b/chrome/renderer/security_filter_peer.h index a4c0027..354cf62 100644 --- a/chrome/renderer/security_filter_peer.h +++ b/chrome/renderer/security_filter_peer.h @@ -6,6 +6,7 @@ #define CHROME_RENDERER_SECURITY_FILTER_PEER_H_ #include "webkit/child/resource_loader_bridge.h" +#include "webkit/common/resource_response_info.h" #include "webkit/common/resource_type.h" // The SecurityFilterPeer is a proxy to a diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc index a1d1530..6695f76 100644 --- a/content/child/npapi/plugin_url_fetcher.cc +++ b/content/child/npapi/plugin_url_fetcher.cc @@ -24,6 +24,7 @@ #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" #include "third_party/WebKit/public/platform/WebURLResponse.h" #include "webkit/child/multipart_response_delegate.h" +#include "webkit/common/resource_response_info.h" namespace content { namespace { diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index 990bf84..be24da4 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc @@ -18,6 +18,7 @@ #include "content/child/request_extra_data.h" #include "content/child/request_info.h" #include "content/child/site_isolation_policy.h" +#include "content/child/sync_load_response.h" #include "content/common/inter_process_time_ticks_converter.h" #include "content/common/resource_messages.h" #include "content/common/service_worker/service_worker_types.h" diff --git a/content/child/sync_load_response.cc b/content/child/sync_load_response.cc new file mode 100644 index 0000000..163153a --- /dev/null +++ b/content/child/sync_load_response.cc @@ -0,0 +1,13 @@ +// Copyright 2014 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/child/sync_load_response.h" + +namespace content { + +SyncLoadResponse::SyncLoadResponse() {} + +SyncLoadResponse::~SyncLoadResponse() {} + +} // namespace content diff --git a/content/child/sync_load_response.h b/content/child/sync_load_response.h new file mode 100644 index 0000000..d19985f --- /dev/null +++ b/content/child/sync_load_response.h @@ -0,0 +1,34 @@ +// Copyright 2014 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. + +#ifndef CONTENT_CHILD_SYNC_LOAD_RESPONSE_H_ +#define CONTENT_CHILD_SYNC_LOAD_RESPONSE_H_ + +#include <string> + +#include "url/gurl.h" +#include "webkit/common/resource_response_info.h" + +namespace content { + +// See the SyncLoad method. (The name of this struct is not +// suffixed with "Info" because it also contains the response data.) +struct SyncLoadResponse : webkit_glue::ResourceResponseInfo { + SyncLoadResponse(); + ~SyncLoadResponse(); + + // The response error code. + int error_code; + + // The final URL of the response. This may differ from the request URL in + // the case of a server redirect. + GURL url; + + // The response data. + std::string data; +}; + +} // namespace content + +#endif // CONTENT_CHILD_SYNC_LOAD_RESPONSE_H_ diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index b11a537..13300df 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc @@ -16,6 +16,7 @@ #include "content/child/ftp_directory_listing_response_delegate.h" #include "content/child/request_extra_data.h" #include "content/child/request_info.h" +#include "content/child/sync_load_response.h" #include "content/common/resource_request_body.h" #include "net/base/data_url.h" #include "net/base/load_flags.h" @@ -231,7 +232,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, void SetDefersLoading(bool value); void DidChangePriority(WebURLRequest::Priority new_priority); void Start(const WebURLRequest& request, - ResourceLoaderBridge::SyncLoadResponse* sync_load_response); + SyncLoadResponse* sync_load_response); // ResourceLoaderBridge::Peer methods: virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; @@ -306,9 +307,8 @@ void WebURLLoaderImpl::Context::DidChangePriority( ConvertWebKitPriorityToNetPriority(new_priority)); } -void WebURLLoaderImpl::Context::Start( - const WebURLRequest& request, - ResourceLoaderBridge::SyncLoadResponse* sync_load_response) { +void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, + SyncLoadResponse* sync_load_response) { DCHECK(!bridge_.get()); request_ = request; // Save the request. @@ -828,7 +828,7 @@ void WebURLLoaderImpl::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { - ResourceLoaderBridge::SyncLoadResponse sync_load_response; + SyncLoadResponse sync_load_response; context_->Start(request, &sync_load_response); const GURL& final_url = sync_load_response.url; diff --git a/content/content_child.gypi b/content/content_child.gypi index 354faed..b744edae 100644 --- a/content/content_child.gypi +++ b/content/content_child.gypi @@ -161,10 +161,12 @@ 'child/site_isolation_policy.h', 'child/socket_stream_dispatcher.cc', 'child/socket_stream_dispatcher.h', - 'child/touch_fling_gesture_curve.cc', - 'child/touch_fling_gesture_curve.h', + 'child/sync_load_response.cc', + 'child/sync_load_response.h', 'child/thread_safe_sender.cc', 'child/thread_safe_sender.h', + 'child/touch_fling_gesture_curve.cc', + 'child/touch_fling_gesture_curve.h', 'child/web_database_observer_impl.cc', 'child/web_database_observer_impl.h', 'child/web_discardable_memory_impl.cc', diff --git a/webkit/child/resource_loader_bridge.cc b/webkit/child/resource_loader_bridge.cc index 35cf74e..41acf98 100644 --- a/webkit/child/resource_loader_bridge.cc +++ b/webkit/child/resource_loader_bridge.cc @@ -6,10 +6,6 @@ namespace webkit_glue { -ResourceLoaderBridge::SyncLoadResponse::SyncLoadResponse() {} - -ResourceLoaderBridge::SyncLoadResponse::~SyncLoadResponse() {} - ResourceLoaderBridge::ResourceLoaderBridge() {} ResourceLoaderBridge::~ResourceLoaderBridge() {} diff --git a/webkit/child/resource_loader_bridge.h b/webkit/child/resource_loader_bridge.h index efe8b77..fb6cf09 100644 --- a/webkit/child/resource_loader_bridge.h +++ b/webkit/child/resource_loader_bridge.h @@ -28,35 +28,20 @@ #include "net/base/request_priority.h" #include "url/gurl.h" #include "webkit/child/webkit_child_export.h" -#include "webkit/common/resource_response_info.h" // TODO(pilgrim) remove this once resource loader is moved to content // http://crbug.com/338338 namespace content { class ResourceRequestBody; +struct SyncLoadResponse; } namespace webkit_glue { +struct ResourceResponseInfo; + class ResourceLoaderBridge { public: - // See the SyncLoad method declared below. (The name of this struct is not - // suffixed with "Info" because it also contains the response data.) - struct SyncLoadResponse : ResourceResponseInfo { - WEBKIT_CHILD_EXPORT SyncLoadResponse(); - WEBKIT_CHILD_EXPORT ~SyncLoadResponse(); - - // The response error code. - int error_code; - - // The final URL of the response. This may differ from the request URL in - // the case of a server redirect. - GURL url; - - // The response data. - std::string data; - }; - // Generated by the bridge. This is implemented by our custom resource loader // within webkit. The Peer and it's bridge should have identical lifetimes // as they represent each end of a communication channel. @@ -156,7 +141,7 @@ class ResourceLoaderBridge { // use this if you really need it! There is also no way for the caller to // interrupt this method. Errors are reported via the status field of the // response parameter. - virtual void SyncLoad(SyncLoadResponse* response) = 0; + virtual void SyncLoad(content::SyncLoadResponse* response) = 0; protected: // Construction must go through |