Changeset 207546 in webkit
- Timestamp:
- Oct 19, 2016 11:09:50 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207544 r207546 1 2016-10-19 Joseph Pecoraro <pecoraro@apple.com> 2 3 Cleanup WebCore/workers 4 https://bugs.webkit.org/show_bug.cgi?id=163635 5 6 Reviewed by Chris Dumez. 7 8 * workers/*: 9 Cleanup like pragma once, nullptr, remove stale includes, declarations. 10 1 11 2016-10-19 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/Source/WebCore/workers/AbstractWorker.cpp
r206254 r207546 33 33 34 34 #include "ContentSecurityPolicy.h" 35 #include "Event.h"36 35 #include "ExceptionCode.h" 37 36 #include "ScriptExecutionContext.h" -
trunk/Source/WebCore/workers/AbstractWorker.h
r204466 r207546 29 29 */ 30 30 31 #ifndef AbstractWorker_h 32 #define AbstractWorker_h 31 #pragma once 33 32 34 33 #include "ActiveDOMObject.h" … … 36 35 #include "EventTarget.h" 37 36 #include <wtf/RefCounted.h> 38 #include <wtf/RefPtr.h>39 37 #include <wtf/text/AtomicStringHash.h> 40 38 … … 63 61 64 62 } // namespace WebCore 65 66 #endif // AbstractWorker_h -
trunk/Source/WebCore/workers/Worker.cpp
r207505 r207546 23 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 *26 25 */ 27 26 28 27 #include "config.h" 29 30 28 #include "Worker.h" 31 29 32 #include "DOMWindow.h"33 #include "CachedResourceLoader.h"34 30 #include "ContentSecurityPolicy.h" 35 #include "Document.h" 36 #include "EventListener.h" 31 #include "Event.h" 37 32 #include "EventNames.h" 38 33 #include "ExceptionCode.h" 39 #include "Frame.h"40 #include "FrameLoader.h"41 34 #include "InspectorInstrumentation.h" 42 #include "MessageEvent.h"43 35 #include "NetworkStateNotifier.h" 36 #include "ResourceResponse.h" 44 37 #include "SecurityOrigin.h" 45 #include "TextEncoding.h"46 38 #include "WorkerGlobalScopeProxy.h" 47 39 #include "WorkerScriptLoader.h" -
trunk/Source/WebCore/workers/Worker.h
r207505 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 27 #ifndef Worker_h 28 #define Worker_h 26 #pragma once 29 27 30 28 #include "AbstractWorker.h" 31 29 #include "ActiveDOMObject.h" 32 30 #include "ContentSecurityPolicyResponseHeaders.h" 33 #include "EventListener.h"34 31 #include "EventTarget.h" 35 32 #include "MessagePort.h" … … 88 85 89 86 } // namespace WebCore 90 91 #endif // Worker_h -
trunk/Source/WebCore/workers/Worker.idl
r206723 r207546 23 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 *26 25 */ 27 26 -
trunk/Source/WebCore/workers/WorkerConsoleClient.h
r198786 r207546 24 24 */ 25 25 26 #ifndef WorkerConsoleClient_h 27 #define WorkerConsoleClient_h 26 #pragma once 28 27 29 28 #include "WorkerGlobalScope.h" … … 58 57 59 58 } // namespace WebCore 60 61 #endif // WorkerConsoleClient_h -
trunk/Source/WebCore/workers/WorkerEventQueue.cpp
r201675 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 … … 28 27 #include "WorkerEventQueue.h" 29 28 30 #include "DOMWindow.h"31 #include "Document.h"32 29 #include "Event.h" 33 30 #include "EventNames.h" 31 #include "EventTarget.h" 34 32 #include "ScriptExecutionContext.h" 35 33 … … 38 36 WorkerEventQueue::WorkerEventQueue(ScriptExecutionContext& context) 39 37 : m_scriptExecutionContext(context) 40 , m_isClosed(false)41 38 { 42 39 } … … 53 50 : m_event(WTFMove(event)) 54 51 , m_eventQueue(eventQueue) 55 , m_isCancelled(false)56 52 { 57 53 } … … 81 77 RefPtr<Event> m_event; 82 78 WorkerEventQueue& m_eventQueue; 83 bool m_isCancelled ;79 bool m_isCancelled { false }; 84 80 }; 85 81 … … 116 112 } 117 113 118 } 114 } // namespace WebCore -
trunk/Source/WebCore/workers/WorkerEventQueue.h
r197563 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 27 #ifndef WorkerEventQueue_h 28 #define WorkerEventQueue_h 26 #pragma once 29 27 30 28 #include "EventQueue.h" … … 46 44 private: 47 45 ScriptExecutionContext& m_scriptExecutionContext; 48 bool m_isClosed ;46 bool m_isClosed { false }; 49 47 50 48 class EventDispatcher; … … 53 51 }; 54 52 55 } 56 57 #endif // WorkerEventQueue_h 53 } // namespace WebCore -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r206627 r207546 29 29 #include "WorkerGlobalScope.h" 30 30 31 #include "ActiveDOMObject.h"32 31 #include "ContentSecurityPolicy.h" 33 32 #include "Crypto.h" 34 33 #include "DOMTimer.h" 35 #include "DOMURL.h"36 #include "DOMWindow.h"37 #include "ErrorEvent.h"38 34 #include "Event.h" 39 35 #include "ExceptionCode.h" 40 36 #include "IDBConnectionProxy.h" 41 37 #include "InspectorConsoleInstrumentation.h" 42 #include "MessagePort.h"43 38 #include "ScheduledAction.h" 44 39 #include "ScriptSourceCode.h" … … 50 45 #include "WorkerLocation.h" 51 46 #include "WorkerNavigator.h" 52 #include "Worker ObjectProxy.h"47 #include "WorkerReportingProxy.h" 53 48 #include "WorkerScriptLoader.h" 54 49 #include "WorkerThread.h" 55 50 #include "WorkerThreadableLoader.h" 56 #include <bindings/ScriptValue.h>57 51 #include <inspector/ConsoleMessage.h> 58 52 #include <inspector/ScriptCallStack.h> 59 #include <wtf/RefPtr.h>60 61 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)62 #include "NotificationCenter.h"63 #endif64 53 65 54 using namespace Inspector; … … 290 279 291 280 thread().workerReportingProxy().postConsoleMessageToWorkerObject(source, level, message, 0, 0, String()); 292 addMessageToWorkerConsole(source, level, message, String(), 0, 0, 0, 0, requestIdentifier);281 addMessageToWorkerConsole(source, level, message, String(), 0, 0, nullptr, nullptr, requestIdentifier); 293 282 } 294 283 … … 353 342 ASSERT(m_context->isContextThread()); 354 343 m_context->unregisterObserver(this); 355 m_context = 0;344 m_context = nullptr; 356 345 } 357 346 -
trunk/Source/WebCore/workers/WorkerGlobalScope.h
r206627 r207546 35 35 #include "WorkerScriptController.h" 36 36 #include <memory> 37 #include <wtf/Assertions.h>38 37 #include <wtf/HashSet.h> 39 38 #include <wtf/RefCounted.h> … … 47 46 namespace WebCore { 48 47 49 class Blob;50 48 class ContentSecurityPolicyResponseHeaders; 51 49 class Crypto; … … 165 163 void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) override; 166 164 void addMessageToWorkerConsole(std::unique_ptr<Inspector::ConsoleMessage>); 167 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = 0, unsigned long requestIdentifier = 0);165 void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0); 168 166 169 167 private: … … 174 172 void derefEventTarget() final { deref(); } 175 173 176 void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = 0, unsigned long requestIdentifier = 0) override;174 void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) override; 177 175 178 176 EventTarget* errorEventTarget() override; -
trunk/Source/WebCore/workers/WorkerGlobalScope.idl
r205280 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 -
trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h
r201675 r207546 29 29 */ 30 30 31 #ifndef WorkerGlobalScopeProxy_h 32 #define WorkerGlobalScopeProxy_h 31 #pragma once 33 32 34 33 #include "MessagePort.h" … … 64 63 65 64 } // namespace WebCore 66 67 #endif // WorkerGlobalScopeProxy_h -
trunk/Source/WebCore/workers/WorkerLoaderProxy.h
r202313 r207546 29 29 */ 30 30 31 #ifndef WorkerLoaderProxy_h 32 #define WorkerLoaderProxy_h 31 #pragma once 33 32 34 33 #include "ScriptExecutionContext.h" 35 #include <wtf/Forward.h>36 34 37 35 namespace WebCore { … … 56 54 57 55 } // namespace WebCore 58 59 #endif // WorkerLoaderProxy_h -
trunk/Source/WebCore/workers/WorkerLocation.cpp
r192810 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 -
trunk/Source/WebCore/workers/WorkerLocation.h
r204954 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 27 #ifndef WorkerLocation_h 28 #define WorkerLocation_h 26 #pragma once 29 27 30 28 #include "URL.h" 31 29 #include <wtf/RefCounted.h> 32 #include <wtf/RefPtr.h>33 30 #include <wtf/text/WTFString.h> 34 31 … … 63 60 64 61 } // namespace WebCore 65 66 #endif // WorkerLocation_h -
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
r202930 r207546 191 191 void WorkerMessagingProxy::workerObjectDestroyed() 192 192 { 193 m_workerObject = 0;193 m_workerObject = nullptr; 194 194 m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) { 195 195 m_mayBeDestroyed = true; … … 219 219 workerGlobalScopeDestroyedInternal(); 220 220 }); 221 // Will execute workerGlobalScopeDestroyedInternal() on context's thread.222 221 } 223 222 224 223 void WorkerMessagingProxy::workerGlobalScopeClosed() 225 224 { 226 // Executes terminateWorkerGlobalScope() on parent context's thread.227 225 m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) { 228 226 terminateWorkerGlobalScope(); … … 232 230 void WorkerMessagingProxy::workerGlobalScopeDestroyedInternal() 233 231 { 234 // WorkerGlobalScopeDestroyedTask is always the lastto be performed, so the proxy is not needed for communication232 // This is always the last task to be performed, so the proxy is not needed for communication 235 233 // in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too. 236 234 m_askedToTerminate = true; … … 256 254 reportPendingActivityInternal(true, hasPendingActivity); 257 255 }); 258 // Will execute reportPendingActivityInternal() on context's thread.259 256 } 260 257 … … 264 261 reportPendingActivityInternal(false, hasPendingActivity); 265 262 }); 266 // Will execute reportPendingActivityInternal() on context's thread.267 263 } 268 264 -
trunk/Source/WebCore/workers/WorkerMessagingProxy.h
r202313 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 27 #ifndef WorkerMessagingProxy_h 28 #define WorkerMessagingProxy_h 26 #pragma once 29 27 30 28 #include "ScriptExecutionContext.h" … … 43 41 class ContentSecurityPolicyResponseHeaders; 44 42 class DedicatedWorkerThread; 45 class ScriptExecutionContext;46 43 class Worker; 47 44 … … 85 82 86 83 private: 87 friend class MessageWorkerTask;88 friend class WorkerGlobalScopeDestroyedTask;89 friend class WorkerExceptionTask;90 friend class WorkerThreadActivityReportTask;91 92 84 void workerGlobalScopeDestroyedInternal(); 93 85 void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity); … … 108 100 109 101 } // namespace WebCore 110 111 #endif // WorkerMessagingProxy_h -
trunk/Source/WebCore/workers/WorkerObjectProxy.h
r201675 r207546 29 29 */ 30 30 31 #ifndef WorkerObjectProxy_h 32 #define WorkerObjectProxy_h 31 #pragma once 33 32 34 33 #include "WorkerReportingProxy.h" … … 53 52 54 53 } // namespace WebCore 55 56 #endif // WorkerObjectProxy_h -
trunk/Source/WebCore/workers/WorkerReportingProxy.h
r193426 r207546 29 29 */ 30 30 31 #ifndef WorkerReportingProxy_h 32 #define WorkerReportingProxy_h 31 #pragma once 33 32 34 33 #include <runtime/ConsoleTypes.h> 35 #include <wtf/Forward.h>36 34 37 35 namespace WebCore { … … 54 52 55 53 } // namespace WebCore 56 57 #endif // WorkerReportingProxy_h -
trunk/Source/WebCore/workers/WorkerRunLoop.cpp
r202313 r207546 117 117 m_runLoop.m_nestedCount--; 118 118 if (!m_runLoop.m_nestedCount) 119 threadGlobalData().threadTimers().setSharedTimer( 0);119 threadGlobalData().threadTimers().setSharedTimer(nullptr); 120 120 } 121 121 private: -
trunk/Source/WebCore/workers/WorkerRunLoop.h
r202313 r207546 29 29 */ 30 30 31 #ifndef WorkerRunLoop_h 32 #define WorkerRunLoop_h 31 #pragma once 33 32 34 33 #include "ScriptExecutionContext.h" … … 93 92 94 93 } // namespace WebCore 95 96 #endif // WorkerRunLoop_h -
trunk/Source/WebCore/workers/WorkerScriptLoader.cpp
r204019 r207546 23 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 *26 25 */ 27 26 28 27 #include "config.h" 29 30 28 #include "WorkerScriptLoader.h" 31 29 … … 33 31 #include "ResourceResponse.h" 34 32 #include "ScriptExecutionContext.h" 35 #include "SecurityOrigin.h"36 33 #include "TextResourceDecoder.h" 37 34 #include "WorkerGlobalScope.h" … … 39 36 #include "WorkerThreadableLoader.h" 40 37 #include <wtf/Ref.h> 41 #include <wtf/RefPtr.h>42 38 43 39 namespace WebCore { 44 40 45 41 WorkerScriptLoader::WorkerScriptLoader() 46 : m_client( 0)42 : m_client(nullptr) 47 43 , m_failed(false) 48 44 , m_identifier(0) … … 115 111 { 116 112 auto request = std::make_unique<ResourceRequest>(m_url); 117 request->setHTTPMethod( "GET");113 request->setHTTPMethod(ASCIILiteral("GET")); 118 114 return request; 119 115 } … … 138 134 if (!m_decoder) { 139 135 if (!m_responseEncoding.isEmpty()) 140 m_decoder = TextResourceDecoder::create( "text/javascript", m_responseEncoding);136 m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), m_responseEncoding); 141 137 else 142 m_decoder = TextResourceDecoder::create( "text/javascript", "UTF-8");138 m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), "UTF-8"); 143 139 } 144 140 -
trunk/Source/WebCore/workers/WorkerScriptLoader.h
r204466 r207546 23 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 *26 25 */ 27 26 28 #ifndef WorkerScriptLoader_h 29 #define WorkerScriptLoader_h 27 #pragma once 30 28 31 29 #include "URL.h" … … 93 91 94 92 } // namespace WebCore 95 96 #endif // WorkerScriptLoader_h -
trunk/Source/WebCore/workers/WorkerScriptLoaderClient.h
r165676 r207546 23 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 *26 25 */ 27 26 28 #ifndef WorkerScriptLoaderClient_h 29 #define WorkerScriptLoaderClient_h 27 #pragma once 30 28 31 29 namespace WebCore { … … 46 44 47 45 } // namespace WebCore 48 49 #endif // WorkerScriptLoaderClient_h -
trunk/Source/WebCore/workers/WorkerThread.cpp
r203238 r207546 26 26 27 27 #include "config.h" 28 29 28 #include "WorkerThread.h" 30 29 31 30 #include "ContentSecurityPolicyResponseHeaders.h" 32 #include "DedicatedWorkerGlobalScope.h"33 31 #include "IDBConnectionProxy.h" 34 32 #include "ScriptSourceCode.h" … … 37 35 #include "ThreadGlobalData.h" 38 36 #include "URL.h" 37 #include "WorkerGlobalScope.h" 39 38 #include <utility> 40 39 #include <wtf/Lock.h> … … 100 99 , m_workerReportingProxy(workerReportingProxy) 101 100 , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin)) 102 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)103 , m_notificationClient(0)104 #endif105 101 #if ENABLE(INDEXED_DATABASE) 106 102 , m_idbConnectionProxy(connectionProxy) -
trunk/Source/WebCore/workers/WorkerThread.h
r202930 r207546 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 *25 24 */ 26 25 … … 103 102 104 103 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 105 NotificationClient* m_notificationClient ;104 NotificationClient* m_notificationClient { nullptr }; 106 105 #endif 107 106 … … 115 114 116 115 } // namespace WebCore 117
Note: See TracChangeset
for help on using the changeset viewer.