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

Issue 296053012: Replace StreamListenSocket with StreamSocket in HttpServer. (Closed)

Created:
6 years, 7 months ago by byungchul
Modified:
6 years, 4 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, vsevik, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, yurys, abarth-chromium, Aaron Boodman, paulirish+reviews_chromium.org, darin-cc_chromium.org, yzshen+watch_chromium.org, devtools-reviews_chromium.org, stgao, aandrey+blink_chromium.org, ben+mojo_chromium.org, darin (slow to review), gunsch, mnaganov (inactive)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Replace StreamListenSocket with StreamSocket in HttpServer. 1) HttpServer gets ServerSocket instead of StreamListenSocket. 2) HttpConnection is just a container for socket, websocket, and pending read/write buffers. 3) HttpServer handles data buffering and asynchronous read/write. 4) HttpConnection has limit in data buffering, up to 1Mbytes by default. 5) For devtools, send buffer limit is 100Mbytes. 6) Unittests for buffer handling in HttpConnection. BUG=371906 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291447

Patch Set 1 #

Total comments: 70

Patch Set 2 : Rebased #

Patch Set 3 : Apply comments. Move async read/write to HttpServer #

Patch Set 4 : Use base::StringPiece in some places not to copy data. #

Total comments: 35

Patch Set 5 : Rebased #

Total comments: 2

Patch Set 6 : Unitests and draft implementation of unix domain server socket. #

Patch Set 7 : Unittests for unix domain server/client socket #

Patch Set 8 : Fix compilation errors. #

Patch Set 9 : Rebased and fix content_unittests #

Patch Set 10 : Fix compilation error on win #

Patch Set 11 : Don't export HttpServer which is built in a static lib #

Total comments: 42

Patch Set 12 : Rebased #

Patch Set 13 : Fix compilation error #

Total comments: 16

Patch Set 14 : Rebased #

Patch Set 15 : Fixed compilation erros. #

Patch Set 16 : Fixed compilation errors. #

Patch Set 17 : Fixed compilation errors in unittests. #

Patch Set 18 : Applied comments #

Patch Set 19 : Redo changes reverted with unknown reason. #

Total comments: 38

Patch Set 20 : Rebased #

Patch Set 21 : Addressed comments. #

Total comments: 36

Patch Set 22 : Addressed comments. #

Patch Set 23 : Fixed unittest failures. #

Total comments: 8

Patch Set 24 : Rebased, and addressed comments. #

Total comments: 4

Patch Set 25 : Addressed comments. #

Patch Set 26 : Added a comment on HttpServer::HasClosedConnection(). #

Patch Set 27 : Fixed unittest errors. #

Total comments: 3

Patch Set 28 : Rebased and fixed chromecast part. #

