2012-06-01 10:21:12 -07:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
2013-12-08 21:31:48 -08:00
|
|
|
#ifndef IndexedDatabaseInlines_h
|
|
|
|
#define IndexedDatabaseInlines_h
|
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
#error Must include IndexedDatabase.h first
|
|
|
|
#endif
|
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
#include "FileInfo.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
|
2014-10-08 09:15:23 -07:00
|
|
|
#include "mozilla/dom/File.h"
|
2014-09-26 16:21:57 -07:00
|
|
|
#include "nsIInputStream.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace indexedDB {
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2012-06-03 09:33:52 -07:00
|
|
|
inline
|
2014-09-26 16:21:57 -07:00
|
|
|
StructuredCloneFile::StructuredCloneFile()
|
2012-06-03 09:33:52 -07:00
|
|
|
{
|
2014-09-26 16:21:57 -07:00
|
|
|
MOZ_COUNT_CTOR(StructuredCloneFile);
|
2012-06-03 09:33:52 -07:00
|
|
|
}
|
|
|
|
|
2014-01-31 18:50:07 -08:00
|
|
|
inline
|
2014-09-26 16:21:57 -07:00
|
|
|
StructuredCloneFile::~StructuredCloneFile()
|
2014-01-31 18:50:07 -08:00
|
|
|
{
|
2014-09-26 16:21:57 -07:00
|
|
|
MOZ_COUNT_DTOR(StructuredCloneFile);
|
2014-01-31 18:50:07 -08:00
|
|
|
}
|
|
|
|
|
2012-06-01 10:21:12 -07:00
|
|
|
inline
|
|
|
|
bool
|
2014-09-26 16:21:57 -07:00
|
|
|
StructuredCloneFile::operator==(const StructuredCloneFile& aOther) const
|
2012-06-01 10:21:12 -07:00
|
|
|
{
|
2014-09-26 16:21:57 -07:00
|
|
|
return this->mFile == aOther.mFile &&
|
|
|
|
this->mFileInfo == aOther.mFileInfo;
|
2014-09-13 09:12:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
2014-09-17 16:36:01 -07:00
|
|
|
StructuredCloneReadInfo::StructuredCloneReadInfo()
|
2014-09-26 16:21:57 -07:00
|
|
|
: mDatabase(nullptr)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(StructuredCloneReadInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo::StructuredCloneReadInfo(
|
|
|
|
SerializedStructuredCloneReadInfo&& aCloneReadInfo)
|
|
|
|
: mData(Move(aCloneReadInfo.data()))
|
|
|
|
, mDatabase(nullptr)
|
2014-09-13 09:12:19 -07:00
|
|
|
{
|
2014-09-26 16:21:57 -07:00
|
|
|
MOZ_COUNT_CTOR(StructuredCloneReadInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo::~StructuredCloneReadInfo()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(StructuredCloneReadInfo);
|
2012-06-03 09:33:52 -07:00
|
|
|
}
|
|
|
|
|
2014-01-31 18:50:07 -08:00
|
|
|
inline StructuredCloneReadInfo&
|
|
|
|
StructuredCloneReadInfo::operator=(StructuredCloneReadInfo&& aCloneReadInfo)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(&aCloneReadInfo != this);
|
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
mData = Move(aCloneReadInfo.mData);
|
2014-01-31 18:50:07 -08:00
|
|
|
mCloneBuffer = Move(aCloneReadInfo.mCloneBuffer);
|
|
|
|
mFiles.Clear();
|
|
|
|
mFiles.SwapElements(aCloneReadInfo.mFiles);
|
|
|
|
mDatabase = aCloneReadInfo.mDatabase;
|
|
|
|
aCloneReadInfo.mDatabase = nullptr;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2012-06-01 10:21:12 -07:00
|
|
|
|
2014-09-26 16:21:57 -07:00
|
|
|
#endif // IndexedDatabaseInlines_h
|