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

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

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: fix crash 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 InspectorSendRequestEvent::data(identifier, frame(), request)); 405 InspectorSendRequestEvent::data(identifier, frame(), request));
406 // For initial requests, prepareRequest() is called in 406 // For initial requests, prepareRequest() is called in
407 // willStartLoadingResource(), before revalidation policy is determined. That 407 // willStartLoadingResource(), before revalidation policy is determined. That
408 // call doesn't exist for redirects, so call preareRequest() here. 408 // call doesn't exist for redirects, so call preareRequest() here.
409 if (!redirectResponse.isNull()) { 409 if (!redirectResponse.isNull()) {
410 prepareRequest(request); 410 prepareRequest(request);
411 } else { 411 } else {
412 frame()->loader().progress().willStartLoading(identifier, 412 frame()->loader().progress().willStartLoading(identifier,
413 request.priority()); 413 request.priority());
414 } 414 }
415 InspectorInstrumentation::willSendRequest(frame(), identifier, 415 InspectorInstrumentation::willSendRequest(frame()->document(), identifier,
416 masterDocumentLoader(), request, 416 masterDocumentLoader(), request,
417 redirectResponse, initiatorInfo); 417 redirectResponse, initiatorInfo);
418 if (frame()->frameScheduler()) 418 if (frame()->frameScheduler())
419 frame()->frameScheduler()->didStartLoading(identifier); 419 frame()->frameScheduler()->didStartLoading(identifier);
420 } 420 }
421 421
422 void FrameFetchContext::dispatchDidReceiveResponse( 422 void FrameFetchContext::dispatchDidReceiveResponse(
423 unsigned long identifier, 423 unsigned long identifier,
424 const ResourceResponse& response, 424 const ResourceResponse& response,
425 WebURLRequest::FrameType frameType, 425 WebURLRequest::FrameType frameType,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 encodedDataLength); 459 encodedDataLength);
460 } 460 }
461 461
462 void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier, 462 void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
463 double finishTime, 463 double finishTime,
464 int64_t encodedDataLength) { 464 int64_t encodedDataLength) {
465 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 465 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
466 InspectorResourceFinishEvent::data(identifier, finishTime, false, 466 InspectorResourceFinishEvent::data(identifier, finishTime, false,
467 encodedDataLength)); 467 encodedDataLength));
468 frame()->loader().progress().completeProgress(identifier); 468 frame()->loader().progress().completeProgress(identifier);
469 InspectorInstrumentation::didFinishLoading(frame(), identifier, finishTime, 469 InspectorInstrumentation::didFinishLoading(frame()->document(), identifier,
470 encodedDataLength); 470 finishTime, encodedDataLength);
471 if (frame()->frameScheduler()) 471 if (frame()->frameScheduler())
472 frame()->frameScheduler()->didStopLoading(identifier); 472 frame()->frameScheduler()->didStopLoading(identifier);
473 } 473 }
474 474
475 void FrameFetchContext::dispatchDidFail(unsigned long identifier, 475 void FrameFetchContext::dispatchDidFail(unsigned long identifier,
476 const ResourceError& error, 476 const ResourceError& error,
477 int64_t encodedDataLength, 477 int64_t encodedDataLength,
478 bool isInternalRequest) { 478 bool isInternalRequest) {
479 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", 479 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
480 InspectorResourceFinishEvent::data(identifier, 0, true, 480 InspectorResourceFinishEvent::data(identifier, 0, true,
481 encodedDataLength)); 481 encodedDataLength));
482 frame()->loader().progress().completeProgress(identifier); 482 frame()->loader().progress().completeProgress(identifier);
483 InspectorInstrumentation::didFailLoading(frame(), identifier, error); 483 InspectorInstrumentation::didFailLoading(frame()->document(), identifier,
484 error);
484 // Notification to FrameConsole should come AFTER InspectorInstrumentation 485 // Notification to FrameConsole should come AFTER InspectorInstrumentation
485 // call, DevTools front-end relies on this. 486 // call, DevTools front-end relies on this.
486 if (!isInternalRequest) 487 if (!isInternalRequest)
487 frame()->console().didFailLoading(identifier, error); 488 frame()->console().didFailLoading(identifier, error);
488 if (frame()->frameScheduler()) 489 if (frame()->frameScheduler())
489 frame()->frameScheduler()->didStopLoading(identifier); 490 frame()->frameScheduler()->didStopLoading(identifier);
490 } 491 }
491 492
492 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache( 493 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(
493 unsigned long identifier, 494 unsigned long identifier,
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 1045
1045 if (response.hasMajorCertificateErrors()) { 1046 if (response.hasMajorCertificateErrors()) {
1046 MixedContentChecker::handleCertificateError(frame(), response, frameType, 1047 MixedContentChecker::handleCertificateError(frame(), response, frameType,
1047 requestContext); 1048 requestContext);
1048 } 1049 }
1049 1050
1050 frame()->loader().progress().incrementProgress(identifier, response); 1051 frame()->loader().progress().incrementProgress(identifier, response);
1051 frameLoaderClient()->dispatchDidReceiveResponse(response); 1052 frameLoaderClient()->dispatchDidReceiveResponse(response);
1052 DocumentLoader* documentLoader = masterDocumentLoader(); 1053 DocumentLoader* documentLoader = masterDocumentLoader();
1053 InspectorInstrumentation::didReceiveResourceResponse( 1054 InspectorInstrumentation::didReceiveResourceResponse(
1054 frame(), identifier, documentLoader, response, resource); 1055 frame()->document(), identifier, documentLoader, response, resource);
1055 // It is essential that inspector gets resource response BEFORE console. 1056 // It is essential that inspector gets resource response BEFORE console.
1056 frame()->console().reportResourceResponseReceived(documentLoader, identifier, 1057 frame()->console().reportResourceResponseReceived(documentLoader, identifier,
1057 response); 1058 response);
1058 } 1059 }
1059 1060
1060 DEFINE_TRACE(FrameFetchContext) { 1061 DEFINE_TRACE(FrameFetchContext) {
1061 visitor->trace(m_document); 1062 visitor->trace(m_document);
1062 visitor->trace(m_documentLoader); 1063 visitor->trace(m_documentLoader);
1063 FetchContext::trace(visitor); 1064 FetchContext::trace(visitor);
1064 } 1065 }
1065 1066
1066 } // namespace blink 1067 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698