Bug 24017 - Remove some usage of Document in Worker.
Summary: Remove some usage of Document in Worker.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Dmitry Titov
URL:
Keywords:
Depends on:
Blocks: 24016
  Show dependency treegraph
 
Reported: 2009-02-18 18:46 PST by Dmitry Titov
Modified: 2009-02-19 23:28 PST (History)
3 users (show)

See Also:


Attachments
Proposed patch (5.25 KB, patch)
2009-02-18 19:11 PST, Dmitry Titov
no flags Details | Formatted Diff | Diff
Updated patch. (7.43 KB, patch)
2009-02-19 12:44 PST, Dmitry Titov
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Titov 2009-02-18 18:46:41 PST
This is a small step toward making workers nestable.
Comment 1 Dmitry Titov 2009-02-18 19:11:23 PST
Created attachment 27774 [details]
Proposed patch
Comment 2 Alexey Proskuryakov 2009-02-19 02:11:23 PST
Comment on attachment 27774 [details]
Proposed patch

I don't think that the Worker object is the right place to store m_userAgent. It should be available from ScriptExecutionContext (calculated for Document, stored in WorkerContext).

We should de-virtualize completeURL() some day, as it's pretty much the same in both cases.
Comment 3 Dmitry Titov 2009-02-19 12:44:09 PST
Created attachment 27808 [details]
Updated patch.

Made userAgent a virtual on SEC.
Fixed couple of typos.

The un-virtualization of completeURL - I think it deserves a separate patch, together with charset. I'l do that soon.
Comment 4 Alexey Proskuryakov 2009-02-19 14:22:15 PST
Comment on attachment 27808 [details]
Updated patch.

r=me

> +        virtual String userAgent(const KURL&) const { return m_userAgent; }

There isn't much good in inlining this virtual function - it is unlikely to ever be called in a way that can be inlined. There also isn't a lot of use in keeping the implementation in header as documentation, nor a significant win in brevity.
Comment 5 Dmitry Titov 2009-02-19 23:28:19 PST
Landed as http://trac.webkit.org/changeset/41102

Before landing, I've removed inlining of WorkerContext::userAgent() as was suggested above.