Bug 130626

Summary: [WK2] Make updates on ViewUpdateDispatcher less heavy
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

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>