Skip to content

Commit

Permalink
browser(firefox): fix win compile (#3275)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Aug 3, 2020
1 parent 5c4f067 commit e481f37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions browser_patches/firefox/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1147
Changed: [email protected] Mon Aug 3 13:14:27 PDT 2020
1148
Changed: [email protected] Mon Aug 3 14:40:54 PDT 2020
12 changes: 6 additions & 6 deletions browser_patches/firefox/juggler/pipe/nsRemoteDebuggingPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "nsRemoteDebuggingPipe.h"

#include <cstring>
#if defined(OS_WIN)
#if defined(_WIN32)
#include <io.h>
#else
#include <stdio.h>
Expand All @@ -29,7 +29,7 @@ const int writeFD = 4;

const size_t kWritePacketSize = 1 << 16;

#if defined(OS_WIN)
#if defined(_WIN32)
HANDLE readHandle;
HANDLE writeHandle;
#endif
Expand All @@ -38,7 +38,7 @@ size_t ReadBytes(void* buffer, size_t size, bool exact_size)
{
size_t bytesRead = 0;
while (bytesRead < size) {
#if defined(OS_WIN)
#if defined(_WIN32)
DWORD sizeRead = 0;
bool hadError = !ReadFile(readHandle, static_cast<char*>(buffer) + bytesRead,
size - bytesRead, &sizeRead, nullptr);
Expand Down Expand Up @@ -66,7 +66,7 @@ void WriteBytes(const char* bytes, size_t size)
size_t length = size - totalWritten;
if (length > kWritePacketSize)
length = kWritePacketSize;
#if defined(OS_WIN)
#if defined(_WIN32)
DWORD bytesWritten = 0;
bool hadError = !WriteFile(writeHandle, bytes + totalWritten, static_cast<DWORD>(length), &bytesWritten, nullptr);
#else
Expand Down Expand Up @@ -105,7 +105,7 @@ nsresult nsRemoteDebuggingPipe::Init(nsIRemoteDebuggingPipeClient* aClient) {
MOZ_ALWAYS_SUCCEEDS(NS_NewNamedThread("Pipe Reader", getter_AddRefs(mReaderThread)));
MOZ_ALWAYS_SUCCEEDS(NS_NewNamedThread("Pipe Writer", getter_AddRefs(mWriterThread)));

#if defined(OS_WIN)
#if defined(_WIN32)
readHandle = reinterpret_cast<HANDLE>(_get_osfhandle(readFD));
writeHandle = reinterpret_cast<HANDLE>(_get_osfhandle(writeFD));
#endif
Expand All @@ -124,7 +124,7 @@ nsresult nsRemoteDebuggingPipe::Stop() {
m_terminated = true;
mClient = nullptr;
// Cancel pending synchronous read.
#if defined(OS_WIN)
#if defined(_WIN32)
CancelIoEx(readHandle, nullptr);
CloseHandle(readHandle);
#else
Expand Down

0 comments on commit e481f37

Please sign in to comment.