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

Side by Side Diff: Source/core/loader/cache/CachedResourceLoader.cpp

Issue 14054023: Add loadedNonEmptyDocument flag in FrameLoader for Resource Timing (Closed) Base URL: http://chromium.googlesource.com/chromium/blink.git@master
Patch Set: set loadedNonEmptyDocument flag in CachedResourceLoader(Resource Timing related code) Created 7 years, 7 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 if (!memoryCache()->add(resource.get())) 564 if (!memoryCache()->add(resource.get()))
565 resource->setOwningCachedResourceLoader(this); 565 resource->setOwningCachedResourceLoader(this);
566 storeResourceTimingInitiatorInformation(resource, request); 566 storeResourceTimingInitiatorInformation(resource, request);
567 return resource; 567 return resource;
568 } 568 }
569 569
570 void CachedResourceLoader::storeResourceTimingInitiatorInformation(const CachedR esourceHandle<CachedResource>& resource, const CachedResourceRequest& request) 570 void CachedResourceLoader::storeResourceTimingInitiatorInformation(const CachedR esourceHandle<CachedResource>& resource, const CachedResourceRequest& request)
571 { 571 {
572 if (resource->type() == CachedResource::MainResource) { 572 if (resource->type() == CachedResource::MainResource) {
573 // <iframe>s should report the initial navigation requested by the paren t document, but not subsequent navigations. 573 // <iframe>s should report the initial navigation requested by the paren t document, but not subsequent navigations.
574 if (frame()->ownerElement() && m_documentLoader->frameLoader()->stateMac hine()->committingFirstRealLoad()) { 574 if (frame()->ownerElement() && !frame()->ownerElement()->loadedNonEmptyD ocument()) {
575 InitiatorInfo info = { frame()->ownerElement()->localName(), monoton icallyIncreasingTime() }; 575 InitiatorInfo info = { frame()->ownerElement()->localName(), monoton icallyIncreasingTime() };
576 m_initiatorMap.add(resource.get(), info); 576 m_initiatorMap.add(resource.get(), info);
577
578 if(!frame()->ownerElement()->loadedNonEmptyDocument() && !m_document Loader->requestURL().isBlankURL() && !m_documentLoader-> requestURL().isEmpty())
Nate Chapin 2013/05/08 16:06:55 I think this if isn't necessary. DocumentLoader sh
579 frame()->ownerElement()->didLoadNonEmptyDocument();
577 } 580 }
578 } else { 581 } else {
579 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingT ime() }; 582 InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingT ime() };
580 m_initiatorMap.add(resource.get(), info); 583 m_initiatorMap.add(resource.get(), info);
581 } 584 }
582 } 585 }
583 586
584 CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalida tionPolicy(CachedResource::Type type, ResourceRequest& request, bool forPreload, CachedResource* existingResource, CachedResourceRequest::DeferOption defer) con st 587 CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalida tionPolicy(CachedResource::Type type, ResourceRequest& request, bool forPreload, CachedResource* existingResource, CachedResourceRequest::DeferOption defer) con st
585 { 588 {
586 if (!existingResource) 589 if (!existingResource)
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 info.ignoreMember(m_initiatorMap); 1014 info.ignoreMember(m_initiatorMap);
1012 } 1015 }
1013 1016
1014 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( ) 1017 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( )
1015 { 1018 {
1016 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData , AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); 1019 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData , AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck);
1017 return options; 1020 return options;
1018 } 1021 }
1019 1022
1020 } 1023 }
OLDNEW
« Source/core/html/HTMLIFrameElement.h ('K') | « Source/core/loader/FrameLoaderStateMachine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698