diff options
author | danakj <danakj@chromium.org> | 2015-11-16 16:27:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-17 00:28:45 +0000 |
commit | 8199479504103bee23b5e560a96b914b9d959caf (patch) | |
tree | e497cb99b5651a655d39b53821faec278293d79e /ash | |
parent | 563454636cfe3df6a57fff84560e8a89e4f6b175 (diff) | |
download | chromium_src-8199479504103bee23b5e560a96b914b9d959caf.zip chromium_src-8199479504103bee23b5e560a96b914b9d959caf.tar.gz chromium_src-8199479504103bee23b5e560a96b914b9d959caf.tar.bz2 |
Make operators on scoped_ptr match the ones defined for std::unique_ptr
Currently scoped_ptr is missing comparison operators other than == and
!=, and it defines those operators incorrectly (it compares to a raw
pointer but unique_ptr compares to a unique_ptr).
This fixes the operator== and !=, and adds .get() at a bunch of
callsites. And adds the < > <= >= operators so that we don't have any
differences in where you can use it. This will help the transition
from scoped_ptr to unique_ptr as no code will have to change along with
the rename wrt these operators.
R=Nico, dcheng
TBR=ellyjones, sky, jochen, wez, rockot, droger
BUG=554390
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1440593004
Cr-Commit-Position: refs/heads/master@{#359957}
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shelf/shelf_view.cc | 2 | ||||
-rw-r--r-- | ash/wm/overview/window_selector_unittest.cc | 6 | ||||
-rw-r--r-- | ash/wm/system_gesture_event_filter_unittest.cc | 2 | ||||
-rw-r--r-- | ash/wm/system_modal_container_layout_manager_unittest.cc | 2 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer_unittest.cc | 2 |
5 files changed, 6 insertions, 8 deletions
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 9f3fe0a..95c7e08 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc @@ -1900,7 +1900,7 @@ void ShelfView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) { } void ShelfView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { - if (snap_back_from_rip_off_view_ && animator == bounds_animator_) { + if (snap_back_from_rip_off_view_ && animator == bounds_animator_.get()) { if (!animator->IsAnimating(snap_back_from_rip_off_view_)) { // Coming here the animation of the ShelfButton is finished and the // previously hidden status can be shown again. Since the button itself diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 0e15230..01fdf63 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -739,8 +739,7 @@ TEST_F(WindowSelectorTest, WindowDoesNotReceiveEvents) { // The event should target the window because we are still not in overview // mode. - EXPECT_EQ(window, static_cast<aura::Window*>( - targeter->FindTargetForEvent(root_target, &event1))); + EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1)); ToggleOverview(); @@ -751,8 +750,7 @@ TEST_F(WindowSelectorTest, WindowDoesNotReceiveEvents) { ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); // Now the transparent window should be intercepting this event. - EXPECT_NE(window, static_cast<aura::Window*>( - targeter->FindTargetForEvent(root_target, &event2))); + EXPECT_NE(window.get(), targeter->FindTargetForEvent(root_target, &event2)); } // Tests that clicking on the close button effectively closes the window. diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index fc7934f..c5d8936 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -200,7 +200,7 @@ TEST_F(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) { base::OneShotTimer* timer = GetLongPressAffordanceTimer(); EXPECT_TRUE(timer->IsRunning()); - EXPECT_EQ(window1, GetLongPressAffordanceTarget()); + EXPECT_EQ(window1.get(), GetLongPressAffordanceTarget()); // Force timeout so that the affordance animation can start. timer->user_task().Run(); diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index 7273f6f..1d2eaa7 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -275,7 +275,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalNonTransient) { EXPECT_TRUE(wm::IsActiveWindow(t2)); - EXPECT_EQ(t1, ::wm::GetTransientParent(t2)); + EXPECT_EQ(t1.get(), ::wm::GetTransientParent(t2)); EXPECT_EQ(GetModalContainer(), t2->parent()); // t2 should still be active, even after clicking on t1. diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 359d0b6..0d8efc3 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -126,7 +126,7 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { const aura::Window::Windows& windows = parent->children(); for (aura::Window::Windows::const_reverse_iterator i = windows.rbegin(); i != windows.rend(); ++i) { - if (*i == window_ || *i == window2_ || *i == window3_) { + if (*i == window_.get() || *i == window2_.get() || *i == window3_.get()) { if (!result.empty()) result += " "; result += base::IntToString((*i)->id()); |