Remove evil defines out of shared_x_display.h

This is a trivial but dangerous change to remove X11/Xlib.h out of
shared_x_display.h. Since we do not have a strict and automatically
Include-What-You-Use rule, I cannot quite tell whether any Chromium source files
wrongly assume X11/Xlib.h will be included through shared_x_display.h. We can
fix the breaks in Chromium after this change has been failed to integrate to
Chromium.

BUG=webrtc:6513

Review-Url: https://codereview.webrtc.org/2482963003
Cr-Commit-Position: refs/heads/master@{#14987}
This commit is contained in:
zijiehe
2016-11-08 12:47:14 -08:00
committed by Commit bot
parent d1d26fbeb3
commit e083909f85
3 changed files with 11 additions and 5 deletions

View File

@ -12,6 +12,7 @@
#include <sys/stat.h>
#include <semaphore.h>
#include <string.h>
#include <X11/Xlib.h>
#include <memory>

View File

@ -10,19 +10,22 @@
#include "webrtc/modules/desktop_capture/x11/shared_x_display.h"
#include <X11/Xlib.h>
#include <algorithm>
#include "webrtc/base/checks.h"
#include "webrtc/system_wrappers/include/logging.h"
namespace webrtc {
SharedXDisplay::SharedXDisplay(Display* display)
: display_(display) {
assert(display_);
RTC_DCHECK(display_);
}
SharedXDisplay::~SharedXDisplay() {
assert(event_handlers_.empty());
RTC_DCHECK(event_handlers_.empty());
XCloseDisplay(display_);
}

View File

@ -14,15 +14,17 @@
#include <map>
#include <vector>
#include <assert.h>
#include <X11/Xlib.h>
#include <string>
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/system_wrappers/include/atomic32.h"
// Including Xlib.h will involve evil defines (Bool, Status, True, False), which
// easily conflict with other headers.
typedef struct _XDisplay Display;
typedef union _XEvent XEvent;
namespace webrtc {
// A ref-counted object to store XDisplay connection.