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

Issue 2411573002: media: Use new wrapper types for media mojo interfaces (Closed)

Created:
4 years, 2 months ago by xhwang
Modified:
4 years, 2 months ago
Reviewers:
jrummell, dcheng
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, feature-media-reviews_chromium.org, alokp+watch_chromium.org, darin (slow to review), Aaron Boodman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Use new wrapper types for media mojo interfaces Now optional parameters are converted to base::Optional<>. I found it annoying for optional array or string which are converted to base::Optional<std::vector<T>> and base::Optional<std::string>: - It's confusing that it can be null and/or empty. In almost all cases we only need one type of "invalid" parameter. - In C++ we pass vector/string by const-ref so they cannot be null. So in this CL, I make array/string parameters mandatory, so that if they are not needed, we'll just pass empty array/string. This is easier to understand, more consistent with C++ code we have, and we don't need to deal with base::Optional. TBR=dkrahn@chromium.org BUG=611224 TEST=No functionality change Committed: https://crrev.com/7f6b08cb25cebbc09e7b61859942c57c1895fb47 Cr-Commit-Position: refs/heads/master@{#424765}

Patch Set 1 : media: Use new wrapper types for media mojo interfaces #

Total comments: 5

Patch Set 2 : comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -195 lines) Patch
M chrome/browser/chromeos/attestation/platform_verification_impl.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/attestation/platform_verification_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/media/android/provision_fetcher_impl.h View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/media/android/provision_fetcher_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/base/media_keys.h View 1 chunk +5 lines, -1 line 0 comments Download
M media/mojo/clients/mojo_cdm.h View 3 chunks +12 lines, -22 lines 0 comments Download
M media/mojo/clients/mojo_cdm.cc View 10 chunks +36 lines, -20 lines 0 comments Download
M media/mojo/clients/mojo_decryptor.h View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/clients/mojo_decryptor.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/common/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M media/mojo/common/media_type_converters.cc View 12 chunks +24 lines, -34 lines 0 comments Download
M media/mojo/common/media_type_converters_unittest.cc View 4 chunks +4 lines, -4 lines 0 comments Download
D media/mojo/common/mojo_type_trait.h View 1 chunk +0 lines, -32 lines 0 comments Download
M media/mojo/interfaces/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M media/mojo/interfaces/content_decryption_module.mojom View 3 chunks +9 lines, -9 lines 0 comments Download
M media/mojo/interfaces/decryptor.mojom View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/interfaces/media_types.mojom View 4 chunks +6 lines, -7 lines 0 comments Download
M media/mojo/interfaces/platform_verification.mojom View 1 chunk +3 lines, -3 lines 0 comments Download
M media/mojo/interfaces/provision_fetcher.mojom View 1 chunk +3 lines, -3 lines 0 comments Download
M media/mojo/services/mojo_cdm_promise.h View 1 2 chunks +3 lines, -5 lines 0 comments Download
M media/mojo/services/mojo_cdm_promise.cc View 2 chunks +2 lines, -6 lines 0 comments Download
M media/mojo/services/mojo_cdm_service.h View 1 chunk +9 lines, -9 lines 0 comments Download
M media/mojo/services/mojo_cdm_service.cc View 5 chunks +19 lines, -20 lines 0 comments Download
M media/mojo/services/mojo_decryptor_service.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M media/mojo/services/mojo_provision_fetcher.h View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/services/mojo_provision_fetcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/services/service_factory_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/services/service_factory_impl.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 41 (30 generated)
xhwang
rebase only
4 years, 2 months ago (2016-10-11 17:07:57 UTC) #5
xhwang
jrummell: PTAL at everything dcheng: Please OWNERS review mojom files and type converters
4 years, 2 months ago (2016-10-11 20:21:31 UTC) #23
jrummell
LGTM. std::vector<> conversions use "const &" sometimes, other times not. Just checking that this is ...
4 years, 2 months ago (2016-10-11 22:25:21 UTC) #24
xhwang
On 2016/10/11 22:25:21, jrummell wrote: > LGTM. std::vector<> conversions use "const &" sometimes, other times ...
4 years, 2 months ago (2016-10-11 22:33:41 UTC) #25
dcheng
mojo lgtm out of curiosity, did you find nullable or empty easier to reason about? ...
4 years, 2 months ago (2016-10-11 23:53:34 UTC) #26
xhwang
On 2016/10/11 23:53:34, dcheng wrote: > mojo lgtm > > out of curiosity, did you ...
4 years, 2 months ago (2016-10-12 00:00:30 UTC) #27
xhwang
https://chromiumcodereview.appspot.com/2411573002/diff/60001/media/mojo/services/mojo_cdm_promise.h File media/mojo/services/mojo_cdm_promise.h (right): https://chromiumcodereview.appspot.com/2411573002/diff/60001/media/mojo/services/mojo_cdm_promise.h#newcode21 media/mojo/services/mojo_cdm_promise.h:21: typedef base::Callback<void(mojom::CdmPromiseResultPtr, const T&...)> On 2016/10/11 23:53:34, dcheng wrote: ...
4 years, 2 months ago (2016-10-12 00:00:39 UTC) #28
xhwang
comments addressed
4 years, 2 months ago (2016-10-12 00:01:14 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411573002/80001
4 years, 2 months ago (2016-10-12 16:42:12 UTC) #36
commit-bot: I haz the power
Committed patchset #2 (id:80001)
4 years, 2 months ago (2016-10-12 16:53:01 UTC) #39
commit-bot: I haz the power
4 years, 2 months ago (2016-10-12 17:49:16 UTC) #41
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/7f6b08cb25cebbc09e7b61859942c57c1895fb47
Cr-Commit-Position: refs/heads/master@{#424765}

Powered by Google App Engine
This is Rietveld 408576698