Tighten AbstractWorker and subclasses a bit.
Created attachment 213487 [details] Patch
Created attachment 213490 [details] Patch
Attachment 213490 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp', u'Source/WebCore/bindings/js/JSWorkerCustom.cpp', u'Source/WebCore/workers/AbstractWorker.cpp', u'Source/WebCore/workers/AbstractWorker.h', u'Source/WebCore/workers/SharedWorker.cpp', u'Source/WebCore/workers/SharedWorker.h', u'Source/WebCore/workers/Worker.cpp', u'Source/WebCore/workers/Worker.h']" exit_code: 1 Source/WebCore/workers/SharedWorker.h:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 213490 [details] Patch 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?
Committed r157000: <http://trac.webkit.org/changeset/157000>