| 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/gdata/file_write_helper.h" | 5 #include "chrome/browser/chromeos/gdata/file_write_helper.h" |
| 6 | 6 |
| 7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 | 9 |
| 10 using content::BrowserThread; | 10 using content::BrowserThread; |
| 11 | 11 |
| 12 namespace gdata { | 12 namespace gdata { |
| 13 | 13 |
| 14 FileWriteHelper::FileWriteHelper(GDataFileSystemInterface* file_system) | 14 FileWriteHelper::FileWriteHelper(DriveFileSystemInterface* file_system) |
| 15 : file_system_(file_system), | 15 : file_system_(file_system), |
| 16 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 16 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 17 // Must be created in GDataSystemService. | 17 // Must be created in GDataSystemService. |
| 18 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 18 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 FileWriteHelper::~FileWriteHelper() { | 21 FileWriteHelper::~FileWriteHelper() { |
| 22 // Must be destroyed in GDataSystemService. | 22 // Must be destroyed in GDataSystemService. |
| 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 24 } | 24 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 void FileWriteHelper::PrepareWritableFileAndRunAfterCallback( | 90 void FileWriteHelper::PrepareWritableFileAndRunAfterCallback( |
| 91 const FilePath& file_path) { | 91 const FilePath& file_path) { |
| 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 93 file_system_->CloseFile(file_path, FileOperationCallback()); | 93 file_system_->CloseFile(file_path, FileOperationCallback()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace gdata | 96 } // namespace gdata |
| OLD | NEW |