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

Side by Side Diff: content/common/resource_request_body_impl.cc

Issue 2954343005: Merge ResourceRequestBodyImpl and ResourceRequestBody. (Closed)
Patch Set: Remove comment Created 3 years, 5 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
« no previous file with comments | « content/common/resource_request_body_impl.h ('k') | content/network/url_loader_impl.cc » ('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 2014 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 "content/common/resource_request_body_impl.h"
6
7 #include "base/strings/utf_string_conversions.h"
8 #include "content/common/page_state_serialization.h"
9
10 using blink::WebHTTPBody;
11 using blink::WebString;
12
13 namespace content {
14
15 ResourceRequestBodyImpl::ResourceRequestBodyImpl()
16 : identifier_(0),
17 contains_sensitive_info_(false) {}
18
19 void ResourceRequestBodyImpl::AppendBytes(const char* bytes, int bytes_len) {
20 if (bytes_len > 0) {
21 elements_.push_back(Element());
22 elements_.back().SetToBytes(bytes, bytes_len);
23 }
24 }
25
26 void ResourceRequestBodyImpl::AppendFileRange(
27 const base::FilePath& file_path,
28 uint64_t offset,
29 uint64_t length,
30 const base::Time& expected_modification_time) {
31 elements_.push_back(Element());
32 elements_.back().SetToFilePathRange(file_path, offset, length,
33 expected_modification_time);
34 }
35
36 void ResourceRequestBodyImpl::AppendBlob(const std::string& uuid) {
37 elements_.push_back(Element());
38 elements_.back().SetToBlob(uuid);
39 }
40
41 void ResourceRequestBodyImpl::AppendFileSystemFileRange(
42 const GURL& url,
43 uint64_t offset,
44 uint64_t length,
45 const base::Time& expected_modification_time) {
46 elements_.push_back(Element());
47 elements_.back().SetToFileSystemUrlRange(url, offset, length,
48 expected_modification_time);
49 }
50
51 std::vector<base::FilePath> ResourceRequestBodyImpl::GetReferencedFiles()
52 const {
53 std::vector<base::FilePath> result;
54 for (const auto& element : *elements()) {
55 if (element.type() == Element::TYPE_FILE)
56 result.push_back(element.path());
57 }
58 return result;
59 }
60
61 ResourceRequestBodyImpl::~ResourceRequestBodyImpl() {}
62
63 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_request_body_impl.h ('k') | content/network/url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698