Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: content/renderer/java/gin_java_bridge_dispatcher.h

Issue 2496653002: Part 2 of base::IDMap refactor to eliminate IDMapOwnPointer/IDMapExternalPointer modes (Closed)
Patch Set: typedefs => using statements, update comments in base/id_map.h Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 using ObjectMap = IDMap<GinJavaBridgeObject*>;
38 typedef ObjectMap::KeyType ObjectID; 38 using ObjectID = ObjectMap::KeyType;
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);
48 bool HasJavaMethod(ObjectID object_id, const std::string& method_name); 48 bool HasJavaMethod(ObjectID object_id, const std::string& method_name);
(...skipping 18 matching lines...) Expand all
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_
OLDNEW
« no previous file with comments | « content/renderer/dom_storage/webstoragearea_impl.cc ('k') | content/renderer/media/audio_input_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698