Closed
Bug 273056
Opened 20 years ago
Closed 20 years ago
PluginArrayImpl::GetLength should not throw if there's no plugin host, and PluginArrayImpl::GetPlugins should handle no plugin host and failure from mPluginHost->GetPlugins
Categories
(Core Graveyard :: Plug-ins, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
()
Details
Attachments
(1 file)
|
3.28 KB,
patch
|
bzbarsky
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMPluginArray.length]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript: navigator.plugins.length :: <TOP_LEVEL> :: line 1" data: no] Error: uncaught exception: [Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript: navigator.plugins[0] :: <TOP_LEVEL> :: line 1" data: no] Error: uncaught exception: [Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript: navigator.plugins.test :: <TOP_LEVEL> :: line 1" data: no]
Attachment #167783 -
Flags: superreview?(jst)
Comment 2•20 years ago
|
||
Comment on attachment 167783 [details] [diff] [review] fix PluginArrayImpl. also clean up idl sr=jst
Attachment #167783 -
Flags: superreview?(jst) → superreview+
Comment 3•20 years ago
|
||
Comment on attachment 167783 [details] [diff] [review] fix PluginArrayImpl. also clean up idl >Index: dom/src/base/nsPluginArray.cpp > mPluginArray = new nsIDOMPlugin*[mPluginCount]; >+ if (!mPluginArray) >+ return NS_ERROR_OUT_OF_MEMORY; >+ >+ if (!mPluginCount) >+ return NS_OK; I'd prefer the mPluginCount check first, so we don't even allocate mPluginArray when the plugin count is 0. All accesses to mPluginArray check mPluginCount, so it should be ok. With that, r=bzbarsky.
Attachment #167783 -
Flags: review+
mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp 1.513 mozilla/modules/plugin/base/src/nsPluginHostImpl.h 1.96 mozilla/dom/src/base/nsPluginArray.cpp 1.28 mozilla/modules/plugin/base/public/nsIPluginHost.idl 1.3 i explained to bz why his suggestion doesn't work, and he was fine with it.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•2 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•