<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[42897] trunk/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/42897">42897</a></dd>
<dt>Author</dt> <dd>kdecker@apple.com</dd>
<dt>Date</dt> <dd>2009-04-27 10:50:14 -0700 (Mon, 27 Apr 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Anders Carlsson.

        &lt;rdar://problem/6352982&gt;
        
        * Plugins/WebBaseNetscapePluginView.mm: Removed checkIfAllowedToLoadURL:frame:callbackFunc, cancelCheckIfAllowedToLoadURL, and 
        _webPluginContainerCancelCheckIfAllowedToLoadRequest from the base class. These methods now exist in the subclass WebNetscapePluginView.
        
        Added WebNetscapeContainerCheckContextInfo, which is used as a &quot;contextInfo&quot; object in 
        -[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]
        * Plugins/WebNetscapeContainerCheckContextInfo.h: Added.
        * Plugins/WebNetscapeContainerCheckContextInfo.mm: Added.
        (-[WebNetscapeContainerCheckContextInfo initWithCheckRequestID:callbackFunc:]): Added desiginated initializer.
        (-[WebNetscapeContainerCheckContextInfo checkRequestID]): Added. Returns the checkRequestID.
        (-[WebNetscapeContainerCheckContextInfo callback]): Added. Returns the callback.
        
        * Plugins/WebNetscapePluginView.h: Added two new ivars: _containerChecksInProgress and _currentContainerCheckRequestID.
        * Plugins/WebNetscapePluginView.mm: #import both WebPluginContainerCheck.h and WebNetscapeContainerCheckContextInfo.h
        
        (-[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]): Added. This is the implementation of WKN_CheckIfAllowedToLoadURL.
        Here, we increment the request ID and start the container check.
        
        (-[WebNetscapePluginView _containerCheckResult:contextInfo:]): Added. This is a callback method for WebPluginContainerCheck.
        It's where we actually call into the plug-in and provide the allow-or-deny result.
    
        (-[WebNetscapePluginView cancelCheckIfAllowedToLoadURL:]): Added. This is the implementation of WKN_CancelCheckIfAllowedToLoadURL. 
        Here we lookup the check, cancel it, and remove it from _containerChecksInProgress.
        
        (-[WebNetscapePluginView _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Added. WebPluginContainerCheck automatically calls
        this method after invoking our _containerCheckResult: selector. It works this way because calling -[WebPluginContainerCheck cancel] allows
        it to do it's teardown process.
        
        (-[WebNetscapePluginView fini]): Release _containerChecksInProgress ivar.
        
        * Plugins/WebPluginContainerCheck.h: Removed initWithRequest: method from header; no client was using this method directly.
        * Plugins/WebPluginContainerCheck.mm: 
        (+[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:contextInfo:]): Added optional contextInfo parameter.
        (-[WebPluginContainerCheck _continueWithPolicy:]): If there's a contextInfo object, pass it as a parameter to resultSelector.
        (-[WebPluginContainerCheck cancel]): Release _contextInfo ivar.
        (-[WebPluginContainerCheck contextInfo]): Added new method. Returns the contextInfo object, if one so exists.
        * Plugins/WebPluginController.mm:
        (-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]): Pass nil for contextInfo. WebKit-style
        plug-ins do not need additional context information.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitWebKitxcodeprojprojectpbxproj">trunk/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewh">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewmm">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm</a></li>
<li><a href="#trunkWebKitmacPluginsWebNetscapePluginViewh">trunk/WebKit/mac/Plugins/WebNetscapePluginView.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebNetscapePluginViewmm">trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm</a></li>
<li><a href="#trunkWebKitmacPluginsWebPluginContainerCheckh">trunk/WebKit/mac/Plugins/WebPluginContainerCheck.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebPluginContainerCheckmm">trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm</a></li>
<li><a href="#trunkWebKitmacPluginsWebPluginControllermm">trunk/WebKit/mac/Plugins/WebPluginController.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebKitmacPluginsWebNetscapeContainerCheckContextInfoh">trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebNetscapeContainerCheckContextInfomm">trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/ChangeLog        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2009-04-27  Kevin Decker  &lt;kdecker@apple.com&gt;
+
+        Reviewed by Anders Carlsson.
+                
+        &lt;rdar://problem/6352982&gt;
+
+        * WebKit.xcodeproj/project.pbxproj: Added WebNetscapeContainerCheckContextInfo.mm to the project.
+
</ins><span class="cx"> 2009-04-23  Kevin Decker  &lt;kdecker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Anders Carlsson.
</span></span></pre></div>
<a id="trunkWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/WebKit.xcodeproj/project.pbxproj (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/WebKit.xcodeproj/project.pbxproj        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -11,7 +11,9 @@
</span><span class="cx">                 065AD5A40B0C32C7005A2B1D /* WebContextMenuClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */; };
</span><span class="cx">                 06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 06693DDA0BFBA85200216072 /* WebInspectorClient.h */; };
</span><span class="cx">                 06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */; };
</span><del>-                0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; };
</del><ins>+                0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */; };
+                0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */; };
+                0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */; };
</span><span class="cx">                 14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D8252D0AF955090004F057 /* WebChromeClient.h */; };
</span><span class="cx">                 14D825300AF955090004F057 /* WebChromeClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14D8252E0AF955090004F057 /* WebChromeClient.mm */; };
</span><span class="lines">@@ -327,6 +329,8 @@
</span><span class="cx">                 065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 06693DDA0BFBA85200216072 /* WebInspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspectorClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapeContainerCheckContextInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckContextInfo.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = WebNetscapeContainerCheckPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckPrivate.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -979,6 +983,8 @@
</span><span class="cx">                                 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */,
</span><span class="cx">                                 F5F717230288493C018635CA /* npapi.mm */,
</span><span class="cx">                                 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */,
</span><ins>+                                0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */,
+                                0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */,
</ins><span class="cx">                                 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         name = &quot;Netscape Plug-ins&quot;;
</span><span class="lines">@@ -1409,6 +1415,7 @@
</span><span class="cx">                                 FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */,
</span><span class="cx">                                 AB9FBBBB0F8582B0006ADC43 /* WebDOMOperationsInternal.h in Headers */,
</span><span class="cx">                                 0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */,
</span><ins>+                                0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -1718,6 +1725,7 @@
</span><span class="cx">                                 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */,
</span><span class="cx">                                 FEF52DFA0F6748F200FF70EE /* WebGeolocation.mm in Sources */,
</span><span class="cx">                                 0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */,
</span><ins>+                                0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/ChangeLog        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2009-04-27  Kevin Decker  &lt;kdecker@apple.com&gt;
+
+        Reviewed by Anders Carlsson.
+
+        &lt;rdar://problem/6352982&gt;
+        
+        * Plugins/WebBaseNetscapePluginView.mm: Removed checkIfAllowedToLoadURL:frame:callbackFunc, cancelCheckIfAllowedToLoadURL, and 
+        _webPluginContainerCancelCheckIfAllowedToLoadRequest from the base class. These methods now exist in the subclass WebNetscapePluginView.
+        
+        Added WebNetscapeContainerCheckContextInfo, which is used as a &quot;contextInfo&quot; object in 
+        -[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]
+        * Plugins/WebNetscapeContainerCheckContextInfo.h: Added.
+        * Plugins/WebNetscapeContainerCheckContextInfo.mm: Added.
+        (-[WebNetscapeContainerCheckContextInfo initWithCheckRequestID:callbackFunc:]): Added desiginated initializer.
+        (-[WebNetscapeContainerCheckContextInfo checkRequestID]): Added. Returns the checkRequestID.
+        (-[WebNetscapeContainerCheckContextInfo callback]): Added. Returns the callback.
+        
+        * Plugins/WebNetscapePluginView.h: Added two new ivars: _containerChecksInProgress and _currentContainerCheckRequestID.
+        * Plugins/WebNetscapePluginView.mm: #import both WebPluginContainerCheck.h and WebNetscapeContainerCheckContextInfo.h
+        
+        (-[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]): Added. This is the implementation of WKN_CheckIfAllowedToLoadURL.
+        Here, we increment the request ID and start the container check.
+        
+        (-[WebNetscapePluginView _containerCheckResult:contextInfo:]): Added. This is a callback method for WebPluginContainerCheck.
+        It's where we actually call into the plug-in and provide the allow-or-deny result.
+    
+        (-[WebNetscapePluginView cancelCheckIfAllowedToLoadURL:]): Added. This is the implementation of WKN_CancelCheckIfAllowedToLoadURL. 
+        Here we lookup the check, cancel it, and remove it from _containerChecksInProgress.
+        
+        (-[WebNetscapePluginView _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Added. WebPluginContainerCheck automatically calls
+        this method after invoking our _containerCheckResult: selector. It works this way because calling -[WebPluginContainerCheck cancel] allows
+        it to do it's teardown process.
+        
+        (-[WebNetscapePluginView fini]): Release _containerChecksInProgress ivar.
+        
+        * Plugins/WebPluginContainerCheck.h: Removed initWithRequest: method from header; no client was using this method directly.
+        * Plugins/WebPluginContainerCheck.mm: 
+        (+[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:contextInfo:]): Added optional contextInfo parameter.
+        (-[WebPluginContainerCheck _continueWithPolicy:]): If there's a contextInfo object, pass it as a parameter to resultSelector.
+        (-[WebPluginContainerCheck cancel]): Release _contextInfo ivar.
+        (-[WebPluginContainerCheck contextInfo]): Added new method. Returns the contextInfo object, if one so exists.
+        * Plugins/WebPluginController.mm:
+        (-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]): Pass nil for contextInfo. WebKit-style
+        plug-ins do not need additional context information.
+
</ins><span class="cx"> 2009-04-25  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam Weinig
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     class HTMLPlugInElement;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-@interface WebBaseNetscapePluginView : NSView &lt;WebPluginContainerCheckController&gt;
</del><ins>+@interface WebBaseNetscapePluginView : NSView
</ins><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;WebNetscapePluginPackage&gt; _pluginPackage;
</span><span class="cx">     
</span><span class="lines">@@ -104,9 +104,6 @@
</span><span class="cx"> - (void)addWindowObservers;
</span><span class="cx"> - (void)removeWindowObservers;
</span><span class="cx"> 
</span><del>-- (uint32)checkIfAllowedToLoadURL:(const char*) url frame:(const char*) frame callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc;
-- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID;
-
</del><span class="cx"> - (BOOL)convertFromX:(double)sourceX andY:(double)sourceY space:(NPCoordinateSpace)sourceSpace
</span><span class="cx">                  toX:(double *)destX andY:(double *)destY space:(NPCoordinateSpace)destSpace;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> #import &quot;WebKitLogging.h&quot;
</span><span class="cx"> #import &quot;WebKitNSStringExtras.h&quot;
</span><span class="cx"> #import &quot;WebKitSystemInterface.h&quot;
</span><ins>+#import &quot;WebPluginContainerCheck.h&quot;
+#import &quot;WebNetscapeContainerCheckContextInfo.h&quot;
</ins><span class="cx"> #import &quot;WebNSURLExtras.h&quot;
</span><span class="cx"> #import &quot;WebNSURLRequestExtras.h&quot;
</span><span class="cx"> #import &quot;WebView.h&quot;
</span><span class="lines">@@ -95,7 +97,7 @@
</span><span class="cx">         _mode = NP_EMBED;
</span><span class="cx">     
</span><span class="cx">     _loadManually = loadManually;
</span><del>-    
</del><ins>+
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -722,23 +724,6 @@
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-- (uint32)checkIfAllowedToLoadURL:(const char*) url frame:(const char*) frame callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc
-{
-    // Not yet implemented
-    return 0;
-}
-
-- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID
-{
-    // Not yet implemented
-}
-   
-- (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier
-{
-  // Not yet implemented   
-}
-
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebNetscapeContainerCheckContextInfoh"></a>
<div class="addfile"><h4>Added: trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h (0 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h                                (rev 0)
+++ trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;WebBaseNetscapePluginView.h&quot;
+
+@interface WebNetscapeContainerCheckContextInfo : NSObject {
+    uint32 _checkRequestID;
+    void (*_callback)(NPP npp, uint32, NPBool);
+}
+
+- (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc;
+- (uint32)checkRequestID;
+- (void (*)(NPP npp, uint32, NPBool))callback;
+
+@end
</ins></span></pre></div>
<a id="trunkWebKitmacPluginsWebNetscapeContainerCheckContextInfomm"></a>
<div class="addfile"><h4>Added: trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm (0 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm                                (rev 0)
+++ trunk/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;WebNetscapeContainerCheckContextInfo.h&quot;
+
+@implementation WebNetscapeContainerCheckContextInfo
+
+- (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc;
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _checkRequestID = checkRequestID;
+    _callback = callbackFunc;
+    return self;
+}
+
+- (uint32)checkRequestID
+{
+    return _checkRequestID;   
+}
+
+- (void (*)(NPP npp, uint32, NPBool))callback
+{
+    return _callback;
+}
+
+@end
</ins></span></pre></div>
<a id="trunkWebKitmacPluginsWebNetscapePluginViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebNetscapePluginView.h (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebNetscapePluginView.h        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebNetscapePluginView.h        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> // for the plug-in to function correctly. (rdar://problem/4699455)
</span><span class="cx"> #define WebNetscapePluginView WebNetscapePluginDocumentView
</span><span class="cx"> 
</span><del>-@interface WebNetscapePluginView : WebBaseNetscapePluginView&lt;WebPluginManualLoader&gt;
</del><ins>+@interface WebNetscapePluginView : WebBaseNetscapePluginView&lt;WebPluginManualLoader, WebPluginContainerCheckController&gt;
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;WebNetscapePluginStream&gt; _manualStream;
</span><span class="cx"> #ifndef BUILDING_ON_TIGER
</span><span class="lines">@@ -102,6 +102,9 @@
</span><span class="cx">     
</span><span class="cx">     BOOL _isFlash;
</span><span class="cx">     BOOL _isSilverlight;
</span><ins>+    
+    NSMutableDictionary *_containerChecksInProgress;
+    uint32 _currentContainerCheckRequestID;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (WebNetscapePluginView *)currentPluginView;
</span><span class="lines">@@ -140,6 +143,8 @@
</span><span class="cx"> - (void)didCallPlugInFunction;
</span><span class="cx"> 
</span><span class="cx"> - (void)handleMouseMoved:(NSEvent *)event;
</span><ins>+- (uint32)checkIfAllowedToLoadURL:(const char*) url frame:(const char*) frame callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc;
+- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx"> #import &quot;WebNSViewExtras.h&quot;
</span><span class="cx"> #import &quot;WebNetscapePluginPackage.h&quot;
</span><span class="cx"> #import &quot;WebBaseNetscapePluginStream.h&quot;
</span><ins>+#import &quot;WebPluginContainerCheck.h&quot;
+#import &quot;WebNetscapeContainerCheckContextInfo.h&quot;
</ins><span class="cx"> #import &quot;WebNetscapePluginEventHandler.h&quot;
</span><span class="cx"> #import &quot;WebNullPluginView.h&quot;
</span><span class="cx"> #import &quot;WebPreferences.h&quot;
</span><span class="lines">@@ -1211,6 +1213,65 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed))callbackFunc
+{
+    if (!_containerChecksInProgress) 
+        _containerChecksInProgress = [[NSMutableDictionary alloc] init];
+    
+    NSString *frameName = frameNameCString ? [NSString stringWithCString:frameNameCString encoding:NSISOLatin1StringEncoding] : nil;
+    
+    ++_currentContainerCheckRequestID;
+    WebNetscapeContainerCheckContextInfo *contextInfo = [[WebNetscapeContainerCheckContextInfo alloc] initWithCheckRequestID:_currentContainerCheckRequestID callbackFunc:callbackFunc];
+    
+    WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:[self requestWithURLCString:urlCString]
+                                                                        target:frameName
+                                                                  resultObject:self
+                                                                      selector:@selector(_containerCheckResult:contextInfo:)
+                                                                    controller:self 
+                                                                   contextInfo:contextInfo];
+    
+    [contextInfo release];
+    [_containerChecksInProgress setObject:check forKey:[NSNumber numberWithInt:_currentContainerCheckRequestID]];
+    [check start];
+    
+    return _currentContainerCheckRequestID;
+}
+
+- (void)_containerCheckResult:(PolicyAction)policy contextInfo:(id)contextInfo
+{
+    ASSERT([contextInfo isKindOfClass:[WebNetscapeContainerCheckContextInfo class]]);
+    void (*pluginCallback)(NPP npp, uint32, NPBool) = [contextInfo callback];
+    
+    if (!pluginCallback) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    
+    pluginCallback([self plugin], [contextInfo checkRequestID], (policy == PolicyUse));
+}
+
+- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID
+{
+    WebPluginContainerCheck *check = (WebPluginContainerCheck *)[_containerChecksInProgress objectForKey:[NSNumber numberWithInt:checkID]];
+    
+    if (!check)
+        return;
+    
+    [check cancel];
+    [_containerChecksInProgress removeObjectForKey:[NSNumber numberWithInt:checkID]];
+}
+
+// WebPluginContainerCheck automatically calls this method after invoking our _containerCheckResult: selector.
+// It works this way because calling -[WebPluginContainerCheck cancel] allows it to do it's teardown process.
+- (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)webPluginContainerCheck
+{
+    ASSERT([webPluginContainerCheck isKindOfClass:[WebPluginContainerCheck class]]);
+    WebPluginContainerCheck *check = (WebPluginContainerCheck *)webPluginContainerCheck;
+    ASSERT([check contextInfo] &amp;&amp; [[check contextInfo] isKindOfClass:[WebNetscapeContainerCheckContextInfo class]]);
+    
+    [self cancelCheckIfAllowedToLoadURL:[[check contextInfo] checkRequestID]];
+}
+
</ins><span class="cx"> #pragma mark NSVIEW
</span><span class="cx"> 
</span><span class="cx"> - (id)initWithFrame:(NSRect)frame
</span><span class="lines">@@ -1263,7 +1324,9 @@
</span><span class="cx">     if (timers) {
</span><span class="cx">         deleteAllValues(*timers);
</span><span class="cx">         delete timers;
</span><del>-    }    
</del><ins>+    }  
+    
+    [_containerChecksInProgress release];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)disconnectStream:(WebNetscapePluginStream*)stream
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebPluginContainerCheckh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebPluginContainerCheck.h (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebPluginContainerCheck.h        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebPluginContainerCheck.h        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -47,16 +47,14 @@
</span><span class="cx">     id &lt;WebPluginContainerCheckController&gt; _controller;
</span><span class="cx">     id _resultObject;
</span><span class="cx">     SEL _resultSelector;
</span><ins>+    id _contextInfo;
</ins><span class="cx">     BOOL _done;
</span><span class="cx">     WebPolicyDecisionListener *_listener;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-+ (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller;
-
-- (id)initWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller;
-
</del><ins>++ (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller contextInfo:(id)/*optional*/contextInfo; 
</ins><span class="cx"> - (void)start;
</span><del>-
</del><span class="cx"> - (void)cancel;
</span><ins>+- (id)contextInfo;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebPluginContainerCheckmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -47,27 +47,28 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WebPluginContainerCheck
</span><span class="cx"> 
</span><del>-+ (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller
</del><ins>+- (id)initWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller contextInfo:(id)contextInfo /*optional*/
</ins><span class="cx"> {
</span><del>-    return [[[self alloc] initWithRequest:request target:target resultObject:obj selector:selector controller:controller] autorelease];
-}
-
-- (id)initWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller
-{
</del><span class="cx">     if (!(self = [super init]))
</span><span class="cx">         return nil;
</span><del>-
</del><ins>+    
</ins><span class="cx">     _request = [request copy];
</span><span class="cx">     _target = [target copy];
</span><span class="cx">     _resultObject = [obj retain];
</span><span class="cx">     _resultSelector = selector;
</span><del>-
</del><ins>+    _contextInfo = [contextInfo retain];
+    
</ins><span class="cx">     // controller owns us so don't retain, to avoid cycle
</span><span class="cx">     _controller = controller;
</span><del>-
</del><ins>+    
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>++ (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id &lt;WebPluginContainerCheckController&gt;)controller contextInfo:(id)contextInfo /*optional*/
+{
+    return [[[self alloc] initWithRequest:request target:target resultObject:obj selector:selector controller:controller contextInfo:contextInfo] autorelease];
+}
+
</ins><span class="cx"> - (void)finalize
</span><span class="cx"> {
</span><span class="cx">     // mandatory to complete or cancel before releasing this object
</span><span class="lines">@@ -84,7 +85,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_continueWithPolicy:(PolicyAction)policy
</span><span class="cx"> {
</span><del>-    ((void (*)(id, SEL, BOOL))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse));
</del><ins>+    if (_contextInfo)
+        ((void (*)(id, SEL, BOOL, id))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse), _contextInfo);
+    else     
+        ((void (*)(id, SEL, BOOL))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse));
</ins><span class="cx"> 
</span><span class="cx">     // this will call indirectly call cancel
</span><span class="cx">     [_controller _webPluginContainerCancelCheckIfAllowedToLoadRequest:self];
</span><span class="lines">@@ -173,8 +177,16 @@
</span><span class="cx">     _resultObject = nil;
</span><span class="cx"> 
</span><span class="cx">     _controller = nil;
</span><ins>+    
+    [_contextInfo release];
+    _contextInfo = nil;
</ins><span class="cx"> 
</span><span class="cx">     _done = YES;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (id)contextInfo
+{
+    return _contextInfo;   
+}
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebPluginControllermm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebPluginController.mm (42896 => 42897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebPluginController.mm        2009-04-27 16:57:13 UTC (rev 42896)
+++ trunk/WebKit/mac/Plugins/WebPluginController.mm        2009-04-27 17:50:14 UTC (rev 42897)
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (id)_webPluginContainerCheckIfAllowedToLoadRequest:(NSURLRequest *)request inFrame:(NSString *)target resultObject:(id)obj selector:(SEL)selector
</span><span class="cx"> {
</span><del>-    WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:request target:target resultObject:obj selector:selector controller:self];
</del><ins>+    WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:request target:target resultObject:obj selector:selector controller:self contextInfo:nil];
</ins><span class="cx">     [_checksInProgress addObject:check];
</span><span class="cx">     [check start];
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>