| 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 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/CSSPropertyNames.h" | 29 #include "core/CSSPropertyNames.h" |
| 30 #include "wtf/BitVector.h" | 30 #include "wtf/BitVector.h" |
| 31 #include "wtf/Noncopyable.h" | 31 #include "wtf/Noncopyable.h" |
| 32 #include "wtf/OwnPtr.h" | 32 #include "wtf/OwnPtr.h" |
| 33 #include "wtf/PassOwnPtr.h" | 33 #include "wtf/PassOwnPtr.h" |
| 34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 class CSSStyleSheet; | 38 class CSSStyleSheet; |
| 39 class DOMWindow; | 39 class LocalDOMWindow; |
| 40 class Document; | 40 class Document; |
| 41 class ExecutionContext; | 41 class ExecutionContext; |
| 42 class StyleSheetContents; | 42 class StyleSheetContents; |
| 43 | 43 |
| 44 // UseCounter is used for counting the number of times features of | 44 // UseCounter is used for counting the number of times features of |
| 45 // Blink are used on real web pages and help us know commonly | 45 // Blink are used on real web pages and help us know commonly |
| 46 // features are used and thus when it's safe to remove or change them. | 46 // features are used and thus when it's safe to remove or change them. |
| 47 // | 47 // |
| 48 // The Chromium Content layer controls what is done with this data. | 48 // The Chromium Content layer controls what is done with this data. |
| 49 // For instance, in Google Chrome, these counts are submitted | 49 // For instance, in Google Chrome, these counts are submitted |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 // This doesn't count for non-Document ExecutionContext. | 472 // This doesn't count for non-Document ExecutionContext. |
| 473 static void count(const ExecutionContext*, Feature); | 473 static void count(const ExecutionContext*, Feature); |
| 474 void count(CSSParserContext, CSSPropertyID); | 474 void count(CSSParserContext, CSSPropertyID); |
| 475 void count(Feature); | 475 void count(Feature); |
| 476 | 476 |
| 477 // "countDeprecation" sets the bit for this feature to 1, and sends a deprec
ation | 477 // "countDeprecation" sets the bit for this feature to 1, and sends a deprec
ation |
| 478 // warning to the console. Repeated calls are ignored. | 478 // warning to the console. Repeated calls are ignored. |
| 479 // | 479 // |
| 480 // Be considerate to developers' consoles: features should only send depreca
tion warnings | 480 // Be considerate to developers' consoles: features should only send depreca
tion warnings |
| 481 // when we're actively interested in removing them from the platform. | 481 // when we're actively interested in removing them from the platform. |
| 482 static void countDeprecation(const DOMWindow*, Feature); | 482 static void countDeprecation(const LocalDOMWindow*, Feature); |
| 483 static void countDeprecation(ExecutionContext*, Feature); | 483 static void countDeprecation(ExecutionContext*, Feature); |
| 484 static void countDeprecation(const Document&, Feature); | 484 static void countDeprecation(const Document&, Feature); |
| 485 String deprecationMessage(Feature); | 485 String deprecationMessage(Feature); |
| 486 | 486 |
| 487 void didCommitLoad(); | 487 void didCommitLoad(); |
| 488 | 488 |
| 489 static UseCounter* getFrom(const Document*); | 489 static UseCounter* getFrom(const Document*); |
| 490 static UseCounter* getFrom(const CSSStyleSheet*); | 490 static UseCounter* getFrom(const CSSStyleSheet*); |
| 491 static UseCounter* getFrom(const StyleSheetContents*); | 491 static UseCounter* getFrom(const StyleSheetContents*); |
| 492 | 492 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 518 | 518 |
| 519 void updateMeasurements(); | 519 void updateMeasurements(); |
| 520 | 520 |
| 521 OwnPtr<BitVector> m_countBits; | 521 OwnPtr<BitVector> m_countBits; |
| 522 BitVector m_CSSFeatureBits; | 522 BitVector m_CSSFeatureBits; |
| 523 }; | 523 }; |
| 524 | 524 |
| 525 } // namespace WebCore | 525 } // namespace WebCore |
| 526 | 526 |
| 527 #endif // UseCounter_h | 527 #endif // UseCounter_h |
| OLD | NEW |