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

Unified Diff: content/child/npapi/plugin_url_fetcher.cc

Issue 226273005: Remove webkit's ResourceLoaderBridge interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm resource_loader_bridge.* 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: content/child/npapi/plugin_url_fetcher.cc
diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc
index d1c5c248a22dc48776305874f22cd339d1f67d3e..9cc2768edf9530e008ed8f096d71a06d726b85a4 100644
--- a/content/child/npapi/plugin_url_fetcher.cc
+++ b/content/child/npapi/plugin_url_fetcher.cc
@@ -24,7 +24,6 @@
#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/child/resource_loader_bridge.h"
#include "webkit/common/resource_response_info.h"
namespace content {
@@ -143,16 +142,18 @@ PluginURLFetcher::PluginURLFetcher(PluginStreamUrl* plugin_stream,
request_info.headers = std::string("Range: ") + range;
}
- bridge_.reset(ChildThread::current()->resource_dispatcher()->CreateBridge(
- request_info));
+ ResourceDispatcher* dispatcher =
+ ChildThread::current()->resource_dispatcher();
+ dispatcher->CreateBridge(request_info);
+
if (!body.empty()) {
scoped_refptr<ResourceRequestBody> request_body =
new ResourceRequestBody;
request_body->AppendBytes(&body[0], body.size());
- bridge_->SetRequestBody(request_body.get());
+ dispatcher->SetRequestBody(request_body.get());
}
- bridge_->Start(this);
+ dispatcher->Start(this);
// TODO(jam): range requests
}
@@ -161,7 +162,7 @@ PluginURLFetcher::~PluginURLFetcher() {
}
void PluginURLFetcher::Cancel() {
- bridge_->Cancel();
+ ChildThread::current()->resource_dispatcher()->Cancel();
// Due to races and nested event loops, PluginURLFetcher may still receive
// events from the bridge before being destroyed. Do not forward additional
@@ -177,10 +178,13 @@ void PluginURLFetcher::URLRedirectResponse(bool allow) {
if (!plugin_stream_)
return;
+ ResourceDispatcher* dispatcher =
+ ChildThread::current()->resource_dispatcher();
+
if (allow) {
- bridge_->SetDefersLoading(false);
+ dispatcher->SetDefersLoading(false);
} else {
- bridge_->Cancel();
+ dispatcher->Cancel();
plugin_stream_->DidFail(resource_id_); // That will delete |this|.
}
}
@@ -231,7 +235,9 @@ bool PluginURLFetcher::OnReceivedRedirect(
}
} else {
// Pause the request while we ask the plugin what to do about the redirect.
- bridge_->SetDefersLoading(true);
+ ResourceDispatcher* dispatcher =
+ ChildThread::current()->resource_dispatcher();
+ dispatcher->SetDefersLoading(true);
plugin_stream_->WillSendRequest(url_, response_code);
}

Powered by Google App Engine
This is Rietveld 408576698