Index: cc/trees/threaded_channel.h |
diff --git a/cc/trees/threaded_channel.h b/cc/trees/threaded_channel.h |
index 1a4b8b7027ad2acf883fc730def38235f6701a94..edd1444e6112be72b85285b586e76eb73895df4f 100644 |
--- a/cc/trees/threaded_channel.h |
+++ b/cc/trees/threaded_channel.h |
@@ -13,7 +13,6 @@ |
#include "cc/trees/proxy_common.h" |
#include "cc/trees/proxy_impl.h" |
#include "cc/trees/proxy_main.h" |
-#include "cc/trees/thread_proxy.h" |
namespace base { |
class SingleThreadTaskRunner; |
@@ -22,9 +21,9 @@ class SingleThreadTaskRunner; |
namespace cc { |
class ChannelImpl; |
class ChannelMain; |
+class LayerTreeHost; |
class ProxyImpl; |
class ProxyMain; |
-class ThreadProxy; |
// An implementation of ChannelMain and ChannelImpl that sends commands between |
// ProxyMain and ProxyImpl across thread boundaries. |
@@ -69,9 +68,7 @@ class CC_EXPORT ThreadedChannel : public ChannelMain, public ChannelImpl { |
// TODO(khushalsagar): Make this ProxyMain* and write the initialization |
Wez
2015/11/10 01:41:51
nit: Looks like it _is_ now ProxyMain* ?
Khushal
2015/11/11 04:17:47
Done.
|
// sequence. Currently ThreadProxy implements both so we pass the pointer |
// and set ProxyImpl. |
- ThreadProxy* thread_proxy, |
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
- scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
+ ProxyMain* proxy_main); |
~ThreadedChannel() override; |
@@ -99,9 +96,13 @@ class CC_EXPORT ThreadedChannel : public ChannelMain, public ChannelImpl { |
void StartCommitOnImpl(CompletionEvent* completion, |
LayerTreeHost* layer_tree_host, |
bool hold_commit_for_activation) override; |
- void InitializeImplOnImpl(CompletionEvent* completion, |
- LayerTreeHost* layer_tree_host) override; |
- void LayerTreeHostClosedOnImpl(CompletionEvent* completion) override; |
+ |
Wez
2015/11/10 01:41:51
nit: Why is there a blank line here? Are these par
Khushal
2015/11/11 04:17:47
These are all ChannelMain implementation. Fixed.
|
+ void InitializeImpl( |
+ CompletionEvent* completion, |
+ LayerTreeHost* layer_tree_host, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source) override; |
+ void CloseImpl(CompletionEvent* completion) override; |
+ bool IsInitialized() const override; |
// ChannelImpl Implementation |
void DidCompleteSwapBuffers() override; |
@@ -123,28 +124,31 @@ class CC_EXPORT ThreadedChannel : public ChannelMain, public ChannelImpl { |
void BeginMainFrame( |
scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override; |
+ ProxyImpl* proxy_impl() const { return proxy_impl_.get(); } |
+ |
protected: |
- ThreadedChannel(ThreadProxy* thread_proxy, |
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
- scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
+ explicit ThreadedChannel(ProxyMain* proxy_main); |
+ |
+ // virtual for testing. |
+ virtual scoped_ptr<ProxyImpl> CreateProxyImpl( |
+ ChannelImpl* channel_impl, |
+ LayerTreeHost* layer_tree_host, |
+ TaskRunnerProvider* task_runner_provider, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source); |
private: |
+ void InitializeImplOnImpl( |
+ CompletionEvent* completion, |
+ LayerTreeHost* layer_tree_host, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source); |
+ void CloseImplOnImpl(CompletionEvent* completion); |
+ |
base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; |
ProxyMain* proxy_main_; |
- ProxyImpl* proxy_impl_; |
- |
- // TODO(khushalsagar): Temporary variable to access proxy for assertion checks |
- // Remove this once the proxy class is split and the complete |
- // implementation for controlling communication across threads is moved to |
- // ThreadedChannel. |
- Proxy* proxy_; |
- |
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
- |
- scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
+ scoped_ptr<ProxyImpl> proxy_impl_; |
Wez
2015/11/10 01:41:51
This doesn't look right; you're creating ThreadCha
Khushal
2015/11/11 04:17:47
ProxyImpl is created and destroyed only on the imp
Wez
2015/11/12 22:30:18
Sorry, I missed the proxy_impl_.reset() in the Clo
Khushal
2015/11/13 04:02:17
Yeah, Sorry I missed that. It should be there. It
Wez
2015/11/18 01:50:35
Not quite - it's absolutely fine to check whether
|
DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); |
}; |