Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4005)

Unified Diff: chrome/renderer/security_filter_peer.h

Issue 267973002: Revert of Remove webkit's ResourceLoaderBridge interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/security_filter_peer.h
diff --git a/chrome/renderer/security_filter_peer.h b/chrome/renderer/security_filter_peer.h
index 15bef29dbf1a66ab8c4bc7175785be18371815b3..ca98e1856c90190dc40bebab87cf053b692edabc 100644
--- a/chrome/renderer/security_filter_peer.h
+++ b/chrome/renderer/security_filter_peer.h
@@ -8,6 +8,10 @@
#include "content/public/child/request_peer.h"
#include "webkit/common/resource_response_info.h"
#include "webkit/common/resource_type.h"
+
+namespace webkit_glue {
+class ResourceLoaderBridge;
+}
// The SecurityFilterPeer is a proxy to a
// content::RequestPeer instance. It is used to pre-process
@@ -49,9 +53,11 @@
int64 total_transfer_size) OVERRIDE;
protected:
- explicit SecurityFilterPeer(content::RequestPeer* peer);
+ SecurityFilterPeer(webkit_glue::ResourceLoaderBridge* resource_loader_bridge,
+ content::RequestPeer* peer);
content::RequestPeer* original_peer_;
+ webkit_glue::ResourceLoaderBridge* resource_loader_bridge_;
private:
DISALLOW_COPY_AND_ASSIGN(SecurityFilterPeer);
@@ -61,7 +67,9 @@
// Subclasses should implement DataReady() to process the data as necessary.
class BufferedPeer : public SecurityFilterPeer {
public:
- BufferedPeer(content::RequestPeer* peer, const std::string& mime_type);
+ BufferedPeer(webkit_glue::ResourceLoaderBridge* resource_loader_bridge,
+ content::RequestPeer* peer,
+ const std::string& mime_type);
virtual ~BufferedPeer();
// content::RequestPeer Implementation.
@@ -96,13 +104,16 @@
// The ReplaceContentPeer cancels the request and serves the provided data as
// content instead.
-// TODO(jcampan): For now the resource is still being fetched, but ignored, as
-// once we have provided the replacement content, the associated pending request
+// TODO(jcampan): we do not as of now cancel the request, as we do not have
+// access to the resource_loader_bridge in the SecurityFilterPeer factory
+// method. For now the resource is still being fetched, but ignored, as once
+// we have provided the replacement content, the associated pending request
// in ResourceDispatcher is removed and further OnReceived* notifications are
// ignored.
class ReplaceContentPeer : public SecurityFilterPeer {
public:
- ReplaceContentPeer(content::RequestPeer* peer,
+ ReplaceContentPeer(webkit_glue::ResourceLoaderBridge* resource_loader_bridge,
+ content::RequestPeer* peer,
const std::string& mime_type,
const std::string& data);
virtual ~ReplaceContentPeer();
@@ -113,12 +124,13 @@
virtual void OnReceivedData(const char* data,
int data_length,
int encoded_data_length) OVERRIDE;
- virtual void OnCompletedRequest(int error_code,
- bool was_ignored_by_handler,
- bool stale_copy_in_cache,
- const std::string& security_info,
- const base::TimeTicks& completion_time,
- int64 total_transfer_size) OVERRIDE;
+ virtual void OnCompletedRequest(
+ int error_code,
+ bool was_ignored_by_handler,
+ bool stale_copy_in_cache,
+ const std::string& security_info,
+ const base::TimeTicks& completion_time,
+ int64 total_transfer_size) OVERRIDE;
private:
webkit_glue::ResourceResponseInfo response_info_;
« no previous file with comments | « chrome/renderer/extensions/extension_localization_peer_unittest.cc ('k') | chrome/renderer/security_filter_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698