| 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/runtime_custom_bindings.h" | 5 #include "extensions/renderer/runtime_custom_bindings.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 base::Unretained(this))); | 31 base::Unretained(this))); |
| 32 } | 32 } |
| 33 | 33 |
| 34 RuntimeCustomBindings::~RuntimeCustomBindings() { | 34 RuntimeCustomBindings::~RuntimeCustomBindings() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void RuntimeCustomBindings::GetManifest( | 37 void RuntimeCustomBindings::GetManifest( |
| 38 const v8::FunctionCallbackInfo<v8::Value>& args) { | 38 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 39 CHECK(context()->extension()); | 39 CHECK(context()->extension()); |
| 40 | 40 |
| 41 std::unique_ptr<content::V8ValueConverter> converter( | 41 args.GetReturnValue().Set(content::V8ValueConverter::Create()->ToV8Value( |
| 42 content::V8ValueConverter::create()); | |
| 43 args.GetReturnValue().Set(converter->ToV8Value( | |
| 44 context()->extension()->manifest()->value(), context()->v8_context())); | 42 context()->extension()->manifest()->value(), context()->v8_context())); |
| 45 } | 43 } |
| 46 | 44 |
| 47 void RuntimeCustomBindings::GetExtensionViews( | 45 void RuntimeCustomBindings::GetExtensionViews( |
| 48 const v8::FunctionCallbackInfo<v8::Value>& args) { | 46 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 49 CHECK_EQ(args.Length(), 3); | 47 CHECK_EQ(args.Length(), 3); |
| 50 CHECK(args[0]->IsInt32()); | 48 CHECK(args[0]->IsInt32()); |
| 51 CHECK(args[1]->IsInt32()); | 49 CHECK(args[1]->IsInt32()); |
| 52 CHECK(args[2]->IsString()); | 50 CHECK(args[2]->IsString()); |
| 53 | 51 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 v8::Maybe<bool> maybe = | 106 v8::Maybe<bool> maybe = |
| 109 v8_views->CreateDataProperty(v8_context, v8_index++, window); | 107 v8_views->CreateDataProperty(v8_context, v8_index++, window); |
| 110 CHECK(maybe.IsJust() && maybe.FromJust()); | 108 CHECK(maybe.IsJust() && maybe.FromJust()); |
| 111 } | 109 } |
| 112 } | 110 } |
| 113 | 111 |
| 114 args.GetReturnValue().Set(v8_views); | 112 args.GetReturnValue().Set(v8_views); |
| 115 } | 113 } |
| 116 | 114 |
| 117 } // namespace extensions | 115 } // namespace extensions |
| OLD | NEW |