OLD | NEW |
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 "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
14 #include "ppapi/shared_impl/host_resource.h" | 14 #include "ppapi/shared_impl/host_resource.h" |
15 #include "ppapi/shared_impl/ppapi_shared_export.h" | 15 #include "ppapi/shared_impl/ppapi_shared_export.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 | 18 |
19 class ArrayBufferVar; | 19 class ArrayBufferVar; |
20 class ArrayVar; | 20 class ArrayVar; |
21 class DictionaryVar; | 21 class DictionaryVar; |
22 class NPObjectVar; | 22 class V8ObjectVar; |
23 class ProxyObjectVar; | 23 class ProxyObjectVar; |
24 class ResourceVar; | 24 class ResourceVar; |
25 class StringVar; | 25 class StringVar; |
26 class V8ObjectVar; | 26 class V8ObjectVar; |
27 class VarTracker; | 27 class VarTracker; |
28 | 28 |
29 // Var ------------------------------------------------------------------------- | 29 // Var ------------------------------------------------------------------------- |
30 | 30 |
31 // Represents a non-POD var. | 31 // Represents a non-POD var. |
32 class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> { | 32 class PPAPI_SHARED_EXPORT Var : public base::RefCounted<Var> { |
33 public: | 33 public: |
34 // Returns a string representing the given var for logging purposes. | 34 // Returns a string representing the given var for logging purposes. |
35 static std::string PPVarToLogString(PP_Var var); | 35 static std::string PPVarToLogString(PP_Var var); |
36 | 36 |
37 virtual StringVar* AsStringVar(); | 37 virtual StringVar* AsStringVar(); |
38 virtual ArrayBufferVar* AsArrayBufferVar(); | 38 virtual ArrayBufferVar* AsArrayBufferVar(); |
39 virtual NPObjectVar* AsNPObjectVar(); | |
40 virtual V8ObjectVar* AsV8ObjectVar(); | 39 virtual V8ObjectVar* AsV8ObjectVar(); |
41 virtual ProxyObjectVar* AsProxyObjectVar(); | 40 virtual ProxyObjectVar* AsProxyObjectVar(); |
42 virtual ArrayVar* AsArrayVar(); | 41 virtual ArrayVar* AsArrayVar(); |
43 virtual DictionaryVar* AsDictionaryVar(); | 42 virtual DictionaryVar* AsDictionaryVar(); |
44 virtual ResourceVar* AsResourceVar(); | 43 virtual ResourceVar* AsResourceVar(); |
45 | 44 |
46 // Creates a PP_Var corresponding to this object. The return value will have | 45 // Creates a PP_Var corresponding to this object. The return value will have |
47 // one reference addrefed on behalf of the caller. | 46 // one reference addrefed on behalf of the caller. |
48 PP_Var GetPPVar(); | 47 PP_Var GetPPVar(); |
49 | 48 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // return NULL if the PP_Var is not of ArrayBuffer type. | 184 // return NULL if the PP_Var is not of ArrayBuffer type. |
186 static ArrayBufferVar* FromPPVar(PP_Var var); | 185 static ArrayBufferVar* FromPPVar(PP_Var var); |
187 | 186 |
188 private: | 187 private: |
189 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); | 188 DISALLOW_COPY_AND_ASSIGN(ArrayBufferVar); |
190 }; | 189 }; |
191 | 190 |
192 } // namespace ppapi | 191 } // namespace ppapi |
193 | 192 |
194 #endif // PPAPI_SHARED_IMPL_VAR_H_ | 193 #endif // PPAPI_SHARED_IMPL_VAR_H_ |
OLD | NEW |