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

Side by Side Diff: content/public/child/v8_value_converter.h

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
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 CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_ 5 #ifndef CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_
6 #define CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_ 6 #define CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // the case of arrays. 110 // the case of arrays.
111 // TODO(dcheng): This should just take a const reference. 111 // TODO(dcheng): This should just take a const reference.
112 virtual v8::Local<v8::Value> ToV8Value( 112 virtual v8::Local<v8::Value> ToV8Value(
113 const base::Value* value, 113 const base::Value* value,
114 v8::Local<v8::Context> context) const = 0; 114 v8::Local<v8::Context> context) const = 0;
115 115
116 // Converts a v8::Value to base::Value. 116 // Converts a v8::Value to base::Value.
117 // 117 //
118 // Unsupported types (unless explicitly configured) are not converted, so 118 // Unsupported types (unless explicitly configured) are not converted, so
119 // this method may return NULL -- the exception is when converting arrays, 119 // this method may return NULL -- the exception is when converting arrays,
120 // where unsupported types are converted to Value(TYPE_NULL). 120 // where unsupported types are converted to Value(Type::NONE).
121 // 121 //
122 // Likewise, if an object throws while converting a property it will not be 122 // Likewise, if an object throws while converting a property it will not be
123 // converted, whereas if an array throws while converting an item it will be 123 // converted, whereas if an array throws while converting an item it will be
124 // converted to Value(TYPE_NULL). 124 // converted to Value(Type::NONE).
125 virtual std::unique_ptr<base::Value> FromV8Value( 125 virtual std::unique_ptr<base::Value> FromV8Value(
126 v8::Local<v8::Value> value, 126 v8::Local<v8::Value> value,
127 v8::Local<v8::Context> context) const = 0; 127 v8::Local<v8::Context> context) const = 0;
128 }; 128 };
129 129
130 } // namespace content 130 } // namespace content
131 131
132 #endif // CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_ 132 #endif // CONTENT_PUBLIC_CHILD_V8_VALUE_CONVERTER_H_
OLDNEW
« no previous file with comments | « content/common/android/gin_java_bridge_value.cc ('k') | content/renderer/java/gin_java_bridge_value_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698