Patch Set 29 : Disable a checking in HttpServerTest.MultipleRequestsOnSameConnection #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M net/server/http_server_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 73 (0 generated)
byungchul
Please review this CL which is not yet completed, but want to get some review ...
6 years, 7 months ago (2014-05-22 03:06:27 UTC) #1
pfeldman
Only started my review, but need to switch machines, so uploading these. https://codereview.chromium.org/296053012/diff/1/chrome/test/chromedriver/server/chromedriver_server.cc File chrome/test/chromedriver/server/chromedriver_server.cc ...
6 years, 7 months ago (2014-05-22 06:01:04 UTC) #2
pfeldman
Also note that it is typical for remote debugging payloads to be 10-100Mb and we ...
6 years, 7 months ago (2014-05-22 06:03:54 UTC) #3
mmenke
On 2014/05/22 06:03:54, pfeldman wrote: > Also note that it is typical for remote debugging ...
6 years, 7 months ago (2014-05-22 20:49:27 UTC) #4
mmenke
A lot of these are just nits, still need to spend more time looking at ...
6 years, 7 months ago (2014-05-23 19:20:57 UTC) #5
pfeldman
https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc#newcode217 net/server/http_connection.cc:217: if (pending_write_buf_->total_size() + data.size() > kPendingDataLimit) { Before we ...
6 years, 7 months ago (2014-05-26 09:21:30 UTC) #6
mmenke
https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc#newcode217 net/server/http_connection.cc:217: if (pending_write_buf_->total_size() + data.size() > kPendingDataLimit) { On 2014/05/26 ...
6 years, 7 months ago (2014-05-27 14:32:07 UTC) #7
pfeldman
> It's buffering 100 MB payloads in RAM? That just seems a bad idea. Well, ...
6 years, 7 months ago (2014-05-27 14:59:15 UTC) #8
byungchul
On 2014/05/27 14:59:15, pfeldman wrote: > > It's buffering 100 MB payloads in RAM? That ...
6 years, 7 months ago (2014-05-27 16:03:42 UTC) #9
mmenke
On 2014/05/27 14:59:15, pfeldman wrote: > > It's buffering 100 MB payloads in RAM? That ...
6 years, 7 months ago (2014-05-27 16:08:35 UTC) #10
byungchul
On 2014/05/27 16:03:42, byungchul wrote: > On 2014/05/27 14:59:15, pfeldman wrote: > > > It's ...
6 years, 7 months ago (2014-05-27 16:09:55 UTC) #11
byungchul
On 2014/05/27 16:09:55, byungchul wrote: > On 2014/05/27 16:03:42, byungchul wrote: > > On 2014/05/27 ...
6 years, 7 months ago (2014-05-27 16:32:28 UTC) #12
pfeldman
Yep, DevToolsClientMsg_DispatchOnInspectorFrontend can carry 100Mb.
6 years, 7 months ago (2014-05-27 20:07:07 UTC) #13
byungchul
On 2014/05/27 20:07:07, pfeldman wrote: > Yep, DevToolsClientMsg_DispatchOnInspectorFrontend can carry 100Mb. I see. Then, instead ...
6 years, 7 months ago (2014-05-27 23:33:05 UTC) #14
byungchul
On 2014/05/27 23:33:05, byungchul wrote: > On 2014/05/27 20:07:07, pfeldman wrote: > > Yep, DevToolsClientMsg_DispatchOnInspectorFrontend ...
6 years, 7 months ago (2014-05-28 00:08:30 UTC) #15
Ryan Sleevi
On 2014/05/27 23:33:05, byungchul wrote: > On 2014/05/27 20:07:07, pfeldman wrote: > > Yep, DevToolsClientMsg_DispatchOnInspectorFrontend ...
6 years, 7 months ago (2014-05-28 00:17:08 UTC) #16
Ryan Sleevi
On 2014/05/28 00:08:30, byungchul wrote: > On 2014/05/27 23:33:05, byungchul wrote: > > On 2014/05/27 ...
6 years, 7 months ago (2014-05-28 00:18:04 UTC) #17
byungchul
Replied on comments before changing code. https://codereview.chromium.org/296053012/diff/1/content/browser/devtools/devtools_browser_target.cc File content/browser/devtools/devtools_browser_target.cc (right): https://codereview.chromium.org/296053012/diff/1/content/browser/devtools/devtools_browser_target.cc#newcode139 content/browser/devtools/devtools_browser_target.cc:139: if (!http_server_) On ...
6 years, 7 months ago (2014-05-28 01:19:35 UTC) #18
byungchul
On 2014/05/28 00:17:08, Ryan Sleevi wrote: > On 2014/05/27 23:33:05, byungchul wrote: > > On ...
6 years, 7 months ago (2014-05-28 01:25:02 UTC) #19
Ryan Sleevi
https://codereview.chromium.org/296053012/diff/1/content/browser/devtools/devtools_http_handler_impl.cc File content/browser/devtools/devtools_http_handler_impl.cc (right): https://codereview.chromium.org/296053012/diff/1/content/browser/devtools/devtools_http_handler_impl.cc#newcode121 content/browser/devtools/devtools_http_handler_impl.cc:121: base::WeakPtr<net::HttpServer> server_; On 2014/05/28 01:19:35, byungchul wrote: > On ...
6 years, 7 months ago (2014-05-28 01:36:25 UTC) #20
byungchul
https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/1/net/server/http_connection.cc#newcode157 net/server/http_connection.cc:157: DCHECK_GT(pending_data_.front().size(), consumed); On 2014/05/28 01:36:26, Ryan Sleevi wrote: > ...
6 years, 7 months ago (2014-05-28 05:01:32 UTC) #21
byungchul
PTAL. 1) Moved async read/write to HttpServer. 2) HttpConnection is just a container. 3) Sets ...
6 years, 6 months ago (2014-05-30 00:19:01 UTC) #22
mmenke
Sorry for slowness, I'll do another pass tomorrow morning.
6 years, 6 months ago (2014-06-02 21:21:16 UTC) #23
mmenke
Quick comments (Sorry again for slowness). Hope to do a more thorough pass this afternoon. ...
6 years, 6 months ago (2014-06-04 16:29:49 UTC) #24
byungchul
https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h File net/server/http_connection.h (right): https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h#newcode30 net/server/http_connection.h:30: class ReadIOBuffer : public IOBuffer { On 2014/06/04 16:29:50, ...
6 years, 6 months ago (2014-06-04 17:41:27 UTC) #25
mmenke
https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h File net/server/http_connection.h (right): https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h#newcode30 net/server/http_connection.h:30: class ReadIOBuffer : public IOBuffer { On 2014/06/04 17:41:28, ...
6 years, 6 months ago (2014-06-04 19:27:49 UTC) #26
mmenke
https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h File net/server/http_connection.h (right): https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h#newcode71 net/server/http_connection.h:71: class PendingWriteIOBuffer : public IOBuffer { This class really ...
6 years, 6 months ago (2014-06-04 19:28:51 UTC) #27
byungchul
https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h File net/server/http_connection.h (right): https://codereview.chromium.org/296053012/diff/50001/net/server/http_connection.h#newcode30 net/server/http_connection.h:30: class ReadIOBuffer : public IOBuffer { On 2014/06/04 19:27:50, ...
6 years, 6 months ago (2014-06-04 20:51:25 UTC) #28
mmenke
Two more quick responses... Still intend need to continue dig through everything and get more ...
6 years, 6 months ago (2014-06-04 20:59:59 UTC) #29
Ryan Sleevi
On 2014/06/04 20:59:59, mmenke wrote: > Two more quick responses... Still intend need to continue ...
6 years, 6 months ago (2014-06-04 21:03:08 UTC) #30
pfeldman
Could you elaborate on what is not ideal in the DevTools behavior? We are happy ...
6 years, 6 months ago (2014-06-05 04:25:50 UTC) #31
Ryan Sleevi
On 2014/06/05 04:25:50, pfeldman_ooo wrote: > Could you elaborate on what is not ideal in ...
6 years, 6 months ago (2014-06-05 06:59:48 UTC) #32
pfeldman
There is nothing forcing us to use blocking apis. All we do is receive a ...
6 years, 6 months ago (2014-06-05 09:03:11 UTC) #33
pfeldman
now that i am trying to recollect why we could not use io thread, i ...
6 years, 6 months ago (2014-06-05 09:10:23 UTC) #34
mmenke
I'm really thinking we need tests for this. https://codereview.chromium.org/296053012/diff/60001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/60001/net/server/http_connection.cc#newcode46 net/server/http_connection.cc:46: data_ ...
6 years, 6 months ago (2014-06-06 15:41:03 UTC) #35
byungchul
Unittests for buffer management are ready. UnixDomainServerSocket is still in progress, but want to get ...
6 years, 6 months ago (2014-06-06 19:17:36 UTC) #36
byungchul
PTAL. Added unittests for buffer management in HttpConnection, new unix domain server/client sockets.
6 years, 6 months ago (2014-06-08 07:21:05 UTC) #37
byungchul
https://codereview.chromium.org/296053012/diff/1/net/server/http_server.h File net/server/http_server.h (right): https://codereview.chromium.org/296053012/diff/1/net/server/http_server.h#newcode27 net/server/http_server.h:27: public base::SupportsWeakPtr<HttpServer> { On 2014/05/30 00:19:02, byungchul wrote: > ...
6 years, 6 months ago (2014-06-08 17:24:27 UTC) #38
mmenke
Could we split this into two CLS for simpler review? 2600 lines of code is ...
6 years, 6 months ago (2014-06-11 16:05:50 UTC) #39
mmenke
https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc#newcode23 net/server/http_connection.cc:23: IOBuffer* HttpConnection::ReadIOBuffer::GetUnusedIOBuffer() const { On 2014/06/11 16:05:49, mmenke wrote: ...
6 years, 6 months ago (2014-06-11 16:09:04 UTC) #40
byungchul
I also feel sorry that this CL is getting bigger. Will try to split. Please ...
6 years, 6 months ago (2014-06-11 17:30:28 UTC) #41
mmenke
https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc#newcode23 net/server/http_connection.cc:23: IOBuffer* HttpConnection::ReadIOBuffer::GetUnusedIOBuffer() const { On 2014/06/11 17:30:28, byungchul wrote: ...
6 years, 6 months ago (2014-06-11 17:53:27 UTC) #42
byungchul
CL for unix socket refactoring is uploaded in https://codereview.chromium.org/348803003/. Please review. https://codereview.chromium.org/296053012/diff/180001/net/socket/server_socket.cc File net/socket/server_socket.cc (right): ...
6 years, 6 months ago (2014-06-20 08:22:32 UTC) #43
mmenke
Not a very thorough pass today, had less time than expected. :( https://codereview.chromium.org/296053012/diff/220001/net/server/http_server.cc File net/server/http_server.cc ...
6 years, 5 months ago (2014-07-24 20:50:10 UTC) #44
byungchul
PTAL https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/180001/net/server/http_connection.cc#newcode23 net/server/http_connection.cc:23: IOBuffer* HttpConnection::ReadIOBuffer::GetUnusedIOBuffer() const { On 2014/06/11 17:53:27, mmenke ...
6 years, 4 months ago (2014-08-05 07:06:20 UTC) #45
mmenke
Doesn't look like I'll have time to do another pass today. I will get back ...
6 years, 4 months ago (2014-08-06 16:01:10 UTC) #46
byungchul
I have some ideas on more refactoring after this CL, for example, differentiating http connection ...
6 years, 4 months ago (2014-08-06 16:50:29 UTC) #47
mmenke
Sounds great! And "How" in that last comment should have been "Hope". On 2014/08/06 16:50:29, ...
6 years, 4 months ago (2014-08-06 16:52:20 UTC) #48
mmenke
Grr...sorry for slowness, been meaning to get to this all week, but just haven't been ...
6 years, 4 months ago (2014-08-08 18:35:44 UTC) #49
byungchul
https://codereview.chromium.org/296053012/diff/330001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/330001/net/server/http_connection.cc#newcode19 net/server/http_connection.cc:19: data_ = NULL; // base_ owns data_. On 2014/08/08 ...
6 years, 4 months ago (2014-08-12 21:36:55 UTC) #50
mmenke
Hrm....Maybe we will be able to land this by Friday... Not noticing a whole lot. ...
6 years, 4 months ago (2014-08-13 18:30:16 UTC) #51
mmenke
https://codereview.chromium.org/296053012/diff/370001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/370001/net/server/http_connection.cc#newcode35 net/server/http_connection.cc:35: << ", read=" << GetSize(); include base/logging.h https://codereview.chromium.org/296053012/diff/370001/net/server/http_connection.cc#newcode77 net/server/http_connection.cc:77: ...
6 years, 4 months ago (2014-08-14 16:36:03 UTC) #52
byungchul
https://codereview.chromium.org/296053012/diff/370001/net/server/http_connection.cc File net/server/http_connection.cc (right): https://codereview.chromium.org/296053012/diff/370001/net/server/http_connection.cc#newcode35 net/server/http_connection.cc:35: << ", read=" << GetSize(); On 2014/08/14 16:36:02, mmenke ...
6 years, 4 months ago (2014-08-14 18:44:03 UTC) #53
mmenke
https://codereview.chromium.org/296053012/diff/410001/net/server/http_connection_unittest.cc File net/server/http_connection_unittest.cc (right): https://codereview.chromium.org/296053012/diff/410001/net/server/http_connection_unittest.cc#newcode48 net/server/http_connection_unittest.cc:48: // Write arbitrara data up to kInitialBufSize. nit: arbitrary ...
6 years, 4 months ago (2014-08-15 14:23:16 UTC) #54
byungchul
https://codereview.chromium.org/296053012/diff/410001/net/server/http_connection_unittest.cc File net/server/http_connection_unittest.cc (right): https://codereview.chromium.org/296053012/diff/410001/net/server/http_connection_unittest.cc#newcode48 net/server/http_connection_unittest.cc:48: // Write arbitrara data up to kInitialBufSize. On 2014/08/15 ...
6 years, 4 months ago (2014-08-15 17:12:17 UTC) #55
mmenke
LGTM https://codereview.chromium.org/296053012/diff/430001/net/server/http_server.cc File net/server/http_server.cc (right): https://codereview.chromium.org/296053012/diff/430001/net/server/http_server.cc#newcode215 net/server/http_server.cc:215: } nit: Don't use braces for ifs with ...
6 years, 4 months ago (2014-08-15 17:53:02 UTC) #56
byungchul
https://codereview.chromium.org/296053012/diff/430001/net/server/http_server.cc File net/server/http_server.cc (right): https://codereview.chromium.org/296053012/diff/430001/net/server/http_server.cc#newcode215 net/server/http_server.cc:215: } On 2014/08/15 17:53:02, mmenke wrote: > nit: Don't ...
6 years, 4 months ago (2014-08-15 18:05:17 UTC) #57
pfeldman
devtools lgtm, but you need no move the socket factory out of devtools_http_handler. https://codereview.chromium.org/296053012/diff/490001/content/public/browser/devtools_http_handler.h File ...
6 years, 4 months ago (2014-08-18 15:18:01 UTC) #58
byungchul
https://codereview.chromium.org/296053012/diff/490001/content/public/browser/devtools_http_handler.h File content/public/browser/devtools_http_handler.h (right): https://codereview.chromium.org/296053012/diff/490001/content/public/browser/devtools_http_handler.h#newcode33 content/public/browser/devtools_http_handler.h:33: class CONTENT_EXPORT ServerSocketFactory { On 2014/08/18 15:18:00, pfeldman wrote: ...
6 years, 4 months ago (2014-08-19 22:26:11 UTC) #59
mmenke
https://codereview.chromium.org/296053012/diff/490001/content/public/browser/devtools_http_handler.h File content/public/browser/devtools_http_handler.h (right): https://codereview.chromium.org/296053012/diff/490001/content/public/browser/devtools_http_handler.h#newcode33 content/public/browser/devtools_http_handler.h:33: class CONTENT_EXPORT ServerSocketFactory { On 2014/08/18 15:18:00, pfeldman wrote: ...
6 years, 4 months ago (2014-08-19 22:43:55 UTC) #60
Yaron
Unfortunately, I'm not a great android OWNER for this. Normally I'd say mnaganov but he ...
6 years, 4 months ago (2014-08-20 05:28:16 UTC) #61
pfeldman
@Yaron: I looked at the Android parts, they look good. @byungchul: TBR mnaganov@ for them ...
6 years, 4 months ago (2014-08-20 14:41:19 UTC) #62
gunsch
chromecast/ LGTM. I patched this into https://codereview.chromium.org/490603002/ and confirmed Android side still builds.
6 years, 4 months ago (2014-08-20 20:16:40 UTC) #63
byungchul
The CQ bit was checked by byungchul@chromium.org
6 years, 4 months ago (2014-08-20 20:27:49 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/byungchul@chromium.org/296053012/510001
6 years, 4 months ago (2014-08-20 20:28:16 UTC) #65
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_tests_recipe on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-20 22:17:17 UTC) #66
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 22:21:12 UTC) #67
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/5610)
6 years, 4 months ago (2014-08-20 22:21:13 UTC) #68
darin (slow to review)
rubber stamp LGTM
6 years, 4 months ago (2014-08-22 17:58:11 UTC) #69
byungchul
The CQ bit was checked by byungchul@chromium.org
6 years, 4 months ago (2014-08-22 18:04:01 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/byungchul@chromium.org/296053012/510001
6 years, 4 months ago (2014-08-22 18:05:44 UTC) #71
commit-bot: I haz the power
Committed patchset #28 (510001) as 291447
6 years, 4 months ago (2014-08-22 18:10:19 UTC) #72
Evan Stade
6 years, 4 months ago (2014-08-22 21:03:32 UTC) #73
Message was sent while issue was closed.
A revert of this CL (patchset #29) has been created in
https://codereview.chromium.org/497223003/ by estade@chromium.org.

The reason for reverting is: looks like it caused net_unittests failures:
http://build.chromium.org/p/chromium.win/builders/Vista%20Tests%20(2)/builds/....

Powered by Google App Engine
This is Rietveld 408576698