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

Side by Side Diff: content/child/v8_value_converter_impl.h

Issue 2709103004: [Content] Allow V8ValueConverter to convert -0 to an integer (Closed)
Patch Set: Created 3 years, 10 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
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_CHILD_V8_VALUE_CONVERTER_IMPL_H_ 5 #ifndef CONTENT_CHILD_V8_VALUE_CONVERTER_IMPL_H_
6 #define CONTENT_CHILD_V8_VALUE_CONVERTER_IMPL_H_ 6 #define CONTENT_CHILD_V8_VALUE_CONVERTER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 12 matching lines...) Expand all
23 23
24 class CONTENT_EXPORT V8ValueConverterImpl : public V8ValueConverter { 24 class CONTENT_EXPORT V8ValueConverterImpl : public V8ValueConverter {
25 public: 25 public:
26 V8ValueConverterImpl(); 26 V8ValueConverterImpl();
27 27
28 // V8ValueConverter implementation. 28 // V8ValueConverter implementation.
29 void SetDateAllowed(bool val) override; 29 void SetDateAllowed(bool val) override;
30 void SetRegExpAllowed(bool val) override; 30 void SetRegExpAllowed(bool val) override;
31 void SetFunctionAllowed(bool val) override; 31 void SetFunctionAllowed(bool val) override;
32 void SetStripNullFromObjects(bool val) override; 32 void SetStripNullFromObjects(bool val) override;
33 void SetConvertNegativeZeroToInt(bool val) override;
33 void SetStrategy(Strategy* strategy) override; 34 void SetStrategy(Strategy* strategy) override;
34 v8::Local<v8::Value> ToV8Value( 35 v8::Local<v8::Value> ToV8Value(
35 const base::Value* value, 36 const base::Value* value,
36 v8::Local<v8::Context> context) const override; 37 v8::Local<v8::Context> context) const override;
37 std::unique_ptr<base::Value> FromV8Value( 38 std::unique_ptr<base::Value> FromV8Value(
38 v8::Local<v8::Value> value, 39 v8::Local<v8::Value> value,
39 v8::Local<v8::Context> context) const override; 40 v8::Local<v8::Context> context) const override;
40 41
41 private: 42 private:
42 friend class ScopedAvoidIdentityHashForTesting; 43 friend class ScopedAvoidIdentityHashForTesting;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // If true, we will convert RegExp JavaScript objects to string. 81 // If true, we will convert RegExp JavaScript objects to string.
81 bool reg_exp_allowed_; 82 bool reg_exp_allowed_;
82 83
83 // If true, we will convert Function JavaScript objects to dictionaries. 84 // If true, we will convert Function JavaScript objects to dictionaries.
84 bool function_allowed_; 85 bool function_allowed_;
85 86
86 // If true, undefined and null values are ignored when converting v8 objects 87 // If true, undefined and null values are ignored when converting v8 objects
87 // into Values. 88 // into Values.
88 bool strip_null_from_objects_; 89 bool strip_null_from_objects_;
89 90
91 // If true, convert -0 to an integer value (instead of a double).
92 bool convert_negative_zero_to_int_;
93
90 bool avoid_identity_hash_for_testing_; 94 bool avoid_identity_hash_for_testing_;
91 95
92 // Strategy object that changes the converter's behavior. 96 // Strategy object that changes the converter's behavior.
93 Strategy* strategy_; 97 Strategy* strategy_;
94 98
95 DISALLOW_COPY_AND_ASSIGN(V8ValueConverterImpl); 99 DISALLOW_COPY_AND_ASSIGN(V8ValueConverterImpl);
96 }; 100 };
97 101
98 } // namespace content 102 } // namespace content
99 103
100 #endif // CONTENT_CHILD_V8_VALUE_CONVERTER_IMPL_H_ 104 #endif // CONTENT_CHILD_V8_VALUE_CONVERTER_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/platform_apps/window_api/test.js ('k') | content/child/v8_value_converter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698