Closed Bug 1181395 Opened 7 years ago Closed 7 years ago

Make kClassName* constants in nsWindowsDef.h use wchar_t[] to avoid runtime conversion

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

Details

Attachments

(2 files)

Currently, the kClass* constants in nsWindowsDef.h use `const char[]` type. However, we are currently using the Unicode version of Windows API, which means we have to do runtime conversion every time when we use those constants.

We should change them to type `const wchar_t[]` instead.
Assignee: nobody → quanxunzhen
Summary: Make kClass* constants in nsWindowsDef.h use wchar_t[] to avoid runtime conversion → Make kClassName* constants in nsWindowsDef.h use wchar_t[] to avoid runtime conversion
Attached patch patchSplinter Review
Attachment #8630823 - Flags: review?(jmathies)
Attached patch another patchSplinter Review
This patch removes nsWindow::sDefaultMainWindowClass so that we can pass the literal strings everywhere without wrapping them in nsString in advance.

You can r+ either one as you like. I prefer this patch, though, because I don't see the static field makes any sense.
Attachment #8630827 - Flags: review?(jmathies)
Comment on attachment 8630827 [details] [diff] [review]
another patch

I like this one too. Thanks!
Attachment #8630827 - Flags: review?(jmathies) → review+
Attachment #8630823 - Flags: review?(jmathies) → review-
After this, I got errors. I use vc14rc.
widget/windows/nsWindow.cpp(757): error C2660: “nsAString_internal::AssignLiteral”: function does not take one parameters
(In reply to zhoubcfan from comment #5)
> After this, I got errors. I use vc14rc.
> widget/windows/nsWindow.cpp(757): error C2660:
> “nsAString_internal::AssignLiteral”: function does not take one parameters

Could you please file a bug blocking this bug and bug 1119082 and provide more detailed information there? Since we haven't officially started supporting VC14, this error shouldn't block landing of this bug anyway.
Flags: needinfo?(zhoubcfan)
Depends on: 1181912
OK. I filed Bug 1181912 .
Flags: needinfo?(zhoubcfan)
https://hg.mozilla.org/mozilla-central/rev/64077f01ac16
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.