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 CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ |
6 #define CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ | 6 #define CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 v8::Handle<v8::Value> ToArrayBuffer(const base::BinaryValue* value) const; | 53 v8::Handle<v8::Value> ToArrayBuffer(const base::BinaryValue* value) const; |
54 | 54 |
55 base::Value* FromV8ValueImpl(FromV8ValueState* state, | 55 base::Value* FromV8ValueImpl(FromV8ValueState* state, |
56 v8::Handle<v8::Value> value, | 56 v8::Handle<v8::Value> value, |
57 v8::Isolate* isolate) const; | 57 v8::Isolate* isolate) const; |
58 base::Value* FromV8Array(v8::Handle<v8::Array> array, | 58 base::Value* FromV8Array(v8::Handle<v8::Array> array, |
59 FromV8ValueState* state, | 59 FromV8ValueState* state, |
60 v8::Isolate* isolate) const; | 60 v8::Isolate* isolate) const; |
61 | 61 |
62 // This will convert objects of type ArrayBuffer or any of the | 62 // This will convert objects of type ArrayBuffer or any of the |
63 // ArrayBufferView subclasses. The return value will be NULL if |value| is | 63 // ArrayBufferView subclasses. |
64 // not one of these types. | 64 base::Value* FromV8ArrayBuffer(v8::Handle<v8::Object> val) const; |
65 base::BinaryValue* FromV8Buffer(v8::Handle<v8::Value> value) const; | |
66 | 65 |
67 base::Value* FromV8Object(v8::Handle<v8::Object> object, | 66 base::Value* FromV8Object(v8::Handle<v8::Object> object, |
68 FromV8ValueState* state, | 67 FromV8ValueState* state, |
69 v8::Isolate* isolate) const; | 68 v8::Isolate* isolate) const; |
70 | 69 |
71 // If true, we will convert Date JavaScript objects to doubles. | 70 // If true, we will convert Date JavaScript objects to doubles. |
72 bool date_allowed_; | 71 bool date_allowed_; |
73 | 72 |
74 // If true, we will convert RegExp JavaScript objects to string. | 73 // If true, we will convert RegExp JavaScript objects to string. |
75 bool reg_exp_allowed_; | 74 bool reg_exp_allowed_; |
76 | 75 |
77 // If true, we will convert Function JavaScript objects to dictionaries. | 76 // If true, we will convert Function JavaScript objects to dictionaries. |
78 bool function_allowed_; | 77 bool function_allowed_; |
79 | 78 |
80 // If true, undefined and null values are ignored when converting v8 objects | 79 // If true, undefined and null values are ignored when converting v8 objects |
81 // into Values. | 80 // into Values. |
82 bool strip_null_from_objects_; | 81 bool strip_null_from_objects_; |
83 | 82 |
84 bool avoid_identity_hash_for_testing_; | 83 bool avoid_identity_hash_for_testing_; |
85 | 84 |
86 // Strategy object that changes the converter's behavior. | 85 // Strategy object that changes the converter's behavior. |
87 Strategy* strategy_; | 86 Strategy* strategy_; |
88 | 87 |
89 DISALLOW_COPY_AND_ASSIGN(V8ValueConverterImpl); | 88 DISALLOW_COPY_AND_ASSIGN(V8ValueConverterImpl); |
90 }; | 89 }; |
91 | 90 |
92 } // namespace content | 91 } // namespace content |
93 | 92 |
94 #endif // CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ | 93 #endif // CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ |
OLD | NEW |