|
|
Created:
7 years, 3 months ago by lgombos Modified:
7 years, 3 months ago CC:
blink-reviews, Nils Barth (inactive), kojih, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, ruben Base URL:
https://chromium.googlesource.com/chromium/blink.git@master Visibility:
Public. |
DescriptionUse the platform=linux code path for other Unix-like platforms (FreeBSD and OpenBSD) as well, not just OS(LINUX) - with the exception of MacOS.
As a side benefit this change removes code that was not tested by any of the existing bots.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158120
Patch Set 1 #Patch Set 2 : Remove unrelated change. #
Messages
Total messages: 13 (0 generated)
Make the UNIX-like a.k.a OS(POSIX) code path the default. Some examples from existing code/bugs where this has been discussed/suggested: - https://bugs.webkit.org/show_bug.cgi?id=59297#c0 (the same bug where the OS(xxxBSD) guards where introduced) - https://src.chromium.org/viewvc/blink?revision=157777&view=revision
I am happy to rename the "linux" platform to "unix" or "posix" or "default" if that would make the code more readable/consistent.
On 2013/09/14 06:06:41, lgombos wrote: > I am happy to rename the "linux" platform to "unix" or "posix" or "default" if > that would make the code more readable/consistent. I believe the FreeBSD port is functional; cc'ing ruben, the maintainer. I think it would be OK to move the OS(LINUX) into an OS(POSIX) at the end of the #ifs. Is this causing a bug or a problem that we should solve by always returning "linux" here?
On 2013/09/16 17:58:28, tony wrote: > On 2013/09/14 06:06:41, lgombos wrote: > > I am happy to rename the "linux" platform to "unix" or "posix" or "default" if > > that would make the code more readable/consistent. > > I believe the FreeBSD port is functional; cc'ing ruben, the maintainer. I think > it would be OK to move the OS(LINUX) into an OS(POSIX) at the end of the #ifs. > > Is this causing a bug or a problem that we should solve by always returning > "linux" here? I am not able to formulate a "bug" per say - that does not mean that it does not existing. This CL came out from a larger effort to cut down on unnecessary use of build-time configurations and replace them with run-time options, where it is possible/applicable. An other driver is to use the OS() macros consistently across the project. It seems some of the css rules use this platform information - https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit.... The BSD implementation would probably benefit from these rules as well. Best option would be to eliminate this native function and perhaps implement it in JavaScript. In fact it seems there is already a JavaScript implementation which is more aligned with the CL proposed here with a default "linux" branch. - https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
On 2013/09/16 19:17:03, lgombos wrote: > On 2013/09/16 17:58:28, tony wrote: > > On 2013/09/14 06:06:41, lgombos wrote: > > > I am happy to rename the "linux" platform to "unix" or "posix" or "default" > if > > > that would make the code more readable/consistent. > > > > I believe the FreeBSD port is functional; cc'ing ruben, the maintainer. I > think > > it would be OK to move the OS(LINUX) into an OS(POSIX) at the end of the #ifs. > > > > Is this causing a bug or a problem that we should solve by always returning > > "linux" here? > > I am not able to formulate a "bug" per say - that does not mean that it does not > existing. This CL came out from a larger effort to cut down on unnecessary use > of build-time configurations and replace them with run-time options, where it is > possible/applicable. An other driver is to use the OS() macros consistently > across the project. > > It seems some of the css rules use this platform information - > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit.... > The BSD implementation would probably benefit from these rules as well. This seems like a bug and a good reason to collapse all the unixes together. I would change the code to be: #elif OS(POSIX) v8SetReturnValue(args, v8::String::NewSymbol("linux")); #else #error Unknown UI style for inspector frontend. #endif This is more like code we have in Chromium. Do we compile this on Android or iOS?
On 2013/09/16 19:24:08, tony wrote: > On 2013/09/16 19:17:03, lgombos wrote: > > On 2013/09/16 17:58:28, tony wrote: > > > On 2013/09/14 06:06:41, lgombos wrote: > > > > I am happy to rename the "linux" platform to "unix" or "posix" or > "default" > > if > > > > that would make the code more readable/consistent. > > > > > > I believe the FreeBSD port is functional; cc'ing ruben, the maintainer. I > > think > > > it would be OK to move the OS(LINUX) into an OS(POSIX) at the end of the > #ifs. > > > > > > Is this causing a bug or a problem that we should solve by always returning > > > "linux" here? > > > > I am not able to formulate a "bug" per say - that does not mean that it does > not > > existing. This CL came out from a larger effort to cut down on unnecessary use > > of build-time configurations and replace them with run-time options, where it > is > > possible/applicable. An other driver is to use the OS() macros consistently > > across the project. > > > > It seems some of the css rules use this platform information - > > > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit.... > > The BSD implementation would probably benefit from these rules as well. > > This seems like a bug and a good reason to collapse all the unixes together. I > would change the code to be: > #elif OS(POSIX) > v8SetReturnValue(args, v8::String::NewSymbol("linux")); > #else > #error Unknown UI style for inspector frontend. > #endif > > This is more like code we have in Chromium. > > Do we compile this on Android or iOS? I had a similar discussion with Adam recently on another CL - https://codereview.chromium.org/23895006/#msg5 . !OS(WIN) is a synonym for OS(POSIX) and if this assumption ever changes #error in config.h will be triggered. The #error you proposed is redundant with #error in config.h and can not happen today; it just adds some dead code to the project, so I propose to just rely on #error in config.h.
LGTM. FWIW, the value of having #error in multiple places is that if you're bringing up a new port, it let's you know where a runtime problem may exist at compile time. E.g., if I were to try to bring up a windows phone port, this may silently fall through to linux and it may take a very long time to find this bug. Please update the bug description to say what bug it is you're fixing (inspector style on freebsd and openbsd).
On 2013/09/16 20:02:50, tony wrote: > LGTM. Thanks ! > FWIW, the value of having #error in multiple places is that if you're bringing > up a new port, it let's you know where a runtime problem may exist at compile > time. E.g., if I were to try to bring up a windows phone port, this may > silently fall through to linux and it may take a very long time to find this > bug. I expect any new platform to be a variation/subplatform/specialization of either OS(WIN) or OS(POSIX).
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/l.gombos@samsung.com/23537045/3001
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_pres...
LGTM.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/l.gombos@samsung.com/23537045/3001
Message was sent while issue was closed.
Change committed as 158120 |