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

Side by Side Diff: Source/core/frame/UseCounter.h

Issue 342103003: Support UseCounter in dedicated workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Support countDeprecation Created 6 years, 6 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 | Source/core/frame/UseCounter.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) 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 TextAutosizing = 274, 272 TextAutosizing = 274,
273 TextAutosizingLayout = 275, 273 TextAutosizingLayout = 275,
274 HTMLAnchorElementPingAttribute = 276, 274 HTMLAnchorElementPingAttribute = 276,
275 InsertAdjacentHTML = 278, 275 InsertAdjacentHTML = 278,
276 SVGClassName = 279, 276 SVGClassName = 279,
277 HTMLAppletElement = 280, 277 HTMLAppletElement = 280,
278 HTMLMediaElementSeekToFragmentStart = 281, 278 HTMLMediaElementSeekToFragmentStart = 281,
279 HTMLMediaElementPauseAtFragmentEnd = 282, 279 HTMLMediaElementPauseAtFragmentEnd = 282,
280 PrefixedWindowURL = 283, 280 PrefixedWindowURL = 283,
281 PrefixedWorkerURL = 284, 281 PrefixedWorkerURL = 284, // This didn't work because of crbug.com/376039 . Available since M37.
282 WindowOrientation = 285, 282 WindowOrientation = 285,
283 DOMStringListContains = 286, 283 DOMStringListContains = 286,
284 DocumentCaptureEvents = 287, 284 DocumentCaptureEvents = 287,
285 DocumentReleaseEvents = 288, 285 DocumentReleaseEvents = 288,
286 WindowCaptureEvents = 289, 286 WindowCaptureEvents = 289,
287 WindowReleaseEvents = 290, 287 WindowReleaseEvents = 290,
288 PrefixedGamepad = 291, 288 PrefixedGamepad = 291,
289 ElementAnimateKeyframeListEffectObjectTiming = 292, 289 ElementAnimateKeyframeListEffectObjectTiming = 292,
290 ElementAnimateKeyframeListEffectDoubleTiming = 293, 290 ElementAnimateKeyframeListEffectDoubleTiming = 293,
291 ElementAnimateKeyframeListEffectNoTiming = 294, 291 ElementAnimateKeyframeListEffectNoTiming = 294,
292 DocumentXPathCreateExpression = 295, 292 DocumentXPathCreateExpression = 295,
293 DocumentXPathCreateNSResolver = 296, 293 DocumentXPathCreateNSResolver = 296,
294 DocumentXPathEvaluate = 297, 294 DocumentXPathEvaluate = 297,
295 AttrGetValue = 298, 295 AttrGetValue = 298,
296 AttrSetValue = 299, 296 AttrSetValue = 299,
297 AnimationConstructorKeyframeListEffectObjectTiming = 300, 297 AnimationConstructorKeyframeListEffectObjectTiming = 300,
298 AnimationConstructorKeyframeListEffectDoubleTiming = 301, 298 AnimationConstructorKeyframeListEffectDoubleTiming = 301,
299 AnimationConstructorKeyframeListEffectNoTiming = 302, 299 AnimationConstructorKeyframeListEffectNoTiming = 302,
300 AttrSetValueWithElement = 303, 300 AttrSetValueWithElement = 303,
301 PrefixedCancelAnimationFrame = 304, 301 PrefixedCancelAnimationFrame = 304,
302 PrefixedCancelRequestAnimationFrame = 305, 302 PrefixedCancelRequestAnimationFrame = 305,
303 NamedNodeMapGetNamedItem = 306, 303 NamedNodeMapGetNamedItem = 306,
304 NamedNodeMapSetNamedItem = 307, 304 NamedNodeMapSetNamedItem = 307,
305 NamedNodeMapRemoveNamedItem = 308, 305 NamedNodeMapRemoveNamedItem = 308,
306 NamedNodeMapItem = 309, 306 NamedNodeMapItem = 309,
307 NamedNodeMapGetNamedItemNS = 310, 307 NamedNodeMapGetNamedItemNS = 310,
308 NamedNodeMapSetNamedItemNS = 311, 308 NamedNodeMapSetNamedItemNS = 311,
309 NamedNodeMapRemoveNamedItemNS = 312, 309 NamedNodeMapRemoveNamedItemNS = 312,
310 OpenWebDatabaseInWorker = 313, // This doesn't work because of crbug.com /376039. 310 OpenWebDatabaseInWorker = 313, // This didn't work because of crbug.com/ 376039. Available since M37.
311 OpenWebDatabaseSyncInWorker = 314, // This doesn't work because of crbug .com/376039. 311 OpenWebDatabaseSyncInWorker = 314, // This didn't work because of crbug. com/376039. Available since M37.
312 PrefixedAllowFullscreenAttribute = 315, 312 PrefixedAllowFullscreenAttribute = 315,
313 XHRProgressEventPosition = 316, 313 XHRProgressEventPosition = 316,
314 XHRProgressEventTotalSize = 317, 314 XHRProgressEventTotalSize = 317,
315 PrefixedDocumentIsFullscreen = 318, 315 PrefixedDocumentIsFullscreen = 318,
316 PrefixedDocumentFullScreenKeyboardInputAllowed = 319, 316 PrefixedDocumentFullScreenKeyboardInputAllowed = 319,
317 PrefixedDocumentCurrentFullScreenElement = 320, 317 PrefixedDocumentCurrentFullScreenElement = 320,
318 PrefixedDocumentCancelFullScreen = 321, 318 PrefixedDocumentCancelFullScreen = 321,
319 PrefixedDocumentFullscreenEnabled = 322, 319 PrefixedDocumentFullscreenEnabled = 322,
320 PrefixedDocumentFullscreenElement = 323, 320 PrefixedDocumentFullscreenElement = 323,
321 PrefixedDocumentExitFullscreen = 324, 321 PrefixedDocumentExitFullscreen = 324,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 CSSDeepCombinator = 471, 471 CSSDeepCombinator = 471,
472 // Add new features immediately above this line. Don't change assigned 472 // Add new features immediately above this line. Don't change assigned
473 // numbers of any item, and don't reuse removed slots. 473 // numbers of any item, and don't reuse removed slots.
474 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me trics/histograms/ 474 // Also, run update_use_counter_feature_enum.py in chromium/src/tools/me trics/histograms/
475 // to update the UMA mapping. 475 // to update the UMA mapping.
476 NumberOfFeatures, // This enum value must be last. 476 NumberOfFeatures, // This enum value must be last.
477 }; 477 };
478 478
479 // "count" sets the bit for this feature to 1. Repeated calls are ignored. 479 // "count" sets the bit for this feature to 1. Repeated calls are ignored.
480 static void count(const Document&, Feature); 480 static void count(const Document&, Feature);
481 // This doesn't count for non-Document ExecutionContext. 481 // This doesn't count for ExecutionContexts for shared workers and service
482 // workers.
482 static void count(const ExecutionContext*, Feature); 483 static void count(const ExecutionContext*, Feature);
483 void count(CSSParserContext, CSSPropertyID); 484 void count(CSSParserContext, CSSPropertyID);
484 void count(Feature); 485 void count(Feature);
485 486
486 // "countDeprecation" sets the bit for this feature to 1, and sends a deprec ation 487 // "countDeprecation" sets the bit for this feature to 1, and sends a deprec ation
487 // warning to the console. Repeated calls are ignored. 488 // warning to the console. Repeated calls are ignored.
488 // 489 //
489 // Be considerate to developers' consoles: features should only send depreca tion warnings 490 // Be considerate to developers' consoles: features should only send
490 // when we're actively interested in removing them from the platform. 491 // deprecation warnings when we're actively interested in removing them from
492 // the platform.
493 //
494 // The ExecutionContext* overload doesn't work for shared workers and
495 // service workers.
491 static void countDeprecation(const DOMWindow*, Feature); 496 static void countDeprecation(const DOMWindow*, Feature);
492 static void countDeprecation(ExecutionContext*, Feature); 497 static void countDeprecation(ExecutionContext*, Feature);
493 static void countDeprecation(const Document&, Feature); 498 static void countDeprecation(const Document&, Feature);
494 String deprecationMessage(Feature); 499 String deprecationMessage(Feature);
495 500
496 void didCommitLoad(); 501 void didCommitLoad();
497 502
498 static UseCounter* getFrom(const Document*); 503 static UseCounter* getFrom(const Document*);
499 static UseCounter* getFrom(const CSSStyleSheet*); 504 static UseCounter* getFrom(const CSSStyleSheet*);
500 static UseCounter* getFrom(const StyleSheetContents*); 505 static UseCounter* getFrom(const StyleSheetContents*);
(...skipping 26 matching lines...) Expand all
527 532
528 void updateMeasurements(); 533 void updateMeasurements();
529 534
530 OwnPtr<BitVector> m_countBits; 535 OwnPtr<BitVector> m_countBits;
531 BitVector m_CSSFeatureBits; 536 BitVector m_CSSFeatureBits;
532 }; 537 };
533 538
534 } // namespace WebCore 539 } // namespace WebCore
535 540
536 #endif // UseCounter_h 541 #endif // UseCounter_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698