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

Side by Side Diff: extensions/renderer/messaging_bindings.cc

Issue 2931393003: [Content] Update V8ValueConverter::create to return a std::unique_ptr (Closed)
Patch Set: rebase Created 3 years, 6 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
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const std::string& source_url_spec = info.source_url.spec(); 121 const std::string& source_url_spec = info.source_url.spec();
122 const Extension* extension = script_context->extension(); 122 const Extension* extension = script_context->extension();
123 123
124 v8::Local<v8::Value> tab = v8::Null(isolate); 124 v8::Local<v8::Value> tab = v8::Null(isolate);
125 v8::Local<v8::Value> tls_channel_id_value = v8::Undefined(isolate); 125 v8::Local<v8::Value> tls_channel_id_value = v8::Undefined(isolate);
126 v8::Local<v8::Value> guest_process_id = v8::Undefined(isolate); 126 v8::Local<v8::Value> guest_process_id = v8::Undefined(isolate);
127 v8::Local<v8::Value> guest_render_frame_routing_id = v8::Undefined(isolate); 127 v8::Local<v8::Value> guest_render_frame_routing_id = v8::Undefined(isolate);
128 128
129 if (extension) { 129 if (extension) {
130 if (!source->tab.empty() && !extension->is_platform_app()) { 130 if (!source->tab.empty() && !extension->is_platform_app()) {
131 std::unique_ptr<content::V8ValueConverter> converter( 131 tab = content::V8ValueConverter::Create()->ToV8Value(
132 content::V8ValueConverter::create()); 132 &source->tab, script_context->v8_context());
133 tab = converter->ToV8Value(&source->tab, script_context->v8_context());
134 } 133 }
135 134
136 ExternallyConnectableInfo* externally_connectable = 135 ExternallyConnectableInfo* externally_connectable =
137 ExternallyConnectableInfo::Get(extension); 136 ExternallyConnectableInfo::Get(extension);
138 if (externally_connectable && 137 if (externally_connectable &&
139 externally_connectable->accepts_tls_channel_id) { 138 externally_connectable->accepts_tls_channel_id) {
140 v8::Local<v8::String> v8_tls_channel_id; 139 v8::Local<v8::String> v8_tls_channel_id;
141 if (ToV8String(isolate, tls_channel_id.c_str(), &v8_tls_channel_id)) 140 if (ToV8String(isolate, tls_channel_id.c_str(), &v8_tls_channel_id))
142 tls_channel_id_value = v8_tls_channel_id; 141 tls_channel_id_value = v8_tls_channel_id;
143 } 142 }
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 ports_.erase(iter); 551 ports_.erase(iter);
553 port->Close(force_close); 552 port->Close(force_close);
554 } 553 }
555 } 554 }
556 555
557 int MessagingBindings::GetNextJsId() { 556 int MessagingBindings::GetNextJsId() {
558 return next_js_id_++; 557 return next_js_id_++;
559 } 558 }
560 559
561 } // namespace extensions 560 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/i18n_custom_bindings.cc ('k') | extensions/renderer/runtime_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698