If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Add GonkNativeHandle::CreateDupNhObj()

RESOLVED FIXED in Firefox 46

Status

()

Core
Graphics: Layers
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: sotaro, Assigned: sotaro)

Tracking

unspecified
mozilla46
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(1 attachment, 4 obsolete attachments)

(Assignee)

Description

2 years ago
GonkNativeHandle expects that it always owns fd of native_handle_t. But there is a case that the assumption is not met. To handle the case, it seems better to add a function that just dups a native_handle_t for GonkNativeHandle::NhObj.
(Assignee)

Updated

2 years ago
Assignee: nobody → sotaro.ikeda.g
(Assignee)

Updated

2 years ago
Blocks: 1234472
(Assignee)

Comment 1

2 years ago
Created attachment 8709269 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()
(Assignee)

Updated

2 years ago
Attachment #8709269 - Flags: review?(nical.bugzilla)
(Assignee)

Updated

2 years ago
Attachment #8709269 - Flags: review?(nical.bugzilla)
(Assignee)

Comment 2

2 years ago
Created attachment 8709303 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()

Add error handling.
Attachment #8709269 - Attachment is obsolete: true
(Assignee)

Comment 3

2 years ago
Created attachment 8709304 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()
Attachment #8709303 - Attachment is obsolete: true
(Assignee)

Comment 4

2 years ago
Created attachment 8709305 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()

correct patch.
Attachment #8709304 - Attachment is obsolete: true
(Assignee)

Updated

2 years ago
Attachment #8709305 - Flags: review?(nical.bugzilla)
Comment on attachment 8709305 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()

Review of attachment 8709305 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/ipc/GonkNativeHandle.cpp
@@ +42,5 @@
>  
>  already_AddRefed<GonkNativeHandle::NhObj>
>  GonkNativeHandle::GetDupNhObj()
>  {
> +  return GonkNativeHandle::CreateDupNhObj(mNhObj->mHandle);

IsValid() checks (mNhObj && mNhObj->mHandle). Does this mean that you may run in a crash if mNhObj is null here?
(Assignee)

Comment 6

2 years ago
(In reply to Nicolas Silva [:nical] from comment #5)
> Comment on attachment 8709305 [details] [diff] [review]
> patch - Add GonkNativeHandle::CreateDupNhObj()
> 
> Review of attachment 8709305 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: gfx/layers/ipc/GonkNativeHandle.cpp
> @@ +42,5 @@
> >  
> >  already_AddRefed<GonkNativeHandle::NhObj>
> >  GonkNativeHandle::GetDupNhObj()
> >  {
> > +  return GonkNativeHandle::CreateDupNhObj(mNhObj->mHandle);
> 
> IsValid() checks (mNhObj && mNhObj->mHandle). Does this mean that you may
> run in a crash if mNhObj is null here?

Oh, sorry it is my mistake. I am going to update the patch. It should not crash.
(Assignee)

Comment 7

2 years ago
Created attachment 8709744 [details] [diff] [review]
patch - Add GonkNativeHandle::CreateDupNhObj()
Attachment #8709305 - Attachment is obsolete: true
Attachment #8709305 - Flags: review?(nical.bugzilla)
Attachment #8709744 - Flags: review?(nical.bugzilla)

Updated

2 years ago
Attachment #8709744 - Flags: review?(nical.bugzilla) → review+

Comment 8

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a24d6c2b7525

Comment 9

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/a24d6c2b7525
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.