Fix TTS code to be compatible with new extension API parameter serialization.
commit1f7f8fe0eb8908ea4aee0896a6f93d62fcb440ff
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 8 May 2012 22:45:30 +0000 (8 22:45 +0000)
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 8 May 2012 22:45:30 +0000 (8 22:45 +0000)
treefa5bdc1c0451b495afcf1a87b1e413dacb89b881
parent268942a27d80974dd10f5c2727c1db6e3a0ee87b
Fix TTS code to be compatible with new extension API parameter serialization.

Some TTS tests broke when I landed codereview.chromium.org/10161038 because it
turned out the tts.speak method takes the incoming options dictionary argument
and re-purposes it to send an event it dispatches back to extension code. With
the above reverenced CL changes to avoid JSON.stringify, instead using
V8ValueConverter, it turns out one subtle difference between the two is that
JSON.stringify will ignore key/value pairs where the value is not a
stringifiable type (in this case, a function), whereas V8ValueConverter leaves
the key in and inserts a null value. This was causing the schema parameter
validation to fail for the event dispatch.

BUG=122675
TEST=Existing tests should pass, and re-landing the CL referenced above should
work with the TTS API browser tests.

Review URL: https://chromiumcodereview.appspot.com/10382065

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135933 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/speech/extension_api/tts_engine_extension_api.cc
chrome/browser/speech/extension_api/tts_extension_api_constants.cc
chrome/browser/speech/extension_api/tts_extension_api_constants.h