WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
86654
[chromium] Clear the m_private pointer when destroying WebFilterOperations to avoid assert in WebPrivateOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=86654
Summary
[chromium] Clear the m_private pointer when destroying WebFilterOperations to...
Dana Jansens
Reported
2012-05-16 10:50:14 PDT
[chromium] Clear the m_private pointer when destroying WebFilterOperations to avoid assert in WebPrivateOwnPtr
Attachments
Patch
(2.95 KB, patch)
2012-05-16 10:51 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(3.63 KB, patch)
2012-05-16 13:20 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Dana Jansens
Comment 1
2012-05-16 10:51:29 PDT
Created
attachment 142298
[details]
Patch The ::reset() method is private on other WebClasses, but I can't imagine why it would be. So I've made it private here. If this is crazy please say so!
WebKit Review Bot
Comment 2
2012-05-16 10:55:36 PDT
Please wait for approval from
abarth@webkit.org
,
dglazkov@chromium.org
,
fishd@chromium.org
,
jamesr@chromium.org
or
tkent@chromium.org
before submitting, as this patch contains changes to the Chromium public API. See also
https://trac.webkit.org/wiki/ChromiumWebKitAPI
.
Adrienne Walker
Comment 3
2012-05-16 12:30:51 PDT
It seems like it should be public to me. What classes are you seeing that on?
James Robinson
Comment 4
2012-05-16 12:35:21 PDT
Comment on
attachment 142298
[details]
Patch It's normally public since it makes sense for someone using a WebFilterOperations to want to get a fresh one without having to make a new object (or wrap it in a pointer or the like).
Dana Jansens
Comment 5
2012-05-16 13:20:19 PDT
Created
attachment 142330
[details]
Patch K made reset() public. Dropping clear() since it's redundant then. Adding private destroy() to clear the m_private pointer so that toFilterOperations() can remain const.
James Robinson
Comment 6
2012-05-16 15:24:13 PDT
Comment on
attachment 142330
[details]
Patch reset() in WebKit API normally puts you in a null state (and there's often a bool isNull() call to check it), so it's a bit odd to have initialize() construct something non-null. Maybe leave initialize() and have ~ call reset() ?
Dana Jansens
Comment 7
2012-05-16 15:42:19 PDT
I tried this at first, but the problem is toFilterOperations() is const and returns a reference, not a pointer. So if the m_private is null, then you can't call toFilterOperations() without a segfault, because you can't change m_private. Options: 1) Changing toFilterOperations() to non-const: breaks the WebLayer API which takes a const WebFilterOperations&. 2) Changing toFilterOperations() to return a pointer? 3) Make a static empty FilterOperations object to return when m_private is NULL? 4) Don't let m_private be NULL.
James Robinson
Comment 8
2012-05-16 15:44:18 PDT
Ah, I see. Having m_private always be non-NULL seems like the best of those options.
James Robinson
Comment 9
2012-05-16 15:44:42 PDT
Comment on
attachment 142330
[details]
Patch R=me then. Thanks for the explanation.
Dana Jansens
Comment 10
2012-05-16 15:46:04 PDT
Comment on
attachment 142330
[details]
Patch Thanks!
WebKit Review Bot
Comment 11
2012-05-16 16:34:31 PDT
Comment on
attachment 142330
[details]
Patch Clearing flags on attachment: 142330 Committed
r117362
: <
http://trac.webkit.org/changeset/117362
>
WebKit Review Bot
Comment 12
2012-05-16 16:34:36 PDT
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