| 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 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 GinJavaBoundObject::ObjectID object_id, | 65 GinJavaBoundObject::ObjectID object_id, |
| 66 const std::string& method_name, | 66 const std::string& method_name, |
| 67 IPC::Message* reply_msg); | 67 IPC::Message* reply_msg); |
| 68 void OnInvokeMethod(RenderFrameHost* render_frame_host, | 68 void OnInvokeMethod(RenderFrameHost* render_frame_host, |
| 69 GinJavaBoundObject::ObjectID object_id, | 69 GinJavaBoundObject::ObjectID object_id, |
| 70 const std::string& method_name, | 70 const std::string& method_name, |
| 71 const base::ListValue& arguments, | 71 const base::ListValue& arguments, |
| 72 IPC::Message* reply_msg); | 72 IPC::Message* reply_msg); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 typedef std::set<RenderFrameHost*> RendererSet; | |
| 76 void OnObjectWrapperDeleted(RenderFrameHost* render_frame_host, | 75 void OnObjectWrapperDeleted(RenderFrameHost* render_frame_host, |
| 77 GinJavaBoundObject::ObjectID object_id); | 76 GinJavaBoundObject::ObjectID object_id); |
| 78 | 77 |
| 78 bool IsValidRenderFrameHost(RenderFrameHost* render_frame_host); |
| 79 void SendReply(RenderFrameHost* render_frame_host, IPC::Message* reply_msg); | 79 void SendReply(RenderFrameHost* render_frame_host, IPC::Message* reply_msg); |
| 80 void SendMethods(RenderFrameHost* render_frame_host, | 80 void SendMethods(RenderFrameHost* render_frame_host, |
| 81 IPC::Message* reply_msg, | 81 IPC::Message* reply_msg, |
| 82 const std::set<std::string>& method_names); | 82 const std::set<std::string>& method_names); |
| 83 void SendHasMethodReply(RenderFrameHost* render_frame_host, | 83 void SendHasMethodReply(RenderFrameHost* render_frame_host, |
| 84 IPC::Message* reply_msg, | 84 IPC::Message* reply_msg, |
| 85 bool result); | 85 bool result); |
| 86 void ProcessMethodInvocationResult( | 86 void ProcessMethodInvocationResult( |
| 87 RenderFrameHost* render_frame_host, | 87 RenderFrameHost* render_frame_host, |
| 88 IPC::Message* reply_msg, | 88 IPC::Message* reply_msg, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 103 size_t count); | 103 size_t count); |
| 104 | 104 |
| 105 // Every time a GinJavaBoundObject backed by a real Java object is | 105 // Every time a GinJavaBoundObject backed by a real Java object is |
| 106 // created/destroyed, we insert/remove a strong ref to that Java object into | 106 // created/destroyed, we insert/remove a strong ref to that Java object into |
| 107 // this set so that it doesn't get garbage collected while it's still | 107 // this set so that it doesn't get garbage collected while it's still |
| 108 // potentially in use. Although the set is managed native side, it's owned | 108 // potentially in use. Although the set is managed native side, it's owned |
| 109 // and defined in Java so that pushing refs into it does not create new GC | 109 // and defined in Java so that pushing refs into it does not create new GC |
| 110 // roots that would prevent ContentViewCore from being garbage collected. | 110 // roots that would prevent ContentViewCore from being garbage collected. |
| 111 JavaObjectWeakGlobalRef retained_object_set_; | 111 JavaObjectWeakGlobalRef retained_object_set_; |
| 112 bool allow_object_contents_inspection_; | 112 bool allow_object_contents_inspection_; |
| 113 RendererSet renderers_; | |
| 114 GinJavaBoundObject::ObjectMap objects_; | 113 GinJavaBoundObject::ObjectMap objects_; |
| 115 typedef std::map<std::string, GinJavaBoundObject::ObjectID> NamedObjectMap; | 114 typedef std::map<std::string, GinJavaBoundObject::ObjectID> NamedObjectMap; |
| 116 NamedObjectMap named_objects_; | 115 NamedObjectMap named_objects_; |
| 117 | 116 |
| 118 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcherHost); | 117 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcherHost); |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 } // namespace content | 120 } // namespace content |
| 122 | 121 |
| 123 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ | 122 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_HOST_H_ |
| OLD | NEW |