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

Side by Side Diff: Source/WebCore/page/FeatureObserver.cpp

Issue 12340046: Merge 143363 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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 | « Source/WebCore/page/FeatureObserver.h ('k') | 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) 2012 Google, Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 24 matching lines...) Expand all
35 35
36 FeatureObserver::FeatureObserver() 36 FeatureObserver::FeatureObserver()
37 { 37 {
38 } 38 }
39 39
40 FeatureObserver::~FeatureObserver() 40 FeatureObserver::~FeatureObserver()
41 { 41 {
42 // We always log PageDestruction so that we have a scale for the rest of the features. 42 // We always log PageDestruction so that we have a scale for the rest of the features.
43 HistogramSupport::histogramEnumeration("WebCore.FeatureObserver", PageDestru ction, NumberOfFeatures); 43 HistogramSupport::histogramEnumeration("WebCore.FeatureObserver", PageDestru ction, NumberOfFeatures);
44 44
45 updateMeasurements();
46 }
47
48 void FeatureObserver::updateMeasurements()
49 {
50 HistogramSupport::histogramEnumeration("WebCore.FeatureObserver", PageVisits , NumberOfFeatures);
45 if (!m_featureBits) 51 if (!m_featureBits)
46 return; 52 return;
47 53
48 for (unsigned i = 0; i < NumberOfFeatures; ++i) { 54 for (unsigned i = 0; i < NumberOfFeatures; ++i) {
49 if (m_featureBits->quickGet(i)) 55 if (m_featureBits->quickGet(i))
50 HistogramSupport::histogramEnumeration("WebCore.FeatureObserver", i, NumberOfFeatures); 56 HistogramSupport::histogramEnumeration("WebCore.FeatureObserver", i, NumberOfFeatures);
51 } 57 }
58
59 m_featureBits->clearAll();
60 }
61
62 void FeatureObserver::didCommitLoad()
63 {
64 updateMeasurements();
52 } 65 }
53 66
54 void FeatureObserver::observe(Document* document, Feature feature) 67 void FeatureObserver::observe(Document* document, Feature feature)
55 { 68 {
56 if (!document) 69 if (!document)
57 return; 70 return;
58 71
59 Page* page = document->page(); 72 Page* page = document->page();
60 if (!page) 73 if (!page)
61 return; 74 return;
62 75
63 page->featureObserver()->didObserve(feature); 76 page->featureObserver()->didObserve(feature);
64 } 77 }
65 78
66 void FeatureObserver::observe(DOMWindow* domWindow, Feature feature) 79 void FeatureObserver::observe(DOMWindow* domWindow, Feature feature)
67 { 80 {
68 ASSERT(domWindow); 81 ASSERT(domWindow);
69 observe(domWindow->document(), feature); 82 observe(domWindow->document(), feature);
70 } 83 }
71 84
72 } // namespace WebCore 85 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/page/FeatureObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698