RESOLVED FIXED 143682
Web Inspector: Auto-attach fails after r179562, initialization too late after dispatch
https://bugs.webkit.org/show_bug.cgi?id=143682
Summary Web Inspector: Auto-attach fails after r179562, initialization too late after...
Joseph Pecoraro
Reported 2015-04-13 15:27:58 PDT
* SUMMARY Auto-attach fails after r179562, initialization too late after dispatch. The async initialization of the RemoteInspector singleton causes auto-attach to fail if for instance you have: int main() { [[[JSContext alloc] init] evaluateScript:@"debugger"]; ... } We should detect if we are on the main thread and do it synchronously, since that was the only reason we were dispatching to the main thread anyways.
Attachments
[PATCH] Proposed Fix (1.92 KB, patch)
2015-04-13 15:30 PDT, Joseph Pecoraro
timothy: review+
joepeck: commit-queue-
Radar WebKit Bug Importer
Comment 1 2015-04-13 15:28:29 PDT
Joseph Pecoraro
Comment 2 2015-04-13 15:30:02 PDT
Created attachment 250679 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 3 2015-04-13 15:49:45 PDT
Comment on attachment 250679 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=250679&action=review > Source/JavaScriptCore/inspector/remote/RemoteInspector.mm:87 > - dispatch_async(dispatch_get_main_queue(), ^{ > + dispatch_block_t initialize = ^{ One could argue that we should just change the dispatch_async to be a dispatch_sync. I'm going to cq- while I think about that.
Joseph Pecoraro
Comment 4 2015-04-14 17:25:12 PDT
> One could argue that we should just change the dispatch_async to be a > dispatch_sync. I'm going to cq- while I think about that. I couldn't reproduce the issue I was thinking with background queues, so I'm going to keep this dispatch_async in the non-main thread case.
Joseph Pecoraro
Comment 5 2015-04-14 17:28:48 PDT
Note You need to log in before you can comment on or make changes to this bug.