Bug 134069

Summary: Use a single map for all callback types in WebPageProxy
Product: WebKit Reporter: mitz
Component: WebKit2Assignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: sam, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Part 1
andersca: review+
Part 2 thorton: review+

Description mitz 2014-06-19 12:23:07 PDT
Replace WebPageProxy’s multiple callback maps with one map for all callback types.
Comment 1 mitz 2014-06-19 12:28:10 PDT
Created attachment 233373 [details]
Part 1
Comment 2 mitz 2014-06-19 12:40:36 PDT
Comment on attachment 233373 [details]
Part 1

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

> Source/WebKit2/UIProcess/GenericCallback.h:177
> +    typename std::enable_if<std::is_base_of<CallbackBase, T>::value, RefPtr<T>>::type take(uint64_t callbackID)

Oops, the enable_if isn’t necessary anymore. I’ll get rid of it.
Comment 3 Anders Carlsson 2014-06-19 12:45:15 PDT
Comment on attachment 233373 [details]
Part 1

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

> Source/WebKit2/UIProcess/GenericCallback.h:170
> +    void put(PassRefPtr<CallbackBase> callback)

I think set or add would be better than put but I don't feel strongly about it.
Comment 4 mitz 2014-06-19 12:52:18 PDT
(In reply to comment #3)
> (From update of attachment 233373 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=233373&action=review
> 
> > Source/WebKit2/UIProcess/GenericCallback.h:170
> > +    void put(PassRefPtr<CallbackBase> callback)
> 
> I think set or add would be better than put but I don't feel strongly about it.

I wanted to use something different from the HashMap function names add and set, because the argument is consumed.
Comment 5 mitz 2014-06-19 12:59:54 PDT
Committed part 1 as <http://trac.webkit.org/r170158>.
Comment 6 mitz 2014-06-19 14:41:36 PDT
Created attachment 233384 [details]
Part 2
Comment 7 mitz 2014-06-19 17:50:00 PDT
Committed part 2 as <http://trac.webkit.org/r170168>.