<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[128788] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/128788">128788</a></dd>
<dt>Author</dt> <dd>abarth@webkit.org</dd>
<dt>Date</dt> <dd>2012-09-17 11:53:35 -0700 (Mon, 17 Sep 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>We should make collecting metrics easier by adding an IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=96837

Reviewed by Kentaro Hara.

Currently it is too hard to set up a good measurement experiment to see
whether we can safely remove a feature (including vendor-prefixed
features). This patch introduces the [V8MeasureAs] IDL attribute to make
that process easier.

When you add the [V8MeasureAs] IDL property to an API, we'll count what
fraction of Page objects used that API.

* Modules/notifications/DOMWindowNotifications.idl:
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateFeatureObservation):
(GenerateNormalAttrGetter):
(GenerateReplaceableAttrSetter):
(GenerateNormalAttrSetter):
(GenerateOverloadedFunctionCallback):
(GenerateFunctionCallback):
(GenerateConstructorCallback):
(GenerateNamedConstructorCallback):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::testObjAttrAttrGetter):
(WebCore::TestObjV8Internal::testObjAttrAttrSetter):
(WebCore::TestObjV8Internal::objMethodCallback):
(WebCore):
* page/Page.h:
(WebCore::Page::featureObserver):
(Page):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsDOMWindowNotificationsidl">trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl</a></li>
<li><a href="#trunkSourceWebCoreTargetpri">trunk/Source/WebCore/Target.pri</a></li>
<li><a href="#trunkSourceWebCoreWebCoregypi">trunk/Source/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcprojWebCorevcproj">trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorV8pm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestV8V8TestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestV8V8TestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestV8V8TestNodecpp">trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestV8V8TestObjcpp">trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestV8V8TestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepageFeatureObservercpp">trunk/Source/WebCore/page/FeatureObserver.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFeatureObserverh">trunk/Source/WebCore/page/FeatureObserver.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/CMakeLists.txt        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -1685,6 +1685,7 @@
</span><span class="cx">     page/DragController.cpp
</span><span class="cx">     page/EventHandler.cpp
</span><span class="cx">     page/EventSource.cpp
</span><ins>+    page/FeatureObserver.cpp
</ins><span class="cx">     page/FocusController.cpp
</span><span class="cx">     page/Frame.cpp
</span><span class="cx">     page/FrameActionScheduler.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/ChangeLog        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2012-09-17  Adam Barth  &lt;abarth@webkit.org&gt;
+
+        We should make collecting metrics easier by adding an IDL attribute
+        https://bugs.webkit.org/show_bug.cgi?id=96837
+
+        Reviewed by Kentaro Hara.
+
+        Currently it is too hard to set up a good measurement experiment to see
+        whether we can safely remove a feature (including vendor-prefixed
+        features). This patch introduces the [V8MeasureAs] IDL attribute to make
+        that process easier.
+
+        When you add the [V8MeasureAs] IDL property to an API, we'll count what
+        fraction of Page objects used that API.
+
+        * Modules/notifications/DOMWindowNotifications.idl:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateFeatureObservation):
+        (GenerateNormalAttrGetter):
+        (GenerateReplaceableAttrSetter):
+        (GenerateNormalAttrSetter):
+        (GenerateOverloadedFunctionCallback):
+        (GenerateFunctionCallback):
+        (GenerateConstructorCallback):
+        (GenerateNamedConstructorCallback):
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjV8Internal::testObjAttrAttrGetter):
+        (WebCore::TestObjV8Internal::testObjAttrAttrSetter):
+        (WebCore::TestObjV8Internal::objMethodCallback):
+        (WebCore):
+        * page/Page.h:
+        (WebCore::Page::featureObserver):
+        (Page):
+
</ins><span class="cx"> 2012-09-17  Bear Travis  &lt;betravis@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Exclusions] Enable shape-inside for percentage lengths based on logical height
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -3968,6 +3968,8 @@
</span><span class="cx">         Source/WebCore/page/EventHandler.h \
</span><span class="cx">         Source/WebCore/page/EventSource.cpp \
</span><span class="cx">         Source/WebCore/page/EventSource.h \
</span><ins>+        Source/WebCore/page/FeatureObserver.cpp \
+        Source/WebCore/page/FeatureObserver.h \
</ins><span class="cx">         Source/WebCore/page/FocusController.cpp \
</span><span class="cx">         Source/WebCore/page/FocusController.h \
</span><span class="cx">         Source/WebCore/page/FocusDirection.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsDOMWindowNotificationsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">         Supplemental=DOMWindow
</span><span class="cx">     ] DOMWindowNotifications {
</span><span class="cx"> #if defined(ENABLE_LEGACY_NOTIFICATIONS) &amp;&amp; ENABLE_LEGACY_NOTIFICATIONS
</span><del>-        readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
</del><ins>+        readonly attribute [V8EnabledAtRuntime, V8MeasureAs=LegacyNotifications] NotificationCenter webkitNotifications;
</ins><span class="cx"> #endif
</span><span class="cx"> #if defined(ENABLE_NOTIFICATIONS) &amp;&amp; ENABLE_NOTIFICATIONS
</span><span class="cx">         attribute NotificationConstructor Notification;
</span></span></pre></div>
<a id="trunkSourceWebCoreTargetpri"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Target.pri (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Target.pri        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/Target.pri        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -865,6 +865,7 @@
</span><span class="cx">     page/DragController.cpp \
</span><span class="cx">     page/EventHandler.cpp \
</span><span class="cx">     page/EventSource.cpp \
</span><ins>+    page/FeatureObserver.cpp \
</ins><span class="cx">     page/FocusController.cpp \
</span><span class="cx">     page/Frame.cpp \
</span><span class="cx">     page/FrameActionScheduler.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.gypi (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.gypi        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/WebCore.gypi        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -232,6 +232,7 @@
</span><span class="cx">             'page/DragState.h',
</span><span class="cx">             'page/EditorClient.h',
</span><span class="cx">             'page/EventHandler.h',
</span><ins>+            'page/FeatureObserver.h',
</ins><span class="cx">             'page/FocusController.h',
</span><span class="cx">             'page/FocusDirection.h',
</span><span class="cx">             'page/Frame.h',
</span><span class="lines">@@ -3113,6 +3114,7 @@
</span><span class="cx">             'page/EventHandler.cpp',
</span><span class="cx">             'page/EventSource.cpp',
</span><span class="cx">             'page/EventSource.h',
</span><ins>+            'page/FeatureObserver.cpp',
</ins><span class="cx">             'page/FocusController.cpp',
</span><span class="cx">             'page/Frame.cpp',
</span><span class="cx">             'page/FrameActionScheduler.cpp',
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -27051,6 +27051,14 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><ins>+                                RelativePath=&quot;..\page\FeatureObserver.cpp&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
+                                RelativePath=&quot;..\page\FeatureObserver.h&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
</ins><span class="cx">                                 RelativePath=&quot;..\page\FocusController.cpp&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -3690,6 +3690,8 @@
</span><span class="cx">                 97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; };
</span><span class="cx">                 97C471DB12F925BD0086354B /* ContentSecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */; };
</span><span class="cx">                 97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                97C740141603F7A10011FF2D /* FeatureObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97C740121603F7A10011FF2D /* FeatureObserver.cpp */; };
+                97C740151603F7A10011FF2D /* FeatureObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C740131603F7A10011FF2D /* FeatureObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */; };
</span><span class="cx">                 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 97DCE20110807C750057D394 /* HistoryController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DCE1FF10807C750057D394 /* HistoryController.cpp */; };
</span><span class="lines">@@ -10915,6 +10917,8 @@
</span><span class="cx">                 97C1F552122855CB00EDE616 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLToken.h; path = parser/HTMLToken.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSecurityPolicy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentSecurityPolicy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                97C740121603F7A10011FF2D /* FeatureObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FeatureObserver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                97C740131603F7A10011FF2D /* FeatureObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureObserver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowProperty.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowProperty.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 97DCE1FF10807C750057D394 /* HistoryController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15814,6 +15818,8 @@
</span><span class="cx">                                 E0FEF371B17C53EAC1C1FBEE /* EventSource.h */,
</span><span class="cx">                                 E0FEF371B07C53EAC1C1FBEE /* EventSource.idl */,
</span><span class="cx">                                 14993BE30B2F2B1C0050497F /* FocusController.cpp */,
</span><ins>+                                97C740121603F7A10011FF2D /* FeatureObserver.cpp */,
+                                97C740131603F7A10011FF2D /* FeatureObserver.h */,
</ins><span class="cx">                                 14993BE40B2F2B1C0050497F /* FocusController.h */,
</span><span class="cx">                                 062287830B4DB322000C34DF /* FocusDirection.h */,
</span><span class="cx">                                 65BF02290974816300C43196 /* Frame.cpp */,
</span><span class="lines">@@ -23406,6 +23412,7 @@
</span><span class="cx">                                 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */,
</span><span class="cx">                                 FD31609512B026F700C1A359 /* FFTConvolver.h in Headers */,
</span><span class="cx">                                 FD31609712B026F700C1A359 /* FFTFrame.h in Headers */,
</span><ins>+                                97C740151603F7A10011FF2D /* FeatureObserver.h in Headers */,
</ins><span class="cx">                                 976D6C81122B8A3D001FD1F7 /* File.h in Headers */,
</span><span class="cx">                                 893C47A71238908B002B3D86 /* FileCallback.h in Headers */,
</span><span class="cx">                                 066C772B0AB603B700238CC4 /* FileChooser.h in Headers */,
</span><span class="lines">@@ -26658,6 +26665,7 @@
</span><span class="cx">                                 FD31609412B026F700C1A359 /* FFTConvolver.cpp in Sources */,
</span><span class="cx">                                 FD31609612B026F700C1A359 /* FFTFrame.cpp in Sources */,
</span><span class="cx">                                 FD3160C012B0272A00C1A359 /* FFTFrameMac.cpp in Sources */,
</span><ins>+                                97C740141603F7A10011FF2D /* FeatureObserver.cpp in Sources */,
</ins><span class="cx">                                 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
</span><span class="cx">                                 934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */,
</span><span class="cx">                                 89878561122CA064003AABDA /* FileEntry.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorV8pm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -813,6 +813,18 @@
</span><span class="cx"> END
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GenerateFeatureObservation
+{
+    my $measureAs = shift;
+
+    if ($measureAs) {
+        AddToImplIncludes(&quot;FeatureObserver.h&quot;);
+        return &quot;    FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureObserver::${measureAs});\n&quot;;
+    }
+
+    return &quot;&quot;;
+}
+
</ins><span class="cx"> sub GenerateNormalAttrGetter
</span><span class="cx"> {
</span><span class="cx">     my $attribute = shift;
</span><span class="lines">@@ -836,8 +848,9 @@
</span><span class="cx">     push(@implContentDecls, &lt;&lt;END);
</span><span class="cx"> static v8::Handle&lt;v8::Value&gt; ${attrName}AttrGetter(v8::Local&lt;v8::String&gt; name, const v8::AccessorInfo&amp; info)
</span><span class="cx"> {
</span><del>-    INC_STATS(\&quot;DOM.$implClassName.$attrName._get\&quot;);
</del><ins>+    INC_STATS(&quot;DOM.$implClassName.$attrName._get&quot;);
</ins><span class="cx"> END
</span><ins>+    push(@implContentDecls, GenerateFeatureObservation($attrExt-&gt;{&quot;V8MeasureAs&quot;}));
</ins><span class="cx"> 
</span><span class="cx">     if ($svgNativeType) {
</span><span class="cx">         my $svgWrappedNativeType = $codeGenerator-&gt;GetSVGWrappedTypeNeedingTearOff($implClassName);
</span><span class="lines">@@ -1085,6 +1098,7 @@
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.$implClassName.replaceable._set&quot;);
</span><span class="cx"> END
</span><ins>+    push(@implContentDecls, GenerateFeatureObservation($dataNode-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;}));
</ins><span class="cx"> 
</span><span class="cx">     if ($implClassName eq &quot;DOMWindow&quot; || $dataNode-&gt;extendedAttributes-&gt;{&quot;CheckSecurity&quot;}) {
</span><span class="cx">         AddToImplIncludes(&quot;Frame.h&quot;);
</span><span class="lines">@@ -1117,6 +1131,7 @@
</span><span class="cx"> 
</span><span class="cx">     push(@implContentDecls, &quot;static void ${attrName}AttrSetter(v8::Local&lt;v8::String&gt; name, v8::Local&lt;v8::Value&gt; value, const v8::AccessorInfo&amp; info)\n{\n&quot;);
</span><span class="cx">     push(@implContentDecls, &quot;    INC_STATS(\&quot;DOM.$implClassName.$attrName._set\&quot;);\n&quot;);
</span><ins>+    push(@implContentDecls, GenerateFeatureObservation($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;}));
</ins><span class="cx"> 
</span><span class="cx">     # If the &quot;StrictTypeChecking&quot; extended attribute is present, and the attribute's type is an
</span><span class="cx">     # interface type, then if the incoming value does not implement that interface, a TypeError is
</span><span class="lines">@@ -1423,6 +1438,7 @@
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(\&quot;DOM.$implClassName.$name\&quot;);
</span><span class="cx"> END
</span><ins>+    push(@implContentDecls, GenerateFeatureObservation($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;}));
</ins><span class="cx"> 
</span><span class="cx">     foreach my $overload (@{$function-&gt;{overloads}}) {
</span><span class="cx">         my ($numMandatoryParams, $parametersCheck) = GenerateFunctionParametersCheck($overload);
</span><span class="lines">@@ -1473,6 +1489,7 @@
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(\&quot;DOM.$implClassName.$name\&quot;);
</span><span class="cx"> END
</span><ins>+    push(@implContentDecls, GenerateFeatureObservation($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;}));
</ins><span class="cx"> 
</span><span class="cx">     push(@implContentDecls, GenerateArgumentsCountCheck($function, $dataNode));
</span><span class="cx"> 
</span><span class="lines">@@ -1799,13 +1816,15 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    my $maybeObserveFeature = GenerateFeatureObservation($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;});
+
</ins><span class="cx">     my @beforeArgumentList;
</span><span class="cx">     my @afterArgumentList;
</span><span class="cx">     push(@implContent, &lt;&lt;END);
</span><span class="cx"> v8::Handle&lt;v8::Value&gt; V8${implClassName}::constructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.${implClassName}.Constructor&quot;);
</span><del>-
</del><ins>+    ${maybeObserveFeature}
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -1976,6 +1995,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    my $maybeObserveFeature = GenerateFeatureObservation($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;V8MeasureAs&quot;});
+
</ins><span class="cx">     my @beforeArgumentList;
</span><span class="cx">     my @afterArgumentList;
</span><span class="cx"> 
</span><span class="lines">@@ -1996,7 +2017,7 @@
</span><span class="cx"> static v8::Handle&lt;v8::Value&gt; V8${implClassName}ConstructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.${implClassName}.Constructor&quot;);
</span><del>-
</del><ins>+    ${maybeObserveFeature}
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -119,5 +119,6 @@
</span><span class="cx"> V8EnabledAtRuntime=*
</span><span class="cx"> V8EnabledPerContext=*
</span><span class="cx"> V8GenerateIsReachable=ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot
</span><ins>+V8MeasureAs=*
</ins><span class="cx"> V8ReadOnly
</span><span class="cx"> V8Unforgeable
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">         attribute long long                longLongAttr;
</span><span class="cx">         attribute unsigned long long       unsignedLongLongAttr;
</span><span class="cx">         attribute DOMString                stringAttr;
</span><del>-        attribute TestObj                  testObjAttr;
</del><ins>+        attribute [V8MeasureAs=TestFeature] TestObj testObjAttr;
</ins><span class="cx"> 
</span><span class="cx">         JS, V8
</span><span class="cx">         // WK_ucfirst, WK_lcfirst exceptional cases.
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">         void    voidMethodWithArgs(in long longArg, in DOMString strArg, in TestObj objArg);
</span><span class="cx">         long    longMethod();
</span><span class="cx">         long    longMethodWithArgs(in long longArg, in DOMString strArg, in TestObj objArg);
</span><del>-        TestObj objMethod();
</del><ins>+        [V8MeasureAs=TestFeature] TestObj objMethod();
</ins><span class="cx">         TestObj objMethodWithArgs(in long longArg, in DOMString strArg, in TestObj objArg);
</span><span class="cx"> 
</span><span class="cx">         void methodWithSequenceArg(in sequence&lt;ScriptProfile&gt; sequenceArg);
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">         // 'Custom' extended attribute
</span><span class="cx">         attribute [Custom] long            customAttr;
</span><del>-        [Custom] void customMethod();
</del><ins>+        [Custom, V8MeasureAs=CustomTestFeature] void customMethod();
</ins><span class="cx">         [Custom] void customMethodWithArgs(in long longArg, in DOMString strArg, in TestObj objArg);
</span><span class="cx"> 
</span><span class="cx">         void addEventListener(in DOMString type, 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestV8V8TestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> v8::Handle&lt;v8::Value&gt; V8TestInterface::constructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestInterface.Constructor&quot;);
</span><del>-
</del><ins>+    
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestV8V8TestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> static v8::Handle&lt;v8::Value&gt; V8TestNamedConstructorConstructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestNamedConstructor.Constructor&quot;);
</span><del>-
</del><ins>+    
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestV8V8TestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> v8::Handle&lt;v8::Value&gt; V8TestNode::constructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestNode.Constructor&quot;);
</span><del>-
</del><ins>+    
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestV8V8TestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;DOMStringList.h&quot;
</span><span class="cx"> #include &quot;Dictionary.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><ins>+#include &quot;FeatureObserver.h&quot;
</ins><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="lines">@@ -227,6 +228,7 @@
</span><span class="cx"> static v8::Handle&lt;v8::Value&gt; testObjAttrAttrGetter(v8::Local&lt;v8::String&gt; name, const v8::AccessorInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestObj.testObjAttr._get&quot;);
</span><ins>+    FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureObserver::TestFeature);
</ins><span class="cx">     TestObj* imp = V8TestObj::toNative(info.Holder());
</span><span class="cx">     return toV8(imp-&gt;testObjAttr(), info.Holder(), info.GetIsolate());
</span><span class="cx"> }
</span><span class="lines">@@ -234,6 +236,7 @@
</span><span class="cx"> static void testObjAttrAttrSetter(v8::Local&lt;v8::String&gt; name, v8::Local&lt;v8::Value&gt; value, const v8::AccessorInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestObj.testObjAttr._set&quot;);
</span><ins>+    FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureObserver::TestFeature);
</ins><span class="cx">     TestObj* imp = V8TestObj::toNative(info.Holder());
</span><span class="cx">     TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle&lt;v8::Object&gt;::Cast(value)) : 0;
</span><span class="cx">     imp-&gt;setTestObjAttr(WTF::getPtr(v));
</span><span class="lines">@@ -1094,6 +1097,7 @@
</span><span class="cx"> static v8::Handle&lt;v8::Value&gt; objMethodCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestObj.objMethod&quot;);
</span><ins>+    FeatureObserver::observe(activeDOMWindow(BindingState::instance()), FeatureObserver::TestFeature);
</ins><span class="cx">     TestObj* imp = V8TestObj::toNative(args.Holder());
</span><span class="cx">     return toV8(imp-&gt;objMethod(), args.Holder(), args.GetIsolate());
</span><span class="cx"> }
</span><span class="lines">@@ -1928,7 +1932,7 @@
</span><span class="cx">     {&quot;unsignedLongLongAttr&quot;, TestObjV8Internal::unsignedLongLongAttrAttrGetter, TestObjV8Internal::unsignedLongLongAttrAttrSetter, 0 /* no data */, static_cast&lt;v8::AccessControl&gt;(v8::DEFAULT), static_cast&lt;v8::PropertyAttribute&gt;(v8::None), 0 /* on instance */},
</span><span class="cx">     // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '')
</span><span class="cx">     {&quot;stringAttr&quot;, TestObjV8Internal::stringAttrAttrGetter, TestObjV8Internal::stringAttrAttrSetter, 0 /* no data */, static_cast&lt;v8::AccessControl&gt;(v8::DEFAULT), static_cast&lt;v8::PropertyAttribute&gt;(v8::None), 0 /* on instance */},
</span><del>-    // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
</del><ins>+    // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: 'V8MeasureAs')
</ins><span class="cx">     {&quot;testObjAttr&quot;, TestObjV8Internal::testObjAttrAttrGetter, TestObjV8Internal::testObjAttrAttrSetter, 0 /* no data */, static_cast&lt;v8::AccessControl&gt;(v8::DEFAULT), static_cast&lt;v8::PropertyAttribute&gt;(v8::None), 0 /* on instance */},
</span><span class="cx">     // Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
</span><span class="cx">     {&quot;XMLObjAttr&quot;, TestObjV8Internal::XMLObjAttrAttrGetter, TestObjV8Internal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast&lt;v8::AccessControl&gt;(v8::DEFAULT), static_cast&lt;v8::PropertyAttribute&gt;(v8::None), 0 /* on instance */},
</span><span class="lines">@@ -2122,7 +2126,7 @@
</span><span class="cx"> v8::Handle&lt;v8::Value&gt; V8TestObj::constructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestObj.Constructor&quot;);
</span><del>-
</del><ins>+    
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestV8V8TestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx"> v8::Handle&lt;v8::Value&gt; V8TestSerializedScriptValueInterface::constructorCallback(const v8::Arguments&amp; args)
</span><span class="cx"> {
</span><span class="cx">     INC_STATS(&quot;DOM.TestSerializedScriptValueInterface.Constructor&quot;);
</span><del>-
</del><ins>+    
</ins><span class="cx">     if (!args.IsConstructCall())
</span><span class="cx">         return throwTypeError(&quot;DOM object constructor cannot be called as a function.&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFeatureObservercppfromrev128787trunkSourceWebCoreModulesnotificationsDOMWindowNotificationsidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/FeatureObserver.cpp (from rev 128787, trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl) (0 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FeatureObserver.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/FeatureObserver.cpp        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FeatureObserver.h&quot;
+
+#include &quot;DOMWindow.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;HistogramSupport.h&quot;
+#include &quot;Page.h&quot;
+
+namespace WebCore {
+
+FeatureObserver::FeatureObserver()
+    : m_featureMask(0)
+{
+}
+
+FeatureObserver::~FeatureObserver()
+{
+    // We always log PageDestruction so that we have a scale for the rest of the features.
+    HistogramSupport::histogramEnumeration(&quot;WebCore.FeatureObserver&quot;, PageDestruction, NumberOfFeatures);
+
+    if (!m_featureMask)
+        return;
+
+    for (int i = 0; i &lt; NumberOfFeatures; ++i) {
+        if (m_featureMask &amp; (1 &lt;&lt; i))
+            HistogramSupport::histogramEnumeration(&quot;WebCore.FeatureObserver&quot;, i, NumberOfFeatures);
+    }
+}
+
+void FeatureObserver::observe(DOMWindow* domWindow, Feature feature)
+{
+    Document* document = domWindow-&gt;document();
+    if (!document)
+        return;
+
+    Page* page = document-&gt;page();
+    if (!page)
+        return;
+
+    page-&gt;featureObserver()-&gt;didObserve(feature);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorepageFeatureObserverhfromrev128787trunkSourceWebCoreModulesnotificationsDOMWindowNotificationsidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/FeatureObserver.h (from rev 128787, trunk/Source/WebCore/Modules/notifications/DOMWindowNotifications.idl) (0 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FeatureObserver.h                                (rev 0)
+++ trunk/Source/WebCore/page/FeatureObserver.h        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FeatureObserver_h
+#define FeatureObserver_h
+
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace WebCore {
+
+class DOMWindow;
+
+class FeatureObserver {
+    WTF_MAKE_NONCOPYABLE(FeatureObserver);
+public:
+    FeatureObserver();
+    ~FeatureObserver();
+
+    enum Feature {
+        PageDestruction,
+        LegacyNotifications,
+        // Add new features above this line.
+        NumberOfFeatures, // This enum value must be last.
+    };
+
+    static void observe(DOMWindow*, Feature);
+
+private:
+    void didObserve(Feature feature)
+    {
+        COMPILE_ASSERT(sizeof(m_featureMask) * 8 &gt;= NumberOfFeatures, FeaturesMustNotOverflowBitmask);
+        ASSERT(feature != PageDestruction); // PageDestruction is reserved as a scaling factor.
+        ASSERT(feature &lt; NumberOfFeatures);
+        m_featureMask |= 1 &lt;&lt; static_cast&lt;int&gt;(feature);
+    }
+
+    int m_featureMask;
+};
+
+} // namespace WebCore
+    
+#endif // FeatureObserver_h
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (128787 => 128788)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2012-09-17 18:49:45 UTC (rev 128787)
+++ trunk/Source/WebCore/page/Page.h        2012-09-17 18:53:35 UTC (rev 128788)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #ifndef Page_h
</span><span class="cx"> #define Page_h
</span><span class="cx"> 
</span><ins>+#include &quot;FeatureObserver.h&quot;
</ins><span class="cx"> #include &quot;FrameLoaderTypes.h&quot;
</span><span class="cx"> #include &quot;FindOptions.h&quot;
</span><span class="cx"> #include &quot;LayoutTypes.h&quot;
</span><span class="lines">@@ -197,6 +198,8 @@
</span><span class="cx">         ProgressTracker* progress() const { return m_progress.get(); }
</span><span class="cx">         BackForwardController* backForward() const { return m_backForwardController.get(); }
</span><span class="cx"> 
</span><ins>+        FeatureObserver* featureObserver() { return &amp;m_featureObserver; }
+
</ins><span class="cx">         enum ViewMode {
</span><span class="cx">             ViewModeInvalid,
</span><span class="cx">             ViewModeWindowed,
</span><span class="lines">@@ -391,6 +394,8 @@
</span><span class="cx">         EditorClient* m_editorClient;
</span><span class="cx">         ValidationMessageClient* m_validationMessageClient;
</span><span class="cx"> 
</span><ins>+        FeatureObserver m_featureObserver;
+
</ins><span class="cx">         int m_frameCount;
</span><span class="cx">         String m_groupName;
</span><span class="cx">         bool m_openedByDOM;
</span></span></pre>
</div>
</div>

</body>
</html>