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

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

Issue 2510333002: Send encoded_body_length to renderer when response completed (2/3) (Closed)
Patch Set: rebase 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 DECLARE_VIRTUAL_TRACE(); 203 DECLARE_VIRTUAL_TRACE();
204 204
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) final;
214 void didFinishLoading(WebURLLoader*, double, int64_t) final; 214 void didFinishLoading(WebURLLoader*, double, int64_t, int64_t) final;
215 void didFail(WebURLLoader*, const WebURLError&, int64_t) final; 215 void didFail(WebURLLoader*, const WebURLError&, int64_t, 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 339 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
340 InspectorResourceFinishEvent::data(m_identifier, 0, true)); 340 InspectorResourceFinishEvent::data(m_identifier, 0, true));
341 const ResourceResponse& resourceResponse = response.toResourceResponse(); 341 const ResourceResponse& resourceResponse = response.toResourceResponse();
342 InspectorInstrumentation::didReceiveResourceResponse(frame, m_identifier, 0, 342 InspectorInstrumentation::didReceiveResourceResponse(frame, m_identifier, 0,
343 resourceResponse, 0); 343 resourceResponse, 0);
344 didFailLoading(frame); 344 didFailLoading(frame);
345 } 345 }
346 dispose(); 346 dispose();
347 } 347 }
348 348
349 void PingLoaderImpl::didReceiveData(WebURLLoader*, const char*, int, int, int) { 349 void PingLoaderImpl::didReceiveData(WebURLLoader*, const char*, int, int) {
350 if (LocalFrame* frame = this->frame()) { 350 if (LocalFrame* frame = this->frame()) {
351 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 351 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
352 InspectorResourceFinishEvent::data(m_identifier, 0, true)); 352 InspectorResourceFinishEvent::data(m_identifier, 0, true));
353 didFailLoading(frame); 353 didFailLoading(frame);
354 } 354 }
355 dispose(); 355 dispose();
356 } 356 }
357 357
358 void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t) { 358 void PingLoaderImpl::didFinishLoading(WebURLLoader*, double, int64_t, 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*, 367 void PingLoaderImpl::didFail(WebURLLoader*,
368 const WebURLError& resourceError, 368 const WebURLError& resourceError,
369 int64_t,
369 int64_t) { 370 int64_t) {
370 if (LocalFrame* frame = this->frame()) { 371 if (LocalFrame* frame = this->frame()) {
371 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 372 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
372 InspectorResourceFinishEvent::data(m_identifier, 0, true)); 373 InspectorResourceFinishEvent::data(m_identifier, 0, true));
373 didFailLoading(frame); 374 didFailLoading(frame);
374 } 375 }
375 dispose(); 376 dispose();
376 } 377 }
377 378
378 void PingLoaderImpl::timeout(TimerBase*) { 379 void PingLoaderImpl::timeout(TimerBase*) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 bool PingLoader::sendBeacon(LocalFrame* frame, 558 bool PingLoader::sendBeacon(LocalFrame* frame,
558 int allowance, 559 int allowance,
559 const KURL& beaconURL, 560 const KURL& beaconURL,
560 Blob* data, 561 Blob* data,
561 int& payloadLength) { 562 int& payloadLength) {
562 BeaconBlob beacon(data); 563 BeaconBlob beacon(data);
563 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 564 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
564 } 565 }
565 566
566 } // namespace blink 567 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698