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

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

Issue 2519843002: Update ResourceResponse::encodedDataLength when response is completed (Closed)
Patch Set: Update ResourceResponse::encodedDataLength when response is completed Created 4 years 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 private: 205 private:
206 void dispose(); 206 void dispose();
207 207
208 // WebURLLoaderClient 208 // WebURLLoaderClient
209 bool willFollowRedirect(WebURLLoader*, 209 bool willFollowRedirect(WebURLLoader*,
210 WebURLRequest&, 210 WebURLRequest&,
211 const WebURLResponse&) override; 211 const WebURLResponse&) override;
212 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final; 212 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) final;
213 void didReceiveData(WebURLLoader*, const char*, int, int, int) final; 213 void didReceiveData(WebURLLoader*, const char*, int, int, int) final;
214 void didFinishLoading(WebURLLoader*, double, int64_t) final; 214 void didFinishLoading(WebURLLoader*, double, int64_t) final;
215 void didFail(WebURLLoader*, const WebURLError&) final; 215 void didFail(WebURLLoader*, const WebURLError&, int64_t) final;
216 216
217 void timeout(TimerBase*); 217 void timeout(TimerBase*);
218 218
219 void didFailLoading(LocalFrame*); 219 void didFailLoading(LocalFrame*);
220 220
221 std::unique_ptr<WebURLLoader> m_loader; 221 std::unique_ptr<WebURLLoader> m_loader;
222 Timer<PingLoaderImpl> m_timeout; 222 Timer<PingLoaderImpl> m_timeout;
223 String m_url; 223 String m_url;
224 unsigned long m_identifier; 224 unsigned long m_identifier;
225 SelfKeepAlive<PingLoaderImpl> m_keepAlive; 225 SelfKeepAlive<PingLoaderImpl> m_keepAlive;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t) { 358 void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t) {
359 if (LocalFrame* frame = this->frame()) { 359 if (LocalFrame* frame = this->frame()) {
360 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 360 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
361 InspectorResourceFinishEvent::data(m_identifier, 0, true)); 361 InspectorResourceFinishEvent::data(m_identifier, 0, true));
362 didFailLoading(frame); 362 didFailLoading(frame);
363 } 363 }
364 dispose(); 364 dispose();
365 } 365 }
366 366
367 void PingLoaderImpl::didFail(WebURLLoader*, const WebURLError& resourceError) { 367 void PingLoaderImpl::didFail(WebURLLoader*,
368 const WebURLError& resourceError,
369 int64_t) {
368 if (LocalFrame* frame = this->frame()) { 370 if (LocalFrame* frame = this->frame()) {
369 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 371 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
370 InspectorResourceFinishEvent::data(m_identifier, 0, true)); 372 InspectorResourceFinishEvent::data(m_identifier, 0, true));
371 didFailLoading(frame); 373 didFailLoading(frame);
372 } 374 }
373 dispose(); 375 dispose();
374 } 376 }
375 377
376 void PingLoaderImpl::timeout(TimerBase*) { 378 void PingLoaderImpl::timeout(TimerBase*) {
377 if (LocalFrame* frame = this->frame()) { 379 if (LocalFrame* frame = this->frame()) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool PingLoader::sendBeacon(LocalFrame* frame, 557 bool PingLoader::sendBeacon(LocalFrame* frame,
556 int allowance, 558 int allowance,
557 const KURL& beaconURL, 559 const KURL& beaconURL,
558 Blob* data, 560 Blob* data,
559 int& payloadLength) { 561 int& payloadLength) {
560 BeaconBlob beacon(data); 562 BeaconBlob beacon(data);
561 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 563 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
562 } 564 }
563 565
564 } // namespace blink 566 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698