| 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/messaging_bindings.h" | 5 #include "extensions/renderer/messaging_bindings.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 std::string target_extension_id = script_context->GetExtensionID(); | 100 std::string target_extension_id = script_context->GetExtensionID(); |
| 101 const Extension* extension = script_context->extension(); | 101 const Extension* extension = script_context->extension(); |
| 102 | 102 |
| 103 v8::Local<v8::Value> tab = v8::Null(isolate); | 103 v8::Local<v8::Value> tab = v8::Null(isolate); |
| 104 v8::Local<v8::Value> tls_channel_id_value = v8::Undefined(isolate); | 104 v8::Local<v8::Value> tls_channel_id_value = v8::Undefined(isolate); |
| 105 v8::Local<v8::Value> guest_process_id = v8::Undefined(isolate); | 105 v8::Local<v8::Value> guest_process_id = v8::Undefined(isolate); |
| 106 v8::Local<v8::Value> guest_render_frame_routing_id = v8::Undefined(isolate); | 106 v8::Local<v8::Value> guest_render_frame_routing_id = v8::Undefined(isolate); |
| 107 | 107 |
| 108 if (extension) { | 108 if (extension) { |
| 109 if (!source->tab.empty() && !extension->is_platform_app()) { | 109 if (!source->tab.empty() && !extension->is_platform_app()) { |
| 110 std::unique_ptr<content::V8ValueConverter> converter( | 110 tab = content::V8ValueConverter::Create()->ToV8Value( |
| 111 content::V8ValueConverter::create()); | 111 &source->tab, script_context->v8_context()); |
| 112 tab = converter->ToV8Value(&source->tab, script_context->v8_context()); | |
| 113 } | 112 } |
| 114 | 113 |
| 115 ExternallyConnectableInfo* externally_connectable = | 114 ExternallyConnectableInfo* externally_connectable = |
| 116 ExternallyConnectableInfo::Get(extension); | 115 ExternallyConnectableInfo::Get(extension); |
| 117 if (externally_connectable && | 116 if (externally_connectable && |
| 118 externally_connectable->accepts_tls_channel_id) { | 117 externally_connectable->accepts_tls_channel_id) { |
| 119 v8::Local<v8::String> v8_tls_channel_id; | 118 v8::Local<v8::String> v8_tls_channel_id; |
| 120 if (ToV8String(isolate, tls_channel_id.c_str(), &v8_tls_channel_id)) | 119 if (ToV8String(isolate, tls_channel_id.c_str(), &v8_tls_channel_id)) |
| 121 tls_channel_id_value = v8_tls_channel_id; | 120 tls_channel_id_value = v8_tls_channel_id; |
| 122 } | 121 } |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 ports_.erase(iter); | 544 ports_.erase(iter); |
| 546 port->Close(force_close); | 545 port->Close(force_close); |
| 547 } | 546 } |
| 548 } | 547 } |
| 549 | 548 |
| 550 int MessagingBindings::GetNextJsId() { | 549 int MessagingBindings::GetNextJsId() { |
| 551 return next_js_id_++; | 550 return next_js_id_++; |
| 552 } | 551 } |
| 553 | 552 |
| 554 } // namespace extensions | 553 } // namespace extensions |
| OLD | NEW |