WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
55979
Unify Windows version checks
https://bugs.webkit.org/show_bug.cgi?id=55979
Summary
Unify Windows version checks
Peter Kasting
Reported
2011-03-08 16:09:02 PST
WebCore/platform/win/SystemInfo.h has a lone function "isRunningOnVistaOrLater()". Chromium has its own file, WindowsVersion.h, which defines a similar "isVistaOrNewer()". Then various different files call GetVersionEx() directly. We should unify all these in calling a function in SystemInfo.h that returns the Windows version in an easy-to-understand way (e.g. as an enum). Blocks
bug 55226
because unifying on this file gives me an appropriate place to add the WOW64/processor architecture checks that bug needs.
Attachments
Part 1, v1
(16.30 KB, patch)
2011-03-08 17:30 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Part 2, v1
(28.19 KB, patch)
2011-03-09 15:42 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Part 2, v2
(28.17 KB, patch)
2011-03-09 15:50 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Part 2, v3
(28.17 KB, patch)
2011-03-09 17:55 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Part 2, v4
(29.35 KB, patch)
2011-03-09 18:53 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Part 2, v5
(29.33 KB, patch)
2011-03-09 18:59 PST
,
Peter Kasting
mihaip
: review+
Details
Formatted Diff
Diff
Part 2, v6
(29.44 KB, patch)
2011-03-09 19:33 PST
,
Peter Kasting
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Peter Kasting
Comment 1
2011-03-08 17:30:23 PST
Created
attachment 85115
[details]
Part 1, v1 I split this into two parts for easier review, because changing everyone to use SystemInfo.cpp and changing SystemInfo.cpp to return Windows versions are distinct and can be done independently, and since each touches a number of places it's easier to miss things if they're lumped together.
WebKit Review Bot
Comment 2
2011-03-08 17:32:02 PST
Attachment 85115
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:40: Alphabetical sorting problem. [build/include_order] [4] Source/WebCore/rendering/RenderThemeChromiumWin.cpp:47: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
James Robinson
Comment 3
2011-03-08 17:33:18 PST
Comment on
attachment 85115
[details]
Part 1, v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=85115&action=review
please sort includes to make style thingy happy. R=me
>> Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:40 >> +#include "SystemInfo.h" > > Alphabetical sorting problem. [build/include_order] [4]
sort the includes please
>> Source/WebCore/rendering/RenderThemeChromiumWin.cpp:47 >> +#include "SystemInfo.h" > > Alphabetical sorting problem. [build/include_order] [4]
sort includes please
Peter Kasting
Comment 4
2011-03-08 17:58:30 PST
Comment on
attachment 85115
[details]
Part 1, v1 Clearing flags, patch landed in
r80611
.
Alexey Proskuryakov
Comment 5
2011-03-09 10:50:38 PST
GNUmakefile.am uses tabs everywhere, but this patch didn't have them - did it break the build? And if not, can we globally replace tabs with spaces in this file?
Peter Kasting
Comment 6
2011-03-09 12:08:27 PST
(In reply to
comment #5
)
> GNUmakefile.am uses tabs everywhere, but this patch didn't have them - did it break the build? And if not, can we globally replace tabs with spaces in this file?
The build (at least, the GTK build... is this used elsewhere?) didn't break. I don't know enough about this file to know if tabs can be globally removed. That might be a good question for one of the GTK guys. I'd prefer not to tackle it on this bug, although if you'd like me to correct my last change to use tabs instead of spaces I will happily include that in the part 2 patch.
Alexey Proskuryakov
Comment 7
2011-03-09 13:04:05 PST
Sounds like using tabs would be good for consistency.
Peter Kasting
Comment 8
2011-03-09 15:42:13 PST
Created
attachment 85247
[details]
Part 2, v1 By unifying the places that construct the UA string to call my new function, the fix for
bug 55226
will become very simple. Unfortunately, I am skeptical that the Qt part will work, and even if it does, I couldn't find enough docs on GetVersionEx() on WinCE to fully replace the old code. Oh well; if it doesn't work, I can yank it.
WebKit Review Bot
Comment 9
2011-03-09 15:45:31 PST
Attachment 85247
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/win/SystemInfo.cpp:54: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/WebCore/platform/win/SystemInfo.cpp:66: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/WebCore/platform/win/SystemInfo.cpp:74: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Source/WebCore/platform/win/SystemInfo.h:34: Should only a single space after a punctuation in a comment. [whitespace/comments] [5] Source/WebCore/platform/win/SystemInfo.h:59: Use 0 instead of NULL. [readability/null] [5] Total errors found: 5 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Peter Kasting
Comment 10
2011-03-09 15:50:04 PST
Created
attachment 85248
[details]
Part 2, v2 Style fixes
Build Bot
Comment 11
2011-03-09 17:23:21 PST
Attachment 85248
[details]
did not build on win: Build output:
http://queues.webkit.org/results/8114871
Peter Kasting
Comment 12
2011-03-09 17:55:22 PST
Created
attachment 85269
[details]
Part 2, v3 Fixes Win build error.
Peter Kasting
Comment 13
2011-03-09 18:53:18 PST
Created
attachment 85276
[details]
Part 2, v4 With help from kling on IRC, this replaces the rest of the Qt UA string code. This also makes the version check function shorter.
Build Bot
Comment 14
2011-03-09 18:53:29 PST
Attachment 85269
[details]
did not build on win: Build output:
http://queues.webkit.org/results/8115791
Peter Kasting
Comment 15
2011-03-09 18:59:07 PST
Created
attachment 85277
[details]
Part 2, v5 Fix another Windows build error.
Build Bot
Comment 16
2011-03-09 19:16:00 PST
Attachment 85277
[details]
did not build on win: Build output:
http://queues.webkit.org/results/8122097
Build Bot
Comment 17
2011-03-09 19:20:22 PST
Attachment 85276
[details]
did not build on win: Build output:
http://queues.webkit.org/results/8113893
Mihai Parparita
Comment 18
2011-03-09 19:23:02 PST
Comment on
attachment 85277
[details]
Part 2, v5 View in context:
https://bugs.webkit.org/attachment.cgi?id=85277&action=review
> Source/WebCore/platform/win/SystemInfo.cpp:37 > + static WindowsVersion version;
It might be safer to have a WindowsUnknown default value here, but I don't have a strong opinion about that.
Peter Kasting
Comment 19
2011-03-09 19:33:48 PST
Created
attachment 85279
[details]
Part 2, v6 Try to fix Windows build failure based on abarth's guesses about how to do WebKit[2] ForwardingHeaders. (In reply to
comment #18
)
> (From update of
attachment 85277
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=85277&action=review
> > > Source/WebCore/platform/win/SystemInfo.cpp:37 > > + static WindowsVersion version; > > It might be safer to have a WindowsUnknown default value here, but I don't have a strong opinion about that.
I originally had one, but I guarantee the code below sets a version, and I _want_ to guarantee that, since it's not clear on the caller side how one should handle "unknown".
Peter Kasting
Comment 20
2011-03-09 19:37:50 PST
Comment on
attachment 85279
[details]
Part 2, v6 Lemme temporarily set r? to make sure the EWS bots take a crack at this.
WebKit Review Bot
Comment 21
2011-03-09 19:39:55 PST
Attachment 85279
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp:31: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Peter Kasting
Comment 22
2011-03-09 20:20:45 PST
Comment on
attachment 85279
[details]
Part 2, v6 Landed in
r80688
, clearing flags.
Peter Kasting
Comment 23
2011-03-09 20:21:01 PST
Fixed in
r80688
.
Mihai Parparita
Comment 24
2011-03-09 21:21:15 PST
(In reply to
comment #19
)
> I originally had one, but I guarantee the code below sets a version, and I _want_ to guarantee that, since it's not clear on the caller side how one should handle "unknown".
A marker unknown initial value with an ASSERT that it's no longer set at the end may work.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug