| 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_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // cleared. These objects remain bound until the window object is cleared | 27 // cleared. These objects remain bound until the window object is cleared |
| 28 // again. | 28 // again. |
| 29 class GinJavaBridgeDispatcher | 29 class GinJavaBridgeDispatcher |
| 30 : public base::SupportsWeakPtr<GinJavaBridgeDispatcher>, | 30 : public base::SupportsWeakPtr<GinJavaBridgeDispatcher>, |
| 31 public RenderFrameObserver { | 31 public RenderFrameObserver { |
| 32 public: | 32 public: |
| 33 // GinJavaBridgeObjects are managed by gin. An object gets destroyed | 33 // GinJavaBridgeObjects are managed by gin. An object gets destroyed |
| 34 // when it is no more referenced from JS. As GinJavaBridgeObject reports | 34 // when it is no more referenced from JS. As GinJavaBridgeObject reports |
| 35 // deletion of self to GinJavaBridgeDispatcher, we would not have stale | 35 // deletion of self to GinJavaBridgeDispatcher, we would not have stale |
| 36 // pointers here. | 36 // pointers here. |
| 37 typedef IDMap<GinJavaBridgeObject, IDMapExternalPointer> ObjectMap; | 37 typedef IDMap<GinJavaBridgeObject*> ObjectMap; |
| 38 typedef ObjectMap::KeyType ObjectID; | 38 typedef ObjectMap::KeyType ObjectID; |
| 39 | 39 |
| 40 explicit GinJavaBridgeDispatcher(RenderFrame* render_frame); | 40 explicit GinJavaBridgeDispatcher(RenderFrame* render_frame); |
| 41 ~GinJavaBridgeDispatcher() override; | 41 ~GinJavaBridgeDispatcher() override; |
| 42 | 42 |
| 43 // RenderFrameObserver override: | 43 // RenderFrameObserver override: |
| 44 bool OnMessageReceived(const IPC::Message& message) override; | 44 bool OnMessageReceived(const IPC::Message& message) override; |
| 45 void DidClearWindowObject() override; | 45 void DidClearWindowObject() override; |
| 46 | 46 |
| 47 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods); | 47 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 NamedObjectMap named_objects_; | 67 NamedObjectMap named_objects_; |
| 68 ObjectMap objects_; | 68 ObjectMap objects_; |
| 69 bool inside_did_clear_window_object_; | 69 bool inside_did_clear_window_object_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher); | 71 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace content | 74 } // namespace content |
| 75 | 75 |
| 76 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ | 76 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ |
| OLD | NEW |