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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2259823003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « services/ui/ws/modal_window_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client), 387 window_server_->EmbedAtWindow(window, InvalidUserId(), std::move(client),
388 flags, 388 flags,
389 base::WrapUnique(new DefaultAccessPolicy)); 389 base::WrapUnique(new DefaultAccessPolicy));
390 return true; 390 return true;
391 } 391 }
392 392
393 void WindowTree::DispatchInputEvent(ServerWindow* target, 393 void WindowTree::DispatchInputEvent(ServerWindow* target,
394 const ui::Event& event) { 394 const ui::Event& event) {
395 if (event_ack_id_) { 395 if (event_ack_id_) {
396 // This is currently waiting for an event ack. Add it to the queue. 396 // This is currently waiting for an event ack. Add it to the queue.
397 event_queue_.push(base::WrapUnique(new TargetedEvent(target, event))); 397 event_queue_.push(base::MakeUnique<TargetedEvent>(target, event));
398 // TODO(sad): If the |event_queue_| grows too large, then this should notify 398 // TODO(sad): If the |event_queue_| grows too large, then this should notify
399 // Display, so that it can stop sending events. 399 // Display, so that it can stop sending events.
400 return; 400 return;
401 } 401 }
402 402
403 // If there are events in the queue, then store this new event in the queue, 403 // If there are events in the queue, then store this new event in the queue,
404 // and dispatch the latest event from the queue instead that still has a live 404 // and dispatch the latest event from the queue instead that still has a live
405 // target. 405 // target.
406 if (!event_queue_.empty()) { 406 if (!event_queue_.empty()) {
407 event_queue_.push(base::WrapUnique(new TargetedEvent(target, event))); 407 event_queue_.push(base::MakeUnique<TargetedEvent>(target, event));
408 return; 408 return;
409 } 409 }
410 410
411 DispatchInputEventImpl(target, event); 411 DispatchInputEventImpl(target, event);
412 } 412 }
413 413
414 bool WindowTree::IsWaitingForNewTopLevelWindow(uint32_t wm_change_id) { 414 bool WindowTree::IsWaitingForNewTopLevelWindow(uint32_t wm_change_id) {
415 return waiting_for_top_level_window_info_ && 415 return waiting_for_top_level_window_info_ &&
416 waiting_for_top_level_window_info_->wm_change_id == wm_change_id; 416 waiting_for_top_level_window_info_->wm_change_id == wm_change_id;
417 } 417 }
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 } 1681 }
1682 1682
1683 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1683 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1684 const ServerWindow* window) const { 1684 const ServerWindow* window) const {
1685 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1685 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1686 return tree && tree != this; 1686 return tree && tree != this;
1687 } 1687 }
1688 1688
1689 } // namespace ws 1689 } // namespace ws
1690 } // namespace ui 1690 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/modal_window_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698