| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 void MimeHandlerViewContainer::PostMessageFromValue( | 269 void MimeHandlerViewContainer::PostMessageFromValue( |
| 270 const base::Value& message) { | 270 const base::Value& message) { |
| 271 blink::WebFrame* frame = render_frame()->GetWebFrame(); | 271 blink::WebFrame* frame = render_frame()->GetWebFrame(); |
| 272 if (!frame) | 272 if (!frame) |
| 273 return; | 273 return; |
| 274 | 274 |
| 275 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 275 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 276 v8::HandleScope handle_scope(isolate); | 276 v8::HandleScope handle_scope(isolate); |
| 277 v8::Context::Scope context_scope(frame->mainWorldScriptContext()); | 277 v8::Context::Scope context_scope(frame->mainWorldScriptContext()); |
| 278 scoped_ptr<content::V8ValueConverter> converter( | 278 std::unique_ptr<content::V8ValueConverter> converter( |
| 279 content::V8ValueConverter::create()); | 279 content::V8ValueConverter::create()); |
| 280 PostMessage(isolate, | 280 PostMessage(isolate, |
| 281 converter->ToV8Value(&message, frame->mainWorldScriptContext())); | 281 converter->ToV8Value(&message, frame->mainWorldScriptContext())); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void MimeHandlerViewContainer::OnCreateMimeHandlerViewGuestACK( | 284 void MimeHandlerViewContainer::OnCreateMimeHandlerViewGuestACK( |
| 285 int element_instance_id) { | 285 int element_instance_id) { |
| 286 DCHECK_NE(this->element_instance_id(), guest_view::kInstanceIDNone); | 286 DCHECK_NE(this->element_instance_id(), guest_view::kInstanceIDNone); |
| 287 DCHECK_EQ(this->element_instance_id(), element_instance_id); | 287 DCHECK_EQ(this->element_instance_id(), element_instance_id); |
| 288 | 288 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 if (!render_frame()) | 331 if (!render_frame()) |
| 332 return; | 332 return; |
| 333 | 333 |
| 334 render_frame()->Send( | 334 render_frame()->Send( |
| 335 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( | 335 new ExtensionsGuestViewHostMsg_CreateMimeHandlerViewGuest( |
| 336 render_frame()->GetRoutingID(), view_id_, element_instance_id(), | 336 render_frame()->GetRoutingID(), view_id_, element_instance_id(), |
| 337 element_size_)); | 337 element_size_)); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace extensions | 340 } // namespace extensions |
| OLD | NEW |