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

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

Issue 11359063: Refactor the way singleton-style resources are exposed via PPB_Instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 | Annotate | Revision Log
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 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 20 matching lines...) Expand all
31 #include "ppapi/c/ppb_input_event.h" 31 #include "ppapi/c/ppb_input_event.h"
32 #include "ppapi/c/ppb_gamepad.h" 32 #include "ppapi/c/ppb_gamepad.h"
33 #include "ppapi/c/ppp_graphics_3d.h" 33 #include "ppapi/c/ppp_graphics_3d.h"
34 #include "ppapi/c/ppp_input_event.h" 34 #include "ppapi/c/ppp_input_event.h"
35 #include "ppapi/c/ppp_messaging.h" 35 #include "ppapi/c/ppp_messaging.h"
36 #include "ppapi/c/ppp_mouse_lock.h" 36 #include "ppapi/c/ppp_mouse_lock.h"
37 #include "ppapi/c/private/ppb_content_decryptor_private.h" 37 #include "ppapi/c/private/ppb_content_decryptor_private.h"
38 #include "ppapi/c/private/ppp_instance_private.h" 38 #include "ppapi/c/private/ppp_instance_private.h"
39 #include "ppapi/shared_impl/ppb_instance_shared.h" 39 #include "ppapi/shared_impl/ppb_instance_shared.h"
40 #include "ppapi/shared_impl/ppb_view_shared.h" 40 #include "ppapi/shared_impl/ppb_view_shared.h"
41 #include "ppapi/thunk/ppb_flash_clipboard_api.h"
42 #include "ppapi/thunk/ppb_flash_functions_api.h"
43 #include "ppapi/thunk/ppb_gamepad_api.h" 41 #include "ppapi/thunk/ppb_gamepad_api.h"
44 #include "ppapi/thunk/resource_creation_api.h" 42 #include "ppapi/thunk/resource_creation_api.h"
45 #include "ppapi/shared_impl/tracked_callback.h" 43 #include "ppapi/shared_impl/tracked_callback.h"
46 #include "third_party/skia/include/core/SkRefCnt.h" 44 #include "third_party/skia/include/core/SkRefCnt.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h"
48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
49 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
50 #include "ui/base/ime/text_input_type.h" 48 #include "ui/base/ime/text_input_type.h"
51 #include "ui/gfx/rect.h" 49 #include "ui/gfx/rect.h"
52 #include "webkit/plugins/ppapi/plugin_delegate.h" 50 #include "webkit/plugins/ppapi/plugin_delegate.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 virtual void NumberOfFindResultsChanged(PP_Instance instance, 357 virtual void NumberOfFindResultsChanged(PP_Instance instance,
360 int32_t total, 358 int32_t total,
361 PP_Bool final_result) OVERRIDE; 359 PP_Bool final_result) OVERRIDE;
362 virtual void SelectedFindResultChanged(PP_Instance instance, 360 virtual void SelectedFindResultChanged(PP_Instance instance,
363 int32_t index) OVERRIDE; 361 int32_t index) OVERRIDE;
364 virtual PP_Bool SetFullscreen(PP_Instance instance, 362 virtual PP_Bool SetFullscreen(PP_Instance instance,
365 PP_Bool fullscreen) OVERRIDE; 363 PP_Bool fullscreen) OVERRIDE;
366 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) 364 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size)
367 OVERRIDE; 365 OVERRIDE;
368 virtual ::ppapi::thunk::PPB_Flash_API* GetFlashAPI() OVERRIDE; 366 virtual ::ppapi::thunk::PPB_Flash_API* GetFlashAPI() OVERRIDE;
369 virtual ::ppapi::thunk::PPB_Flash_Clipboard_API* GetFlashClipboardAPI( 367 virtual ::ppapi::Resource* GetSingletonResource(PP_Instance instance,
370 PP_Instance instance) OVERRIDE; 368 ::ppapi::SingletonResourceID id) OVERRIDE;
371 virtual ::ppapi::thunk::PPB_Flash_Functions_API* GetFlashFunctionsAPI(
372 PP_Instance instance) OVERRIDE;
373 virtual ::ppapi::thunk::PPB_Gamepad_API* GetGamepadAPI(PP_Instance instance)
374 OVERRIDE;
375 virtual int32_t RequestInputEvents(PP_Instance instance, 369 virtual int32_t RequestInputEvents(PP_Instance instance,
376 uint32_t event_classes) OVERRIDE; 370 uint32_t event_classes) OVERRIDE;
377 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, 371 virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
378 uint32_t event_classes) OVERRIDE; 372 uint32_t event_classes) OVERRIDE;
379 virtual void ClearInputEventRequest(PP_Instance instance, 373 virtual void ClearInputEventRequest(PP_Instance instance,
380 uint32_t event_classes) OVERRIDE; 374 uint32_t event_classes) OVERRIDE;
381 virtual void ClosePendingUserGesture(PP_Instance instance, 375 virtual void ClosePendingUserGesture(PP_Instance instance,
382 PP_TimeTicks timestamp); 376 PP_TimeTicks timestamp);
383 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; 377 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE;
384 virtual void ZoomLimitsChanged(PP_Instance instance, 378 virtual void ZoomLimitsChanged(PP_Instance instance,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if 453 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if
460 // necessary). 454 // necessary).
461 // This is for use with the NaCl proxy. 455 // This is for use with the NaCl proxy.
462 bool ResetAsProxied(scoped_refptr<PluginModule> module); 456 bool ResetAsProxied(scoped_refptr<PluginModule> module);
463 457
464 private: 458 private:
465 friend class PpapiUnittest; 459 friend class PpapiUnittest;
466 460
467 // Implements PPB_Gamepad_API. This is just to avoid having an excessive 461 // Implements PPB_Gamepad_API. This is just to avoid having an excessive
468 // number of interfaces implemented by PluginInstance. 462 // number of interfaces implemented by PluginInstance.
469 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API { 463 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API,
464 public ::ppapi::Resource {
470 public: 465 public:
471 explicit GamepadImpl(PluginDelegate* delegate); 466 explicit GamepadImpl(PluginDelegate* delegate);
467 // Resource implementation.
468 virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE;
472 virtual void Sample(PP_GamepadsSampleData* data) OVERRIDE; 469 virtual void Sample(PP_GamepadsSampleData* data) OVERRIDE;
473 private: 470 private:
474 PluginDelegate* delegate_; 471 PluginDelegate* delegate_;
475 }; 472 };
476 473
477 // See the static Create functions above for creating PluginInstance objects. 474 // See the static Create functions above for creating PluginInstance objects.
478 // This constructor is private so that we can hide the PPP_Instance_Combined 475 // This constructor is private so that we can hide the PPP_Instance_Combined
479 // details while still having 1 constructor to maintain for member 476 // details while still having 1 constructor to maintain for member
480 // initialization. 477 // initialization.
481 PluginInstance(PluginDelegate* delegate, 478 PluginInstance(PluginDelegate* delegate,
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // calls and handles PPB_ContentDecryptor_Private calls. 749 // calls and handles PPB_ContentDecryptor_Private calls.
753 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_; 750 scoped_ptr<ContentDecryptorDelegate> content_decryptor_delegate_;
754 751
755 DISALLOW_COPY_AND_ASSIGN(PluginInstance); 752 DISALLOW_COPY_AND_ASSIGN(PluginInstance);
756 }; 753 };
757 754
758 } // namespace ppapi 755 } // namespace ppapi
759 } // namespace webkit 756 } // namespace webkit
760 757
761 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 758 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698