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

Side by Side Diff: chrome/renderer/extensions/tts_custom_bindings.cc

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 | Annotate | Revision Log
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 #include "chrome/renderer/extensions/tts_custom_bindings.h" 5 #include "chrome/renderer/extensions/tts_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "grit/renderer_resources.h" 9 #include "grit/renderer_resources.h"
10 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 TTSCustomBindings::TTSCustomBindings() 14 TTSCustomBindings::TTSCustomBindings(
15 : ChromeV8Extension(NULL) { 15 Dispatcher* dispatcher, v8::Handle<v8::Context> v8_context)
16 : ChromeV8Extension(dispatcher, v8_context) {
16 RouteStaticFunction("GetNextTTSEventId", &GetNextTTSEventId); 17 RouteStaticFunction("GetNextTTSEventId", &GetNextTTSEventId);
17 } 18 }
18 19
19 // static 20 // static
20 v8::Handle<v8::Value> TTSCustomBindings::GetNextTTSEventId( 21 v8::Handle<v8::Value> TTSCustomBindings::GetNextTTSEventId(
21 const v8::Arguments& args) { 22 const v8::Arguments& args) {
22 // Note: this works because the TTS API only works in the 23 // Note: this works because the TTS API only works in the
23 // extension process, not content scripts. 24 // extension process, not content scripts.
24 static int next_tts_event_id = 1; 25 static int next_tts_event_id = 1;
25 return v8::Integer::New(next_tts_event_id++); 26 return v8::Integer::New(next_tts_event_id++);
26 } 27 }
27 28
28 } // extensions 29 } // extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/tts_custom_bindings.h ('k') | chrome/renderer/extensions/v8_schema_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698