OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_WEBMESSAGING_BROADCAST_CHANNEL_SERVICE_H_ |
| 6 #define COMPONENTS_WEBMESSAGING_BROADCAST_CHANNEL_SERVICE_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "components/webmessaging/public/interfaces/broadcast_channel.mojom.h" |
| 12 #include "url/origin.h" |
| 13 |
| 14 namespace webmessaging { |
| 15 |
| 16 class BroadcastChannelService |
| 17 : public base::RefCountedThreadSafe<BroadcastChannelService> { |
| 18 public: |
| 19 BroadcastChannelService(); |
| 20 void Connect(mojom::BroadcastChannelServiceRequest request); |
| 21 |
| 22 private: |
| 23 class Connection; |
| 24 |
| 25 friend class base::RefCountedThreadSafe<BroadcastChannelService>; |
| 26 ~BroadcastChannelService(); |
| 27 |
| 28 void UnregisterConnection(Connection*); |
| 29 void ReceivedMessageOnConnection(Connection*, |
| 30 const url::Origin& origin, |
| 31 const mojo::String& name, |
| 32 const mojo::String& message); |
| 33 |
| 34 std::set<Connection*> connections_; |
| 35 }; |
| 36 |
| 37 } // namespace webmessaging |
| 38 |
| 39 #endif // COMPONENTS_WEBMESSAGING_CHANNEL_SERVICE_H_ |
OLD | NEW |