Title: [129182] trunk/Source/WebCore
Revision
129182
Author
[email protected]
Date
2012-09-20 18:20:15 -0700 (Thu, 20 Sep 2012)

Log Message

Measure how often web pages use Worker and SharedWorker
https://bugs.webkit.org/show_bug.cgi?id=97273

Reviewed by Ojan Vafai.

We're not considering removing these features, but it will give us a
baseline idea of how often they're used.

* page/FeatureObserver.h:
* workers/SharedWorker.cpp:
(WebCore::SharedWorker::create):
* workers/Worker.cpp:
(WebCore::Worker::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129181 => 129182)


--- trunk/Source/WebCore/ChangeLog	2012-09-21 01:04:24 UTC (rev 129181)
+++ trunk/Source/WebCore/ChangeLog	2012-09-21 01:20:15 UTC (rev 129182)
@@ -1,3 +1,19 @@
+2012-09-20  Adam Barth  <[email protected]>
+
+        Measure how often web pages use Worker and SharedWorker
+        https://bugs.webkit.org/show_bug.cgi?id=97273
+
+        Reviewed by Ojan Vafai.
+
+        We're not considering removing these features, but it will give us a
+        baseline idea of how often they're used.
+
+        * page/FeatureObserver.h:
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::create):
+        * workers/Worker.cpp:
+        (WebCore::Worker::create):
+
 2012-09-20  Tony Chang  <[email protected]>
 
         [chromium] Enable more clang warnings

Modified: trunk/Source/WebCore/page/FeatureObserver.h (129181 => 129182)


--- trunk/Source/WebCore/page/FeatureObserver.h	2012-09-21 01:04:24 UTC (rev 129181)
+++ trunk/Source/WebCore/page/FeatureObserver.h	2012-09-21 01:20:15 UTC (rev 129182)
@@ -43,6 +43,8 @@
         LegacyNotifications,
         LegacyBlobBuilder,
         PrefixedIndexedDB,
+        WorkerStart,
+        SharedWorkerStart,
         // Add new features above this line.
         NumberOfFeatures, // This enum value must be last.
     };

Modified: trunk/Source/WebCore/workers/SharedWorker.cpp (129181 => 129182)


--- trunk/Source/WebCore/workers/SharedWorker.cpp	2012-09-21 01:04:24 UTC (rev 129181)
+++ trunk/Source/WebCore/workers/SharedWorker.cpp	2012-09-21 01:20:15 UTC (rev 129182)
@@ -35,6 +35,7 @@
 
 #include "SharedWorker.h"
 
+#include "FeatureObserver.h"
 #include "InspectorInstrumentation.h"
 #include "KURL.h"
 #include "MessageChannel.h"
@@ -52,6 +53,9 @@
 
 PassRefPtr<SharedWorker> SharedWorker::create(ScriptExecutionContext* context, const String& url, const String& name, ExceptionCode& ec)
 {
+    ASSERT(isMainThread());
+    FeatureObserver::observe(static_cast<Document*>(context)->domWindow(), FeatureObserver::SharedWorkerStart);
+
     RefPtr<SharedWorker> worker = adoptRef(new SharedWorker(context));
 
     RefPtr<MessageChannel> channel = MessageChannel::create(context);

Modified: trunk/Source/WebCore/workers/Worker.cpp (129181 => 129182)


--- trunk/Source/WebCore/workers/Worker.cpp	2012-09-21 01:04:24 UTC (rev 129181)
+++ trunk/Source/WebCore/workers/Worker.cpp	2012-09-21 01:20:15 UTC (rev 129182)
@@ -38,6 +38,7 @@
 #include "EventListener.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
+#include "FeatureObserver.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "InspectorInstrumentation.h"
@@ -58,6 +59,9 @@
 
 PassRefPtr<Worker> Worker::create(ScriptExecutionContext* context, const String& url, ExceptionCode& ec)
 {
+    ASSERT(isMainThread());
+    FeatureObserver::observe(static_cast<Document*>(context)->domWindow(), FeatureObserver::WorkerStart);
+
     RefPtr<Worker> worker = adoptRef(new Worker(context));
 
     worker->suspendIfNeeded();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to