OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/renderer/extensions/webview_custom_bindings.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/bind.h" |
| 10 #include "v8/include/v8.h" |
| 11 |
| 12 namespace extensions { |
| 13 |
| 14 WebViewCustomBindings::WebViewCustomBindings( |
| 15 Dispatcher* dispatcher, ChromeV8Context* context) |
| 16 : ChromeV8Extension(dispatcher, context) { |
| 17 RouteFunction("GetNextInstanceID", |
| 18 base::Bind(&WebViewCustomBindings::GetNextInstanceID, |
| 19 base::Unretained(this))); |
| 20 } |
| 21 |
| 22 void WebViewCustomBindings::GetNextInstanceID( |
| 23 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 24 static int next_instance_id = 1; |
| 25 args.GetReturnValue().Set(next_instance_id++); |
| 26 } |
| 27 |
| 28 } // namespace extensions |
OLD | NEW |