RESOLVED FIXED 89087
Web Inspector: Remove devtoolsInjectedScript hidden property
https://bugs.webkit.org/show_bug.cgi?id=89087
Summary Web Inspector: Remove devtoolsInjectedScript hidden property
Andrey Adaikin
Reported 2012-06-14 03:00:33 PDT
We use this hidden property to reference a InjectedScript object for a given ScriptState, but we also have the same reference in the InjectedScriptManager's hash maps. Just use the hash maps and remove the hidden property from the global object.
Attachments
Patch (17.38 KB, patch)
2012-06-14 03:04 PDT, Andrey Adaikin
no flags
Patch (17.48 KB, patch)
2012-06-14 03:26 PDT, Andrey Adaikin
no flags
Patch to land (18.25 KB, patch)
2012-06-14 06:09 PDT, Andrey Adaikin
no flags
Andrey Adaikin
Comment 1 2012-06-14 03:04:51 PDT
Andrey Adaikin
Comment 2 2012-06-14 03:26:50 PDT
Created attachment 147544 [details] Patch Fix broken mac build
Andrey Kosyakov
Comment 3 2012-06-14 05:30:28 PDT
Comment on attachment 147544 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147544&action=review General approach looks good, but I'm a bit concerned with consistency between two maps (m_idToInjectedScript and m_scriptStateToId) being not obvious. Also a nit -- Google copyright line should only include last year. > Source/WebCore/inspector/InjectedScriptManager.cpp:180 > + if (it1 != m_idToInjectedScript.end()) When are we supposed to hit this check?
Andrey Kosyakov
Comment 4 2012-06-14 05:48:40 PDT
Comment on attachment 147544 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147544&action=review >> Source/WebCore/inspector/InjectedScriptManager.cpp:180 >> + if (it1 != m_idToInjectedScript.end()) > > When are we supposed to hit this check? Ok, looks like it's normal for us to hit this. LGTM then.
Andrey Adaikin
Comment 5 2012-06-14 06:09:09 PDT
Created attachment 147567 [details] Patch to land
Pavel Feldman
Comment 6 2012-06-14 08:32:32 PDT
Comment on attachment 147567 [details] Patch to land View in context: https://bugs.webkit.org/attachment.cgi?id=147567&action=review > Source/WebCore/inspector/InjectedScriptManager.cpp:194 > +ScriptObject InjectedScriptManager::wrapWebGLRenderingContextForInstrumentation(const ScriptObject&) InjectedScriptManager should not be aware of "WebGL".
Andrey Adaikin
Comment 7 2012-06-14 08:58:24 PDT
Comment on attachment 147567 [details] Patch to land View in context: https://bugs.webkit.org/attachment.cgi?id=147567&action=review >> Source/WebCore/inspector/InjectedScriptManager.cpp:194 >> +ScriptObject InjectedScriptManager::wrapWebGLRenderingContextForInstrumentation(const ScriptObject&) > > InjectedScriptManager should not be aware of "WebGL". Then it also should not be aware of the InjectedScript class.
WebKit Review Bot
Comment 8 2012-06-14 12:24:50 PDT
Comment on attachment 147567 [details] Patch to land Clearing flags on attachment: 147567 Committed r120347: <http://trac.webkit.org/changeset/120347>
WebKit Review Bot
Comment 9 2012-06-14 12:24:55 PDT
All reviewed patches have been landed. Closing bug.
Yury Semikhatsky
Comment 10 2012-06-18 03:19:19 PDT
Comment on attachment 147567 [details] Patch to land View in context: https://bugs.webkit.org/attachment.cgi?id=147567&action=review > Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:-98 > - visitor.append(&thisObject->m_injectedScript); Now that this is removed how can we make sure that the injected script is not garbage collected?
Yury Semikhatsky
Comment 11 2012-06-18 03:23:16 PDT
(In reply to comment #10) > (From update of attachment 147567 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=147567&action=review > > > Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:-98 > > - visitor.append(&thisObject->m_injectedScript); > > Now that this is removed how can we make sure that the injected script is not garbage collected? Nevermind. I missed that it is kept as a strong ref in ScriptObject.
Note You need to log in before you can comment on or make changes to this bug.