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

Side by Side Diff: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.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/guest_view/mime_handler_view/mime_handler_view_con tainer.h" 5 #include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_con tainer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 void MimeHandlerViewContainer::PostMessageFromValue( 255 void MimeHandlerViewContainer::PostMessageFromValue(
256 const base::Value& message) { 256 const base::Value& message) {
257 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); 257 blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
258 if (!frame) 258 if (!frame)
259 return; 259 return;
260 260
261 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 261 v8::Isolate* isolate = v8::Isolate::GetCurrent();
262 v8::HandleScope handle_scope(isolate); 262 v8::HandleScope handle_scope(isolate);
263 v8::Context::Scope context_scope(frame->MainWorldScriptContext()); 263 v8::Context::Scope context_scope(frame->MainWorldScriptContext());
264 std::unique_ptr<content::V8ValueConverter> converter( 264 PostMessage(isolate, content::V8ValueConverter::Create()->ToV8Value(
265 content::V8ValueConverter::create()); 265 &message, frame->MainWorldScriptContext()));
266 PostMessage(isolate,
267 converter->ToV8Value(&message, frame->MainWorldScriptContext()));
268 } 266 }
269 267
270 void MimeHandlerViewContainer::OnCreateMimeHandlerViewGuestACK( 268 void MimeHandlerViewContainer::OnCreateMimeHandlerViewGuestACK(
271 int element_instance_id) { 269 int element_instance_id) {
272 DCHECK_NE(this->element_instance_id(), guest_view::kInstanceIDNone); 270 DCHECK_NE(this->element_instance_id(), guest_view::kInstanceIDNone);
273 DCHECK_EQ(this->element_instance_id(), element_instance_id); 271 DCHECK_EQ(this->element_instance_id(), element_instance_id);
274 272
275 if (!render_frame()) 273 if (!render_frame())
276 return; 274 return;
277 275
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 if (!render_frame()) 318 if (!render_frame())
321 return; 319 return;
322 320
323 render_frame()->Send( 321 render_frame()->Send(
324 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( 322 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest(
325 render_frame()->GetRoutingID(), view_id_, element_instance_id(), 323 render_frame()->GetRoutingID(), view_id_, element_instance_id(),
326 element_size_)); 324 element_size_));
327 } 325 }
328 326
329 } // namespace extensions 327 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc ('k') | extensions/renderer/i18n_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698