⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 100041 in webkit


Ignore:
Timestamp:
Nov 11, 2011, 3:54:14 PM (15 years ago)
Author:
adamk@chromium.org
Message:

Remove no-op StorageNamespace::unlock method
https://bugs.webkit.org/show_bug.cgi?id=72181

Reviewed by Darin Adler.

Source/WebCore:

The method was meant to support the localStorage mutex,
but the approach of using a mutex for localStorage has never been
implemented (and almost certainly won't be). Even if it were implemented,
it's not being called at the right time, due to bugs in the V8 bindings'
use of V8Proxy (see http://webkit.org/b/72063 for details).

If, in the future, some replacement for a mutex is used to synchronize
localStorage access, it can easily be re-added to the (hopefully
fixed-by-then) replacement for V8Proxy::didLeaveScriptContext.

  • bindings/v8/V8Proxy.cpp:

(WebCore::V8Proxy::didLeaveScriptContext): Stop calling unlock().

  • page/Navigator.cpp:

(WebCore::Navigator::getStorageUpdates): Remove implementation (a call to unlock), but leave code as it's exposed to the platform.

  • page/Navigator.idl: Added a FIXME to remove getStorageUpdates from the platform.
  • storage/StorageNamespace.h:
  • storage/StorageNamespaceImpl.cpp:
  • storage/StorageNamespaceImpl.h:

Source/WebKit/chromium:

  • src/StorageNamespaceProxy.cpp:
  • src/StorageNamespaceProxy.h:
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r100038 r100041  
     12011-11-11  Adam Klein  <adamk@chromium.org>
     2
     3        Remove no-op StorageNamespace::unlock method
     4        https://bugs.webkit.org/show_bug.cgi?id=72181
     5
     6        Reviewed by Darin Adler.
     7
     8        The method was meant to support the localStorage mutex,
     9        but the approach of using a mutex for localStorage has never been
     10        implemented (and almost certainly won't be). Even if it were implemented,
     11        it's not being called at the right time, due to bugs in the V8 bindings'
     12        use of V8Proxy (see http://webkit.org/b/72063 for details).
     13
     14        If, in the future, some replacement for a mutex is used to synchronize
     15        localStorage access, it can easily be re-added to the (hopefully
     16        fixed-by-then) replacement for V8Proxy::didLeaveScriptContext.
     17
     18        * bindings/v8/V8Proxy.cpp:
     19        (WebCore::V8Proxy::didLeaveScriptContext): Stop calling unlock().
     20        * page/Navigator.cpp:
     21        (WebCore::Navigator::getStorageUpdates): Remove implementation (a call to unlock), but leave code as it's exposed to the platform.
     22        * page/Navigator.idl: Added a FIXME to remove getStorageUpdates from the platform.
     23        * storage/StorageNamespace.h:
     24        * storage/StorageNamespaceImpl.cpp:
     25        * storage/StorageNamespaceImpl.h:
     26
    1272011-11-11  Alexis Menard  <alexis.menard@openbossa.org>
    228
  • trunk/Source/WebCore/bindings/v8/V8Proxy.cpp

    r100003 r100041  
    4646#include "InspectorInstrumentation.h"
    4747#include "Page.h"
    48 #include "PageGroup.h"
    4948#include "PlatformSupport.h"
    5049#include "ScriptSourceCode.h"
    5150#include "SecurityOrigin.h"
    5251#include "Settings.h"
    53 #include "StorageNamespace.h"
    5452#include "V8Binding.h"
    5553#include "V8BindingState.h"
     
    590588void V8Proxy::didLeaveScriptContext()
    591589{
    592     Page* page = m_frame->page();
    593     if (!page)
    594         return;
    595     // If we've just left a top level script context and local storage has been
    596     // instantiated, we must ensure that any storage locks have been freed.
    597     // Per http://dev.w3.org/html5/spec/Overview.html#storage-mutex
    598590    if (m_recursion)
    599591        return;
     592
    600593#if ENABLE(INDEXED_DATABASE)
    601594    // If we've just left a script context and indexed database has been
     
    604597    IDBPendingTransactionMonitor::abortPendingTransactions();
    605598#endif // ENABLE(INDEXED_DATABASE)
    606     if (page->group().hasLocalStorage())
    607         page->group().localStorage()->unlock();
    608599
    609600#if ENABLE(MUTATION_OBSERVERS)
  • trunk/Source/WebCore/page/Navigator.cpp

    r100004 r100041  
    173173void Navigator::getStorageUpdates()
    174174{
    175     if (!m_frame)
    176         return;
    177 
    178     Page* page = m_frame->page();
    179     if (!page)
    180         return;
    181 
    182     StorageNamespace* localStorage = page->group().localStorage();
    183     if (localStorage)
    184         localStorage->unlock();
     175    // FIXME: Remove this method or rename to yieldForStorageUpdates.
    185176}
    186177
  • trunk/Source/WebCore/page/Navigator.idl

    r100004 r100041  
    4545#endif
    4646
    47         void getStorageUpdates();
     47        void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
    4848
    4949#if defined(ENABLE_REGISTER_PROTOCOL_HANDLER) && ENABLE_REGISTER_PROTOCOL_HANDLER
  • trunk/Source/WebCore/storage/StorageNamespace.h

    r97574 r100041  
    4848    virtual PassRefPtr<StorageNamespace> copy() = 0;
    4949    virtual void close() = 0;
    50     virtual void unlock() = 0;
    5150    virtual void clearOriginForDeletion(SecurityOrigin*) = 0;
    5251    virtual void clearAllOriginsForDeletion() = 0;
  • trunk/Source/WebCore/storage/StorageNamespaceImpl.cpp

    r98316 r100041  
    140140}
    141141
    142 void StorageNamespaceImpl::unlock()
    143 {
    144     // Because there's a single event loop per-process, this is a no-op.
    145 }
    146 
    147142void StorageNamespaceImpl::clearOriginForDeletion(SecurityOrigin* origin)
    148143{
  • trunk/Source/WebCore/storage/StorageNamespaceImpl.h

    r97574 r100041  
    4848        virtual PassRefPtr<StorageNamespace> copy();
    4949        virtual void close();
    50         virtual void unlock();
    5150
    5251        // Not removing the origin's StorageArea from m_storageAreaMap because
  • trunk/Source/WebKit/chromium/ChangeLog

    r100040 r100041  
     12011-11-11  Adam Klein  <adamk@chromium.org>
     2
     3        Remove no-op StorageNamespace::unlock method
     4        https://bugs.webkit.org/show_bug.cgi?id=72181
     5
     6        Reviewed by Darin Adler.
     7
     8        * src/StorageNamespaceProxy.cpp:
     9        * src/StorageNamespaceProxy.h:
     10
    1112011-11-11  Stephen Chenney  <schenney@chromium.org>
    212
  • trunk/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp

    r97574 r100041  
    8686}
    8787
    88 void StorageNamespaceProxy::unlock()
    89 {
    90     // FIXME: Implement.
    91 }
    92 
    9388void StorageNamespaceProxy::clearOriginForDeletion(SecurityOrigin* origin)
    9489{
  • trunk/Source/WebKit/chromium/src/StorageNamespaceProxy.h

    r97574 r100041  
    4141    virtual PassRefPtr<StorageNamespace> copy();
    4242    virtual void close();
    43     virtual void unlock();
    4443   
    4544    virtual void clearOriginForDeletion(SecurityOrigin*);
Note: See TracChangeset for help on using the changeset viewer.