Chromium Code Reviews| Index: content/public/browser/push_messaging_router.h |
| diff --git a/content/public/browser/push_messaging_router.h b/content/public/browser/push_messaging_router.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4e7d9d092620a7b16a76d4229f98492b88bfaa04 |
| --- /dev/null |
| +++ b/content/public/browser/push_messaging_router.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2014 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 CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_ROUTER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_ROUTER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/common/content_export.h" |
| +#include "content/public/common/push_messaging_status.h" |
| + |
| +namespace content { |
| + |
| +class BrowserContext; |
| +struct PushMessagingApplicationId; |
| + |
| +// Routes messages from a PushMessagingService to the correct Service Worker. |
| +class CONTENT_EXPORT PushMessagingRouter { |
| + public: |
| + static scoped_ptr<PushMessagingRouter> Create( |
| + BrowserContext* browser_context); |
| + |
| + typedef base::Callback<void(PushMessagingStatus /* push_messaging_status */)> |
| + SendMessageCallback; |
| + |
| + // Sends a push message with |data| to the Service Worker identified by |
| + // |application_id|. Must be called on the UI thread. |
| + virtual void SendMessage( |
|
johnme
2014/07/23 14:25:23
s/Send/Deliver/ to avoid confusion with upstream m
Michael van Ouwerkerk
2014/07/23 16:57:52
Done.
|
| + const PushMessagingApplicationId& application_id, |
| + const std::string& data, |
| + const SendMessageCallback& send_message_callback) = 0; |
| + |
| + virtual ~PushMessagingRouter() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_ROUTER_H_ |