Changeset 172219 in webkit


Ignore:
Timestamp:
Aug 7, 2014 11:46:43 AM (10 years ago)
Author:
dbates@webkit.org
Message:

Sometimes Gmail cannot load messages, particularly on refresh ("...the application ran into an unexpected error...")
https://bugs.webkit.org/show_bug.cgi?id=135688
<rdar://problem/17886686>

Reviewed by Maciej Stachowiak.

Fixes an issue where gmail.com may fail to load the list of messages. In particular, a SQLTransactionCallback
function may not be executed and hence Gmail will not display the list of messages and
will subsequently display an error message.

When a WebKit client defers loading of a page (e.g. -[WebView setDefersCallbacks:YES]), WebCore
may still load the main resource, say if substitute data is available for it, and defer executing
tasks, such as a SQLTransactionCallback function, by appending such tasks to the end of the list
of pending tasks for the associated Document. This list of pending tasks is never processed when
a client subsequently allows loading (e.g. -[WebView setDefersCallbacks:NO])). Therefore, we never
execute a SQLTransactionCallback function that was deferred.

Ideally WebCore would defer loading of substitute data when a WebKit client requests that loading
be deferred and hence a SQLTransactionCallback function would be deferred as a consequence of the
lack of JavaScript script execution (since substitute data wasn't loaded and hence any JavaScript
script contained in the substitute data that initiates a SQL transaction isn't executed). For now,
it's sufficient to only defer executing tasks when either there are existing pending tasks or the
active DOM objects for the document are suspended (e.g. Document::suspendActiveDOMObjects() was called).

  • dom/Document.cpp:

(WebCore::Document::postTask):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r172218 r172219  
     12014-08-07  Daniel Bates  <dabates@apple.com>
     2
     3        Sometimes Gmail cannot load messages, particularly on refresh ("...the application ran into an unexpected error...")
     4        https://bugs.webkit.org/show_bug.cgi?id=135688
     5        <rdar://problem/17886686>
     6
     7        Reviewed by Maciej Stachowiak.
     8
     9        Fixes an issue where gmail.com may fail to load the list of messages. In particular, a SQLTransactionCallback
     10        function may not be executed and hence Gmail will not display the list of messages and
     11        will subsequently display an error message.
     12
     13        When a WebKit client defers loading of a page (e.g. -[WebView setDefersCallbacks:YES]), WebCore
     14        may still load the main resource, say if substitute data is available for it, and defer executing
     15        tasks, such as a SQLTransactionCallback function, by appending such tasks to the end of the list
     16        of pending tasks for the associated Document. This list of pending tasks is never processed when
     17        a client subsequently allows loading (e.g. -[WebView setDefersCallbacks:NO])). Therefore, we never
     18        execute a SQLTransactionCallback function that was deferred.
     19
     20        Ideally WebCore would defer loading of substitute data when a WebKit client requests that loading
     21        be deferred and hence a SQLTransactionCallback function would be deferred as a consequence of the
     22        lack of JavaScript script execution (since substitute data wasn't loaded and hence any JavaScript
     23        script contained in the substitute data that initiates a SQL transaction isn't executed). For now,
     24        it's sufficient to only defer executing tasks when either there are existing pending tasks or the
     25        active DOM objects for the document are suspended (e.g. Document::suspendActiveDOMObjects() was called).
     26
     27        * dom/Document.cpp:
     28        (WebCore::Document::postTask):
     29
    1302014-08-07  Zalan Bujtas  <zalan@apple.com>
    231
  • trunk/Source/WebCore/dom/Document.cpp

    r172210 r172219  
    49164916            return;
    49174917
    4918         Page* page = document->page();
    4919         if ((page && page->defersLoading()) || !document->m_pendingTasks.isEmpty())
     4918        if (document->activeDOMObjectsAreStopped())
     4919            return;
     4920
     4921        if (document->activeDOMObjectsAreSuspended() || !document->m_pendingTasks.isEmpty())
    49204922            document->m_pendingTasks.append(WTF::move(*task.release()));
    49214923        else
Note: See TracChangeset for help on using the changeset viewer.