| OLD | NEW |
| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef UseCounter_h | 26 #ifndef UseCounter_h |
| 27 #define UseCounter_h | 27 #define UseCounter_h |
| 28 | 28 |
| 29 #include "core/CSSPropertyNames.h" | 29 #include "core/CSSPropertyNames.h" |
| 30 #include "core/frame/UseByOriginCounter.h" |
| 30 #include "wtf/BitVector.h" | 31 #include "wtf/BitVector.h" |
| 31 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 32 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 33 #include "wtf/PassOwnPtr.h" | 34 #include "wtf/PassOwnPtr.h" |
| 34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 35 #include <v8.h> | 36 #include <v8.h> |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 class CSSStyleSheet; | 40 class CSSStyleSheet; |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 // doesn't count the usage but only sends a console warning. | 669 // doesn't count the usage but only sends a console warning. |
| 669 static void countDeprecation(const LocalFrame*, Feature); | 670 static void countDeprecation(const LocalFrame*, Feature); |
| 670 static void countDeprecation(ExecutionContext*, Feature); | 671 static void countDeprecation(ExecutionContext*, Feature); |
| 671 static void countDeprecation(const Document&, Feature); | 672 static void countDeprecation(const Document&, Feature); |
| 672 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation() | 673 // Use countDeprecationIfNotPrivateScript() instead of countDeprecation() |
| 673 // if you don't want to count metrics in private scripts. You should use | 674 // if you don't want to count metrics in private scripts. You should use |
| 674 // countDeprecationIfNotPrivateScript() in a binding layer. | 675 // countDeprecationIfNotPrivateScript() in a binding layer. |
| 675 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex
t*, Feature); | 676 static void countDeprecationIfNotPrivateScript(v8::Isolate*, ExecutionContex
t*, Feature); |
| 676 static String deprecationMessage(Feature); | 677 static String deprecationMessage(Feature); |
| 677 | 678 |
| 679 UseByOriginCounter& useByOriginCounter() { return m_useByOriginCounter; } |
| 680 |
| 678 void didCommitLoad(); | 681 void didCommitLoad(); |
| 679 | 682 |
| 680 static UseCounter* getFrom(const Document*); | 683 static UseCounter* getFrom(const Document*); |
| 681 static UseCounter* getFrom(const CSSStyleSheet*); | 684 static UseCounter* getFrom(const CSSStyleSheet*); |
| 682 static UseCounter* getFrom(const StyleSheetContents*); | 685 static UseCounter* getFrom(const StyleSheetContents*); |
| 683 | 686 |
| 684 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); | 687 static int mapCSSPropertyIdToCSSSampleIdForHistogram(int id); |
| 685 | 688 |
| 686 static void muteForInspector(); | 689 static void muteForInspector(); |
| 687 static void unmuteForInspector(); | 690 static void unmuteForInspector(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 712 }; | 715 }; |
| 713 | 716 |
| 714 private: | 717 private: |
| 715 static int m_muteCount; | 718 static int m_muteCount; |
| 716 | 719 |
| 717 bool recordMeasurement(Feature feature) { return m_countBits.recordMeasureme
nt(feature); } | 720 bool recordMeasurement(Feature feature) { return m_countBits.recordMeasureme
nt(feature); } |
| 718 void updateMeasurements(); | 721 void updateMeasurements(); |
| 719 | 722 |
| 720 CountBits m_countBits; | 723 CountBits m_countBits; |
| 721 BitVector m_CSSFeatureBits; | 724 BitVector m_CSSFeatureBits; |
| 725 UseByOriginCounter m_useByOriginCounter; |
| 722 }; | 726 }; |
| 723 | 727 |
| 724 } // namespace blink | 728 } // namespace blink |
| 725 | 729 |
| 726 #endif // UseCounter_h | 730 #endif // UseCounter_h |
| OLD | NEW |