Bug 83325 - Get rid of the useless flag PREEMPT_GEOLOCATION_PERMISSION
Summary: Get rid of the useless flag PREEMPT_GEOLOCATION_PERMISSION
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-05 16:11 PDT by Benjamin Poulain
Modified: 2012-04-14 13:29 PDT (History)
3 users (show)

See Also:


Attachments
Patch (8.75 KB, patch)
2012-04-05 16:33 PDT, Benjamin Poulain
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2012-04-05 16:11:34 PDT
The flag PREEMPT_GEOLOCATION_PERMISSION was added in
http://trac.webkit.org/changeset/63742 around some code of
Geolocation.

I could not find any case where PREEMPT_GEOLOCATION_PERMISSION is not
used. Unless someone does not use this flag, I plan to remove the flag
and the related useless code.
Comment 1 Benjamin Poulain 2012-04-05 16:33:57 PDT
Created attachment 135933 [details]
Patch
Comment 2 Ryosuke Niwa 2012-04-05 17:31:21 PDT
Comment on attachment 135933 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135933&action=review

> Source/WebCore/ChangeLog:23
> +        (WebCore::Geolocation::positionChanged): The case (!isAllowed()) was there
> +        to support granting the authorization for WTF_USE_PREEMPT_GEOLOCATION_PERMISSION.

You mean when PREEMPT_GEOLOCATION_PERMISSION is disabled?
Comment 3 Benjamin Poulain 2012-04-05 17:37:29 PDT
> > Source/WebCore/ChangeLog:23
> > +        (WebCore::Geolocation::positionChanged): The case (!isAllowed()) was there
> > +        to support granting the authorization for WTF_USE_PREEMPT_GEOLOCATION_PERMISSION.
> 
> You mean when PREEMPT_GEOLOCATION_PERMISSION is disabled?

Yes indeed. I will reword that when landing.
Comment 4 Benjamin Poulain 2012-04-06 15:24:16 PDT
Committed r113505: <http://trac.webkit.org/changeset/113505>
Comment 5 Alexey Proskuryakov 2012-04-14 10:53:35 PDT
Was there a specific reason to use CRASH instead of ASSERT? We usually only do that for out of memory conditions, and use ASSERT.
Comment 6 Benjamin Poulain 2012-04-14 13:29:05 PDT
> Was there a specific reason to use CRASH instead of ASSERT? We usually only do that for out of memory conditions, and use ASSERT.

This particular check comes from a hardening patch I previously did. At the time, Adam suggested it would be better to crash so we learn if that happens I the wild. At the time, I did not aggree because there were too many corner case for granting permission.

Now that the permission system is greatly simplified, I think CRASH() is reasonable.