Commit 65f511c1 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

storage: Remove unused IndexedDBContext::CopyOriginData

The last user is removed via:
https://chromium-review.googlesource.com/c/chromium/src/+/2048032

Bug: 1015214
Change-Id: Icb7a3011ba4edfa707d2abd292a1b4b7beda3eb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2048503
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742743}
parent f9f90cd5
...@@ -527,37 +527,6 @@ base::Time IndexedDBContextImpl::GetOriginLastModified(const Origin& origin) { ...@@ -527,37 +527,6 @@ base::Time IndexedDBContextImpl::GetOriginLastModified(const Origin& origin) {
return file_info.last_modified; return file_info.last_modified;
} }
void IndexedDBContextImpl::CopyOriginData(const Origin& origin,
IndexedDBContext* dest_context) {
DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence());
if (is_incognito() || !HasOrigin(origin))
return;
IndexedDBContextImpl* dest_context_impl =
static_cast<IndexedDBContextImpl*>(dest_context);
ForceCloseSync(origin,
storage::mojom::ForceCloseReason::FORCE_CLOSE_COPY_ORIGIN);
// Make sure we're not about to delete our own database.
CHECK_NE(dest_context_impl->data_path().value(), data_path().value());
// Delete any existing storage paths in the destination context.
// A previously failed migration may have left behind partially copied
// directories.
for (const auto& dest_path : dest_context_impl->GetStoragePaths(origin))
base::DeleteFileRecursively(dest_path);
base::FilePath dest_data_path = dest_context_impl->data_path();
base::CreateDirectory(dest_data_path);
for (const base::FilePath& src_data_path : GetStoragePaths(origin)) {
if (base::PathExists(src_data_path)) {
base::CopyDirectory(src_data_path, dest_data_path, true);
}
}
}
V2SchemaCorruptionStatus IndexedDBContextImpl::HasV2SchemaCorruption( V2SchemaCorruptionStatus IndexedDBContextImpl::HasV2SchemaCorruption(
const Origin& origin) { const Origin& origin) {
DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence()); DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence());
......
...@@ -112,8 +112,6 @@ class CONTENT_EXPORT IndexedDBContextImpl ...@@ -112,8 +112,6 @@ class CONTENT_EXPORT IndexedDBContextImpl
// IndexedDBContext implementation: // IndexedDBContext implementation:
base::SequencedTaskRunner* IDBTaskRunner() override; base::SequencedTaskRunner* IDBTaskRunner() override;
void CopyOriginData(const url::Origin& origin,
IndexedDBContext* dest_context) override;
// Methods called by IndexedDBFactoryImpl or IndexedDBDispatcherHost for // Methods called by IndexedDBFactoryImpl or IndexedDBDispatcherHost for
// quota support. // quota support.
......
...@@ -18,10 +18,6 @@ namespace base { ...@@ -18,10 +18,6 @@ namespace base {
class SequencedTaskRunner; class SequencedTaskRunner;
} }
namespace url {
class Origin;
}
namespace content { namespace content {
// Represents the per-BrowserContext IndexedDB data. // Represents the per-BrowserContext IndexedDB data.
...@@ -36,11 +32,6 @@ class IndexedDBContext ...@@ -36,11 +32,6 @@ class IndexedDBContext
// Only call the below methods by posting to this IDBTaskRunner. // Only call the below methods by posting to this IDBTaskRunner.
virtual base::SequencedTaskRunner* IDBTaskRunner() = 0; virtual base::SequencedTaskRunner* IDBTaskRunner() = 0;
// Copies the indexed db files from this context to another. The
// indexed db directory in the destination context needs to be empty.
virtual void CopyOriginData(const url::Origin& origin,
IndexedDBContext* dest_context) = 0;
protected: protected:
friend class base::RefCountedDeleteOnSequence<IndexedDBContext>; friend class base::RefCountedDeleteOnSequence<IndexedDBContext>;
friend class base::DeleteHelper<IndexedDBContext>; friend class base::DeleteHelper<IndexedDBContext>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment