Bug 1835185 - Replace OS_WIN with XP_WIN in ipc code. r=ipc-reviewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D180044
This commit is contained in:
Mike Hommey 2023-06-06 21:05:31 +00:00
parent eb02cb32ad
commit 30c664bf9c
41 changed files with 122 additions and 122 deletions

View file

@ -40,7 +40,7 @@ const int64_t kint64max = ((int64_t)GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
# define PRId64L "I64d" # define PRId64L "I64d"
# define PRIu64L "I64u" # define PRIu64L "I64u"
# define PRIx64L "I64x" # define PRIx64L "I64x"
#elif defined(OS_WIN) #elif defined(XP_WIN)
# define PRId64L L"I64d" # define PRId64L L"I64d"
# define PRIu64L L"I64u" # define PRIu64L L"I64u"
# define PRIx64L L"I64x" # define PRIx64L L"I64x"

View file

@ -6,7 +6,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
# include <shellapi.h> # include <shellapi.h>
# include "mozilla/DynamicallyLinkedFunctionPtr.h" # include "mozilla/DynamicallyLinkedFunctionPtr.h"
@ -23,7 +23,7 @@ CommandLine* CommandLine::current_process_commandline_ = NULL;
// Since we use a lazy match, make sure that longer versions (like L"--") // Since we use a lazy match, make sure that longer versions (like L"--")
// are listed before shorter versions (like L"-") of similar prefixes. // are listed before shorter versions (like L"-") of similar prefixes.
#if defined(OS_WIN) #if defined(XP_WIN)
const wchar_t* const kSwitchPrefixes[] = {L"--", L"-", L"/"}; const wchar_t* const kSwitchPrefixes[] = {L"--", L"-", L"/"};
const wchar_t kSwitchTerminator[] = L"--"; const wchar_t kSwitchTerminator[] = L"--";
const wchar_t kSwitchValueSeparator[] = L"="; const wchar_t kSwitchValueSeparator[] = L"=";
@ -34,7 +34,7 @@ const char kSwitchTerminator[] = "--";
const char kSwitchValueSeparator[] = "="; const char kSwitchValueSeparator[] = "=";
#endif #endif
#if defined(OS_WIN) #if defined(XP_WIN)
// Lowercase a string. This is used to lowercase switch names. // Lowercase a string. This is used to lowercase switch names.
// Is this what we really want? It seems crazy to me. I've left it in // Is this what we really want? It seems crazy to me. I've left it in
// for backwards compatibility on Windows. // for backwards compatibility on Windows.
@ -43,7 +43,7 @@ static void Lowercase(std::wstring* parameter) {
} }
#endif #endif
#if defined(OS_WIN) #if defined(XP_WIN)
void CommandLine::ParseFromString(const std::wstring& command_line) { void CommandLine::ParseFromString(const std::wstring& command_line) {
TrimWhitespace(command_line, TRIM_ALL, &command_line_string_); TrimWhitespace(command_line, TRIM_ALL, &command_line_string_);
@ -159,7 +159,7 @@ bool CommandLine::IsSwitch(const StringType& parameter_string,
parameter_string.substr(switch_start, equals_position - switch_start); parameter_string.substr(switch_start, equals_position - switch_start);
*switch_value = parameter_string.substr(equals_position + 1); *switch_value = parameter_string.substr(equals_position + 1);
} }
#if defined(OS_WIN) #if defined(XP_WIN)
Lowercase(&switch_native); Lowercase(&switch_native);
*switch_string = WideToASCII(switch_native); *switch_string = WideToASCII(switch_native);
#else #else
@ -175,7 +175,7 @@ bool CommandLine::IsSwitch(const StringType& parameter_string,
// static // static
void CommandLine::Init(int argc, const char* const* argv) { void CommandLine::Init(int argc, const char* const* argv) {
DCHECK(current_process_commandline_ == NULL); DCHECK(current_process_commandline_ == NULL);
#if defined(OS_WIN) #if defined(XP_WIN)
current_process_commandline_ = new CommandLine; current_process_commandline_ = new CommandLine;
current_process_commandline_->ParseFromString(::GetCommandLineW()); current_process_commandline_->ParseFromString(::GetCommandLineW());
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
@ -191,7 +191,7 @@ void CommandLine::Terminate() {
bool CommandLine::HasSwitch(const std::wstring& switch_string) const { bool CommandLine::HasSwitch(const std::wstring& switch_string) const {
std::wstring lowercased_switch(switch_string); std::wstring lowercased_switch(switch_string);
#if defined(OS_WIN) #if defined(XP_WIN)
Lowercase(&lowercased_switch); Lowercase(&lowercased_switch);
#endif #endif
return switches_.find(WideToASCII(lowercased_switch)) != switches_.end(); return switches_.find(WideToASCII(lowercased_switch)) != switches_.end();
@ -200,7 +200,7 @@ bool CommandLine::HasSwitch(const std::wstring& switch_string) const {
std::wstring CommandLine::GetSwitchValue( std::wstring CommandLine::GetSwitchValue(
const std::wstring& switch_string) const { const std::wstring& switch_string) const {
std::wstring lowercased_switch(switch_string); std::wstring lowercased_switch(switch_string);
#if defined(OS_WIN) #if defined(XP_WIN)
Lowercase(&lowercased_switch); Lowercase(&lowercased_switch);
#endif #endif
@ -210,7 +210,7 @@ std::wstring CommandLine::GetSwitchValue(
if (result == switches_.end()) { if (result == switches_.end()) {
return L""; return L"";
} else { } else {
#if defined(OS_WIN) #if defined(XP_WIN)
return result->second; return result->second;
#else #else
return ASCIIToWide(result->second); return ASCIIToWide(result->second);
@ -218,7 +218,7 @@ std::wstring CommandLine::GetSwitchValue(
} }
} }
#if defined(OS_WIN) #if defined(XP_WIN)
std::vector<std::wstring> CommandLine::GetLooseValues() const { std::vector<std::wstring> CommandLine::GetLooseValues() const {
return loose_values_; return loose_values_;
} }
@ -254,7 +254,7 @@ std::wstring CommandLine::PrefixedSwitchStringWithValue(
value_string.c_str()); value_string.c_str());
} }
#if defined(OS_WIN) #if defined(XP_WIN)
void CommandLine::AppendSwitch(const std::wstring& switch_string) { void CommandLine::AppendSwitch(const std::wstring& switch_string) {
std::wstring prefixed_switch_string = PrefixedSwitchString(switch_string); std::wstring prefixed_switch_string = PrefixedSwitchString(switch_string);
command_line_string_.append(L" "); command_line_string_.append(L" ");

View file

@ -32,7 +32,7 @@ class InProcessBrowserTest;
class CommandLine { class CommandLine {
public: public:
#if defined(OS_WIN) #if defined(XP_WIN)
// Creates a parsed version of the given command-line string. // Creates a parsed version of the given command-line string.
// The program name is assumed to be the first item in the string. // The program name is assumed to be the first item in the string.
void ParseFromString(const std::wstring& command_line); void ParseFromString(const std::wstring& command_line);
@ -82,7 +82,7 @@ class CommandLine {
// WARNING: this is incorrect on POSIX; we must do string conversions. // WARNING: this is incorrect on POSIX; we must do string conversions.
std::vector<std::wstring> GetLooseValues() const; std::vector<std::wstring> GetLooseValues() const;
#if defined(OS_WIN) #if defined(XP_WIN)
// Returns the original command line string. // Returns the original command line string.
const std::wstring& command_line_string() const { const std::wstring& command_line_string() const {
return command_line_string_; return command_line_string_;
@ -116,7 +116,7 @@ class CommandLine {
// Append a loose value to the command line. // Append a loose value to the command line.
void AppendLooseValue(const std::wstring& value); void AppendLooseValue(const std::wstring& value);
#if defined(OS_WIN) #if defined(XP_WIN)
void AppendLooseValue(const wchar_t* value) { void AppendLooseValue(const wchar_t* value) {
AppendLooseValue(std::wstring(value)); AppendLooseValue(std::wstring(value));
} }
@ -148,7 +148,7 @@ class CommandLine {
// We store a platform-native version of the command line, used when building // We store a platform-native version of the command line, used when building
// up a new command line to be executed. This ifdef delimits that code. // up a new command line to be executed. This ifdef delimits that code.
#if defined(OS_WIN) #if defined(XP_WIN)
// The quoted, space-separated command-line string. // The quoted, space-separated command-line string.
std::wstring command_line_string_; std::wstring command_line_string_;

View file

@ -75,7 +75,7 @@
# include <pthread.h> # include <pthread.h>
#endif #endif
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#endif #endif
@ -103,7 +103,7 @@ class ConditionVariable {
void Signal(); void Signal();
private: private:
#if defined(OS_WIN) #if defined(XP_WIN)
CONDITION_VARIABLE cv_; CONDITION_VARIABLE cv_;
SRWLOCK* const srwlock_; SRWLOCK* const srwlock_;
#elif defined(XP_UNIX) #elif defined(XP_UNIX)

View file

@ -244,7 +244,7 @@ FilePath FilePath::Append(const FilePath& component) const {
FilePath FilePath::AppendASCII(const std::string& component) const { FilePath FilePath::AppendASCII(const std::string& component) const {
DCHECK(IsStringASCII(component)); DCHECK(IsStringASCII(component));
#if defined(OS_WIN) #if defined(XP_WIN)
return Append(ASCIIToWide(component)); return Append(ASCIIToWide(component));
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
return Append(component); return Append(component);
@ -266,7 +266,7 @@ FilePath FilePath::FromWStringHack(const std::wstring& wstring) {
std::wstring FilePath::ToWStringHack() const { std::wstring FilePath::ToWStringHack() const {
return base::SysNativeMBToWide(path_); return base::SysNativeMBToWide(path_);
} }
#elif defined(OS_WIN) #elif defined(XP_WIN)
// static // static
FilePath FilePath::FromWStringHack(const std::wstring& wstring) { FilePath FilePath::FromWStringHack(const std::wstring& wstring) {
return FilePath(wstring); return FilePath(wstring);

View file

@ -76,10 +76,10 @@
// enabled and disabled independently, to aid testing. These #defines are // enabled and disabled independently, to aid testing. These #defines are
// here so that the same setting can be used in both the implementation and // here so that the same setting can be used in both the implementation and
// in the unit test. // in the unit test.
#if defined(OS_WIN) #if defined(XP_WIN)
# define FILE_PATH_USES_DRIVE_LETTERS # define FILE_PATH_USES_DRIVE_LETTERS
# define FILE_PATH_USES_WIN_SEPARATORS # define FILE_PATH_USES_WIN_SEPARATORS
#endif // OS_WIN #endif // XP_WIN
// An abstraction to isolate users from the differences between native // An abstraction to isolate users from the differences between native
// pathnames on different platforms. // pathnames on different platforms.
@ -90,11 +90,11 @@ class FilePath {
// may or may not be specified. On Mac OS X, native pathnames are encoded // may or may not be specified. On Mac OS X, native pathnames are encoded
// in UTF-8. // in UTF-8.
typedef std::string StringType; typedef std::string StringType;
#elif defined(OS_WIN) #elif defined(XP_WIN)
// On Windows, for Unicode-aware applications, native pathnames are wchar_t // On Windows, for Unicode-aware applications, native pathnames are wchar_t
// arrays encoded in UTF-16. // arrays encoded in UTF-16.
typedef std::wstring StringType; typedef std::wstring StringType;
#endif // OS_WIN #endif // XP_WIN
typedef StringType::value_type CharType; typedef StringType::value_type CharType;
@ -117,7 +117,7 @@ class FilePath {
FilePath(const FilePath& that) : path_(that.path_) {} FilePath(const FilePath& that) : path_(that.path_) {}
explicit FilePath(const StringType& path) : path_(path) {} explicit FilePath(const StringType& path) : path_(path) {}
#if defined(OS_WIN) #if defined(XP_WIN)
explicit FilePath(const wchar_t* path) : path_(path) {} explicit FilePath(const wchar_t* path) : path_(path) {}
#endif #endif
@ -241,8 +241,8 @@ class FilePath {
// Macros for string literal initialization of FilePath::CharType[]. // Macros for string literal initialization of FilePath::CharType[].
#if defined(XP_UNIX) #if defined(XP_UNIX)
# define FILE_PATH_LITERAL(x) x # define FILE_PATH_LITERAL(x) x
#elif defined(OS_WIN) #elif defined(XP_WIN)
# define FILE_PATH_LITERAL(x) L##x # define FILE_PATH_LITERAL(x) L##x
#endif // OS_WIN #endif // XP_WIN
#endif // BASE_FILE_PATH_H_ #endif // BASE_FILE_PATH_H_

View file

@ -37,7 +37,7 @@ class Lock {
// POSIX mitigates priority inversion by setting the priority of a thread // POSIX mitigates priority inversion by setting the priority of a thread
// holding a Lock to the maximum priority of any other thread waiting on it. // holding a Lock to the maximum priority of any other thread waiting on it.
return base::internal::LockImpl::PriorityInheritanceAvailable(); return base::internal::LockImpl::PriorityInheritanceAvailable();
#elif defined(OS_WIN) #elif defined(XP_WIN)
// Windows mitigates priority inversion by randomly boosting the priority of // Windows mitigates priority inversion by randomly boosting the priority of
// ready threads. // ready threads.
// https://msdn.microsoft.com/library/windows/desktop/ms684831.aspx // https://msdn.microsoft.com/library/windows/desktop/ms684831.aspx
@ -47,7 +47,7 @@ class Lock {
#endif #endif
} }
#if defined(XP_UNIX) || defined(OS_WIN) #if defined(XP_UNIX) || defined(XP_WIN)
// Both Windows and POSIX implementations of ConditionVariable need to be // Both Windows and POSIX implementations of ConditionVariable need to be
// able to see our lock and tweak our debugging counters, as they release and // able to see our lock and tweak our debugging counters, as they release and
// acquire locks inside of their condition variable APIs. // acquire locks inside of their condition variable APIs.

View file

@ -10,7 +10,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
# include <pthread.h> # include <pthread.h>
@ -24,7 +24,7 @@ namespace internal {
// should instead use Lock. // should instead use Lock.
class LockImpl { class LockImpl {
public: public:
#if defined(OS_WIN) #if defined(XP_WIN)
using NativeHandle = SRWLOCK; using NativeHandle = SRWLOCK;
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
using NativeHandle = pthread_mutex_t; using NativeHandle = pthread_mutex_t;

View file

@ -52,7 +52,7 @@ static base::ThreadLocalPointer<MessageLoop>& get_tls_ptr() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#if defined(OS_WIN) #if defined(XP_WIN)
// Upon a SEH exception in this thread, it restores the original unhandled // Upon a SEH exception in this thread, it restores the original unhandled
// exception filter. // exception filter.
@ -70,7 +70,7 @@ static LPTOP_LEVEL_EXCEPTION_FILTER GetTopSEHFilter() {
return top_filter; return top_filter;
} }
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -220,9 +220,9 @@ MessageLoop::MessageLoop(Type type, nsISerialEventTarget* aEventTarget)
state_(NULL), state_(NULL),
run_depth_base_(1), run_depth_base_(1),
shutting_down_(false), shutting_down_(false),
#ifdef OS_WIN #ifdef XP_WIN
os_modal_loop_(false), os_modal_loop_(false),
#endif // OS_WIN #endif // XP_WIN
transient_hang_timeout_(0), transient_hang_timeout_(0),
permanent_hang_timeout_(0), permanent_hang_timeout_(0),
next_sequence_num_(0) { next_sequence_num_(0) {
@ -250,7 +250,7 @@ MessageLoop::MessageLoop(Type type, nsISerialEventTarget* aEventTarget)
case TYPE_MOZILLA_NONMAINTHREAD: case TYPE_MOZILLA_NONMAINTHREAD:
pump_ = new mozilla::ipc::MessagePumpForNonMainThreads(aEventTarget); pump_ = new mozilla::ipc::MessagePumpForNonMainThreads(aEventTarget);
return; return;
#if defined(OS_WIN) || defined(OS_MACOSX) #if defined(XP_WIN) || defined(OS_MACOSX)
case TYPE_MOZILLA_NONMAINUITHREAD: case TYPE_MOZILLA_NONMAINUITHREAD:
pump_ = new mozilla::ipc::MessagePumpForNonMainUIThreads(aEventTarget); pump_ = new mozilla::ipc::MessagePumpForNonMainUIThreads(aEventTarget);
return; return;
@ -265,7 +265,7 @@ MessageLoop::MessageLoop(Type type, nsISerialEventTarget* aEventTarget)
break; break;
} }
#if defined(OS_WIN) #if defined(XP_WIN)
// TODO(rvargas): Get rid of the OS guards. // TODO(rvargas): Get rid of the OS guards.
if (type_ == TYPE_DEFAULT) { if (type_ == TYPE_DEFAULT) {
pump_ = new base::MessagePumpDefault(); pump_ = new base::MessagePumpDefault();
@ -349,7 +349,7 @@ void MessageLoop::Run() {
// enable_SEH_restoration_ = true : any unhandled exception goes to the filter // enable_SEH_restoration_ = true : any unhandled exception goes to the filter
// that was existed before the loop was run. // that was existed before the loop was run.
void MessageLoop::RunHandler() { void MessageLoop::RunHandler() {
#if defined(OS_WIN) #if defined(XP_WIN)
if (exception_restoration_) { if (exception_restoration_) {
LPTOP_LEVEL_EXCEPTION_FILTER current_filter = GetTopSEHFilter(); LPTOP_LEVEL_EXCEPTION_FILTER current_filter = GetTopSEHFilter();
MOZ_SEH_TRY { RunInternal(); } MOZ_SEH_TRY { RunInternal(); }
@ -627,7 +627,7 @@ MessageLoop::AutoRunState::AutoRunState(MessageLoop* loop) : loop_(loop) {
// Initialize the other fields: // Initialize the other fields:
quit_received = false; quit_received = false;
#if defined(OS_WIN) #if defined(XP_WIN)
dispatcher = NULL; dispatcher = NULL;
#endif #endif
} }
@ -664,7 +664,7 @@ nsISerialEventTarget* MessageLoop::SerialEventTarget() { return mEventTarget; }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// MessageLoopForUI // MessageLoopForUI
#if defined(OS_WIN) #if defined(XP_WIN)
void MessageLoopForUI::Run(Dispatcher* dispatcher) { void MessageLoopForUI::Run(Dispatcher* dispatcher) {
AutoRunState save_state(this); AutoRunState save_state(this);
@ -690,12 +690,12 @@ void MessageLoopForUI::PumpOutPendingPaintMessages() {
pump_ui()->PumpOutPendingPaintMessages(); pump_ui()->PumpOutPendingPaintMessages();
} }
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// MessageLoopForIO // MessageLoopForIO
#if defined(OS_WIN) #if defined(XP_WIN)
void MessageLoopForIO::RegisterIOHandler(HANDLE file, IOHandler* handler) { void MessageLoopForIO::RegisterIOHandler(HANDLE file, IOHandler* handler) {
pump_io()->RegisterIOHandler(file, handler); pump_io()->RegisterIOHandler(file, handler);

View file

@ -18,7 +18,7 @@
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#if defined(OS_WIN) #if defined(XP_WIN)
// We need this to declare base::MessagePumpWin::Dispatcher, which we should // We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate. // really just eliminate.
# include "base/message_pump_win.h" # include "base/message_pump_win.h"
@ -247,11 +247,11 @@ class MessageLoop : public base::MessagePump::Delegate {
exception_restoration_ = restore; exception_restoration_ = restore;
} }
#if defined(OS_WIN) #if defined(XP_WIN)
void set_os_modal_loop(bool os_modal_loop) { os_modal_loop_ = os_modal_loop; } void set_os_modal_loop(bool os_modal_loop) { os_modal_loop_ = os_modal_loop; }
bool& os_modal_loop() { return os_modal_loop_; } bool& os_modal_loop() { return os_modal_loop_; }
#endif // OS_WIN #endif // XP_WIN
// Set the timeouts for background hang monitoring. // Set the timeouts for background hang monitoring.
// A value of 0 indicates there is no timeout. // A value of 0 indicates there is no timeout.
@ -273,7 +273,7 @@ class MessageLoop : public base::MessagePump::Delegate {
// once it becomes idle. // once it becomes idle.
bool quit_received; bool quit_received;
#if defined(OS_WIN) #if defined(XP_WIN)
base::MessagePumpWin::Dispatcher* dispatcher; base::MessagePumpWin::Dispatcher* dispatcher;
#endif #endif
}; };
@ -325,7 +325,7 @@ class MessageLoop : public base::MessagePump::Delegate {
typedef std::queue<PendingTask> TaskQueue; typedef std::queue<PendingTask> TaskQueue;
typedef std::priority_queue<PendingTask> DelayedTaskQueue; typedef std::priority_queue<PendingTask> DelayedTaskQueue;
#if defined(OS_WIN) #if defined(XP_WIN)
base::MessagePumpWin* pump_win() { base::MessagePumpWin* pump_win() {
return static_cast<base::MessagePumpWin*>(pump_.get()); return static_cast<base::MessagePumpWin*>(pump_.get());
} }
@ -428,7 +428,7 @@ class MessageLoop : public base::MessagePump::Delegate {
int run_depth_base_; int run_depth_base_;
bool shutting_down_; bool shutting_down_;
#if defined(OS_WIN) #if defined(XP_WIN)
// Should be set to true before calling Windows APIs like TrackPopupMenu, etc // Should be set to true before calling Windows APIs like TrackPopupMenu, etc
// which enter a modal message loop. // which enter a modal message loop.
bool os_modal_loop_; bool os_modal_loop_;
@ -469,7 +469,7 @@ class MessageLoopForUI : public MessageLoop {
return static_cast<MessageLoopForUI*>(loop); return static_cast<MessageLoopForUI*>(loop);
} }
#if defined(OS_WIN) #if defined(XP_WIN)
typedef base::MessagePumpWin::Dispatcher Dispatcher; typedef base::MessagePumpWin::Dispatcher Dispatcher;
typedef base::MessagePumpWin::Observer Observer; typedef base::MessagePumpWin::Observer Observer;
@ -486,7 +486,7 @@ class MessageLoopForUI : public MessageLoop {
base::MessagePumpForUI* pump_ui() { base::MessagePumpForUI* pump_ui() {
return static_cast<base::MessagePumpForUI*>(pump_.get()); return static_cast<base::MessagePumpForUI*>(pump_.get());
} }
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
}; };
// Do not add any member variables to MessageLoopForUI! This is important b/c // Do not add any member variables to MessageLoopForUI! This is important b/c
@ -513,7 +513,7 @@ class MessageLoopForIO : public MessageLoop {
return static_cast<MessageLoopForIO*>(loop); return static_cast<MessageLoopForIO*>(loop);
} }
#if defined(OS_WIN) #if defined(XP_WIN)
typedef base::MessagePumpForIO::IOHandler IOHandler; typedef base::MessagePumpForIO::IOHandler IOHandler;
typedef base::MessagePumpForIO::IOContext IOContext; typedef base::MessagePumpForIO::IOContext IOContext;

View file

@ -8,7 +8,7 @@
#define BASE_PLATFORM_FILE_H_ #define BASE_PLATFORM_FILE_H_
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#endif #endif
@ -16,7 +16,7 @@
namespace base { namespace base {
#if defined(OS_WIN) #if defined(XP_WIN)
typedef HANDLE PlatformFile; typedef HANDLE PlatformFile;
const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE; const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE;
#elif defined(XP_UNIX) #elif defined(XP_UNIX)

View file

@ -17,7 +17,7 @@
// standard intends to allow pthread_t to be a structure. This means you // standard intends to allow pthread_t to be a structure. This means you
// should not initialize it to a value, like 0. If it's a member variable, the // should not initialize it to a value, like 0. If it's a member variable, the
// constructor can safely "value initialize" using () in the initializer list. // constructor can safely "value initialize" using () in the initializer list.
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
typedef DWORD PlatformThreadId; typedef DWORD PlatformThreadId;
typedef void* PlatformThreadHandle; // HANDLE typedef void* PlatformThreadHandle; // HANDLE

View file

@ -56,7 +56,7 @@ namespace base {
} // namespace base } // namespace base
// Define an OS-neutral wrapper for shared library entry points // Define an OS-neutral wrapper for shared library entry points
#if defined(OS_WIN) #if defined(XP_WIN)
# define API_CALL __stdcall # define API_CALL __stdcall
#elif defined(OS_LINUX) || defined(OS_MACOSX) #elif defined(OS_LINUX) || defined(OS_MACOSX)
# define API_CALL # define API_CALL

View file

@ -10,7 +10,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include <sys/types.h> #include <sys/types.h>
#ifdef OS_WIN #ifdef XP_WIN
# include <windows.h> # include <windows.h>
#endif #endif
@ -19,7 +19,7 @@ namespace base {
// ProcessHandle is a platform specific type which represents the underlying OS // ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process. // handle to a process.
// ProcessId is a number which identifies the process in the OS. // ProcessId is a number which identifies the process in the OS.
#if defined(OS_WIN) #if defined(XP_WIN)
typedef HANDLE ProcessHandle; typedef HANDLE ProcessHandle;
typedef DWORD ProcessId; typedef DWORD ProcessId;
// inttypes.h-like macro for ProcessId formatting. // inttypes.h-like macro for ProcessId formatting.

View file

@ -12,7 +12,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "mozilla/ipc/EnvironmentMap.h" # include "mozilla/ipc/EnvironmentMap.h"
# include <windows.h> # include <windows.h>
# include <tlhelp32.h> # include <tlhelp32.h>
@ -128,7 +128,7 @@ struct LaunchOptions {
// immediately. // immediately.
bool wait = false; bool wait = false;
#if defined(OS_WIN) #if defined(XP_WIN)
bool start_hidden = false; bool start_hidden = false;
// Start as an independent process rather than a process that is closed by the // Start as an independent process rather than a process that is closed by the
@ -188,7 +188,7 @@ struct LaunchOptions {
#endif // OS_MACOSX #endif // OS_MACOSX
}; };
#if defined(OS_WIN) #if defined(XP_WIN)
// Runs the given application name with the given command line. Normally, the // Runs the given application name with the given command line. Normally, the
// first command line argument should be the path to the process, and don't // first command line argument should be the path to the process, and don't
// forget to quote it. // forget to quote it.
@ -314,7 +314,7 @@ class EnvironmentLog {
private: private:
explicit EnvironmentLog(const char* varname, size_t len); explicit EnvironmentLog(const char* varname, size_t len);
#if defined(OS_WIN) #if defined(XP_WIN)
std::wstring fname_; std::wstring fname_;
#else #else
std::string fname_; std::string fname_;
@ -330,7 +330,7 @@ typedef std::tuple<mozilla::ipc::FileDescriptor, int> FdMapping;
} // namespace mozilla } // namespace mozilla
#if defined(OS_WIN) #if defined(XP_WIN)
// Undo the windows.h damage // Undo the windows.h damage
# undef GetMessage # undef GetMessage
# undef CreateEvent # undef CreateEvent

View file

@ -7,7 +7,7 @@
#ifndef BASE_SCOPED_BSTR_WIN_H_ #ifndef BASE_SCOPED_BSTR_WIN_H_
#define BASE_SCOPED_BSTR_WIN_H_ #define BASE_SCOPED_BSTR_WIN_H_
#include "base/basictypes.h" // needed to pick up OS_WIN #include "base/basictypes.h" // needed to pick up XP_WIN
#include "base/logging.h" #include "base/logging.h"

View file

@ -11,7 +11,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "base/scoped_handle_win.h" # include "base/scoped_handle_win.h"
#endif #endif

View file

@ -180,7 +180,7 @@ class SharedMemory {
UniqueMapping memory_; UniqueMapping memory_;
size_t max_size_ = 0; size_t max_size_ = 0;
mozilla::UniqueFileHandle mapped_file_; mozilla::UniqueFileHandle mapped_file_;
#if defined(OS_WIN) #if defined(XP_WIN)
// If true indicates this came from an external source so needs extra checks // If true indicates this came from an external source so needs extra checks
// before being mapped. // before being mapped.
bool external_section_ = false; bool external_section_ = false;

View file

@ -138,7 +138,7 @@ class StringToInt64Traits {
static const int kBase = 10; static const int kBase = 10;
static inline value_type convert_func(const string_type::value_type* str, static inline value_type convert_func(const string_type::value_type* str,
string_type::value_type** endptr) { string_type::value_type** endptr) {
#ifdef OS_WIN #ifdef XP_WIN
return _strtoi64(str, endptr, kBase); return _strtoi64(str, endptr, kBase);
#else // assume XP_UNIX #else // assume XP_UNIX
return strtoll(str, endptr, kBase); return strtoll(str, endptr, kBase);
@ -156,7 +156,7 @@ class String16ToInt64Traits {
static const int kBase = 10; static const int kBase = 10;
static inline value_type convert_func(const string_type::value_type* str, static inline value_type convert_func(const string_type::value_type* str,
string_type::value_type** endptr) { string_type::value_type** endptr) {
#ifdef OS_WIN #ifdef XP_WIN
return _wcstoi64(str, endptr, kBase); return _wcstoi64(str, endptr, kBase);
#else // assume XP_UNIX #else // assume XP_UNIX
std::string ascii_string = UTF16ToASCII(string16(str)); std::string ascii_string = UTF16ToASCII(string16(str));
@ -355,7 +355,7 @@ static void StringAppendVT(StringType* dst,
va_list backup_ap; va_list backup_ap;
base_va_copy(backup_ap, ap); base_va_copy(backup_ap, ap);
#if !defined(OS_WIN) #if !defined(XP_WIN)
errno = 0; errno = 0;
#endif #endif
int result = vsnprintfT(stack_buf, arraysize(stack_buf), format, backup_ap); int result = vsnprintfT(stack_buf, arraysize(stack_buf), format, backup_ap);
@ -371,7 +371,7 @@ static void StringAppendVT(StringType* dst,
int mem_length = arraysize(stack_buf); int mem_length = arraysize(stack_buf);
while (true) { while (true) {
if (result < 0) { if (result < 0) {
#if !defined(OS_WIN) #if !defined(XP_WIN)
// On Windows, vsnprintfT always returns the number of characters in a // On Windows, vsnprintfT always returns the number of characters in a
// fully-formatted string, so if we reach this point, something else is // fully-formatted string, so if we reach this point, something else is
// wrong and no amount of buffer-doubling is going to fix it. // wrong and no amount of buffer-doubling is going to fix it.

View file

@ -102,7 +102,7 @@ bool IsWprintfFormatPortable(const wchar_t* format);
} // namespace base } // namespace base
#if defined(OS_WIN) #if defined(XP_WIN)
# include "base/string_util_win.h" # include "base/string_util_win.h"
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
# include "base/string_util_posix.h" # include "base/string_util_posix.h"

View file

@ -52,7 +52,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
# include <pthread.h> # include <pthread.h>
@ -62,7 +62,7 @@ namespace base {
// Helper functions that abstract the cross-platform APIs. Do not use directly. // Helper functions that abstract the cross-platform APIs. Do not use directly.
struct ThreadLocalPlatform { struct ThreadLocalPlatform {
#if defined(OS_WIN) #if defined(XP_WIN)
typedef DWORD SlotType; typedef DWORD SlotType;
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
typedef pthread_key_t SlotType; typedef pthread_key_t SlotType;

View file

@ -56,7 +56,7 @@ class ThreadLocalStorage {
private: private:
// The internals of this struct should be considered private. // The internals of this struct should be considered private.
bool initialized_; bool initialized_;
#if defined(OS_WIN) #if defined(XP_WIN)
int slot_; int slot_;
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
pthread_key_t key_; pthread_key_t key_;
@ -65,7 +65,7 @@ class ThreadLocalStorage {
DISALLOW_COPY_AND_ASSIGN(Slot); DISALLOW_COPY_AND_ASSIGN(Slot);
}; };
#if defined(OS_WIN) #if defined(XP_WIN)
// Function called when on thread exit to call TLS // Function called when on thread exit to call TLS
// destructor functions. This function is used internally. // destructor functions. This function is used internally.
static void ThreadExit(); static void ThreadExit();
@ -83,7 +83,7 @@ class ThreadLocalStorage {
static long tls_key_; static long tls_key_;
static long tls_max_; static long tls_max_;
static TLSDestructorFunc tls_destructors_[kThreadLocalStorageSize]; static TLSDestructorFunc tls_destructors_[kThreadLocalStorageSize];
#endif // OS_WIN #endif // XP_WIN
DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage); DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage);
}; };

View file

@ -9,7 +9,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#endif #endif
@ -75,7 +75,7 @@ class WaitableEvent {
// does not necessarily mean that max_time was exceeded. // does not necessarily mean that max_time was exceeded.
bool TimedWait(const TimeDelta& max_time); bool TimedWait(const TimeDelta& max_time);
#if defined(OS_WIN) #if defined(XP_WIN)
HANDLE handle() const { return handle_; } HANDLE handle() const { return handle_; }
#endif #endif
@ -121,7 +121,7 @@ class WaitableEvent {
private: private:
friend class WaitableEventWatcher; friend class WaitableEventWatcher;
#if defined(OS_WIN) #if defined(XP_WIN)
HANDLE handle_; HANDLE handle_;
#else #else
// On Windows, one can close a HANDLE which is currently being waited on. The // On Windows, one can close a HANDLE which is currently being waited on. The

View file

@ -28,7 +28,7 @@ bool ChildProcessHost::CreateChannel() {
channel_id_ = IPC::Channel::GenerateVerifiedChannelID(); channel_id_ = IPC::Channel::GenerateVerifiedChannelID();
channel_.reset( channel_.reset(
new IPC::Channel(channel_id_, IPC::Channel::MODE_SERVER, &listener_)); new IPC::Channel(channel_id_, IPC::Channel::MODE_SERVER, &listener_));
#if defined(OS_WIN) #if defined(XP_WIN)
channel_->StartAcceptingHandles(IPC::Channel::MODE_SERVER); channel_->StartAcceptingHandles(IPC::Channel::MODE_SERVER);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
channel_->StartAcceptingMachPorts(IPC::Channel::MODE_SERVER); channel_->StartAcceptingMachPorts(IPC::Channel::MODE_SERVER);

View file

@ -31,7 +31,7 @@ ChildThread* ChildThread::current() {
void ChildThread::Init() { void ChildThread::Init() {
auto channel = mozilla::MakeUnique<IPC::Channel>( auto channel = mozilla::MakeUnique<IPC::Channel>(
channel_name_, IPC::Channel::MODE_CLIENT, nullptr); channel_name_, IPC::Channel::MODE_CLIENT, nullptr);
#if defined(OS_WIN) #if defined(XP_WIN)
channel->StartAcceptingHandles(IPC::Channel::MODE_CLIENT); channel->StartAcceptingHandles(IPC::Channel::MODE_CLIENT);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
channel->StartAcceptingMachPorts(IPC::Channel::MODE_CLIENT); channel->StartAcceptingMachPorts(IPC::Channel::MODE_CLIENT);

View file

@ -17,7 +17,7 @@
#include "mozilla/WeakPtr.h" #include "mozilla/WeakPtr.h"
#include "chrome/common/ipc_message.h" #include "chrome/common/ipc_message.h"
#ifdef OS_WIN #ifdef XP_WIN
# include <string> # include <string>
#endif #endif
@ -38,7 +38,7 @@ class Channel {
// but on Unix we use unnamed socketpairs and pass capabilities // but on Unix we use unnamed socketpairs and pass capabilities
// directly using SCM_RIGHTS messages. This type abstracts away // directly using SCM_RIGHTS messages. This type abstracts away
// that difference. // that difference.
#ifdef OS_WIN #ifdef XP_WIN
typedef std::wstring ChannelId; typedef std::wstring ChannelId;
#else #else
struct ChannelId {}; struct ChannelId {};
@ -161,7 +161,7 @@ class Channel {
void StartAcceptingMachPorts(Mode mode); void StartAcceptingMachPorts(Mode mode);
# endif # endif
#elif defined(OS_WIN) #elif defined(XP_WIN)
// Tell this pipe to accept handles. Exactly one side of the IPC connection // Tell this pipe to accept handles. Exactly one side of the IPC connection
// must be set as `MODE_SERVER`, and that side will be responsible for calling // must be set as `MODE_SERVER`, and that side will be responsible for calling
// `DuplicateHandle` to transfer the handle between processes. // `DuplicateHandle` to transfer the handle between processes.

View file

@ -337,7 +337,7 @@ class Message : public mojo::core::ports::UserMessage, public Pickle {
#endif #endif
uint32_t num_relayed_attachments() const { uint32_t num_relayed_attachments() const {
#if defined(OS_WIN) #if defined(XP_WIN)
return num_handles(); return num_handles();
#elif defined(OS_MACOSX) || defined(OS_IOS) #elif defined(OS_MACOSX) || defined(OS_IOS)
return num_send_rights(); return num_send_rights();

View file

@ -26,7 +26,7 @@
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"
#include "mozilla/IntegerRange.h" #include "mozilla/IntegerRange.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <windows.h> # include <windows.h>
#endif #endif
@ -891,7 +891,7 @@ struct ParamTraitsStd<std::map<K, V>> {
template <class P> template <class P>
struct ParamTraitsWindows : ParamTraitsStd<P> {}; struct ParamTraitsWindows : ParamTraitsStd<P> {};
#if defined(OS_WIN) #if defined(XP_WIN)
template <> template <>
struct ParamTraitsWindows<HANDLE> { struct ParamTraitsWindows<HANDLE> {
static_assert(sizeof(HANDLE) == sizeof(intptr_t), "Wrong size for HANDLE?"); static_assert(sizeof(HANDLE) == sizeof(intptr_t), "Wrong size for HANDLE?");
@ -915,7 +915,7 @@ struct ParamTraitsWindows<HWND> {
return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r)); return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r));
} }
}; };
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
// Various ipc/chromium types. // Various ipc/chromium types.

View file

@ -682,7 +682,7 @@ components that the process expects to use:
.. code-block:: c++ .. code-block:: c++
bool DemoChild::Init(int aArgc, char* aArgv[]) { bool DemoChild::Init(int aArgc, char* aArgv[]) {
#if defined(MOZ_SANDBOX) && defined(OS_WIN) #if defined(MOZ_SANDBOX) && defined(XP_WIN)
mozilla::SandboxTarget::Instance()->StartSandbox(); mozilla::SandboxTarget::Instance()->StartSandbox();
#elif defined(__OpenBSD__) && defined(MOZ_SANDBOX) #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
StartOpenBSDSandbox(GeckoProcessType_Demo); StartOpenBSDSandbox(GeckoProcessType_Demo);

View file

@ -7,7 +7,7 @@
#include "mozilla/ipc/BrowserProcessSubThread.h" #include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/ipc/NodeController.h" #include "mozilla/ipc/NodeController.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include <objbase.h> # include <objbase.h>
#endif #endif
@ -46,7 +46,7 @@ BrowserProcessSubThread::~BrowserProcessSubThread() {
} }
void BrowserProcessSubThread::Init() { void BrowserProcessSubThread::Init() {
#if defined(OS_WIN) #if defined(XP_WIN)
// Initializes the COM library on the current thread. // Initializes the COM library on the current thread.
CoInitialize(nullptr); CoInitialize(nullptr);
#endif #endif
@ -62,7 +62,7 @@ void BrowserProcessSubThread::CleanUp() {
NodeController::CleanUp(); NodeController::CleanUp();
} }
#if defined(OS_WIN) #if defined(XP_WIN)
// Closes the COM library on the current thread. CoInitialize must // Closes the COM library on the current thread. CoInitialize must
// be balanced by a corresponding call to CoUninitialize. // be balanced by a corresponding call to CoUninitialize.
CoUninitialize(); CoUninitialize();

View file

@ -10,10 +10,10 @@
#include "base/process.h" #include "base/process.h"
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "mozilla/UniquePtrExtensions.h" # include "mozilla/UniquePtrExtensions.h"
#endif #endif
#if !defined(OS_WIN) && !defined(OS_NETBSD) && !defined(OS_OPENBSD) #if !defined(XP_WIN) && !defined(OS_NETBSD) && !defined(OS_OPENBSD)
# include <pthread.h> # include <pthread.h>
# include "mozilla/ipc/SharedMemoryBasic.h" # include "mozilla/ipc/SharedMemoryBasic.h"
# include "mozilla/Atomics.h" # include "mozilla/Atomics.h"
@ -36,7 +36,7 @@ struct ParamTraits;
// preferred to making bare calls to CrossProcessMutex.Lock and Unlock. // preferred to making bare calls to CrossProcessMutex.Lock and Unlock.
// //
namespace mozilla { namespace mozilla {
#if defined(OS_WIN) #if defined(XP_WIN)
typedef mozilla::UniqueFileHandle CrossProcessMutexHandle; typedef mozilla::UniqueFileHandle CrossProcessMutexHandle;
#elif !defined(OS_NETBSD) && !defined(OS_OPENBSD) #elif !defined(OS_NETBSD) && !defined(OS_OPENBSD)
typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessMutexHandle; typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessMutexHandle;
@ -101,7 +101,7 @@ class CrossProcessMutex {
CrossProcessMutex(const CrossProcessMutex&); CrossProcessMutex(const CrossProcessMutex&);
CrossProcessMutex& operator=(const CrossProcessMutex&); CrossProcessMutex& operator=(const CrossProcessMutex&);
#if defined(OS_WIN) #if defined(XP_WIN)
HANDLE mMutex; HANDLE mMutex;
#elif !defined(OS_NETBSD) && !defined(OS_OPENBSD) #elif !defined(OS_NETBSD) && !defined(OS_OPENBSD)
RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer; RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer;

View file

@ -11,10 +11,10 @@
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "mozilla/UniquePtrExtensions.h" # include "mozilla/UniquePtrExtensions.h"
#endif #endif
#if !defined(OS_WIN) && !defined(OS_MACOSX) #if !defined(XP_WIN) && !defined(OS_MACOSX)
# include <pthread.h> # include <pthread.h>
# include <semaphore.h> # include <semaphore.h>
# include "mozilla/ipc/SharedMemoryBasic.h" # include "mozilla/ipc/SharedMemoryBasic.h"
@ -37,7 +37,7 @@ inline bool IsHandleValid(const T& handle) {
return bool(handle); return bool(handle);
} }
#if defined(OS_WIN) #if defined(XP_WIN)
typedef mozilla::UniqueFileHandle CrossProcessSemaphoreHandle; typedef mozilla::UniqueFileHandle CrossProcessSemaphoreHandle;
#elif !defined(OS_MACOSX) #elif !defined(OS_MACOSX)
typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessSemaphoreHandle; typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessSemaphoreHandle;
@ -102,7 +102,7 @@ class CrossProcessSemaphore {
CrossProcessSemaphore(const CrossProcessSemaphore&); CrossProcessSemaphore(const CrossProcessSemaphore&);
CrossProcessSemaphore& operator=(const CrossProcessSemaphore&); CrossProcessSemaphore& operator=(const CrossProcessSemaphore&);
#if defined(OS_WIN) #if defined(XP_WIN)
explicit CrossProcessSemaphore(HANDLE aSemaphore); explicit CrossProcessSemaphore(HANDLE aSemaphore);
HANDLE mSemaphore; HANDLE mSemaphore;

View file

@ -13,7 +13,7 @@
namespace base { namespace base {
#if defined(OS_WIN) #if defined(XP_WIN)
typedef std::wstring NativeEnvironmentString; typedef std::wstring NativeEnvironmentString;
typedef std::map<NativeEnvironmentString, NativeEnvironmentString> typedef std::map<NativeEnvironmentString, NativeEnvironmentString>

View file

@ -551,7 +551,7 @@ mozilla::BinPathType BaseProcessLauncher::GetPathToBinary(
BinPathType pathType = XRE_GetChildProcBinPathType(processType); BinPathType pathType = XRE_GetChildProcBinPathType(processType);
if (pathType == BinPathType::Self) { if (pathType == BinPathType::Self) {
#if defined(OS_WIN) #if defined(XP_WIN)
wchar_t exePathBuf[MAXPATHLEN]; wchar_t exePathBuf[MAXPATHLEN];
if (!::GetModuleFileNameW(nullptr, exePathBuf, MAXPATHLEN)) { if (!::GetModuleFileNameW(nullptr, exePathBuf, MAXPATHLEN)) {
MOZ_CRASH("GetModuleFileNameW failed (FIXME)"); MOZ_CRASH("GetModuleFileNameW failed (FIXME)");
@ -583,7 +583,7 @@ mozilla::BinPathType BaseProcessLauncher::GetPathToBinary(
if (ShouldHaveDirectoryService()) { if (ShouldHaveDirectoryService()) {
MOZ_ASSERT(gGREBinPath); MOZ_ASSERT(gGREBinPath);
#ifdef OS_WIN #ifdef XP_WIN
exePath = FilePath(char16ptr_t(gGREBinPath)); exePath = FilePath(char16ptr_t(gGREBinPath));
#elif MOZ_WIDGET_COCOA #elif MOZ_WIDGET_COCOA
nsCOMPtr<nsIFile> childProcPath; nsCOMPtr<nsIFile> childProcPath;
@ -606,7 +606,7 @@ mozilla::BinPathType BaseProcessLauncher::GetPathToBinary(
} }
if (exePath.empty()) { if (exePath.empty()) {
#ifdef OS_WIN #ifdef XP_WIN
exePath = exePath =
FilePath::FromWStringHack(CommandLine::ForCurrentProcess()->program()); FilePath::FromWStringHack(CommandLine::ForCurrentProcess()->program());
#else #else

View file

@ -42,7 +42,7 @@
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#ifdef OS_WIN #ifdef XP_WIN
# include "mozilla/gfx/Logging.h" # include "mozilla/gfx/Logging.h"
#endif #endif
@ -438,7 +438,7 @@ MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener)
: mName(aName), mListener(aListener), mMonitor(new RefCountedMonitor()) { : mName(aName), mListener(aListener), mMonitor(new RefCountedMonitor()) {
MOZ_COUNT_CTOR(ipc::MessageChannel); MOZ_COUNT_CTOR(ipc::MessageChannel);
#ifdef OS_WIN #ifdef XP_WIN
mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr); mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr);
MOZ_RELEASE_ASSERT(mEvent, "CreateEvent failed! Nothing is going to work!"); MOZ_RELEASE_ASSERT(mEvent, "CreateEvent failed! Nothing is going to work!");
#endif #endif
@ -452,7 +452,7 @@ MessageChannel::~MessageChannel() {
MonitorAutoLock lock(*mMonitor); MonitorAutoLock lock(*mMonitor);
MOZ_RELEASE_ASSERT(!mOnCxxStack, MOZ_RELEASE_ASSERT(!mOnCxxStack,
"MessageChannel destroyed while code on CxxStack"); "MessageChannel destroyed while code on CxxStack");
#ifdef OS_WIN #ifdef XP_WIN
if (mEvent) { if (mEvent) {
BOOL ok = CloseHandle(mEvent); BOOL ok = CloseHandle(mEvent);
mEvent = nullptr; mEvent = nullptr;
@ -1235,7 +1235,7 @@ bool MessageChannel::Send(UniquePtr<Message> aMsg, UniquePtr<Message>* aReply) {
RefPtr<ActorLifecycleProxy> proxy = Listener()->GetLifecycleProxy(); RefPtr<ActorLifecycleProxy> proxy = Listener()->GetLifecycleProxy();
#ifdef OS_WIN #ifdef XP_WIN
SyncStackFrame frame(this); SyncStackFrame frame(this);
NeuteredWindowRegion neuteredRgn(mFlags & NeuteredWindowRegion neuteredRgn(mFlags &
REQUIRE_DEFERRED_MESSAGE_PROTECTION); REQUIRE_DEFERRED_MESSAGE_PROTECTION);
@ -1838,7 +1838,7 @@ bool MessageChannel::WaitResponse(bool aWaitTimedOut) {
return true; return true;
} }
#ifndef OS_WIN #ifndef XP_WIN
bool MessageChannel::WaitForSyncNotify() { bool MessageChannel::WaitForSyncNotify() {
AssertWorkerThread(); AssertWorkerThread();
# ifdef DEBUG # ifdef DEBUG

View file

@ -14,9 +14,9 @@
#include "mozilla/LinkedList.h" #include "mozilla/LinkedList.h"
#include "mozilla/Monitor.h" #include "mozilla/Monitor.h"
#include "mozilla/Vector.h" #include "mozilla/Vector.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "mozilla/ipc/Neutering.h" # include "mozilla/ipc/Neutering.h"
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
#include <functional> #include <functional>
#include <map> #include <map>
@ -316,7 +316,7 @@ class MessageChannel : HasResultCodes {
} }
#endif #endif
#ifdef OS_WIN #ifdef XP_WIN
struct MOZ_STACK_CLASS SyncStackFrame { struct MOZ_STACK_CLASS SyncStackFrame {
explicit SyncStackFrame(MessageChannel* channel); explicit SyncStackFrame(MessageChannel* channel);
~SyncStackFrame(); ~SyncStackFrame();
@ -355,7 +355,7 @@ class MessageChannel : HasResultCodes {
private: private:
void SpinInternalEventLoop(); void SpinInternalEventLoop();
#endif // defined(OS_WIN) #endif // defined(XP_WIN)
private: private:
void PostErrorNotifyTask() MOZ_REQUIRES(*mMonitor); void PostErrorNotifyTask() MOZ_REQUIRES(*mMonitor);
@ -761,7 +761,7 @@ class MessageChannel : HasResultCodes {
// Map of async Callbacks that are still waiting replies. // Map of async Callbacks that are still waiting replies.
CallbackMap mPendingResponses; CallbackMap mPendingResponses;
#ifdef OS_WIN #ifdef XP_WIN
HANDLE mEvent; HANDLE mEvent;
#endif #endif

View file

@ -61,14 +61,14 @@ namespace base {
// converters, and implementing the one that doesn't exist for OS X // converters, and implementing the one that doesn't exist for OS X
// and Windows. // and Windows.
#if !defined(OS_MACOSX) && !defined(OS_WIN) #if !defined(OS_MACOSX) && !defined(XP_WIN)
std::string SysWideToUTF8(const std::wstring& wide) { std::string SysWideToUTF8(const std::wstring& wide) {
// FIXME/cjones: do this with iconv // FIXME/cjones: do this with iconv
return GhettoStringConvert<std::wstring, std::string>(wide); return GhettoStringConvert<std::wstring, std::string>(wide);
} }
#endif #endif
#if !defined(OS_MACOSX) && !defined(OS_WIN) #if !defined(OS_MACOSX) && !defined(XP_WIN)
std::wstring SysUTF8ToWide(const StringPiece& utf8) { std::wstring SysUTF8ToWide(const StringPiece& utf8) {
// FIXME/cjones: do this with iconv // FIXME/cjones: do this with iconv
return GhettoStringConvert<StringPiece, std::wstring>(utf8); return GhettoStringConvert<StringPiece, std::wstring>(utf8);

View file

@ -78,7 +78,7 @@ void UtilityAudioDecoderParent::GenericPreloadForSandbox() {
/* static */ /* static */
void UtilityAudioDecoderParent::WMFPreloadForSandbox() { void UtilityAudioDecoderParent::WMFPreloadForSandbox() {
#if defined(MOZ_SANDBOX) && defined(OS_WIN) #if defined(MOZ_SANDBOX) && defined(XP_WIN)
// mfplat.dll and mf.dll will be preloaded by // mfplat.dll and mf.dll will be preloaded by
// wmf::MediaFoundationInitializer::HasInitialized() // wmf::MediaFoundationInitializer::HasInitialized()
# if defined(DEBUG) # if defined(DEBUG)
@ -91,7 +91,7 @@ void UtilityAudioDecoderParent::WMFPreloadForSandbox() {
NS_WARNING("Failed to init Media Foundation in the Utility process"); NS_WARNING("Failed to init Media Foundation in the Utility process");
return; return;
} }
#endif // defined(MOZ_SANDBOX) && defined(OS_WIN) #endif // defined(MOZ_SANDBOX) && defined(XP_WIN)
} }
void UtilityAudioDecoderParent::Start( void UtilityAudioDecoderParent::Start(

View file

@ -8,11 +8,11 @@
#include "mozilla/ipc/IOThreadChild.h" #include "mozilla/ipc/IOThreadChild.h"
#include "mozilla/GeckoArgs.h" #include "mozilla/GeckoArgs.h"
#if defined(OS_WIN) #if defined(XP_WIN)
# include "nsExceptionHandler.h" # include "nsExceptionHandler.h"
#endif #endif
#if defined(OS_WIN) && defined(MOZ_SANDBOX) #if defined(XP_WIN) && defined(MOZ_SANDBOX)
# include "mozilla/sandboxTarget.h" # include "mozilla/sandboxTarget.h"
# include "WMF.h" # include "WMF.h"
# include "WMFDecoderModule.h" # include "WMFDecoderModule.h"
@ -80,7 +80,7 @@ bool UtilityProcessImpl::Init(int aArgc, char* aArgv[]) {
return false; return false;
} }
#if defined(MOZ_SANDBOX) && defined(OS_WIN) #if defined(MOZ_SANDBOX) && defined(XP_WIN)
// We delay load winmm.dll so that its dependencies don't interfere with COM // We delay load winmm.dll so that its dependencies don't interfere with COM
// initialization when win32k is locked down. We need to load it before we // initialization when win32k is locked down. We need to load it before we
// lower the sandbox in processes where the policy will prevent loading. // lower the sandbox in processes where the policy will prevent loading.

View file

@ -4202,7 +4202,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
) )
processnative.addcode( processnative.addcode(
""" """
#ifdef OS_WIN #ifdef XP_WIN
GetIPCChannel()->ProcessNativeEventsInInterruptCall(); GetIPCChannel()->ProcessNativeEventsInInterruptCall();
#else #else
FatalError("This method is Windows-only"); FatalError("This method is Windows-only");

View file

@ -51,7 +51,7 @@ char* gIPDLUnitTestName = nullptr;
const char* IPDLUnitTestName() { const char* IPDLUnitTestName() {
if (!gIPDLUnitTestName) { if (!gIPDLUnitTestName) {
#if defined(OS_WIN) #if defined(XP_WIN)
vector<wstring> args = CommandLine::ForCurrentProcess()->GetLooseValues(); vector<wstring> args = CommandLine::ForCurrentProcess()->GetLooseValues();
gIPDLUnitTestName = ::strdup(WideToUTF8(args[0]).c_str()); gIPDLUnitTestName = ::strdup(WideToUTF8(args[0]).c_str());
#elif defined(XP_UNIX) #elif defined(XP_UNIX)