Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Issue 1800008: Created a MessageLoopProxy interface. This provides a thread-safe refcounted ... (Closed)

Created:
10 years, 7 months ago by sanjeevr
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., ben+cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Created a MessageLoopProxy interface. This provides a thread-safe refcounted interface to the Post* methods of a message loop. This class can outlive the target message loop. Changed ChromeThread to vend an implementation of this proxy. BUG=None TEST=ChromeThread unit-tests modified. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45907

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Total comments: 10

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -14 lines) Patch
M base/base.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A base/message_loop_proxy.h View 1 2 1 chunk +45 lines, -0 lines 0 comments Download
M chrome/browser/chrome_thread.h View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/chrome_thread.cc View 1 2 3 3 chunks +47 lines, -0 lines 0 comments Download
M chrome/browser/chrome_thread_unittest.cc View 1 2 3 6 chunks +67 lines, -14 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
sanjeevr
10 years, 7 months ago (2010-04-28 21:12:39 UTC) #1
darin (slow to review)
This looks good to me. I am wondering what your implementation of MessageLoopProxy will look ...
10 years, 7 months ago (2010-04-28 22:05:49 UTC) #2
sanjeevr
Made the changes and uploaded a new patch. I was also wondering about the implementation ...
10 years, 7 months ago (2010-04-28 22:30:49 UTC) #3
jam
http://codereview.chromium.org/1800008/diff/8001/3002 File base/message_loop_proxy.h (right): http://codereview.chromium.org/1800008/diff/8001/3002#newcode16 base/message_loop_proxy.h:16: MessageLoopProxy() { } nit: since it's empty no need ...
10 years, 7 months ago (2010-04-28 22:42:46 UTC) #4
darin (slow to review)
Another choice would be to build an implementation on top of MessageLoop that uses MessageLoop's ...
10 years, 7 months ago (2010-04-28 23:23:05 UTC) #5
darin (slow to review)
Another choice would be to build an implementation on top of MessageLoop that uses MessageLoop's ...
10 years, 7 months ago (2010-04-28 23:24:34 UTC) #6
sanjeevr
Made the changes as we discussed. Please take another look. http://codereview.chromium.org/1800008/diff/8001/3002 File base/message_loop_proxy.h (right): http://codereview.chromium.org/1800008/diff/8001/3002#newcode16 ...
10 years, 7 months ago (2010-04-29 00:29:04 UTC) #7
jam
lgtm
10 years, 7 months ago (2010-04-29 00:53:31 UTC) #8
jam
On Wed, Apr 28, 2010 at 5:29 PM, <sanjeevr@chromium.org> wrote: > Made the changes as ...
10 years, 7 months ago (2010-04-29 01:11:06 UTC) #9
sanjeevr
10 years, 7 months ago (2010-04-29 01:34:40 UTC) #10
Moved it out of the class and uploaded. Please take a look.

On 2010/04/29 01:11:06, John Abd-El-Malek wrote:
> On Wed, Apr 28, 2010 at 5:29 PM, <mailto:sanjeevr@chromium.org> wrote:
> 
> > Made the changes as we discussed. Please take another look.
> >
> >
> > http://codereview.chromium.org/1800008/diff/8001/3002
> >
> > File base/message_loop_proxy.h (right):
> >
> > http://codereview.chromium.org/1800008/diff/8001/3002#newcode16
> > base/message_loop_proxy.h:16: MessageLoopProxy() { }
> >
> > On 2010/04/28 22:42:46, John Abd-El-Malek wrote:
> >
> >> nit: since it's empty no need to have for now
> >>
> >
> > Done.
> >
> > http://codereview.chromium.org/1800008/diff/8001/3004
> > File chrome/browser/chrome_thread.cc (right):
> >
> > http://codereview.chromium.org/1800008/diff/8001/3004#newcode22
> > chrome/browser/chrome_thread.cc:22: class
> > ChromeThread::MessageLoopProxyImpl : public MessageLoopProxy {
> >
> > On 2010/04/28 22:42:46, John Abd-El-Malek wrote:
> >
> >> nit: just curious, why is this class part of ChromeThread?  Since it
> >>
> > doesn't use
> >
> >> any private members or methods, it doesn't need to right?
> >>
> >
> > It is part of ChromeThread because it is ChromeThread's implementation
> > of MessageLoopProxy.
> 
> 
> note: i still don't understand why this class is part of ChromeThread.  This
> class both uses and is used by ChromeThread, so it seems they're peers
> instead of dependent relationship which is why one would normally use a
> nested class.
> 
> 
> >
> > http://codereview.chromium.org/1800008/diff/8001/3004#newcode28
> > chrome/browser/chrome_thread.cc:28: Task* task);
> >
> > On 2010/04/28 22:42:46, John Abd-El-Malek wrote:
> >
> >> nit: if you're defining this class in the .cc file, then we usually
> >>
> > put the
> >
> >> implementation inline as well.
> >>
> >
> > Done.
> >
> > http://codereview.chromium.org/1800008/diff/8001/3005
> > File chrome/browser/chrome_thread.h (right):
> >
> > http://codereview.chromium.org/1800008/diff/8001/3005#newcode132
> > chrome/browser/chrome_thread.h:132: static
> > scoped_refptr<MessageLoopProxy> GetMessageLoopProxyForThread(
> > On 2010/04/28 22:42:46, John Abd-El-Malek wrote:
> >
> >> nit: we normally return refcounted objects as naked pointers
> >>
> >
> > Left this as is as per our discussion.
> >
> >
> > http://codereview.chromium.org/1800008/diff/8001/3006
> > File chrome/browser/chrome_thread_unittest.cc (right):
> >
> > http://codereview.chromium.org/1800008/diff/8001/3006#newcode134
> > chrome/browser/chrome_thread_unittest.cc:134: }
> > On 2010/04/28 22:42:46, John Abd-El-Malek wrote:
> >
> >> a test that exercise the primary reason for this class would be nice
> >>
> > as well
> >
> >> (i.e. posting a task after the ML is gone)
> >>
> >
> > Done.
> >
> > http://codereview.chromium.org/1800008/show
> >
>

Powered by Google App Engine
This is Rietveld 408576698