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

Unified Diff: webkit/glue/plugins/pepper_webplugin_impl.cc

Issue 2842036: Add support for HandleDocumentLoad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
« no previous file with comments | « webkit/glue/plugins/pepper_webplugin_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_webplugin_impl.cc
===================================================================
--- webkit/glue/plugins/pepper_webplugin_impl.cc (revision 51230)
+++ webkit/glue/plugins/pepper_webplugin_impl.cc (working copy)
@@ -11,6 +11,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
#include "webkit/glue/plugins/pepper_plugin_instance.h"
#include "webkit/glue/plugins/pepper_plugin_module.h"
+#include "webkit/glue/plugins/pepper_url_loader.h"
#include "webkit/glue/plugins/pepper_var.h"
using WebKit::WebCanvas;
@@ -103,15 +104,32 @@
void WebPluginImpl::didReceiveResponse(
const WebKit::WebURLResponse& response) {
+ DCHECK(!document_loader_);
+
+ document_loader_ = new URLLoader(instance_);
+ document_loader_->didReceiveResponse(NULL, response);
+
+ if (!instance_->HandleDocumentLoad(document_loader_))
+ document_loader_ = NULL;
}
void WebPluginImpl::didReceiveData(const char* data, int data_length) {
+ if (document_loader_)
+ document_loader_->didReceiveData(NULL, data, data_length);
}
void WebPluginImpl::didFinishLoading() {
+ if (document_loader_) {
+ document_loader_->didFinishLoading(NULL);
+ document_loader_ = NULL;
+ }
}
-void WebPluginImpl::didFailLoading(const WebKit::WebURLError&) {
+void WebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
+ if (document_loader_) {
+ document_loader_->didFail(NULL, error);
+ document_loader_ = NULL;
+ }
}
void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url,
« no previous file with comments | « webkit/glue/plugins/pepper_webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698