Bug 37399

Summary: Remove use of STL data structures from CoreIPC code
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Updated patch
none
Take 3 andersca: review+

Description Sam Weinig 2010-04-10 19:52:07 PDT
No reason to keep these STL.
Comment 1 Sam Weinig 2010-04-10 19:55:25 PDT
Created attachment 53066 [details]
Patch
Comment 2 Sam Weinig 2010-04-10 19:56:33 PDT
Please ignore the NotImplemented.h bits. That should not be there.
Comment 3 Sam Weinig 2010-04-10 22:15:31 PDT
Created attachment 53074 [details]
Updated patch

This updates the patch to use a Vector instead of a Deque in Connection as per Anders' request. It also changes some uses of malloc/free with fastMalloc/fastFree.
Comment 4 Darin Adler 2010-04-10 23:35:11 PDT
Comment on attachment 53074 [details]
Updated patch

> -    queue<WorkItem*> workItemQueue;
> +    Deque<WorkItem*> workItemQueue;

You said this updates the patch to use a Vector instead of a Deque. But this is a Deque.
Comment 5 Sam Weinig 2010-04-11 09:59:07 PDT
(In reply to comment #4)
> (From update of attachment 53074 [details])
> > -    queue<WorkItem*> workItemQueue;
> > +    Deque<WorkItem*> workItemQueue;
> 
> You said this updates the patch to use a Vector instead of a Deque. But this is
> a Deque.

Only in Connection for the incomming/outgoing message queues.
Comment 6 Anders Carlsson 2010-04-11 13:07:59 PDT
Comment on attachment 53074 [details]
Updated patch

> Index: WebKit2/Platform/RunLoop.h
> ===================================================================
> --- WebKit2/Platform/RunLoop.h	(revision 57421)
> +++ WebKit2/Platform/RunLoop.h	(working copy)
> @@ -27,7 +27,7 @@
>  #define RunLoop_h
>  
>  #include <memory>
> -#include <queue>
> +#include <wtf/Deque.h>
>  #include <wtf/HashMap.h>
>  #include <wtf/Threading.h>
>  
> @@ -99,7 +99,7 @@ private:
>      void wakeUp();
>  
>      Mutex m_workItemQueueLock;
> -    std::queue<WorkItem*> m_workItemQueue;
> +    Deque<WorkItem*> m_workItemQueue;

This can actually be a Vector.
Comment 7 Sam Weinig 2010-04-11 13:14:20 PDT
Created attachment 53099 [details]
Take 3
Comment 8 Anders Carlsson 2010-04-11 13:17:33 PDT
Comment on attachment 53099 [details]
Take 3

Great, r=me!
Comment 9 Sam Weinig 2010-04-11 13:23:55 PDT
Fixed in r57454.