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

Side by Side Diff: content/renderer/pepper/ppapi_plugin_instance_impl.h

Issue 20165002: Move webkit/plugins/ppapi to content/renderer/pepper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more more clang fun Created 7 years, 5 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 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_IMPL_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_IMPL_H_ 6 #define CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "cc/layers/texture_layer_client.h" 17 #include "cc/layers/texture_layer_client.h"
18 #include "content/common/content_export.h"
19 #include "content/public/renderer/ppapi_plugin_instance.h"
20 #include "content/renderer/pepper/plugin_delegate.h"
21 #include "content/renderer/pepper/ppp_pdf.h"
18 #include "ppapi/c/dev/pp_cursor_type_dev.h" 22 #include "ppapi/c/dev/pp_cursor_type_dev.h"
19 #include "ppapi/c/dev/ppp_find_dev.h" 23 #include "ppapi/c/dev/ppp_find_dev.h"
20 #include "ppapi/c/dev/ppp_printing_dev.h" 24 #include "ppapi/c/dev/ppp_printing_dev.h"
21 #include "ppapi/c/dev/ppp_selection_dev.h" 25 #include "ppapi/c/dev/ppp_selection_dev.h"
22 #include "ppapi/c/dev/ppp_text_input_dev.h" 26 #include "ppapi/c/dev/ppp_text_input_dev.h"
23 #include "ppapi/c/dev/ppp_zoom_dev.h" 27 #include "ppapi/c/dev/ppp_zoom_dev.h"
24 #include "ppapi/c/pp_completion_callback.h" 28 #include "ppapi/c/pp_completion_callback.h"
25 #include "ppapi/c/pp_instance.h" 29 #include "ppapi/c/pp_instance.h"
26 #include "ppapi/c/pp_time.h" 30 #include "ppapi/c/pp_time.h"
27 #include "ppapi/c/pp_var.h" 31 #include "ppapi/c/pp_var.h"
(...skipping 15 matching lines...) Expand all
43 #include "skia/ext/refptr.h" 47 #include "skia/ext/refptr.h"
44 #include "third_party/WebKit/public/platform/WebCanvas.h" 48 #include "third_party/WebKit/public/platform/WebCanvas.h"
45 #include "third_party/WebKit/public/platform/WebString.h" 49 #include "third_party/WebKit/public/platform/WebString.h"
46 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" 50 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
47 #include "third_party/WebKit/public/platform/WebURLResponse.h" 51 #include "third_party/WebKit/public/platform/WebURLResponse.h"
48 #include "third_party/WebKit/public/web/WebPlugin.h" 52 #include "third_party/WebKit/public/web/WebPlugin.h"
49 #include "third_party/WebKit/public/web/WebUserGestureToken.h" 53 #include "third_party/WebKit/public/web/WebUserGestureToken.h"
50 #include "ui/base/ime/text_input_type.h" 54 #include "ui/base/ime/text_input_type.h"
51 #include "ui/gfx/rect.h" 55 #include "ui/gfx/rect.h"
52 #include "url/gurl.h" 56 #include "url/gurl.h"
53 #include "webkit/plugins/ppapi/plugin_delegate.h"
54 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
55 #include "webkit/plugins/ppapi/ppp_pdf.h"
56 #include "webkit/plugins/webkit_plugins_export.h"
57 57
58 struct PP_Point; 58 struct PP_Point;
59 struct _NPP; 59 struct _NPP;
60 60
61 class SkBitmap; 61 class SkBitmap;
62 class TransportDIB; 62 class TransportDIB;
63 63
64 namespace WebKit { 64 namespace WebKit {
65 class WebInputEvent; 65 class WebInputEvent;
66 class WebLayer; 66 class WebLayer;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 class PluginModule; 102 class PluginModule;
103 class PluginObject; 103 class PluginObject;
104 class PPB_Graphics3D_Impl; 104 class PPB_Graphics3D_Impl;
105 class PPB_ImageData_Impl; 105 class PPB_ImageData_Impl;
106 class PPB_URLLoader_Impl; 106 class PPB_URLLoader_Impl;
107 107
108 // Represents one time a plugin appears on one web page. 108 // Represents one time a plugin appears on one web page.
109 // 109 //
110 // Note: to get from a PP_Instance to a PluginInstance*, use the 110 // Note: to get from a PP_Instance to a PluginInstance*, use the
111 // ResourceTracker. 111 // ResourceTracker.
112 class WEBKIT_PLUGINS_EXPORT PluginInstanceImpl : 112 class CONTENT_EXPORT PluginInstanceImpl
113 public base::RefCounted<PluginInstanceImpl>, 113 : public base::RefCounted<PluginInstanceImpl>,
114 public base::SupportsWeakPtr<PluginInstanceImpl>, 114 public base::SupportsWeakPtr<PluginInstanceImpl>,
115 public NON_EXPORTED_BASE(PluginInstance), 115 public NON_EXPORTED_BASE(PluginInstance),
116 public ::ppapi::PPB_Instance_Shared { 116 public ::ppapi::PPB_Instance_Shared {
117 public: 117 public:
118 // Create and return a PluginInstanceImpl object which supports the most 118 // Create and return a PluginInstanceImpl object which supports the most
119 // recent version of PPP_Instance possible by querying the given 119 // recent version of PPP_Instance possible by querying the given
120 // get_plugin_interface function. If the plugin does not support any valid 120 // get_plugin_interface function. If the plugin does not support any valid
121 // PPP_Instance interface, returns NULL. 121 // PPP_Instance interface, returns NULL.
122 static PluginInstanceImpl* Create(PluginDelegate* delegate, 122 static PluginInstanceImpl* Create(
123 content::RenderView* render_view, 123 PluginDelegate* delegate,
124 PluginModule* module, 124 content::RenderView* render_view,
125 WebKit::WebPluginContainer* container, 125 PluginModule* module,
126 const GURL& plugin_url); 126 WebKit::WebPluginContainer* container,
127 // Delete should be called by the WebPlugin before this destructor. 127 const GURL& plugin_url);
128 virtual ~PluginInstanceImpl();
129
130 PluginDelegate* delegate() const { return delegate_; } 128 PluginDelegate* delegate() const { return delegate_; }
131 PluginModule* module() const { return module_.get(); } 129 PluginModule* module() const { return module_.get(); }
132 MessageChannel& message_channel() { return *message_channel_; } 130 MessageChannel& message_channel() { return *message_channel_; }
133 131
134 WebKit::WebPluginContainer* container() const { return container_; } 132 WebKit::WebPluginContainer* container() const { return container_; }
135 133
136 // Returns the PP_Instance uniquely identifying this instance. Guaranteed 134 // Returns the PP_Instance uniquely identifying this instance. Guaranteed
137 // nonzero. 135 // nonzero.
138 PP_Instance pp_instance() const { return pp_instance_; } 136 PP_Instance pp_instance() const { return pp_instance_; }
139 137
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 WebKit::WebURLLoaderClient* document_loader() const { 346 WebKit::WebURLLoaderClient* document_loader() const {
349 return document_loader_; 347 return document_loader_;
350 } 348 }
351 void set_document_loader(WebKit::WebURLLoaderClient* loader) { 349 void set_document_loader(WebKit::WebURLLoaderClient* loader) {
352 document_loader_ = loader; 350 document_loader_ = loader;
353 } 351 }
354 352
355 ContentDecryptorDelegate* GetContentDecryptorDelegate(); 353 ContentDecryptorDelegate* GetContentDecryptorDelegate();
356 354
357 // webkit::ppapi::PluginInstance implementation 355 // webkit::ppapi::PluginInstance implementation
358 content::RenderView* GetRenderView(); 356 virtual content::RenderView* GetRenderView() OVERRIDE;
359 virtual WebKit::WebPluginContainer* GetContainer(); 357 virtual WebKit::WebPluginContainer* GetContainer() OVERRIDE;
360 virtual ::ppapi::VarTracker* GetVarTracker(); 358 virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE;
361 virtual const GURL& GetPluginURL(); 359 virtual const GURL& GetPluginURL() OVERRIDE;
362 virtual base::FilePath GetModulePath(); 360 virtual base::FilePath GetModulePath() OVERRIDE;
363 virtual PP_Resource CreateExternalFileReference( 361 virtual PP_Resource CreateExternalFileReference(
364 const base::FilePath& external_file_path); 362 const base::FilePath& external_file_path) OVERRIDE;
365 virtual PP_Resource CreateImage(gfx::ImageSkia* source_image, 363 virtual PP_Resource CreateImage(gfx::ImageSkia* source_image,
366 float scale); 364 float scale) OVERRIDE;
367 virtual PP_ExternalPluginResult SwitchToOutOfProcessProxy( 365 virtual PP_ExternalPluginResult SwitchToOutOfProcessProxy(
368 const base::FilePath& file_path, 366 const base::FilePath& file_path,
369 ::ppapi::PpapiPermissions permissions, 367 ::ppapi::PpapiPermissions permissions,
370 const IPC::ChannelHandle& channel_handle, 368 const IPC::ChannelHandle& channel_handle,
371 base::ProcessId plugin_pid, 369 base::ProcessId plugin_pid,
372 int plugin_child_id); 370 int plugin_child_id) OVERRIDE;
373 virtual void SetAlwaysOnTop(bool on_top); 371 virtual void SetAlwaysOnTop(bool on_top) OVERRIDE;
374 virtual bool IsFullPagePlugin(); 372 virtual bool IsFullPagePlugin() OVERRIDE;
375 virtual void FlashSetFullscreen(bool fullscreen, bool delay_report); 373 virtual void FlashSetFullscreen(bool fullscreen, bool delay_report) OVERRIDE;
376 virtual bool IsRectTopmost(const gfx::Rect& rect); 374 virtual bool IsRectTopmost(const gfx::Rect& rect) OVERRIDE;
377 virtual int32_t Navigate(const ::ppapi::URLRequestInfoData& request, 375 virtual int32_t Navigate(const ::ppapi::URLRequestInfoData& request,
378 const char* target, 376 const char* target,
379 bool from_user_action); 377 bool from_user_action) OVERRIDE;
380 378
381 // PPB_Instance_API implementation. 379 // PPB_Instance_API implementation.
382 virtual PP_Bool BindGraphics(PP_Instance instance, 380 virtual PP_Bool BindGraphics(PP_Instance instance,
383 PP_Resource device) OVERRIDE; 381 PP_Resource device) OVERRIDE;
384 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; 382 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE;
385 virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE; 383 virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE;
386 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; 384 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE;
387 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE; 385 virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE;
388 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE; 386 virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE;
389 virtual PP_Var ExecuteScript(PP_Instance instance, 387 virtual PP_Var ExecuteScript(PP_Instance instance,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 501
504 // Returns the plugin NPP identifier that this plugin will use to identify 502 // Returns the plugin NPP identifier that this plugin will use to identify
505 // itself when making NPObject scripting calls to WebBindings. 503 // itself when making NPObject scripting calls to WebBindings.
506 struct _NPP* instanceNPP(); 504 struct _NPP* instanceNPP();
507 505
508 // Returns the v8::Isolate that was current when this Instance was created. 506 // Returns the v8::Isolate that was current when this Instance was created.
509 // This is not inlined so as to avoid an unnecessary header include of v8.h. 507 // This is not inlined so as to avoid an unnecessary header include of v8.h.
510 v8::Isolate* GetIsolate() const; 508 v8::Isolate* GetIsolate() const;
511 509
512 private: 510 private:
511 friend class base::RefCounted<PluginInstanceImpl>;
513 friend class PpapiUnittest; 512 friend class PpapiUnittest;
514 513
514 // Delete should be called by the WebPlugin before this destructor.
515 virtual ~PluginInstanceImpl();
516
515 // Class to record document load notifications and play them back once the 517 // Class to record document load notifications and play them back once the
516 // real document loader becomes available. Used only by NaCl instances. 518 // real document loader becomes available. Used only by NaCl instances.
517 class NaClDocumentLoader : public WebKit::WebURLLoaderClient { 519 class NaClDocumentLoader : public WebKit::WebURLLoaderClient {
518 public: 520 public:
519 NaClDocumentLoader(); 521 NaClDocumentLoader();
520 virtual ~NaClDocumentLoader(); 522 virtual ~NaClDocumentLoader();
521 523
522 void ReplayReceivedData(WebURLLoaderClient* document_loader); 524 void ReplayReceivedData(WebURLLoaderClient* document_loader);
523 525
524 // WebKit::WebURLLoaderClient implementation. 526 // WebKit::WebURLLoaderClient implementation.
(...skipping 16 matching lines...) Expand all
541 // number of interfaces implemented by PluginInstanceImpl. 543 // number of interfaces implemented by PluginInstanceImpl.
542 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API, 544 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API,
543 public ::ppapi::Resource { 545 public ::ppapi::Resource {
544 public: 546 public:
545 explicit GamepadImpl(PluginDelegate* delegate); 547 explicit GamepadImpl(PluginDelegate* delegate);
546 // Resource implementation. 548 // Resource implementation.
547 virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE; 549 virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE;
548 virtual void Sample(PP_Instance instance, 550 virtual void Sample(PP_Instance instance,
549 PP_GamepadsSampleData* data) OVERRIDE; 551 PP_GamepadsSampleData* data) OVERRIDE;
550 private: 552 private:
553 virtual ~GamepadImpl();
551 PluginDelegate* delegate_; 554 PluginDelegate* delegate_;
552 }; 555 };
553 556
554 // See the static Create functions above for creating PluginInstanceImpl 557 // See the static Create functions above for creating PluginInstanceImpl
555 // objects. This constructor is private so that we can hide the 558 // objects. This constructor is private so that we can hide the
556 // PPP_Instance_Combined details while still having 1 constructor to maintain 559 // PPP_Instance_Combined details while still having 1 constructor to maintain
557 // for member initialization. 560 // for member initialization.
558 PluginInstanceImpl(PluginDelegate* delegate, 561 PluginInstanceImpl(PluginDelegate* delegate,
559 content::RenderView* render_view, 562 content::RenderView* render_view,
560 PluginModule* module, 563 PluginModule* module,
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 // Isolate in which this Instance was created when interacting with v8. 854 // Isolate in which this Instance was created when interacting with v8.
852 v8::Isolate* isolate_; 855 v8::Isolate* isolate_;
853 856
854 friend class PpapiPluginInstanceTest; 857 friend class PpapiPluginInstanceTest;
855 DISALLOW_COPY_AND_ASSIGN(PluginInstanceImpl); 858 DISALLOW_COPY_AND_ASSIGN(PluginInstanceImpl);
856 }; 859 };
857 860
858 } // namespace ppapi 861 } // namespace ppapi
859 } // namespace webkit 862 } // namespace webkit
860 863
861 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_IMPL_H_ 864 #endif // CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/ppapi_interface_factory.cc ('k') | content/renderer/pepper/ppapi_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698