OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "blimp/client/core/blimp_client_context_impl.h" | 5 #include "blimp/client/core/blimp_client_context_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/sequenced_task_runner_handle.h" | 10 #include "base/threading/sequenced_task_runner_handle.h" |
| 11 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |
11 #include "blimp/client/core/contents/blimp_contents_impl.h" | 12 #include "blimp/client/core/contents/blimp_contents_impl.h" |
12 #include "blimp/client/core/contents/blimp_contents_manager.h" | 13 #include "blimp/client/core/contents/blimp_contents_manager.h" |
13 #include "blimp/client/core/contents/ime_feature.h" | 14 #include "blimp/client/core/contents/ime_feature.h" |
14 #include "blimp/client/core/contents/navigation_feature.h" | 15 #include "blimp/client/core/contents/navigation_feature.h" |
15 #include "blimp/client/core/contents/tab_control_feature.h" | 16 #include "blimp/client/core/contents/tab_control_feature.h" |
16 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 17 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
17 #include "blimp/client/public/blimp_client_context_delegate.h" | 18 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 19 #include "blimp/client/public/compositor/compositor_dependencies.h" |
18 | 20 |
19 #if defined(OS_ANDROID) | 21 #if defined(OS_ANDROID) |
20 #include "blimp/client/core/android/blimp_client_context_impl_android.h" | 22 #include "blimp/client/core/android/blimp_client_context_impl_android.h" |
21 #endif // OS_ANDROID | 23 #endif // OS_ANDROID |
22 | 24 |
23 namespace blimp { | 25 namespace blimp { |
24 namespace client { | 26 namespace client { |
25 | 27 |
26 namespace { | 28 namespace { |
27 const char kDefaultAssignerUrl[] = | 29 const char kDefaultAssignerUrl[] = |
28 "https://blimp-pa.googleapis.com/v1/assignment"; | 30 "https://blimp-pa.googleapis.com/v1/assignment"; |
29 } // namespace | 31 } // namespace |
30 | 32 |
31 // This function is declared in //blimp/client/public/blimp_client_context.h, | 33 // This function is declared in //blimp/client/public/blimp_client_context.h, |
32 // and either this function or the one in | 34 // and either this function or the one in |
33 // //blimp/client/core/dummy_blimp_client_context.cc should be linked in to | 35 // //blimp/client/core/dummy_blimp_client_context.cc should be linked in to |
34 // any binary using BlimpClientContext::Create. | 36 // any binary using BlimpClientContext::Create. |
35 // static | 37 // static |
36 BlimpClientContext* BlimpClientContext::Create( | 38 BlimpClientContext* BlimpClientContext::Create( |
37 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
38 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner) { | 40 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| 41 std::unique_ptr<CompositorDependencies> compositor_dependencies) { |
39 #if defined(OS_ANDROID) | 42 #if defined(OS_ANDROID) |
40 return new BlimpClientContextImplAndroid(io_thread_task_runner, | 43 return new BlimpClientContextImplAndroid(io_thread_task_runner, |
41 file_thread_task_runner); | 44 file_thread_task_runner, |
| 45 std::move(compositor_dependencies)); |
42 #else | 46 #else |
43 return new BlimpClientContextImpl(io_thread_task_runner, | 47 return new BlimpClientContextImpl(io_thread_task_runner, |
44 file_thread_task_runner); | 48 file_thread_task_runner, |
| 49 std::move(compositor_dependencies)); |
45 #endif // defined(OS_ANDROID) | 50 #endif // defined(OS_ANDROID) |
46 } | 51 } |
47 | 52 |
48 BlimpClientContextImpl::BlimpClientContextImpl( | 53 BlimpClientContextImpl::BlimpClientContextImpl( |
49 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 54 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
50 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner) | 55 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| 56 std::unique_ptr<CompositorDependencies> compositor_dependencies) |
51 : BlimpClientContext(), | 57 : BlimpClientContext(), |
52 io_thread_task_runner_(io_thread_task_runner), | 58 io_thread_task_runner_(io_thread_task_runner), |
53 file_thread_task_runner_(file_thread_task_runner), | 59 file_thread_task_runner_(file_thread_task_runner), |
| 60 blimp_compositor_dependencies_( |
| 61 base::MakeUnique<BlimpCompositorDependencies>( |
| 62 std::move(compositor_dependencies))), |
54 ime_feature_(new ImeFeature), | 63 ime_feature_(new ImeFeature), |
55 navigation_feature_(new NavigationFeature), | 64 navigation_feature_(new NavigationFeature), |
56 tab_control_feature_(new TabControlFeature), | 65 tab_control_feature_(new TabControlFeature), |
57 blimp_contents_manager_( | 66 blimp_contents_manager_( |
58 new BlimpContentsManager(ime_feature_.get(), | 67 new BlimpContentsManager(ime_feature_.get(), |
59 navigation_feature_.get(), | 68 navigation_feature_.get(), |
60 tab_control_feature_.get())), | 69 tab_control_feature_.get())), |
61 weak_factory_(this) { | 70 weak_factory_(this) { |
62 net_components_.reset(new ClientNetworkComponents( | 71 net_components_.reset(new ClientNetworkComponents( |
63 base::MakeUnique<CrossThreadNetworkEventObserver>( | 72 base::MakeUnique<CrossThreadNetworkEventObserver>( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 navigation_feature_->set_outgoing_message_processor( | 169 navigation_feature_->set_outgoing_message_processor( |
161 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, | 170 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, |
162 navigation_feature_.get())); | 171 navigation_feature_.get())); |
163 tab_control_feature_->set_outgoing_message_processor( | 172 tab_control_feature_->set_outgoing_message_processor( |
164 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, | 173 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, |
165 tab_control_feature_.get())); | 174 tab_control_feature_.get())); |
166 } | 175 } |
167 | 176 |
168 } // namespace client | 177 } // namespace client |
169 } // namespace blimp | 178 } // namespace blimp |
OLD | NEW |