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

Side by Side Diff: Source/WebKit/chromium/src/WebWorkerClientImpl.cpp

Issue 17885002: Use toDocument instead of static_cast<Document*>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/WebKit/chromium/src/WebDocument.cpp ('k') | Source/core/workers/SharedWorker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 using namespace WebCore; 65 using namespace WebCore;
66 66
67 namespace WebKit { 67 namespace WebKit {
68 68
69 // Chromium-specific decorator of WorkerMessagingProxy. 69 // Chromium-specific decorator of WorkerMessagingProxy.
70 70
71 // static 71 // static
72 WorkerGlobalScopeProxy* WebWorkerClientImpl::createWorkerGlobalScopeProxy(Worker * worker) 72 WorkerGlobalScopeProxy* WebWorkerClientImpl::createWorkerGlobalScopeProxy(Worker * worker)
73 { 73 {
74 if (worker->scriptExecutionContext()->isDocument()) { 74 if (worker->scriptExecutionContext()->isDocument()) {
75 Document* document = static_cast<Document*>(worker->scriptExecutionConte xt()); 75 Document* document = toDocument(worker->scriptExecutionContext());
76 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); 76 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
77 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker, webFrame); 77 WebWorkerClientImpl* proxy = new WebWorkerClientImpl(worker, webFrame);
78 return proxy; 78 return proxy;
79 } 79 }
80 ASSERT_NOT_REACHED(); 80 ASSERT_NOT_REACHED();
81 return 0; 81 return 0;
82 } 82 }
83 83
84 void WebWorkerClientImpl::terminateWorkerGlobalScope() 84 void WebWorkerClientImpl::terminateWorkerGlobalScope()
85 { 85 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 : WebCore::WorkerMessagingProxy(worker) 152 : WebCore::WorkerMessagingProxy(worker)
153 , m_webFrame(webFrame) 153 , m_webFrame(webFrame)
154 { 154 {
155 } 155 }
156 156
157 WebWorkerClientImpl::~WebWorkerClientImpl() 157 WebWorkerClientImpl::~WebWorkerClientImpl()
158 { 158 {
159 } 159 }
160 160
161 } // namespace WebKit 161 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebDocument.cpp ('k') | Source/core/workers/SharedWorker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698