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

Side by Side Diff: content/renderer/fetchers/resource_fetcher_impl.cc

Issue 2835123005: Send the decoded size when response completed and stop summing in ResourceLoader::DidReceiveData() (Closed)
Patch Set: Created 3 years, 8 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 "content/renderer/fetchers/resource_fetcher_impl.h" 5 #include "content/renderer/fetchers/resource_fetcher_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DCHECK_GT(data_length, 0); 82 DCHECK_GT(data_length, 0);
83 } 83 }
84 void DidReceiveData(const char* data, int data_length) override { 84 void DidReceiveData(const char* data, int data_length) override {
85 DCHECK(!completed_); 85 DCHECK(!completed_);
86 DCHECK_GT(data_length, 0); 86 DCHECK_GT(data_length, 0);
87 87
88 data_.append(data, data_length); 88 data_.append(data, data_length);
89 } 89 }
90 void DidFinishLoading(double finishTime, 90 void DidFinishLoading(double finishTime,
91 int64_t total_encoded_data_length, 91 int64_t total_encoded_data_length,
92 int64_t total_encoded_body_length) override { 92 int64_t total_encoded_body_length,
93 int64_t total_decoded_body_length) override {
93 DCHECK(!completed_); 94 DCHECK(!completed_);
94 95
95 OnLoadCompleteInternal(LOAD_SUCCEEDED); 96 OnLoadCompleteInternal(LOAD_SUCCEEDED);
96 } 97 }
97 void DidFail(const blink::WebURLError& error, 98 void DidFail(const blink::WebURLError& error,
98 int64_t total_encoded_data_length, 99 int64_t total_encoded_data_length,
99 int64_t total_encoded_body_length) override { 100 int64_t total_encoded_body_length,
101 int64_t total_decoded_body_length) override {
100 OnLoadCompleteInternal(LOAD_FAILED); 102 OnLoadCompleteInternal(LOAD_FAILED);
101 } 103 }
102 104
103 private: 105 private:
104 ResourceFetcherImpl* parent_; 106 ResourceFetcherImpl* parent_;
105 107
106 // Set to true once the request is complete. 108 // Set to true once the request is complete.
107 bool completed_; 109 bool completed_;
108 110
109 // Buffer to hold the content from the server. 111 // Buffer to hold the content from the server.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void ResourceFetcherImpl::OnLoadComplete() { 204 void ResourceFetcherImpl::OnLoadComplete() {
203 timeout_timer_.Stop(); 205 timeout_timer_.Stop();
204 } 206 }
205 207
206 void ResourceFetcherImpl::Cancel() { 208 void ResourceFetcherImpl::Cancel() {
207 loader_->Cancel(); 209 loader_->Cancel();
208 client_->Cancel(); 210 client_->Cancel();
209 } 211 }
210 212
211 } // namespace content 213 } // namespace content
OLDNEW
« no previous file with comments | « content/public/child/request_peer.h ('k') | third_party/WebKit/Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698