Bug 134069 - Use a single map for all callback types in WebPageProxy
Summary: Use a single map for all callback types in WebPageProxy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-19 12:23 PDT by mitz
Modified: 2014-06-19 17:50 PDT (History)
2 users (show)

See Also:


Attachments
Part 1 (25.17 KB, patch)
2014-06-19 12:28 PDT, mitz
andersca: review+
Details | Formatted Diff | Diff
Part 2 (4.81 KB, patch)
2014-06-19 14:41 PDT, mitz
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.