Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
index 5bdacb09c65997675a54edb7d748733d567b9d3f..0495f80079f22b0f9b86171b0f63ac4458f5b291 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -39,6 +39,7 @@ |
#include "ppapi/shared_impl/resource.h" |
#include "ppapi/shared_impl/scoped_pp_resource.h" |
#include "ppapi/shared_impl/time_conversion.h" |
+#include "ppapi/shared_impl/url_request_info_data.h" |
#include "ppapi/shared_impl/var.h" |
#include "ppapi/thunk/enter.h" |
#include "ppapi/thunk/ppb_buffer_api.h" |
@@ -79,7 +80,6 @@ |
#include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
#include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
#include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
-#include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
#include "webkit/plugins/ppapi/ppp_pdf.h" |
#include "webkit/plugins/ppapi/url_request_info_util.h" |
#include "webkit/plugins/sad_plugin.h" |
@@ -380,7 +380,8 @@ PluginInstance::PluginInstance( |
selection_caret_(0), |
selection_anchor_(0), |
pending_user_gesture_(0.0), |
- flash_impl_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
+ flash_impl_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
+ document_loader_(NULL) { |
pp_instance_ = HostGlobals::Get()->AddInstance(this); |
memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
@@ -584,13 +585,19 @@ bool PluginInstance::Initialize(WebPluginContainer* container, |
argv_array.get())); |
} |
-bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) { |
- if (!document_loader_) |
- document_loader_ = loader; |
- DCHECK(loader == document_loader_.get()); |
- |
- return PP_ToBool(instance_interface_->HandleDocumentLoad( |
- pp_instance(), loader->pp_resource())); |
+bool PluginInstance::HandleDocumentLoad( |
+ const WebKit::WebURLResponse& response) { |
+ DCHECK(!document_loader_); |
+ if (module()->is_crashed()) { |
+ // Don't create a resource for a crashed plugin. |
+ container()->element().document().frame()->stopLoading(); |
+ return false; |
+ } |
+ delegate()->HandleDocumentLoad(this, response); |
+ // If the load was not abandoned, document_loader_ will now be set. It's |
+ // possible that the load was canceled by now and document_loader_ was |
+ // already nulled out. |
+ return true; |
} |
bool PluginInstance::SendCompositionEventToPlugin(PP_InputEvent_Type type, |
@@ -2410,9 +2417,7 @@ bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) { |
view_change_weak_ptr_factory_.InvalidateWeakPtrs(); |
SendDidChangeView(); |
- // If we received HandleDocumentLoad, re-send it now via the proxy. |
- if (document_loader_) |
- HandleDocumentLoad(document_loader_.get()); |
+ // TODO(brettw) handle re-sending HandleDocumentLoad to the proxied plugin. |
return true; |
} |