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

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

Issue 23651014: Merge "[Resource Timing] Fix potential double free problem" (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1599/
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 RefPtr<Document> protectDocument(m_document); 945 RefPtr<Document> protectDocument(m_document);
946 946
947 if (resource && resource->response().isHTTP() && ((!resource->errorOccurred( ) && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304) && document()) { 947 if (resource && resource->response().isHTTP() && ((!resource->errorOccurred( ) && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304) && document()) {
948 ResourceTimingInfoMap::iterator it = m_resourceTimingInfoMap.find(resour ce); 948 ResourceTimingInfoMap::iterator it = m_resourceTimingInfoMap.find(resour ce);
949 if (it != m_resourceTimingInfoMap.end()) { 949 if (it != m_resourceTimingInfoMap.end()) {
950 Document* initiatorDocument = document(); 950 Document* initiatorDocument = document();
951 if (resource->type() == Resource::MainResource) 951 if (resource->type() == Resource::MainResource)
952 initiatorDocument = document()->parentDocument(); 952 initiatorDocument = document()->parentDocument();
953 ASSERT(initiatorDocument); 953 ASSERT(initiatorDocument);
954 RefPtr<ResourceTimingInfo> info = it->value; 954 RefPtr<ResourceTimingInfo> info = it->value;
955 m_resourceTimingInfoMap.remove(it);
955 info->setInitialRequest(resource->resourceRequest()); 956 info->setInitialRequest(resource->resourceRequest());
956 info->setFinalResponse(resource->response()); 957 info->setFinalResponse(resource->response());
957 info->setLoadFinishTime(resource->loadFinishTime()); 958 info->setLoadFinishTime(resource->loadFinishTime());
958 if (DOMWindow* initiatorWindow = initiatorDocument->domWindow()) 959 if (DOMWindow* initiatorWindow = initiatorDocument->domWindow())
959 initiatorWindow->performance()->addResourceTiming(*info, initiat orDocument); 960 initiatorWindow->performance()->addResourceTiming(*info, initiat orDocument);
960 m_resourceTimingInfoMap.remove(it);
961 } 961 }
962 } 962 }
963 963
964 if (frame()) 964 if (frame())
965 frame()->loader()->loadDone(); 965 frame()->loader()->loadDone();
966 performPostLoadActions(); 966 performPostLoadActions();
967 967
968 if (!m_garbageCollectDocumentResourcesTimer.isActive()) 968 if (!m_garbageCollectDocumentResourcesTimer.isActive())
969 m_garbageCollectDocumentResourcesTimer.startOneShot(0); 969 m_garbageCollectDocumentResourcesTimer.startOneShot(0);
970 } 970 }
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 } 1292 }
1293 #endif 1293 #endif
1294 1294
1295 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() 1295 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions()
1296 { 1296 {
1297 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); 1297 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext));
1298 return options; 1298 return options;
1299 } 1299 }
1300 1300
1301 } 1301 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698