summaryrefslogtreecommitdiffstats
path: root/content/renderer/v8_value_converter_impl.h
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 09:17:06 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 09:17:06 +0000
commit2a52184bfdca58d440df84e90bdfc87d5c886f44 (patch)
treeb24a6641267864152003229c878c774df21d9cb2 /content/renderer/v8_value_converter_impl.h
parent8dc590b5e3165d31c730ae2f5cf8a2df0878f699 (diff)
downloadchromium_src-2a52184bfdca58d440df84e90bdfc87d5c886f44.zip
chromium_src-2a52184bfdca58d440df84e90bdfc87d5c886f44.tar.gz
chromium_src-2a52184bfdca58d440df84e90bdfc87d5c886f44.tar.bz2
Allow "null" to mean optional in extension APIs (for realz), but normalise it
for browser implementations by stripping it from objects. The following are all now exactly the same, where previously they weren't and would either not work or crash the browser/renderer: chrome.tabs.create({}); chrome.tabs.create({windowId: undefined}); chrome.tabs.create({windowId: null}); BUG=129411 TEST=as in bug Review URL: https://chromiumcodereview.appspot.com/10456010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139510 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/v8_value_converter_impl.h')
-rw-r--r--content/renderer/v8_value_converter_impl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/content/renderer/v8_value_converter_impl.h b/content/renderer/v8_value_converter_impl.h
index 7f9baea..7f75899 100644
--- a/content/renderer/v8_value_converter_impl.h
+++ b/content/renderer/v8_value_converter_impl.h
@@ -27,6 +27,8 @@ class CONTENT_EXPORT V8ValueConverterImpl : public content::V8ValueConverter {
virtual void SetDateAllowed(bool val) OVERRIDE;
virtual bool GetRegexpAllowed() const OVERRIDE;
virtual void SetRegexpAllowed(bool val) OVERRIDE;
+ virtual bool GetStripNullFromObjects() const OVERRIDE;
+ virtual void SetStripNullFromObjects(bool val) OVERRIDE;
virtual v8::Handle<v8::Value> ToV8Value(
const base::Value* value,
v8::Handle<v8::Context> context) const OVERRIDE;
@@ -59,6 +61,10 @@ class CONTENT_EXPORT V8ValueConverterImpl : public content::V8ValueConverter {
// If true, we will convet RegExp JavaScript objects to string.
bool regexp_allowed_;
+
+ // If true, undefined and null values are ignored when converting v8 objects
+ // into Values.
+ bool strip_null_from_objects_;
};
#endif // CONTENT_RENDERER_V8_VALUE_CONVERTER_IMPL_H_