OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_V8_VALUE_CONVERTER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ |
6 #define CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "v8/include/v8.h" | 9 #include "v8/include/v8.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class CONTENT_EXPORT V8ValueConverter { | 23 class CONTENT_EXPORT V8ValueConverter { |
24 public: | 24 public: |
25 static V8ValueConverter* create(); | 25 static V8ValueConverter* create(); |
26 | 26 |
27 virtual ~V8ValueConverter() {} | 27 virtual ~V8ValueConverter() {} |
28 | 28 |
29 // Converts Value to v8::Value. Unsupported types are replaced with null. | 29 // Converts Value to v8::Value. Unsupported types are replaced with null. |
30 // If an array or object throws while setting a value, that property or item | 30 // If an array or object throws while setting a value, that property or item |
31 // is skipped, leaving a hole in the case of arrays. | 31 // is skipped, leaving a hole in the case of arrays. |
32 virtual v8::Handle<v8::Value> ToV8Value( | 32 virtual v8::Handle<v8::Value> ToV8Value( |
33 base::Value* value, | 33 const base::Value* value, |
34 v8::Handle<v8::Context> context) const = 0; | 34 v8::Handle<v8::Context> context) const = 0; |
35 | 35 |
36 // Converts v8::Value to Value. Unsupported types are replaced with null. | 36 // Converts v8::Value to Value. Unsupported types are replaced with null. |
37 // If an array or object throws while getting a value, that property or item | 37 // If an array or object throws while getting a value, that property or item |
38 // is replaced with null. | 38 // is replaced with null. |
39 virtual base::Value* FromV8Value(v8::Handle<v8::Value> value, | 39 virtual base::Value* FromV8Value(v8::Handle<v8::Value> value, |
40 v8::Handle<v8::Context> context) const = 0; | 40 v8::Handle<v8::Context> context) const = 0; |
41 }; | 41 }; |
42 | 42 |
43 } // namespace content | 43 } // namespace content |
44 | 44 |
45 #endif // CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ | 45 #endif // CONTENT_PUBLIC_RENDERER_V8_VALUE_CONVERTER_H_ |
OLD | NEW |