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

Issue 10697069: Move the callback out of the Read method and into Initialize to make Read loops simpler. (Closed)

Created:
8 years, 5 months ago by tommi (sloooow) - chröme
Modified:
8 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Move the callback out of the Read method and into Initialize to make Read loops simpler. TEST=Run media_unittests --gtest_filter=*AsyncSocketIoHandlerTest* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=145453

Patch Set 1 #

Patch Set 2 : Updated comments #

Patch Set 3 : Fix expectations for the synchronous test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -45 lines) Patch
M media/audio/async_socket_io_handler.h View 1 3 chunks +19 lines, -14 lines 0 comments Download
M media/audio/async_socket_io_handler_posix.cc View 3 chunks +12 lines, -8 lines 0 comments Download
M media/audio/async_socket_io_handler_unittest.cc View 1 2 4 chunks +72 lines, -10 lines 0 comments Download
M media/audio/async_socket_io_handler_win.cc View 4 chunks +15 lines, -13 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
tommi (sloooow) - chröme
8 years, 5 months ago (2012-07-03 14:06:13 UTC) #1
no longer working on chromium
Nice work, lgtm with one nit. https://chromiumcodereview.appspot.com/10697069/diff/6001/media/audio/async_socket_io_handler_win.cc File media/audio/async_socket_io_handler_win.cc (right): https://chromiumcodereview.appspot.com/10697069/diff/6001/media/audio/async_socket_io_handler_win.cc#newcode53 media/audio/async_socket_io_handler_win.cc:53: is_pending_ = !ok ...
8 years, 5 months ago (2012-07-04 09:54:55 UTC) #2
tommi (sloooow) - chröme
8 years, 5 months ago (2012-07-04 12:12:40 UTC) #3
https://chromiumcodereview.appspot.com/10697069/diff/6001/media/audio/async_s...
File media/audio/async_socket_io_handler_win.cc (right):

https://chromiumcodereview.appspot.com/10697069/diff/6001/media/audio/async_s...
media/audio/async_socket_io_handler_win.cc:53: is_pending_ = !ok &&
(GetLastError() == ERROR_IO_PENDING);
On 2012/07/04 09:54:55, xians1 wrote:
> From the code, it seems that we run the callback only in OnIOCompleted().

That's correct.

> But the comment above is a bit confusing, does it mean that we need to run the
> callback explicitly when is_pending == false?

"OnIOCompleted() will be called regardless and we don't need to explicitly run
the callback" is really the key.  Can you tell me which part it is that's
confusing you?

Powered by Google App Engine
This is Rietveld 408576698