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 "chrome/browser/chromeos/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const base::FilePath tmp_directory = | 316 const base::FilePath tmp_directory = |
317 cache_root_directory.AppendASCII("tmp"); | 317 cache_root_directory.AppendASCII("tmp"); |
318 if (!base::PathExists(persistent_directory)) | 318 if (!base::PathExists(persistent_directory)) |
319 return; | 319 return; |
320 | 320 |
321 const base::FilePath cache_file_directory = | 321 const base::FilePath cache_file_directory = |
322 cache_root_directory.Append(kCacheFileDirectory); | 322 cache_root_directory.Append(kCacheFileDirectory); |
323 | 323 |
324 // Move all files inside "persistent" to "files". | 324 // Move all files inside "persistent" to "files". |
325 MoveAllFilesFromDirectory(persistent_directory, cache_file_directory); | 325 MoveAllFilesFromDirectory(persistent_directory, cache_file_directory); |
326 base::Delete(persistent_directory, true /* recursive */); | 326 base::DeleteFile(persistent_directory, true /* recursive */); |
327 | 327 |
328 // Move all files inside "tmp" to "files". | 328 // Move all files inside "tmp" to "files". |
329 MoveAllFilesFromDirectory(tmp_directory, cache_file_directory); | 329 MoveAllFilesFromDirectory(tmp_directory, cache_file_directory); |
330 } | 330 } |
331 | 331 |
332 void PrepareWritableFileAndRun(Profile* profile, | 332 void PrepareWritableFileAndRun(Profile* profile, |
333 const base::FilePath& path, | 333 const base::FilePath& path, |
334 const OpenFileCallback& callback) { | 334 const OpenFileCallback& callback) { |
335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 335 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
336 DCHECK(!callback.is_null()); | 336 DCHECK(!callback.is_null()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 base::MD5Update(&context, base::StringPiece(buffer.get(), result)); | 470 base::MD5Update(&context, base::StringPiece(buffer.get(), result)); |
471 } | 471 } |
472 | 472 |
473 base::MD5Digest digest; | 473 base::MD5Digest digest; |
474 base::MD5Final(&digest, &context); | 474 base::MD5Final(&digest, &context); |
475 return MD5DigestToBase16(digest); | 475 return MD5DigestToBase16(digest); |
476 } | 476 } |
477 | 477 |
478 } // namespace util | 478 } // namespace util |
479 } // namespace drive | 479 } // namespace drive |
OLD | NEW |