summaryrefslogtreecommitdiffstats
path: root/cc/test/threaded_channel_for_test.cc
blob: 468eec3b66a2cd5cd2a324a2688be67179cba738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2011 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.

#include "cc/test/threaded_channel_for_test.h"

#include "cc/test/proxy_impl_for_test.h"

namespace cc {

scoped_ptr<ThreadedChannelForTest> ThreadedChannelForTest::Create(
    TestHooks* test_hooks,
    ProxyMain* proxy_main,
    TaskRunnerProvider* task_runner_provider) {
  return make_scoped_ptr(
      new ThreadedChannelForTest(test_hooks, proxy_main, task_runner_provider));
}

ThreadedChannelForTest::ThreadedChannelForTest(
    TestHooks* test_hooks,
    ProxyMain* proxy_main,
    TaskRunnerProvider* task_runner_provider)
    : ThreadedChannel(proxy_main, task_runner_provider),
      test_hooks_(test_hooks),
      proxy_impl_for_test_(nullptr) {}

scoped_ptr<ProxyImpl> ThreadedChannelForTest::CreateProxyImpl(
    ChannelImpl* channel_impl,
    LayerTreeHost* layer_tree_host,
    TaskRunnerProvider* task_runner_provider,
    scoped_ptr<BeginFrameSource> external_begin_frame_source) {
  scoped_ptr<ProxyImplForTest> proxy_impl = ProxyImplForTest::Create(
      test_hooks_, channel_impl, layer_tree_host, task_runner_provider,
      std::move(external_begin_frame_source));
  proxy_impl_for_test_ = proxy_impl.get();
  return std::move(proxy_impl);
}

}  // namespace cc