| 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/context/blimp_client_context_impl.h" | 5 #include "blimp/client/core/context/blimp_client_context_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 const char kDefaultAssignerUrl[] = | 45 const char kDefaultAssignerUrl[] = |
| 46 "https://blimp-pa.googleapis.com/v1/assignment"; | 46 "https://blimp-pa.googleapis.com/v1/assignment"; |
| 47 | 47 |
| 48 void DropConnectionOnIOThread(ClientNetworkComponents* net_components) { | 48 void DropConnectionOnIOThread(ClientNetworkComponents* net_components) { |
| 49 net_components->GetBrowserConnectionHandler()->DropCurrentConnection(); | 49 net_components->GetBrowserConnectionHandler()->DropCurrentConnection(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void AppendDefaultCommandLineFlags(base::CommandLine* command_line) { |
| 53 // Enables the updated compositing path before any tabs are created. |
| 54 command_line->AppendSwitch(switches::kEnableUpdatedCompositingPath); |
| 55 } |
| 56 |
| 52 } // namespace | 57 } // namespace |
| 53 | 58 |
| 54 // This function is declared in //blimp/client/public/blimp_client_context.h, | 59 // This function is declared in //blimp/client/public/blimp_client_context.h, |
| 55 // and either this function or the one in | 60 // and either this function or the one in |
| 56 // //blimp/client/core/dummy_blimp_client_context.cc should be linked in to | 61 // //blimp/client/core/dummy_blimp_client_context.cc should be linked in to |
| 57 // any binary using BlimpClientContext::Create. | 62 // any binary using BlimpClientContext::Create. |
| 58 // static | 63 // static |
| 59 BlimpClientContext* BlimpClientContext::Create( | 64 BlimpClientContext* BlimpClientContext::Create( |
| 60 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 65 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
| 61 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 66 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 settings_feature_->PushSettings(); | 137 settings_feature_->PushSettings(); |
| 133 | 138 |
| 134 connection_status_.AddObserver(this); | 139 connection_status_.AddObserver(this); |
| 135 | 140 |
| 136 // Initialize must only be posted after the features have been | 141 // Initialize must only be posted after the features have been |
| 137 // registered. | 142 // registered. |
| 138 io_thread_task_runner_->PostTask( | 143 io_thread_task_runner_->PostTask( |
| 139 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, | 144 FROM_HERE, base::Bind(&ClientNetworkComponents::Initialize, |
| 140 base::Unretained(net_components_.get()))); | 145 base::Unretained(net_components_.get()))); |
| 141 | 146 |
| 147 AppendDefaultCommandLineFlags(base::CommandLine::ForCurrentProcess()); |
| 148 |
| 142 UMA_HISTOGRAM_BOOLEAN("Blimp.Supported", true); | 149 UMA_HISTOGRAM_BOOLEAN("Blimp.Supported", true); |
| 143 } | 150 } |
| 144 | 151 |
| 145 BlimpClientContextImpl::~BlimpClientContextImpl() { | 152 BlimpClientContextImpl::~BlimpClientContextImpl() { |
| 146 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); | 153 io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release()); |
| 147 connection_status_.RemoveObserver(this); | 154 connection_status_.RemoveObserver(this); |
| 148 } | 155 } |
| 149 | 156 |
| 150 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { | 157 void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) { |
| 151 DCHECK(!delegate_ || !delegate); | 158 DCHECK(!delegate_ || !delegate); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (result >= 0) { | 282 if (result >= 0) { |
| 276 delegate_->OnEngineDisconnected(result); | 283 delegate_->OnEngineDisconnected(result); |
| 277 } else { | 284 } else { |
| 278 delegate_->OnNetworkDisconnected(result); | 285 delegate_->OnNetworkDisconnected(result); |
| 279 } | 286 } |
| 280 } | 287 } |
| 281 } | 288 } |
| 282 | 289 |
| 283 } // namespace client | 290 } // namespace client |
| 284 } // namespace blimp | 291 } // namespace blimp |
| OLD | NEW |