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)

enhancement

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.
No longer depends on: 1352559
Depends on: 1352559
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)?
I believe |nsPluginHost::GetPluginTempDir| can also be removed. I can also file a follow up bug if that's preferred.
Assignee: nobody → benjamin
Mentor: benjamin
Packing up. Kyle, can you land this after review?
Assignee: benjamin → kyle
Sure! Going to talk to :jimm about become a module peer on plugins too.
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 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 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+
I think we should land this in 58.
m-c is now nightly 58.
Flags: needinfo?(jmathies)
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)
Tried an autoland and it didn't work. I'll take care of cleaning this up and getting it landed.
Thanks Kyle, this lets us trim a few sandbox rules on macOS, so it's much appreciated!
(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)
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
Depends on: 1528586
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: