OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 27 matching lines...) Expand all Loading... | |
38 const IPC::Message& message) override; | 38 const IPC::Message& message) override; |
39 | 39 |
40 // Called on the UI thread. | 40 // Called on the UI thread. |
41 void AddRoutingIdForHost(GinJavaBridgeDispatcherHost* host, | 41 void AddRoutingIdForHost(GinJavaBridgeDispatcherHost* host, |
42 RenderFrameHost* render_frame_host); | 42 RenderFrameHost* render_frame_host); |
43 void RemoveHost(GinJavaBridgeDispatcherHost* host); | 43 void RemoveHost(GinJavaBridgeDispatcherHost* host); |
44 | 44 |
45 static scoped_refptr<GinJavaBridgeMessageFilter> FromHost( | 45 static scoped_refptr<GinJavaBridgeMessageFilter> FromHost( |
46 GinJavaBridgeDispatcherHost* host, bool create_if_not_exists); | 46 GinJavaBridgeDispatcherHost* host, bool create_if_not_exists); |
47 | 47 |
48 // Removes the user data for the |host| from the associated RenderProcessHost. | |
mnaganov (inactive)
2015/12/29 16:55:28
Please change the comment to: "Removes the filter,
Pritam Nikam
2015/12/30 12:05:36
Done.
| |
49 // It need to be called from |host| when communication channel between RPH and | |
50 // sandbox render process gets exited and eventually triggers the deletion of | |
51 // this filter. Once new sandbox render process gets up and ready a new | |
52 // message filter gets created and registered to receive Java bridge IPC | |
53 // messages. | |
54 void RemoveUserData(const GinJavaBridgeDispatcherHost* host); | |
mnaganov (inactive)
2015/12/29 16:55:28
Please remove `const` for consistency with the res
mnaganov (inactive)
2015/12/29 16:55:28
I would prefer to rename `RemoveUserData` into `Re
Pritam Nikam
2015/12/30 12:05:36
Done.
Pritam Nikam
2015/12/30 12:05:36
Done.
| |
55 | |
48 private: | 56 private: |
49 friend class BrowserThread; | 57 friend class BrowserThread; |
50 friend class base::DeleteHelper<GinJavaBridgeMessageFilter>; | 58 friend class base::DeleteHelper<GinJavaBridgeMessageFilter>; |
51 | 59 |
52 // ContentViewCore (who owns GinJavaBridgeDispatcherHost) outlives | 60 // ContentViewCore (who owns GinJavaBridgeDispatcherHost) outlives |
53 // WebContents, and GinJavaBridgeDispatcherHost removes itself from the map on | 61 // WebContents, and GinJavaBridgeDispatcherHost removes itself from the map on |
54 // WebContents destruction, so there is no risk that the pointer would become | 62 // WebContents destruction, so there is no risk that the pointer would become |
55 // stale. | 63 // stale. |
56 // | 64 // |
57 // The filter keeps its own routing map of RenderFrames for two reasons: | 65 // The filter keeps its own routing map of RenderFrames for two reasons: |
(...skipping 27 matching lines...) Expand all Loading... | |
85 base::Lock hosts_lock_; | 93 base::Lock hosts_lock_; |
86 | 94 |
87 // The routing id of the RenderFrameHost whose request we are processing. | 95 // The routing id of the RenderFrameHost whose request we are processing. |
88 // Used on the background thread. | 96 // Used on the background thread. |
89 int32_t current_routing_id_; | 97 int32_t current_routing_id_; |
90 }; | 98 }; |
91 | 99 |
92 } // namespace content | 100 } // namespace content |
93 | 101 |
94 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_MESSAGE_FILTER_H_ | 102 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BRIDGE_MESSAGE_FILTER_H_ |
OLD | NEW |