Chromium Code Reviews| Index: content/public/browser/navigator_connect_context.h |
| diff --git a/content/renderer/gpu/queue_message_swap_promise.h b/content/public/browser/navigator_connect_context.h |
| similarity index 23% |
| copy from content/renderer/gpu/queue_message_swap_promise.h |
| copy to content/public/browser/navigator_connect_context.h |
| index 245323e320f4b478ad1bf084cbc90d1acc0e06e5..34beccd534b2d1bc032bfc337bd8b1f36d8db3c5 100644 |
| --- a/content/renderer/gpu/queue_message_swap_promise.h |
| +++ b/content/public/browser/navigator_connect_context.h |
| @@ -2,46 +2,35 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
| -#define CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
| +#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_ |
| +#define CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| -#include "cc/base/swap_promise.h" |
| - |
| -namespace IPC { |
| -class SyncMessageFilter; |
| -} |
| namespace content { |
| -class FrameSwapMessageQueue; |
| - |
| -class QueueMessageSwapPromise : public cc::SwapPromise { |
| +class NavigatorConnectServiceFactory; |
| + |
| +// Use this class to register additional navigator.connect service factories. |
| +// The most recently added factory that claims to handle a URL will be used to |
|
scheib
2015/01/23 22:03:58
Move the AddFactory doc to the method.
Marijn Kruisselbrink
2015/01/26 21:34:26
Done.
|
| +// handle a connection request for that URL. |
| +// One instance of this class exists per StoragePartition. |
| +// TODO(mek): Add API to this class so NavigatorConnectService implementations |
| +// can send messages back to the client. |
| +// TODO(mek): Add API so services can close a connection. |
| +class NavigatorConnectContext |
| + : public base::RefCountedThreadSafe<NavigatorConnectContext> { |
| public: |
| - QueueMessageSwapPromise(scoped_refptr<IPC::SyncMessageFilter> message_sender, |
| - scoped_refptr<FrameSwapMessageQueue> message_queue, |
| - int source_frame_number); |
| - |
| - ~QueueMessageSwapPromise() override; |
| - |
| - void DidSwap(cc::CompositorFrameMetadata* metadata) override; |
| - |
| - void DidNotSwap(DidNotSwapReason reason) override; |
| - |
| - int64 TraceId() const override; |
| - |
| - private: |
| - void PromiseCompleted(); |
| + virtual void AddFactory( |
| + scoped_ptr<NavigatorConnectServiceFactory> factory) = 0; |
| - scoped_refptr<IPC::SyncMessageFilter> message_sender_; |
| - scoped_refptr<content::FrameSwapMessageQueue> message_queue_; |
| - int source_frame_number_; |
| -#if DCHECK_IS_ON() |
| - bool completed_; |
| -#endif |
| + protected: |
| + friend class base::RefCountedThreadSafe<NavigatorConnectContext>; |
| + NavigatorConnectContext() {} |
| + virtual ~NavigatorConnectContext() {} |
| }; |
| } // namespace content |
| -#endif // CONTENT_RENDERER_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
| +#endif // CONTENT_PUBLIC_BROWSER_NAVIGATOR_CONNECT_CONTEXT_H_ |