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

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

Issue 2962113002: Updates to Server-Timing in accordance with with spec changes (Closed)
Patch Set: Created 3 years, 5 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 450
451 GetFrame()->Loader().Progress().IncrementProgress(identifier, response); 451 GetFrame()->Loader().Progress().IncrementProgress(identifier, response);
452 GetLocalFrameClient()->DispatchDidReceiveResponse(response); 452 GetLocalFrameClient()->DispatchDidReceiveResponse(response);
453 DocumentLoader* document_loader = MasterDocumentLoader(); 453 DocumentLoader* document_loader = MasterDocumentLoader();
454 probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader, 454 probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader,
455 response, resource); 455 response, resource);
456 // It is essential that inspector gets resource response BEFORE console. 456 // It is essential that inspector gets resource response BEFORE console.
457 GetFrame()->Console().ReportResourceResponseReceived(document_loader, 457 GetFrame()->Console().ReportResourceResponseReceived(document_loader,
458 identifier, response); 458 identifier, response);
459
460 // MainResource responses were already added, skip them here.
461 if (RuntimeEnabledFeatures::ServerTimingEnabled() &&
462 resource->GetType() != Resource::kMainResource &&
463 GetFrame()->GetDocument() && GetFrame()->GetDocument()->domWindow()) {
464 LocalDOMWindow* localDOMWindow = GetFrame()->GetDocument()->domWindow();
465 DOMWindowPerformance::performance(*localDOMWindow)
466 ->AddServerTiming(response,
467 localDOMWindow->HasLoadEventFired()
468 ? PerformanceBase::ShouldAddToBuffer::Never
469 : PerformanceBase::ShouldAddToBuffer::Always);
470 }
471 } 459 }
472 460
473 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier, 461 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier,
474 const char* data, 462 const char* data,
475 int data_length) { 463 int data_length) {
476 if (IsDetached()) 464 if (IsDetached())
477 return; 465 return;
478 466
479 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); 467 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length);
480 probe::didReceiveData(GetFrame(), identifier, data, data_length); 468 probe::didReceiveData(GetFrame(), identifier, data, data_length);
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 } 1104 }
1117 1105
1118 DEFINE_TRACE(FrameFetchContext) { 1106 DEFINE_TRACE(FrameFetchContext) {
1119 visitor->Trace(document_loader_); 1107 visitor->Trace(document_loader_);
1120 visitor->Trace(document_); 1108 visitor->Trace(document_);
1121 visitor->Trace(frozen_state_); 1109 visitor->Trace(frozen_state_);
1122 BaseFetchContext::Trace(visitor); 1110 BaseFetchContext::Trace(visitor);
1123 } 1111 }
1124 1112
1125 } // namespace blink 1113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698