Bug 83805 - Nightly Back/Forward no longer calls plug-in's NPP_NewStream
Summary: Nightly Back/Forward no longer calls plug-in's NPP_NewStream
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-04-12 12:14 PDT by Rudi Sherry
Modified: 2012-04-16 14:03 PDT (History)
5 users (show)

See Also:


Attachments
Plugin that calls CFShow for each NPP call (14.99 KB, application/octet-stream)
2012-04-12 12:14 PDT, Rudi Sherry
no flags Details
Patch (11.24 KB, patch)
2012-04-16 13:34 PDT, Anders Carlsson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rudi Sherry 2012-04-12 12:14:21 PDT
Created attachment 136952 [details]
Plugin that calls CFShow for each NPP call

When a URL to a plugin (for instance, PDF) is shown, and the user goes Back/Forward, the nightly build no longer calls NPP_NewStream() with the resource for the URL.

Safari 5.1.5 does not have that.

To set up:
* Set up a webserver with the following (this is in etc/apache2/mime.types):
         application/vnd.pluginbug   pluginbug
* put any file with extension .pluginbug so the server can serve it (content doesn't matter)
* decompress and put the attached plug-in into /Library/Internet Plug-ins
* using the nightly build, surf to the URL for the .pluginbug file
* go Back, then Forward

... you will see that NPP_Destroy, NPP_New is called but no NPP_NewStream.  Using Safari, NPP_NewStream is called.

Sample logs below (the plugin calls CFShow so output goes to the console):

================================================================================================
Running Safari with the plugin, going to a pluginbug file:

4/12/12 12:00:54.022 PM [0x0-0x154154].com.apple.Safari: NPP_New
4/12/12 12:00:54.022 PM [0x0-0x154154].com.apple.Safari: NPP_SetWindow
4/12/12 12:00:54.022 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:00:54.022 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:00:54.033 PM [0x0-0x154154].com.apple.Safari: NPP_NewStream
4/12/12 12:00:54.034 PM [0x0-0x154154].com.apple.Safari: NPP_StreamAsFile
4/12/12 12:00:54.034 PM [0x0-0x154154].com.apple.Safari: NPP_DestroyStream
4/12/12 12:00:54.039 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventDrawRect
4/12/12 12:00:54.277 PM [0x0-0x154154].com.apple.Safari: NPP_GetValue 15
4/12/12 12:00:54.914 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged 
4/12/12 12:00:54.915 PM [0x0-0x154154].com.apple.Safari: OFF
4/12/12 12:00:54.915 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged OFF

Back/Forward (notice NPP_StreamAsFile):

4/12/12 12:03:43.647 PM [0x0-0x154154].com.apple.Safari: NPP_Destroy
4/12/12 12:03:44.173 PM [0x0-0x154154].com.apple.Safari: NPP_New
4/12/12 12:03:44.174 PM [0x0-0x154154].com.apple.Safari: NPP_SetWindow
4/12/12 12:03:44.174 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:03:44.175 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:03:44.175 PM [0x0-0x154154].com.apple.Safari: NPP_NewStream
4/12/12 12:03:44.175 PM [0x0-0x154154].com.apple.Safari: NPP_StreamAsFile
4/12/12 12:03:44.176 PM [0x0-0x154154].com.apple.Safari: NPP_DestroyStream
4/12/12 12:03:44.179 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventDrawRect
4/12/12 12:03:44.429 PM [0x0-0x154154].com.apple.Safari: NPP_GetValue 15
4/12/12 12:03:44.653 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventFlagsChanged
4/12/12 12:03:45.830 PM [0x0-0x154154].com.apple.Safari: NPP_HandleEvent NPCocoaEventWindowFocusChanged OFF

================================================================================================
Running the 04/12/2012 nightly build:

4/12/12 12:02:43.490 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:43.490 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:43.749 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventDrawRect
4/12/12 12:02:44.796 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_Destroy
4/12/12 12:02:44.805 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_New
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_SetWindow
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_NewStream
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_StreamAsFile
4/12/12 12:02:44.808 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_DestroyStream
4/12/12 12:02:44.811 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventDrawRect
4/12/12 12:02:45.061 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_GetValue 15

Back/forward (Notice *NO* NPP_StreamAsFile)

4/12/12 12:02:49.009 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_Destroy
4/12/12 12:02:49.461 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_New
4/12/12 12:02:49.462 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:49.462 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventWindowFocusChanged ON 
4/12/12 12:02:49.462 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_SetWindow
4/12/12 12:02:49.469 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_HandleEvent NPCocoaEventDrawRect
4/12/12 12:02:50.368 PM [0x0-0x15d15d].org.webkit.nightly.WebKit: NPP_GetValue 15
================================================================================================
Comment 1 Radar WebKit Bug Importer 2012-04-12 12:57:24 PDT
<rdar://problem/11238748>
Comment 2 Anders Carlsson 2012-04-16 13:34:17 PDT
Created attachment 137392 [details]
Patch
Comment 3 Simon Fraser (smfr) 2012-04-16 13:39:35 PDT
Comment on attachment 137392 [details]
Patch

Is it possible to make a layout test for this?
Comment 4 Anders Carlsson 2012-04-16 13:44:59 PDT
(In reply to comment #3)
> (From update of attachment 137392 [details])
> Is it possible to make a layout test for this?

I tried but I couldn't make one that reliably reproduced the bug...
Comment 5 Anders Carlsson 2012-04-16 14:03:19 PDT
Committed r114295: <http://trac.webkit.org/changeset/114295>