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 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // to |object|, which is manipulated on the background thread. This class | 42 // to |object|, which is manipulated on the background thread. This class |
43 // holds a reference to |object| for the time that the proxy object is bound | 43 // holds a reference to |object| for the time that the proxy object is bound |
44 // to the window object. | 44 // to the window object. |
45 void AddNamedObject(const base::string16& name, NPObject* object); | 45 void AddNamedObject(const base::string16& name, NPObject* object); |
46 void RemoveNamedObject(const base::string16& name); | 46 void RemoveNamedObject(const base::string16& name); |
47 | 47 |
48 // Since this object is ref-counted, it might outlive render_frame_host. | 48 // Since this object is ref-counted, it might outlive render_frame_host. |
49 void RenderFrameDeleted(); | 49 void RenderFrameDeleted(); |
50 | 50 |
51 void OnGetChannelHandle(IPC::Message* reply_msg); | 51 void OnGetChannelHandle(IPC::Message* reply_msg); |
52 void Send(IPC::Message* msg); | |
53 | 52 |
54 private: | 53 private: |
55 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; | 54 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; |
56 virtual ~JavaBridgeDispatcherHost(); | 55 virtual ~JavaBridgeDispatcherHost(); |
57 | 56 |
| 57 void Send(IPC::Message* msg); |
| 58 |
58 void GetChannelHandle(IPC::Message* reply_msg); | 59 void GetChannelHandle(IPC::Message* reply_msg); |
59 void CreateNPVariantParam(NPObject* object, NPVariant_Param* param); | 60 void CreateNPVariantParam(NPObject* object, NPVariant_Param* param); |
60 void CreateObjectStub(NPObject* object, int render_process_id, int route_id); | 61 void CreateObjectStub(NPObject* object, int render_process_id, int route_id); |
61 | 62 |
62 scoped_refptr<NPChannelBase> channel_; | 63 scoped_refptr<NPChannelBase> channel_; |
63 RenderFrameHost* render_frame_host_; | 64 RenderFrameHost* render_frame_host_; |
64 std::vector<base::WeakPtr<NPObjectStub> > stubs_; | 65 std::vector<base::WeakPtr<NPObjectStub> > stubs_; |
65 | 66 |
66 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); | 67 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); |
67 }; | 68 }; |
68 | 69 |
69 } // namespace content | 70 } // namespace content |
70 | 71 |
71 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 72 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
OLD | NEW |