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

Side by Side Diff: webkit/glue/cpp_binding_example.h

Issue 8741006: Add exports needed for glue to build as a component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to r112585 Created 9 years 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 | « webkit/glue/context_menu.h ('k') | webkit/glue/cpp_bound_class.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 /* 5 /*
6 CppBindingExample class: 6 CppBindingExample class:
7 This provides an example of how to use the CppBoundClass to create methods 7 This provides an example of how to use the CppBoundClass to create methods
8 and properties that can be exposed to JavaScript by an appropriately built 8 and properties that can be exposed to JavaScript by an appropriately built
9 embedding client. It is also used by the CppBoundClass unit test. 9 embedding client. It is also used by the CppBoundClass unit test.
10 10
(...skipping 16 matching lines...) Expand all
27 example.my_other_value = 2.1; 27 example.my_other_value = 2.1;
28 document.writeln(example.plus(example.my_value, example.my_other_value)); 28 document.writeln(example.plus(example.my_value, example.my_other_value));
29 } 29 }
30 </script> 30 </script>
31 */ 31 */
32 32
33 #ifndef CPP_BINDING_EXAMPLE_H__ 33 #ifndef CPP_BINDING_EXAMPLE_H__
34 #define CPP_BINDING_EXAMPLE_H__ 34 #define CPP_BINDING_EXAMPLE_H__
35 35
36 #include "webkit/glue/cpp_bound_class.h" 36 #include "webkit/glue/cpp_bound_class.h"
37 #include "webkit/glue/webkit_glue_export.h"
37 38
38 class CppBindingExample : public CppBoundClass { 39 class CppBindingExample : public CppBoundClass {
39 public: 40 public:
40 // The default constructor initializes the property and method lists needed 41 // The default constructor initializes the property and method lists needed
41 // to bind this class to a JS object. 42 // to bind this class to a JS object.
42 CppBindingExample(); 43 WEBKIT_GLUE_EXPORT CppBindingExample();
43 44
44 // 45 //
45 // These public member variables and methods implement the methods and 46 // These public member variables and methods implement the methods and
46 // properties that will be exposed to JavaScript. If needed, the class could 47 // properties that will be exposed to JavaScript. If needed, the class could
47 // also contain other methods or variables, which will be hidden from JS 48 // also contain other methods or variables, which will be hidden from JS
48 // as long as they're not mapped in the property and method lists created in 49 // as long as they're not mapped in the property and method lists created in
49 // the constructor. 50 // the constructor.
50 // 51 //
51 // The signatures of any methods to be bound must match 52 // The signatures of any methods to be bound must match
52 // CppBoundClass::Callback. 53 // CppBoundClass::Callback.
(...skipping 16 matching lines...) Expand all
69 // Invoked when a nonexistent method is called on this example object, this 70 // Invoked when a nonexistent method is called on this example object, this
70 // prints an error message. 71 // prints an error message.
71 void fallbackMethod(const CppArgumentList& args, CppVariant* result); 72 void fallbackMethod(const CppArgumentList& args, CppVariant* result);
72 73
73 // These properties will also be exposed to JavaScript. 74 // These properties will also be exposed to JavaScript.
74 CppVariant my_value; 75 CppVariant my_value;
75 CppVariant my_other_value; 76 CppVariant my_other_value;
76 }; 77 };
77 78
78 #endif // CPP_BINDING_EXAMPLE_H__ 79 #endif // CPP_BINDING_EXAMPLE_H__
OLDNEW
« no previous file with comments | « webkit/glue/context_menu.h ('k') | webkit/glue/cpp_bound_class.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698