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

Side by Side Diff: content/child/request_peer.cc

Issue 1103813002: Make WebURLLoader capable of retaining received buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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/public/child/request_peer.h"
jochen (gone - plz use gerrit) 2015/06/01 13:08:28 this file should go into content/public/child
yhirano 2015/06/02 02:08:47 Done.
6
7 namespace content {
8
9 RequestPeer::FixedReceivedData::FixedReceivedData(const char* data,
10 size_t length,
11 int encoded_length)
12 : data_(data, data + length), encoded_length_(encoded_length) {
13 }
14
15 RequestPeer::FixedReceivedData::FixedReceivedData(
16 scoped_ptr<RequestPeer::ReceivedData> data)
17 : FixedReceivedData(data->payload(),
18 data->encoded_length(),
19 data->encoded_length()) {
20 }
21
22 RequestPeer::FixedReceivedData::FixedReceivedData(const std::vector<char>& data,
23 int encoded_length)
24 : data_(data), encoded_length_(encoded_length) {
25 }
26
27 RequestPeer::FixedReceivedData::~FixedReceivedData() {
28 }
29
30 const char* RequestPeer::FixedReceivedData::payload() const {
31 return data_.empty() ? nullptr : &data_[0];
32 }
33
34 int RequestPeer::FixedReceivedData::length() const {
35 return data_.size();
36 }
37
38 int RequestPeer::FixedReceivedData::encoded_length() const {
39 return encoded_length_;
40 }
41
42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698