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

Side by Side Diff: ppapi/cpp/private/instance_private.cc

Issue 7362012: Remove untrusted scripting support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 9 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
« no previous file with comments | « ppapi/cpp/private/instance_private.h ('k') | ppapi/cpp/var.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ppapi/cpp/private/instance_private.h ('k') | ppapi/cpp/var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698