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

Side by Side Diff: ppapi/shared_impl/var.h

Issue 23346009: [PPAPI] Added a new Var subclass, ResourceVar. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gyp: Fix linker errors by linking against ipc.dll. Created 7 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 | « ppapi/shared_impl/resource_var.cc ('k') | ppapi/shared_impl/var.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PPAPI_SHARED_IMPL_VAR_H_ 5 #ifndef PPAPI_SHARED_IMPL_VAR_H_
6 #define PPAPI_SHARED_IMPL_VAR_H_ 6 #define PPAPI_SHARED_IMPL_VAR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/shared_memory.h" 12 #include "base/memory/shared_memory.h"
13 #include "base/platform_file.h" 13 #include "base/platform_file.h"
14 #include "ppapi/c/pp_var.h" 14 #include "ppapi/c/pp_var.h"
15 #include "ppapi/shared_impl/host_resource.h" 15 #include "ppapi/shared_impl/host_resource.h"
16 #include "ppapi/shared_impl/ppapi_shared_export.h" 16 #include "ppapi/shared_impl/ppapi_shared_export.h"
17 17
18 namespace ppapi { 18 namespace ppapi {
19 19
20 class ArrayBufferVar; 20 class ArrayBufferVar;
21 class ArrayVar; 21 class ArrayVar;
22 class DictionaryVar; 22 class DictionaryVar;
23 class NPObjectVar; 23 class NPObjectVar;
24 class ProxyObjectVar; 24 class ProxyObjectVar;
25 class ResourceVar;
25 class StringVar; 26 class StringVar;
26 class VarTracker; 27 class VarTracker;
27 28
28 // Var ------------------------------------------------------------------------- 29 // Var -------------------------------------------------------------------------
29 30
30 // Represents a non-POD var. 31 // Represents a non-POD var.
31 class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> { 32 class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> {
32 public: 33 public:
33 virtual ~Var(); 34 virtual ~Var();
34 35
35 // Returns a string representing the given var for logging purposes. 36 // Returns a string representing the given var for logging purposes.
36 static std::string PPVarToLogString(PP_Var var); 37 static std::string PPVarToLogString(PP_Var var);
37 38
38 virtual StringVar* AsStringVar(); 39 virtual StringVar* AsStringVar();
39 virtual ArrayBufferVar* AsArrayBufferVar(); 40 virtual ArrayBufferVar* AsArrayBufferVar();
40 virtual NPObjectVar* AsNPObjectVar(); 41 virtual NPObjectVar* AsNPObjectVar();
41 virtual ProxyObjectVar* AsProxyObjectVar(); 42 virtual ProxyObjectVar* AsProxyObjectVar();
42 virtual ArrayVar* AsArrayVar(); 43 virtual ArrayVar* AsArrayVar();
43 virtual DictionaryVar* AsDictionaryVar(); 44 virtual DictionaryVar* AsDictionaryVar();
45 virtual ResourceVar* AsResourceVar();
44 46
45 // Creates a PP_Var corresponding to this object. The return value will have 47 // Creates a PP_Var corresponding to this object. The return value will have
46 // one reference addrefed on behalf of the caller. 48 // one reference addrefed on behalf of the caller.
47 PP_Var GetPPVar(); 49 PP_Var GetPPVar();
48 50
49 // Returns the type of this var. 51 // Returns the type of this var.
50 virtual PP_VarType GetType() const = 0; 52 virtual PP_VarType GetType() const = 0;
51 53
52 // Returns the ID corresponing to the string or object if it exists already, 54 // Returns the ID corresponing to the string or object if it exists already,
53 // or 0 if an ID hasn't been generated for this object (the plugin is holding 55 // or 0 if an ID hasn't been generated for this object (the plugin is holding
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // return NULL if the PP_Var is not of ArrayBuffer type. 185 // return NULL if the PP_Var is not of ArrayBuffer type.
184 static ArrayBufferVar* FromPPVar(PP_Var var); 186 static ArrayBufferVar* FromPPVar(PP_Var var);
185 187
186 private: 188 private:
187 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); 189 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar);
188 }; 190 };
189 191
190 } // namespace ppapi 192 } // namespace ppapi
191 193
192 #endif // PPAPI_SHARED_IMPL_VAR_H_ 194 #endif // PPAPI_SHARED_IMPL_VAR_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/resource_var.cc ('k') | ppapi/shared_impl/var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698