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

Side by Side Diff: extensions/renderer/messaging_bindings.h

Issue 2909673003: [Extensions Bindings] Request JS execution from messaging bindings (Closed)
Patch Set: lazyboy's Created 3 years, 6 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 EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ 5 #ifndef EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_
6 #define EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ 6 #define EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 const std::string& error_message, 63 const std::string& error_message,
64 content::RenderFrame* restrict_to_render_frame); 64 content::RenderFrame* restrict_to_render_frame);
65 65
66 // Returns an existing port with the given |id|, or null. 66 // Returns an existing port with the given |id|, or null.
67 ExtensionPort* GetPortWithId(const PortId& id); 67 ExtensionPort* GetPortWithId(const PortId& id);
68 68
69 // Creates a new port with the given |id|. MessagingBindings owns the 69 // Creates a new port with the given |id|. MessagingBindings owns the
70 // returned port. 70 // returned port.
71 ExtensionPort* CreateNewPortWithId(const PortId& id); 71 ExtensionPort* CreateNewPortWithId(const PortId& id);
72 72
73 // Removes the port with the given |js_id|.
74 void RemovePortWithJsId(int js_id);
75
76 const base::UnguessableToken& context_id() const { return context_id_; } 73 const base::UnguessableToken& context_id() const { return context_id_; }
77 74
78 base::WeakPtr<MessagingBindings> GetWeakPtr(); 75 base::WeakPtr<MessagingBindings> GetWeakPtr();
79 76
80 private: 77 private:
81 using PortMap = std::map<int, std::unique_ptr<ExtensionPort>>; 78 using PortMap = std::map<int, std::unique_ptr<ExtensionPort>>;
82 79
83 // JS Exposed Function: Sends a message along the given channel. 80 // JS Exposed Function: Sends a message along the given channel.
84 void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args); 81 void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args);
85 82
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const base::UnguessableToken context_id_; 118 const base::UnguessableToken context_id_;
122 119
123 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_; 120 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_;
124 121
125 DISALLOW_COPY_AND_ASSIGN(MessagingBindings); 122 DISALLOW_COPY_AND_ASSIGN(MessagingBindings);
126 }; 123 };
127 124
128 } // namespace extensions 125 } // namespace extensions
129 126
130 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ 127 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_
OLDNEW
« no previous file with comments | « extensions/renderer/js_extension_bindings_system.cc ('k') | extensions/renderer/messaging_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698