| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "content/browser/renderer_host/render_view_host_impl.h" | 11 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 12 #include "content/common/child_process.h" | 12 #include "content/common/child_process.h" |
| 13 #include "content/common/java_bridge_messages.h" | 13 #include "content/common/java_bridge_messages.h" |
| 14 #include "content/common/npobject_stub.h" | 14 #include "content/common/npobject_stub.h" |
| 15 #include "content/common/npobject_util.h" // For CreateNPVariantParam() | 15 #include "content/common/npobject_util.h" // For CreateNPVariantParam() |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
| 19 | 19 |
| 20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 using content::RenderViewHost; |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 class JavaBridgeThread : public base::Thread { | 24 class JavaBridgeThread : public base::Thread { |
| 24 public: | 25 public: |
| 25 JavaBridgeThread() : base::Thread("JavaBridge") { | 26 JavaBridgeThread() : base::Thread("JavaBridge") { |
| 26 Start(); | 27 Start(); |
| 27 } | 28 } |
| 28 virtual ~JavaBridgeThread() { | 29 virtual ~JavaBridgeThread() { |
| 29 Stop(); | 30 Stop(); |
| 30 } | 31 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // is governed by that of the NPObjectProxy in the renderer, via the channel. | 138 // is governed by that of the NPObjectProxy in the renderer, via the channel. |
| 138 // Pass 0 for the containing window, as it's only used by plugins to pump the | 139 // Pass 0 for the containing window, as it's only used by plugins to pump the |
| 139 // window message queue when a method on a renderer-side object causes a | 140 // window message queue when a method on a renderer-side object causes a |
| 140 // dialog to be displayed, and the Java Bridge does not need this | 141 // dialog to be displayed, and the Java Bridge does not need this |
| 141 // functionality. The page URL is also not required. | 142 // functionality. The page URL is also not required. |
| 142 new NPObjectStub(object, channel_, route_id, 0, GURL()); | 143 new NPObjectStub(object, channel_, route_id, 0, GURL()); |
| 143 // The NPObjectStub takes a reference to the NPObject. Release the ref added | 144 // The NPObjectStub takes a reference to the NPObject. Release the ref added |
| 144 // in CreateNPVariantParam(). | 145 // in CreateNPVariantParam(). |
| 145 WebKit::WebBindings::releaseObject(object); | 146 WebKit::WebBindings::releaseObject(object); |
| 146 } | 147 } |
| OLD | NEW |