| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/renderer/v8_value_converter.h" | 12 #include "content/public/renderer/v8_value_converter.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class BinaryValue; | 15 class BinaryValue; |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 class ListValue; | 17 class ListValue; |
| 18 class Value; | 18 class Value; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class CONTENT_EXPORT V8ValueConverterImpl : public content::V8ValueConverter { | 21 class CONTENT_EXPORT V8ValueConverterImpl : public content::V8ValueConverter { |
| 22 public: | 22 public: |
| 23 V8ValueConverterImpl(); | 23 V8ValueConverterImpl(); |
| 24 | 24 |
| 25 // V8ValueConverter implementation. | 25 // V8ValueConverter implementation. |
| 26 virtual bool GetUndefinedAllowed() const OVERRIDE; | 26 virtual UndefinedValueBehavior GetUndefinedValueBehavior() const OVERRIDE; |
| 27 virtual void SetUndefinedAllowed(bool val) OVERRIDE; | 27 virtual void SetUndefinedValueBehavior(UndefinedValueBehavior val) OVERRIDE; |
| 28 virtual bool GetDateAllowed() const OVERRIDE; | 28 virtual bool GetDateAllowed() const OVERRIDE; |
| 29 virtual void SetDateAllowed(bool val) OVERRIDE; | 29 virtual void SetDateAllowed(bool val) OVERRIDE; |
| 30 virtual bool GetRegexpAllowed() const OVERRIDE; | 30 virtual bool GetRegexpAllowed() const OVERRIDE; |
| 31 virtual void SetRegexpAllowed(bool val) OVERRIDE; | 31 virtual void SetRegexpAllowed(bool val) OVERRIDE; |
| 32 virtual bool GetStripNullFromObjects() const OVERRIDE; | 32 virtual bool GetStripNullFromObjects() const OVERRIDE; |
| 33 virtual void SetStripNullFromObjects(bool val) OVERRIDE; | 33 virtual void SetStripNullFromObjects(bool val) OVERRIDE; |
| 34 virtual v8::Handle<v8::Value> ToV8Value( | 34 virtual v8::Handle<v8::Value> ToV8Value( |
| 35 const base::Value* value, | 35 const base::Value* value, |
| 36 v8::Handle<v8::Context> context) const OVERRIDE; | 36 v8::Handle<v8::Context> context) const OVERRIDE; |
| 37 virtual base::Value* FromV8Value( | 37 virtual base::Value* FromV8Value( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 std::set<int>* unique_set) const; | 51 std::set<int>* unique_set) const; |
| 52 | 52 |
| 53 // This will convert objects of type ArrayBuffer or any of the | 53 // This will convert objects of type ArrayBuffer or any of the |
| 54 // ArrayBufferView subclasses. The return value will be NULL if |value| is | 54 // ArrayBufferView subclasses. The return value will be NULL if |value| is |
| 55 // not one of these types. | 55 // not one of these types. |
| 56 base::BinaryValue* FromV8Buffer(v8::Handle<v8::Value> value) const; | 56 base::BinaryValue* FromV8Buffer(v8::Handle<v8::Value> value) const; |
| 57 | 57 |
| 58 base::Value* FromV8Object(v8::Handle<v8::Object> object, | 58 base::Value* FromV8Object(v8::Handle<v8::Object> object, |
| 59 std::set<int>* unique_set) const; | 59 std::set<int>* unique_set) const; |
| 60 | 60 |
| 61 // If true, we will convert undefined JavaScript values to null. | 61 // Determines how undefined values should be converted. |
| 62 bool undefined_allowed_; | 62 UndefinedValueBehavior undefined_value_behavior_; |
| 63 | 63 |
| 64 // If true, we will convert Date JavaScript objects to doubles. | 64 // If true, we will convert Date JavaScript objects to doubles. |
| 65 bool date_allowed_; | 65 bool date_allowed_; |
| 66 | 66 |
| 67 // If true, we will convet RegExp JavaScript objects to string. | 67 // If true, we will convet RegExp JavaScript objects to string. |
| 68 bool regexp_allowed_; | 68 bool regexp_allowed_; |
| 69 | 69 |
| 70 // If true, undefined and null values are ignored when converting v8 objects | 70 // If true, undefined and null values are ignored when converting v8 objects |
| 71 // into Values. | 71 // into Values. |
| 72 bool strip_null_from_objects_; | 72 bool strip_null_from_objects_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 #endif // CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ | 75 #endif // CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_ |
| OLD | NEW |