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

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

Issue 12387073: Add PPB_VarDictionary_Dev support - part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PPAPI_SHARED_IMPL_VAR_VALUE_CONVERSIONS_H_
6 #define PPAPI_SHARED_IMPL_VAR_VALUE_CONVERSIONS_H_
7
8 #include "ppapi/c/pp_var.h"
9 #include "ppapi/shared_impl/ppapi_shared_export.h"
10
11 namespace base {
12 class Value;
13 }
14
15 namespace ppapi {
16
17 // Converts a PP_Var to a base::Value object. The caller takes ownership of the
18 // returned object.
19 //
20 // Both PP_VARTYPE_UNDEFINED and PP_VARTYPE_NULL are converted to
21 // base::Value::TYPE_NULL. In dictionary vars, key-value pairs whose value is
22 // undefined (PP_VARTYPE_UNDEFINED) are ignored.
23 //
24 // The conversion fails and returns NULL if
25 // - |var| is object (PP_VARTYPE_OBJECT); or
26 // - |var| is an array or dictionary, and calling CreateValueFromVar() on any of
27 // the array elements or dictionary values fails; or
28 // - there exist circular references, i.e., an array or dictionary is its own
29 // ancestor/descendant.
30 PPAPI_SHARED_EXPORT base::Value* CreateValueFromVar(const PP_Var& var);
31
32 // The returned var has been added ref on behalf of the caller.
33 // Returns an undefined var if the conversion fails.
34 PPAPI_SHARED_EXPORT PP_Var CreateVarFromValue(const base::Value& value);
35
36 } // namespace ppapi
37
38 #endif // PPAPI_SHARED_IMPL_VAR_VALUE_CONVERSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698