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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 176763009: Have DOMWindow deal with references instead of pointers when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/DOMWindow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 info->clearLoadTimings(); 173 info->clearLoadTimings();
174 info->setLoadFinishTime(resource->loadFinishTime()); 174 info->setLoadFinishTime(resource->loadFinishTime());
175 } 175 }
176 176
177 static void reportResourceTiming(ResourceTimingInfo* info, Document* initiatorDo cument, bool isMainResource) 177 static void reportResourceTiming(ResourceTimingInfo* info, Document* initiatorDo cument, bool isMainResource)
178 { 178 {
179 if (initiatorDocument && isMainResource) 179 if (initiatorDocument && isMainResource)
180 initiatorDocument = initiatorDocument->parentDocument(); 180 initiatorDocument = initiatorDocument->parentDocument();
181 if (!initiatorDocument || !initiatorDocument->loader()) 181 if (!initiatorDocument || !initiatorDocument->loader())
182 return; 182 return;
183 if (DOMWindow* initiatorWindow = initiatorDocument->domWindow()) { 183 if (DOMWindow* initiatorWindow = initiatorDocument->domWindow())
184 if (Performance* performance = initiatorWindow->performance()) 184 initiatorWindow->performance().addResourceTiming(*info, initiatorDocumen t);
185 performance->addResourceTiming(*info, initiatorDocument);
186 }
187 } 185 }
188 186
189 static ResourceRequest::TargetType requestTargetType(const ResourceFetcher* fetc her, const ResourceRequest& request, Resource::Type type) 187 static ResourceRequest::TargetType requestTargetType(const ResourceFetcher* fetc her, const ResourceRequest& request, Resource::Type type)
190 { 188 {
191 switch (type) { 189 switch (type) {
192 case Resource::MainResource: 190 case Resource::MainResource:
193 if (fetcher->frame()->tree().parent()) 191 if (fetcher->frame()->tree().parent())
194 return ResourceRequest::TargetIsSubframe; 192 return ResourceRequest::TargetIsSubframe;
195 return ResourceRequest::TargetIsMainFrame; 193 return ResourceRequest::TargetIsMainFrame;
196 case Resource::XSLStyleSheet: 194 case Resource::XSLStyleSheet:
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 case Revalidate: 1399 case Revalidate:
1402 ++m_revalidateCount; 1400 ++m_revalidateCount;
1403 return; 1401 return;
1404 case Use: 1402 case Use:
1405 ++m_useCount; 1403 ++m_useCount;
1406 return; 1404 return;
1407 } 1405 }
1408 } 1406 }
1409 1407
1410 } 1408 }
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/DOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698