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

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

Issue 421963008: Add PepperTryCatch and V8ObjectVar classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « content/renderer/pepper/v8object_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 "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 NPObjectVar;
23 class ProxyObjectVar; 23 class ProxyObjectVar;
24 class ResourceVar; 24 class ResourceVar;
25 class StringVar; 25 class StringVar;
26 class V8ObjectVar;
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 // Returns a string representing the given var for logging purposes. 34 // Returns a string representing the given var for logging purposes.
34 static std::string PPVarToLogString(PP_Var var); 35 static std::string PPVarToLogString(PP_Var var);
35 36
36 virtual StringVar* AsStringVar(); 37 virtual StringVar* AsStringVar();
37 virtual ArrayBufferVar* AsArrayBufferVar(); 38 virtual ArrayBufferVar* AsArrayBufferVar();
38 virtual NPObjectVar* AsNPObjectVar(); 39 virtual NPObjectVar* AsNPObjectVar();
40 virtual V8ObjectVar* AsV8ObjectVar();
39 virtual ProxyObjectVar* AsProxyObjectVar(); 41 virtual ProxyObjectVar* AsProxyObjectVar();
40 virtual ArrayVar* AsArrayVar(); 42 virtual ArrayVar* AsArrayVar();
41 virtual DictionaryVar* AsDictionaryVar(); 43 virtual DictionaryVar* AsDictionaryVar();
42 virtual ResourceVar* AsResourceVar(); 44 virtual ResourceVar* AsResourceVar();
43 45
44 // Creates a PP_Var corresponding to this object. The return value will have 46 // Creates a PP_Var corresponding to this object. The return value will have
45 // one reference addrefed on behalf of the caller. 47 // one reference addrefed on behalf of the caller.
46 PP_Var GetPPVar(); 48 PP_Var GetPPVar();
47 49
48 // Returns the type of this var. 50 // Returns the type of this var.
(...skipping 134 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 | « content/renderer/pepper/v8object_var.cc ('k') | ppapi/shared_impl/var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698