| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/java/java_bridge_dispatcher_host.h" | 5 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "content/browser/renderer_host/java/java_bridge_channel_host.h" | 10 #include "content/browser/renderer_host/java/java_bridge_channel_host.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // removed, the proxy object will delete its NPObjectProxy, which will cause | 59 // removed, the proxy object will delete its NPObjectProxy, which will cause |
| 60 // the NPObjectStub to be deleted, which will drop its reference to the | 60 // the NPObjectStub to be deleted, which will drop its reference to the |
| 61 // original NPObject. | 61 // original NPObject. |
| 62 Send(new JavaBridgeMsg_RemoveNamedObject(routing_id(), name)); | 62 Send(new JavaBridgeMsg_RemoveNamedObject(routing_id(), name)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool JavaBridgeDispatcherHost::Send(IPC::Message* msg) { | 65 bool JavaBridgeDispatcherHost::Send(IPC::Message* msg) { |
| 66 return RenderViewHostObserver::Send(msg); | 66 return RenderViewHostObserver::Send(msg); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void JavaBridgeDispatcherHost::RenderViewHostDestroyed() { |
| 70 // Base implementation deletes the object. This class is ref counted, with |
| 71 // refs held by the JavaBridgeDispatcherHostManager and base::Bind, so that |
| 72 // behavior is unwanted. |
| 73 } |
| 74 |
| 69 bool JavaBridgeDispatcherHost::OnMessageReceived(const IPC::Message& msg) { | 75 bool JavaBridgeDispatcherHost::OnMessageReceived(const IPC::Message& msg) { |
| 70 bool handled = true; | 76 bool handled = true; |
| 71 IPC_BEGIN_MESSAGE_MAP(JavaBridgeDispatcherHost, msg) | 77 IPC_BEGIN_MESSAGE_MAP(JavaBridgeDispatcherHost, msg) |
| 72 IPC_MESSAGE_HANDLER_DELAY_REPLY(JavaBridgeHostMsg_GetChannelHandle, | 78 IPC_MESSAGE_HANDLER_DELAY_REPLY(JavaBridgeHostMsg_GetChannelHandle, |
| 73 OnGetChannelHandle) | 79 OnGetChannelHandle) |
| 74 IPC_MESSAGE_UNHANDLED(handled = false) | 80 IPC_MESSAGE_UNHANDLED(handled = false) |
| 75 IPC_END_MESSAGE_MAP() | 81 IPC_END_MESSAGE_MAP() |
| 76 return handled; | 82 return handled; |
| 77 } | 83 } |
| 78 | 84 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 133 |
| 128 // NPObjectStub takes a ref to the NPObject. The lifetime of the NPObjectStub | 134 // NPObjectStub takes a ref to the NPObject. The lifetime of the NPObjectStub |
| 129 // is governed by that of the NPObjectProxy in the renderer, via the channel. | 135 // is governed by that of the NPObjectProxy in the renderer, via the channel. |
| 130 // We don't need the containing window or the page URL, as we don't do | 136 // We don't need the containing window or the page URL, as we don't do |
| 131 // re-entrant sync IPC. | 137 // re-entrant sync IPC. |
| 132 new NPObjectStub(object, channel_, route_id, 0, GURL()); | 138 new NPObjectStub(object, channel_, route_id, 0, GURL()); |
| 133 // The NPObjectStub takes a reference to the NPObject. Release the ref added | 139 // The NPObjectStub takes a reference to the NPObject. Release the ref added |
| 134 // in CreateNPVariantParam(). | 140 // in CreateNPVariantParam(). |
| 135 WebKit::WebBindings::releaseObject(object); | 141 WebKit::WebBindings::releaseObject(object); |
| 136 } | 142 } |
| OLD | NEW |