Changeset 207546 in webkit


Ignore:
Timestamp:
Oct 19, 2016 11:09:50 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Cleanup WebCore/workers
https://bugs.webkit.org/show_bug.cgi?id=163635

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-10-19
Reviewed by Chris Dumez.

  • workers/*:

Cleanup like pragma once, nullptr, remove stale includes, declarations.

Location:
trunk/Source/WebCore
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207544 r207546  
     12016-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
    1112016-10-19  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/workers/AbstractWorker.cpp

    r206254 r207546  
    3333
    3434#include "ContentSecurityPolicy.h"
    35 #include "Event.h"
    3635#include "ExceptionCode.h"
    3736#include "ScriptExecutionContext.h"
  • trunk/Source/WebCore/workers/AbstractWorker.h

    r204466 r207546  
    2929 */
    3030
    31 #ifndef AbstractWorker_h
    32 #define AbstractWorker_h
     31#pragma once
    3332
    3433#include "ActiveDOMObject.h"
     
    3635#include "EventTarget.h"
    3736#include <wtf/RefCounted.h>
    38 #include <wtf/RefPtr.h>
    3937#include <wtf/text/AtomicStringHash.h>
    4038
     
    6361
    6462} // namespace WebCore
    65 
    66 #endif // AbstractWorker_h
  • trunk/Source/WebCore/workers/Worker.cpp

    r207505 r207546  
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2424 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  *
    2625 */
    2726
    2827#include "config.h"
    29 
    3028#include "Worker.h"
    3129
    32 #include "DOMWindow.h"
    33 #include "CachedResourceLoader.h"
    3430#include "ContentSecurityPolicy.h"
    35 #include "Document.h"
    36 #include "EventListener.h"
     31#include "Event.h"
    3732#include "EventNames.h"
    3833#include "ExceptionCode.h"
    39 #include "Frame.h"
    40 #include "FrameLoader.h"
    4134#include "InspectorInstrumentation.h"
    42 #include "MessageEvent.h"
    4335#include "NetworkStateNotifier.h"
     36#include "ResourceResponse.h"
    4437#include "SecurityOrigin.h"
    45 #include "TextEncoding.h"
    4638#include "WorkerGlobalScopeProxy.h"
    4739#include "WorkerScriptLoader.h"
  • trunk/Source/WebCore/workers/Worker.h

    r207505 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
    27 #ifndef Worker_h
    28 #define Worker_h
     26#pragma once
    2927
    3028#include "AbstractWorker.h"
    3129#include "ActiveDOMObject.h"
    3230#include "ContentSecurityPolicyResponseHeaders.h"
    33 #include "EventListener.h"
    3431#include "EventTarget.h"
    3532#include "MessagePort.h"
     
    8885
    8986} // namespace WebCore
    90 
    91 #endif // Worker_h
  • trunk/Source/WebCore/workers/Worker.idl

    r206723 r207546  
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2424 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  *
    2625 */
    2726
  • trunk/Source/WebCore/workers/WorkerConsoleClient.h

    r198786 r207546  
    2424 */
    2525
    26 #ifndef WorkerConsoleClient_h
    27 #define WorkerConsoleClient_h
     26#pragma once
    2827
    2928#include "WorkerGlobalScope.h"
     
    5857
    5958} // namespace WebCore
    60 
    61 #endif // WorkerConsoleClient_h
  • trunk/Source/WebCore/workers/WorkerEventQueue.cpp

    r201675 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
     
    2827#include "WorkerEventQueue.h"
    2928
    30 #include "DOMWindow.h"
    31 #include "Document.h"
    3229#include "Event.h"
    3330#include "EventNames.h"
     31#include "EventTarget.h"
    3432#include "ScriptExecutionContext.h"
    3533
     
    3836WorkerEventQueue::WorkerEventQueue(ScriptExecutionContext& context)
    3937    : m_scriptExecutionContext(context)
    40     , m_isClosed(false)
    4138{
    4239}
     
    5350        : m_event(WTFMove(event))
    5451        , m_eventQueue(eventQueue)
    55         , m_isCancelled(false)
    5652    {
    5753    }
     
    8177    RefPtr<Event> m_event;
    8278    WorkerEventQueue& m_eventQueue;
    83     bool m_isCancelled;
     79    bool m_isCancelled { false };
    8480};
    8581
     
    116112}
    117113
    118 }
     114} // namespace WebCore
  • trunk/Source/WebCore/workers/WorkerEventQueue.h

    r197563 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
    27 #ifndef WorkerEventQueue_h
    28 #define WorkerEventQueue_h
     26#pragma once
    2927
    3028#include "EventQueue.h"
     
    4644private:
    4745    ScriptExecutionContext& m_scriptExecutionContext;
    48     bool m_isClosed;
     46    bool m_isClosed { false };
    4947
    5048    class EventDispatcher;
     
    5351};
    5452
    55 }
    56 
    57 #endif // WorkerEventQueue_h
     53} // namespace WebCore
  • trunk/Source/WebCore/workers/WorkerGlobalScope.cpp

    r206627 r207546  
    2929#include "WorkerGlobalScope.h"
    3030
    31 #include "ActiveDOMObject.h"
    3231#include "ContentSecurityPolicy.h"
    3332#include "Crypto.h"
    3433#include "DOMTimer.h"
    35 #include "DOMURL.h"
    36 #include "DOMWindow.h"
    37 #include "ErrorEvent.h"
    3834#include "Event.h"
    3935#include "ExceptionCode.h"
    4036#include "IDBConnectionProxy.h"
    4137#include "InspectorConsoleInstrumentation.h"
    42 #include "MessagePort.h"
    4338#include "ScheduledAction.h"
    4439#include "ScriptSourceCode.h"
     
    5045#include "WorkerLocation.h"
    5146#include "WorkerNavigator.h"
    52 #include "WorkerObjectProxy.h"
     47#include "WorkerReportingProxy.h"
    5348#include "WorkerScriptLoader.h"
    5449#include "WorkerThread.h"
    5550#include "WorkerThreadableLoader.h"
    56 #include <bindings/ScriptValue.h>
    5751#include <inspector/ConsoleMessage.h>
    5852#include <inspector/ScriptCallStack.h>
    59 #include <wtf/RefPtr.h>
    60 
    61 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    62 #include "NotificationCenter.h"
    63 #endif
    6453
    6554using namespace Inspector;
     
    290279
    291280    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);
    293282}
    294283
     
    353342    ASSERT(m_context->isContextThread());
    354343    m_context->unregisterObserver(this);
    355     m_context = 0;
     344    m_context = nullptr;
    356345}
    357346
  • trunk/Source/WebCore/workers/WorkerGlobalScope.h

    r206627 r207546  
    3535#include "WorkerScriptController.h"
    3636#include <memory>
    37 #include <wtf/Assertions.h>
    3837#include <wtf/HashSet.h>
    3938#include <wtf/RefCounted.h>
     
    4746namespace WebCore {
    4847
    49 class Blob;
    5048class ContentSecurityPolicyResponseHeaders;
    5149class Crypto;
     
    165163    void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, RefPtr<Inspector::ScriptCallStack>&&) override;
    166164    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);
    168166
    169167private:
     
    174172    void derefEventTarget() final { deref(); }
    175173
    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;
    177175
    178176    EventTarget* errorEventTarget() override;
  • trunk/Source/WebCore/workers/WorkerGlobalScope.idl

    r205280 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
  • trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h

    r201675 r207546  
    2929 */
    3030
    31 #ifndef WorkerGlobalScopeProxy_h
    32 #define WorkerGlobalScopeProxy_h
     31#pragma once
    3332
    3433#include "MessagePort.h"
     
    6463
    6564} // namespace WebCore
    66 
    67 #endif // WorkerGlobalScopeProxy_h
  • trunk/Source/WebCore/workers/WorkerLoaderProxy.h

    r202313 r207546  
    2929 */
    3030
    31 #ifndef WorkerLoaderProxy_h
    32 #define WorkerLoaderProxy_h
     31#pragma once
    3332
    3433#include "ScriptExecutionContext.h"
    35 #include <wtf/Forward.h>
    3634
    3735namespace WebCore {
     
    5654
    5755} // namespace WebCore
    58 
    59 #endif // WorkerLoaderProxy_h
  • trunk/Source/WebCore/workers/WorkerLocation.cpp

    r192810 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
  • trunk/Source/WebCore/workers/WorkerLocation.h

    r204954 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
    27 #ifndef WorkerLocation_h
    28 #define WorkerLocation_h
     26#pragma once
    2927
    3028#include "URL.h"
    3129#include <wtf/RefCounted.h>
    32 #include <wtf/RefPtr.h>
    3330#include <wtf/text/WTFString.h>
    3431
     
    6360
    6461} // namespace WebCore
    65 
    66 #endif // WorkerLocation_h
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r202930 r207546  
    191191void WorkerMessagingProxy::workerObjectDestroyed()
    192192{
    193     m_workerObject = 0;
     193    m_workerObject = nullptr;
    194194    m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) {
    195195        m_mayBeDestroyed = true;
     
    219219        workerGlobalScopeDestroyedInternal();
    220220    });
    221     // Will execute workerGlobalScopeDestroyedInternal() on context's thread.
    222221}
    223222
    224223void WorkerMessagingProxy::workerGlobalScopeClosed()
    225224{
    226     // Executes terminateWorkerGlobalScope() on parent context's thread.
    227225    m_scriptExecutionContext->postTask([this] (ScriptExecutionContext&) {
    228226        terminateWorkerGlobalScope();
     
    232230void WorkerMessagingProxy::workerGlobalScopeDestroyedInternal()
    233231{
    234     // WorkerGlobalScopeDestroyedTask is always the last to be performed, so the proxy is not needed for communication
     232    // This is always the last task to be performed, so the proxy is not needed for communication
    235233    // in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too.
    236234    m_askedToTerminate = true;
     
    256254        reportPendingActivityInternal(true, hasPendingActivity);
    257255    });
    258     // Will execute reportPendingActivityInternal() on context's thread.
    259256}
    260257
     
    264261        reportPendingActivityInternal(false, hasPendingActivity);
    265262    });
    266     // Will execute reportPendingActivityInternal() on context's thread.
    267263}
    268264
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.h

    r202313 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
    27 #ifndef WorkerMessagingProxy_h
    28 #define WorkerMessagingProxy_h
     26#pragma once
    2927
    3028#include "ScriptExecutionContext.h"
     
    4341    class ContentSecurityPolicyResponseHeaders;
    4442    class DedicatedWorkerThread;
    45     class ScriptExecutionContext;
    4643    class Worker;
    4744
     
    8582
    8683    private:
    87         friend class MessageWorkerTask;
    88         friend class WorkerGlobalScopeDestroyedTask;
    89         friend class WorkerExceptionTask;
    90         friend class WorkerThreadActivityReportTask;
    91 
    9284        void workerGlobalScopeDestroyedInternal();
    9385        void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity);
     
    108100
    109101} // namespace WebCore
    110 
    111 #endif // WorkerMessagingProxy_h
  • trunk/Source/WebCore/workers/WorkerObjectProxy.h

    r201675 r207546  
    2929 */
    3030
    31 #ifndef WorkerObjectProxy_h
    32 #define WorkerObjectProxy_h
     31#pragma once
    3332
    3433#include "WorkerReportingProxy.h"
     
    5352
    5453} // namespace WebCore
    55 
    56 #endif // WorkerObjectProxy_h
  • trunk/Source/WebCore/workers/WorkerReportingProxy.h

    r193426 r207546  
    2929 */
    3030
    31 #ifndef WorkerReportingProxy_h
    32 #define WorkerReportingProxy_h
     31#pragma once
    3332
    3433#include <runtime/ConsoleTypes.h>
    35 #include <wtf/Forward.h>
    3634
    3735namespace WebCore {
     
    5452
    5553} // namespace WebCore
    56 
    57 #endif // WorkerReportingProxy_h
  • trunk/Source/WebCore/workers/WorkerRunLoop.cpp

    r202313 r207546  
    117117        m_runLoop.m_nestedCount--;
    118118        if (!m_runLoop.m_nestedCount)
    119             threadGlobalData().threadTimers().setSharedTimer(0);
     119            threadGlobalData().threadTimers().setSharedTimer(nullptr);
    120120    }
    121121private:
  • trunk/Source/WebCore/workers/WorkerRunLoop.h

    r202313 r207546  
    2929 */
    3030
    31 #ifndef WorkerRunLoop_h
    32 #define WorkerRunLoop_h
     31#pragma once
    3332
    3433#include "ScriptExecutionContext.h"
     
    9392
    9493} // namespace WebCore
    95 
    96 #endif // WorkerRunLoop_h
  • trunk/Source/WebCore/workers/WorkerScriptLoader.cpp

    r204019 r207546  
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2424 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  *
    2625 */
    2726
    2827#include "config.h"
    29 
    3028#include "WorkerScriptLoader.h"
    3129
     
    3331#include "ResourceResponse.h"
    3432#include "ScriptExecutionContext.h"
    35 #include "SecurityOrigin.h"
    3633#include "TextResourceDecoder.h"
    3734#include "WorkerGlobalScope.h"
     
    3936#include "WorkerThreadableLoader.h"
    4037#include <wtf/Ref.h>
    41 #include <wtf/RefPtr.h>
    4238
    4339namespace WebCore {
    4440
    4541WorkerScriptLoader::WorkerScriptLoader()
    46     : m_client(0)
     42    : m_client(nullptr)
    4743    , m_failed(false)
    4844    , m_identifier(0)
     
    115111{
    116112    auto request = std::make_unique<ResourceRequest>(m_url);
    117     request->setHTTPMethod("GET");
     113    request->setHTTPMethod(ASCIILiteral("GET"));
    118114    return request;
    119115}
     
    138134    if (!m_decoder) {
    139135        if (!m_responseEncoding.isEmpty())
    140             m_decoder = TextResourceDecoder::create("text/javascript", m_responseEncoding);
     136            m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), m_responseEncoding);
    141137        else
    142             m_decoder = TextResourceDecoder::create("text/javascript", "UTF-8");
     138            m_decoder = TextResourceDecoder::create(ASCIILiteral("text/javascript"), "UTF-8");
    143139    }
    144140
  • trunk/Source/WebCore/workers/WorkerScriptLoader.h

    r204466 r207546  
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2424 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  *
    2625 */
    2726
    28 #ifndef WorkerScriptLoader_h
    29 #define WorkerScriptLoader_h
     27#pragma once
    3028
    3129#include "URL.h"
     
    9391
    9492} // namespace WebCore
    95 
    96 #endif // WorkerScriptLoader_h
  • trunk/Source/WebCore/workers/WorkerScriptLoaderClient.h

    r165676 r207546  
    2323 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2424 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  *
    2625 */
    2726
    28 #ifndef WorkerScriptLoaderClient_h
    29 #define WorkerScriptLoaderClient_h
     27#pragma once
    3028
    3129namespace WebCore {
     
    4644
    4745} // namespace WebCore
    48 
    49 #endif // WorkerScriptLoaderClient_h
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r203238 r207546  
    2626
    2727#include "config.h"
    28 
    2928#include "WorkerThread.h"
    3029
    3130#include "ContentSecurityPolicyResponseHeaders.h"
    32 #include "DedicatedWorkerGlobalScope.h"
    3331#include "IDBConnectionProxy.h"
    3432#include "ScriptSourceCode.h"
     
    3735#include "ThreadGlobalData.h"
    3836#include "URL.h"
     37#include "WorkerGlobalScope.h"
    3938#include <utility>
    4039#include <wtf/Lock.h>
     
    10099    , m_workerReportingProxy(workerReportingProxy)
    101100    , 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 #endif
    105101#if ENABLE(INDEXED_DATABASE)
    106102    , m_idbConnectionProxy(connectionProxy)
  • trunk/Source/WebCore/workers/WorkerThread.h

    r202930 r207546  
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  *
    2524 */
    2625
     
    103102
    104103#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    105     NotificationClient* m_notificationClient;
     104    NotificationClient* m_notificationClient { nullptr };
    106105#endif
    107106
     
    115114
    116115} // namespace WebCore
    117 
Note: See TracChangeset for help on using the changeset viewer.