diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 14:49:32 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 14:49:32 +0000 |
commit | 8cef2068010fa12968211e3721d60d4d5fd3d4e9 (patch) | |
tree | 63907b7fd8fc28fd2d9a343772edb66a79a4d19a | |
parent | 304d682f570f60644c97fea6d86bc303ba6b2ac5 (diff) | |
download | chromium_src-8cef2068010fa12968211e3721d60d4d5fd3d4e9.zip chromium_src-8cef2068010fa12968211e3721d60d4d5fd3d4e9.tar.gz chromium_src-8cef2068010fa12968211e3721d60d4d5fd3d4e9.tar.bz2 |
Rename Instance_Trusted to Instance_Private, wire it up in Chrome.
Add C++ InstancePrivate.
BUG=None
TEST=PPAPI tests
Review URL: http://codereview.chromium.org/6871040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82104 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ppapi/c/private/ppb_instance_private.h (renamed from ppapi/c/trusted/ppb_instance_trusted.h) | 14 | ||||
-rw-r--r-- | ppapi/c/private/ppp_instance_private.h (renamed from ppapi/c/trusted/ppp_instance_trusted.h) | 14 | ||||
-rw-r--r-- | ppapi/cpp/private/instance_private.cc | 72 | ||||
-rw-r--r-- | ppapi/cpp/private/instance_private.h | 60 | ||||
-rw-r--r-- | ppapi/cpp/private/var_private.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/private/var_private.h | 4 | ||||
-rw-r--r-- | ppapi/example/example.cc | 13 | ||||
-rw-r--r-- | ppapi/ppapi_cpp.gypi | 6 | ||||
-rw-r--r-- | ppapi/tests/all_c_includes.h | 4 | ||||
-rw-r--r-- | ppapi/tests/all_cpp_includes.h | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 3 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 40 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.h | 9 |
13 files changed, 211 insertions, 36 deletions
diff --git a/ppapi/c/trusted/ppb_instance_trusted.h b/ppapi/c/private/ppb_instance_private.h index 44c9f77..730d909 100644 --- a/ppapi/c/trusted/ppb_instance_trusted.h +++ b/ppapi/c/private/ppb_instance_private.h @@ -2,17 +2,17 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#ifndef PPAPI_C_TRUSTED_PPB_INSTANCE_TRUSTED_H_ -#define PPAPI_C_TRUSTED_PPB_INSTANCE_TRUSTED_H_ +#ifndef PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_ +#define PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_var.h" -#define PPB_INSTANCE_TRUSTED_INTERFACE "PPB_Instance_Trusted;0.1" +#define PPB_INSTANCE_PRIVATE_INTERFACE "PPB_Instance_Private;0.1" /** * @file - * This file defines the PPB_Instance_Trusted interface implemented by the + * This file defines the PPB_Instance_Private interface implemented by the * browser and containing pointers to functions available only to trusted plugin * instances. * @@ -21,11 +21,11 @@ */ /** - * The PPB_Instance_Trusted interface contains functions available only to + * The PPB_Instance_Private interface contains functions available only to * trusted plugin instances. * */ -struct PPB_Instance_Trusted { +struct PPB_Instance_Private { /** * GetWindowObject is a pointer to a function that determines * the DOM window containing this module instance. @@ -70,5 +70,5 @@ struct PPB_Instance_Trusted { * @} */ -#endif /* PPAPI_C_TRUSTED_PPB_INSTANCE_TRUSTED_H_ */ +#endif /* PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_ */ diff --git a/ppapi/c/trusted/ppp_instance_trusted.h b/ppapi/c/private/ppp_instance_private.h index b010db4..e587d26 100644 --- a/ppapi/c/trusted/ppp_instance_trusted.h +++ b/ppapi/c/private/ppp_instance_private.h @@ -2,18 +2,18 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#ifndef PPAPI_C_TRUSTED_PPP_INSTANCE_TRUSTED_H_ -#define PPAPI_C_TRUSTED_PPP_INSTANCE_TRUSTED_H_ +#ifndef PPAPI_C_PRIVATE_PPP_INSTANCE_PRIVATE_H_ +#define PPAPI_C_PRIVATE_PPP_INSTANCE_PRIVATE_H_ #include "ppapi/c/pp_instance.h" struct PP_Var; -#define PPP_INSTANCE_TRUSTED_INTERFACE "PPP_Instance_Trusted;0.1" +#define PPP_INSTANCE_PRIVATE_INTERFACE "PPP_Instance_Private;0.1" /** * @file - * This file defines the PPP_InstanceTrusted structure; a series of functions + * This file defines the PPP_InstancePrivate structure; a series of functions * that a trusted plugin may implement to provide capabilities only available * to trusted plugins. * @@ -24,12 +24,12 @@ struct PP_Var; */ /** - * The PPP_Instance_Trusted interface contains pointers to a series of + * The PPP_Instance_Private interface contains pointers to a series of * functions that may be implemented in a trusted plugin to provide capabilities * that aren't possible in untrusted modules. */ -struct PPP_Instance_Trusted { +struct PPP_Instance_Private { /** * GetInstanceObject returns a PP_Var representing the scriptable object for * the given instance. Normally this will be a PPP_Class_Deprecated object @@ -50,5 +50,5 @@ struct PPP_Instance_Trusted { * @} */ -#endif /* PPAPI_C_TRUSTED_PPP_INSTANCE_TRUSTED_H_ */ +#endif /* PPAPI_C_PRIVATE_PPP_INSTANCE_PRIVATE_H_ */ diff --git a/ppapi/cpp/private/instance_private.cc b/ppapi/cpp/private/instance_private.cc new file mode 100644 index 0000000..2a924a3 --- /dev/null +++ b/ppapi/cpp/private/instance_private.cc @@ -0,0 +1,72 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/cpp/private/instance_private.h" + +#include "ppapi/c/private/ppb_instance_private.h" +#include "ppapi/c/private/ppp_instance_private.h" +#include "ppapi/cpp/module_impl.h" +#include "ppapi/cpp/private/var_private.h" + +namespace pp { + +namespace { + +template <> const char* interface_name<PPB_Instance_Private>() { + return PPB_INSTANCE_PRIVATE_INTERFACE; +} + +PP_Var GetInstanceObject(PP_Instance pp_instance) { + Module* module_singleton = Module::Get(); + if (!module_singleton) + return Var().Detach(); + InstancePrivate* instance_private = static_cast<InstancePrivate*>( + module_singleton->InstanceForPPInstance(pp_instance)); + if (!instance_private) + return Var().Detach(); + return instance_private->GetInstanceObject().Detach(); +} + +const PPP_Instance_Private ppp_instance_private = { + &GetInstanceObject +}; + +} // namespace + +InstancePrivate::InstancePrivate(PP_Instance instance) : Instance(instance) { + // If at least 1 InstancePrivate is created, register the PPP_INSTANCE_PRIVATE + // interface. + Module::Get()->AddPluginInterface(PPP_INSTANCE_PRIVATE_INTERFACE, + &ppp_instance_private); +} + +InstancePrivate::~InstancePrivate() {} + +VarPrivate InstancePrivate::GetWindowObject() { + if (!has_interface<PPB_Instance_Private>()) + return VarPrivate(); + return VarPrivate(Var::PassRef(), + get_interface<PPB_Instance_Private>()->GetWindowObject(pp_instance())); +} + +VarPrivate InstancePrivate::GetOwnerElementObject() { + if (!has_interface<PPB_Instance_Private>()) + return VarPrivate(); + return VarPrivate(Var::PassRef(), + get_interface<PPB_Instance_Private>()->GetOwnerElementObject( + pp_instance())); +} + +VarPrivate InstancePrivate::ExecuteScript(const VarPrivate& script, + VarPrivate* exception) { + if (!has_interface<PPB_Instance_Private>()) + return VarPrivate(); + return VarPrivate(Var::PassRef(), + get_interface<PPB_Instance_Private>()->ExecuteScript( + pp_instance(), + script.pp_var(), + VarPrivate::OutException(exception).get())); +} + +} // namespace pp diff --git a/ppapi/cpp/private/instance_private.h b/ppapi/cpp/private/instance_private.h new file mode 100644 index 0000000..226494c --- /dev/null +++ b/ppapi/cpp/private/instance_private.h @@ -0,0 +1,60 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_CPP_PRIVATE_INSTANCE_PRIVATE_H_ +#define PPAPI_CPP_PRIVATE_INSTANCE_PRIVATE_H_ + +/** + * @file + * Defines the API ... + * + * @addtogroup CPP + * @{ + */ + +#include "ppapi/cpp/instance.h" + +/** The C++ interface to the Pepper API. */ +namespace pp { + +class VarPrivate; + +class InstancePrivate : public Instance { + public: + explicit InstancePrivate(PP_Instance instance); + virtual ~InstancePrivate(); + + // @{ + /// @name PPP_Instance_Private methods for the plugin to override: + + /// See PPP_Instance_Private.GetInstanceObject. + // TODO(dmichael): Put this virtual function here and remove the + // 'Var GetInstanceObject()' version from pp::Instance. + //virtual VarPrivate GetInstanceObject(); + + // @} + + // @{ + /// @name PPB_Instance_Private methods for querying the browser: + + /// See PPB_Instance_Private.GetWindowObject. + VarPrivate GetWindowObject(); + + /// See PPB_Instance_Private.GetOwnerElementObject. + VarPrivate GetOwnerElementObject(); + + /// See PPB_Instance.ExecuteScript. + VarPrivate ExecuteScript(const VarPrivate& script, + VarPrivate* exception = NULL); + + // @} +}; + +} // namespace pp + +/** + * @} + * End addtogroup CPP + */ +#endif // PPAPI_CPP_PRIVATE_INSTANCE_PRIVATE_H_ diff --git a/ppapi/cpp/private/var_private.cc b/ppapi/cpp/private/var_private.cc index c3da55d..5db0aa3 100644 --- a/ppapi/cpp/private/var_private.cc +++ b/ppapi/cpp/private/var_private.cc @@ -5,7 +5,7 @@ #include "ppapi/cpp/private/var_private.h" #include "ppapi/c/dev/ppb_var_deprecated.h" -#include "ppapi/cpp/instance.h" +#include "ppapi/cpp/private/instance_private.h" #include "ppapi/cpp/logging.h" #include "ppapi/cpp/module_impl.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" @@ -22,7 +22,7 @@ template <> const char* interface_name<PPB_Var_Deprecated>() { using namespace deprecated; -VarPrivate::VarPrivate(Instance* instance, ScriptableObject* object) { +VarPrivate::VarPrivate(InstancePrivate* instance, ScriptableObject* object) { if (has_interface<PPB_Var_Deprecated>()) { var_ = get_interface<PPB_Var_Deprecated>()->CreateObject( instance->pp_instance(), object->GetClass(), object); diff --git a/ppapi/cpp/private/var_private.h b/ppapi/cpp/private/var_private.h index 55068bc..5ab1e07b 100644 --- a/ppapi/cpp/private/var_private.h +++ b/ppapi/cpp/private/var_private.h @@ -9,6 +9,8 @@ namespace pp { +class InstancePrivate; + // VarPrivate is a version of Var that exposes the private scripting API. // It's designed to be mostly interchangable with Var since most callers will // be dealing with Vars from various places. @@ -23,7 +25,7 @@ class VarPrivate : public Var { VarPrivate(const std::string& utf8_str) : Var(utf8_str) {} VarPrivate(PassRef, PP_Var var) : Var(PassRef(), var) {} VarPrivate(DontManage, PP_Var var) : Var(DontManage(), var) {} - VarPrivate(Instance* instance, deprecated::ScriptableObject* object); + VarPrivate(InstancePrivate* instance, deprecated::ScriptableObject* object); VarPrivate(const Var& other) : Var(other) {} virtual ~VarPrivate() {} diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc index d660bc4..6f5c950 100644 --- a/ppapi/example/example.cc +++ b/ppapi/example/example.cc @@ -23,7 +23,7 @@ #include "ppapi/cpp/dev/scriptable_object_deprecated.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/image_data.h" -#include "ppapi/cpp/instance.h" +#include "ppapi/cpp/private/instance_private.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/private/var_private.h" #include "ppapi/cpp/rect.h" @@ -48,7 +48,8 @@ void FillRect(pp::ImageData* image, int left, int top, int width, int height, class MyScriptableObject : public pp::deprecated::ScriptableObject { public: - explicit MyScriptableObject(pp::Instance* instance) : instance_(instance) {} + explicit MyScriptableObject(pp::InstancePrivate* instance) + : instance_(instance) {} virtual bool HasMethod(const pp::Var& method, pp::Var* exception) { return method.AsString() == "toString"; @@ -80,7 +81,7 @@ class MyScriptableObject : public pp::deprecated::ScriptableObject { } private: - pp::Instance* instance_; + pp::InstancePrivate* instance_; }; class MyFetcherClient { @@ -94,7 +95,7 @@ class MyFetcher { callback_factory_.Initialize(this); } - void Start(const pp::Instance& instance, + void Start(const pp::InstancePrivate& instance, const pp::Var& url, MyFetcherClient* client) { pp::URLRequestInfo request; @@ -157,10 +158,10 @@ class MyFetcher { std::string data_; }; -class MyInstance : public pp::Instance, public MyFetcherClient { +class MyInstance : public pp::InstancePrivate, public MyFetcherClient { public: MyInstance(PP_Instance instance) - : pp::Instance(instance), + : pp::InstancePrivate(instance), time_at_last_check_(0.0), fetcher_(NULL), width_(0), diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi index 259fdaad..4ce6d01 100644 --- a/ppapi/ppapi_cpp.gypi +++ b/ppapi/ppapi_cpp.gypi @@ -90,9 +90,11 @@ 'c/private/ppb_flash_file.h', 'c/private/ppb_flash_menu.h', 'c/private/ppb_flash_net_connector.h', + 'c/private/ppb_instance_private.h', 'c/private/ppb_nacl_private.h', 'c/private/ppb_pdf.h', 'c/private/ppb_proxy_private.h', + 'c/private/ppp_instance_private.h', # Deprecated interfaces. 'c/dev/deprecated_bool.h', @@ -103,10 +105,8 @@ 'c/trusted/ppb_audio_trusted.h', 'c/trusted/ppb_image_data_trusted.h', 'c/trusted/ppb_broker_trusted.h', - 'c/trusted/ppb_instance_trusted.h', 'c/trusted/ppb_url_loader_trusted.h', 'c/trusted/ppp_broker.h', - 'c/trusted/ppp_instance_trusted.h', ], }, { @@ -210,6 +210,8 @@ 'cpp/dev/scriptable_object_deprecated.cc', # Private interfaces. + 'cpp/private/instance_private.cc', + 'cpp/private/instance_private.h', 'cpp/private/var_private.cc', 'cpp/private/var_private.h', ], diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index 62f2f96..ab68dd1 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -80,13 +80,13 @@ #include "ppapi/c/ppp_messaging.h" #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_flash_menu.h" +#include "ppapi/c/private/ppb_instance_private.h" #include "ppapi/c/private/ppb_nacl_private.h" #include "ppapi/c/private/ppb_pdf.h" +#include "ppapi/c/private/ppp_instance_private.h" #include "ppapi/c/trusted/ppb_audio_trusted.h" #include "ppapi/c/trusted/ppb_image_data_trusted.h" -#include "ppapi/c/trusted/ppb_instance_trusted.h" #include "ppapi/c/trusted/ppb_url_loader_trusted.h" -#include "ppapi/c/trusted/ppp_instance_trusted.h" #endif /* PPAPI_TESTS_ALL_C_INCLUDES_H_ */ diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h index 5860f65..91862fe 100644 --- a/ppapi/tests/all_cpp_includes.h +++ b/ppapi/tests/all_cpp_includes.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -46,6 +46,8 @@ #include "ppapi/cpp/non_thread_safe_ref_count.h" #include "ppapi/cpp/paint_aggregator.h" #include "ppapi/cpp/paint_manager.h" +#include "ppapi/cpp/private/instance_private.cc" +#include "ppapi/cpp/private/instance_private.h" #include "ppapi/cpp/point.h" #include "ppapi/cpp/rect.h" #include "ppapi/cpp/resource.h" diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index 7e8dc4a..7fc683e 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -55,6 +55,7 @@ #include "ppapi/c/private/ppb_flash_file.h" #include "ppapi/c/private/ppb_flash_menu.h" #include "ppapi/c/private/ppb_flash_net_connector.h" +#include "ppapi/c/private/ppb_instance_private.h" #include "ppapi/c/private/ppb_pdf.h" #include "ppapi/c/private/ppb_proxy_private.h" #include "ppapi/c/private/ppb_nacl_private.h" @@ -280,6 +281,8 @@ const void* GetInterface(const char* name) { return PPB_ImageData_Impl::GetTrustedInterface(); if (strcmp(name, PPB_INSTANCE_INTERFACE) == 0) return PluginInstance::GetInterface(); + if (strcmp(name, PPB_INSTANCE_PRIVATE_INTERFACE) == 0) + return PluginInstance::GetPrivateInterface(); if (strcmp(name, PPB_MESSAGING_INTERFACE) == 0) return PluginInstance::GetMessagingInterface(); if (strcmp(name, PPB_PDF_INTERFACE) == 0) diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 78df75b..0d81fa9 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -25,6 +25,8 @@ #include "ppapi/c/ppb_messaging.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/c/ppp_messaging.h" +#include "ppapi/c/private/ppb_instance_private.h" +#include "ppapi/c/private/ppp_instance_private.h" #include "printing/units.h" #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" @@ -213,6 +215,12 @@ const PPB_Instance ppb_instance = { &ExecuteScript, }; +const PPB_Instance_Private ppb_instance_private = { + &GetWindowObject, + &GetOwnerElementObject, + &ExecuteScript +}; + void NumberOfFindResultsChanged(PP_Instance instance_id, int32_t total, PP_Bool final_result) { @@ -405,6 +413,11 @@ const PPB_Messaging* PluginInstance::GetMessagingInterface() { } // static +const PPB_Instance_Private* PluginInstance::GetPrivateInterface() { + return &ppb_instance_private; +} + +// static const PPB_Zoom_Dev* PluginInstance::GetZoomInterface() { return &ppb_zoom; } @@ -741,6 +754,12 @@ void PluginInstance::HandleMessage(PP_Var message) { } PP_Var PluginInstance::GetInstanceObject() { + // Try the private interface first. If it is not supported, we fall back to + // the primary PPP_Instance interface. + // TODO(dmichael): Remove support for PPP_Instance.GetInstanceObject + if (LoadPrivateInterface()) { + return plugin_private_interface_->GetInstanceObject(pp_instance()); + } return instance_interface_->GetInstanceObject(pp_instance()); } @@ -909,7 +928,7 @@ void PluginInstance::StopFind() { bool PluginInstance::LoadFindInterface() { if (!plugin_find_interface_) { plugin_find_interface_ = - reinterpret_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( + static_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( PPP_FIND_DEV_INTERFACE)); } @@ -920,7 +939,7 @@ bool PluginInstance::LoadMessagingInterface() { if (!checked_for_plugin_messaging_interface_) { checked_for_plugin_messaging_interface_ = true; plugin_messaging_interface_ = - reinterpret_cast<const PPP_Messaging*>(module_->GetPluginInterface( + static_cast<const PPP_Messaging*>(module_->GetPluginInterface( PPP_MESSAGING_INTERFACE)); } @@ -930,7 +949,7 @@ bool PluginInstance::LoadMessagingInterface() { bool PluginInstance::LoadPdfInterface() { if (!plugin_pdf_interface_) { plugin_pdf_interface_ = - reinterpret_cast<const PPP_Pdf*>(module_->GetPluginInterface( + static_cast<const PPP_Pdf*>(module_->GetPluginInterface( PPP_PDF_INTERFACE)); } @@ -940,17 +959,26 @@ bool PluginInstance::LoadPdfInterface() { bool PluginInstance::LoadSelectionInterface() { if (!plugin_selection_interface_) { plugin_selection_interface_ = - reinterpret_cast<const PPP_Selection_Dev*>(module_->GetPluginInterface( + static_cast<const PPP_Selection_Dev*>(module_->GetPluginInterface( PPP_SELECTION_DEV_INTERFACE)); } return !!plugin_selection_interface_; } +bool PluginInstance::LoadPrivateInterface() { + if (!plugin_private_interface_) { + plugin_private_interface_ = static_cast<const PPP_Instance_Private*>( + module_->GetPluginInterface(PPP_INSTANCE_PRIVATE_INTERFACE)); + } + + return !!plugin_private_interface_; +} + bool PluginInstance::LoadZoomInterface() { if (!plugin_zoom_interface_) { plugin_zoom_interface_ = - reinterpret_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface( + static_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface( PPP_ZOOM_DEV_INTERFACE)); } @@ -975,7 +1003,7 @@ bool PluginInstance::GetPreferredPrintOutputFormat( scoped_refptr<PluginInstance> ref(this); if (!plugin_print_interface_) { plugin_print_interface_ = - reinterpret_cast<const PPP_Printing_Dev*>(module_->GetPluginInterface( + static_cast<const PPP_Printing_Dev*>(module_->GetPluginInterface( PPP_PRINTING_DEV_INTERFACE)); } if (!plugin_print_interface_) diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index f60dc88..c36419e 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -28,12 +28,14 @@ typedef struct NPObject NPObject; struct PP_Var; struct PPB_Instance; +struct PPB_Instance_Private; struct PPB_Find_Dev; struct PPB_Fullscreen_Dev; struct PPB_Messaging; struct PPB_Zoom_Dev; struct PPP_Find_Dev; struct PPP_Instance; +struct PPP_Instance_Private; struct PPP_Messaging; struct PPP_Pdf; struct PPP_Selection_Dev; @@ -82,6 +84,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { ~PluginInstance(); static const PPB_Instance* GetInterface(); + static const PPB_Instance_Private* GetPrivateInterface(); // Returns a pointer to the interface implementing PPB_Find that is // exposed to the plugin. @@ -140,7 +143,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { // Called when the out-of-process plugin implementing this instance crashed. void InstanceCrashed(); - // PPB_Instance implementation. + // PPB_Instance and PPB_Instance_Private implementation. PP_Var GetWindowObject(); PP_Var GetOwnerElementObject(); bool BindGraphics(PP_Resource graphics_id); @@ -153,7 +156,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { const PP_Point* hot_spot); PP_Var ExecuteScript(PP_Var script, PP_Var* exception); - // PPP_Instance pass-through. + // PPP_Instance and PPP_Instance_Private pass-through. bool Initialize(WebKit::WebPluginContainer* container, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, @@ -263,6 +266,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { bool LoadMessagingInterface(); bool LoadPdfInterface(); bool LoadSelectionInterface(); + bool LoadPrivateInterface(); bool LoadZoomInterface(); // Determines if we think the plugin has focus, both content area and webkit @@ -352,6 +356,7 @@ class PluginInstance : public base::RefCounted<PluginInstance> { const PPP_Messaging* plugin_messaging_interface_; const PPP_Pdf* plugin_pdf_interface_; const PPP_Selection_Dev* plugin_selection_interface_; + const PPP_Instance_Private* plugin_private_interface_; const PPP_Zoom_Dev* plugin_zoom_interface_; // A flag to indicate whether we have asked this plugin instance for its |