Index: Source/core/workers/SharedWorker.cpp |
diff --git a/Source/core/workers/SharedWorker.cpp b/Source/core/workers/SharedWorker.cpp |
index 28298c362ca4fdd0e85f7189ab7deec525954dd4..df13db8d992d605e4c12b2f50761d48a9aba277e 100644 |
--- a/Source/core/workers/SharedWorker.cpp |
+++ b/Source/core/workers/SharedWorker.cpp |
@@ -54,7 +54,7 @@ inline SharedWorker::SharedWorker(ScriptExecutionContext* context) |
PassRefPtr<SharedWorker> SharedWorker::create(ScriptExecutionContext* context, const String& url, const String& name, ExceptionCode& ec) |
{ |
ASSERT(isMainThread()); |
- UseCounter::count(static_cast<Document*>(context)->domWindow(), UseCounter::SharedWorkerStart); |
+ UseCounter::count(toDocument(context)->domWindow(), UseCounter::SharedWorkerStart); |
RefPtr<SharedWorker> worker = adoptRef(new SharedWorker(context)); |
@@ -71,7 +71,7 @@ PassRefPtr<SharedWorker> SharedWorker::create(ScriptExecutionContext* context, c |
// 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); |
+ Document* document = toDocument(context); |
if (!document->securityOrigin()->canAccessSharedWorkers(document->topOrigin())) { |
ec = SECURITY_ERR; |
return 0; |