Changeset 156751 in webkit


Ignore:
Timestamp:
Oct 1, 2013 5:03:12 PM (10 years ago)
Author:
weinig@apple.com
Message:

Convert PageGroup to using std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=122184

Reviewed by Anders Carlsson.

  • page/CaptionUserPreferences.cpp:
  • page/CaptionUserPreferences.h:
  • page/CaptionUserPreferencesMediaAF.cpp:
  • page/CaptionUserPreferencesMediaAF.h:
  • page/Frame.cpp:
  • page/GroupSettings.h:
  • page/Page.cpp:
  • page/PageGroup.cpp:
  • page/PageGroup.h:
  • page/UserScriptTypes.h:
  • page/UserStyleSheetTypes.h:
  • workers/DedicatedWorkerGlobalScope.h:
  • workers/DedicatedWorkerThread.cpp:
  • workers/DedicatedWorkerThread.h:
  • workers/SharedWorkerGlobalScope.cpp:
  • workers/SharedWorkerGlobalScope.h:
  • workers/SharedWorkerThread.cpp:
  • workers/SharedWorkerThread.h:
  • workers/WorkerGlobalScope.cpp:
  • workers/WorkerGlobalScope.h:
  • workers/WorkerThread.cpp:
  • workers/WorkerThread.h:
