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

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 634243003: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr [part-4] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formating fix. Created 6 years, 2 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 377
378 void set_test_started(bool started) { test_started_ = started; } 378 void set_test_started(bool started) { test_started_ = started; }
379 379
380 virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } 380 virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); }
381 381
382 private: 382 private:
383 LayerTreeHostForTesting(TestHooks* test_hooks, 383 LayerTreeHostForTesting(TestHooks* test_hooks,
384 LayerTreeHostClient* client, 384 LayerTreeHostClient* client,
385 const LayerTreeSettings& settings) 385 const LayerTreeSettings& settings)
386 : LayerTreeHost(client, NULL, settings), 386 : LayerTreeHost(client, nullptr, settings),
387 shared_bitmap_manager_(new TestSharedBitmapManager()), 387 shared_bitmap_manager_(new TestSharedBitmapManager()),
388 test_hooks_(test_hooks), 388 test_hooks_(test_hooks),
389 test_started_(false) {} 389 test_started_(false) {}
390 390
391 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; 391 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
392 TestHooks* test_hooks_; 392 TestHooks* test_hooks_;
393 bool test_started_; 393 bool test_started_;
394 }; 394 };
395 395
396 LayerTreeTest::LayerTreeTest() 396 LayerTreeTest::LayerTreeTest()
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 void LayerTreeTest::DoBeginTest() { 516 void LayerTreeTest::DoBeginTest() {
517 client_ = LayerTreeHostClientForTesting::Create(this); 517 client_ = LayerTreeHostClientForTesting::Create(this);
518 518
519 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get()); 519 DCHECK(!impl_thread_ || impl_thread_->message_loop_proxy().get());
520 layer_tree_host_ = LayerTreeHostForTesting::Create( 520 layer_tree_host_ = LayerTreeHostForTesting::Create(
521 this, 521 this,
522 client_.get(), 522 client_.get(),
523 settings_, 523 settings_,
524 base::MessageLoopProxy::current(), 524 base::MessageLoopProxy::current(),
525 impl_thread_ ? impl_thread_->message_loop_proxy() : NULL); 525 impl_thread_ ? impl_thread_->message_loop_proxy() : nullptr);
526 ASSERT_TRUE(layer_tree_host_); 526 ASSERT_TRUE(layer_tree_host_);
527 527
528 started_ = true; 528 started_ = true;
529 beginning_ = true; 529 beginning_ = true;
530 SetupTree(); 530 SetupTree();
531 WillBeginTest(); 531 WillBeginTest();
532 BeginTest(); 532 BeginTest();
533 beginning_ = false; 533 beginning_ = false;
534 if (end_when_begin_returns_) 534 if (end_when_begin_returns_)
535 RealEndTest(); 535 RealEndTest();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 if (impl->pending_tree()) 705 if (impl->pending_tree())
706 return impl->pending_tree()->source_frame_number(); 706 return impl->pending_tree()->source_frame_number();
707 if (impl->active_tree()) 707 if (impl->active_tree())
708 return impl->active_tree()->source_frame_number(); 708 return impl->active_tree()->source_frame_number();
709 // Source frames start at 0, so this is invalid. 709 // Source frames start at 0, so this is invalid.
710 return -1; 710 return -1;
711 } 711 }
712 712
713 void LayerTreeTest::DestroyLayerTreeHost() { 713 void LayerTreeTest::DestroyLayerTreeHost() {
714 if (layer_tree_host_ && layer_tree_host_->root_layer()) 714 if (layer_tree_host_ && layer_tree_host_->root_layer())
715 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); 715 layer_tree_host_->root_layer()->SetLayerTreeHost(nullptr);
716 layer_tree_host_ = nullptr; 716 layer_tree_host_ = nullptr;
717 } 717 }
718 718
719 } // namespace cc 719 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698