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

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

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

Powered by Google App Engine
This is Rietveld 408576698