17757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch/*
27757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * Copyright (C) 2013 Google Inc. All rights reserved.
37757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *
47757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * Redistribution and use in source and binary forms, with or without
57757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * modification, are permitted provided that the following conditions are
67757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * met:
77757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *
87757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *     * Redistributions of source code must retain the above copyright
97757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * notice, this list of conditions and the following disclaimer.
107757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *     * Redistributions in binary form must reproduce the above
117757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * copyright notice, this list of conditions and the following disclaimer
127757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * in the documentation and/or other materials provided with the
137757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * distribution.
147757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *     * Neither the name of Google Inc. nor the names of its
157757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * contributors may be used to endorse or promote products derived from
167757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * this software without specific prior written permission.
177757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch *
187757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
197757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
207757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
217757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
227757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
237757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
247757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
257757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
267757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
277757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
287757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
297757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch */
307757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
317757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#ifndef WorkerThreadStartupData_h
327757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#define WorkerThreadStartupData_h
337757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
34d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#include "core/frame/csp/ContentSecurityPolicy.h"
357757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "core/workers/WorkerClients.h"
367757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "core/workers/WorkerThread.h"
37d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)#include "platform/network/ContentSecurityPolicyParsers.h"
3851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)#include "platform/weborigin/KURL.h"
397757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/Forward.h"
407757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/Noncopyable.h"
417757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
42c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
437757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
447757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochclass WorkerClients;
457757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
466f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdochclass WorkerThreadStartupData FINAL : public NoBaseWillBeGarbageCollectedFinalized<WorkerThreadStartupData> {
47d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData);
48d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
497757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochpublic:
506f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
517757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    {
52d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)        return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, workerClients));
537757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    }
547757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
557757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    ~WorkerThreadStartupData();
567757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
577757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    KURL m_scriptURL;
587757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    String m_userAgent;
597757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    String m_sourceCode;
607757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    WorkerThreadStartMode m_startMode;
617757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch    String m_contentSecurityPolicy;
62d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    ContentSecurityPolicyHeaderType m_contentSecurityPolicyType;
636f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    OwnPtrWillBeMember<WorkerClients> m_workerClients;
647757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
656f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    void trace(Visitor*);
66d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
677757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochprivate:
686f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, PassOwnPtrWillBeRawPtr<WorkerClients>);
697757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch};
707757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
71c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink
727757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch
737757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#endif // WorkerThreadStartupData_h
74