зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1370519 - Part 4: Get rid of FileHandleCommon.h/cpp; r=btseng
This commit is contained in:
Родитель
d0c12b86b4
Коммит
fecbc27222
|
@ -9,7 +9,6 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/FileHandleCommon.h"
|
||||
#include "mozilla/dom/PBackgroundFileHandleParent.h"
|
||||
#include "mozilla/dom/PBackgroundFileRequestParent.h"
|
||||
#include "mozilla/dom/indexedDB/ActorsParent.h"
|
||||
|
@ -201,7 +200,9 @@ class FileHandle
|
|||
bool mFinishedOrAborted;
|
||||
bool mForceAborted;
|
||||
|
||||
DEBUGONLY(nsCOMPtr<nsIEventTarget> mThreadPoolEventTarget;)
|
||||
#ifdef DEBUG
|
||||
nsCOMPtr<nsIEventTarget> mThreadPoolEventTarget;
|
||||
#endif
|
||||
|
||||
public:
|
||||
void
|
||||
|
@ -457,7 +458,9 @@ class NormalFileHandleOp
|
|||
bool mActorDestroyed;
|
||||
const bool mFileHandleIsAborted;
|
||||
|
||||
DEBUGONLY(bool mResponseSent;)
|
||||
#ifdef DEBUG
|
||||
bool mResponseSent;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsISupports> mFileStream;
|
||||
|
@ -507,7 +510,9 @@ protected:
|
|||
, mOperationMayProceed(true)
|
||||
, mActorDestroyed(false)
|
||||
, mFileHandleIsAborted(aFileHandle->IsAborted())
|
||||
DEBUGONLY(, mResponseSent(false))
|
||||
#ifdef DEBUG
|
||||
, mResponseSent(false)
|
||||
#endif
|
||||
{
|
||||
MOZ_ASSERT(aFileHandle);
|
||||
}
|
||||
|
@ -2069,7 +2074,9 @@ NormalFileHandleOp::SendSuccessResult()
|
|||
}
|
||||
}
|
||||
|
||||
DEBUGONLY(mResponseSent = true;)
|
||||
#ifdef DEBUG
|
||||
mResponseSent = true;
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2087,7 +2094,9 @@ NormalFileHandleOp::SendFailureResult(nsresult aResultCode)
|
|||
PBackgroundFileRequestParent::Send__delete__(this, aResultCode);
|
||||
}
|
||||
|
||||
DEBUGONLY(mResponseSent = true;)
|
||||
#ifdef DEBUG
|
||||
mResponseSent = true;
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include "FileHandleCommon.h"
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "prthread.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
void
|
||||
ThreadObject::AssertIsOnOwningThread() const
|
||||
{
|
||||
MOZ_ASSERT(mOwningThread);
|
||||
MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
|
||||
}
|
||||
|
||||
PRThread*
|
||||
ThreadObject::OwningThread() const
|
||||
{
|
||||
MOZ_ASSERT(mOwningThread);
|
||||
return mOwningThread;
|
||||
}
|
||||
|
||||
#endif // DEBUG
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -1,70 +0,0 @@
|
|||
/* 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_dom_FileHandleCommon_h
|
||||
#define mozilla_dom_FileHandleCommon_h
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DEBUGONLY(...) __VA_ARGS__
|
||||
#else
|
||||
#define DEBUGONLY(...) /* nothing */
|
||||
#endif
|
||||
|
||||
struct PRThread;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class RefCountedObject
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
|
||||
|
||||
protected:
|
||||
virtual ~RefCountedObject()
|
||||
{ }
|
||||
};
|
||||
|
||||
class ThreadObject
|
||||
{
|
||||
DEBUGONLY(PRThread* mOwningThread;)
|
||||
|
||||
public:
|
||||
explicit ThreadObject(DEBUGONLY(PRThread* aOwningThread))
|
||||
DEBUGONLY(: mOwningThread(aOwningThread))
|
||||
{ }
|
||||
|
||||
virtual ~ThreadObject()
|
||||
{ }
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
AssertIsOnOwningThread() const;
|
||||
|
||||
PRThread*
|
||||
OwningThread() const;
|
||||
#else
|
||||
void
|
||||
AssertIsOnOwningThread() const
|
||||
{ }
|
||||
#endif
|
||||
};
|
||||
|
||||
class RefCountedThreadObject
|
||||
: public RefCountedObject
|
||||
, public ThreadObject
|
||||
{
|
||||
public:
|
||||
explicit RefCountedThreadObject(DEBUGONLY(PRThread* aOwningThread))
|
||||
: ThreadObject(DEBUGONLY(aOwningThread))
|
||||
{ }
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_FileHandleCommon_h
|
|
@ -13,13 +13,11 @@ EXPORTS.mozilla.dom.filehandle += [
|
|||
]
|
||||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'FileHandleCommon.h',
|
||||
'FileHandleStorage.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'ActorsParent.cpp',
|
||||
'FileHandleCommon.cpp',
|
||||
]
|
||||
|
||||
IPDL_SOURCES += [
|
||||
|
|
Загрузка…
Ссылка в новой задаче