Bug 122469 - Clean up ScriptExecutionContext::Task and subclasses
Summary: Clean up ScriptExecutionContext::Task and subclasses
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on: 122479
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-07 15:16 PDT by Anders Carlsson
Modified: 2013-10-07 18:29 PDT (History)
2 users (show)

See Also:


Attachments
Patch (78.94 KB, patch)
2013-10-07 15:19 PDT, Anders Carlsson
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2013-10-07 15:16:43 PDT
Clean up ScriptExecutionContext::Task and subclasses
Comment 1 Anders Carlsson 2013-10-07 15:19:45 PDT
Created attachment 213620 [details]
Patch
Comment 2 Andreas Kling 2013-10-07 15:26:01 PDT
Comment on attachment 213620 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=213620&action=review

> Source/WebCore/Modules/webdatabase/Database.cpp:89
> +    DerefContextTask(PassRefPtr<ScriptExecutionContext> context)

explicit

> Source/WebCore/Modules/webdatabase/Database.cpp:203
> +    DeliverPendingCallbackTask(PassRefPtr<SQLTransaction> transaction)

explicit

> Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:236
> +    Vector<std::unique_ptr<ScriptExecutionContext::Task>> tasks = std::move(m_pendingTasks);

auto

> Source/WebCore/bindings/js/JSCallbackData.h:80
> +    DeleteCallbackDataTask(JSCallbackData* data)

explicit

> Source/WebCore/dom/Document.cpp:4900
> -        OwnPtr<Task> task = m_pendingTasks[0].release();
> +        auto task = std::move(m_pendingTasks[0]);
>          m_pendingTasks.remove(0);

This code looks pretty inefficient, taking the first element out of a vector in a loop :|

> Source/WebCore/workers/WorkerMessagingProxy.cpp:156
>      WorkerTerminateTask(WorkerMessagingProxy* messagingProxy)

explicit

> Source/WebCore/workers/WorkerMessagingProxy.cpp:213
>      NotifyNetworkStateChangeTask(bool isOnLine)

explicit
Comment 3 Anders Carlsson 2013-10-07 15:37:36 PDT
Committed r157061: <http://trac.webkit.org/changeset/157061>
Comment 5 WebKit Commit Bot 2013-10-07 18:29:37 PDT
Re-opened since this is blocked by bug 122479