Title: [182825] trunk/Source/_javascript_Core
Revision
182825
Author
[email protected]
Date
2015-04-14 17:27:26 -0700 (Tue, 14 Apr 2015)

Log Message

Web Inspector: Auto-attach fails after r179562, initialization too late after dispatch
https://bugs.webkit.org/show_bug.cgi?id=143682

Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):
If we are on the main thread, run the initialization immediately.
Otherwise dispatch to the main thread. This way if the first JSContext
was created on the main thread it can get auto-attached if applicable.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (182824 => 182825)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-15 00:26:23 UTC (rev 182824)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-15 00:27:26 UTC (rev 182825)
@@ -1,5 +1,18 @@
 2015-04-14  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Auto-attach fails after r179562, initialization too late after dispatch
+        https://bugs.webkit.org/show_bug.cgi?id=143682
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::singleton):
+        If we are on the main thread, run the initialization immediately.
+        Otherwise dispatch to the main thread. This way if the first JSContext
+        was created on the main thread it can get auto-attached if applicable.
+
+2015-04-14  Joseph Pecoraro  <[email protected]>
+
         Unreviewed build fix for Mavericks.
 
         Mavericks includes this file but does not enable ENABLE_REMOTE_INSPECTOR

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm (182824 => 182825)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-04-15 00:26:23 UTC (rev 182824)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-04-15 00:27:26 UTC (rev 182825)
@@ -84,12 +84,17 @@
     static dispatch_once_t once;
     dispatch_once(&once, ^{
         if (canAccessWebInspectorMachPort()) {
-            dispatch_async(dispatch_get_main_queue(), ^{
+            dispatch_block_t initialize = ^{
                 WTF::initializeMainThread();
                 JSC::initializeThreading();
                 if (RemoteInspector::startEnabled)
                     shared.get().start();
-            });
+            };
+
+            if ([NSThread isMainThread])
+                initialize();
+            else
+                dispatch_async(dispatch_get_main_queue(), initialize);
         }
     });
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to