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

Side by Side Diff: net/base/upload_bytes_element_reader.h

Issue 11419034: net: Move ownership of UploadDataStream from URLRequestHttpJob to URLRequest (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove a local variable Created 8 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ 5 #ifndef NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_
6 #define NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ 6 #define NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "net/base/upload_element_reader.h" 9 #include "net/base/upload_element_reader.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 // An UploadElementReader implementation for bytes. 13 // An UploadElementReader implementation for bytes.
14 class NET_EXPORT_PRIVATE UploadBytesElementReader : public UploadElementReader { 14 class NET_EXPORT_PRIVATE UploadBytesElementReader : public UploadElementReader {
15 public: 15 public:
16 UploadBytesElementReader(const char* bytes, int bytes_length); 16 UploadBytesElementReader(const char* bytes, int length);
17 virtual ~UploadBytesElementReader(); 17 virtual ~UploadBytesElementReader();
18 18
19 const char* bytes() const { return bytes_; }
20 int length() const { return length_; }
21
19 // UploadElementReader overrides: 22 // UploadElementReader overrides:
23 virtual const UploadBytesElementReader* AsBytesReader() const OVERRIDE;
20 virtual int Init(const CompletionCallback& callback) OVERRIDE; 24 virtual int Init(const CompletionCallback& callback) OVERRIDE;
21 virtual int InitSync() OVERRIDE; 25 virtual int InitSync() OVERRIDE;
22 virtual uint64 GetContentLength() const OVERRIDE; 26 virtual uint64 GetContentLength() const OVERRIDE;
23 virtual uint64 BytesRemaining() const OVERRIDE; 27 virtual uint64 BytesRemaining() const OVERRIDE;
24 virtual bool IsInMemory() const OVERRIDE; 28 virtual bool IsInMemory() const OVERRIDE;
25 virtual int Read(IOBuffer* buf, 29 virtual int Read(IOBuffer* buf,
26 int buf_length, 30 int buf_length,
27 const CompletionCallback& callback) OVERRIDE; 31 const CompletionCallback& callback) OVERRIDE;
28 virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE; 32 virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE;
29 33
30 private: 34 private:
31 const char* const bytes_; 35 const char* const bytes_;
32 const int bytes_length_; 36 const int length_;
33 int offset_; 37 int offset_;
34 38
35 DISALLOW_COPY_AND_ASSIGN(UploadBytesElementReader); 39 DISALLOW_COPY_AND_ASSIGN(UploadBytesElementReader);
36 }; 40 };
37 41
38 } // namespace net 42 } // namespace net
39 43
40 #endif // NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_ 44 #endif // NET_BASE_UPLOAD_BYTES_ELEMENT_READER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/better_session_restore_browsertest.cc ('k') | net/base/upload_bytes_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698