| 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" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); | 81 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { | 84 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { |
| 85 delegate_ = delegate; | 85 delegate_ = delegate; |
| 86 } | 86 } |
| 87 | 87 |
| 88 std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() { | 88 std::unique_ptr<BlimpContents> BlimpClientContextImpl::CreateBlimpContents() { |
| 89 std::unique_ptr<BlimpContents> blimp_contents = | 89 std::unique_ptr<BlimpContents> blimp_contents = |
| 90 blimp_contents_manager_->CreateBlimpContents(); | 90 blimp_contents_manager_->CreateBlimpContents(); |
| 91 delegate_->AttachBlimpContentsHelpers(blimp_contents.get()); | 91 if (blimp_contents) |
| 92 delegate_->AttachBlimpContentsHelpers(blimp_contents.get()); |
| 92 return blimp_contents; | 93 return blimp_contents; |
| 93 } | 94 } |
| 94 | 95 |
| 95 void BlimpClientContextImpl::Connect() { | 96 void BlimpClientContextImpl::Connect() { |
| 96 // Lazy initialization of IdentitySource. | 97 // Lazy initialization of IdentitySource. |
| 97 if (!identity_source_) { | 98 if (!identity_source_) { |
| 98 identity_source_ = base::MakeUnique<IdentitySource>( | 99 identity_source_ = base::MakeUnique<IdentitySource>( |
| 99 delegate_, | 100 delegate_, |
| 100 base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource, | 101 base::Bind(&BlimpClientContextImpl::ConnectToAssignmentSource, |
| 101 base::Unretained(this))); | 102 base::Unretained(this))); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 navigation_feature_->set_outgoing_message_processor( | 161 navigation_feature_->set_outgoing_message_processor( |
| 161 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, | 162 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, |
| 162 navigation_feature_.get())); | 163 navigation_feature_.get())); |
| 163 tab_control_feature_->set_outgoing_message_processor( | 164 tab_control_feature_->set_outgoing_message_processor( |
| 164 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, | 165 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, |
| 165 tab_control_feature_.get())); | 166 tab_control_feature_.get())); |
| 166 } | 167 } |
| 167 | 168 |
| 168 } // namespace client | 169 } // namespace client |
| 169 } // namespace blimp | 170 } // namespace blimp |
| OLD | NEW |