[webkit-reviews] review granted: [Bug 122402] Tighten AbstractWorker and subclasses a bit. : [Attachment 213490] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 6 09:31:42 PDT 2013


Darin Adler <darin at apple.com> has granted Andreas Kling <akling at apple.com>'s
request for review:
Bug 122402: Tighten AbstractWorker and subclasses a bit.
https://bugs.webkit.org/show_bug.cgi?id=122402

Attachment 213490: Patch
https://bugs.webkit.org/attachment.cgi?id=213490&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=213490&action=review


> Source/WebCore/workers/SharedWorker.cpp:61
> +    // We don't currently support nested workers, so workers can only be
created from documents.
> +    ASSERT_WITH_SECURITY_IMPLICATION(context.isDocument());
> +    Document& document = static_cast<Document&>(context);

Is having the argument stay a ScriptExecutionContext& truly a helpful
forward-looking step? I guess so, but it’s a little annoying.

> Source/WebCore/workers/SharedWorker.cpp:63
> +    FeatureObserver::observe(static_cast<Document&>(context).domWindow(),
FeatureObserver::SharedWorkerStart);

document, not static_cast<Document&>(context)

> Source/WebCore/workers/Worker.cpp:81
> -    FeatureObserver::observe(static_cast<Document*>(context)->domWindow(),
FeatureObserver::WorkerStart);
> +    FeatureObserver::observe(static_cast<Document&>(context).domWindow(),
FeatureObserver::WorkerStart);

Where’s the assertion that goes with this cast?


More information about the webkit-reviews mailing list