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

Side by Side Diff: storage/browser/blob/upload_blob_element_reader.h

Issue 1376123002: Revert of [Blob] BlobReader class & tests, and removal of all redundant reading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef STORAGE_BROWSER_BLOB_UPLOAD_BLOB_ELEMENT_READER_H_
6 #define STORAGE_BROWSER_BLOB_UPLOAD_BLOB_ELEMENT_READER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/completion_callback.h"
11 #include "net/base/upload_element_reader.h"
12 #include "storage/browser/storage_browser_export.h"
13
14 namespace net {
15 class IOBuffer;
16 }
17
18 namespace storage {
19 class BlobDataHandle;
20 class BlobReader;
21
22 // This class is a wrapper around the BlobReader to make it conform
23 // to the net::UploadElementReader interface, and it also holds around the
24 // handle to the blob so it stays in memory while we read it.
25 class STORAGE_EXPORT UploadBlobElementReader
26 : NON_EXPORTED_BASE(public net::UploadElementReader) {
27 public:
28 UploadBlobElementReader(scoped_ptr<BlobReader> reader,
29 scoped_ptr<BlobDataHandle> handle);
30 ~UploadBlobElementReader() override;
31
32 int Init(const net::CompletionCallback& callback) override;
33
34 uint64_t GetContentLength() const override;
35
36 uint64_t BytesRemaining() const override;
37
38 bool IsInMemory() const override;
39
40 int Read(net::IOBuffer* buf,
41 int buf_length,
42 const net::CompletionCallback& callback) override;
43
44 const std::string& uuid() const;
45
46 private:
47 scoped_ptr<BlobReader> reader_;
48 scoped_ptr<BlobDataHandle> handle_;
49
50 DISALLOW_COPY_AND_ASSIGN(UploadBlobElementReader);
51 };
52
53 } // namespace storage
54 #endif // STORAGE_BROWSER_BLOB_UPLOAD_BLOB_ELEMENT_READER_H_
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_url_request_job_factory.cc ('k') | storage/browser/blob/upload_blob_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698