| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |