Closed
Bug 796873
Opened 13 years ago
Closed 12 years ago
Check the null GetOwner() case in nsScreen::MozLockOrientation
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: Ms2ger, Assigned: AMoz)
Details
Attachments
(1 file, 3 obsolete files)
1.39 KB,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
See bug 793244 comment 5.
Comment 1•13 years ago
|
||
Possibly a non-issue.
Can the owner be removed in another thread between GetLock and GetOwner?
Can do_QueryInterface fail?
If both are no, then this is a non-issue and there is no need for the if statement.
switch (GetLockOrientationPermission()) {
#In GetLockOrientationPermission#
if (!owner) {
return LOCK_DENIED;
}
#Back to switch#
...
case FULLSCREEN_LOCK_ALLOWED:
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner())
Assignee | ||
Comment 2•12 years ago
|
||
i am interested in working in this.
I have build src code long back.
Do i need to build anything else ?
Also which files do i need to edit ?
Comment 3•12 years ago
|
||
You can search for the affected files referred to in the bug by searching the mozilla source code directory, using as a search string some of the code posted above ...
To start a source code search of any kind start here: http://mxr.mozilla.org/mozilla-central/search
For this bug, you can search for the string |GetLockOrientationPermission()| from the code snippet provided above by doing this: http://mxr.mozilla.org/mozilla-central/search?string=GetLockOrientationPermission%28%29&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central
Assignee | ||
Comment 4•12 years ago
|
||
i have found the required | switch | scenario in only one file, so making changes in that file only ! If there is any other case then please suggest me.. Thanks !
Attachment #687843 -
Flags: feedback?
Updated•12 years ago
|
Attachment #687843 -
Flags: feedback? → feedback?(Ms2ger)
Reporter | ||
Comment 5•12 years ago
|
||
Comment on attachment 687843 [details] [diff] [review]
first patch !
Mounir, I know nothing about this code.
Attachment #687843 -
Flags: feedback?(Ms2ger) → feedback?(mounir)
Comment 6•12 years ago
|
||
Comment on attachment 687843 [details] [diff] [review]
first patch !
Review of attachment 687843 [details] [diff] [review]:
-----------------------------------------------------------------
You shouldn't remove the LockScreenOrientation() call, otherwise we will not lock the screen as we should. However, you could move that call *after* setting |target| and make target == null case returning false. That way, we will not try to lock the screen if we haven't a way to unlock it.
Thank you for working on that on sorry for being unresponsive on IRC, I am online 100% of the time but not actually in front of my computer ;)
Attachment #687843 -
Flags: feedback?(mounir) → feedback-
Assignee | ||
Comment 7•12 years ago
|
||
i will return to the bug after two days after my next paper of the exam schedule gets over. then i will upload the patch with the suggested changes. thanks !
Assignee | ||
Comment 8•12 years ago
|
||
is it as per you suggested ?
Also i didnot request feedback on your name since when i typed "mounir" in the text box, it gave a list of names, so i was confused.
Attachment #687843 -
Attachment is obsolete: true
Attachment #689722 -
Flags: feedback?
Comment 9•12 years ago
|
||
Comment on attachment 689722 [details] [diff] [review]
test patch
Review of attachment 689722 [details] [diff] [review]:
-----------------------------------------------------------------
You should try to lock after checking if target is null.
Also, you should remove the XXX comment and, "( target == null )" should be "(!target)".
Could you attach another patch and ask for a review to ":mounir" (notice the ':' ;)
Attachment #689722 -
Flags: feedback?
Assignee | ||
Comment 10•12 years ago
|
||
Attachment #689722 -
Attachment is obsolete: true
Attachment #689726 -
Flags: feedback?(mounir)
Comment 11•12 years ago
|
||
Comment on attachment 689726 [details] [diff] [review]
bug-796873-fix
Review of attachment 689726 [details] [diff] [review]:
-----------------------------------------------------------------
Could you update the comments?
Thanks
Attachment #689726 -
Flags: feedback?(mounir) → feedback+
Assignee | ||
Comment 12•12 years ago
|
||
is this correct. Since the first comment was after the < LockScreenOrientation(orientation) > check, i have shifted it later.
Attachment #689737 -
Flags: feedback?(mounir)
Assignee | ||
Comment 13•12 years ago
|
||
i dont understand why the patch is looking so weird ?
Updated•12 years ago
|
Attachment #689737 -
Flags: feedback?(mounir) → review+
Comment 14•12 years ago
|
||
Assignee: nobody → amod.narvekar
Status: NEW → ASSIGNED
Updated•12 years ago
|
Attachment #689726 -
Attachment is obsolete: true
Updated•12 years ago
|
Target Milestone: --- → mozilla20
Assignee | ||
Comment 15•12 years ago
|
||
any more file is needed to modify ?
i searched at http://mxr.mozilla.org/mozilla-central/search?string=GetLockOrientationPermission%28%29&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central where i found only i file where the switch case is used which i have modified and uploaded the patch !
Comment 16•12 years ago
|
||
No, nothing else is needed. I pushed your patch to mozilla-inbound. It should be in mozilla-central soon.
Thank you for your contribution :)
Comment 17•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•