Closed
Bug 801212
Opened 12 years ago
Closed 12 years ago
nsWebBrowser fails to override its interface's "PaintWindow()" method, due to subtly different method-signature
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: dholbert, Assigned: tnikkel)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
Bug 743975 tried to make nsWebBrowser::PaintWindow() override nsIWidgetListener::PaintWindow(), but the method-signatures are different, so they're different methods.
This triggers this build warning:
{
Warning: -Woverloaded-virtual in /mozilla/../obj/dist/include/nsIWidgetListener.h: ‘virtual bool nsIWidgetListener::PaintWindow(nsIWidget*, nsIntRegion, bool, bool)’ was hidden
../../../dist/include/nsIWidgetListener.h:126:16: warning: ‘virtual bool nsIWidgetListener::PaintWindow(nsIWidget*, nsIntRegion, bool, bool)’ was hidden [-Woverloaded-virtual]
Warning: -Woverloaded-virtual in /mozilla/embedding/browser/webBrowser/nsWebBrowser.h: by ‘virtual bool nsWebBrowser::PaintWindow(nsIWidget*, bool, nsIntRegion, bool)’
/mozilla/embedding/browser/webBrowser/nsWebBrowser.h:127:18: warning: by ‘virtual bool nsWebBrowser::PaintWindow(nsIWidget*, bool, nsIntRegion, bool)’ [-Woverloaded-virtual]
}
Note the subtly different method-signatures -- "bool" and "nsIntRegion" are inverted.
This appears to have been broken ever since nsIWidgetListener.h was created, back in bug 743975.
(FWIW, if we'd annotated nsWebBrowser::PaintWindow as MOZ_OVERRIDE, this would have been a build error and we would have caught this.)
Reporter | ||
Updated•12 years ago
|
Blocks: buildwarning
Reporter | ||
Comment 1•12 years ago
|
||
Depending on how PaintWindow() is invoked, this could mean we're never actually exercising the intended nsWebBrowser::PaintWindow() impl.
Summary: warning: ‘virtual bool nsIWidgetListener::PaintWindow()... was hidden [-Woverloaded-virtual]...by ‘virtual bool nsWebBrowser::PaintWindow() → nsWebBrowser fails to override its interface's "PaintWindow()" method, due to subtly different method-signature
Comment 2•12 years ago
|
||
Matt, I noticed you changed the signature in the base class even more just three days after this bug was entered. Was it in response to this, are you in the middle of fixing this issue?
Flags: needinfo?(matt.woodrow)
Assignee | ||
Comment 5•12 years ago
|
||
I think it was just intended to override that function. So let's just fix it.
Assignee: nobody → tnikkel
Attachment #692089 -
Flags: review?(enndeakin)
Flags: needinfo?(enndeakin)
Comment 6•12 years ago
|
||
Comment on attachment 692089 [details] [diff] [review]
patch
>- virtual bool PaintWindow(nsIWidget* aWidget, bool isRequest, nsIntRegion aRegion, bool aWillSendDidPaint);
>+ virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion, uint32_t aFlags);
Use MOZ_OVERRIDE to prevent a future mistake.
Reporter | ||
Comment 7•12 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #6)
> Use MOZ_OVERRIDE to prevent a future mistake.
+1 (per end of comment 0) :)
Assignee | ||
Comment 8•12 years ago
|
||
Arguably we should be adding that to every widget listener on every function, but I'm not going to do that, so I'll just do it the once here.
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #692089 -
Attachment is obsolete: true
Attachment #692089 -
Flags: review?(enndeakin)
Attachment #692111 -
Flags: review?(enndeakin)
Updated•12 years ago
|
Attachment #692111 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•