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

Unified Diff: webkit/plugins/ppapi/ppapi_webplugin_impl.cc

Issue 11416064: Convert URLLoader to the new proxy design (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments, merge Created 8 years 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
« no previous file with comments | « webkit/plugins/ppapi/ppapi_webplugin_impl.h ('k') | webkit/plugins/ppapi/ppb_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_webplugin_impl.cc
diff --git a/webkit/plugins/ppapi/ppapi_webplugin_impl.cc b/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
index 04161408bce499a3a82557deeb2f25d694b50dd0..447b54c8dee1d752e70b1127aa962b00e7beab38 100644
--- a/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
+++ b/webkit/plugins/ppapi/ppapi_webplugin_impl.cc
@@ -21,12 +21,12 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoaderClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "webkit/plugins/ppapi/message_channel.h"
#include "webkit/plugins/ppapi/npobject_var.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-#include "webkit/plugins/ppapi/ppb_url_loader_impl.h"
using ppapi::NPObjectVar;
using WebKit::WebCanvas;
@@ -187,38 +187,26 @@ bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event,
void WebPluginImpl::didReceiveResponse(
const WebKit::WebURLResponse& response) {
- DCHECK(!document_loader_);
-
- if (instance_->module()->is_crashed()) {
- // Don't create a resource for a crashed plugin.
- instance_->container()->element().document().frame()->stopLoading();
- return;
- }
-
- document_loader_ = new PPB_URLLoader_Impl(instance_->pp_instance(), true);
- document_loader_->didReceiveResponse(NULL, response);
-
- if (!instance_->HandleDocumentLoad(document_loader_))
- document_loader_ = NULL;
+ DCHECK(!instance_->document_loader());
+ instance_->HandleDocumentLoad(response);
}
void WebPluginImpl::didReceiveData(const char* data, int data_length) {
- if (document_loader_)
- document_loader_->didReceiveData(NULL, data, data_length, data_length);
+ WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+ if (document_loader)
+ document_loader->didReceiveData(NULL, data, data_length, 0);
}
void WebPluginImpl::didFinishLoading() {
- if (document_loader_) {
- document_loader_->didFinishLoading(NULL, 0);
- document_loader_ = NULL;
- }
+ WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+ if (document_loader)
+ document_loader->didFinishLoading(NULL, 0.0);
}
void WebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
- if (document_loader_) {
- document_loader_->didFail(NULL, error);
- document_loader_ = NULL;
- }
+ WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+ if (document_loader)
+ document_loader->didFail(NULL, error);
}
void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url,
« no previous file with comments | « webkit/plugins/ppapi/ppapi_webplugin_impl.h ('k') | webkit/plugins/ppapi/ppb_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698