<!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>[165755] trunk/Source/WebKit2</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/165755">165755</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-03-17 13:38:28 -0700 (Mon, 17 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add SPI for getting bundle parameters from the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=130355

Reviewed by Dan Bernstein.

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
(-[WKWebProcessBundleParameters initWithDictionary:]):
(-[WKWebProcessBundleParameters valueForKey:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(-[WKWebProcessPlugInController parameters]):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::InjectedBundle):
* WebProcess/InjectedBundle/InjectedBundle.h:
(WebKit::InjectedBundle::create):
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::bundleParameters):
(WebKit::InjectedBundle::platformInitialize):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebContextMacmm">trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInmm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleh">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundlemacInjectedBundleMacmm">trunk/Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessBundleParametersh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessBundleParametersmm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-03-17  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Add SPI for getting bundle parameters from the injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=130355
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
+        (-[WKWebProcessBundleParameters initWithDictionary:]):
+        (-[WKWebProcessBundleParameters valueForKey:]):
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
+        (-[WKWebProcessPlugInController parameters]):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::InjectedBundle):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        (WebKit::InjectedBundle::create):
+        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
+        (WebKit::InjectedBundle::bundleParameters):
+        (WebKit::InjectedBundle::platformInitialize):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
</ins><span class="cx"> 2014-03-17  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Provide preference to enable additional AVFoundation options
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebContextMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED == 1080
</del><ins>+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED == 1080
</ins><span class="cx"> @interface NSKeyedArchiver (WKDetails)
</span><span class="cx"> - (void)setRequiresSecureCoding:(BOOL)b;
</span><span class="cx"> @end
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_bundleParameters) {
</span><span class="cx">         auto data = adoptNS([[NSMutableData alloc] init]);
</span><del>-        auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] init]);
</del><ins>+        auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
</ins><span class="cx"> 
</span><span class="cx">         [keyedArchiver setRequiresSecureCoding:YES];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -288,6 +288,8 @@
</span><span class="cx">                 1AA20D5118AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA20D5018AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2E51B12E4C05E00BC4966 /* CGUtilities.h */; };
</span><span class="cx">                 1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA2E51C12E4C05E00BC4966 /* CGUtilities.cpp */; };
</span><ins>+                1AA2E56618D77508003814BD /* WKWebProcessBundleParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA2E56418D77508003814BD /* WKWebProcessBundleParameters.mm */; };
+                1AA2E56718D77508003814BD /* WKWebProcessBundleParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2E56518D77508003814BD /* WKWebProcessBundleParameters.h */; };
</ins><span class="cx">                 1AA3D75B1651B44F008713D0 /* RemoteLayerTreeHost.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA3D7591651B44F008713D0 /* RemoteLayerTreeHost.mm */; };
</span><span class="cx">                 1AA3D75C1651B44F008713D0 /* RemoteLayerTreeHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA3D75A1651B44F008713D0 /* RemoteLayerTreeHost.h */; };
</span><span class="cx">                 1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA417C912C00CCA002BE67B /* TextChecker.h */; };
</span><span class="lines">@@ -2031,6 +2033,8 @@
</span><span class="cx">                 1AA20D5018AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationDelegatePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AA2E51B12E4C05E00BC4966 /* CGUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AA2E51C12E4C05E00BC4966 /* CGUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CGUtilities.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1AA2E56418D77508003814BD /* WKWebProcessBundleParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessBundleParameters.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1AA2E56518D77508003814BD /* WKWebProcessBundleParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessBundleParameters.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1AA3D7591651B44F008713D0 /* RemoteLayerTreeHost.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeHost.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AA3D75A1651B44F008713D0 /* RemoteLayerTreeHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeHost.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AA417C912C00CCA002BE67B /* TextChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4259,6 +4263,8 @@
</span><span class="cx">                 1F0181681858DC1500F92884 /* Cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1AA2E56518D77508003814BD /* WKWebProcessBundleParameters.h */,
+                                1AA2E56418D77508003814BD /* WKWebProcessBundleParameters.mm */,
</ins><span class="cx">                                 3795789B18AD4F1100B9ED2E /* WKWebProcessPlugInFormDelegatePrivate.h */,
</span><span class="cx">                                 1F0181691858DC1500F92884 /* WKWebProcessPlugInFrame.h */,
</span><span class="cx">                                 1F01816A1858DC1500F92884 /* WKWebProcessPlugInFrame.mm */,
</span><span class="lines">@@ -6689,6 +6695,7 @@
</span><span class="cx">                                 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><span class="cx">                                 1A9E329B1822E1CC00F5D04C /* WKRemoteObject.h in Headers */,
</span><ins>+                                1AA2E56718D77508003814BD /* WKWebProcessBundleParameters.h in Headers */,
</ins><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><span class="cx">                                 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
</span><span class="cx">                                 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
</span><span class="lines">@@ -7923,6 +7930,7 @@
</span><span class="cx">                                 1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */,
</span><span class="cx">                                 BC82837B16B36A4F00A278FE /* ChildProcessEntryPoint.mm in Sources */,
</span><span class="cx">                                 9F54F88F16488E87007DF81A /* ChildProcessMac.mm in Sources */,
</span><ins>+                                1AA2E56618D77508003814BD /* WKWebProcessBundleParameters.mm in Sources */,
</ins><span class="cx">                                 1A9EA31E18BBDF4B004F7C95 /* WKWebViewConfigurationToBeRemoved.mm in Sources */,
</span><span class="cx">                                 E1513C66166EABB200149FCB /* ChildProcessProxy.cpp in Sources */,
</span><span class="cx">                                 1A2A4B0E1586A2240090C9E9 /* ColorSpaceData.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessBundleParametershfromrev165754trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h (from rev 165754, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h) (0 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 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.
+ */
+
+@interface WKWebProcessBundleParameters : NSObject
+
+- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPICocoaWKWebProcessBundleParametersmmfromrev165754trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm (from rev 165754, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h) (0 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 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;config.h&quot;
+#import &quot;WKWebProcessBundleParameters.h&quot;
+
+#import &lt;wtf/RetainPtr.h&gt;
+
+@implementation WKWebProcessBundleParameters {
+    RetainPtr&lt;NSMutableDictionary&gt; _parameters;
+}
+
+- (instancetype)initWithDictionary:(NSDictionary *)dictionary
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _parameters = adoptNS([[NSMutableDictionary alloc] initWithDictionary:dictionary]);
+
+    return self;
+}
+
+- (NSString *)valueForKey:(NSString *)key
+{
+    return [_parameters valueForKey:key];
+}
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -44,8 +44,10 @@
</span><span class="cx"> WK_API_CLASS
</span><span class="cx"> @interface WKWebProcessPlugInController : NSObject
</span><span class="cx"> 
</span><del>-@property(readonly) WKConnection *connection;
</del><ins>+@property (readonly) WKConnection *connection;
</ins><span class="cx"> 
</span><ins>+@property (readonly) id parameters;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -96,6 +96,11 @@
</span><span class="cx">     return wrapper(*_bundle-&gt;webConnectionToUIProcess());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (id)parameters
+{
+    return _bundle-&gt;bundleParameters();
+}
+
</ins><span class="cx"> #pragma mark WKObject protocol implementation
</span><span class="cx"> 
</span><span class="cx"> - (API::Object&amp;)_apiObject
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &quot;WebPreferencesStore.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><ins>+#include &quot;WebProcessCreationParameters.h&quot;
</ins><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><span class="cx"> #include &lt;WebCore/ApplicationCache.h&gt;
</span><span class="lines">@@ -84,11 +85,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-InjectedBundle::InjectedBundle(const String&amp; path)
-    : m_path(path)
</del><ins>+InjectedBundle::InjectedBundle(const WebProcessCreationParameters&amp; parameters)
+    : m_path(parameters.injectedBundlePath)
</ins><span class="cx">     , m_platformBundle(0)
</span><span class="cx"> {
</span><del>-    initializeClient(0);
</del><ins>+    platformInitialize(parameters);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InjectedBundle::~InjectedBundle()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &lt;WebCore/UserContentTypes.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserScriptTypes.h&gt;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><ins>+#include &lt;wtf/RetainPtr.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="lines">@@ -45,6 +46,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(FOUNDATION)
</span><span class="cx"> OBJC_CLASS NSBundle;
</span><ins>+OBJC_CLASS NSMutableDictionary;
+OBJC_CLASS WKWebProcessBundleParameters;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="lines">@@ -73,12 +76,13 @@
</span><span class="cx"> class WebFrame;
</span><span class="cx"> class WebPage;
</span><span class="cx"> class WebPageGroupProxy;
</span><ins>+struct WebProcessCreationParameters;
</ins><span class="cx"> 
</span><span class="cx"> class InjectedBundle : public API::ObjectImpl&lt;API::Object::Type::Bundle&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;InjectedBundle&gt; create(const String&amp; path)
</del><ins>+    static PassRefPtr&lt;InjectedBundle&gt; create(const WebProcessCreationParameters&amp; parameters)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new InjectedBundle(path));
</del><ins>+        return adoptRef(new InjectedBundle(parameters));
</ins><span class="cx">     }
</span><span class="cx">     ~InjectedBundle();
</span><span class="cx"> 
</span><span class="lines">@@ -168,15 +172,25 @@
</span><span class="cx">     void setCSSCompositingEnabled(bool);
</span><span class="cx">     void dispatchPendingLoadRequests();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA)
+    WKWebProcessBundleParameters *bundleParameters();
+#endif
+
</ins><span class="cx"> private:
</span><del>-    explicit InjectedBundle(const String&amp;);
</del><ins>+    explicit InjectedBundle(const WebProcessCreationParameters&amp;);
</ins><span class="cx"> 
</span><ins>+    void platformInitialize(const WebProcessCreationParameters&amp;);
+
</ins><span class="cx">     String m_path;
</span><span class="cx">     PlatformBundle m_platformBundle; // This is leaked right now, since we never unload the bundle/module.
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SandboxExtension&gt; m_sandboxExtension;
</span><span class="cx"> 
</span><span class="cx">     InjectedBundleClient m_client;
</span><ins>+
+#if PLATFORM(COCOA)
+    RetainPtr&lt;WKWebProcessBundleParameters&gt; m_bundleParameters;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundlemacInjectedBundleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -26,10 +26,13 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;InjectedBundle.h&quot;
</span><span class="cx"> 
</span><ins>+#import &quot;APIData.h&quot;
</ins><span class="cx"> #import &quot;ObjCObjectGraph.h&quot;
</span><span class="cx"> #import &quot;WKBundleAPICast.h&quot;
</span><span class="cx"> #import &quot;WKBundleInitialize.h&quot;
</span><ins>+#import &quot;WKWebProcessBundleParameters.h&quot;
</ins><span class="cx"> #import &quot;WKWebProcessPlugInInternal.h&quot;
</span><ins>+#import &quot;WebProcessCreationParameters.h&quot;
</ins><span class="cx"> #import &lt;Foundation/NSBundle.h&gt;
</span><span class="cx"> #import &lt;stdio.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="lines">@@ -42,6 +45,12 @@
</span><span class="cx"> - (CFBundleRef)_cfBundle;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED == 1080
+@interface NSKeyedUnarchiver (WKDetails)
+- (void)setRequiresSecureCoding:(BOOL)b;
+@end
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> bool InjectedBundle::load(API::Object* initializationUserData)
</span><span class="lines">@@ -124,4 +133,32 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+WKWebProcessBundleParameters *InjectedBundle::bundleParameters()
+{
+    ASSERT(m_bundleParameters);
+
+    return m_bundleParameters.get();
+}
+
+void InjectedBundle::platformInitialize(const WebProcessCreationParameters&amp; parameters)
+{
+    if (!parameters.bundleParameterData)
+        return;
+
+    auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast&lt;void*&gt;(static_cast&lt;const void*&gt;(parameters.bundleParameterData-&gt;bytes())) length:parameters.bundleParameterData-&gt;size() freeWhenDone:NO]);
+
+    auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParameterData.get()]);
+    [unarchiver setRequiresSecureCoding:YES];
+
+    NSDictionary *dictionary = nil;
+    @try {
+        dictionary = [unarchiver.get() decodeObjectOfClass:[NSDictionary class] forKey:@&quot;parameters&quot;];
+    } @catch (NSException *exception) {
+        LOG_ERROR(&quot;Failed to decode bundle parameters: %@&quot;, exception);
+    }
+
+    m_bundleParameters = adoptNS([[WKWebProcessBundleParameters alloc] initWithDictionary:dictionary]);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (165754 => 165755)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-17 20:34:52 UTC (rev 165754)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-17 20:38:28 UTC (rev 165755)
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!parameters.injectedBundlePath.isEmpty()) {
</span><del>-        m_injectedBundle = InjectedBundle::create(parameters.injectedBundlePath);
</del><ins>+        m_injectedBundle = InjectedBundle::create(parameters);
</ins><span class="cx">         m_injectedBundle-&gt;setSandboxExtension(SandboxExtension::create(parameters.injectedBundlePathExtensionHandle));
</span><span class="cx"> 
</span><span class="cx">         if (!m_injectedBundle-&gt;load(injectedBundleInitializationUserData.get())) {
</span></span></pre>
</div>
</div>

</body>
</html>