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

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

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 <set> 10 #include <set>
10 11
11 #include "base/id_map.h" 12 #include "base/id_map.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "content/common/android/gin_java_bridge_errors.h" 16 #include "content/common/android/gin_java_bridge_errors.h"
17 #include "content/public/renderer/render_frame_observer.h" 17 #include "content/public/renderer/render_frame_observer.h"
18 18
19 namespace blink { 19 namespace blink {
20 class WebFrame; 20 class WebFrame;
21 } 21 }
22 22
23 namespace content { 23 namespace content {
(...skipping 19 matching lines...) Expand all
43 43
44 explicit GinJavaBridgeDispatcher(RenderFrame* render_frame); 44 explicit GinJavaBridgeDispatcher(RenderFrame* render_frame);
45 ~GinJavaBridgeDispatcher() override; 45 ~GinJavaBridgeDispatcher() override;
46 46
47 // RenderFrameObserver override: 47 // RenderFrameObserver override:
48 bool OnMessageReceived(const IPC::Message& message) override; 48 bool OnMessageReceived(const IPC::Message& message) override;
49 void DidClearWindowObject() override; 49 void DidClearWindowObject() override;
50 50
51 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods); 51 void GetJavaMethods(ObjectID object_id, std::set<std::string>* methods);
52 bool HasJavaMethod(ObjectID object_id, const std::string& method_name); 52 bool HasJavaMethod(ObjectID object_id, const std::string& method_name);
53 scoped_ptr<base::Value> InvokeJavaMethod(ObjectID object_id, 53 std::unique_ptr<base::Value> InvokeJavaMethod(
54 const std::string& method_name, 54 ObjectID object_id,
55 const base::ListValue& arguments, 55 const std::string& method_name,
56 GinJavaBridgeError* error); 56 const base::ListValue& arguments,
57 GinJavaBridgeError* error);
57 GinJavaBridgeObject* GetObject(ObjectID object_id); 58 GinJavaBridgeObject* GetObject(ObjectID object_id);
58 void OnGinJavaBridgeObjectDeleted(GinJavaBridgeObject* object); 59 void OnGinJavaBridgeObjectDeleted(GinJavaBridgeObject* object);
59 60
60 private: 61 private:
61 void OnAddNamedObject(const std::string& name, 62 void OnAddNamedObject(const std::string& name,
62 ObjectID object_id); 63 ObjectID object_id);
63 void OnRemoveNamedObject(const std::string& name); 64 void OnRemoveNamedObject(const std::string& name);
64 void OnSetAllowObjectContentsInspection(bool allow); 65 void OnSetAllowObjectContentsInspection(bool allow);
65 66
66 typedef std::map<std::string, ObjectID> NamedObjectMap; 67 typedef std::map<std::string, ObjectID> NamedObjectMap;
67 NamedObjectMap named_objects_; 68 NamedObjectMap named_objects_;
68 ObjectMap objects_; 69 ObjectMap objects_;
69 bool inside_did_clear_window_object_; 70 bool inside_did_clear_window_object_;
70 71
71 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher); 72 DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeDispatcher);
72 }; 73 };
73 74
74 } // namespace content 75 } // namespace content
75 76
76 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_ 77 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_BRIDGE_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/renderer/internal_document_state_data.h ('k') | content/renderer/java/gin_java_bridge_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698