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

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

Issue 2712833002: DevTools: Show decoded body length for network requests on timeline. (Closed)
Patch Set: rebaseline Created 3 years, 10 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 fetchContext.dispatchWillSendRequest( 335 fetchContext.dispatchWillSendRequest(
336 m_identifier, passedNewRequest.toMutableResourceRequest(), 336 m_identifier, passedNewRequest.toMutableResourceRequest(),
337 passedRedirectResponse.toResourceResponse(), initiatorInfo); 337 passedRedirectResponse.toResourceResponse(), initiatorInfo);
338 } 338 }
339 339
340 return true; 340 return true;
341 } 341 }
342 342
343 void PingLoaderImpl::didReceiveResponse(const WebURLResponse& response) { 343 void PingLoaderImpl::didReceiveResponse(const WebURLResponse& response) {
344 if (frame()) { 344 if (frame()) {
345 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 345 TRACE_EVENT1(
346 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); 346 "devtools.timeline", "ResourceFinish", "data",
347 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0, 0));
347 const ResourceResponse& resourceResponse = response.toResourceResponse(); 348 const ResourceResponse& resourceResponse = response.toResourceResponse();
348 InspectorInstrumentation::didReceiveResourceResponse( 349 InspectorInstrumentation::didReceiveResourceResponse(
349 frame(), m_identifier, 0, resourceResponse, 0); 350 frame(), m_identifier, 0, resourceResponse, 0);
350 didFailLoading(frame()); 351 didFailLoading(frame());
351 } 352 }
352 dispose(); 353 dispose();
353 } 354 }
354 355
355 void PingLoaderImpl::didReceiveData(const char*, int dataLength) { 356 void PingLoaderImpl::didReceiveData(const char*, int dataLength) {
356 if (frame()) { 357 if (frame()) {
357 TRACE_EVENT1( 358 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
358 "devtools.timeline", "ResourceFinish", "data", 359 InspectorResourceFinishEvent::data(m_identifier, 0, true,
359 InspectorResourceFinishEvent::data(m_identifier, 0, true, dataLength)); 360 dataLength, 0));
360 didFailLoading(frame()); 361 didFailLoading(frame());
361 } 362 }
362 dispose(); 363 dispose();
363 } 364 }
364 365
365 void PingLoaderImpl::didFinishLoading(double, 366 void PingLoaderImpl::didFinishLoading(double,
366 int64_t, 367 int64_t,
367 int64_t encodedDataLength) { 368 int64_t encodedDataLength) {
368 if (frame()) { 369 if (frame()) {
369 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 370 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
370 InspectorResourceFinishEvent::data(m_identifier, 0, true, 371 InspectorResourceFinishEvent::data(m_identifier, 0, true,
371 encodedDataLength)); 372 encodedDataLength, 0));
372 didFailLoading(frame()); 373 didFailLoading(frame());
373 } 374 }
374 dispose(); 375 dispose();
375 } 376 }
376 377
377 void PingLoaderImpl::didFail(const WebURLError& resourceError, 378 void PingLoaderImpl::didFail(const WebURLError& resourceError,
378 int64_t, 379 int64_t,
379 int64_t encodedDataLength) { 380 int64_t encodedDataLength) {
380 if (frame()) { 381 if (frame()) {
381 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 382 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
382 InspectorResourceFinishEvent::data(m_identifier, 0, true, 383 InspectorResourceFinishEvent::data(m_identifier, 0, true,
383 encodedDataLength)); 384 encodedDataLength, 0));
384 didFailLoading(frame()); 385 didFailLoading(frame());
385 } 386 }
386 dispose(); 387 dispose();
387 } 388 }
388 389
389 void PingLoaderImpl::timeout(TimerBase*) { 390 void PingLoaderImpl::timeout(TimerBase*) {
390 if (frame()) { 391 if (frame()) {
391 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 392 TRACE_EVENT1(
392 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); 393 "devtools.timeline", "ResourceFinish", "data",
394 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0, 0));
393 didFailLoading(frame()); 395 didFailLoading(frame());
394 } 396 }
395 dispose(); 397 dispose();
396 } 398 }
397 399
398 void PingLoaderImpl::didFailLoading(LocalFrame* frame) { 400 void PingLoaderImpl::didFailLoading(LocalFrame* frame) {
399 InspectorInstrumentation::didFailLoading( 401 InspectorInstrumentation::didFailLoading(
400 frame, m_identifier, ResourceError::cancelledError(m_url)); 402 frame, m_identifier, ResourceError::cancelledError(m_url));
401 frame->console().didFailLoading(m_identifier, 403 frame->console().didFailLoading(m_identifier,
402 ResourceError::cancelledError(m_url)); 404 ResourceError::cancelledError(m_url));
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 bool PingLoader::sendBeacon(LocalFrame* frame, 571 bool PingLoader::sendBeacon(LocalFrame* frame,
570 int allowance, 572 int allowance,
571 const KURL& beaconURL, 573 const KURL& beaconURL,
572 Blob* data, 574 Blob* data,
573 int& payloadLength) { 575 int& payloadLength) {
574 BeaconBlob beacon(data); 576 BeaconBlob beacon(data);
575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 577 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
576 } 578 }
577 579
578 } // namespace blink 580 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698