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

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

Issue 2038813003: Making ResourceRequestBody part of //content's public API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 4 years, 6 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/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "content/common/resource_request_body.h" 5 #include "content/common/resource_request_body_impl.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/common/page_state_serialization.h" 8 #include "content/common/page_state_serialization.h"
9 9
10 using blink::WebHTTPBody; 10 using blink::WebHTTPBody;
11 using blink::WebString; 11 using blink::WebString;
12 12
13 namespace content { 13 namespace content {
14 14
15 ResourceRequestBody::ResourceRequestBody() 15 ResourceRequestBodyImpl::ResourceRequestBodyImpl() : identifier_(0) {}
16 : identifier_(0) {
17 }
18 16
19 void ResourceRequestBody::AppendBytes(const char* bytes, int bytes_len) { 17 void ResourceRequestBodyImpl::AppendBytes(const char* bytes, int bytes_len) {
20 if (bytes_len > 0) { 18 if (bytes_len > 0) {
21 elements_.push_back(Element()); 19 elements_.push_back(Element());
22 elements_.back().SetToBytes(bytes, bytes_len); 20 elements_.back().SetToBytes(bytes, bytes_len);
23 } 21 }
24 } 22 }
25 23
26 void ResourceRequestBody::AppendFileRange( 24 void ResourceRequestBodyImpl::AppendFileRange(
27 const base::FilePath& file_path, 25 const base::FilePath& file_path,
28 uint64_t offset, 26 uint64_t offset,
29 uint64_t length, 27 uint64_t length,
30 const base::Time& expected_modification_time) { 28 const base::Time& expected_modification_time) {
31 elements_.push_back(Element()); 29 elements_.push_back(Element());
32 elements_.back().SetToFilePathRange(file_path, offset, length, 30 elements_.back().SetToFilePathRange(file_path, offset, length,
33 expected_modification_time); 31 expected_modification_time);
34 } 32 }
35 33
36 void ResourceRequestBody::AppendBlob(const std::string& uuid) { 34 void ResourceRequestBodyImpl::AppendBlob(const std::string& uuid) {
37 elements_.push_back(Element()); 35 elements_.push_back(Element());
38 elements_.back().SetToBlob(uuid); 36 elements_.back().SetToBlob(uuid);
39 } 37 }
40 38
41 void ResourceRequestBody::AppendFileSystemFileRange( 39 void ResourceRequestBodyImpl::AppendFileSystemFileRange(
42 const GURL& url, 40 const GURL& url,
43 uint64_t offset, 41 uint64_t offset,
44 uint64_t length, 42 uint64_t length,
45 const base::Time& expected_modification_time) { 43 const base::Time& expected_modification_time) {
46 elements_.push_back(Element()); 44 elements_.push_back(Element());
47 elements_.back().SetToFileSystemUrlRange(url, offset, length, 45 elements_.back().SetToFileSystemUrlRange(url, offset, length,
48 expected_modification_time); 46 expected_modification_time);
49 } 47 }
50 48
51 ResourceRequestBody::~ResourceRequestBody() { 49 ResourceRequestBodyImpl::~ResourceRequestBodyImpl() {}
52 }
53 50
54 } // namespace content 51 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_request_body_impl.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698