Bug 932421. Stop including windows.h (via Hal.h) in Screen.h, so we don't screw up our bindings code. r=smaug

Also stops Hal.h bootlegging Observer.h.
This commit is contained in:
Boris Zbarsky 2013-10-31 22:07:10 -04:00
parent e621b0acbc
commit ad9d365422
6 changed files with 38 additions and 15 deletions

View File

@ -36,16 +36,6 @@
#include "nsIScriptTimeoutHandler.h"
#include "nsIController.h"
#ifdef XP_WIN
// Thanks so much, Microsoft! :(
#ifdef GetClassName
#undef GetClassName
#endif // GetClassName
#ifdef CreateEvent
#undef CreateEvent
#endif
#endif // XP_WIN
// Helper Classes
#include "nsJSUtils.h"
#include "jsapi.h" // for JSAutoRequest
@ -75,6 +65,18 @@
#include "nsIWidgetListener.h"
#include "nsIBaseWindow.h"
#include "nsDeviceSensors.h"
#ifdef XP_WIN
// Thanks so much, Microsoft and the people who pull in windows.h via
// random silly headers! :(
#ifdef GetClassName
#undef GetClassName
#endif // GetClassName
#ifdef CreateEvent
#undef CreateEvent
#endif
#endif // XP_WIN
#include "nsIContent.h"
#include "nsIDocShell.h"
#include "nsIDocCharset.h"

View File

@ -8,7 +8,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Hal.h"
#include "mozilla/HalScreenConfiguration.h"
#include "nsIDOMScreen.h"
#include "nsCOMPtr.h"
#include "nsDOMEventTargetHelper.h"

View File

@ -7,6 +7,8 @@
#include "mozilla/dom/PContentPermissionRequestChild.h"
// Microsoft's API Name hackery sucks
// XXXbz Doing this in a header is a gigantic footgun. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=932421#c3 for why.
#undef CreateEvent
/*

View File

@ -10,6 +10,7 @@
#include "mozilla/hal_sandbox/PHal.h"
#include "mozilla/HalTypes.h"
#include "base/basictypes.h"
#include "mozilla/Observer.h"
#include "mozilla/Types.h"
#include "nsTArray.h"
#include "prlog.h"
@ -18,6 +19,7 @@
#include "mozilla/dom/power/Types.h"
#include "mozilla/hal_sandbox/PHal.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/HalScreenConfiguration.h"
/*
* Hal.h contains the public Hal API.
@ -38,13 +40,9 @@ class nsIDOMWindow;
namespace mozilla {
template <class T>
class Observer;
namespace hal {
typedef Observer<void_t> AlarmObserver;
typedef Observer<ScreenConfiguration> ScreenConfigurationObserver;
class WindowIdentifier;

View File

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_HalScreenConfiguration_h
#define mozilla_HalScreenConfiguration_h
#include "mozilla/Observer.h"
namespace mozilla {
namespace hal {
struct ScreenConfiguration;
typedef Observer<ScreenConfiguration> ScreenConfigurationObserver;
} // namespace hal
} // namespace mozilla
#endif // mozilla_HalScreenConfiguration_h

View File

@ -14,6 +14,7 @@ EXPORTS.mozilla += [
'Hal.h',
'HalImpl.h',
'HalSandbox.h',
'HalScreenConfiguration.h',
'HalSensor.h',
'HalTypes.h',
'HalWakeLock.h',