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

Side by Side Diff: chrome/renderer/security_filter_peer.cc

Issue 2835123005: Send the decoded size when response completed and stop summing in ResourceLoader::DidReceiveData() (Closed)
Patch Set: Created 3 years, 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/security_filter_peer.h" 5 #include "chrome/renderer/security_filter_peer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void ReplaceContentPeer::OnReceivedData(std::unique_ptr<ReceivedData> data) { 135 void ReplaceContentPeer::OnReceivedData(std::unique_ptr<ReceivedData> data) {
136 // Ignore this, we'll serve some alternate content in OnCompletedRequest. 136 // Ignore this, we'll serve some alternate content in OnCompletedRequest.
137 } 137 }
138 138
139 void ReplaceContentPeer::OnCompletedRequest( 139 void ReplaceContentPeer::OnCompletedRequest(
140 int error_code, 140 int error_code,
141 bool was_ignored_by_handler, 141 bool was_ignored_by_handler,
142 bool stale_copy_in_cache, 142 bool stale_copy_in_cache,
143 const base::TimeTicks& completion_time, 143 const base::TimeTicks& completion_time,
144 int64_t total_transfer_size, 144 int64_t total_transfer_size,
145 int64_t encoded_body_size) { 145 int64_t encoded_body_size,
146 int64_t decoded_body_size) {
146 content::ResourceResponseInfo info; 147 content::ResourceResponseInfo info;
147 ProcessResponseInfo(info, &info, mime_type_); 148 ProcessResponseInfo(info, &info, mime_type_);
148 info.content_length = static_cast<int>(data_.size()); 149 info.content_length = static_cast<int>(data_.size());
149 original_peer_->OnReceivedResponse(info); 150 original_peer_->OnReceivedResponse(info);
150 if (!data_.empty()) { 151 if (!data_.empty()) {
151 original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>( 152 original_peer_->OnReceivedData(base::MakeUnique<content::FixedReceivedData>(
152 data_.data(), data_.size())); 153 data_.data(), data_.size()));
153 } 154 }
154 original_peer_->OnCompletedRequest(net::OK, false, stale_copy_in_cache, 155 original_peer_->OnCompletedRequest(net::OK, false, stale_copy_in_cache,
155 completion_time, total_transfer_size, 156 completion_time, total_transfer_size,
156 encoded_body_size); 157 encoded_body_size, decoded_body_size);
157 } 158 }
OLDNEW
« no previous file with comments | « chrome/renderer/security_filter_peer.h ('k') | content/browser/loader/async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698