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

Side by Side Diff: ui/ozone/platform/wayland/fake_server.cc

Issue 2259753003: 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/ozone/platform/wayland/fake_server.h" 5 #include "ui/ozone/platform/wayland/fake_server.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 #include <wayland-server.h> 8 #include <wayland-server.h>
9 #include <xdg-shell-unstable-v5-server-protocol.h> 9 #include <xdg-shell-unstable-v5-server-protocol.h>
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 void CreateSurface(wl_client* client, wl_resource* resource, uint32_t id) { 30 void CreateSurface(wl_client* client, wl_resource* resource, uint32_t id) {
31 auto compositor = 31 auto compositor =
32 static_cast<MockCompositor*>(wl_resource_get_user_data(resource)); 32 static_cast<MockCompositor*>(wl_resource_get_user_data(resource));
33 wl_resource* surface_resource = wl_resource_create( 33 wl_resource* surface_resource = wl_resource_create(
34 client, &wl_surface_interface, wl_resource_get_version(resource), id); 34 client, &wl_surface_interface, wl_resource_get_version(resource), id);
35 if (!surface_resource) { 35 if (!surface_resource) {
36 wl_client_post_no_memory(client); 36 wl_client_post_no_memory(client);
37 return; 37 return;
38 } 38 }
39 compositor->AddSurface(base::WrapUnique(new MockSurface(surface_resource))); 39 compositor->AddSurface(base::MakeUnique<MockSurface>(surface_resource));
40 } 40 }
41 41
42 const struct wl_compositor_interface compositor_impl = { 42 const struct wl_compositor_interface compositor_impl = {
43 &CreateSurface, // create_surface 43 &CreateSurface, // create_surface
44 nullptr, // create_region 44 nullptr, // create_region
45 }; 45 };
46 46
47 // wl_surface 47 // wl_surface
48 48
49 void Attach(wl_client* client, 49 void Attach(wl_client* client,
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 386
387 void FakeServer::OnFileCanReadWithoutBlocking(int fd) { 387 void FakeServer::OnFileCanReadWithoutBlocking(int fd) {
388 wl_event_loop_dispatch(event_loop_, 0); 388 wl_event_loop_dispatch(event_loop_, 0);
389 wl_display_flush_clients(display_.get()); 389 wl_display_flush_clients(display_.get());
390 } 390 }
391 391
392 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {} 392 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {}
393 393
394 } // namespace wl 394 } // namespace wl
OLDNEW
« no previous file with comments | « ui/ozone/platform/headless/ozone_platform_headless.cc ('k') | ui/ozone/platform/wayland/ozone_platform_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698