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

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

Issue 2737623006: Revert of [instrumentation] Introduce InspectorTraceEvents agent (Closed)
Patch Set: Created 3 years, 9 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(
346 "devtools.timeline", "ResourceFinish", "data",
347 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0, 0));
345 const ResourceResponse& resourceResponse = response.toResourceResponse(); 348 const ResourceResponse& resourceResponse = response.toResourceResponse();
346 probe::didReceiveResourceResponse(frame(), m_identifier, 0, 349 probe::didReceiveResourceResponse(frame(), m_identifier, 0,
347 resourceResponse, 0); 350 resourceResponse, 0);
348 didFailLoading(frame()); 351 didFailLoading(frame());
349 } 352 }
350 dispose(); 353 dispose();
351 } 354 }
352 355
353 void PingLoaderImpl::didReceiveData(const char*, int dataLength) { 356 void PingLoaderImpl::didReceiveData(const char*, int dataLength) {
354 if (frame()) 357 if (frame()) {
358 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
359 InspectorResourceFinishEvent::data(m_identifier, 0, true,
360 dataLength, 0));
355 didFailLoading(frame()); 361 didFailLoading(frame());
362 }
356 dispose(); 363 dispose();
357 } 364 }
358 365
359 void PingLoaderImpl::didFinishLoading(double, 366 void PingLoaderImpl::didFinishLoading(double,
360 int64_t, 367 int64_t,
361 int64_t encodedDataLength) { 368 int64_t encodedDataLength) {
362 if (frame()) 369 if (frame()) {
370 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
371 InspectorResourceFinishEvent::data(m_identifier, 0, true,
372 encodedDataLength, 0));
363 didFailLoading(frame()); 373 didFailLoading(frame());
374 }
364 dispose(); 375 dispose();
365 } 376 }
366 377
367 void PingLoaderImpl::didFail(const WebURLError& resourceError, 378 void PingLoaderImpl::didFail(const WebURLError& resourceError,
368 int64_t, 379 int64_t,
369 int64_t encodedDataLength) { 380 int64_t encodedDataLength) {
370 if (frame()) 381 if (frame()) {
382 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
383 InspectorResourceFinishEvent::data(m_identifier, 0, true,
384 encodedDataLength, 0));
371 didFailLoading(frame()); 385 didFailLoading(frame());
386 }
372 dispose(); 387 dispose();
373 } 388 }
374 389
375 void PingLoaderImpl::timeout(TimerBase*) { 390 void PingLoaderImpl::timeout(TimerBase*) {
376 if (frame()) 391 if (frame()) {
392 TRACE_EVENT1(
393 "devtools.timeline", "ResourceFinish", "data",
394 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0, 0));
377 didFailLoading(frame()); 395 didFailLoading(frame());
396 }
378 dispose(); 397 dispose();
379 } 398 }
380 399
381 void PingLoaderImpl::didFailLoading(LocalFrame* frame) { 400 void PingLoaderImpl::didFailLoading(LocalFrame* frame) {
382 probe::didFailLoading(frame, m_identifier, 401 probe::didFailLoading(frame, m_identifier,
383 ResourceError::cancelledError(m_url)); 402 ResourceError::cancelledError(m_url));
384 frame->console().didFailLoading(m_identifier, 403 frame->console().didFailLoading(m_identifier,
385 ResourceError::cancelledError(m_url)); 404 ResourceError::cancelledError(m_url));
386 } 405 }
387 406
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 bool PingLoader::sendBeacon(LocalFrame* frame, 576 bool PingLoader::sendBeacon(LocalFrame* frame,
558 int allowance, 577 int allowance,
559 const KURL& beaconURL, 578 const KURL& beaconURL,
560 Blob* data, 579 Blob* data,
561 int& payloadLength) { 580 int& payloadLength) {
562 BeaconBlob beacon(data); 581 BeaconBlob beacon(data);
563 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 582 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
564 } 583 }
565 584
566 } // namespace blink 585 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | third_party/WebKit/Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698