| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/cpp/private/instance_private.h" | 5 #include "ppapi/cpp/private/instance_private.h" |
| 6 | 6 |
| 7 #include "ppapi/c/private/ppb_instance_private.h" | 7 #include "ppapi/c/private/ppb_instance_private.h" |
| 8 #include "ppapi/c/private/ppp_instance_private.h" | 8 #include "ppapi/c/private/ppp_instance_private.h" |
| 9 #include "ppapi/cpp/module_impl.h" | 9 #include "ppapi/cpp/module_impl.h" |
| 10 #include "ppapi/cpp/private/var_private.h" | 10 #include "ppapi/cpp/private/var_private.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 InstancePrivate::InstancePrivate(PP_Instance instance) : Instance(instance) { | 37 InstancePrivate::InstancePrivate(PP_Instance instance) : Instance(instance) { |
| 38 // If at least 1 InstancePrivate is created, register the PPP_INSTANCE_PRIVATE | 38 // If at least 1 InstancePrivate is created, register the PPP_INSTANCE_PRIVATE |
| 39 // interface. | 39 // interface. |
| 40 Module::Get()->AddPluginInterface(PPP_INSTANCE_PRIVATE_INTERFACE, | 40 Module::Get()->AddPluginInterface(PPP_INSTANCE_PRIVATE_INTERFACE, |
| 41 &ppp_instance_private); | 41 &ppp_instance_private); |
| 42 } | 42 } |
| 43 | 43 |
| 44 InstancePrivate::~InstancePrivate() {} | 44 InstancePrivate::~InstancePrivate() {} |
| 45 | 45 |
| 46 #ifdef PPAPI_INSTANCE_REMOVE_SCRIPTING | |
| 47 Var InstancePrivate::GetInstanceObject() { | 46 Var InstancePrivate::GetInstanceObject() { |
| 48 return Var(); | 47 return Var(); |
| 49 } | 48 } |
| 50 #endif | |
| 51 | 49 |
| 52 VarPrivate InstancePrivate::GetWindowObject() { | 50 VarPrivate InstancePrivate::GetWindowObject() { |
| 53 if (!has_interface<PPB_Instance_Private>()) | 51 if (!has_interface<PPB_Instance_Private>()) |
| 54 return VarPrivate(); | 52 return VarPrivate(); |
| 55 return VarPrivate(Var::PassRef(), | 53 return VarPrivate(Var::PassRef(), |
| 56 get_interface<PPB_Instance_Private>()->GetWindowObject(pp_instance())); | 54 get_interface<PPB_Instance_Private>()->GetWindowObject(pp_instance())); |
| 57 } | 55 } |
| 58 | 56 |
| 59 VarPrivate InstancePrivate::GetOwnerElementObject() { | 57 VarPrivate InstancePrivate::GetOwnerElementObject() { |
| 60 if (!has_interface<PPB_Instance_Private>()) | 58 if (!has_interface<PPB_Instance_Private>()) |
| 61 return VarPrivate(); | 59 return VarPrivate(); |
| 62 return VarPrivate(Var::PassRef(), | 60 return VarPrivate(Var::PassRef(), |
| 63 get_interface<PPB_Instance_Private>()->GetOwnerElementObject( | 61 get_interface<PPB_Instance_Private>()->GetOwnerElementObject( |
| 64 pp_instance())); | 62 pp_instance())); |
| 65 } | 63 } |
| 66 | 64 |
| 67 VarPrivate InstancePrivate::ExecuteScript(const Var& script, Var* exception) { | 65 VarPrivate InstancePrivate::ExecuteScript(const Var& script, Var* exception) { |
| 68 if (!has_interface<PPB_Instance_Private>()) | 66 if (!has_interface<PPB_Instance_Private>()) |
| 69 return VarPrivate(); | 67 return VarPrivate(); |
| 70 return VarPrivate(Var::PassRef(), | 68 return VarPrivate(Var::PassRef(), |
| 71 get_interface<PPB_Instance_Private>()->ExecuteScript( | 69 get_interface<PPB_Instance_Private>()->ExecuteScript( |
| 72 pp_instance(), | 70 pp_instance(), |
| 73 script.pp_var(), | 71 script.pp_var(), |
| 74 VarPrivate::OutException(exception).get())); | 72 VarPrivate::OutException(exception).get())); |
| 75 } | 73 } |
| 76 | 74 |
| 77 } // namespace pp | 75 } // namespace pp |
| OLD | NEW |