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(); | |
622 if (resource->IsLoadEventBlockingResourceType()) | 619 if (resource->IsLoadEventBlockingResourceType()) |
623 GetDocument()->CheckCompleted(); | 620 GetFrame()->Loader().CheckCompleted(); |
| 621 if (GetDocument()) |
| 622 FirstMeaningfulPaintDetector::From(*GetDocument()).CheckNetworkStable(); |
624 } | 623 } |
625 | 624 |
626 void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) { | 625 void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) { |
627 Document* initiator_document = GetDocument() && info.IsMainResource() | 626 Document* initiator_document = GetDocument() && info.IsMainResource() |
628 ? GetDocument()->ParentDocument() | 627 ? GetDocument()->ParentDocument() |
629 : GetDocument(); | 628 : GetDocument(); |
630 if (!initiator_document || !initiator_document->domWindow()) | 629 if (!initiator_document || !initiator_document->domWindow()) |
631 return; | 630 return; |
632 DOMWindowPerformance::performance(*initiator_document->domWindow()) | 631 DOMWindowPerformance::performance(*initiator_document->domWindow()) |
633 ->AddResourceTiming(info); | 632 ->AddResourceTiming(info); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const { | 1029 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const { |
1031 return GetFrame()->FrameScheduler()->LoadingTaskRunner(); | 1030 return GetFrame()->FrameScheduler()->LoadingTaskRunner(); |
1032 } | 1031 } |
1033 | 1032 |
1034 DEFINE_TRACE(FrameFetchContext) { | 1033 DEFINE_TRACE(FrameFetchContext) { |
1035 visitor->Trace(document_loader_); | 1034 visitor->Trace(document_loader_); |
1036 BaseFetchContext::Trace(visitor); | 1035 BaseFetchContext::Trace(visitor); |
1037 } | 1036 } |
1038 | 1037 |
1039 } // namespace blink | 1038 } // namespace blink |
OLD | NEW |