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

Side by Side Diff: experimental/c_salt/scriptable_native_object.h

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « experimental/c_salt/rect.cc ('k') | experimental/c_salt/scriptable_native_object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2010 The Ginsu Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can
3 // be found in the LICENSE file.
4
5 #ifndef C_SALT_SCRIPTABLE_NATIVE_OBJECT_H_
6 #define C_SALT_SCRIPTABLE_NATIVE_OBJECT_H_
7
8 #include "c_salt/scripting_bridge_ptrs.h"
9
10 namespace c_salt {
11
12 // The base class for C++ classes which are Scriptable, where Scriptable means
13 // they can be accessed from JavaScript. Scriptable C++ classes expose their
14 // methods and properties to JavaScript via ScriptingBridge.
15 class ScriptableNativeObject {
16 public:
17 ScriptableNativeObject() {}
18 virtual ~ScriptableNativeObject() {}
19
20 // Initialize the ScriptableNativeObject. This invokes appropriate virtual
21 // functions on the child class to give it an opportunity to register methods
22 // and properties with the ScriptingBridge.
23 void Initialize(SharedScriptingBridge bridge);
24
25 // Return the ScriptingBridge which is associated with this object.
26 WeakScriptingBridge GetScriptingBridge();
27
28
29 private:
30 // Called during initialization to publish the module's method names that
31 // can be called from JavaScript.
32 virtual void InitializeMethods(ScriptingBridge* bridge) = 0;
33
34 // Called during initialization to publish the module's properties that can
35 // be called from JavaScript.
36 virtual void InitializeProperties(ScriptingBridge* bridge) = 0;
37
38 private:
39 // Copy and assign are unsupported and therefore not implemented.
40 ScriptableNativeObject(const ScriptableNativeObject&);
41 ScriptableNativeObject& operator=(const ScriptableNativeObject&);
42 WeakScriptingBridge scripting_bridge_;
43 };
44
45 } // namespace c_salt
46
47 #endif // C_SALT_SCRIPTABLE_NATIVE_OBJECT_H_
OLDNEW
« no previous file with comments | « experimental/c_salt/rect.cc ('k') | experimental/c_salt/scriptable_native_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698