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

Issue 3305001: Move decoder into separate thread, clean up API layering, and redo update protocl (Closed)

Created:
10 years, 3 months ago by awong
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Sergey Ulanov, dmac, awong, garykac, Alpha Left Google, Erik does not do reviews, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

This is a monster CL. It started as an attempt to put the decoder onto another thread. However, this became complicated due to multiple object ownership transfers and coupling between the decode layer and the network layer; the decoder's states were highly coupled with how the network packets were processed. This could probably be broken up slightly, but at this point, it's easier to just commit as a whole The refactor includes: 1) Making the decoder interface unaware of "network packet" types. 2) Making the network layer process packets in order. 3) Threading through asynchronous APIs all over the place. 4) Simplifying the rectangle update protocol. 5) Cleaning up object lifetime and ownership semantics between the decode layer and the renderer. As of right now, the Verbatim format is still broken on the encode side because it uses the old protocol. BUG=52883, 57351 TEST=still connects to chromoting_simple_host Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=61402

Patch Set 1 #

Patch Set 2 : Snapshot of changes. #

Patch Set 3 : Fake client works again. #

Patch Set 4 : Compiles in windows #

Patch Set 5 : Rebased #

Patch Set 6 : rebased #

Patch Set 7 : fix verbatim decoder. verbatim encoder still broken. #

Patch Set 8 : Simple style fixes. #

Total comments: 17

Patch Set 9 : unittests disabled. #

Patch Set 10 : rebased #

Patch Set 11 : disable vp8 #

Patch Set 12 : fix x11_view compile issues. #

Patch Set 13 : disable one test. take stab fixing windows try. #

Patch Set 14 : removed remoting/base/basictypes.h due to include shadowing. #

Patch Set 15 : Silly include mistake.w #

Patch Set 16 : fix linux compile #

