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

Side by Side Diff: gpu/ipc/service/gpu_watchdog_thread.cc

Issue 2914103002: Remove usages of XInternAtom (Closed)
Patch Set: Created 3 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/ipc/service/gpu_watchdog_thread.h" 5 #include "gpu/ipc/service/gpu_watchdog_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 13 matching lines...) Expand all
24 #include "base/threading/platform_thread.h" 24 #include "base/threading/platform_thread.h"
25 #include "build/build_config.h" 25 #include "build/build_config.h"
26 26
27 #if defined(OS_WIN) 27 #if defined(OS_WIN)
28 #include <windows.h> 28 #include <windows.h>
29 #endif 29 #endif
30 30
31 #if defined(USE_X11) 31 #if defined(USE_X11)
32 #include <X11/Xatom.h> 32 #include <X11/Xatom.h>
33 #include <X11/Xlib.h> 33 #include <X11/Xlib.h>
34
35 #include "ui/base/x/x11_util.h" // nogncheck
34 #endif 36 #endif
35 37
36 namespace gpu { 38 namespace gpu {
37 namespace { 39 namespace {
38 40
39 #if defined(CYGPROFILE_INSTRUMENTATION) 41 #if defined(CYGPROFILE_INSTRUMENTATION)
40 const int kGpuTimeout = 30000; 42 const int kGpuTimeout = 30000;
41 #elif defined(OS_WIN) 43 #elif defined(OS_WIN)
42 // Use a slightly longer timeout on Windows due to prevalence of slow and 44 // Use a slightly longer timeout on Windows due to prevalence of slow and
43 // infected machines. 45 // infected machines.
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 *((volatile int*)0) = 0x1337; 423 *((volatile int*)0) = 0x1337;
422 424
423 terminated = true; 425 terminated = true;
424 } 426 }
425 427
426 #if defined(USE_X11) 428 #if defined(USE_X11)
427 void GpuWatchdogThread::SetupXServer() { 429 void GpuWatchdogThread::SetupXServer() {
428 display_ = XOpenDisplay(NULL); 430 display_ = XOpenDisplay(NULL);
429 window_ = XCreateWindow(display_, DefaultRootWindow(display_), 0, 0, 1, 1, 0, 431 window_ = XCreateWindow(display_, DefaultRootWindow(display_), 0, 0, 1, 1, 0,
430 CopyFromParent, InputOutput, CopyFromParent, 0, NULL); 432 CopyFromParent, InputOutput, CopyFromParent, 0, NULL);
431 atom_ = XInternAtom(display_, "CHECK", False); 433 atom_ = ui::GetAtom("CHECK");
sadrul 2017/06/01 20:45:30 I think we need to keep this. Different displays.
Tom Anderson 2017/06/01 21:20:42 Done. (but for the record, I think atom IDs are t
432 host_tty_ = GetActiveTTY(); 434 host_tty_ = GetActiveTTY();
433 } 435 }
434 436
435 void GpuWatchdogThread::SetupXChangeProp() { 437 void GpuWatchdogThread::SetupXChangeProp() {
436 XChangeProperty(display_, window_, atom_, XA_STRING, 8, PropModeReplace, text, 438 XChangeProperty(display_, window_, atom_, XA_STRING, 8, PropModeReplace, text,
437 (arraysize(text) - 1)); 439 (arraysize(text) - 1));
438 } 440 }
439 441
440 bool GpuWatchdogThread::MatchXEventAtom(XEvent* event) { 442 bool GpuWatchdogThread::MatchXEventAtom(XEvent* event) {
441 if (event->xproperty.window == window_ && event->type == PropertyNotify && 443 if (event->xproperty.window == window_ && event->type == PropertyNotify &&
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 int tty_number; 526 int tty_number;
525 size_t num_res = sscanf(tty_string, "tty%d\n", &tty_number); 527 size_t num_res = sscanf(tty_string, "tty%d\n", &tty_number);
526 if (num_res == 1) 528 if (num_res == 1)
527 return tty_number; 529 return tty_number;
528 } 530 }
529 return -1; 531 return -1;
530 } 532 }
531 #endif 533 #endif
532 534
533 } // namespace gpu 535 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698