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

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

Issue 2423833002: Set ozone_platform_wayland to true for ozone/ChromeOS builds (Closed)
Patch Set: opt-out for wayland_unittests as per kylechar's advice. Created 4 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
« ui/ozone/ozone.gni ('K') | « ui/ozone/platform/wayland/BUILD.gn ('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 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return false; 360 return false;
361 if (!xdg_shell_.Initialize(display_.get())) 361 if (!xdg_shell_.Initialize(display_.get()))
362 return false; 362 return false;
363 363
364 client_ = wl_client_create(display_.get(), server_fd.get()); 364 client_ = wl_client_create(display_.get(), server_fd.get());
365 if (!client_) 365 if (!client_)
366 return false; 366 return false;
367 (void)server_fd.release(); 367 (void)server_fd.release();
368 368
369 base::Thread::Options options; 369 base::Thread::Options options;
370 options.message_loop_type = MessageLoop::TYPE_IO; 370 options.message_loop_type = base::MessageLoop::TYPE_IO;
371 if (!base::Thread::StartWithOptions(options)) 371 if (!base::Thread::StartWithOptions(options))
372 return false; 372 return false;
373 task_runner()->PostTask(FROM_HERE, 373 task_runner()->PostTask(FROM_HERE,
374 base::Bind(&FakeServer::StartWatchingFileDescriptor, 374 base::Bind(&FakeServer::StartWatchingFileDescriptor,
375 base::Unretained(this))); 375 base::Unretained(this)));
376 376
377 setenv("WAYLAND_SOCKET", base::UintToString(client_fd.release()).c_str(), 1); 377 setenv("WAYLAND_SOCKET", base::UintToString(client_fd.release()).c_str(), 1);
378 378
379 return true; 379 return true;
380 } 380 }
(...skipping 23 matching lines...) Expand all
404 base::Unretained(this))); 404 base::Unretained(this)));
405 } 405 }
406 406
407 void FakeServer::OnFileCanReadWithoutBlocking() { 407 void FakeServer::OnFileCanReadWithoutBlocking() {
408 wl_event_loop_dispatch(event_loop_, 0); 408 wl_event_loop_dispatch(event_loop_, 0);
409 wl_display_flush_clients(display_.get()); 409 wl_display_flush_clients(display_.get());
410 } 410 }
411 411
412 412
413 } // namespace wl 413 } // namespace wl
OLDNEW
« ui/ozone/ozone.gni ('K') | « ui/ozone/platform/wayland/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698