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

Side by Side Diff: content/public/child/fixed_received_data.cc

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Initialise encoded_body_length for sync XHR to data: URLs Created 4 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/public/child/fixed_received_data.h ('k') | content/public/child/request_peer.h » ('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 2015 The Chromium Authors. All rights reserved. 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 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/public/child/fixed_received_data.h" 5 #include "content/public/child/fixed_received_data.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 FixedReceivedData::FixedReceivedData(const char* data, 9 FixedReceivedData::FixedReceivedData(const char* data,
10 size_t length, 10 size_t length,
11 int encoded_length) 11 int encoded_data_length,
12 : data_(data, data + length), encoded_length_(encoded_length) { 12 int encoded_body_length)
13 } 13 : data_(data, data + length),
14 encoded_data_length_(encoded_data_length),
15 encoded_body_length_(encoded_body_length) {}
14 16
15 FixedReceivedData::FixedReceivedData(ReceivedData* data) 17 FixedReceivedData::FixedReceivedData(ReceivedData* data)
16 : FixedReceivedData(data->payload(), 18 : FixedReceivedData(data->payload(),
17 data->length(), 19 data->length(),
18 data->encoded_length()) { 20 data->encoded_data_length(),
19 } 21 data->length()) {}
20 22
21 FixedReceivedData::FixedReceivedData(const std::vector<char>& data, 23 FixedReceivedData::FixedReceivedData(const std::vector<char>& data,
22 int encoded_length) 24 int encoded_data_length,
23 : data_(data), encoded_length_(encoded_length) { 25 int encoded_body_length)
24 } 26 : data_(data),
27 encoded_data_length_(encoded_data_length),
28 encoded_body_length_(encoded_body_length) {}
25 29
26 FixedReceivedData::~FixedReceivedData() { 30 FixedReceivedData::~FixedReceivedData() {
27 } 31 }
28 32
29 const char* FixedReceivedData::payload() const { 33 const char* FixedReceivedData::payload() const {
30 return data_.empty() ? nullptr : &data_[0]; 34 return data_.empty() ? nullptr : &data_[0];
31 } 35 }
32 36
33 int FixedReceivedData::length() const { 37 int FixedReceivedData::length() const {
34 return static_cast<int>(data_.size()); 38 return static_cast<int>(data_.size());
35 } 39 }
36 40
37 int FixedReceivedData::encoded_length() const { 41 int FixedReceivedData::encoded_data_length() const {
38 return encoded_length_; 42 return encoded_data_length_;
43 }
44
45 int FixedReceivedData::encoded_body_length() const {
46 return encoded_body_length_;
39 } 47 }
40 48
41 } // namespace content 49 } // namespace content
OLDNEW
« no previous file with comments | « content/public/child/fixed_received_data.h ('k') | content/public/child/request_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698