| 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 if (activity_logger) { | 610 if (activity_logger) { |
| 611 Vector<String> argv; | 611 Vector<String> argv; |
| 612 argv.push_back(Resource::ResourceTypeToString(type, fetch_initiator_name)); | 612 argv.push_back(Resource::ResourceTypeToString(type, fetch_initiator_name)); |
| 613 argv.push_back(request.Url()); | 613 argv.push_back(request.Url()); |
| 614 activity_logger->LogEvent("blinkRequestResource", argv.size(), argv.Data()); | 614 activity_logger->LogEvent("blinkRequestResource", argv.size(), argv.Data()); |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 | 617 |
| 618 void FrameFetchContext::DidLoadResource(Resource* resource) { | 618 void FrameFetchContext::DidLoadResource(Resource* resource) { |
| 619 if (!GetDocument()) |
| 620 return; |
| 621 FirstMeaningfulPaintDetector::From(*GetDocument()).CheckNetworkStable(); |
| 619 if (resource->IsLoadEventBlockingResourceType()) | 622 if (resource->IsLoadEventBlockingResourceType()) |
| 620 GetFrame()->Loader().CheckCompleted(); | 623 GetDocument()->CheckCompleted(); |
| 621 if (GetDocument()) | |
| 622 FirstMeaningfulPaintDetector::From(*GetDocument()).CheckNetworkStable(); | |
| 623 } | 624 } |
| 624 | 625 |
| 625 void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) { | 626 void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) { |
| 626 Document* initiator_document = GetDocument() && info.IsMainResource() | 627 Document* initiator_document = GetDocument() && info.IsMainResource() |
| 627 ? GetDocument()->ParentDocument() | 628 ? GetDocument()->ParentDocument() |
| 628 : GetDocument(); | 629 : GetDocument(); |
| 629 if (!initiator_document || !initiator_document->domWindow()) | 630 if (!initiator_document || !initiator_document->domWindow()) |
| 630 return; | 631 return; |
| 631 DOMWindowPerformance::performance(*initiator_document->domWindow()) | 632 DOMWindowPerformance::performance(*initiator_document->domWindow()) |
| 632 ->AddResourceTiming(info); | 633 ->AddResourceTiming(info); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const { | 1030 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const { |
| 1030 return GetFrame()->FrameScheduler()->LoadingTaskRunner(); | 1031 return GetFrame()->FrameScheduler()->LoadingTaskRunner(); |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 DEFINE_TRACE(FrameFetchContext) { | 1034 DEFINE_TRACE(FrameFetchContext) { |
| 1034 visitor->Trace(document_loader_); | 1035 visitor->Trace(document_loader_); |
| 1035 BaseFetchContext::Trace(visitor); | 1036 BaseFetchContext::Trace(visitor); |
| 1036 } | 1037 } |
| 1037 | 1038 |
| 1038 } // namespace blink | 1039 } // namespace blink |
| OLD | NEW |