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

Side by Side Diff: chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h

Issue 1550593002: Switch to standard integer types in chrome/browser/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
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_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H_
7 7
8 #include <stdint.h>
9
8 #include <queue> 10 #include <queue>
9 11
12 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
11 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
12 #include "storage/browser/fileapi/file_stream_reader.h" 15 #include "storage/browser/fileapi/file_stream_reader.h"
13 16
14 // Wraps a source FileStreamReader with a readahead buffer. 17 // Wraps a source FileStreamReader with a readahead buffer.
15 class ReadaheadFileStreamReader 18 class ReadaheadFileStreamReader
16 : public NON_EXPORTED_BASE(storage::FileStreamReader) { 19 : public NON_EXPORTED_BASE(storage::FileStreamReader) {
17 public: 20 public:
18 // Takes ownership of |source|. 21 // Takes ownership of |source|.
19 explicit ReadaheadFileStreamReader(storage::FileStreamReader* source); 22 explicit ReadaheadFileStreamReader(storage::FileStreamReader* source);
20 23
21 ~ReadaheadFileStreamReader() override; 24 ~ReadaheadFileStreamReader() override;
22 25
23 // FileStreamReader overrides. 26 // FileStreamReader overrides.
24 int Read(net::IOBuffer* buf, 27 int Read(net::IOBuffer* buf,
25 int buf_len, 28 int buf_len,
26 const net::CompletionCallback& callback) override; 29 const net::CompletionCallback& callback) override;
27 int64 GetLength(const net::Int64CompletionCallback& callback) override; 30 int64_t GetLength(const net::Int64CompletionCallback& callback) override;
28 31
29 private: 32 private:
30 // Returns the number of bytes consumed from the internal cache into |sink|. 33 // Returns the number of bytes consumed from the internal cache into |sink|.
31 // Returns an error code if we are out of cache, hit an error, or hit EOF. 34 // Returns an error code if we are out of cache, hit an error, or hit EOF.
32 int FinishReadFromCacheOrStoredError(net::DrainableIOBuffer* sink); 35 int FinishReadFromCacheOrStoredError(net::DrainableIOBuffer* sink);
33 36
34 // Reads into a new buffer from the source reader. This calls 37 // Reads into a new buffer from the source reader. This calls
35 // OnFinishReadFromSource when it completes (either synchronously or 38 // OnFinishReadFromSource when it completes (either synchronously or
36 // asynchronously). 39 // asynchronously).
37 void ReadFromSourceIfNeeded(); 40 void ReadFromSourceIfNeeded();
(...skipping 15 matching lines...) Expand all
53 // reading and fill the cache. 56 // reading and fill the cache.
54 scoped_refptr<net::DrainableIOBuffer> pending_sink_buffer_; 57 scoped_refptr<net::DrainableIOBuffer> pending_sink_buffer_;
55 net::CompletionCallback pending_read_callback_; 58 net::CompletionCallback pending_read_callback_;
56 59
57 base::WeakPtrFactory<ReadaheadFileStreamReader> weak_factory_; 60 base::WeakPtrFactory<ReadaheadFileStreamReader> weak_factory_;
58 61
59 DISALLOW_COPY_AND_ASSIGN(ReadaheadFileStreamReader); 62 DISALLOW_COPY_AND_ASSIGN(ReadaheadFileStreamReader);
60 }; 63 };
61 64
62 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H _ 65 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_READAHEAD_FILE_STREAM_READER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698