Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/trees/proxy_main.h" | 5 #include "cc/trees/proxy_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 task_runner_provider_->blocking_main_thread_task_runner()); | 258 task_runner_provider_->blocking_main_thread_task_runner()); |
| 259 | 259 |
| 260 bool hold_commit_for_activation = commit_waits_for_activation_; | 260 bool hold_commit_for_activation = commit_waits_for_activation_; |
| 261 commit_waits_for_activation_ = false; | 261 commit_waits_for_activation_ = false; |
| 262 CompletionEvent completion; | 262 CompletionEvent completion; |
| 263 ImplThreadTaskRunner()->PostTask( | 263 ImplThreadTaskRunner()->PostTask( |
| 264 FROM_HERE, base::Bind(&ProxyImpl::NotifyReadyToCommitOnImpl, | 264 FROM_HERE, base::Bind(&ProxyImpl::NotifyReadyToCommitOnImpl, |
| 265 base::Unretained(proxy_impl_.get()), &completion, | 265 base::Unretained(proxy_impl_.get()), &completion, |
| 266 layer_tree_host_, begin_main_frame_start_time, | 266 layer_tree_host_, begin_main_frame_start_time, |
| 267 hold_commit_for_activation)); | 267 hold_commit_for_activation)); |
| 268 completion.Wait(); | 268 // TODO(sunnyps): Remove this code once crbug.com/668892 is fixed. |
| 269 // content/common/content_constants_internal.cc defines hung renderer delay | |
| 270 // as 30s so choose something less than that but still sufficiently long. | |
| 271 constexpr base::TimeDelta kDumpDelay = base::TimeDelta::FromSeconds(20); | |
|
vmpstr
2017/04/11 01:06:46
nit: static?
sunnyps
2017/04/11 18:22:48
Done.
| |
| 272 if (!completion.TimedWait(kDumpDelay)) { | |
| 273 ImplThreadTaskRunner()->PostTask( | |
| 274 FROM_HERE, base::Bind(&ProxyImpl::DumpForBeginMainFrameHang, | |
| 275 base::Unretained(proxy_impl_.get()))); | |
| 276 completion.Wait(); | |
|
vmpstr
2017/04/11 01:06:46
nit: this will DCHECK since we've already waited.
sunnyps
2017/04/11 18:22:48
Changed TimedWait to set waited_ to false if wait
| |
| 277 } | |
| 269 } | 278 } |
| 270 | 279 |
| 271 current_pipeline_stage_ = NO_PIPELINE_STAGE; | 280 current_pipeline_stage_ = NO_PIPELINE_STAGE; |
| 272 layer_tree_host_->CommitComplete(); | 281 layer_tree_host_->CommitComplete(); |
| 273 layer_tree_host_->DidBeginMainFrame(); | 282 layer_tree_host_->DidBeginMainFrame(); |
| 274 } | 283 } |
| 275 | 284 |
| 276 bool ProxyMain::IsStarted() const { | 285 bool ProxyMain::IsStarted() const { |
| 277 DCHECK(IsMainThread()); | 286 DCHECK(IsMainThread()); |
| 278 return started_; | 287 return started_; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 | 514 |
| 506 bool ProxyMain::IsImplThread() const { | 515 bool ProxyMain::IsImplThread() const { |
| 507 return task_runner_provider_->IsImplThread(); | 516 return task_runner_provider_->IsImplThread(); |
| 508 } | 517 } |
| 509 | 518 |
| 510 base::SingleThreadTaskRunner* ProxyMain::ImplThreadTaskRunner() { | 519 base::SingleThreadTaskRunner* ProxyMain::ImplThreadTaskRunner() { |
| 511 return task_runner_provider_->ImplThreadTaskRunner(); | 520 return task_runner_provider_->ImplThreadTaskRunner(); |
| 512 } | 521 } |
| 513 | 522 |
| 514 } // namespace cc | 523 } // namespace cc |
| OLD | NEW |