| Index: components/webmessaging/broadcast_channel_service.h
|
| diff --git a/components/webmessaging/broadcast_channel_service.h b/components/webmessaging/broadcast_channel_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1fad4e46ff1b37226669a154cc23274a78c1800e
|
| --- /dev/null
|
| +++ b/components/webmessaging/broadcast_channel_service.h
|
| @@ -0,0 +1,39 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_WEBMESSAGING_BROADCAST_CHANNEL_SERVICE_H_
|
| +#define COMPONENTS_WEBMESSAGING_BROADCAST_CHANNEL_SERVICE_H_
|
| +
|
| +#include <map>
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "components/webmessaging/public/interfaces/broadcast_channel.mojom.h"
|
| +#include "url/origin.h"
|
| +
|
| +namespace webmessaging {
|
| +
|
| +class BroadcastChannelService
|
| + : public base::RefCountedThreadSafe<BroadcastChannelService> {
|
| + public:
|
| + BroadcastChannelService();
|
| + void Connect(mojom::BroadcastChannelServiceRequest request);
|
| +
|
| + private:
|
| + class Connection;
|
| +
|
| + friend class base::RefCountedThreadSafe<BroadcastChannelService>;
|
| + ~BroadcastChannelService();
|
| +
|
| + void UnregisterConnection(Connection*);
|
| + void ReceivedMessageOnConnection(Connection*,
|
| + const url::Origin& origin,
|
| + const mojo::String& name,
|
| + const mojo::String& message);
|
| +
|
| + std::set<Connection*> connections_;
|
| +};
|
| +
|
| +} // namespace webmessaging
|
| +
|
| +#endif // COMPONENTS_WEBMESSAGING_CHANNEL_SERVICE_H_
|
|
|