Bug 156632 - Reduce use of Deprecated::ScriptXXX classes
Summary: Reduce use of Deprecated::ScriptXXX classes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-15 11:40 PDT by Darin Adler
Modified: 2016-04-15 19:27 PDT (History)
6 users (show)

See Also:


Attachments
Patch (100.17 KB, patch)
2016-04-15 12:35 PDT, Darin Adler
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-yosemite (1.23 MB, application/zip)
2016-04-15 13:13 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-yosemite-wk2 (1.08 MB, application/zip)
2016-04-15 13:13 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (1.04 MB, application/zip)
2016-04-15 13:28 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (619.95 KB, application/zip)
2016-04-15 13:33 PDT, Build Bot
no flags Details
Patch (100.75 KB, patch)
2016-04-15 14:36 PDT, Darin Adler
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2016-04-15 11:40:58 PDT
Reduce use of Deprecated::ScriptXXX classes
Comment 1 Darin Adler 2016-04-15 12:35:45 PDT
Created attachment 276494 [details]
Patch
Comment 2 Darin Adler 2016-04-15 13:10:04 PDT
Looks like I missed a null check somewhere.
Comment 3 Build Bot 2016-04-15 13:13:02 PDT
Comment on attachment 276494 [details]
Patch

Attachment 276494 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1164770

New failing tests:
fast/dom/javascript-url-exception-isolation.html
fast/frames/sandboxed-iframe-scripting-03.html
Comment 4 Build Bot 2016-04-15 13:13:04 PDT
Created attachment 276499 [details]
Archive of layout-test-results from ews103 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Build Bot 2016-04-15 13:13:14 PDT
Comment on attachment 276494 [details]
Patch

Attachment 276494 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1164765

New failing tests:
fast/dom/javascript-url-exception-isolation.html
fast/frames/sandboxed-iframe-scripting-03.html
Comment 6 Build Bot 2016-04-15 13:13:17 PDT
Created attachment 276500 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-04-15 13:28:14 PDT
Comment on attachment 276494 [details]
Patch

Attachment 276494 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1164777

New failing tests:
fast/dom/javascript-url-exception-isolation.html
fast/frames/sandboxed-iframe-scripting-03.html
Comment 8 Build Bot 2016-04-15 13:28:17 PDT
Created attachment 276502 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2016-04-15 13:33:27 PDT
Comment on attachment 276494 [details]
Patch

Attachment 276494 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1164830

New failing tests:
fast/dom/javascript-url-exception-isolation.html
fast/frames/sandboxed-iframe-scripting-03.html
Comment 10 Build Bot 2016-04-15 13:33:30 PDT
Created attachment 276503 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 11 Darin Adler 2016-04-15 14:36:22 PDT
Created attachment 276514 [details]
Patch
Comment 12 Alex Christensen 2016-04-15 16:32:05 PDT
Comment on attachment 276514 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276514&action=review

> Source/JavaScriptCore/bindings/ScriptValue.cpp:169
>  RefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
>  {
>      JSLockHolder holder(scriptState);
> -    return jsToInspectorValue(scriptState, m_value.get(), InspectorValue::maxDepth);
> +    return jsToInspectorValue(*scriptState, m_value.get(), InspectorValue::maxDepth);
>  }

There are a lot of places where ExecStates and VMs are passed around as pointers that are assumed to be non-null.  Why don't we use more ExecState&?

> Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp:87
> -    ScriptGlobalObject::set(execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral("InspectorFrontendHost"), m_frontendHost.get());
> +    ScriptGlobalObject::set(*execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral("InspectorFrontendHost"), *m_frontendHost);

This will be dereferencing a null pointer if corePage() returns null.
Comment 13 Darin Adler 2016-04-15 19:25:45 PDT
Committed r199619: <http://trac.webkit.org/changeset/199619>
Comment 14 Darin Adler 2016-04-15 19:27:28 PDT
Comment on attachment 276514 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276514&action=review

>> Source/JavaScriptCore/bindings/ScriptValue.cpp:169
>>  }
> 
> There are a lot of places where ExecStates and VMs are passed around as pointers that are assumed to be non-null.  Why don't we use more ExecState&?

Yes, there are. We should use more ExecState&. It takes a long time to change all the old code.

>> Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp:87
>> +    ScriptGlobalObject::set(*execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral("InspectorFrontendHost"), *m_frontendHost);
> 
> This will be dereferencing a null pointer if corePage() returns null.

Yes, was true before, the dereferencing was inside ScriptGlobalObject::set, and it is equally true now.