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..fef4355c23f8110fa1be3619bee9f1845a03e23e |
| --- /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; |
|
michaeln
2014/07/24 02:08:16
where is this defined?
Michael van Ouwerkerk
2014/07/24 14:18:55
(In another pending patch)
|
| + |
| +// 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 */)> |
| + DeliverMessageCallback; |
| + |
| + // Delivers a push message with |data| to the Service Worker identified by |
| + // |application_id|. Must be called on the UI thread. |
| + virtual void DeliverMessage( |
| + const PushMessagingApplicationId& application_id, |
| + const std::string& data, |
| + const DeliverMessageCallback& deliver_message_callback) = 0; |
| + |
| + virtual ~PushMessagingRouter() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_ROUTER_H_ |