<!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>[198040] trunk/Source/WebCore</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/198040">198040</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-03-11 12:26:09 -0800 (Fri, 11 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
https://bugs.webkit.org/show_bug.cgi?id=155256

Reviewed by Alexey Proskuryakov.

<a href="http://trac.webkit.org/projects/webkit/changeset/197628">r197628</a> consolidated the runtime application checking code for iOS and
Mac. However, while the new code works fine for WebKit2, it is unsafe
on WebKit1 / iOS and hits assertion in debug. The reason is that
applicationBundleIdentifier() for getting called from several threads
(WebThread, UIThread).

To address the problem, this patch renames applicationBundleIdentifier()
to applicationBundleIdentifierOverride() and only initializes the
override upon WebProcess and Network process initialization. We therefore
do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
When the override is not set, we fall back to using the main bundle
identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
but without caching it to avoid thread safety issues.

No new tests, already covered by API tests currently crashing.

* platform/RuntimeApplicationChecks.mm:
(WebCore::applicationBundleIdentifierOverride):
- Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
  and only initialize upon initialization of the WebProcess or the Network
  process.
- In debug, set a flag to indicate that the override was already queried.

(WebCore::applicationBundleIdentifier):
New utility function that is returns the application bundle override if it is
set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.

(WebCore::setApplicationBundleIdentifier):
Add assertions to make sure that:
1. This is always called from the main thread.
2. The application bundle identifier has not been queried *before* getting
   overriden as this would indicate a bug in our code and we would have wrongly
   returned the main bundle identifier in such case.

