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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 callback.Run(base::WeakPtr<ProvidedFileSystemInterface>(), | 42 callback.Run(base::WeakPtr<ProvidedFileSystemInterface>(), |
43 base::FilePath(), | 43 base::FilePath(), |
44 0 /* file_handle */, | 44 0 /* file_handle */, |
45 base::File::FILE_ERROR_SECURITY); | 45 base::File::FILE_ERROR_SECURITY); |
46 return; | 46 return; |
47 } | 47 } |
48 | 48 |
49 parser.file_system()->OpenFile( | 49 parser.file_system()->OpenFile( |
50 parser.file_path(), | 50 parser.file_path(), |
51 ProvidedFileSystemInterface::OPEN_FILE_MODE_READ, | 51 ProvidedFileSystemInterface::OPEN_FILE_MODE_READ, |
52 false /* create */, | |
53 base::Bind( | 52 base::Bind( |
54 callback, parser.file_system()->GetWeakPtr(), parser.file_path())); | 53 callback, parser.file_system()->GetWeakPtr(), parser.file_path())); |
55 } | 54 } |
56 | 55 |
57 // Forwards results of calling OpenFileOnUIThread back to the IO thread. | 56 // Forwards results of calling OpenFileOnUIThread back to the IO thread. |
58 void OnOpenFileCompletedOnUIThread( | 57 void OnOpenFileCompletedOnUIThread( |
59 const FileStreamReader::OpenFileCompletedCallback& callback, | 58 const FileStreamReader::OpenFileCompletedCallback& callback, |
60 base::WeakPtr<ProvidedFileSystemInterface> file_system, | 59 base::WeakPtr<ProvidedFileSystemInterface> file_system, |
61 const base::FilePath& file_path, | 60 const base::FilePath& file_path, |
62 int file_handle, | 61 int file_handle, |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); | 422 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); |
424 return; | 423 return; |
425 } | 424 } |
426 | 425 |
427 DCHECK_EQ(base::File::FILE_OK, result); | 426 DCHECK_EQ(base::File::FILE_OK, result); |
428 callback.Run(metadata.size); | 427 callback.Run(metadata.size); |
429 } | 428 } |
430 | 429 |
431 } // namespace file_system_provider | 430 } // namespace file_system_provider |
432 } // namespace chromeos | 431 } // namespace chromeos |
OLD | NEW |