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

Side by Side Diff: net/base/upload_data.cc

Issue 140733002: Revert 244982 "Revert 244857 "net: Remove classes which were use..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: rebase Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/base/upload_data.h ('k') | net/base/upload_file_element_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/base/upload_data.h"
6
7 #include "base/logging.h"
8
9 namespace net {
10
11 UploadData::UploadData()
12 : identifier_(0),
13 is_chunked_(false),
14 last_chunk_appended_(false) {
15 }
16
17 void UploadData::AppendBytes(const char* bytes, int bytes_len) {
18 DCHECK(!is_chunked_);
19 if (bytes_len > 0) {
20 elements_.push_back(new UploadElement());
21 elements_.back()->SetToBytes(bytes, bytes_len);
22 }
23 }
24
25 void UploadData::AppendFileRange(const base::FilePath& file_path,
26 uint64 offset, uint64 length,
27 const base::Time& expected_modification_time) {
28 DCHECK(!is_chunked_);
29 elements_.push_back(new UploadElement());
30 elements_.back()->SetToFilePathRange(file_path, offset, length,
31 expected_modification_time);
32 }
33
34 UploadData::~UploadData() {
35 }
36
37 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_data.h ('k') | net/base/upload_file_element_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698