(WebCore::MacApplication::isAppleMail):
(WebCore::MacApplication::isIBooks):
(WebCore::MacApplication::isITunes):
(WebCore::MacApplication::isMicrosoftMessenger):
(WebCore::MacApplication::isAdobeInstaller):
(WebCore::MacApplication::isMicrosoftOutlook):
(WebCore::MacApplication::isQuickenEssentials):
(WebCore::MacApplication::isAperture):
(WebCore::MacApplication::isVersions):
(WebCore::MacApplication::isHRBlock):
(WebCore::MacApplication::isHipChat):
(WebCore::IOSApplication::isMobileSafari):
(WebCore::IOSApplication::isDumpRenderTree):
(WebCore::IOSApplication::isMobileStore):
(WebCore::IOSApplication::isFacebook):
(WebCore::IOSApplication::isDaijisenDictionary):
(WebCore::IOSApplication::isNASAHD):
(WebCore::IOSApplication::isTheEconomistOnIphone):
(WebCore::IOSApplication::isWebProcess):
(WebCore::IOSApplication::isIBooks):
Drop assertions making sure the cached flag is correct. We now have
an assertion to detect this earlier in setApplicationBundleIdentifier().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformRuntimeApplicationChecksmm">trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198039 => 198040)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-11 20:04:14 UTC (rev 198039)
+++ trunk/Source/WebCore/ChangeLog        2016-03-11 20:26:09 UTC (rev 198040)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2016-03-11  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
+        https://bugs.webkit.org/show_bug.cgi?id=155256
+
+        Reviewed by Alexey Proskuryakov.
+
+        r197628 consolidated the runtime application checking code for iOS and
+        Mac. However, while the new code works fine for WebKit2, it is unsafe
+        on WebKit1 / iOS and hits assertion in debug. The reason is that
+        applicationBundleIdentifier() for getting called from several threads
+        (WebThread, UIThread).
+
+        To address the problem, this patch renames applicationBundleIdentifier()
+        to applicationBundleIdentifierOverride() and only initializes the
+        override upon WebProcess and Network process initialization. We therefore
+        do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
+        When the override is not set, we fall back to using the main bundle
+        identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
+        but without caching it to avoid thread safety issues.
+
+        No new tests, already covered by API tests currently crashing.
+
+        * platform/RuntimeApplicationChecks.mm:
+        (WebCore::applicationBundleIdentifierOverride):
+        - Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
+          and only initialize upon initialization of the WebProcess or the Network
+          process.
+        - In debug, set a flag to indicate that the override was already queried.
+
+        (WebCore::applicationBundleIdentifier):
+        New utility function that is returns the application bundle override if it is
+        set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.
+
+        (WebCore::setApplicationBundleIdentifier):
+        Add assertions to make sure that:
+        1. This is always called from the main thread.
+        2. The application bundle identifier has not been queried *before* getting
+           overriden as this would indicate a bug in our code and we would have wrongly
+           returned the main bundle identifier in such case.
+
+        (WebCore::MacApplication::isAppleMail):
+        (WebCore::MacApplication::isIBooks):
+        (WebCore::MacApplication::isITunes):
+        (WebCore::MacApplication::isMicrosoftMessenger):
+        (WebCore::MacApplication::isAdobeInstaller):
+        (WebCore::MacApplication::isMicrosoftOutlook):
+        (WebCore::MacApplication::isQuickenEssentials):
+        (WebCore::MacApplication::isAperture):
+        (WebCore::MacApplication::isVersions):
+        (WebCore::MacApplication::isHRBlock):
+        (WebCore::MacApplication::isHipChat):
+        (WebCore::IOSApplication::isMobileSafari):
+        (WebCore::IOSApplication::isDumpRenderTree):
+        (WebCore::IOSApplication::isMobileStore):
+        (WebCore::IOSApplication::isFacebook):
+        (WebCore::IOSApplication::isDaijisenDictionary):
+        (WebCore::IOSApplication::isNASAHD):
+        (WebCore::IOSApplication::isTheEconomistOnIphone):
+        (WebCore::IOSApplication::isWebProcess):
+        (WebCore::IOSApplication::isIBooks):
+        Drop assertions making sure the cached flag is correct. We now have
+        an assertion to detect this earlier in setApplicationBundleIdentifier().
+
</ins><span class="cx"> 2016-03-10  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Audio becomes distorted after sample rate changes
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformRuntimeApplicationChecksmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm (198039 => 198040)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm        2016-03-11 20:04:14 UTC (rev 198039)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm        2016-03-11 20:26:09 UTC (rev 198040)
</span><span class="lines">@@ -33,22 +33,34 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !ASSERT_MSG_DISABLED
+static bool applicationBundleIdentifierOverrideWasQueried = false;
+#endif
+
</ins><span class="cx"> // The application bundle identifier gets set to the UIProcess bundle identifier by the WebProcess and
</span><del>-// the networking process upon initialization.
-// If not explicitly set, this will return the main bundle identifier which is accurate for WK1 or
-// the WK2 UIProcess.
-static String&amp; applicationBundleIdentifier()
</del><ins>+// the Networking upon initialization. It is unset otherwise.
+static String&amp; applicationBundleIdentifierOverride()
</ins><span class="cx"> {
</span><del>-    ASSERT(RunLoop::isMain());
-
-    static NeverDestroyed&lt;String&gt; identifier([[NSBundle mainBundle] bundleIdentifier]);
-
</del><ins>+    static NeverDestroyed&lt;String&gt; identifier;
+#if !ASSERT_MSG_DISABLED
+    applicationBundleIdentifierOverrideWasQueried = true;
+#endif
</ins><span class="cx">     return identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static String applicationBundleIdentifier()
+{
+    // The override only gets set in WebKit2's WebProcess and NetworkProcess. If unset, we use the main bundle identifier.
+    const auto&amp; identifier = applicationBundleIdentifierOverride();
+    ASSERT(identifier.isNull() || RunLoop::isMain());
+    return identifier.isNull() ? String([[NSBundle mainBundle] bundleIdentifier]) : identifier;
+}
+
</ins><span class="cx"> void setApplicationBundleIdentifier(const String&amp; bundleIdentifier)
</span><span class="cx"> {
</span><del>-    applicationBundleIdentifier() = bundleIdentifier;
</del><ins>+    ASSERT(RunLoop::isMain());
+    ASSERT_WITH_MESSAGE(!applicationBundleIdentifierOverrideWasQueried, &quot;applicationBundleIsEqualTo() should not be called before setApplicationBundleIdentifier()&quot;);
+    applicationBundleIdentifierOverride() = bundleIdentifier;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool applicationBundleIsEqualTo(const String&amp; bundleIdentifierString)
</span><span class="lines">@@ -61,106 +73,90 @@
</span><span class="cx"> bool MacApplication::isSafari()
</span><span class="cx"> {
</span><span class="cx">     static bool isSafari = applicationBundleIsEqualTo(&quot;com.apple.Safari&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isSafari == applicationBundleIsEqualTo(&quot;com.apple.Safari&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isSafari;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isAppleMail()
</span><span class="cx"> {
</span><span class="cx">     static bool isAppleMail = applicationBundleIsEqualTo(&quot;com.apple.mail&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isAppleMail == applicationBundleIsEqualTo(&quot;com.apple.mail&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isAppleMail;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isIBooks()
</span><span class="cx"> {
</span><span class="cx">     static bool isIBooks = applicationBundleIsEqualTo(&quot;com.apple.iBooksX&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isIBooks == applicationBundleIsEqualTo(&quot;com.apple.iBooksX&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isIBooks;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isITunes()
</span><span class="cx"> {
</span><span class="cx">     static bool isITunes = applicationBundleIsEqualTo(&quot;com.apple.iTunes&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isITunes == applicationBundleIsEqualTo(&quot;com.apple.iTunes&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isITunes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isMicrosoftMessenger()
</span><span class="cx"> {
</span><span class="cx">     static bool isMicrosoftMessenger = applicationBundleIsEqualTo(&quot;com.microsoft.Messenger&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMicrosoftMessenger == applicationBundleIsEqualTo(&quot;com.microsoft.Messenger&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMicrosoftMessenger;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isAdobeInstaller()
</span><span class="cx"> {
</span><span class="cx">     static bool isAdobeInstaller = applicationBundleIsEqualTo(&quot;com.adobe.Installers.Setup&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isAdobeInstaller == applicationBundleIsEqualTo(&quot;com.adobe.Installers.Setup&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isAdobeInstaller;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isAOLInstantMessenger()
</span><span class="cx"> {
</span><span class="cx">     static bool isAOLInstantMessenger = applicationBundleIsEqualTo(&quot;com.aol.aim.desktop&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isAOLInstantMessenger == applicationBundleIsEqualTo(&quot;com.aol.aim.desktop&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isAOLInstantMessenger;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isMicrosoftMyDay()
</span><span class="cx"> {
</span><span class="cx">     static bool isMicrosoftMyDay = applicationBundleIsEqualTo(&quot;com.microsoft.myday&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMicrosoftMyDay == applicationBundleIsEqualTo(&quot;com.microsoft.myday&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMicrosoftMyDay;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isMicrosoftOutlook()
</span><span class="cx"> {
</span><span class="cx">     static bool isMicrosoftOutlook = applicationBundleIsEqualTo(&quot;com.microsoft.Outlook&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMicrosoftOutlook == applicationBundleIsEqualTo(&quot;com.microsoft.Outlook&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMicrosoftOutlook;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isQuickenEssentials()
</span><span class="cx"> {
</span><span class="cx">     static bool isQuickenEssentials = applicationBundleIsEqualTo(&quot;com.intuit.QuickenEssentials&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isQuickenEssentials == applicationBundleIsEqualTo(&quot;com.intuit.QuickenEssentials&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isQuickenEssentials;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isAperture()
</span><span class="cx"> {
</span><span class="cx">     static bool isAperture = applicationBundleIsEqualTo(&quot;com.apple.Aperture&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isAperture == applicationBundleIsEqualTo(&quot;com.apple.Aperture&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isAperture;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isVersions()
</span><span class="cx"> {
</span><span class="cx">     static bool isVersions = applicationBundleIsEqualTo(&quot;com.blackpixel.versions&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isVersions == applicationBundleIsEqualTo(&quot;com.blackpixel.versions&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isVersions;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isHRBlock()
</span><span class="cx"> {
</span><span class="cx">     static bool isHRBlock = applicationBundleIsEqualTo(&quot;com.hrblock.tax.2010&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isHRBlock == applicationBundleIsEqualTo(&quot;com.hrblock.tax.2010&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isHRBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isSolidStateNetworksDownloader()
</span><span class="cx"> {
</span><span class="cx">     static bool isSolidStateNetworksDownloader = applicationBundleIsEqualTo(&quot;com.solidstatenetworks.awkhost&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isSolidStateNetworksDownloader == applicationBundleIsEqualTo(&quot;com.solidstatenetworks.awkhost&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
-
</del><span class="cx">     return isSolidStateNetworksDownloader;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MacApplication::isHipChat()
</span><span class="cx"> {
</span><span class="cx">     static bool isHipChat = applicationBundleIsEqualTo(&quot;com.hipchat.HipChat&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isHipChat == applicationBundleIsEqualTo(&quot;com.hipchat.HipChat&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isHipChat;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -171,14 +167,12 @@
</span><span class="cx"> bool IOSApplication::isMobileMail()
</span><span class="cx"> {
</span><span class="cx">     static bool isMobileMail = applicationBundleIsEqualTo(&quot;com.apple.mobilemail&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMobileMail == applicationBundleIsEqualTo(&quot;com.apple.mobilemail&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMobileMail;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isMobileSafari()
</span><span class="cx"> {
</span><span class="cx">     static bool isMobileSafari = applicationBundleIsEqualTo(&quot;com.apple.mobilesafari&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMobileSafari == applicationBundleIsEqualTo(&quot;com.apple.mobilesafari&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMobileSafari;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -187,56 +181,48 @@
</span><span class="cx">     // We use a prefix match instead of strict equality since LayoutTestRelay may launch multiple instances of
</span><span class="cx">     // DumpRenderTree where the bundle identifier of each instance has a unique suffix.
</span><span class="cx">     static bool isDumpRenderTree = applicationBundleIsEqualTo(&quot;org.webkit.DumpRenderTree&quot;); // e.g. org.webkit.DumpRenderTree0
</span><del>-    ASSERT_WITH_MESSAGE(isDumpRenderTree == applicationBundleIsEqualTo(&quot;org.webkit.DumpRenderTree&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isDumpRenderTree;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isMobileStore()
</span><span class="cx"> {
</span><span class="cx">     static bool isMobileStore = applicationBundleIsEqualTo(&quot;com.apple.MobileStore&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isMobileStore == applicationBundleIsEqualTo(&quot;com.apple.MobileStore&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isMobileStore;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isWebApp()
</span><span class="cx"> {
</span><span class="cx">     static bool isWebApp = applicationBundleIsEqualTo(&quot;com.apple.webapp&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isWebApp == applicationBundleIsEqualTo(&quot;com.apple.webapp&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isWebApp;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isOkCupid()
</span><span class="cx"> {
</span><span class="cx">     static bool isOkCupid = applicationBundleIsEqualTo(&quot;com.okcupid.app&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isOkCupid == applicationBundleIsEqualTo(&quot;com.okcupid.app&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isOkCupid;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isFacebook()
</span><span class="cx"> {
</span><span class="cx">     static bool isFacebook = applicationBundleIsEqualTo(&quot;com.facebook.Facebook&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isFacebook == applicationBundleIsEqualTo(&quot;com.facebook.Facebook&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isFacebook;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isDaijisenDictionary()
</span><span class="cx"> {
</span><span class="cx">     static bool isDaijisenDictionary = applicationBundleIsEqualTo(&quot;jp.co.shogakukan.daijisen2009i&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isDaijisenDictionary == applicationBundleIsEqualTo(&quot;jp.co.shogakukan.daijisen2009i&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isDaijisenDictionary;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isNASAHD()
</span><span class="cx"> {
</span><span class="cx">     static bool isNASAHD = applicationBundleIsEqualTo(&quot;gov.nasa.NASAHD&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isNASAHD == applicationBundleIsEqualTo(&quot;gov.nasa.NASAHD&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isNASAHD;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IOSApplication::isTheEconomistOnIphone()
</span><span class="cx"> {
</span><span class="cx">     static bool isTheEconomistOnIphone = applicationBundleIsEqualTo(&quot;com.economist.iphone&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isTheEconomistOnIphone == applicationBundleIsEqualTo(&quot;com.economist.iphone&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isTheEconomistOnIphone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -252,7 +238,6 @@
</span><span class="cx"> bool IOSApplication::isIBooks()
</span><span class="cx"> {
</span><span class="cx">     static bool isIBooks = applicationBundleIsEqualTo(&quot;com.apple.iBooks&quot;);
</span><del>-    ASSERT_WITH_MESSAGE(isIBooks == applicationBundleIsEqualTo(&quot;com.apple.iBooks&quot;), &quot;Should not be called before setApplicationBundleIdentifier()&quot;);
</del><span class="cx">     return isIBooks;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>