<!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>[149765] 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/149765">149765</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2013-05-08 13:48:58 -0700 (Wed, 08 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add SPI to determine if a plugin is sandboxed
https://bugs.webkit.org/show_bug.cgi?id=115810

Reviewed by Anders Carlsson.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeSandbox):
* Shared/Plugins/mac/PluginSandboxProfile.h: Added.
* Shared/Plugins/mac/PluginSandboxProfile.mm: Added.
(WebKit::pluginSandboxProfileDefaultDirectory):
(WebKit::pluginSandboxProfileDirectories):
(WebKit::pluginSandboxProfileName):
(WebKit::pluginSandboxCommonProfile):
(WebKit::pluginSandboxProfileForDirectory):
(WebKit::pluginSandboxProfile):
(WebKit::pluginHasSandboxProfileForDirectory):
(WebKit::pluginHasSandboxProfile):
Move sandbox code to its own file and refactor to use cocoa. Also adds pluginHasSandboxProfile function
which uses the newly refactored code.

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKPlugInInfoIsSandboxedKey):
(createInfoDictionary):
Add WKPlugInInfoIsSandboxedKey.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PluginProcessmacPluginProcessMacmm">trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMach">trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMacmm">trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedPluginsmacPluginSandboxProfileh">trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.h</a></li>
<li><a href="#trunkSourceWebKit2SharedPluginsmacPluginSandboxProfilemm">trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (149764 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-08 20:45:01 UTC (rev 149764)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2013-05-08  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add SPI to determine if a plugin is sandboxed
+        https://bugs.webkit.org/show_bug.cgi?id=115810
+
+        Reviewed by Anders Carlsson.
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::initializeSandbox):
+        * Shared/Plugins/mac/PluginSandboxProfile.h: Added.
+        * Shared/Plugins/mac/PluginSandboxProfile.mm: Added.
+        (WebKit::pluginSandboxProfileDefaultDirectory):
+        (WebKit::pluginSandboxProfileDirectories):
+        (WebKit::pluginSandboxProfileName):
+        (WebKit::pluginSandboxCommonProfile):
+        (WebKit::pluginSandboxProfileForDirectory):
+        (WebKit::pluginSandboxProfile):
+        (WebKit::pluginHasSandboxProfileForDirectory):
+        (WebKit::pluginHasSandboxProfile):
+        Move sandbox code to its own file and refactor to use cocoa. Also adds pluginHasSandboxProfile function
+        which uses the newly refactored code.
+
+        * UIProcess/API/C/mac/WKContextPrivateMac.h:
+        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
+        (WKPlugInInfoIsSandboxedKey):
+        (createInfoDictionary):
+        Add WKPlugInInfoIsSandboxedKey.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
</ins><span class="cx"> 2013-05-08  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Safari unexpectedly quits with invalid message from the web process with message ID 0x323002f (WebPageProxy.DecidePolicyForNavigationAction)
</span></span></pre></div>
<a id="trunkSourceWebKit2PluginProcessmacPluginProcessMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm (149764 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm        2013-05-08 20:45:01 UTC (rev 149764)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -30,9 +30,10 @@
</span><span class="cx"> #if ENABLE(PLUGIN_PROCESS)
</span><span class="cx"> 
</span><span class="cx"> #import &quot;NetscapePlugin.h&quot;
</span><del>-#import &quot;PluginProcessShim.h&quot;
-#import &quot;PluginProcessProxyMessages.h&quot;
</del><span class="cx"> #import &quot;PluginProcessCreationParameters.h&quot;
</span><ins>+#import &quot;PluginProcessProxyMessages.h&quot;
+#import &quot;PluginProcessShim.h&quot;
+#import &quot;PluginSandboxProfile.h&quot;
</ins><span class="cx"> #import &quot;SandboxInitializationParameters.h&quot;
</span><span class="cx"> #import &lt;CoreAudio/AudioHardware.h&gt;
</span><span class="cx"> #import &lt;WebCore/LocalizedStrings.h&gt;
</span><span class="lines">@@ -282,48 +283,6 @@
</span><span class="cx">     parentProcessConnection()-&gt;send(Messages::PluginProcessProxy::SetFullscreenWindowIsShowing(fullscreenWindowIsShowing), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static String loadSandboxProfileForDirectory(const String&amp; bundleIdentifier, NSString *sandboxProfileDirectoryPath)
-{
-    if (bundleIdentifier.isEmpty())
-        return String();
-
-    // Fold all / characters to : to prevent the plugin bundle-id from trying to escape the profile directory
-    String sanitizedBundleIdentifier = bundleIdentifier;
-    sanitizedBundleIdentifier.replace('/', ':');
-
-    RetainPtr&lt;CFURLRef&gt; sandboxProfileDirectory = adoptCF(CFURLCreateWithFileSystemPath(0, (CFStringRef)sandboxProfileDirectoryPath, kCFURLPOSIXPathStyle, TRUE));
-
-    RetainPtr&lt;CFStringRef&gt; sandboxFileName = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR(&quot;%@.sb&quot;), sanitizedBundleIdentifier.createCFString().get()));
-    RetainPtr&lt;CFURLRef&gt; sandboxURL = adoptCF(CFURLCreateWithFileSystemPathRelativeToBase(0, sandboxFileName.get(), kCFURLPOSIXPathStyle, FALSE, sandboxProfileDirectory.get()));
-
-    RetainPtr&lt;NSString&gt; profileString = adoptNS([[NSString alloc] initWithContentsOfURL:(NSURL *)sandboxURL.get() encoding:NSUTF8StringEncoding error:NULL]);
-    if (!profileString)
-        return String();
-
-    sandboxURL = adoptCF(CFURLCreateWithFileSystemPathRelativeToBase(0, CFSTR(&quot;com.apple.WebKit.plugin-common.sb&quot;), kCFURLPOSIXPathStyle, FALSE, sandboxProfileDirectory.get()));
-
-    RetainPtr&lt;NSString&gt; commonProfileString = adoptNS([[NSString alloc] initWithContentsOfURL:(NSURL *)sandboxURL.get() encoding:NSUTF8StringEncoding error:NULL]);
-    if (!commonProfileString)
-        return String();
-
-    return [commonProfileString.get() stringByAppendingString:profileString.get()];
-}
-
-static String loadSandboxProfile(const String&amp; bundleIdentifier)
-{
-    // First look in the WebKit2 bundle.
-    String sandboxProfile = loadSandboxProfileForDirectory(bundleIdentifier, [[[NSBundle bundleForClass:NSClassFromString(@&quot;WKView&quot;)] resourcePath] stringByAppendingPathComponent:@&quot;PlugInSandboxProfiles&quot;]);
-    if (!sandboxProfile.isEmpty())
-        return sandboxProfile;
-
-    // Then try /System/Library/Sandbox/Profiles/.
-    sandboxProfile = loadSandboxProfileForDirectory(bundleIdentifier, @&quot;/System/Library/Sandbox/Profiles/&quot;);
-    if (!sandboxProfile.isEmpty())
-        return sandboxProfile;
-
-    return String();
-}
-
</del><span class="cx"> static void muteAudio(void)
</span><span class="cx"> {
</span><span class="cx">     AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyProcessIsAudible, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
</span><span class="lines">@@ -382,7 +341,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PluginProcess::initializeSandbox(const ChildProcessInitializationParameters&amp; parameters, SandboxInitializationParameters&amp; sandboxParameters)
</span><span class="cx"> {
</span><del>-    String sandboxProfile = loadSandboxProfile(m_pluginBundleIdentifier);
</del><ins>+    String sandboxProfile = pluginSandboxProfile(m_pluginBundleIdentifier);
</ins><span class="cx">     if (sandboxProfile.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedPluginsmacPluginSandboxProfileh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.h (0 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.h        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef PluginSandboxProfile_h
+#define PluginSandboxProfile_h
+
+#include &lt;wtf/Forward.h&gt;
+
+namespace WebKit {
+
+String pluginSandboxProfile(const String&amp; bundleIdentifier);
+bool pluginHasSandboxProfile(const String&amp; bundleIdentifier);
+
+} // namespace WebKit
+
+#endif // PluginSandboxProfile_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedPluginsmacPluginSandboxProfilemm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.mm (0 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.mm                                (rev 0)
+++ trunk/Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.mm        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginSandboxProfile.h&quot;
+
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/text/StringConcatenate.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebKit {
+
+static NSString *pluginSandboxProfileDefaultDirectory()
+{
+    return [[[NSBundle bundleForClass:NSClassFromString(@&quot;WKView&quot;)] resourcePath] stringByAppendingPathComponent:@&quot;PlugInSandboxProfiles&quot;];
+}
+
+static NSArray *pluginSandboxProfileDirectories()
+{
+    return @[
+        // First look in the WebKit2 bundle.
+        pluginSandboxProfileDefaultDirectory(),
+
+        // Then try /System/Library/Sandbox/Profiles/.
+        @&quot;/System/Library/Sandbox/Profiles/&quot;
+    ];
+}
+
+static NSString *pluginSandboxProfileName(const String&amp; bundleIdentifier)
+{
+    // Fold all / characters to : to prevent the plugin bundle-id from trying to escape the profile directory
+    String sanitizedBundleIdentifier = bundleIdentifier;
+    sanitizedBundleIdentifier.replace('/', ':');
+
+    return [NSString stringWithFormat:@&quot;%@.sb&quot;, (NSString *)sanitizedBundleIdentifier];
+}
+
+static String pluginSandboxCommonProfile()
+{
+    NSString *profilePath = [pluginSandboxProfileDefaultDirectory() stringByAppendingPathComponent:@&quot;com.apple.WebKit.plugin-common.sb&quot;];
+    return [NSString stringWithContentsOfFile:profilePath encoding:NSUTF8StringEncoding error:NULL];
+}
+
+static String pluginSandboxProfileForDirectory(NSString *profileName, NSString *sandboxProfileDirectoryPath)
+{
+    NSString *profilePath = [sandboxProfileDirectoryPath stringByAppendingPathComponent:profileName];
+    NSString *profileString = [NSString stringWithContentsOfFile:profilePath encoding:NSUTF8StringEncoding error:NULL];
+    if (!profileString)
+        return String();
+
+    return makeString(pluginSandboxCommonProfile(), String(profileString));
+}
+
+String pluginSandboxProfile(const String&amp; bundleIdentifier)
+{
+    if (bundleIdentifier.isEmpty())
+        return String();
+
+    NSString *profileName = pluginSandboxProfileName(bundleIdentifier);
+
+    for (NSString *directory in pluginSandboxProfileDirectories()) {
+        String sandboxProfile = pluginSandboxProfileForDirectory(profileName, directory);
+        if (!sandboxProfile.isEmpty())
+            return sandboxProfile;
+    }
+
+    return String();
+}
+
+static bool pluginHasSandboxProfileForDirectory(NSString *profileName, NSString *sandboxProfileDirectoryPath)
+{
+    NSString *profilePath = [sandboxProfileDirectoryPath stringByAppendingPathComponent:profileName];
+    return [[NSFileManager defaultManager] fileExistsAtPath:profilePath];
+}
+
+bool pluginHasSandboxProfile(const String&amp; bundleIdentifier)
+{
+    if (bundleIdentifier.isEmpty())
+        return false;
+
+    NSString *profileName = pluginSandboxProfileName(bundleIdentifier);
+
+    for (NSString *directory in pluginSandboxProfileDirectories()) {
+        if (pluginHasSandboxProfileForDirectory(profileName, directory))
+            return true;
+    }
+    
+    return false;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h (149764 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h        2013-05-08 20:45:01 UTC (rev 149764)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -53,6 +53,9 @@
</span><span class="cx"> /* Value type: WKBooleanRef */
</span><span class="cx"> WK_EXPORT WKStringRef WKPlugInInfoUpdatePastLastBlockedVersionIsKnownAvailableKey();
</span><span class="cx"> 
</span><ins>+/* Value type: WKBooleanRef */
+WK_EXPORT WKStringRef WKPlugInInfoIsSandboxedKey();
+
</ins><span class="cx"> WK_EXPORT WKDictionaryRef WKContextCopyPlugInInfoForBundleIdentifier(WKContextRef context, WKStringRef plugInBundleIdentifier);
</span><span class="cx"> 
</span><span class="cx"> typedef void (^WKContextGetInfoForInstalledPlugInsBlock)(WKArrayRef, WKErrorRef);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm (149764 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm        2013-05-08 20:45:01 UTC (rev 149764)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #import &quot;ImmutableArray.h&quot;
</span><span class="cx"> #import &quot;ImmutableDictionary.h&quot;
</span><span class="cx"> #import &quot;PluginInfoStore.h&quot;
</span><ins>+#import &quot;PluginSandboxProfile.h&quot;
</ins><span class="cx"> #import &quot;StringUtilities.h&quot;
</span><span class="cx"> #import &quot;WKAPICast.h&quot;
</span><span class="cx"> #import &quot;WKSharedAPICast.h&quot;
</span><span class="lines">@@ -87,6 +88,12 @@
</span><span class="cx">     return toAPI(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WKStringRef WKPlugInInfoIsSandboxedKey()
+{
+    static WebString* key = WebString::createFromUTF8String(&quot;WKPlugInInfoIsSandboxed&quot;).leakRef();
+    return toAPI(key);
+}
+
</ins><span class="cx"> static PassRefPtr&lt;ImmutableDictionary&gt; createInfoDictionary(const PluginModuleInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     ImmutableDictionary::MapType map;
</span><span class="lines">@@ -95,6 +102,7 @@
</span><span class="cx">     map.set(toWTFString(WKPlugInInfoVersionKey()), WebString::create(info.versionString));
</span><span class="cx">     map.set(toWTFString(WKPlugInInfoLoadPolicyKey()), WebUInt64::create(toWKPluginLoadPolicy(PluginInfoStore::policyForPlugin(info))));
</span><span class="cx">     map.set(toWTFString(WKPlugInInfoUpdatePastLastBlockedVersionIsKnownAvailableKey()), WebBoolean::create(WKIsPluginUpdateAvailable(nsStringFromWebCoreString(info.bundleIdentifier))));
</span><ins>+    map.set(toWTFString(WKPlugInInfoIsSandboxedKey()), WebBoolean::create(pluginHasSandboxProfile(info.bundleIdentifier)));
</ins><span class="cx"> 
</span><span class="cx">     return ImmutableDictionary::adopt(map);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (149764 => 149765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-05-08 20:45:01 UTC (rev 149764)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-05-08 20:48:58 UTC (rev 149765)
</span><span class="lines">@@ -580,6 +580,8 @@
</span><span class="cx">                 7CB16FF21724BA28007A0A95 /* com.macromedia.Flash Player.plugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE51724B9B5007A0A95 /* com.macromedia.Flash Player.plugin.sb */; };
</span><span class="cx">                 7CB16FF31724BA2F007A0A95 /* com.microsoft.SilverlightPlugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE61724B9B5007A0A95 /* com.microsoft.SilverlightPlugin.sb */; };
</span><span class="cx">                 7CB16FF41724BA30007A0A95 /* com.oracle.java.JavaAppletPlugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7CB16FE71724B9B5007A0A95 /* com.oracle.java.JavaAppletPlugin.sb */; };
</span><ins>+                7CD622771739D863005BD7FF /* PluginSandboxProfile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CD622751739D863005BD7FF /* PluginSandboxProfile.mm */; };
+                7CD622781739D863005BD7FF /* PluginSandboxProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD622761739D863005BD7FF /* PluginSandboxProfile.h */; };
</ins><span class="cx">                 7CF47FF617275B71008ACB91 /* WKBundlePageBanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CF47FF417275B71008ACB91 /* WKBundlePageBanner.cpp */; };
</span><span class="cx">                 7CF47FF717275B71008ACB91 /* WKBundlePageBanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FF517275B71008ACB91 /* WKBundlePageBanner.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FF917275C57008ACB91 /* PageBanner.h */; };
</span><span class="lines">@@ -2054,6 +2056,8 @@
</span><span class="cx">                 7CB16FE51724B9B5007A0A95 /* com.macromedia.Flash Player.plugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = &quot;com.macromedia.Flash Player.plugin.sb&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CB16FE61724B9B5007A0A95 /* com.microsoft.SilverlightPlugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.microsoft.SilverlightPlugin.sb; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CB16FE71724B9B5007A0A95 /* com.oracle.java.JavaAppletPlugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.oracle.java.JavaAppletPlugin.sb; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7CD622751739D863005BD7FF /* PluginSandboxProfile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginSandboxProfile.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7CD622761739D863005BD7FF /* PluginSandboxProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginSandboxProfile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7CF47FF417275B71008ACB91 /* WKBundlePageBanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundlePageBanner.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CF47FF517275B71008ACB91 /* WKBundlePageBanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageBanner.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CF47FF917275C57008ACB91 /* PageBanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageBanner.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3171,6 +3175,8 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */,
</span><ins>+                                7CD622751739D863005BD7FF /* PluginSandboxProfile.mm */,
+                                7CD622761739D863005BD7FF /* PluginSandboxProfile.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -5581,6 +5587,7 @@
</span><span class="cx">                                 909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */,
</span><span class="cx">                                 BCF69FA21176D01400471A52 /* WebNavigationData.h in Headers */,
</span><span class="cx">                                 BCF69F9A1176CED600471A52 /* WebNavigationDataStore.h in Headers */,
</span><ins>+                                7CD622781739D863005BD7FF /* PluginSandboxProfile.h in Headers */,
</ins><span class="cx">                                 31A2EC49148997C200810D71 /* WebNotification.h in Headers */,
</span><span class="cx">                                 310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */,
</span><span class="cx">                                 31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */,
</span><span class="lines">@@ -6589,6 +6596,7 @@
</span><span class="cx">                                 1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */,
</span><span class="cx">                                 1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */,
</span><span class="cx">                                 BCE0937714FB128C001138D9 /* LayerHostingContext.mm in Sources */,
</span><ins>+                                7CD622771739D863005BD7FF /* PluginSandboxProfile.mm in Sources */,
</ins><span class="cx">                                 1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */,
</span><span class="cx">                                 1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */,
</span><span class="cx">                                 1A97E07716A5F9E0000BC9E5 /* LayerTreeHostMac.mm in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>