Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: webkit/fileapi/obfuscated_file_system_file_util.cc

Issue 7511008: Specify 'true' to force creating the new directory in MigrateFromOldSandbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/fileapi/obfuscated_file_system_file_util.h" 5 #include "webkit/fileapi/obfuscated_file_system_file_util.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 890 }
891 891
892 bool ObfuscatedFileSystemFileUtil::MigrateFromOldSandbox( 892 bool ObfuscatedFileSystemFileUtil::MigrateFromOldSandbox(
893 const GURL& origin_url, FileSystemType type, const FilePath& src_root) { 893 const GURL& origin_url, FileSystemType type, const FilePath& src_root) {
894 if (!DestroyDirectoryDatabase(origin_url, type)) 894 if (!DestroyDirectoryDatabase(origin_url, type))
895 return false; 895 return false;
896 FilePath dest_root = GetDirectoryForOriginAndType(origin_url, type, true); 896 FilePath dest_root = GetDirectoryForOriginAndType(origin_url, type, true);
897 if (dest_root.empty()) 897 if (dest_root.empty())
898 return false; 898 return false;
899 FileSystemDirectoryDatabase* db = GetDirectoryDatabase( 899 FileSystemDirectoryDatabase* db = GetDirectoryDatabase(
900 origin_url, type, false); 900 origin_url, type, true);
901 if (!db) 901 if (!db)
902 return false; 902 return false;
903 903
904 file_util::FileEnumerator file_enum(src_root, true, 904 file_util::FileEnumerator file_enum(src_root, true,
905 static_cast<file_util::FileEnumerator::FILE_TYPE>( 905 static_cast<file_util::FileEnumerator::FILE_TYPE>(
906 file_util::FileEnumerator::FILES | 906 file_util::FileEnumerator::FILES |
907 file_util::FileEnumerator::DIRECTORIES)); 907 file_util::FileEnumerator::DIRECTORIES));
908 FilePath src_full_path; 908 FilePath src_full_path;
909 size_t root_path_length = src_root.value().length() + 1; // +1 for the slash 909 size_t root_path_length = src_root.value().length() + 1; // +1 for the slash
910 while (!(src_full_path = file_enum.Next()).empty()) { 910 while (!(src_full_path = file_enum.Next()).empty()) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 return false; 1093 return false;
1094 } 1094 }
1095 origin_database_.reset( 1095 origin_database_.reset(
1096 new FileSystemOriginDatabase( 1096 new FileSystemOriginDatabase(
1097 file_system_directory_.AppendASCII(kOriginDatabaseName))); 1097 file_system_directory_.AppendASCII(kOriginDatabaseName)));
1098 } 1098 }
1099 return true; 1099 return true;
1100 } 1100 }
1101 1101
1102 } // namespace fileapi 1102 } // namespace fileapi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698