| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_util.h" | 5 #include "webkit/fileapi/obfuscated_file_util.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 | 1316 |
| 1317 PlatformFileError error = base::PLATFORM_FILE_OK; | 1317 PlatformFileError error = base::PLATFORM_FILE_OK; |
| 1318 base::FilePath new_local_path = GetDirectoryForOriginAndType(origin, type, | 1318 base::FilePath new_local_path = GetDirectoryForOriginAndType(origin, type, |
| 1319 false, &error); | 1319 false, &error); |
| 1320 if (error != base::PLATFORM_FILE_OK) | 1320 if (error != base::PLATFORM_FILE_OK) |
| 1321 return base::PLATFORM_FILE_ERROR_FAILED; | 1321 return base::PLATFORM_FILE_ERROR_FAILED; |
| 1322 | 1322 |
| 1323 // We use the third- and fourth-to-last digits as the directory. | 1323 // We use the third- and fourth-to-last digits as the directory. |
| 1324 int64 directory_number = number % 10000 / 100; | 1324 int64 directory_number = number % 10000 / 100; |
| 1325 new_local_path = new_local_path.AppendASCII( | 1325 new_local_path = new_local_path.AppendASCII( |
| 1326 StringPrintf("%02" PRId64, directory_number)); | 1326 base::StringPrintf("%02" PRId64, directory_number)); |
| 1327 | 1327 |
| 1328 error = NativeFileUtil::CreateDirectory( | 1328 error = NativeFileUtil::CreateDirectory( |
| 1329 new_local_path, false /* exclusive */, false /* recursive */); | 1329 new_local_path, false /* exclusive */, false /* recursive */); |
| 1330 if (error != base::PLATFORM_FILE_OK) | 1330 if (error != base::PLATFORM_FILE_OK) |
| 1331 return error; | 1331 return error; |
| 1332 | 1332 |
| 1333 *local_path = new_local_path.AppendASCII(StringPrintf("%08" PRId64, number)); | 1333 *local_path = |
| 1334 new_local_path.AppendASCII(base::StringPrintf("%08" PRId64, number)); |
| 1334 return base::PLATFORM_FILE_OK; | 1335 return base::PLATFORM_FILE_OK; |
| 1335 } | 1336 } |
| 1336 | 1337 |
| 1337 } // namespace fileapi | 1338 } // namespace fileapi |
| OLD | NEW |