Location:
trunk/Source/WebCore
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156749 r156751  
     12013-10-01  Sam Weinig  <sam@webkit.org>
     2
     3        Convert PageGroup to using std::unique_ptr
     4        https://bugs.webkit.org/show_bug.cgi?id=122184
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * page/CaptionUserPreferences.cpp:
     9        * page/CaptionUserPreferences.h:
     10        * page/CaptionUserPreferencesMediaAF.cpp:
     11        * page/CaptionUserPreferencesMediaAF.h:
     12        * page/Frame.cpp:
     13        * page/GroupSettings.h:
     14        * page/Page.cpp:
     15        * page/PageGroup.cpp:
     16        * page/PageGroup.h:
     17        * page/UserScriptTypes.h:
     18        * page/UserStyleSheetTypes.h:
     19        * workers/DedicatedWorkerGlobalScope.h:
     20        * workers/DedicatedWorkerThread.cpp:
     21        * workers/DedicatedWorkerThread.h:
     22        * workers/SharedWorkerGlobalScope.cpp:
     23        * workers/SharedWorkerGlobalScope.h:
     24        * workers/SharedWorkerThread.cpp:
     25        * workers/SharedWorkerThread.h:
     26        * workers/WorkerGlobalScope.cpp:
     27        * workers/WorkerGlobalScope.h:
     28        * workers/WorkerThread.cpp:
     29        * workers/WorkerThread.h:
     30
    1312013-10-01  Tim Horton  <timothy_horton@apple.com>
    232
  • trunk/Source/WebCore/page/CaptionUserPreferences.cpp

    r156550 r156751  
    3838namespace WebCore {
    3939
    40 CaptionUserPreferences::CaptionUserPreferences(PageGroup* group)
     40CaptionUserPreferences::CaptionUserPreferences(PageGroup& group)
    4141    : m_pageGroup(group)
    4242    , m_displayMode(ForcedOnly)
     
    8080bool CaptionUserPreferences::userPrefersCaptions() const
    8181{
    82     Page* page = *(pageGroup()->pages().begin());
     82    Page* page = *(m_pageGroup.pages().begin());
    8383    if (!page)
    8484        return false;
     
    8989void CaptionUserPreferences::setUserPrefersCaptions(bool preference)
    9090{
    91     Page* page = *(pageGroup()->pages().begin());
     91    Page* page = *(m_pageGroup.pages().begin());
    9292    if (!page)
    9393        return;
     
    9999bool CaptionUserPreferences::userPrefersSubtitles() const
    100100{
    101     Page* page = *(pageGroup()->pages().begin());
     101    Page* page = *(pageGroup().pages().begin());
    102102    if (!page)
    103103        return false;
     
    108108void CaptionUserPreferences::setUserPrefersSubtitles(bool preference)
    109109{
    110     Page* page = *(pageGroup()->pages().begin());
     110    Page* page = *(m_pageGroup.pages().begin());
    111111    if (!page)
    112112        return;
     
    118118bool CaptionUserPreferences::userPrefersTextDescriptions() const
    119119{
    120     Page* page = *(pageGroup()->pages().begin());
     120    Page* page = *(m_pageGroup.pages().begin());
    121121    if (!page)
    122122        return false;
     
    127127void CaptionUserPreferences::setUserPrefersTextDescriptions(bool preference)
    128128{
    129     Page* page = *(pageGroup()->pages().begin());
     129    Page* page = *(m_pageGroup.pages().begin());
    130130    if (!page)
    131131        return;
     
    137137void CaptionUserPreferences::captionPreferencesChanged()
    138138{
    139     m_pageGroup->captionPreferencesChanged();
     139    m_pageGroup.captionPreferencesChanged();
    140140}
    141141
     
    239239    DEFINE_STATIC_LOCAL(URL, captionsStyleSheetURL, (ParsedURLString, "user-captions-override:01F6AF12-C3B0-4F70-AF5E-A3E00234DC23"));
    240240
    241     pageGroup()->removeUserStyleSheetFromWorld(mainThreadNormalWorld(), captionsStyleSheetURL);
     241    m_pageGroup.removeUserStyleSheetFromWorld(mainThreadNormalWorld(), captionsStyleSheetURL);
    242242
    243243    String captionsOverrideStyleSheet = captionsStyleSheetOverride();
     
    245245        return;
    246246
    247     pageGroup()->addUserStyleSheetToWorld(mainThreadNormalWorld(), captionsOverrideStyleSheet, captionsStyleSheetURL, Vector<String>(),
     247    m_pageGroup.addUserStyleSheetToWorld(mainThreadNormalWorld(), captionsOverrideStyleSheet, captionsStyleSheetURL, Vector<String>(),
    248248        Vector<String>(), InjectInAllFrames, UserStyleAuthorLevel, InjectInExistingDocuments);
    249249}
  • trunk/Source/WebCore/page/CaptionUserPreferences.h

    r155277 r156751  
    4444class CaptionUserPreferences {
    4545public:
    46     static PassOwnPtr<CaptionUserPreferences> create(PageGroup* group) { return adoptPtr(new CaptionUserPreferences(group)); }
     46    CaptionUserPreferences(PageGroup&);
    4747    virtual ~CaptionUserPreferences();
    4848
     
    8888    virtual void setTestingMode(bool override) { m_testingMode = override; }
    8989   
    90     PageGroup* pageGroup() const { return m_pageGroup; }
     90    PageGroup& pageGroup() const { return m_pageGroup; }
    9191
    9292protected:
    93     CaptionUserPreferences(PageGroup*);
    9493    void updateCaptionStyleSheetOveride();
    9594
     
    9897    void notify();
    9998
    100     PageGroup* m_pageGroup;
     99    PageGroup& m_pageGroup;
    101100    CaptionDisplayMode m_displayMode;
    102101    Timer<CaptionUserPreferences> m_timer;
  • trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp

    r156550 r156751  
    4141#include "Logging.h"
    4242#include "MediaControlElements.h"
    43 #include "PageGroup.h"
    4443#include "SoftLinking.h"
    4544#include "TextTrackCue.h"
     
    142141#endif
    143142
    144 CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF(PageGroup* group)
     143CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF(PageGroup& group)
    145144    : CaptionUserPreferences(group)
    146145#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
  • trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.h

    r152004 r156751  
    3838class CaptionUserPreferencesMediaAF : public CaptionUserPreferences {
    3939public:
    40     static PassOwnPtr<CaptionUserPreferencesMediaAF> create(PageGroup* group) { return adoptPtr(new CaptionUserPreferencesMediaAF(group)); }
     40    CaptionUserPreferencesMediaAF(PageGroup&);
    4141    virtual ~CaptionUserPreferencesMediaAF();
    4242
     
    6868
    6969private:
    70     CaptionUserPreferencesMediaAF(PageGroup*);
    71 
    7270#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
    7371    String captionsWindowCSS() const;
  • trunk/Source/WebCore/page/Frame.cpp

    r156622 r156751  
    536536    if (!userScripts)
    537537        return;
    538     UserScriptMap::const_iterator end = userScripts->end();
    539     for (UserScriptMap::const_iterator it = userScripts->begin(); it != end; ++it)
     538
     539    for (auto it = userScripts->begin(), end = userScripts->end(); it != end; ++it)
    540540        injectUserScriptsForWorld(it->key.get(), *it->value, injectionTime);
    541541}
  • trunk/Source/WebCore/page/GroupSettings.h

    r127757 r156751  
    2727#define GroupSettings_h
    2828
    29 #include <wtf/PassOwnPtr.h>
    3029#include <wtf/text/WTFString.h>
    3130
     
    3736    WTF_MAKE_NONCOPYABLE(GroupSettings); WTF_MAKE_FAST_ALLOCATED;
    3837public:
    39     static PassOwnPtr<GroupSettings> create()
    40     {
    41         return adoptPtr(new GroupSettings());
    42     }
     38    GroupSettings();
    4339
    4440    void setLocalStorageQuotaBytes(unsigned);
     
    5248
    5349private:
    54     GroupSettings();
    55 
    5650    unsigned m_localStorageQuotaBytes;
    5751    String m_indexedDBDatabasePath;
  • trunk/Source/WebCore/page/Page.cpp

    r156660 r156751  
    435435        ASSERT(m_group != m_singlePageGroup.get());
    436436        ASSERT(!m_singlePageGroup);
    437         m_group->removePage(this);
     437        m_group->removePage(*this);
    438438    }
    439439
     
    443443        m_singlePageGroup = nullptr;
    444444        m_group = PageGroup::pageGroup(name);
    445         m_group->addPage(this);
     445        m_group->addPage(*this);
    446446    }
    447447}
  • trunk/Source/WebCore/page/PageGroup.cpp

    r156660 r156751  
    3939#include "Settings.h"
    4040#include "StorageNamespace.h"
     41#include <wtf/StdLibExtras.h>
    4142
    4243#if ENABLE(VIDEO_TRACK)
     
    6465    , m_visitedLinksPopulated(false)
    6566    , m_identifier(getUniqueIdentifier())
    66     , m_groupSettings(GroupSettings::create())
     67    , m_groupSettings(std::make_unique<GroupSettings>())
    6768{
    6869}
     
    7172    : m_visitedLinksPopulated(false)
    7273    , m_identifier(getUniqueIdentifier())
    73     , m_groupSettings(GroupSettings::create())
    74 {
    75     addPage(&page);
     74    , m_groupSettings(std::make_unique<GroupSettings>())
     75{
     76    addPage(page);
    7677}
    7778
     
    107108        return;
    108109
    109     PageGroupMap::iterator end = pageGroups->end();
    110 
    111     for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
     110    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
    112111        if (it->value->hasLocalStorage())
    113112            it->value->localStorage()->close();
     
    120119        return;
    121120
    122     PageGroupMap::iterator end = pageGroups->end();
    123     for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
     121    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
    124122        if (it->value->hasLocalStorage())
    125123            it->value->localStorage()->clearAllOriginsForDeletion();
     
    132130        return;
    133131
    134     PageGroupMap::iterator end = pageGroups->end();
    135     for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
     132    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
    136133        if (it->value->hasLocalStorage())
    137134            it->value->localStorage()->clearOriginForDeletion(origin);
     
    144141        return;
    145142
    146     PageGroupMap::iterator end = pageGroups->end();
    147     for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
     143    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
    148144        if (it->value->hasLocalStorage())
    149145            it->value->localStorage()->closeIdleLocalStorageDatabases();
     
    156152        return;
    157153
    158     PageGroupMap::iterator end = pageGroups->end();
    159     for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
     154    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
    160155        if (it->value->hasLocalStorage())
    161156            it->value->localStorage()->sync();
     
    171166}
    172167
    173 void PageGroup::addPage(Page* page)
    174 {
    175     ASSERT(page);
    176     ASSERT(!m_pages.contains(page));
    177     m_pages.add(page);
    178 }
    179 
    180 void PageGroup::removePage(Page* page)
    181 {
    182     ASSERT(page);
    183     ASSERT(m_pages.contains(page));
    184     m_pages.remove(page);
     168void PageGroup::addPage(Page& page)
     169{
     170    ASSERT(!m_pages.contains(&page));
     171    m_pages.add(&page);
     172}
     173
     174void PageGroup::removePage(Page& page)
     175{
     176    ASSERT(m_pages.contains(&page));
     177    m_pages.remove(&page);
    185178}
    186179
     
    274267    ASSERT_ARG(world, world);
    275268
    276     OwnPtr<UserScript> userScript = adoptPtr(new UserScript(source, url, whitelist, blacklist, injectionTime, injectedFrames));
     269    auto userScript = std::make_unique<UserScript>(source, url, whitelist, blacklist, injectionTime, injectedFrames);
    277270    if (!m_userScripts)
    278         m_userScripts = adoptPtr(new UserScriptMap);
    279     OwnPtr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->value;
     271        m_userScripts = std::make_unique<UserScriptMap>();
     272    std::unique_ptr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->value;
    280273    if (!scriptsInWorld)
    281         scriptsInWorld = adoptPtr(new UserScriptVector);
    282     scriptsInWorld->append(userScript.release());
     274        scriptsInWorld = std::make_unique<UserScriptVector>();
     275    scriptsInWorld->append(std::move(userScript));
    283276}
    284277
     
    291284    ASSERT_ARG(world, world);
    292285
    293     OwnPtr<UserStyleSheet> userStyleSheet = adoptPtr(new UserStyleSheet(source, url, whitelist, blacklist, injectedFrames, level));
     286    auto userStyleSheet = std::make_unique<UserStyleSheet>(source, url, whitelist, blacklist, injectedFrames, level);
    294287    if (!m_userStyleSheets)
    295         m_userStyleSheets = adoptPtr(new UserStyleSheetMap);
    296     OwnPtr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(world, nullptr).iterator->value;
     288        m_userStyleSheets = std::make_unique<UserStyleSheetMap>();
     289    std::unique_ptr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(world, nullptr).iterator->value;
    297290    if (!styleSheetsInWorld)
    298         styleSheetsInWorld = adoptPtr(new UserStyleSheetVector);
    299     styleSheetsInWorld->append(userStyleSheet.release());
     291        styleSheetsInWorld = std::make_unique<UserStyleSheetVector>();
     292    styleSheetsInWorld->append(std::move(userStyleSheet));
    300293
    301294    if (injectionTime == InjectInExistingDocuments)
     
    310303        return;
    311304
    312     UserScriptMap::iterator it = m_userScripts->find(world);
     305    auto it = m_userScripts->find(world);
    313306    if (it == m_userScripts->end())
    314307        return;
    315308   
    316     UserScriptVector* scripts = it->value.get();
     309    auto scripts = it->value.get();
    317310    for (int i = scripts->size() - 1; i >= 0; --i) {
    318311        if (scripts->at(i)->url() == url)
     
    331324        return;
    332325
    333     UserStyleSheetMap::iterator it = m_userStyleSheets->find(world);
     326    auto it = m_userStyleSheets->find(world);
    334327    bool sheetsChanged = false;
    335328    if (it == m_userStyleSheets->end())
    336329        return;
    337330   
    338     UserStyleSheetVector* stylesheets = it->value.get();
     331    auto stylesheets = it->value.get();
    339332    for (int i = stylesheets->size() - 1; i >= 0; --i) {
    340333        if (stylesheets->at(i)->url() == url) {
     
    378371void PageGroup::removeAllUserContent()
    379372{
    380     m_userScripts.clear();
     373    m_userScripts = nullptr;
    381374
    382375    if (m_userStyleSheets) {
    383         m_userStyleSheets.clear();
     376        m_userStyleSheets = nullptr;
    384377        invalidateInjectedStyleSheetCacheInAllFrames();
    385378    }
     
    389382{
    390383    // Clear our cached sheets and have them just reparse.
    391     HashSet<Page*>::const_iterator end = m_pages.end();
    392     for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
     384    for (auto it = m_pages.begin(), end = m_pages.end(); it != end; ++it) {
    393385        for (Frame* frame = &(*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
    394386            frame->document()->styleSheetCollection().invalidateInjectedStyleSheetCache();
     
    401393void PageGroup::captionPreferencesChanged()
    402394{
    403     for (HashSet<Page*>::iterator i = m_pages.begin(); i != m_pages.end(); ++i)
    404         (*i)->captionPreferencesChanged();
     395    for (auto it = m_pages.begin(), end = m_pages.end(); it != end; ++it)
     396        (*it)->captionPreferencesChanged();
    405397    pageCache()->markPagesForCaptionPreferencesChanged();
    406398}
     
    408400CaptionUserPreferences* PageGroup::captionPreferences()
    409401{
    410     if (!m_captionPreferences)
     402    if (!m_captionPreferences) {
    411403#if (PLATFORM(MAC) && !PLATFORM(IOS)) || HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
    412         m_captionPreferences = CaptionUserPreferencesMediaAF::create(this);
     404        m_captionPreferences = std::make_unique<CaptionUserPreferencesMediaAF>(*this);
    413405#else
    414         m_captionPreferences = CaptionUserPreferences::create(this);
     406        m_captionPreferences = std::make_unique<CaptionUserPreferences>(*this);
    415407#endif
     408    }
    416409
    417410    return m_captionPreferences.get();
    418411}
    419 
    420412#endif
    421413
  • trunk/Source/WebCore/page/PageGroup.h

    r156660 r156751  
    3737namespace WebCore {
    3838
    39 #if ENABLE(VIDEO_TRACK)
    40     class CaptionPreferencesChangedListener;
    41     class CaptionUserPreferences;
    42 #endif
    4339    class URL;
    4440    class GroupSettings;
     
    4743    class SecurityOrigin;
    4844    class StorageNamespace;
     45
     46#if ENABLE(VIDEO_TRACK)
     47    class CaptionPreferencesChangedListener;
     48    class CaptionUserPreferences;
     49#endif
    4950
    5051    class PageGroup : public Supplementable<PageGroup> {
     
    6970        const HashSet<Page*>& pages() const { return m_pages; }
    7071
    71         void addPage(Page*);
    72         void removePage(Page*);
     72        void addPage(Page&);
     73        void removePage(Page&);
    7374
    7475        bool isLinkVisited(LinkHash);
     
    130131        HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageNamespace> > m_transientLocalStorageMap;
    131132
    132         OwnPtr<UserScriptMap> m_userScripts;
    133         OwnPtr<UserStyleSheetMap> m_userStyleSheets;
     133        std::unique_ptr<UserScriptMap> m_userScripts;
     134        std::unique_ptr<UserStyleSheetMap> m_userStyleSheets;
    134135
    135         const OwnPtr<GroupSettings> m_groupSettings;
     136        const std::unique_ptr<GroupSettings> m_groupSettings;
    136137
    137138#if ENABLE(VIDEO_TRACK)
    138         OwnPtr<CaptionUserPreferences> m_captionPreferences;
     139        std::unique_ptr<CaptionUserPreferences> m_captionPreferences;
    139140#endif
    140141    };
  • trunk/Source/WebCore/page/UserScriptTypes.h

    r103793 r156751  
    3737class UserScript;
    3838
    39 typedef Vector<OwnPtr<UserScript> > UserScriptVector;
    40 typedef HashMap<RefPtr<DOMWrapperWorld>, OwnPtr<UserScriptVector> > UserScriptMap;
     39typedef Vector<std::unique_ptr<UserScript>> UserScriptVector;
     40typedef HashMap<RefPtr<DOMWrapperWorld>, std::unique_ptr<UserScriptVector>> UserScriptMap;
    4141
    4242} // namespace WebCore
  • trunk/Source/WebCore/page/UserStyleSheetTypes.h

    r103793 r156751  
    3838class UserStyleSheet;
    3939
    40 typedef Vector<OwnPtr<UserStyleSheet> > UserStyleSheetVector;
    41 typedef HashMap<RefPtr<DOMWrapperWorld>, OwnPtr<UserStyleSheetVector> > UserStyleSheetMap;
     40typedef Vector<std::unique_ptr<UserStyleSheet>> UserStyleSheetVector;
     41typedef HashMap<RefPtr<DOMWrapperWorld>, std::unique_ptr<UserStyleSheetVector>> UserStyleSheetMap;
    4242
    4343} // namespace WebCore
  • trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp

    r156550 r156751  
    4141namespace WebCore {
    4242
    43 PassRefPtr<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin)
     43PassRefPtr<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin)
    4444{
    45     RefPtr<DedicatedWorkerGlobalScope> context = adoptRef(new DedicatedWorkerGlobalScope(url, userAgent, settings, thread, topOrigin));
     45    RefPtr<DedicatedWorkerGlobalScope> context = adoptRef(new DedicatedWorkerGlobalScope(url, userAgent, std::move(settings), thread, topOrigin));
    4646    context->applyContentSecurityPolicyFromString(contentSecurityPolicy, contentSecurityPolicyType);
    4747    return context.release();
    4848}
    4949
    50 DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin)
    51     : WorkerGlobalScope(url, userAgent, settings, thread, topOrigin)
     50DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, DedicatedWorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin)
     51    : WorkerGlobalScope(url, userAgent, std::move(settings), thread, topOrigin)
    5252{
    5353}
  • trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h

    r156550 r156751  
    4545    public:
    4646        typedef WorkerGlobalScope Base;
    47         static PassRefPtr<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin);
     47        static PassRefPtr<DedicatedWorkerGlobalScope> create(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin);
    4848        virtual ~DedicatedWorkerGlobalScope();
    4949
     
    6565
    6666    private:
    67         DedicatedWorkerGlobalScope(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, PassRefPtr<SecurityOrigin> topOrigin);
     67        DedicatedWorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, DedicatedWorkerThread*, PassRefPtr<SecurityOrigin> topOrigin);
    6868    };
    6969
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp

    r156550 r156751  
    5656}
    5757
    58 PassRefPtr<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin)
     58PassRefPtr<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin)
    5959{
    60     return DedicatedWorkerGlobalScope::create(url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType, topOrigin);
     60    return DedicatedWorkerGlobalScope::create(url, userAgent, std::move(settings), this, contentSecurityPolicy, contentSecurityPolicyType, topOrigin);
    6161}
    6262
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.h

    r156550 r156751  
    4747
    4848    protected:
    49         virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) OVERRIDE;
     49        virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) OVERRIDE;
    5050        virtual void runEventLoop() OVERRIDE;
    5151
  • trunk/Source/WebCore/workers/SharedWorkerGlobalScope.cpp

    r156550 r156751  
    5454
    5555// static
    56 PassRefPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create(const String& name, const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     56PassRefPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create(const String& name, const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    5757{
    58     RefPtr<SharedWorkerGlobalScope> context = adoptRef(new SharedWorkerGlobalScope(name, url, userAgent, settings, thread));
     58    RefPtr<SharedWorkerGlobalScope> context = adoptRef(new SharedWorkerGlobalScope(name, url, userAgent, std::move(settings), thread));
    5959    context->applyContentSecurityPolicyFromString(contentSecurityPolicy, contentSecurityPolicyType);
    6060    return context.release();
    6161}
    6262
    63 SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, SharedWorkerThread* thread)
    64     : WorkerGlobalScope(url, userAgent, settings, thread, 0)
     63SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, SharedWorkerThread* thread)
     64    : WorkerGlobalScope(url, userAgent, std::move(settings), thread, 0)
    6565    , m_name(name)
    6666{
  • trunk/Source/WebCore/workers/SharedWorkerGlobalScope.h

    r156550 r156751  
    4545    public:
    4646        typedef WorkerGlobalScope Base;
    47         static PassRefPtr<SharedWorkerGlobalScope> create(const String& name, const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, SharedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType);
     47        static PassRefPtr<SharedWorkerGlobalScope> create(const String& name, const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, SharedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType);
    4848        virtual ~SharedWorkerGlobalScope();
    4949
     
    6060
    6161    private:
    62         SharedWorkerGlobalScope(const String& name, const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, SharedWorkerThread*);
     62        SharedWorkerGlobalScope(const String& name, const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, SharedWorkerThread*);
    6363        virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) OVERRIDE;
    6464
  • trunk/Source/WebCore/workers/SharedWorkerThread.cpp

    r156550 r156751  
    5454}
    5555
    56 PassRefPtr<WorkerGlobalScope> SharedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin>)
     56PassRefPtr<WorkerGlobalScope> SharedWorkerThread::createWorkerGlobalScope(const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin>)
    5757{
    58     return SharedWorkerGlobalScope::create(m_name, url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType);
     58    return SharedWorkerGlobalScope::create(m_name, url, userAgent, std::move(settings), this, contentSecurityPolicy, contentSecurityPolicyType);
    5959}
    6060
  • trunk/Source/WebCore/workers/SharedWorkerThread.h

    r156550 r156751  
    4444
    4545    protected:
    46         virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) OVERRIDE;
     46        virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) OVERRIDE;
    4747
    4848    private:
  • trunk/Source/WebCore/workers/WorkerGlobalScope.cpp

    r156550 r156751  
    8585};
    8686
    87 WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin)
     87WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, std::unique_ptr<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin)
    8888    : m_url(url)
    8989    , m_userAgent(userAgent)
    90     , m_groupSettings(settings)
     90    , m_groupSettings(std::move(settings))
    9191    , m_script(adoptPtr(new WorkerScriptController(this)))
    9292    , m_thread(thread)
  • trunk/Source/WebCore/workers/WorkerGlobalScope.h

    r156550 r156751  
    140140
    141141    protected:
    142         WorkerGlobalScope(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, WorkerThread*, PassRefPtr<SecurityOrigin> topOrigin);
     142        WorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, WorkerThread*, PassRefPtr<SecurityOrigin> topOrigin);
    143143        void applyContentSecurityPolicyFromString(const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    144144
     
    162162        URL m_url;
    163163        String m_userAgent;
    164         OwnPtr<GroupSettings> m_groupSettings;
     164        std::unique_ptr<GroupSettings> m_groupSettings;
    165165
    166166        mutable RefPtr<WorkerLocation> m_location;
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r156550 r156751  
    7777    URL m_scriptURL;
    7878    String m_userAgent;
    79     OwnPtr<GroupSettings> m_groupSettings;
     79    std::unique_ptr<GroupSettings> m_groupSettings;
    8080    String m_sourceCode;
    8181    WorkerThreadStartMode m_startMode;
     
    9999        return;
    100100
    101     m_groupSettings = GroupSettings::create();
     101    m_groupSettings = std::make_unique<GroupSettings>();
    102102    m_groupSettings->setLocalStorageQuotaBytes(settings->localStorageQuotaBytes());
    103103    m_groupSettings->setIndexedDBQuotaBytes(settings->indexedDBQuotaBytes());
     
    147147    {
    148148        MutexLocker lock(m_threadCreationMutex);
    149         m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_groupSettings.release(), m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType, m_startupData->m_topOrigin.release());
     149        m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_userAgent, std::move(m_startupData->m_groupSettings), m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType, m_startupData->m_topOrigin.release());
    150150
    151151        if (m_runLoop.terminated()) {
  • trunk/Source/WebCore/workers/WorkerThread.h

    r156550 r156751  
    7575
    7676        // Factory method for creating a new worker context for the thread.
    77         virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) = 0;
     77        virtual PassRefPtr<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& userAgent, std::unique_ptr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) = 0;
    7878
    7979        // Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
Note: See TracChangeset for help on using the changeset viewer.