OLD | NEW |
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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 finished_loading_ = true; | 412 finished_loading_ = true; |
413 } | 413 } |
414 | 414 |
415 void PepperPluginInstanceImpl::NaClDocumentLoader::didFail( | 415 void PepperPluginInstanceImpl::NaClDocumentLoader::didFail( |
416 WebURLLoader* loader, | 416 WebURLLoader* loader, |
417 const WebURLError& error) { | 417 const WebURLError& error) { |
418 DCHECK(!error_.get()); | 418 DCHECK(!error_.get()); |
419 error_.reset(new WebURLError(error)); | 419 error_.reset(new WebURLError(error)); |
420 } | 420 } |
421 | 421 |
422 PepperPluginInstanceImpl::GamepadImpl::GamepadImpl(PepperHelperImpl* helper) | 422 PepperPluginInstanceImpl::GamepadImpl::GamepadImpl() |
423 : Resource(::ppapi::Resource::Untracked()), | 423 : Resource(::ppapi::Resource::Untracked()) { |
424 helper_(helper) { | |
425 } | 424 } |
426 | 425 |
427 PepperPluginInstanceImpl::GamepadImpl::~GamepadImpl() { | 426 PepperPluginInstanceImpl::GamepadImpl::~GamepadImpl() { |
428 } | 427 } |
429 | 428 |
430 PPB_Gamepad_API* PepperPluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { | 429 PPB_Gamepad_API* PepperPluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { |
431 return this; | 430 return this; |
432 } | 431 } |
433 | 432 |
434 void PepperPluginInstanceImpl::GamepadImpl::Sample( | 433 void PepperPluginInstanceImpl::GamepadImpl::Sample( |
435 PP_Instance instance, | 434 PP_Instance instance, |
436 PP_GamepadsSampleData* data) { | 435 PP_GamepadsSampleData* data) { |
437 WebKit::WebGamepads webkit_data; | 436 WebKit::WebGamepads webkit_data; |
438 helper_->SampleGamepads(&webkit_data); | 437 RenderThreadImpl::current()->SampleGamepads(&webkit_data); |
439 ConvertWebKitGamepadData( | 438 ConvertWebKitGamepadData( |
440 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); | 439 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); |
441 } | 440 } |
442 | 441 |
443 PepperPluginInstanceImpl::PepperPluginInstanceImpl( | 442 PepperPluginInstanceImpl::PepperPluginInstanceImpl( |
444 PepperHelperImpl* helper, | 443 PepperHelperImpl* helper, |
445 RenderViewImpl* render_view, | 444 RenderViewImpl* render_view, |
446 PluginModule* module, | 445 PluginModule* module, |
447 ::ppapi::PPP_Instance_Combined* instance_interface, | 446 ::ppapi::PPP_Instance_Combined* instance_interface, |
448 WebPluginContainer* container, | 447 WebPluginContainer* container, |
(...skipping 18 matching lines...) Expand all Loading... |
467 plugin_messaging_interface_(NULL), | 466 plugin_messaging_interface_(NULL), |
468 plugin_mouse_lock_interface_(NULL), | 467 plugin_mouse_lock_interface_(NULL), |
469 plugin_pdf_interface_(NULL), | 468 plugin_pdf_interface_(NULL), |
470 plugin_private_interface_(NULL), | 469 plugin_private_interface_(NULL), |
471 plugin_selection_interface_(NULL), | 470 plugin_selection_interface_(NULL), |
472 plugin_textinput_interface_(NULL), | 471 plugin_textinput_interface_(NULL), |
473 plugin_zoom_interface_(NULL), | 472 plugin_zoom_interface_(NULL), |
474 checked_for_plugin_input_event_interface_(false), | 473 checked_for_plugin_input_event_interface_(false), |
475 checked_for_plugin_messaging_interface_(false), | 474 checked_for_plugin_messaging_interface_(false), |
476 checked_for_plugin_pdf_interface_(false), | 475 checked_for_plugin_pdf_interface_(false), |
477 gamepad_impl_(new GamepadImpl(helper)), | 476 gamepad_impl_(new GamepadImpl()), |
478 plugin_print_interface_(NULL), | 477 plugin_print_interface_(NULL), |
479 plugin_graphics_3d_interface_(NULL), | 478 plugin_graphics_3d_interface_(NULL), |
480 always_on_top_(false), | 479 always_on_top_(false), |
481 fullscreen_container_(NULL), | 480 fullscreen_container_(NULL), |
482 flash_fullscreen_(false), | 481 flash_fullscreen_(false), |
483 desired_fullscreen_state_(false), | 482 desired_fullscreen_state_(false), |
484 sad_plugin_(NULL), | 483 sad_plugin_(NULL), |
485 input_event_mask_(0), | 484 input_event_mask_(0), |
486 filtered_input_event_mask_(0), | 485 filtered_input_event_mask_(0), |
487 text_input_type_(kPluginDefaultTextInputType), | 486 text_input_type_(kPluginDefaultTextInputType), |
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 // Running out-of-process. Initiate an IPC call to notify the plugin | 2886 // Running out-of-process. Initiate an IPC call to notify the plugin |
2888 // process. | 2887 // process. |
2889 ppapi::proxy::HostDispatcher* dispatcher = | 2888 ppapi::proxy::HostDispatcher* dispatcher = |
2890 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2889 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2891 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2890 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2892 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2891 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2893 } | 2892 } |
2894 } | 2893 } |
2895 | 2894 |
2896 } // namespace content | 2895 } // namespace content |
OLD | NEW |