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

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

Issue 709933002: Add frameId to MessageSender (extension messaging API) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Generate frameId in browser Created 6 years, 1 month 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 "extensions/renderer/script_context_set.h" 10 #include "extensions/renderer/script_context_set.h"
11 11
12 struct ExtensionMsg_ExternalConnectionInfo; 12 struct ExtensionMsg_ExternalConnectionInfo;
13 struct ExtensionMsg_TabConnectionInfo;
13 14
14 namespace base { 15 namespace base {
15 class DictionaryValue; 16 class DictionaryValue;
16 } 17 }
17 18
18 namespace content { 19 namespace content {
19 class RenderView; 20 class RenderView;
20 } 21 }
21 22
22 namespace v8 { 23 namespace v8 {
(...skipping 16 matching lines...) Expand all
39 // Creates an instance of the extension. 40 // Creates an instance of the extension.
40 static ObjectBackedNativeHandler* Get(Dispatcher* dispatcher, 41 static ObjectBackedNativeHandler* Get(Dispatcher* dispatcher,
41 ScriptContext* context); 42 ScriptContext* context);
42 43
43 // Dispatches the onConnect content script messaging event to some contexts 44 // Dispatches the onConnect content script messaging event to some contexts
44 // in |context_set|. If |restrict_to_render_view| is specified, only contexts 45 // in |context_set|. If |restrict_to_render_view| is specified, only contexts
45 // in that render view will receive the message. 46 // in that render view will receive the message.
46 static void DispatchOnConnect(const ScriptContextSet& context_set, 47 static void DispatchOnConnect(const ScriptContextSet& context_set,
47 int target_port_id, 48 int target_port_id,
48 const std::string& channel_name, 49 const std::string& channel_name,
49 const base::DictionaryValue& source_tab, 50 const ExtensionMsg_TabConnectionInfo& source,
50 const ExtensionMsg_ExternalConnectionInfo& info, 51 const ExtensionMsg_ExternalConnectionInfo& info,
51 const std::string& tls_channel_id, 52 const std::string& tls_channel_id,
52 content::RenderView* restrict_to_render_view); 53 content::RenderView* restrict_to_render_view);
53 54
54 // Delivers a message sent using content script messaging to some of the 55 // Delivers a message sent using content script messaging to some of the
55 // contexts in |bindings_context_set|. If |restrict_to_render_view| is 56 // contexts in |bindings_context_set|. If |restrict_to_render_view| is
56 // specified, only contexts in that render view will receive the message. 57 // specified, only contexts in that render view will receive the message.
57 static void DeliverMessage(const ScriptContextSet& context_set, 58 static void DeliverMessage(const ScriptContextSet& context_set,
58 int target_port_id, 59 int target_port_id,
59 const Message& message, 60 const Message& message,
60 content::RenderView* restrict_to_render_view); 61 content::RenderView* restrict_to_render_view);
61 62
62 // Dispatches the onDisconnect event in response to the channel being closed. 63 // Dispatches the onDisconnect event in response to the channel being closed.
63 static void DispatchOnDisconnect( 64 static void DispatchOnDisconnect(
64 const ScriptContextSet& context_set, 65 const ScriptContextSet& context_set,
65 int port_id, 66 int port_id,
66 const std::string& error_message, 67 const std::string& error_message,
67 content::RenderView* restrict_to_render_view); 68 content::RenderView* restrict_to_render_view);
68 }; 69 };
69 70
70 } // namespace extensions 71 } // namespace extensions
71 72
72 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ 73 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698