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

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

Issue 10868064: net: Move data reading functionalities from UploadElement to UploadElementReader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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_element_reader.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_element_reader.h"
6
7 #include "base/logging.h"
8 #include "net/base/upload_bytes_element_reader.h"
9 #include "net/base/upload_element.h"
10 #include "net/base/upload_file_element_reader.h"
11
12 namespace net {
13
14 // static
15 UploadElementReader* UploadElementReader::Create(const UploadElement& element) {
16 UploadElementReader* reader = NULL;
17 switch (element.type()) {
18 case UploadElement::TYPE_BYTES:
19 reader = new UploadBytesElementReader(element.bytes(),
20 element.bytes_length());
21 break;
22 case UploadElement::TYPE_FILE:
23 reader = new UploadFileElementReader(
24 element.file_path(),
25 element.file_range_offset(),
26 element.file_range_length(),
27 element.expected_file_modification_time());
28 break;
29 }
30 DCHECK(reader);
31 return reader;
32 }
33
34 bool UploadElementReader::IsInMemory() const {
35 return false;
36 }
37
38 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_element_reader.h ('k') | net/base/upload_file_element_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698