Patch Set 17 : Fix compile error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+909 lines, -1267 lines) Patch
M remoting/base/codec_test.cc View 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
M remoting/base/decoder.h View 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +14 lines, -109 lines 0 comments Download
A remoting/base/decoder_row_based.h View 7 8 1 chunk +75 lines, -0 lines 0 comments Download
A remoting/base/decoder_row_based.cc View 7 8 9 1 chunk +117 lines, -0 lines 0 comments Download
M remoting/base/decoder_verbatim.h View 3 4 5 6 1 chunk +0 lines, -58 lines 0 comments Download
D remoting/base/decoder_verbatim.cc View 3 4 5 6 7 8 9 1 chunk +0 lines, -148 lines 0 comments Download
D remoting/base/decoder_verbatim_unittest.cc View 7 8 9 1 chunk +0 lines, -77 lines 0 comments Download
M remoting/base/decoder_zlib.h View 2 3 4 5 6 1 chunk +0 lines, -69 lines 0 comments Download
M remoting/base/decoder_zlib.cc View 1 2 3 4 5 6 1 chunk +0 lines, -167 lines 0 comments Download
D remoting/base/decoder_zlib_unittest.cc View 1 chunk +0 lines, -36 lines 0 comments Download
M remoting/base/decompressor.h View 1 chunk +4 lines, -0 lines 0 comments Download
A remoting/base/decompressor_verbatim.h View 1 chunk +29 lines, -0 lines 0 comments Download
A remoting/base/decompressor_verbatim.cc View 1 chunk +31 lines, -0 lines 0 comments Download
M remoting/base/decompressor_zlib.h View 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/base/decompressor_zlib.cc View 2 chunks +17 lines, -8 lines 0 comments Download
A remoting/base/encode_decode_unittest.cc View 7 8 1 chunk +34 lines, -0 lines 0 comments Download
M remoting/base/encoder_zlib.h View 3 4 5 6 7 8 9 1 chunk +7 lines, -3 lines 0 comments Download
M remoting/base/encoder_zlib.cc View 4 chunks +38 lines, -30 lines 0 comments Download
M remoting/base/protocol_decoder.h View 3 chunks +4 lines, -4 lines 0 comments Download
M remoting/base/protocol_decoder.cc View 1 chunk +1 line, -1 line 0 comments Download
M remoting/base/protocol_decoder_unittest.cc View 2 chunks +12 lines, -8 lines 0 comments Download
M remoting/base/tracer.h View 5 6 7 4 chunks +8 lines, -4 lines 0 comments Download
M remoting/client/chromoting_client.h View 2 4 chunks +22 lines, -4 lines 0 comments Download
M remoting/client/chromoting_client.cc View 1 2 4 chunks +75 lines, -44 lines 0 comments Download
M remoting/client/chromoting_view.h View 1 2 3 4 5 6 2 chunks +9 lines, -60 lines 0 comments Download
M remoting/client/chromoting_view.cc View 1 2 3 4 5 6 3 chunks +3 lines, -89 lines 0 comments Download
M remoting/client/chromoting_view_unittest.cc View 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M remoting/client/frame_consumer.h View 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -2 lines 0 comments Download
M remoting/client/plugin/chromoting_instance.h View 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M remoting/client/plugin/chromoting_instance.cc View 1 2 3 4 5 3 chunks +5 lines, -1 line 0 comments Download
M remoting/client/plugin/pepper_view.h View 1 2 chunks +24 lines, -12 lines 0 comments Download
M remoting/client/plugin/pepper_view.cc View 1 2 3 4 7 chunks +109 lines, -106 lines 0 comments Download
M remoting/client/rectangle_update_decoder.h View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M remoting/client/rectangle_update_decoder.cc View 2 3 4 3 chunks +6 lines, -5 lines 0 comments Download
M remoting/client/x11_client.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M remoting/client/x11_view.h View 5 6 7 8 9 10 11 12 13 14 15 3 chunks +18 lines, -8 lines 0 comments Download
M remoting/client/x11_view.cc View 5 6 7 8 9 10 11 7 chunks +46 lines, -61 lines 0 comments Download
M remoting/host/capturer.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M remoting/host/chromoting_host.h View 1 2 3 4 3 chunks +5 lines, -10 lines 0 comments Download
M remoting/host/chromoting_host.cc View 1 2 3 4 3 chunks +82 lines, -88 lines 0 comments Download
M remoting/host/chromoting_host_context.h View 1 chunk +4 lines, -0 lines 0 comments Download
M remoting/host/client_connection.h View 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/host/client_connection.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M remoting/host/event_executor_win.cc View 4 1 chunk +4 lines, -2 lines 0 comments Download
M remoting/host/session_manager.cc View 1 2 3 4 17 chunks +43 lines, -27 lines 0 comments Download
M remoting/host/session_manager_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M remoting/host/simple_host_process.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M remoting/remoting.gyp View 2 3 4 7 8 9 10 11 12 13 2 chunks +17 lines, -20 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
awong
This is going to be a completely monster CL. Here's a snapshot. If I check ...
10 years, 3 months ago (2010-09-02 23:23:26 UTC) #1
awong
Okay, zlib decoder/encoder work again for windows. I need to fix mac and unittests, but ...
10 years, 3 months ago (2010-09-04 00:25:54 UTC) #2
awong
This is ready for review. Since there is soo much code churn, I'm going to ...
10 years, 2 months ago (2010-09-28 00:46:03 UTC) #3
garykac
LGTM + nits http://codereview.chromium.org/3305001/diff/22001/23003 File remoting/base/decoder_row_based.cc (right): http://codereview.chromium.org/3305001/diff/22001/23003#newcode50 remoting/base/decoder_row_based.cc:50: const gfx::Rect& clip, int bytes_per_src_pixel) { ...
10 years, 2 months ago (2010-09-28 19:06:21 UTC) #4
awong
10 years, 2 months ago (2010-09-30 01:55:54 UTC) #5
address comments, rebased, and.... disabled unittests + vp8 from the build. :(
:( :(

Bugs appropriately filed.  Will fix next after this checkin.

Assuming the try bots go green, I will commit.

http://codereview.chromium.org/3305001/diff/22001/23003
File remoting/base/decoder_row_based.cc (right):

http://codereview.chromium.org/3305001/diff/22001/23003#newcode50
remoting/base/decoder_row_based.cc:50: const gfx::Rect& clip, int
bytes_per_src_pixel) {
On 2010/09/28 19:06:21, garykac wrote:
> nit: align

Done.

http://codereview.chromium.org/3305001/diff/22001/23003#newcode100
remoting/base/decoder_row_based.cc:100: in + used, in_size - used, out +
row_pos_, row_size - row_pos_,
On 2010/09/28 19:06:21, garykac wrote:
> row_size is clip-width * bytes_per_src_pixel. It seems like this should be
based
> on dst_pixel_width.
> 
> This code assumes src/dst pixel sizes and strides are the same.


Yep...added a TODO.

http://codereview.chromium.org/3305001/diff/22001/23004
File remoting/base/decoder_row_based.h (right):

http://codereview.chromium.org/3305001/diff/22001/23004#newcode36
remoting/base/decoder_row_based.h:36: enum State {
On 2010/09/28 19:06:21, garykac wrote:
> Can we rename this to something like DecoderState?

Since it's a private enum, I think it's okay...

http://codereview.chromium.org/3305001/diff/22001/23004#newcode39
remoting/base/decoder_row_based.h:39: kError,
On 2010/09/28 19:06:21, garykac wrote:
> Do we care about potential conflicts with other kReady or kError definitions? 
> If so, kDecoderUninitialized, kDecoderReady and kDecoderError might be better.

Same thing...since it's a private enum scoped to the class, pretty sure it's
okay.

http://codereview.chromium.org/3305001/diff/22001/23018
File remoting/base/encoder_zlib.h (right):

http://codereview.chromium.org/3305001/diff/22001/23018#newcode34
remoting/base/encoder_zlib.h:34: // Markes a packets as the first in a series of
rectangle updates.
On 2010/09/28 19:06:21, garykac wrote:
> Marks

Done.

http://codereview.chromium.org/3305001/diff/22001/23018#newcode39
remoting/base/encoder_zlib.h:39: // encoded rectangle data.  Will resize the
buffer to size.
On 2010/09/28 19:06:21, garykac wrote:
> resize buffer to |size|.

Done.

http://codereview.chromium.org/3305001/diff/22001/23023
File remoting/client/chromoting_client.h (right):

http://codereview.chromium.org/3305001/diff/22001/23023#newcode101
remoting/client/chromoting_client.h:101: bool message_being_processed_;
On 2010/09/28 19:06:21, garykac wrote:
> This is safe only if it is only accessed on message_loop(). Do we have a
> commenting convention for noting that?
> 

In general, all member variables in our code are supposed to only be access via
one thread.  I think it's okay as is.

http://codereview.chromium.org/3305001/diff/22001/23036
File remoting/host/capturer.cc (right):

http://codereview.chromium.org/3305001/diff/22001/23036#newcode48
remoting/host/capturer.cc:48: TraceContext::tracer()->PrintString("Started
CalculateInvalidRects");
On 2010/09/28 19:06:21, garykac wrote:
> We'll probably need to remove these trace statements at some point because the
> string data will make the binary larger than it needs to be.

Yes, completely agree.  Filed a bug.

http://crbug.com/57373

Powered by Google App Engine
This is Rietveld 408576698