| OLD | NEW |
| 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 Loading... |
| 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()->document(), identifier, | 415 InspectorInstrumentation::willSendRequest(frame(), 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 Loading... |
| 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()->document(), identifier, | 469 InspectorInstrumentation::didFinishLoading(frame(), identifier, finishTime, |
| 470 finishTime, encodedDataLength); | 470 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()->document(), identifier, | 483 InspectorInstrumentation::didFailLoading(frame(), identifier, error); |
| 484 error); | |
| 485 // Notification to FrameConsole should come AFTER InspectorInstrumentation | 484 // Notification to FrameConsole should come AFTER InspectorInstrumentation |
| 486 // call, DevTools front-end relies on this. | 485 // call, DevTools front-end relies on this. |
| 487 if (!isInternalRequest) | 486 if (!isInternalRequest) |
| 488 frame()->console().didFailLoading(identifier, error); | 487 frame()->console().didFailLoading(identifier, error); |
| 489 if (frame()->frameScheduler()) | 488 if (frame()->frameScheduler()) |
| 490 frame()->frameScheduler()->didStopLoading(identifier); | 489 frame()->frameScheduler()->didStopLoading(identifier); |
| 491 } | 490 } |
| 492 | 491 |
| 493 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache( | 492 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache( |
| 494 unsigned long identifier, | 493 unsigned long identifier, |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 | 1044 |
| 1046 if (response.hasMajorCertificateErrors()) { | 1045 if (response.hasMajorCertificateErrors()) { |
| 1047 MixedContentChecker::handleCertificateError(frame(), response, frameType, | 1046 MixedContentChecker::handleCertificateError(frame(), response, frameType, |
| 1048 requestContext); | 1047 requestContext); |
| 1049 } | 1048 } |
| 1050 | 1049 |
| 1051 frame()->loader().progress().incrementProgress(identifier, response); | 1050 frame()->loader().progress().incrementProgress(identifier, response); |
| 1052 frameLoaderClient()->dispatchDidReceiveResponse(response); | 1051 frameLoaderClient()->dispatchDidReceiveResponse(response); |
| 1053 DocumentLoader* documentLoader = masterDocumentLoader(); | 1052 DocumentLoader* documentLoader = masterDocumentLoader(); |
| 1054 InspectorInstrumentation::didReceiveResourceResponse( | 1053 InspectorInstrumentation::didReceiveResourceResponse( |
| 1055 frame()->document(), identifier, documentLoader, response, resource); | 1054 frame(), identifier, documentLoader, response, resource); |
| 1056 // It is essential that inspector gets resource response BEFORE console. | 1055 // It is essential that inspector gets resource response BEFORE console. |
| 1057 frame()->console().reportResourceResponseReceived(documentLoader, identifier, | 1056 frame()->console().reportResourceResponseReceived(documentLoader, identifier, |
| 1058 response); | 1057 response); |
| 1059 } | 1058 } |
| 1060 | 1059 |
| 1061 DEFINE_TRACE(FrameFetchContext) { | 1060 DEFINE_TRACE(FrameFetchContext) { |
| 1062 visitor->trace(m_document); | 1061 visitor->trace(m_document); |
| 1063 visitor->trace(m_documentLoader); | 1062 visitor->trace(m_documentLoader); |
| 1064 FetchContext::trace(visitor); | 1063 FetchContext::trace(visitor); |
| 1065 } | 1064 } |
| 1066 | 1065 |
| 1067 } // namespace blink | 1066 } // namespace blink |
| OLD | NEW |