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

Side by Side Diff: content/common/resource_request_body.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.h ('k') | content/common/resource_request_body_impl.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 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.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 ResourceRequestBody::ResourceRequestBody()
16 : identifier_(0) {
17 }
18
19 void ResourceRequestBody::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 ResourceRequestBody::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 ResourceRequestBody::AppendBlob(const std::string& uuid) {
37 elements_.push_back(Element());
38 elements_.back().SetToBlob(uuid);
39 }
40
41 void ResourceRequestBody::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 ResourceRequestBody::~ResourceRequestBody() {
52 }
53
54 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_request_body.h ('k') | content/common/resource_request_body_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698