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 <string> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
10 #include "base/threading/sequenced_task_runner_handle.h" | 12 #include "base/threading/sequenced_task_runner_handle.h" |
11 #include "blimp/client/core/contents/blimp_contents_impl.h" | 13 #include "blimp/client/core/contents/blimp_contents_impl.h" |
12 #include "blimp/client/core/contents/blimp_contents_manager.h" | 14 #include "blimp/client/core/contents/blimp_contents_manager.h" |
13 #include "blimp/client/core/session/cross_thread_network_event_observer.h" | 15 #include "blimp/client/core/session/cross_thread_network_event_observer.h" |
14 #include "blimp/client/public/blimp_client_context_delegate.h" | 16 #include "blimp/client/public/blimp_client_context_delegate.h" |
15 | 17 |
16 #if defined(OS_ANDROID) | 18 #if defined(OS_ANDROID) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 weak_factory_(this) { | 54 weak_factory_(this) { |
53 net_components_.reset(new ClientNetworkComponents( | 55 net_components_.reset(new ClientNetworkComponents( |
54 base::MakeUnique<CrossThreadNetworkEventObserver>( | 56 base::MakeUnique<CrossThreadNetworkEventObserver>( |
55 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); | 57 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); |
56 | 58 |
57 // The |thread_pipe_manager_| must be set up correctly before features are | 59 // The |thread_pipe_manager_| must be set up correctly before features are |
58 // registered. | 60 // registered. |
59 thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>( | 61 thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>( |
60 io_thread_task_runner_, net_components_->GetBrowserConnectionHandler()); | 62 io_thread_task_runner_, net_components_->GetBrowserConnectionHandler()); |
61 | 63 |
62 // Initialize must only be posted after the calls features have been | 64 // Initialize must only be posted after the features have been |
63 // registered. | 65 // registered. |
64 io_thread_task_runner_->PostTask( | 66 io_thread_task_runner_->PostTask( |
65 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, | 67 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, |
66 base::Unretained(net_components_.get()))); | 68 base::Unretained(net_components_.get()))); |
67 } | 69 } |
68 | 70 |
69 BlimpClientContextImpl::~BlimpClientContextImpl() { | 71 BlimpClientContextImpl::~BlimpClientContextImpl() { |
70 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); | 72 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); |
71 } | 73 } |
72 | 74 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 119 } |
118 | 120 |
119 io_thread_task_runner_->PostTask( | 121 io_thread_task_runner_->PostTask( |
120 FROM_HERE, | 122 FROM_HERE, |
121 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, | 123 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, |
122 base::Unretained(net_components_.get()), assignment)); | 124 base::Unretained(net_components_.get()), assignment)); |
123 } | 125 } |
124 | 126 |
125 } // namespace client | 127 } // namespace client |
126 } // namespace blimp | 128 } // namespace blimp |
OLD | NEW |