OLD | NEW |
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 #include "net/base/upload_data_stream.h" | 5 #include "net/base/upload_data_stream.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 DCHECK(initialized_successfully_); | 81 DCHECK(initialized_successfully_); |
82 DCHECK(is_chunked_); | 82 DCHECK(is_chunked_); |
83 DCHECK(!is_eof_); | 83 DCHECK(!is_eof_); |
84 is_eof_ = true; | 84 is_eof_ = true; |
85 } | 85 } |
86 | 86 |
87 bool UploadDataStream::IsInMemory() const { | 87 bool UploadDataStream::IsInMemory() const { |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 const ScopedVector<UploadElementReader>* | 91 const std::vector<scoped_ptr<UploadElementReader>>* |
92 UploadDataStream::GetElementReaders() const { | 92 UploadDataStream::GetElementReaders() const { |
93 return NULL; | 93 return NULL; |
94 } | 94 } |
95 | 95 |
96 void UploadDataStream::OnInitCompleted(int result) { | 96 void UploadDataStream::OnInitCompleted(int result) { |
97 DCHECK_NE(ERR_IO_PENDING, result); | 97 DCHECK_NE(ERR_IO_PENDING, result); |
98 DCHECK(!initialized_successfully_); | 98 DCHECK(!initialized_successfully_); |
99 DCHECK_EQ(0u, current_position_); | 99 DCHECK_EQ(0u, current_position_); |
100 DCHECK(!is_eof_); | 100 DCHECK(!is_eof_); |
101 | 101 |
(...skipping 17 matching lines...) Expand all Loading... |
119 is_eof_ = true; | 119 is_eof_ = true; |
120 } | 120 } |
121 | 121 |
122 DCHECK(result > 0 || is_eof_); | 122 DCHECK(result > 0 || is_eof_); |
123 | 123 |
124 if (!callback_.is_null()) | 124 if (!callback_.is_null()) |
125 base::ResetAndReturn(&callback_).Run(result); | 125 base::ResetAndReturn(&callback_).Run(result); |
126 } | 126 } |
127 | 127 |
128 } // namespace net | 128 } // namespace net |
OLD | NEW |