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

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

Issue 148323002: Add histograms to ResourceFetcher to evaluate memory cache hit rate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@histogram-unload-frequency
Patch Set: Addressed nits Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/core/fetch/ResourceFetcher.cpp » ('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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 Timer<ResourceFetcher> m_resourceTimingReportTimer; 214 Timer<ResourceFetcher> m_resourceTimingReportTimer;
215 215
216 typedef HashMap<Resource*, RefPtr<ResourceTimingInfo> > ResourceTimingInfoMa p; 216 typedef HashMap<Resource*, RefPtr<ResourceTimingInfo> > ResourceTimingInfoMa p;
217 ResourceTimingInfoMap m_resourceTimingInfoMap; 217 ResourceTimingInfoMap m_resourceTimingInfoMap;
218 218
219 HashMap<RefPtr<ResourceTimingInfo>, bool> m_scheduledResourceTimingReports; 219 HashMap<RefPtr<ResourceTimingInfo>, bool> m_scheduledResourceTimingReports;
220 220
221 OwnPtr<ResourceLoaderSet> m_loaders; 221 OwnPtr<ResourceLoaderSet> m_loaders;
222 OwnPtr<ResourceLoaderSet> m_multipartLoaders; 222 OwnPtr<ResourceLoaderSet> m_multipartLoaders;
223 223
224 // Used in hit rate histograms.
225 class DeadResourceStatsRecorder {
226 public:
227 DeadResourceStatsRecorder();
228 ~DeadResourceStatsRecorder();
229
230 void update(RevalidationPolicy);
231
232 private:
233 int m_useCount;
234 int m_revalidateCount;
235 int m_loadCount;
236 };
237 DeadResourceStatsRecorder m_deadStatsRecorder;
238
224 // 29 bits left 239 // 29 bits left
225 bool m_autoLoadImages : 1; 240 bool m_autoLoadImages : 1;
226 bool m_imagesEnabled : 1; 241 bool m_imagesEnabled : 1;
227 bool m_allowStaleResources : 1; 242 bool m_allowStaleResources : 1;
228 }; 243 };
229 244
230 class ResourceCacheValidationSuppressor { 245 class ResourceCacheValidationSuppressor {
231 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor); 246 WTF_MAKE_NONCOPYABLE(ResourceCacheValidationSuppressor);
232 WTF_MAKE_FAST_ALLOCATED; 247 WTF_MAKE_FAST_ALLOCATED;
233 public: 248 public:
(...skipping 12 matching lines...) Expand all
246 m_loader->m_allowStaleResources = m_previousState; 261 m_loader->m_allowStaleResources = m_previousState;
247 } 262 }
248 private: 263 private:
249 ResourceFetcher* m_loader; 264 ResourceFetcher* m_loader;
250 bool m_previousState; 265 bool m_previousState;
251 }; 266 };
252 267
253 } // namespace WebCore 268 } // namespace WebCore
254 269
255 #endif 270 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698