2012-06-01 21:21:12 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-03 22:32:37 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-06-01 21:21:12 +04:00
|
|
|
/* 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-09 09:31:48 +04:00
|
|
|
#ifndef IndexedDatabaseInlines_h
|
|
|
|
#define IndexedDatabaseInlines_h
|
|
|
|
|
2012-06-01 21:21:12 +04:00
|
|
|
#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
|
|
|
|
#error Must include IndexedDatabase.h first
|
|
|
|
#endif
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "FileInfo.h"
|
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
|
2014-10-08 20:15:23 +04:00
|
|
|
#include "mozilla/dom/File.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "nsIInputStream.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace indexedDB {
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2012-06-03 20:33:52 +04:00
|
|
|
inline
|
2014-09-27 03:21:57 +04:00
|
|
|
StructuredCloneFile::StructuredCloneFile()
|
2012-06-03 20:33:52 +04:00
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
MOZ_COUNT_CTOR(StructuredCloneFile);
|
2012-06-03 20:33:52 +04:00
|
|
|
}
|
|
|
|
|
2014-02-01 06:50:07 +04:00
|
|
|
inline
|
2014-09-27 03:21:57 +04:00
|
|
|
StructuredCloneFile::~StructuredCloneFile()
|
2014-02-01 06:50:07 +04:00
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
MOZ_COUNT_DTOR(StructuredCloneFile);
|
2014-02-01 06:50:07 +04:00
|
|
|
}
|
|
|
|
|
2012-06-01 21:21:12 +04:00
|
|
|
inline
|
|
|
|
bool
|
2014-09-27 03:21:57 +04:00
|
|
|
StructuredCloneFile::operator==(const StructuredCloneFile& aOther) const
|
2012-06-01 21:21:12 +04:00
|
|
|
{
|
2015-05-12 15:09:51 +03:00
|
|
|
return this->mBlob == aOther.mBlob &&
|
2014-09-27 03:21:57 +04:00
|
|
|
this->mFileInfo == aOther.mFileInfo;
|
2014-09-13 20:12:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
2014-09-18 03:36:01 +04:00
|
|
|
StructuredCloneReadInfo::StructuredCloneReadInfo()
|
2014-09-27 03:21:57 +04:00
|
|
|
: mDatabase(nullptr)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(StructuredCloneReadInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo::StructuredCloneReadInfo(
|
|
|
|
SerializedStructuredCloneReadInfo&& aCloneReadInfo)
|
|
|
|
: mData(Move(aCloneReadInfo.data()))
|
|
|
|
, mDatabase(nullptr)
|
2014-09-13 20:12:19 +04:00
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
MOZ_COUNT_CTOR(StructuredCloneReadInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
StructuredCloneReadInfo::~StructuredCloneReadInfo()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(StructuredCloneReadInfo);
|
2012-06-03 20:33:52 +04:00
|
|
|
}
|
|
|
|
|
2014-02-01 06:50:07 +04:00
|
|
|
inline StructuredCloneReadInfo&
|
|
|
|
StructuredCloneReadInfo::operator=(StructuredCloneReadInfo&& aCloneReadInfo)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(&aCloneReadInfo != this);
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
mData = Move(aCloneReadInfo.mData);
|
2014-02-01 06:50:07 +04:00
|
|
|
mCloneBuffer = Move(aCloneReadInfo.mCloneBuffer);
|
|
|
|
mFiles.Clear();
|
|
|
|
mFiles.SwapElements(aCloneReadInfo.mFiles);
|
|
|
|
mDatabase = aCloneReadInfo.mDatabase;
|
|
|
|
aCloneReadInfo.mDatabase = nullptr;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2012-06-01 21:21:12 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
#endif // IndexedDatabaseInlines_h
|