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

Issue 933973002: Return errors from the Mojo network service using an enum. (Closed)

Created:
5 years, 10 months ago by ppi
Modified:
5 years, 8 months ago
Reviewers:
jamesr, qsr
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, qsr
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Return errors from the Mojo network service using an enum. This allows consumers of the network service to act upon returned error codes without referring to //net/base/net_errors.h. Of course, this is essentially a fork of net/base/net_error_list.h that we should keep in sync with the original. But at least we're handling this within the network service, once for all concumers. BUG=456130

Patch Set 1 #

Patch Set 2 : #

Total comments: 6

Patch Set 3 : Address James's remarks, add missing errors. #

Total comments: 2

Patch Set 4 : Drop unneeded include. #

Patch Set 5 : Generate the static_asserts using a macro. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+798 lines, -20 lines) Patch
M mojo/services/html_viewer/weburlloader_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/services/network/net_adapters.cc View 1 2 3 4 1 chunk +16 lines, -1 line 0 comments Download
M mojo/services/network/public/interfaces/network_error.mojom View 1 2 1 chunk +765 lines, -1 line 0 comments Download
M mojo/services/network/udp_socket_apptest.cc View 1 2 3 10 chunks +15 lines, -16 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
ppi
Hi James, wdyt?
5 years, 10 months ago (2015-02-17 15:48:27 UTC) #2
jamesr
lgtm https://codereview.chromium.org/933973002/diff/20001/mojo/services/network/net_adapters.cc File mojo/services/network/net_adapters.cc (right): https://codereview.chromium.org/933973002/diff/20001/mojo/services/network/net_adapters.cc#newcode112 mojo/services/network/net_adapters.cc:112: error->code = static_cast<NetworkCode>(error_code); can you add a set ...
5 years, 10 months ago (2015-02-18 18:43:07 UTC) #3
ppi
Thanks, James! I somehow managed to miss half of the error codes in the original ...
5 years, 10 months ago (2015-02-19 14:22:19 UTC) #6
qsr
https://codereview.chromium.org/933973002/diff/40001/mojo/services/network/net_adapters.cc File mojo/services/network/net_adapters.cc (right): https://codereview.chromium.org/933973002/diff/40001/mojo/services/network/net_adapters.cc#newcode112 mojo/services/network/net_adapters.cc:112: // error codes from net/net_errors.h. Could you use the ...
5 years, 10 months ago (2015-02-19 14:27:00 UTC) #7
ppi
https://codereview.chromium.org/933973002/diff/40001/mojo/services/network/net_adapters.cc File mojo/services/network/net_adapters.cc (right): https://codereview.chromium.org/933973002/diff/40001/mojo/services/network/net_adapters.cc#newcode112 mojo/services/network/net_adapters.cc:112: // error codes from net/net_errors.h. On 2015/02/19 14:27:00, qsr ...
5 years, 10 months ago (2015-02-19 15:36:09 UTC) #8
jamesr
Sounds like we probably do want a different error space, but since we're currently just ...
5 years, 10 months ago (2015-02-19 22:54:32 UTC) #9
ppi
Thanks, James. I think we should go for dropping the uint8 altogether, so that we ...
5 years, 10 months ago (2015-02-23 17:55:22 UTC) #10
jamesr
On 2015/02/23 17:55:22, ppi wrote: > Thanks, James. > > I think we should go ...
5 years, 10 months ago (2015-02-23 18:01:45 UTC) #11
ppi
By a boolean flag as you suggested. It's just that it'd be struct NetworkResult { ...
5 years, 10 months ago (2015-02-23 18:04:23 UTC) #12
jamesr
5 years, 10 months ago (2015-02-23 18:47:33 UTC) #13
and it wouldn't be nullable? seems almost equivalent similar to having

struct NetworkError {
  string? description;
};

and having the field be nullable in the various response types that use it, but
I think either way works.

Powered by Google App Engine
This is Rietveld 408576698