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

Side by Side Diff: tests/fake_browser_ppapi/fake_object.h

Issue 3391010: Update the PPAPI DEPS revision. This change included parameter profile chang... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/service_runtime/env_cleanser.c ('k') | tests/fake_browser_ppapi/fake_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
1 /* 1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved. 2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_ 7 #ifndef NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_
8 #define NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_ 8 #define NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include "ppapi/c/pp_module.h"
12 #include "ppapi/c/pp_var.h" 13 #include "ppapi/c/pp_var.h"
13 #include "ppapi/c/ppp_class.h" 14 #include "ppapi/c/ppp_class.h"
14 15
15 #include "native_client/src/include/nacl_macros.h" 16 #include "native_client/src/include/nacl_macros.h"
16 #include "native_client/src/shared/ppapi_proxy/object.h" 17 #include "native_client/src/shared/ppapi_proxy/object.h"
17 18
18 namespace fake_browser_ppapi { 19 namespace fake_browser_ppapi {
19 20
20 // Implements a scriptable object in PPAPI. 21 // Implements a scriptable object in PPAPI.
21 class Object : public ppapi_proxy::Object { 22 class Object : public ppapi_proxy::Object {
(...skipping 24 matching lines...) Expand all
46 virtual void Deallocate(); 47 virtual void Deallocate();
47 48
48 typedef std::map<std::string, PP_Var*> PropertyMap; 49 typedef std::map<std::string, PP_Var*> PropertyMap;
49 typedef PP_Var (*Method)(Object* object, 50 typedef PP_Var (*Method)(Object* object,
50 uint32_t argc, 51 uint32_t argc,
51 PP_Var* argv, 52 PP_Var* argv,
52 PP_Var* exception); 53 PP_Var* exception);
53 typedef std::map<std::string, Method> MethodMap; 54 typedef std::map<std::string, Method> MethodMap;
54 55
55 // Create a PP_Var object with a set of initial properties. 56 // Create a PP_Var object with a set of initial properties.
56 static PP_Var New(const PropertyMap& properties, const MethodMap& methods); 57 static PP_Var New(PP_Module module,
58 const PropertyMap& properties,
59 const MethodMap& methods);
57 60
58 // Construct using a map of initial properties. 61 // Construct using a map of initial properties.
59 Object(const PropertyMap& properties, const MethodMap& methods); 62 Object(PP_Module module,
63 const PropertyMap& properties,
64 const MethodMap& methods);
60 65
61 PropertyMap* properties() { return &properties_; } 66 PropertyMap* properties() { return &properties_; }
62 MethodMap* methods() { return &methods_; } 67 MethodMap* methods() { return &methods_; }
68 PP_Module module() const { return module_; }
63 69
64 private: 70 private:
65 // Maintains the list of properties for Set/Get/Remove. 71 // Maintains the list of properties for Set/Get/Remove.
66 PropertyMap properties_; 72 PropertyMap properties_;
67 // Maintains the list of methods that can be invoked by Call. 73 // Maintains the list of methods that can be invoked by Call.
68 MethodMap methods_; 74 MethodMap methods_;
75 // Keep track of the PP_Module that created us.
76 PP_Module module_;
69 77
70 NACL_DISALLOW_COPY_AND_ASSIGN(Object); 78 NACL_DISALLOW_COPY_AND_ASSIGN(Object);
71 }; 79 };
72 80
73 } // namespace fake_browser_ppapi 81 } // namespace fake_browser_ppapi
74 82
75 #endif // NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_ 83 #endif // NATIVE_CLIENT_TESTS_FAKE_BROWSER_PPAPI_FAKE_OBJECT_H_
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/env_cleanser.c ('k') | tests/fake_browser_ppapi/fake_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698