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

Side by Side Diff: third_party/WebKit/Source/core/loader/PingLoader.cpp

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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 DECLARE_VIRTUAL_TRACE(); 204 DECLARE_VIRTUAL_TRACE();
205 205
206 private: 206 private:
207 void Dispose(); 207 void Dispose();
208 208
209 // WebURLLoaderClient 209 // WebURLLoaderClient
210 bool WillFollowRedirect(WebURLRequest&, const WebURLResponse&) override; 210 bool WillFollowRedirect(WebURLRequest&, const WebURLResponse&) override;
211 void DidReceiveResponse(const WebURLResponse&) final; 211 void DidReceiveResponse(const WebURLResponse&) final;
212 void DidReceiveData(const char*, int) final; 212 void DidReceiveData(const char*, int) final;
213 void DidFinishLoading(double, int64_t, int64_t encoded_data_length) final; 213 void DidFinishLoading(double,
214 void DidFail(const WebURLError&, int64_t, int64_t encoded_data_length) final; 214 int64_t encoded_data_length,
215 int64_t encoded_body_length,
216 int64_t decoded_body_length) final;
217 void DidFail(const WebURLError&,
218 int64_t encoded_data_length,
219 int64_t encoded_body_length,
220 int64_t decoded_body_length) final;
215 221
216 void Timeout(TimerBase*); 222 void Timeout(TimerBase*);
217 223
218 void DidFailLoading(LocalFrame*); 224 void DidFailLoading(LocalFrame*);
219 225
220 std::unique_ptr<WebURLLoader> loader_; 226 std::unique_ptr<WebURLLoader> loader_;
221 Timer<PingLoaderImpl> timeout_; 227 Timer<PingLoaderImpl> timeout_;
222 String url_; 228 String url_;
223 unsigned long identifier_; 229 unsigned long identifier_;
224 SelfKeepAlive<PingLoaderImpl> keep_alive_; 230 SelfKeepAlive<PingLoaderImpl> keep_alive_;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 Dispose(); 360 Dispose();
355 } 361 }
356 362
357 void PingLoaderImpl::DidReceiveData(const char*, int data_length) { 363 void PingLoaderImpl::DidReceiveData(const char*, int data_length) {
358 if (GetFrame()) 364 if (GetFrame())
359 DidFailLoading(GetFrame()); 365 DidFailLoading(GetFrame());
360 Dispose(); 366 Dispose();
361 } 367 }
362 368
363 void PingLoaderImpl::DidFinishLoading(double, 369 void PingLoaderImpl::DidFinishLoading(double,
364 int64_t, 370 int64_t encoded_data_length,
365 int64_t encoded_data_length) { 371 int64_t encoded_body_length,
372 int64_t decoded_body_length) {
366 if (GetFrame()) 373 if (GetFrame())
367 DidFailLoading(GetFrame()); 374 DidFailLoading(GetFrame());
368 Dispose(); 375 Dispose();
369 } 376 }
370 377
371 void PingLoaderImpl::DidFail(const WebURLError& resource_error, 378 void PingLoaderImpl::DidFail(const WebURLError& resource_error,
372 int64_t, 379 int64_t encoded_data_length,
373 int64_t encoded_data_length) { 380 int64_t encoded_body_length,
381 int64_t decoded_body_length) {
374 if (GetFrame()) 382 if (GetFrame())
375 DidFailLoading(GetFrame()); 383 DidFailLoading(GetFrame());
376 Dispose(); 384 Dispose();
377 } 385 }
378 386
379 void PingLoaderImpl::Timeout(TimerBase*) { 387 void PingLoaderImpl::Timeout(TimerBase*) {
380 if (GetFrame()) 388 if (GetFrame())
381 DidFailLoading(GetFrame()); 389 DidFailLoading(GetFrame());
382 Dispose(); 390 Dispose();
383 } 391 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 bool PingLoader::SendBeacon(LocalFrame* frame, 590 bool PingLoader::SendBeacon(LocalFrame* frame,
583 int allowance, 591 int allowance,
584 const KURL& beacon_url, 592 const KURL& beacon_url,
585 Blob* data, 593 Blob* data,
586 size_t& beacon_size) { 594 size_t& beacon_size) {
587 BeaconBlob beacon(data); 595 BeaconBlob beacon(data);
588 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size); 596 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size);
589 } 597 }
590 598
591 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/fetchers/resource_fetcher_impl.cc ('k') | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698