Changeset 150310 in webkit


Ignore:
Timestamp:
May 17, 2013 5:05:10 PM (11 years ago)
Author:
ap@apple.com
Message:

<rdar://problem/13819878> Disable SharedWorker when in multiple web process model
https://bugs.webkit.org/show_bug.cgi?id=116359

Reviewed by Anders Carlsson.

This feature was already RuntimeEnabled. Call through layers to get the answer from
a platform strategy.

  • workers/DefaultSharedWorkerRepository.cpp: (WebCore::DefaultSharedWorkerRepository::isAvailable):
  • workers/DefaultSharedWorkerRepository.h:
  • workers/SharedWorkerRepository.cpp: (WebCore::SharedWorkerRepository::isAvailable):
  • workers/SharedWorkerStrategy.h: (WebCore::SharedWorkerStrategy::isAvailable):
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150309 r150310  
     12013-05-17  Alexey Proskuryakov  <ap@apple.com>
     2
     3        <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
     4        https://bugs.webkit.org/show_bug.cgi?id=116359
     5
     6        Reviewed by Anders Carlsson.
     7
     8        This feature was already RuntimeEnabled. Call through layers to get the answer from
     9        a platform strategy.
     10
     11        * workers/DefaultSharedWorkerRepository.cpp:
     12        (WebCore::DefaultSharedWorkerRepository::isAvailable):
     13        * workers/DefaultSharedWorkerRepository.h:
     14        * workers/SharedWorkerRepository.cpp:
     15        (WebCore::SharedWorkerRepository::isAvailable):
     16        * workers/SharedWorkerStrategy.h:
     17        (WebCore::SharedWorkerStrategy::isAvailable):
     18
    1192013-05-17  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp

    r149131 r150310  
    4444#include "NotImplemented.h"
    4545#include "PageGroup.h"
     46#include "PlatformStrategies.h"
    4647#include "ScriptCallStack.h"
    4748#include "SecurityOrigin.h"
     
    5051#include "SharedWorkerContext.h"
    5152#include "SharedWorkerRepository.h"
     53#include "SharedWorkerStrategy.h"
    5254#include "SharedWorkerThread.h"
    5355#include "WorkerLoaderProxy.h"
     
    352354}
    353355
     356bool DefaultSharedWorkerRepository::isAvailable()
     357{
     358    return platformStrategies()->sharedWorkerStrategy()->isAvailable();
     359}
     360
    354361void DefaultSharedWorkerRepository::workerScriptLoaded(SharedWorkerProxy& proxy, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel> port, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    355362{
  • trunk/Source/WebCore/workers/DefaultSharedWorkerRepository.h

    r104329 r150310  
    5959        WTF_MAKE_NONCOPYABLE(DefaultSharedWorkerRepository); WTF_MAKE_FAST_ALLOCATED;
    6060    public:
     61        // Returns true if the platform supports SharedWorkers, otherwise false.
     62        static bool isAvailable();
     63
    6164        // Invoked once the worker script has been loaded to fire up the worker thread.
    6265        void workerScriptLoaded(SharedWorkerProxy&, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
  • trunk/Source/WebCore/workers/SharedWorkerRepository.cpp

    r145466 r150310  
    3939bool SharedWorkerRepository::isAvailable()
    4040{
    41     // SharedWorkers are enabled on the default WebKit platform.
    42     return true;
     41    return DefaultSharedWorkerRepository::instance().isAvailable();
    4342}
    4443
  • trunk/Source/WebCore/workers/SharedWorkerStrategy.h

    r150104 r150310  
    3131class SharedWorkerStrategy {
    3232public:
     33    virtual bool isAvailable() const { return true; }
     34
    3335protected:
    3436    virtual ~SharedWorkerStrategy()
  • trunk/Source/WebKit2/ChangeLog

    r150307 r150310  
     12013-05-17  Alexey Proskuryakov  <ap@apple.com>
     2
     3        <rdar://problem/13819878> Disable SharedWorker when in multiple web process model
     4        https://bugs.webkit.org/show_bug.cgi?id=116359
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Implement SharedWorkerStrategy::isAvailable.
     9
     10        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     11        (WebKit::WebPlatformStrategies::isAvailable):
     12        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
     13
    1142013-05-17  Beth Dakin  <bdakin@apple.com>
    215
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r150104 r150310  
    305305#endif // ENABLE(NETSCAPE_PLUGIN_API)
    306306
     307// SharedWorkerStrategy.
     308
     309bool WebPlatformStrategies::isAvailable() const
     310{
     311    // Shared workers do not work across multiple processes, and using network process is tied to multiple secondary process model.
     312#if ENABLE(NETWORK_PROCESS)
     313    return WebProcess::shared().usesNetworkProcess();
     314#else
     315    return true;
     316#endif
     317}
     318
    307319// StorageStrategy
    308320
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

    r150104 r150310  
    8282    virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&) OVERRIDE;
    8383
     84    // WebCore::SharedWorkerStrategy.
     85    virtual bool isAvailable() const OVERRIDE;
     86
    8487    // WebCore::StorageStrategy.
    8588    virtual PassRefPtr<WebCore::StorageNamespace> localStorageNamespace(WebCore::PageGroup*) OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.