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

Side by Side Diff: blimp/client/feature/compositor/blimp_input_manager.cc

Issue 2250433006: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 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 "blimp/client/feature/compositor/blimp_input_manager.h" 5 #include "blimp/client/feature/compositor/blimp_input_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void BlimpInputManager::CreateInputHandlerWrapperOnCompositorThread( 106 void BlimpInputManager::CreateInputHandlerWrapperOnCompositorThread(
107 base::WeakPtr<BlimpInputManager> input_manager_weak_ptr, 107 base::WeakPtr<BlimpInputManager> input_manager_weak_ptr,
108 const base::WeakPtr<cc::InputHandler>& input_handler) { 108 const base::WeakPtr<cc::InputHandler>& input_handler) {
109 DCHECK(IsCompositorThread()); 109 DCHECK(IsCompositorThread());
110 110
111 // The input_handler might have been destroyed at this point. 111 // The input_handler might have been destroyed at this point.
112 if (!input_handler) 112 if (!input_handler)
113 return; 113 return;
114 114
115 DCHECK(!input_handler_wrapper_); 115 DCHECK(!input_handler_wrapper_);
116 input_handler_wrapper_ = base::WrapUnique(new BlimpInputHandlerWrapper( 116 input_handler_wrapper_ = base::MakeUnique<BlimpInputHandlerWrapper>(
117 main_task_runner_, input_manager_weak_ptr, input_handler.get())); 117 main_task_runner_, input_manager_weak_ptr, input_handler.get());
118 } 118 }
119 119
120 void BlimpInputManager::HandleWebGestureEventOnCompositorThread( 120 void BlimpInputManager::HandleWebGestureEventOnCompositorThread(
121 const blink::WebGestureEvent& gesture_event) { 121 const blink::WebGestureEvent& gesture_event) {
122 DCHECK(IsCompositorThread()); 122 DCHECK(IsCompositorThread());
123 123
124 if (input_handler_wrapper_) 124 if (input_handler_wrapper_)
125 input_handler_wrapper_->HandleWebGestureEvent(gesture_event); 125 input_handler_wrapper_->HandleWebGestureEvent(gesture_event);
126 } 126 }
127 127
(...skipping 18 matching lines...) Expand all
146 bool BlimpInputManager::IsMainThread() const { 146 bool BlimpInputManager::IsMainThread() const {
147 return main_task_runner_->BelongsToCurrentThread(); 147 return main_task_runner_->BelongsToCurrentThread();
148 } 148 }
149 149
150 bool BlimpInputManager::IsCompositorThread() const { 150 bool BlimpInputManager::IsCompositorThread() const {
151 return compositor_task_runner_->BelongsToCurrentThread(); 151 return compositor_task_runner_->BelongsToCurrentThread();
152 } 152 }
153 153
154 } // namespace client 154 } // namespace client
155 } // namespace blimp 155 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc ('k') | blimp/client/session/blimp_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698