| 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 #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 17 matching lines...) Expand all Loading... |
| 28 #include "ppapi/c/pp_time.h" | 28 #include "ppapi/c/pp_time.h" |
| 29 #include "ppapi/c/pp_var.h" | 29 #include "ppapi/c/pp_var.h" |
| 30 #include "ppapi/c/ppb_audio_config.h" | 30 #include "ppapi/c/ppb_audio_config.h" |
| 31 #include "ppapi/c/ppb_gamepad.h" | 31 #include "ppapi/c/ppb_gamepad.h" |
| 32 #include "ppapi/c/ppb_input_event.h" | 32 #include "ppapi/c/ppb_input_event.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/ppb_nacl_private.h" | |
| 39 #include "ppapi/c/private/ppp_instance_private.h" | 38 #include "ppapi/c/private/ppp_instance_private.h" |
| 40 #include "ppapi/shared_impl/ppb_instance_shared.h" | 39 #include "ppapi/shared_impl/ppb_instance_shared.h" |
| 41 #include "ppapi/shared_impl/ppb_view_shared.h" | 40 #include "ppapi/shared_impl/ppb_view_shared.h" |
| 42 #include "ppapi/shared_impl/singleton_resource_id.h" | 41 #include "ppapi/shared_impl/singleton_resource_id.h" |
| 43 #include "ppapi/shared_impl/tracked_callback.h" | 42 #include "ppapi/shared_impl/tracked_callback.h" |
| 44 #include "ppapi/thunk/ppb_gamepad_api.h" | 43 #include "ppapi/thunk/ppb_gamepad_api.h" |
| 45 #include "ppapi/thunk/resource_creation_api.h" | 44 #include "ppapi/thunk/resource_creation_api.h" |
| 46 #include "skia/ext/refptr.h" | 45 #include "skia/ext/refptr.h" |
| 47 #include "third_party/WebKit/public/platform/WebCanvas.h" | 46 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 48 #include "third_party/WebKit/public/platform/WebString.h" | 47 #include "third_party/WebKit/public/platform/WebString.h" |
| 49 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 48 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
| 50 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 49 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 51 #include "third_party/WebKit/public/web/WebPlugin.h" | 50 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 52 #include "third_party/WebKit/public/web/WebUserGestureToken.h" | 51 #include "third_party/WebKit/public/web/WebUserGestureToken.h" |
| 53 #include "ui/base/ime/text_input_type.h" | 52 #include "ui/base/ime/text_input_type.h" |
| 54 #include "ui/gfx/rect.h" | 53 #include "ui/gfx/rect.h" |
| 55 #include "url/gurl.h" | 54 #include "url/gurl.h" |
| 56 #include "webkit/plugins/ppapi/plugin_delegate.h" | 55 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 57 #include "webkit/plugins/ppapi/ppp_pdf.h" | 56 #include "webkit/plugins/ppapi/ppp_pdf.h" |
| 58 #include "webkit/plugins/webkit_plugins_export.h" | 57 #include "webkit/plugins/webkit_plugins_export.h" |
| 59 | 58 |
| 60 struct PP_Point; | 59 struct PP_Point; |
| 61 struct _NPP; | 60 struct _NPP; |
| 62 | 61 |
| 63 class SkBitmap; | 62 class SkBitmap; |
| 64 class TransportDIB; | 63 class TransportDIB; |
| 65 | 64 |
| 65 namespace IPC { |
| 66 struct ChannelHandle; |
| 67 } |
| 68 |
| 66 namespace WebKit { | 69 namespace WebKit { |
| 67 class WebInputEvent; | 70 class WebInputEvent; |
| 68 class WebLayer; | 71 class WebLayer; |
| 69 class WebMouseEvent; | 72 class WebMouseEvent; |
| 70 class WebPluginContainer; | 73 class WebPluginContainer; |
| 71 class WebURLLoader; | 74 class WebURLLoader; |
| 72 class WebURLResponse; | 75 class WebURLResponse; |
| 73 struct WebCompositionUnderline; | 76 struct WebCompositionUnderline; |
| 74 struct WebCursorInfo; | 77 struct WebCursorInfo; |
| 75 struct WebURLError; | 78 struct WebURLError; |
| 76 struct WebPrintParams; | 79 struct WebPrintParams; |
| 77 } | 80 } |
| 78 | 81 |
| 79 namespace cc { | 82 namespace cc { |
| 80 class TextureLayer; | 83 class TextureLayer; |
| 81 } | 84 } |
| 82 | 85 |
| 83 namespace content { | 86 namespace content { |
| 84 class RenderView; | 87 class RenderView; |
| 85 } | 88 } |
| 86 | 89 |
| 87 namespace gfx { | 90 namespace gfx { |
| 88 class ImageSkia; | 91 class ImageSkia; |
| 89 } | 92 } |
| 90 | 93 |
| 91 namespace ppapi { | 94 namespace ppapi { |
| 95 class PpapiPermissions; |
| 96 class Resource; |
| 92 struct InputEventData; | 97 struct InputEventData; |
| 93 struct PPP_Instance_Combined; | 98 struct PPP_Instance_Combined; |
| 94 class Resource; | |
| 95 struct URLRequestInfoData; | 99 struct URLRequestInfoData; |
| 96 } | 100 } |
| 97 | 101 |
| 98 namespace ui { | 102 namespace ui { |
| 99 class Range; | 103 class Range; |
| 100 } | 104 } |
| 101 | 105 |
| 102 namespace v8 { | 106 namespace v8 { |
| 103 class Isolate; | 107 class Isolate; |
| 104 } | 108 } |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 virtual void DeliverFrame(PP_Instance instance, | 493 virtual void DeliverFrame(PP_Instance instance, |
| 490 PP_Resource decrypted_frame, | 494 PP_Resource decrypted_frame, |
| 491 const PP_DecryptedFrameInfo* frame_info) OVERRIDE; | 495 const PP_DecryptedFrameInfo* frame_info) OVERRIDE; |
| 492 virtual void DeliverSamples(PP_Instance instance, | 496 virtual void DeliverSamples(PP_Instance instance, |
| 493 PP_Resource audio_frames, | 497 PP_Resource audio_frames, |
| 494 const PP_DecryptedBlockInfo* block_info) OVERRIDE; | 498 const PP_DecryptedBlockInfo* block_info) OVERRIDE; |
| 495 | 499 |
| 496 // Reset this instance as proxied. Assigns the instance a new module, resets | 500 // Reset this instance as proxied. Assigns the instance a new module, resets |
| 497 // cached interfaces to point to the out-of-process proxy and re-sends | 501 // cached interfaces to point to the out-of-process proxy and re-sends |
| 498 // DidCreate, DidChangeView, and HandleDocumentLoad (if necessary). | 502 // DidCreate, DidChangeView, and HandleDocumentLoad (if necessary). |
| 499 // This should be used only when switching a trusted NaCl in-process instance | 503 // This should be used only when switching an in-process instance to an |
| 500 // to an untrusted NaCl out-of-process instance. | 504 // external out-of-process instance. |
| 501 PP_NaClResult ResetAsProxied(scoped_refptr<PluginModule> module); | 505 PP_ExternalPluginResult ResetAsProxied(scoped_refptr<PluginModule> module); |
| 502 | 506 |
| 503 // Checks whether this is a valid instance of the given module. After calling | 507 // Checks whether this is a valid instance of the given module. After calling |
| 504 // ResetAsProxied above, a NaCl plugin instance's module changes, so external | 508 // ResetAsProxied above, a NaCl plugin instance's module changes, so external |
| 505 // hosts won't recognize it as a valid instance of the original module. This | 509 // hosts won't recognize it as a valid instance of the original module. This |
| 506 // method fixes that be checking that either module_ or original_module_ match | 510 // method fixes that be checking that either module_ or original_module_ match |
| 507 // the given module. | 511 // the given module. |
| 508 bool IsValidInstanceOf(PluginModule* module); | 512 bool IsValidInstanceOf(PluginModule* module); |
| 509 | 513 |
| 510 // Returns the plugin NPP identifier that this plugin will use to identify | 514 // Returns the plugin NPP identifier that this plugin will use to identify |
| 511 // itself when making NPObject scripting calls to WebBindings. | 515 // itself when making NPObject scripting calls to WebBindings. |
| 512 struct _NPP* instanceNPP(); | 516 struct _NPP* instanceNPP(); |
| 513 | 517 |
| 514 // Returns the v8::Isolate that was current when this Instance was created. | 518 // Returns the v8::Isolate that was current when this Instance was created. |
| 515 // This is not inlined so as to avoid an unnecessary header include of v8.h. | 519 // This is not inlined so as to avoid an unnecessary header include of v8.h. |
| 516 v8::Isolate* GetIsolate() const; | 520 v8::Isolate* GetIsolate() const; |
| 517 | 521 |
| 518 // Returns a reference to a file with the given path. | 522 // Returns a reference to a file with the given path. |
| 519 // The returned object will have a refcount of 0 (just like "new"). | 523 // The returned object will have a refcount of 0 (just like "new"). |
| 520 PP_Resource CreateExternalFileReference( | 524 PP_Resource CreateExternalFileReference( |
| 521 const base::FilePath& external_file_path); | 525 const base::FilePath& external_file_path); |
| 522 | 526 |
| 523 // Creates a PPB_ImageData given a Skia image. | 527 // Creates a PPB_ImageData given a Skia image. |
| 524 PP_Resource CreateImage(gfx::ImageSkia* source_image, float scale); | 528 PP_Resource CreateImage(gfx::ImageSkia* source_image, float scale); |
| 525 | 529 |
| 530 // Returns the location of this module. |
| 531 base::FilePath GetModulePath(); |
| 532 |
| 533 // Switches this instance with one that uses the out of process IPC proxy. |
| 534 PP_ExternalPluginResult SwitchToOutOfProcessProxy( |
| 535 const base::FilePath& file_path, |
| 536 ::ppapi::PpapiPermissions permissions, |
| 537 const IPC::ChannelHandle& channel_handle, |
| 538 base::ProcessId plugin_pid, |
| 539 int plugin_child_id); |
| 540 |
| 526 private: | 541 private: |
| 527 friend class PpapiUnittest; | 542 friend class PpapiUnittest; |
| 528 | 543 |
| 529 // Class to record document load notifications and play them back once the | 544 // Class to record document load notifications and play them back once the |
| 530 // real document loader becomes available. Used only by NaCl instances. | 545 // real document loader becomes available. Used only by NaCl instances. |
| 531 class NaClDocumentLoader : public WebKit::WebURLLoaderClient { | 546 class NaClDocumentLoader : public WebKit::WebURLLoaderClient { |
| 532 public: | 547 public: |
| 533 NaClDocumentLoader(); | 548 NaClDocumentLoader(); |
| 534 virtual ~NaClDocumentLoader(); | 549 virtual ~NaClDocumentLoader(); |
| 535 | 550 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 v8::Isolate* isolate_; | 881 v8::Isolate* isolate_; |
| 867 | 882 |
| 868 friend class PpapiPluginInstanceTest; | 883 friend class PpapiPluginInstanceTest; |
| 869 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 884 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 870 }; | 885 }; |
| 871 | 886 |
| 872 } // namespace ppapi | 887 } // namespace ppapi |
| 873 } // namespace webkit | 888 } // namespace webkit |
| 874 | 889 |
| 875 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 890 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |