| 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_MESSAGE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // example). | 67 // example). |
| 68 struct MessageChannel; | 68 struct MessageChannel; |
| 69 | 69 |
| 70 // One side of the communication handled by extensions::MessageService. | 70 // One side of the communication handled by extensions::MessageService. |
| 71 class MessagePort { | 71 class MessagePort { |
| 72 public: | 72 public: |
| 73 virtual ~MessagePort() {} | 73 virtual ~MessagePort() {} |
| 74 // Notify the port that the channel has been opened. | 74 // Notify the port that the channel has been opened. |
| 75 virtual void DispatchOnConnect(int dest_port_id, | 75 virtual void DispatchOnConnect(int dest_port_id, |
| 76 const std::string& channel_name, | 76 const std::string& channel_name, |
| 77 const base::DictionaryValue& source_tab, | 77 scoped_ptr<base::DictionaryValue> source_tab, |
| 78 int source_frame_id, |
| 78 const std::string& source_extension_id, | 79 const std::string& source_extension_id, |
| 79 const std::string& target_extension_id, | 80 const std::string& target_extension_id, |
| 80 const GURL& source_url, | 81 const GURL& source_url, |
| 81 const std::string& tls_channel_id) {} | 82 const std::string& tls_channel_id) {} |
| 82 | 83 |
| 83 // Notify the port that the channel has been closed. If |error_message| is | 84 // Notify the port that the channel has been closed. If |error_message| is |
| 84 // non-empty, it indicates an error occurred while opening the connection. | 85 // non-empty, it indicates an error occurred while opening the connection. |
| 85 virtual void DispatchOnDisconnect(int source_port_id, | 86 virtual void DispatchOnDisconnect(int source_port_id, |
| 86 const std::string& error_message) {} | 87 const std::string& error_message) {} |
| 87 | 88 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 LazyBackgroundTaskQueue* lazy_background_task_queue_; | 272 LazyBackgroundTaskQueue* lazy_background_task_queue_; |
| 272 | 273 |
| 273 base::WeakPtrFactory<MessageService> weak_factory_; | 274 base::WeakPtrFactory<MessageService> weak_factory_; |
| 274 | 275 |
| 275 DISALLOW_COPY_AND_ASSIGN(MessageService); | 276 DISALLOW_COPY_AND_ASSIGN(MessageService); |
| 276 }; | 277 }; |
| 277 | 278 |
| 278 } // namespace extensions | 279 } // namespace extensions |
| 279 | 280 |
| 280 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ | 281 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_MESSAGE_SERVICE_H_ |
| OLD | NEW |