Closed
Bug 1352567
Opened 8 years ago
Closed 7 years ago
Remove support for NPAPI stream modes other than NP_NORMAL
Categories
(Core Graveyard :: Plug-ins, enhancement, P2)
Core Graveyard
Plug-ins
Tracking
(firefox58 fixed)
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: benjamin, Assigned: qdot)
References
Details
Attachments
(3 files)
NPAPI had multiple modes that browsers could deliver network data to plugins, including normal streaming, download as a file, and random streaming.
Flash only uses the normal streaming mode, and we'd really like to remove the complexity and security risk of the other stream modes. This will be a little bit complex, but I'll mentor!
Basic APIs to remove:
NP_SEEK
NP_ASFILE
NP_ASFILEONLY
NPN_RequestRead
I'm going to outline an attack strategy, but there's a lot of moving pieces here so some of the job is going to be figuring out what you can actually remove.
_requestread is in nsNPAPIPlugin.cpp and can be removed/nulled out
For the content side, start pulling on the tangle here: https://dxr.mozilla.org/mozilla-central/rev/8df9fabf2587b7020889755acb9e75b664fe13cf/dom/plugins/base/nsNPAPIPluginStreamListener.cpp#339
We should check that the plugin set NP_NORMAL, fail early if something else. And then remove a bunch of the "stream type" code and supporting structures in nsNPAPIPluginStreamListener and nsPluginStreamListenerPeer.
Remove the file support starting with nsNPAPIPluginStreamListener::OnFileAvailable and nsPluginStreamListenerPeer::ServeStreamAsFile
Remove all the seekable/byte-range handling starting with nsPluginByteRangeStreamListener and nsPluginStreamListenerPeer::RequestRead.
nsPluginStreamListenerPeer won't need most of 'mPendingRequests' any more.
For the plugin-process side, PBrowserStream can remove the NPP_StreamAsFile API and do aggressive "type" checking. And then make matching changes to BrowserStreamParent and BrowserStreamChild.
A bunch of things will have to be removed from the test plugin (nptest.cpp)
There are a bunch of tests to fix or remove, especially test_pluginstream_*
I recommend not working on this until bug 1352559 is done, since they will likely conflict and that one's easier.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Reporter | ||
Comment 4•7 years ago
|
||
Jim, here's a try run of this change: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3452e76aaaaeb940944503ab5e2b5a485f4f2a41
Since I'm going on vacation for a couple weeks, if this is acceptable could you push this after review (or set checkin-needed)?
Comment 5•7 years ago
|
||
I believe |nsPluginHost::GetPluginTempDir| can also be removed. I can also file a follow up bug if that's preferred.
Reporter | ||
Updated•7 years ago
|
Assignee: nobody → benjamin
Mentor: benjamin
Reporter | ||
Comment 6•7 years ago
|
||
Packing up. Kyle, can you land this after review?
Assignee: benjamin → kyle
Assignee | ||
Comment 7•7 years ago
|
||
Sure! Going to talk to :jimm about become a module peer on plugins too.
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8891459 [details]
Bug 1352567 - Remove tests for plugin stream behavior except NP_NORMAL,
https://reviewboard.mozilla.org/r/162598/#review182974
Attachment #8891459 -
Flags: review?(jmathies) → review+
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8891460 [details]
Bug 1352567 - Remove plugin IPC code to support stream types other than NP_NORMAL (seekable and/or file streams),
https://reviewboard.mozilla.org/r/162600/#review182976
Attachment #8891460 -
Flags: review?(jmathies) → review+
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8891461 [details]
Bug 1352567 - Remove NPAPI seekable and file streams from the dom/plugins/base code,
https://reviewboard.mozilla.org/r/162602/#review182978
Attachment #8891461 -
Flags: review?(jmathies) → review+
Comment 11•7 years ago
|
||
I think we should land this in 58.
Comment 13•7 years ago
|
||
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.
hg error in cmd: hg rebase -s ac48495a38d1 -d d300dade1d49: rebasing 423645:ac48495a38d1 "Bug 1352567 - Remove tests for plugin stream behavior except NP_NORMAL, r=jimm"
local [dest] changed dom/plugins/test/mochitest/test_twostreams.html which other [source] deleted
use (c)hanged version, (d)elete, or leave (u)nresolved? u
merging dom/plugins/test/mochitest/mochitest.ini
unresolved conflicts (see hg resolve, then hg rebase --continue)
Assignee | ||
Comment 14•7 years ago
|
||
Tried an autoland and it didn't work. I'll take care of cleaning this up and getting it landed.
Comment 15•7 years ago
|
||
Thanks Kyle, this lets us trim a few sandbox rules on macOS, so it's much appreciated!
Comment 16•7 years ago
|
||
(In reply to Kyle Machulis [:qdot] [:kmachulis] (if a patch has no decent commit message, automatic r-) from comment #14)
> Tried an autoland and it didn't work. I'll take care of cleaning this up and
> getting it landed.
Ugh, sorry, I promised Ben I'd get to this but haven't had the time. Appreciate you looking at it.
Flags: needinfo?(jmathies)
Comment 17•7 years ago
|
||
Pushed by kmachulis@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/989ab34fd26d
Remove tests for plugin stream behavior except NP_NORMAL, r=jimm
https://hg.mozilla.org/integration/mozilla-inbound/rev/0dfd227a6a20
Remove plugin IPC code to support stream types other than NP_NORMAL (seekable and/or file streams), r=jimm
https://hg.mozilla.org/integration/mozilla-inbound/rev/3eca597f346f
Remove NPAPI seekable and file streams from the dom/plugins/base code, r=jimm
Comment 18•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/989ab34fd26d
https://hg.mozilla.org/mozilla-central/rev/0dfd227a6a20
https://hg.mozilla.org/mozilla-central/rev/3eca597f346f
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
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
•