Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h

Issue 301973007: [fsp] Fix crash when reading files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_ H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_ H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_ H_ 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_ 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/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::File::Error result); 69 base::File::Error result);
70 70
71 // Called when fetching length of the file is completed with either a success 71 // Called when fetching length of the file is completed with either a success
72 // or an error. 72 // or an error.
73 void OnGetMetadataForGetLengthReceived( 73 void OnGetMetadataForGetLengthReceived(
74 const net::Int64CompletionCallback& callback, 74 const net::Int64CompletionCallback& callback,
75 base::File::Error result, 75 base::File::Error result,
76 const base::File::Info& file_info); 76 const base::File::Info& file_info);
77 77
78 // Same as Read(), but called after initializing is completed. 78 // Same as Read(), but called after initializing is completed.
79 void ReadAfterInitialized(net::IOBuffer* buffer, 79 void ReadAfterInitialized(scoped_refptr<net::IOBuffer> buffer,
80 int buffer_length, 80 int buffer_length,
81 const net::CompletionCallback& callback); 81 const net::CompletionCallback& callback);
82 82
83 // Same as GetLength(), but called after initializing is completed. 83 // Same as GetLength(), but called after initializing is completed.
84 void GetLengthAfterInitialized(const net::Int64CompletionCallback& callback); 84 void GetLengthAfterInitialized(const net::Int64CompletionCallback& callback);
85 85
86 fileapi::FileSystemURL url_; 86 fileapi::FileSystemURL url_;
87 int64 current_offset_; 87 int64 current_offset_;
88 int64 current_length_; 88 int64 current_length_;
89 base::Time expected_modification_time_; 89 base::Time expected_modification_time_;
90 90
91 // Set during initialization (in case of a success). 91 // Set during initialization (in case of a success).
92 base::WeakPtr<ProvidedFileSystemInterface> file_system_; 92 base::WeakPtr<ProvidedFileSystemInterface> file_system_;
93 base::FilePath file_path_; 93 base::FilePath file_path_;
94 int file_handle_; 94 int file_handle_;
95 95
96 base::WeakPtrFactory<FileStreamReader> weak_ptr_factory_; 96 base::WeakPtrFactory<FileStreamReader> weak_ptr_factory_;
97 DISALLOW_COPY_AND_ASSIGN(FileStreamReader); 97 DISALLOW_COPY_AND_ASSIGN(FileStreamReader);
98 }; 98 };
99 99
100 } // namespace file_system_provider 100 } // namespace file_system_provider
101 } // namespace chromeos 101 } // namespace chromeos
102 102
103 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READ ER_H_ 103 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READ ER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698