| 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/extensions_guest_view_container.h" | 5 #include "extensions/renderer/guest_view/extensions_guest_view_container.h" |
| 6 | 6 |
| 7 #include "content/public/renderer/render_frame.h" | 7 #include "content/public/renderer/render_frame.h" |
| 8 #include "content/public/renderer/render_view.h" | 8 #include "content/public/renderer/render_view.h" |
| 9 #include "extensions/common/extension_messages.h" | 9 #include "extensions/common/extension_messages.h" |
| 10 #include "extensions/common/guest_view/guest_view_constants.h" | 10 #include "extensions/common/guest_view/guest_view_constants.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const IPC::Message& message) { | 72 const IPC::Message& message) { |
| 73 ExtensionMsg_GuestAttached::Param param; | 73 ExtensionMsg_GuestAttached::Param param; |
| 74 if (!ExtensionMsg_GuestAttached::Read(&message, ¶m)) | 74 if (!ExtensionMsg_GuestAttached::Read(&message, ¶m)) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 // If we don't have a callback then there's nothing more to do. | 77 // If we don't have a callback then there's nothing more to do. |
| 78 if (!HasCallback()) | 78 if (!HasCallback()) |
| 79 return; | 79 return; |
| 80 | 80 |
| 81 content::RenderView* guest_proxy_render_view = | 81 content::RenderView* guest_proxy_render_view = |
| 82 content::RenderView::FromRoutingID(param.b); | 82 content::RenderView::FromRoutingID(get<1>(param)); |
| 83 // TODO(fsamuel): Should we be reporting an error to JavaScript or DCHECKing? | 83 // TODO(fsamuel): Should we be reporting an error to JavaScript or DCHECKing? |
| 84 if (!guest_proxy_render_view) | 84 if (!guest_proxy_render_view) |
| 85 return; | 85 return; |
| 86 | 86 |
| 87 v8::HandleScope handle_scope(isolate()); | 87 v8::HandleScope handle_scope(isolate()); |
| 88 v8::Handle<v8::Function> callback = GetCallback(); | 88 v8::Handle<v8::Function> callback = GetCallback(); |
| 89 v8::Handle<v8::Context> context = callback->CreationContext(); | 89 v8::Handle<v8::Context> context = callback->CreationContext(); |
| 90 if (context.IsEmpty()) | 90 if (context.IsEmpty()) |
| 91 return; | 91 return; |
| 92 | 92 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 void ExtensionsGuestViewContainer::HandlePendingResponseCallback( | 233 void ExtensionsGuestViewContainer::HandlePendingResponseCallback( |
| 234 const IPC::Message& message) { | 234 const IPC::Message& message) { |
| 235 CHECK(pending_response_.get()); | 235 CHECK(pending_response_.get()); |
| 236 linked_ptr<Request> pending_response(pending_response_.release()); | 236 linked_ptr<Request> pending_response(pending_response_.release()); |
| 237 pending_response->HandleResponse(message); | 237 pending_response->HandleResponse(message); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace extensions | 240 } // namespace extensions |
| OLD | NEW |