Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: Source/core/workers/SharedWorker.cpp

Issue 17885002: Use toDocument instead of static_cast<Document*>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/src/WebWorkerClientImpl.cpp ('k') | Source/core/workers/Worker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/WebKit/chromium/src/WebWorkerClientImpl.cpp ('k') | Source/core/workers/Worker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698