| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/child/npobject_proxy.h" | 5 #include "content/child/npobject_proxy.h" |
| 6 | 6 |
| 7 #include "content/child/np_channel_base.h" | 7 #include "content/child/np_channel_base.h" |
| 8 #include "content/child/npobject_util.h" | 8 #include "content/child/npobject_util.h" |
| 9 #include "content/child/plugin_messages.h" | 9 #include "content/child/plugin_messages.h" |
| 10 #include "third_party/WebKit/public/web/WebBindings.h" | 10 #include "third_party/WebKit/public/web/WebBindings.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // NPObjects. | 78 // NPObjects. |
| 79 channel_->RemoveMappingForNPObjectProxy(route_id_); | 79 channel_->RemoveMappingForNPObjectProxy(route_id_); |
| 80 channel_->RemoveRoute(route_id_); | 80 channel_->RemoveRoute(route_id_); |
| 81 Send(new NPObjectMsg_Release(route_id_)); | 81 Send(new NPObjectMsg_Release(route_id_)); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 NPObject* NPObjectProxy::Create(NPChannelBase* channel, | 85 NPObject* NPObjectProxy::Create(NPChannelBase* channel, |
| 86 int route_id, | 86 int route_id, |
| 87 int render_view_id, | 87 int render_view_id, |
| 88 const GURL& page_url) { | 88 const GURL& page_url, |
| 89 NPP owner) { |
| 89 NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>( | 90 NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>( |
| 90 WebBindings::createObject(0, &npclass_proxy_)); | 91 WebBindings::createObject(owner, &npclass_proxy_)); |
| 91 obj->proxy = new NPObjectProxy(channel, route_id, render_view_id, page_url); | 92 obj->proxy = new NPObjectProxy(channel, route_id, render_view_id, page_url); |
| 92 channel->AddMappingForNPObjectProxy(route_id, &obj->object); | 93 channel->AddMappingForNPObjectProxy(route_id, &obj->object); |
| 93 return reinterpret_cast<NPObject*>(obj); | 94 return reinterpret_cast<NPObject*>(obj); |
| 94 } | 95 } |
| 95 | 96 |
| 96 bool NPObjectProxy::Send(IPC::Message* msg) { | 97 bool NPObjectProxy::Send(IPC::Message* msg) { |
| 97 if (channel_.get()) | 98 if (channel_.get()) |
| 98 return channel_->Send(msg); | 99 return channel_->Send(msg); |
| 99 | 100 |
| 100 delete msg; | 101 delete msg; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 proxy = NULL; | 499 proxy = NULL; |
| 499 if (!result) | 500 if (!result) |
| 500 return false; | 501 return false; |
| 501 | 502 |
| 502 CreateNPVariant( | 503 CreateNPVariant( |
| 503 result_param, channel.get(), result_var, render_view_id, page_url); | 504 result_param, channel.get(), result_var, render_view_id, page_url); |
| 504 return true; | 505 return true; |
| 505 } | 506 } |
| 506 | 507 |
| 507 } // namespace content | 508 } // namespace content |
| OLD | NEW |