Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1104)

Side by Side Diff: cc/trees/proxy_impl.cc

Issue 2666423002: Assert sequence validity on non-thread-safe RefCount manipulations (2) (Closed)
Patch Set: remove DisableSequenceConsistencyAssertions Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/memory/ref_counted.cc ('k') | content/browser/gpu/gpu_data_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_impl.h" 5 #include "cc/trees/proxy_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 bool forced_draw = true; 488 bool forced_draw = true;
489 return DrawInternal(forced_draw); 489 return DrawInternal(forced_draw);
490 } 490 }
491 491
492 void ProxyImpl::ScheduledActionCommit() { 492 void ProxyImpl::ScheduledActionCommit() {
493 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionCommit"); 493 TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionCommit");
494 DCHECK(IsImplThread()); 494 DCHECK(IsImplThread());
495 DCHECK(IsMainThreadBlocked()); 495 DCHECK(IsMainThreadBlocked());
496 DCHECK(commit_completion_event_); 496 DCHECK(commit_completion_event_);
497 497
498 // Relax the cross-thread access restriction to non-thread-safe RefCount.
499 // It's safe since the main thread is blocked while a main-thread-bound
500 // compositor stuff are accessed from the impl thread.
501 base::ScopedAllowCrossThreadRefCountAccess
502 allow_cross_thread_ref_count_access;
503
498 layer_tree_host_impl_->BeginCommit(); 504 layer_tree_host_impl_->BeginCommit();
499 blocked_main_commit().layer_tree_host->FinishCommitOnImplThread( 505 blocked_main_commit().layer_tree_host->FinishCommitOnImplThread(
500 layer_tree_host_impl_.get()); 506 layer_tree_host_impl_.get());
501 507
502 // Remove the LayerTreeHost reference before the completion event is signaled 508 // Remove the LayerTreeHost reference before the completion event is signaled
503 // and cleared. This is necessary since blocked_main_commit() allows access 509 // and cleared. This is necessary since blocked_main_commit() allows access
504 // only while we have the completion event to ensure the main thread is 510 // only while we have the completion event to ensure the main thread is
505 // blocked for a commit. 511 // blocked for a commit.
506 blocked_main_commit().layer_tree_host = nullptr; 512 blocked_main_commit().layer_tree_host = nullptr;
507 513
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { 649 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() {
644 DCHECK(IsMainThreadBlocked() && commit_completion_event_); 650 DCHECK(IsMainThreadBlocked() && commit_completion_event_);
645 return main_thread_blocked_commit_vars_unsafe_; 651 return main_thread_blocked_commit_vars_unsafe_;
646 } 652 }
647 653
648 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { 654 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() {
649 return task_runner_provider_->MainThreadTaskRunner(); 655 return task_runner_provider_->MainThreadTaskRunner();
650 } 656 }
651 657
652 } // namespace cc 658 } // namespace cc
OLDNEW
« no previous file with comments | « base/memory/ref_counted.cc ('k') | content/browser/gpu/gpu_data_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698