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

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

Issue 1476443002: Remove ScopedVector from ElementsUploadDataStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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_DATA_STREAM_H_ 5 #ifndef NET_BASE_UPLOAD_DATA_STREAM_H_
6 #define NET_BASE_UPLOAD_DATA_STREAM_H_ 6 #define NET_BASE_UPLOAD_DATA_STREAM_H_
7 7
8 #include <vector>
9
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_vector.h"
11 #include "net/base/completion_callback.h" 12 #include "net/base/completion_callback.h"
12 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
13 14
14 namespace net { 15 namespace net {
15 16
16 class DrainableIOBuffer; 17 class DrainableIOBuffer;
17 class IOBuffer; 18 class IOBuffer;
18 class UploadElementReader; 19 class UploadElementReader;
19 20
20 // A class for retrieving all data to be sent as a request body. Supports both 21 // A class for retrieving all data to be sent as a request body. Supports both
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // being read to is not safe for future use, as it may be in use on another 80 // being read to is not safe for future use, as it may be in use on another
80 // thread. 81 // thread.
81 void Reset(); 82 void Reset();
82 83
83 // Returns true if the upload data in the stream is entirely in memory, and 84 // Returns true if the upload data in the stream is entirely in memory, and
84 // all read requests will succeed synchronously. Expected to return false for 85 // all read requests will succeed synchronously. Expected to return false for
85 // chunked requests. 86 // chunked requests.
86 virtual bool IsInMemory() const; 87 virtual bool IsInMemory() const;
87 88
88 // Returns a list of element readers owned by |this|, if it has any. 89 // Returns a list of element readers owned by |this|, if it has any.
89 virtual const ScopedVector<UploadElementReader>* 90 virtual const std::vector<scoped_ptr<UploadElementReader>>*
mmenke 2015/11/24 17:25:08 include scoped_ptr
90 GetElementReaders() const; 91 GetElementReaders() const;
91 92
92 protected: 93 protected:
93 // Must be called by subclasses when InitInternal and ReadInternal complete 94 // Must be called by subclasses when InitInternal and ReadInternal complete
94 // asynchronously. 95 // asynchronously.
95 void OnInitCompleted(int result); 96 void OnInitCompleted(int result);
96 void OnReadCompleted(int result); 97 void OnReadCompleted(int result);
97 98
98 // Must be called before InitInternal completes, for non-chunked uploads. 99 // Must be called before InitInternal completes, for non-chunked uploads.
99 // Must not be called for chunked uploads. 100 // Must not be called for chunked uploads.
100 void SetSize(uint64_t size); 101 void SetSize(uint64_t size);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool is_eof_; 135 bool is_eof_;
135 136
136 CompletionCallback callback_; 137 CompletionCallback callback_;
137 138
138 DISALLOW_COPY_AND_ASSIGN(UploadDataStream); 139 DISALLOW_COPY_AND_ASSIGN(UploadDataStream);
139 }; 140 };
140 141
141 } // namespace net 142 } // namespace net
142 143
143 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_ 144 #endif // NET_BASE_UPLOAD_DATA_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698