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

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

Issue 2519843002: Update ResourceResponse::encodedDataLength when response is completed (Closed)
Patch Set: Update ResourceResponse::encodedDataLength when response is completed Created 4 years, 1 month 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 data_.append(data, data_length); 94 data_.append(data, data_length);
95 } 95 }
96 void didFinishLoading(blink::WebURLLoader* loader, 96 void didFinishLoading(blink::WebURLLoader* loader,
97 double finishTime, 97 double finishTime,
98 int64_t total_encoded_data_length) override { 98 int64_t total_encoded_data_length) override {
99 DCHECK(!completed_); 99 DCHECK(!completed_);
100 100
101 OnLoadCompleteInternal(LOAD_SUCCEEDED); 101 OnLoadCompleteInternal(LOAD_SUCCEEDED);
102 } 102 }
103 void didFail(blink::WebURLLoader* loader, 103 void didFail(blink::WebURLLoader* loader,
104 const blink::WebURLError& error) override { 104 const blink::WebURLError& error,
105 int64_t total_encoded_data_length) override {
105 OnLoadCompleteInternal(LOAD_FAILED); 106 OnLoadCompleteInternal(LOAD_FAILED);
106 } 107 }
107 108
108 private: 109 private:
109 ResourceFetcherImpl* parent_; 110 ResourceFetcherImpl* parent_;
110 111
111 // Set to true once the request is complete. 112 // Set to true once the request is complete.
112 bool completed_; 113 bool completed_;
113 114
114 // Buffer to hold the content from the server. 115 // Buffer to hold the content from the server.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 void ResourceFetcherImpl::OnLoadComplete() { 211 void ResourceFetcherImpl::OnLoadComplete() {
211 timeout_timer_.Stop(); 212 timeout_timer_.Stop();
212 } 213 }
213 214
214 void ResourceFetcherImpl::Cancel() { 215 void ResourceFetcherImpl::Cancel() {
215 loader_->cancel(); 216 loader_->cancel();
216 client_->Cancel(); 217 client_->Cancel();
217 } 218 }
218 219
219 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl_unittest.cc ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698