OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/app_data_migrator.h" | 5 #include "chrome/browser/extensions/app_data_migrator.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 old_fs_context->default_file_task_runner()->RunsTasksOnCurrentThread()); | 34 old_fs_context->default_file_task_runner()->RunsTasksOnCurrentThread()); |
35 | 35 |
36 SandboxFileSystemBackendDelegate* old_sandbox_delegate = | 36 SandboxFileSystemBackendDelegate* old_sandbox_delegate = |
37 old_fs_context->sandbox_delegate(); | 37 old_fs_context->sandbox_delegate(); |
38 SandboxFileSystemBackendDelegate* sandbox_delegate = | 38 SandboxFileSystemBackendDelegate* sandbox_delegate = |
39 fs_context->sandbox_delegate(); | 39 fs_context->sandbox_delegate(); |
40 | 40 |
41 GURL extension_url = | 41 GURL extension_url = |
42 extensions::Extension::GetBaseURLFromExtensionId(extension->id()); | 42 extensions::Extension::GetBaseURLFromExtensionId(extension->id()); |
43 | 43 |
44 scoped_ptr<storage::SandboxFileSystemBackendDelegate::OriginEnumerator> | 44 std::unique_ptr<storage::SandboxFileSystemBackendDelegate::OriginEnumerator> |
45 enumerator(old_sandbox_delegate->CreateOriginEnumerator()); | 45 enumerator(old_sandbox_delegate->CreateOriginEnumerator()); |
46 | 46 |
47 // Find out if there is a file system that needs migration. | 47 // Find out if there is a file system that needs migration. |
48 GURL origin; | 48 GURL origin; |
49 do { | 49 do { |
50 origin = enumerator->Next(); | 50 origin = enumerator->Next(); |
51 } while (origin != extension_url && !origin.is_empty()); | 51 } while (origin != extension_url && !origin.is_empty()); |
52 | 52 |
53 if (!origin.is_empty()) { | 53 if (!origin.is_empty()) { |
54 // Copy the temporary file system. | 54 // Copy the temporary file system. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (old_was_disabled) | 169 if (old_was_disabled) |
170 registry_->RemoveEnabled(extension->id()); | 170 registry_->RemoveEnabled(extension->id()); |
171 else | 171 else |
172 registry_->AddEnabled(old); | 172 registry_->AddEnabled(old); |
173 | 173 |
174 MigrateLegacyPartition(weak_factory_.GetWeakPtr(), old_partition, | 174 MigrateLegacyPartition(weak_factory_.GetWeakPtr(), old_partition, |
175 new_partition, extension, reply); | 175 new_partition, extension, reply); |
176 } | 176 } |
177 | 177 |
178 } // namespace extensions | 178 } // namespace extensions |
OLD | NEW |