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

Issue 1899943008: Macro-based constraints

Created:
4 years, 8 months ago by hta - Chromium
Modified:
4 years, 4 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, mlamouri+watch-blink_chromium.org, philipj_slow, dglazkov+blink, eric.carlson_apple.com, haraken, tommyw+watchlist_chromium.org, blink-reviews, kinuko+watch, blink-reviews-api_chromium.org, mcasas+watch+mediastream_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Macro-based constraints State: Proof of concept. Not commit-ready. This Cl introduces a single source of truth for what constraints exist, and uses that to generate code for the various places that have to do something for every defined constraint. BUG=

Patch Set 1 #

Patch Set 2 : Removed some more code #

Total comments: 3

Patch Set 3 : Added a fourth macro application #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -96 lines) Patch
M third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp View 1 2 2 chunks +14 lines, -67 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp View 1 2 chunks +11 lines, -16 lines 0 comments Download
M third_party/WebKit/public/platform/WebMediaConstraints.h View 1 2 1 chunk +28 lines, -13 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
hta - Chromium
Thoughts?
4 years, 8 months ago (2016-04-21 12:35:42 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1899943008/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1899943008/1
4 years, 8 months ago (2016-04-21 17:45:44 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/209145)
4 years, 8 months ago (2016-04-21 19:14:32 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1899943008/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1899943008/20001
4 years, 8 months ago (2016-04-21 21:21:11 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-21 22:47:04 UTC) #11
tommi (sloooow) - chröme
https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp File third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp (right): https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp#newcode518 third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp:518: if (constraintsIn.has##uppercase()) { \ crazy question. Instead of all ...
4 years, 7 months ago (2016-05-01 17:52:16 UTC) #12
hta - Chromium
No magic bullet found yet.... https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp File third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp (right): https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp#newcode518 third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp:518: if (constraintsIn.has##uppercase()) { \ ...
4 years, 7 months ago (2016-05-02 08:22:00 UTC) #13
tommi (sloooow) - chröme
4 years, 7 months ago (2016-05-03 16:49:35 UTC) #14
https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
(right):

https://codereview.chromium.org/1899943008/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp:518: if
(constraintsIn.has##uppercase()) { \
On 2016/05/02 08:22:00, hta - Chromium wrote:
> On 2016/05/01 17:52:16, tommi-chrömium wrote:
> > crazy question.  Instead of all of these type specific getters and setters,
> > would it be easier if the type was always base::Value? (see
src/base/values.h)
> 
> two problems with that:
> 
> - the constraints types aren't simple types, they're max/min/exact/ideal or
> multivalues (ConstrainXXX rather than just XXX)
> - the chief API I'm struggling with is the API generated by the WebIDL
compiler.
> I've tried to not go into changing that.
> 
> some of the #datatype# calls can be eliminated by templating. But not the
> data-declaration one; that has to have the type because that's what tells C++
> which type each constraint has.

What I'm wondering is if it would make more sense to do something similar to the
stats value type in webrtc:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc...

Then add to that the 'has' and 'get' methods.

Powered by Google App Engine
This is Rietveld 408576698