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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11490014: PPAPI: Make Messaging not PostTask and copy when out-of-process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 573
574 UpdateTouchEventRequest(); 574 UpdateTouchEventRequest();
575 container_->setWantsWheelEvents(IsAcceptingWheelEvents()); 575 container_->setWantsWheelEvents(IsAcceptingWheelEvents());
576 576
577 SetGPUHistogram(delegate_->GetPreferences(), arg_names, arg_values); 577 SetGPUHistogram(delegate_->GetPreferences(), arg_names, arg_values);
578 578
579 argn_ = arg_names; 579 argn_ = arg_names;
580 argv_ = arg_values; 580 argv_ = arg_values;
581 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); 581 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_));
582 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); 582 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_));
583 return PP_ToBool(instance_interface_->DidCreate(pp_instance(), 583 bool success = PP_ToBool(instance_interface_->DidCreate(pp_instance(),
584 argn_.size(), 584 argn_.size(),
585 argn_array.get(), 585 argn_array.get(),
586 argv_array.get())); 586 argv_array.get()));
587 if (success)
588 message_channel_->StopQueueingJavaScriptMessages();
589 return success;
587 } 590 }
588 591
589 bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) { 592 bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) {
590 if (!document_loader_) 593 if (!document_loader_)
591 document_loader_ = loader; 594 document_loader_ = loader;
592 DCHECK(loader == document_loader_.get()); 595 DCHECK(loader == document_loader_.get());
593 596
594 return PP_ToBool(instance_interface_->HandleDocumentLoad( 597 return PP_ToBool(instance_interface_->HandleDocumentLoad(
595 pp_instance(), loader->pp_resource())); 598 pp_instance(), loader->pp_resource()));
596 } 599 }
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, 2382 return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_,
2380 components); 2383 components);
2381 } 2384 }
2382 2385
2383 bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) { 2386 bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) {
2384 // Save the original module and switch over to the new one now that this 2387 // Save the original module and switch over to the new one now that this
2385 // plugin is using the IPC-based proxy. 2388 // plugin is using the IPC-based proxy.
2386 original_module_ = module_; 2389 original_module_ = module_;
2387 module_ = module; 2390 module_ = module;
2388 2391
2392 // Don't send any messages to the plugin until DidCreate() has finished.
2393 message_channel_->QueueJavaScriptMessages();
2394
2389 // For NaCl instances, remember the NaCl plugin instance interface, so we 2395 // For NaCl instances, remember the NaCl plugin instance interface, so we
2390 // can shut it down by calling its DidDestroy in our Delete() method. 2396 // can shut it down by calling its DidDestroy in our Delete() method.
2391 original_instance_interface_.reset(instance_interface_.release()); 2397 original_instance_interface_.reset(instance_interface_.release());
2392 2398
2393 base::Callback<const void*(const char*)> get_plugin_interface_func = 2399 base::Callback<const void*(const char*)> get_plugin_interface_func =
2394 base::Bind(&PluginModule::GetPluginInterface, module_.get()); 2400 base::Bind(&PluginModule::GetPluginInterface, module_.get());
2395 PPP_Instance_Combined* ppp_instance_combined = 2401 PPP_Instance_Combined* ppp_instance_combined =
2396 PPP_Instance_Combined::Create(get_plugin_interface_func); 2402 PPP_Instance_Combined::Create(get_plugin_interface_func);
2397 if (!ppp_instance_combined) { 2403 if (!ppp_instance_combined) {
2398 // The proxy must support at least one usable PPP_Instance interface. 2404 // The proxy must support at least one usable PPP_Instance interface.
(...skipping 14 matching lines...) Expand all
2413 plugin_selection_interface_ = NULL; 2419 plugin_selection_interface_ = NULL;
2414 plugin_textinput_interface_ = NULL; 2420 plugin_textinput_interface_ = NULL;
2415 plugin_zoom_interface_ = NULL; 2421 plugin_zoom_interface_ = NULL;
2416 2422
2417 // Re-send the DidCreate event via the proxy. 2423 // Re-send the DidCreate event via the proxy.
2418 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_)); 2424 scoped_array<const char*> argn_array(StringVectorToArgArray(argn_));
2419 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_)); 2425 scoped_array<const char*> argv_array(StringVectorToArgArray(argv_));
2420 if (!instance_interface_->DidCreate(pp_instance(), argn_.size(), 2426 if (!instance_interface_->DidCreate(pp_instance(), argn_.size(),
2421 argn_array.get(), argv_array.get())) 2427 argn_array.get(), argv_array.get()))
2422 return false; 2428 return false;
2429 message_channel_->StopQueueingJavaScriptMessages();
2423 2430
2424 // Clear sent_initial_did_change_view_ and cancel any pending DidChangeView 2431 // Clear sent_initial_did_change_view_ and cancel any pending DidChangeView
2425 // event. This way, SendDidChangeView will send the "current" view 2432 // event. This way, SendDidChangeView will send the "current" view
2426 // immediately (before other events like HandleDocumentLoad). 2433 // immediately (before other events like HandleDocumentLoad).
2427 sent_initial_did_change_view_ = false; 2434 sent_initial_did_change_view_ = false;
2428 view_change_weak_ptr_factory_.InvalidateWeakPtrs(); 2435 view_change_weak_ptr_factory_.InvalidateWeakPtrs();
2429 SendDidChangeView(); 2436 SendDidChangeView();
2430 2437
2431 // If we received HandleDocumentLoad, re-send it now via the proxy. 2438 // If we received HandleDocumentLoad, re-send it now via the proxy.
2432 if (document_loader_) 2439 if (document_loader_)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 screen_size_for_fullscreen_ = gfx::Size(); 2504 screen_size_for_fullscreen_ = gfx::Size();
2498 WebElement element = container_->element(); 2505 WebElement element = container_->element();
2499 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2506 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2500 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2507 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2501 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2508 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2502 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2509 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2503 } 2510 }
2504 2511
2505 } // namespace ppapi 2512 } // namespace ppapi
2506 } // namespace webkit 2513 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698