OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/fileapi/file_stream_reade
r.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reade
r.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" | 10 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if (!file_system_.get()) { | 113 if (!file_system_.get()) { |
114 BrowserThread::PostTask( | 114 BrowserThread::PostTask( |
115 BrowserThread::IO, | 115 BrowserThread::IO, |
116 FROM_HERE, | 116 FROM_HERE, |
117 base::Bind(callback, EntryMetadata(), base::File::FILE_ERROR_ABORT)); | 117 base::Bind(callback, EntryMetadata(), base::File::FILE_ERROR_ABORT)); |
118 return; | 118 return; |
119 } | 119 } |
120 | 120 |
121 abort_callback_ = file_system_->GetMetadata( | 121 abort_callback_ = file_system_->GetMetadata( |
122 file_path_, | 122 file_path_, |
| 123 ProvidedFileSystemInterface::METADATA_FIELD_DEFAULT, |
123 base::Bind(&OperationRunner::OnGetMetadataCompletedOnUIThread, | 124 base::Bind(&OperationRunner::OnGetMetadataCompletedOnUIThread, |
124 this, | 125 this, |
125 callback)); | 126 callback)); |
126 } | 127 } |
127 | 128 |
128 // Aborts the most recent operation (if exists), and calls the callback. | 129 // Aborts the most recent operation (if exists), and calls the callback. |
129 void AbortOnUIThread(const storage::AsyncFileUtil::StatusCallback& callback) { | 130 void AbortOnUIThread(const storage::AsyncFileUtil::StatusCallback& callback) { |
130 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 131 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
131 | 132 |
132 if (abort_callback_.is_null()) { | 133 if (abort_callback_.is_null()) { |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); | 481 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); |
481 return; | 482 return; |
482 } | 483 } |
483 | 484 |
484 DCHECK_EQ(base::File::FILE_OK, result); | 485 DCHECK_EQ(base::File::FILE_OK, result); |
485 callback.Run(metadata.size); | 486 callback.Run(metadata.size); |
486 } | 487 } |
487 | 488 |
488 } // namespace file_system_provider | 489 } // namespace file_system_provider |
489 } // namespace chromeos | 490 } // namespace chromeos |
OLD | NEW |