diff options
author | mtytel@chromium.org <mtytel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 21:33:43 +0000 |
---|---|---|
committer | mtytel@chromium.org <mtytel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 21:33:43 +0000 |
commit | 6d2d55b661b11e038d53c4b9271b67e719a72cc6 (patch) | |
tree | 84093d5da6810192f37b24e8174ce617a7ce6340 /tools | |
parent | 737838897fe41e031771979e75c4dfb6dad924cb (diff) | |
download | chromium_src-6d2d55b661b11e038d53c4b9271b67e719a72cc6.zip chromium_src-6d2d55b661b11e038d53c4b9271b67e719a72cc6.tar.gz chromium_src-6d2d55b661b11e038d53c4b9271b67e719a72cc6.tar.bz2 |
Alarm resolution changed to minutes and minimum delay added.
There is a 5 minute minimum delay enforced for released extensions
and a 0 minute delay enforced for extensions in development.
BUG=122821
TEST=Call chrome.experimental.alarms.create and verify that the alarm is delayed in the number of minutes passed in.
Review URL: http://codereview.chromium.org/10217018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/json_schema_compiler/cc_generator.py | 17 | ||||
-rw-r--r-- | tools/json_schema_compiler/idl_schema.py | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py index b8adaaf..3efad84 100644 --- a/tools/json_schema_compiler/cc_generator.py +++ b/tools/json_schema_compiler/cc_generator.py @@ -455,21 +455,16 @@ class CCGenerator(object): c = Code() c.Sblock('{') - if check_type and prop.type_ not in ( - PropertyType.CHOICES, PropertyType.ANY): - (c.Append('if (!%(value_var)s->IsType(%(value_type)s))') - .Append(' return %(failure_value)s;') - ) - if self._IsFundamentalOrFundamentalRef(prop): if prop.optional: (c.Append('%(ctype)s temp;') - .Append('if (%s)' % + .Append('if (!%s)' % cpp_util.GetAsFundamentalValue( self._cpp_type_generator.GetReferencedProperty(prop), value_var, '&temp')) - .Append(' %(dst)s->%(name)s.reset(new %(ctype)s(temp));') + .Append(' return %(failure_value)s;') + .Append('%(dst)s->%(name)s.reset(new %(ctype)s(temp));') ) else: (c.Append('if (!%s)' % @@ -477,7 +472,7 @@ class CCGenerator(object): self._cpp_type_generator.GetReferencedProperty(prop), value_var, '&%s->%s' % (dst, prop.unix_name))) - .Append('return %(failure_value)s;') + .Append(' return %(failure_value)s;') ) elif self._IsObjectOrObjectRef(prop): if prop.optional: @@ -551,7 +546,9 @@ class CCGenerator(object): # This is the same if the property is optional or not. We need a pointer # to the BinaryValue to be able to populate it, so a scoped_ptr is used # whether it is optional or required. - (c.Append('%(dst)s->%(name)s.reset(') + (c.Append('if (!%(value_var)s->IsType(%(value_type)s))') + .Append(' return %(failure_value)s;') + .Append('%(dst)s->%(name)s.reset(') .Append(' static_cast<BinaryValue*>(%(value_var)s)->DeepCopy());') ) else: diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py index 3a7e6e4..087b2f4 100644 --- a/tools/json_schema_compiler/idl_schema.py +++ b/tools/json_schema_compiler/idl_schema.py @@ -161,6 +161,8 @@ class Typeref(object): properties['type'] = 'string' elif self.typeref == 'boolean': properties['type'] = 'boolean' + elif self.typeref == 'double': + properties['type'] = 'number' elif self.typeref == 'long': properties['type'] = 'integer' elif self.typeref == 'any': |