WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136327
Initialization for some member variable of FontPlatformData
https://bugs.webkit.org/show_bug.cgi?id=136327
Summary
Initialization for some member variable of FontPlatformData
byeongha.cho
Reported
2014-08-27 18:46:16 PDT
There are initialization missing on FontPlatformData::FontPlatformData(const FontPlatformData& other, float size). This function is located on FontPlatformDataFreeType.cpp. I think m_fallbacks and m_scaledFont should be initialized on this creator. Because they are used as condition on FontPlatformData::operator= and FontPlatformData() is copying other to itself.
Attachments
Patch
(1.48 KB, patch)
2014-08-27 18:57 PDT
,
byeongha.cho
no flags
Details
Formatted Diff
Diff
Patch
(3.92 KB, patch)
2015-01-20 23:58 PST
,
byeongha.cho
no flags
Details
Formatted Diff
Diff
Patch for landing
(3.92 KB, patch)
2015-01-21 18:38 PST
,
byeongha.cho
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
byeongha.cho
Comment 1
2014-08-27 18:57:05 PDT
Created
attachment 237278
[details]
Patch
Daniel Bates
Comment 2
2014-08-27 21:14:07 PDT
Comment on
attachment 237278
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237278&action=review
> Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:229 > *this = other;
I know you didn't write this, but this isn't a good idiom. That is, calling the assignment operator from inside a copy constructor isn't a good idiom because the former only applies to a fully initialized object and the latter initializes a new object. Instead we should extract the common code into a member function that is called from both the copy assignment and copy constructor. Notice that we also call the copy assignment operator from the default copy constructor: <
http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp?rev=167768#L216
>.
byeongha.cho
Comment 3
2014-08-29 03:02:18 PDT
You mean new function is needed for copying member variables like copyFontPlatformData() or something? But I think this patch is also needed in the case of using same copy function on assignment operator and copy constructor. Should we use different code between assignment op. and copy constructor??
byeongha.cho
Comment 4
2014-08-29 04:25:30 PDT
You mean new function is needed for copying member variables like copyFontPlatformData() or something? But I think this patch is also needed in the case of using same copy function on assignment operator and copy constructor. Should we use different code between assignment op. and copy constructor??
byeongha.cho
Comment 5
2015-01-20 00:27:21 PST
I think idiom issue should be handled on another issue. Because, even though we add copy function for FontPlatformData, this patch is still needed.
Myles C. Maxfield
Comment 6
2015-01-20 18:05:11 PST
Comment on
attachment 237278
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=237278&action=review
> Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:226 > + : m_fallbacks(0) > + , m_scaledFont(0)
Please use nullptr.
Myles C. Maxfield
Comment 7
2015-01-20 18:06:44 PST
Comment on
attachment 237278
[details]
Patch Please file an issue for refactoring common code between the copy constructor and copy assignment operator.
byeongha.cho
Comment 8
2015-01-20 23:58:40 PST
Created
attachment 245052
[details]
Patch
byeongha.cho
Comment 9
2015-01-21 00:00:31 PST
I have filed an issue for idiom.
https://bugs.webkit.org/show_bug.cgi?id=140718
byeongha.cho
Comment 10
2015-01-21 18:38:31 PST
Created
attachment 245108
[details]
Patch for landing
Gyuyoung Kim
Comment 11
2015-01-23 01:51:11 PST
Comment on
attachment 245108
[details]
Patch for landing LGTM. cq=me
WebKit Commit Bot
Comment 12
2015-01-23 02:33:30 PST
Comment on
attachment 245108
[details]
Patch for landing Clearing flags on attachment: 245108 Committed
r179006
: <
http://trac.webkit.org/changeset/179006
>
WebKit Commit Bot
Comment 13
2015-01-23 02:33:34 PST
All reviewed patches have been landed. Closing bug.
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