| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 | 451 |
| 452 GetFrame()->Loader().Progress().IncrementProgress(identifier, response); | 452 GetFrame()->Loader().Progress().IncrementProgress(identifier, response); |
| 453 GetLocalFrameClient()->DispatchDidReceiveResponse(response); | 453 GetLocalFrameClient()->DispatchDidReceiveResponse(response); |
| 454 DocumentLoader* document_loader = MasterDocumentLoader(); | 454 DocumentLoader* document_loader = MasterDocumentLoader(); |
| 455 probe::didReceiveResourceResponse(GetFrame()->GetDocument(), identifier, | 455 probe::didReceiveResourceResponse(GetFrame()->GetDocument(), identifier, |
| 456 document_loader, response, resource); | 456 document_loader, response, resource); |
| 457 // It is essential that inspector gets resource response BEFORE console. | 457 // It is essential that inspector gets resource response BEFORE console. |
| 458 GetFrame()->Console().ReportResourceResponseReceived(document_loader, | 458 GetFrame()->Console().ReportResourceResponseReceived(document_loader, |
| 459 identifier, response); | 459 identifier, response); |
| 460 | |
| 461 // MainResource responses were already added, skip them here. | |
| 462 if (RuntimeEnabledFeatures::ServerTimingEnabled() && | |
| 463 resource->GetType() != Resource::kMainResource && | |
| 464 GetFrame()->GetDocument() && GetFrame()->GetDocument()->domWindow()) { | |
| 465 LocalDOMWindow* localDOMWindow = GetFrame()->GetDocument()->domWindow(); | |
| 466 DOMWindowPerformance::performance(*localDOMWindow) | |
| 467 ->AddServerTiming(response, | |
| 468 localDOMWindow->HasLoadEventFired() | |
| 469 ? PerformanceBase::ShouldAddToBuffer::Never | |
| 470 : PerformanceBase::ShouldAddToBuffer::Always); | |
| 471 } | |
| 472 } | 460 } |
| 473 | 461 |
| 474 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier, | 462 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier, |
| 475 const char* data, | 463 const char* data, |
| 476 int data_length) { | 464 int data_length) { |
| 477 if (IsDetached()) | 465 if (IsDetached()) |
| 478 return; | 466 return; |
| 479 | 467 |
| 480 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); | 468 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); |
| 481 probe::didReceiveData(GetFrame()->GetDocument(), identifier, | 469 probe::didReceiveData(GetFrame()->GetDocument(), identifier, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 } | 1118 } |
| 1131 | 1119 |
| 1132 DEFINE_TRACE(FrameFetchContext) { | 1120 DEFINE_TRACE(FrameFetchContext) { |
| 1133 visitor->Trace(document_loader_); | 1121 visitor->Trace(document_loader_); |
| 1134 visitor->Trace(document_); | 1122 visitor->Trace(document_); |
| 1135 visitor->Trace(frozen_state_); | 1123 visitor->Trace(frozen_state_); |
| 1136 BaseFetchContext::Trace(visitor); | 1124 BaseFetchContext::Trace(visitor); |
| 1137 } | 1125 } |
| 1138 | 1126 |
| 1139 } // namespace blink | 1127 } // namespace blink |
| OLD | NEW |