Bug 130626 - [WK2] Make updates on ViewUpdateDispatcher less heavy
Summary: [WK2] Make updates on ViewUpdateDispatcher less heavy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-21 18:10 PDT by Benjamin Poulain
Modified: 2014-03-24 13:58 PDT (History)
0 users

See Also:


Attachments
Patch (2.98 KB, patch)
2014-03-21 18:10 PDT, Benjamin Poulain
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-03-21 18:10:19 PDT
[WK2] Make updates on ViewUpdateDispatcher less heavy
Comment 1 Benjamin Poulain 2014-03-21 18:10:36 PDT
Created attachment 227520 [details]
Patch
Comment 2 Darin Adler 2014-03-22 08:06:04 PDT
Comment on attachment 227520 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp:74
>          localCopy.swap(m_latestUpdate);

This should really use std::move instead of swap. Swap was the hack for doing this before we had move assignment.

Also, the code below uses the word “iterator”  strangely. It should be written like this:

    for (uint64_t pageID : localCopy.keys())
Comment 3 Darin Adler 2014-03-22 08:06:55 PDT
Comment on attachment 227520 [details]
Patch

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

>> Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp:74
>>          localCopy.swap(m_latestUpdate);
> 
> This should really use std::move instead of swap. Swap was the hack for doing this before we had move assignment.
> 
> Also, the code below uses the word “iterator”  strangely. It should be written like this:
> 
>     for (uint64_t pageID : localCopy.keys())

Oops, that was wrong. Obviously we want both keys and values. I just don’t think that “iterator” is the right name for an entry in a HashMap. I suggest the name "slot".
Comment 4 Benjamin Poulain 2014-03-24 13:58:37 PDT
Committed r166191: <http://trac.webkit.org/changeset/166191>