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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Note that when crbug.com/225339 is resolved, this class will be also | 31 // Note that when crbug.com/225339 is resolved, this class will be also |
32 // initialized explicitly. | 32 // initialized explicitly. |
33 class WebkitFileStreamReaderImpl : public storage::FileStreamReader { | 33 class WebkitFileStreamReaderImpl : public storage::FileStreamReader { |
34 public: | 34 public: |
35 WebkitFileStreamReaderImpl( | 35 WebkitFileStreamReaderImpl( |
36 const DriveFileStreamReader::FileSystemGetter& file_system_getter, | 36 const DriveFileStreamReader::FileSystemGetter& file_system_getter, |
37 base::SequencedTaskRunner* file_task_runner, | 37 base::SequencedTaskRunner* file_task_runner, |
38 const base::FilePath& drive_file_path, | 38 const base::FilePath& drive_file_path, |
39 int64 offset, | 39 int64 offset, |
40 const base::Time& expected_modification_time); | 40 const base::Time& expected_modification_time); |
41 virtual ~WebkitFileStreamReaderImpl(); | 41 ~WebkitFileStreamReaderImpl() override; |
42 | 42 |
43 // storage::FileStreamReader override. | 43 // storage::FileStreamReader override. |
44 virtual int Read(net::IOBuffer* buffer, | 44 int Read(net::IOBuffer* buffer, |
45 int buffer_length, | 45 int buffer_length, |
46 const net::CompletionCallback& callback) override; | 46 const net::CompletionCallback& callback) override; |
47 virtual int64 GetLength(const net::Int64CompletionCallback& callback) | 47 int64 GetLength(const net::Int64CompletionCallback& callback) override; |
48 override; | |
49 | 48 |
50 private: | 49 private: |
51 // Called upon the initialization completion of |stream_reader_|. | 50 // Called upon the initialization completion of |stream_reader_|. |
52 // Processes the result of the initialization with checking last | 51 // Processes the result of the initialization with checking last |
53 // modified time, and calls |callback| with net::Error code as its result. | 52 // modified time, and calls |callback| with net::Error code as its result. |
54 void OnStreamReaderInitialized( | 53 void OnStreamReaderInitialized( |
55 const net::CompletionCallback& callback, | 54 const net::CompletionCallback& callback, |
56 int error, | 55 int error, |
57 scoped_ptr<ResourceEntry> entry); | 56 scoped_ptr<ResourceEntry> entry); |
58 | 57 |
(...skipping 21 matching lines...) Expand all Loading... |
80 // This should remain the last member so it'll be destroyed first and | 79 // This should remain the last member so it'll be destroyed first and |
81 // invalidate its weak pointers before other members are destroyed. | 80 // invalidate its weak pointers before other members are destroyed. |
82 base::WeakPtrFactory<WebkitFileStreamReaderImpl> weak_ptr_factory_; | 81 base::WeakPtrFactory<WebkitFileStreamReaderImpl> weak_ptr_factory_; |
83 DISALLOW_COPY_AND_ASSIGN(WebkitFileStreamReaderImpl); | 82 DISALLOW_COPY_AND_ASSIGN(WebkitFileStreamReaderImpl); |
84 }; | 83 }; |
85 | 84 |
86 } // namespace internal | 85 } // namespace internal |
87 } // namespace drive | 86 } // namespace drive |
88 | 87 |
89 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_
H_ | 88 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_WEBKIT_FILE_STREAM_READER_IMPL_
H_ |
OLD | NEW |