OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/extensions/api/messaging/message_service.h" | 9 #include "chrome/browser/extensions/api/messaging/message_service.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 content::RenderFrameHost* rfh, | 34 content::RenderFrameHost* rfh, |
35 bool include_child_frames); | 35 bool include_child_frames); |
36 // Create a port that is tied to all frames of an extension, possibly spanning | 36 // Create a port that is tied to all frames of an extension, possibly spanning |
37 // multiple tabs, including the invisible background page, popups, etc. | 37 // multiple tabs, including the invisible background page, popups, etc. |
38 ExtensionMessagePort(base::WeakPtr<MessageService> message_service, | 38 ExtensionMessagePort(base::WeakPtr<MessageService> message_service, |
39 int port_id, | 39 int port_id, |
40 const std::string& extension_id, | 40 const std::string& extension_id, |
41 content::RenderProcessHost* extension_process); | 41 content::RenderProcessHost* extension_process); |
42 ~ExtensionMessagePort() override; | 42 ~ExtensionMessagePort() override; |
43 | 43 |
| 44 // MessageService::MessagePort: |
| 45 void RemoveCommonFrames(const MessagePort& port) override; |
| 46 bool HasFrame(content::RenderFrameHost* rfh) const override; |
44 bool IsValidPort() override; | 47 bool IsValidPort() override; |
45 | |
46 // MessageService::MessagePort: | |
47 void DispatchOnConnect(const std::string& channel_name, | 48 void DispatchOnConnect(const std::string& channel_name, |
48 scoped_ptr<base::DictionaryValue> source_tab, | 49 scoped_ptr<base::DictionaryValue> source_tab, |
49 int source_frame_id, | 50 int source_frame_id, |
50 int guest_process_id, | 51 int guest_process_id, |
51 int guest_render_frame_routing_id, | 52 int guest_render_frame_routing_id, |
52 const std::string& source_extension_id, | 53 const std::string& source_extension_id, |
53 const std::string& target_extension_id, | 54 const std::string& target_extension_id, |
54 const GURL& source_url, | 55 const GURL& source_url, |
55 const std::string& tls_channel_id) override; | 56 const std::string& tls_channel_id) override; |
56 void DispatchOnDisconnect(const std::string& error_message) override; | 57 void DispatchOnDisconnect(const std::string& error_message) override; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 99 |
99 ExtensionHost* background_host_ptr_; // used in IncrementLazyKeepaliveCount | 100 ExtensionHost* background_host_ptr_; // used in IncrementLazyKeepaliveCount |
100 scoped_ptr<FrameTracker> frame_tracker_; | 101 scoped_ptr<FrameTracker> frame_tracker_; |
101 | 102 |
102 DISALLOW_COPY_AND_ASSIGN(ExtensionMessagePort); | 103 DISALLOW_COPY_AND_ASSIGN(ExtensionMessagePort); |
103 }; | 104 }; |
104 | 105 |
105 } // namespace extensions | 106 } // namespace extensions |
106 | 107 |
107 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ | 108 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ |
OLD | NEW |