Cleanup WebCore/workers
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 18:09:50 +0000 (18:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 18:09:50 +0000 (18:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163635

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-10-19
Reviewed by Chris Dumez.

* workers/*:
Cleanup like pragma once, nullptr, remove stale includes, declarations.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207546 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/workers/AbstractWorker.cpp
Source/WebCore/workers/AbstractWorker.h
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/Worker.h
Source/WebCore/workers/Worker.idl
Source/WebCore/workers/WorkerConsoleClient.h
Source/WebCore/workers/WorkerEventQueue.cpp
Source/WebCore/workers/WorkerEventQueue.h
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerGlobalScope.idl
Source/WebCore/workers/WorkerGlobalScopeProxy.h
Source/WebCore/workers/WorkerLoaderProxy.h
Source/WebCore/workers/WorkerLocation.cpp
Source/WebCore/workers/WorkerLocation.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerMessagingProxy.h
Source/WebCore/workers/WorkerObjectProxy.h
Source/WebCore/workers/WorkerReportingProxy.h
Source/WebCore/workers/WorkerRunLoop.cpp
Source/WebCore/workers/WorkerRunLoop.h
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/workers/WorkerScriptLoader.h
Source/WebCore/workers/WorkerScriptLoaderClient.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h

index c658880..cf05013 100644 (file)
@@ -1,3 +1,13 @@
+2016-10-19  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Cleanup WebCore/workers
+        https://bugs.webkit.org/show_bug.cgi?id=163635
+
+        Reviewed by Chris Dumez.
+
+        * workers/*:
+        Cleanup like pragma once, nullptr, remove stale includes, declarations.
+
 2016-10-19  Chris Dumez  <cdumez@apple.com>
 
         MouseEvent's coordinates should be 0 for simulated clicks
index 490d2d7..3ab4bf1 100644 (file)
@@ -32,7 +32,6 @@
 #include "AbstractWorker.h"
 
 #include "ContentSecurityPolicy.h"
-#include "Event.h"
 #include "ExceptionCode.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
index 56d3625..44af78e 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef AbstractWorker_h
-#define AbstractWorker_h
+#pragma once
 
 #include "ActiveDOMObject.h"
 #include "EventListener.h"
 #include "EventTarget.h"
 #include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
 #include <wtf/text/AtomicStringHash.h>
 
 namespace WebCore {
@@ -62,5 +60,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // AbstractWorker_h
index c827cad..60582b9 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 #include "config.h"
-
 #include "Worker.h"
 
-#include "DOMWindow.h"
-#include "CachedResourceLoader.h"
 #include "ContentSecurityPolicy.h"
-#include "Document.h"
-#include "EventListener.h"
+#include "Event.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
-#include "Frame.h"
-#include "FrameLoader.h"
 #include "InspectorInstrumentation.h"
-#include "MessageEvent.h"
 #include "NetworkStateNotifier.h"
+#include "ResourceResponse.h"
 #include "SecurityOrigin.h"
-#include "TextEncoding.h"
 #include "WorkerGlobalScopeProxy.h"
 #include "WorkerScriptLoader.h"
 #include "WorkerThread.h"
index e17ceba..384fce2 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef Worker_h
-#define Worker_h
+#pragma once
 
 #include "AbstractWorker.h"
 #include "ActiveDOMObject.h"
 #include "ContentSecurityPolicyResponseHeaders.h"
-#include "EventListener.h"
 #include "EventTarget.h"
 #include "MessagePort.h"
 #include "WorkerScriptLoaderClient.h"
@@ -87,5 +84,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // Worker_h
index 2c2c548..b6816dc 100644 (file)
@@ -22,7 +22,6 @@
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 [
index 3611231..5eca975 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerConsoleClient_h
-#define WorkerConsoleClient_h
+#pragma once
 
 #include "WorkerGlobalScope.h"
 #include <runtime/ConsoleClient.h>
@@ -57,5 +56,3 @@ private:
 };
 
 } // namespace WebCore
-
-#endif // WorkerConsoleClient_h
index 2778b03..0a4a4fa 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 #include "config.h"
 #include "WorkerEventQueue.h"
 
-#include "DOMWindow.h"
-#include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
+#include "EventTarget.h"
 #include "ScriptExecutionContext.h"
 
 namespace WebCore {
 
 WorkerEventQueue::WorkerEventQueue(ScriptExecutionContext& context)
     : m_scriptExecutionContext(context)
-    , m_isClosed(false)
 {
 }
 
@@ -52,7 +49,6 @@ public:
     EventDispatcher(RefPtr<Event>&& event, WorkerEventQueue& eventQueue)
         : m_event(WTFMove(event))
         , m_eventQueue(eventQueue)
-        , m_isCancelled(false)
     {
     }
 
@@ -80,7 +76,7 @@ public:
 private:
     RefPtr<Event> m_event;
     WorkerEventQueue& m_eventQueue;
-    bool m_isCancelled;
+    bool m_isCancelled { false };
 };
 
 bool WorkerEventQueue::enqueueEvent(Ref<Event>&& event)
@@ -115,4 +111,4 @@ void WorkerEventQueue::close()
     m_eventDispatcherMap.clear();
 }
 
-}
+} // namespace WebCore
index 1061608..6115ef4 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef WorkerEventQueue_h
-#define WorkerEventQueue_h
+#pragma once
 
 #include "EventQueue.h"
 #include <wtf/HashMap.h>
@@ -45,13 +43,11 @@ public:
 
 private:
     ScriptExecutionContext& m_scriptExecutionContext;
-    bool m_isClosed;
+    bool m_isClosed { false };
 
     class EventDispatcher;
     typedef HashMap<RefPtr<Event>, EventDispatcher*> EventDispatcherMap;
     EventDispatcherMap m_eventDispatcherMap;
 };
 
-}
-
-#endif // WorkerEventQueue_h
+} // namespace WebCore
index 7e94a9a..1ce6006 100644 (file)
 #include "config.h"
 #include "WorkerGlobalScope.h"
 
-#include "ActiveDOMObject.h"
 #include "ContentSecurityPolicy.h"
 #include "Crypto.h"
 #include "DOMTimer.h"
-#include "DOMURL.h"
-#include "DOMWindow.h"
-#include "ErrorEvent.h"
 #include "Event.h"
 #include "ExceptionCode.h"
 #include "IDBConnectionProxy.h"
 #include "InspectorConsoleInstrumentation.h"
-#include "MessagePort.h"
 #include "ScheduledAction.h"
 #include "ScriptSourceCode.h"
 #include "SecurityOrigin.h"
 #include "WorkerLoaderProxy.h"
 #include "WorkerLocation.h"
 #include "WorkerNavigator.h"
-#include "WorkerObjectProxy.h"
+#include "WorkerReportingProxy.h"
 #include "WorkerScriptLoader.h"
 #include "WorkerThread.h"
 #include "WorkerThreadableLoader.h"
-#include <bindings/ScriptValue.h>
 #include <inspector/ConsoleMessage.h>
 #include <inspector/ScriptCallStack.h>
-#include <wtf/RefPtr.h>
-
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-#include "NotificationCenter.h"
-#endif
 
 using namespace Inspector;
 
@@ -289,7 +278,7 @@ void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel lev
     }
 
     thread().workerReportingProxy().postConsoleMessageToWorkerObject(source, level, message, 0, 0, String());
-    addMessageToWorkerConsole(source, level, message, String(), 0, 0, 0, 0, requestIdentifier);
+    addMessageToWorkerConsole(source, level, message, String(), 0, 0, nullptr, nullptr, requestIdentifier);
 }
 
 void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<ScriptCallStack>&& callStack, JSC::ExecState* state, unsigned long requestIdentifier)
@@ -352,7 +341,7 @@ void WorkerGlobalScope::Observer::stopObserving()
         return;
     ASSERT(m_context->isContextThread());
     m_context->unregisterObserver(this);
-    m_context = 0;
+    m_context = nullptr;
 }
 
 void WorkerGlobalScope::registerObserver(Observer* observer)
index bac411e..2cdb3e5 100644 (file)
@@ -34,7 +34,6 @@
 #include "WorkerEventQueue.h"
 #include "WorkerScriptController.h"
 #include <memory>
-#include <wtf/Assertions.h>
 #include <wtf/HashSet.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -46,7 +45,6 @@ class ConsoleMessage;
 
 namespace WebCore {
 
-class Blob;
 class ContentSecurityPolicyResponseHeaders;
 class Crypto;
 class ScheduledAction;
@@ -164,7 +162,7 @@ protected:
 
     void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) override;
     void addMessageToWorkerConsole(std::unique_ptr<Inspector::ConsoleMessage>);
-    void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = 0, unsigned long requestIdentifier = 0);
+    void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
 
 private:
     void refScriptExecutionContext() override { ref(); }
@@ -173,7 +171,7 @@ private:
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
 
-    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;
+    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;
 
     EventTarget* errorEventTarget() override;
 
index 986a340..759b665 100644 (file)
@@ -21,7 +21,6 @@
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 [
index ee277d5..87b58c9 100644 (file)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerGlobalScopeProxy_h
-#define WorkerGlobalScopeProxy_h
+#pragma once
 
 #include "MessagePort.h"
 #include "WorkerThread.h"
@@ -63,5 +62,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerGlobalScopeProxy_h
index 3534e9f..b88f82a 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerLoaderProxy_h
-#define WorkerLoaderProxy_h
+#pragma once
 
 #include "ScriptExecutionContext.h"
-#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -55,5 +53,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerLoaderProxy_h
index 87e1623..6f228ec 100644 (file)
@@ -21,7 +21,6 @@
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 #include "config.h"
index 864a0f1..53c7761 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef WorkerLocation_h
-#define WorkerLocation_h
+#pragma once
 
 #include "URL.h"
 #include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -62,5 +59,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerLocation_h
index 177fd18..a166196 100644 (file)
@@ -190,7 +190,7 @@ void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread>
 
 void WorkerMessagingProxy::workerObjectDestroyed()
 {
-    m_workerObject = 0;
+    m_workerObject = nullptr;
     m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) {
         m_mayBeDestroyed = true;
         if (m_workerThread)
@@ -218,12 +218,10 @@ void WorkerMessagingProxy::workerGlobalScopeDestroyed()
     m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) {
         workerGlobalScopeDestroyedInternal();
     });
-    // Will execute workerGlobalScopeDestroyedInternal() on context's thread.
 }
 
 void WorkerMessagingProxy::workerGlobalScopeClosed()
 {
-    // Executes terminateWorkerGlobalScope() on parent context's thread.
     m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) {
         terminateWorkerGlobalScope();
     });
@@ -231,7 +229,7 @@ void WorkerMessagingProxy::workerGlobalScopeClosed()
 
 void WorkerMessagingProxy::workerGlobalScopeDestroyedInternal()
 {
-    // WorkerGlobalScopeDestroyedTask is always the last to be performed, so the proxy is not needed for communication
+    // This is always the last task to be performed, so the proxy is not needed for communication
     // in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too.
     m_askedToTerminate = true;
     m_workerThread = nullptr;
@@ -255,7 +253,6 @@ void WorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivit
     m_scriptExecutionContext->postTask([this, hasPendingActivity] (ScriptExecutionContext&) {
         reportPendingActivityInternal(true, hasPendingActivity);
     });
-    // Will execute reportPendingActivityInternal() on context's thread.
 }
 
 void WorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity)
@@ -263,7 +260,6 @@ void WorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity)
     m_scriptExecutionContext->postTask([this, hasPendingActivity] (ScriptExecutionContext&) {
         reportPendingActivityInternal(false, hasPendingActivity);
     });
-    // Will execute reportPendingActivityInternal() on context's thread.
 }
 
 void WorkerMessagingProxy::reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity)
index 95fa7dc..33a8e83 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef WorkerMessagingProxy_h
-#define WorkerMessagingProxy_h
+#pragma once
 
 #include "ScriptExecutionContext.h"
 #include "WorkerGlobalScopeProxy.h"
@@ -42,7 +40,6 @@ namespace WebCore {
 
     class ContentSecurityPolicyResponseHeaders;
     class DedicatedWorkerThread;
-    class ScriptExecutionContext;
     class Worker;
 
     class WorkerMessagingProxy : public WorkerGlobalScopeProxy, public WorkerObjectProxy, public WorkerLoaderProxy {
@@ -84,11 +81,6 @@ namespace WebCore {
         virtual ~WorkerMessagingProxy();
 
     private:
-        friend class MessageWorkerTask;
-        friend class WorkerGlobalScopeDestroyedTask;
-        friend class WorkerExceptionTask;
-        friend class WorkerThreadActivityReportTask;
-
         void workerGlobalScopeDestroyedInternal();
         void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity);
         Worker* workerObject() const { return m_workerObject; }
@@ -107,5 +99,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerMessagingProxy_h
index d9e865d..e89c84c 100644 (file)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerObjectProxy_h
-#define WorkerObjectProxy_h
+#pragma once
 
 #include "WorkerReportingProxy.h"
 #include "MessagePort.h"
@@ -52,5 +51,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerObjectProxy_h
index adcbb9d..62ec808 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerReportingProxy_h
-#define WorkerReportingProxy_h
+#pragma once
 
 #include <runtime/ConsoleTypes.h>
-#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -53,5 +51,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerReportingProxy_h
index e2558c4..9d4210f 100644 (file)
@@ -116,7 +116,7 @@ public:
     {
         m_runLoop.m_nestedCount--;
         if (!m_runLoop.m_nestedCount)
-            threadGlobalData().threadTimers().setSharedTimer(0);
+            threadGlobalData().threadTimers().setSharedTimer(nullptr);
     }
 private:
     WorkerRunLoop& m_runLoop;
index 943033d..3a2cffc 100644 (file)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WorkerRunLoop_h
-#define WorkerRunLoop_h
+#pragma once
 
 #include "ScriptExecutionContext.h"
 #include <memory>
@@ -92,5 +91,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerRunLoop_h
index 04c4f94..e3f6409 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 #include "config.h"
-
 #include "WorkerScriptLoader.h"
 
 #include "ContentSecurityPolicy.h"
 #include "ResourceResponse.h"
 #include "ScriptExecutionContext.h"
-#include "SecurityOrigin.h"
 #include "TextResourceDecoder.h"
 #include "WorkerGlobalScope.h"
 #include "WorkerScriptLoaderClient.h"
 #include "WorkerThreadableLoader.h"
 #include <wtf/Ref.h>
-#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
 WorkerScriptLoader::WorkerScriptLoader()
-    : m_client(0)
+    : m_client(nullptr)
     , m_failed(false)
     , m_identifier(0)
     , m_finishing(false)
@@ -114,7 +110,7 @@ const URL& WorkerScriptLoader::responseURL() const
 std::unique_ptr<ResourceRequest> WorkerScriptLoader::createResourceRequest()
 {
     auto request = std::make_unique<ResourceRequest>(m_url);
-    request->setHTTPMethod("GET");
+    request->setHTTPMethod(ASCIILiteral("GET"));
     return request;
 }
     
@@ -137,9 +133,9 @@ void WorkerScriptLoader::didReceiveData(const char* data, int len)
 
     if (!m_decoder) {
         if (!m_responseEncoding.isEmpty())
-            m_decoder = TextResourceDecoder::create("text/javascript", m_responseEncoding);
+            m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), m_responseEncoding);
         else
-            m_decoder = TextResourceDecoder::create("text/javascript", "UTF-8");
+            m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), "UTF-8");
     }
 
     if (!len)
index d91f7cb..563a9d6 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef WorkerScriptLoader_h
-#define WorkerScriptLoader_h
+#pragma once
 
 #include "URL.h"
 #include "ResourceRequest.h"
@@ -92,5 +90,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerScriptLoader_h
index 1f45150..10d06c7 100644 (file)
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
-#ifndef WorkerScriptLoaderClient_h
-#define WorkerScriptLoaderClient_h
+#pragma once
 
 namespace WebCore {
 
@@ -45,5 +43,3 @@ namespace WebCore {
     };
 
 } // namespace WebCore
-
-#endif // WorkerScriptLoaderClient_h
index 564f2e2..b581c4f 100644 (file)
  */
 
 #include "config.h"
-
 #include "WorkerThread.h"
 
 #include "ContentSecurityPolicyResponseHeaders.h"
-#include "DedicatedWorkerGlobalScope.h"
 #include "IDBConnectionProxy.h"
 #include "ScriptSourceCode.h"
 #include "SecurityOrigin.h"
 #include "SocketProvider.h"
 #include "ThreadGlobalData.h"
 #include "URL.h"
+#include "WorkerGlobalScope.h"
 #include <utility>
 #include <wtf/Lock.h>
 #include <wtf/NeverDestroyed.h>
@@ -99,9 +98,6 @@ WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const
     , m_workerLoaderProxy(workerLoaderProxy)
     , m_workerReportingProxy(workerReportingProxy)
     , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin))
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-    , m_notificationClient(0)
-#endif
 #if ENABLE(INDEXED_DATABASE)
     , m_idbConnectionProxy(connectionProxy)
 #endif
index 7d4ee55..c4c4725 100644 (file)
@@ -21,7 +21,6 @@
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
  */
 
 #pragma once
@@ -102,7 +101,7 @@ private:
     std::unique_ptr<WorkerThreadStartupData> m_startupData;
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-    NotificationClient* m_notificationClient;
+    NotificationClient* m_notificationClient { nullptr };
 #endif
 
 #if ENABLE(INDEXED_DATABASE)
@@ -114,4 +113,3 @@ private:
 };
 
 } // namespace WebCore
-