On Mon, Aug 3, 2009 at 8:23 PM, Albert J. Wong (王重傑)<ajw...@chromium.org> wrote:
> I've noticed that most public functions on MessageLoop are non-virtual.  How
> bad would it be to make PostTask, and its variants, virtual?  Are the perf
> implications or similar that would be bad?
> I'd like to be able to use gmock to mock out a message loop so I can test if
> my code knows to stop posting tasks.  However, not having the message loop
> be virtual makes this hard.
> Thanks,
> Albert

I say go for it. The common pattern is PostTask(FROM_HERE,
NewRunnableMethod(...)) and the cost of allocation is way higher than
the cost of the virtual call.

Antoine

> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to