OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/binding_generating_native_handler.h" | 5 #include "extensions/renderer/binding_generating_native_handler.h" |
6 | 6 |
7 #include "extensions/renderer/module_system.h" | 7 #include "extensions/renderer/module_system.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 .As<v8::Function>(); | 27 .As<v8::Function>(); |
28 v8::Handle<v8::Value> argv[] = { | 28 v8::Handle<v8::Value> argv[] = { |
29 v8::String::NewFromUtf8(isolate, api_name_.c_str())}; | 29 v8::String::NewFromUtf8(isolate, api_name_.c_str())}; |
30 v8::Handle<v8::Object> binding_instance = | 30 v8::Handle<v8::Object> binding_instance = |
31 create_binding->Call(binding, arraysize(argv), argv)->ToObject(); | 31 create_binding->Call(binding, arraysize(argv), argv)->ToObject(); |
32 v8::Handle<v8::Function> generate = | 32 v8::Handle<v8::Function> generate = |
33 binding_instance->Get(v8::String::NewFromUtf8(isolate, "generate")) | 33 binding_instance->Get(v8::String::NewFromUtf8(isolate, "generate")) |
34 .As<v8::Function>(); | 34 .As<v8::Function>(); |
35 v8::Local<v8::Object> object = v8::Object::New(isolate); | 35 v8::Local<v8::Object> object = v8::Object::New(isolate); |
36 v8::Handle<v8::Value> compiled_schema = | 36 v8::Handle<v8::Value> compiled_schema = |
37 generate->Call(binding_instance, 0, NULL); | 37 generate->Call(binding_instance, 0, nullptr); |
38 if (!compiled_schema.IsEmpty()) { | 38 if (!compiled_schema.IsEmpty()) { |
39 object->Set(v8::String::NewFromUtf8(isolate, bind_to_.c_str()), | 39 object->Set(v8::String::NewFromUtf8(isolate, bind_to_.c_str()), |
40 compiled_schema); | 40 compiled_schema); |
41 } | 41 } |
42 return scope.Escape(object); | 42 return scope.Escape(object); |
43 } | 43 } |
44 | 44 |
45 } // namespace extensions | 45 } // namespace extensions |
OLD | NEW |