REGRESSION (r119759): Adobe Flash Player "smaller" installer relies on the incorrect...
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 20:50:03 +0000 (20:50 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 20:50:03 +0000 (20:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117042
<rdar://problem/13916291>

Reviewed by Mark Rowe.

Ignore HTTP errors for scripts requested from within the installer. Instead of just checking for the
Adobe Flash installer, we use the "com.solidstatenetworks.awkhost" bundle identifier to determine
whether to apply the workaround. This could in theory fix other installers that use the same mechanism.

* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
* loader/cache/CachedScript.h:
* platform/RuntimeApplicationChecks.cpp:
(WebCore::applicationIsSolidStateNetworksDownloader):
* platform/RuntimeApplicationChecks.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedScript.cpp
Source/WebCore/loader/cache/CachedScript.h
Source/WebCore/platform/RuntimeApplicationChecks.cpp
Source/WebCore/platform/RuntimeApplicationChecks.h

index 4697f05..f99368f 100644 (file)
@@ -1,3 +1,22 @@
+2013-05-30  Anders Carlsson  <andersca@apple.com>
+
+        REGRESSION (r119759): Adobe Flash Player "smaller" installer relies on the incorrect firing of a load event and needs an app-specific hack for compatibility
+        https://bugs.webkit.org/show_bug.cgi?id=117042
+        <rdar://problem/13916291>
+
+        Reviewed by Mark Rowe.
+
+        Ignore HTTP errors for scripts requested from within the installer. Instead of just checking for the
+        Adobe Flash installer, we use the "com.solidstatenetworks.awkhost" bundle identifier to determine
+        whether to apply the workaround. This could in theory fix other installers that use the same mechanism.
+
+        * loader/cache/CachedScript.cpp:
+        (WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
+        * loader/cache/CachedScript.h:
+        * platform/RuntimeApplicationChecks.cpp:
+        (WebCore::applicationIsSolidStateNetworksDownloader):
+        * platform/RuntimeApplicationChecks.h:
+
 2013-05-30  Sergio Villar Senin  <svillar@igalia.com>
 
         Allow no space between "background-position:" dimensions
index ea20c6d..198dd65 100644 (file)
@@ -33,6 +33,7 @@
 #include "MIMETypeRegistry.h"
 #include "MemoryCache.h"
 #include "ResourceBuffer.h"
+#include "RuntimeApplicationChecks.h"
 #include "TextResourceDecoder.h"
 #include <wtf/Vector.h>
 
@@ -107,4 +108,18 @@ bool CachedScript::mimeTypeAllowedByNosniff() const
 }
 #endif
 
+bool CachedScript::shouldIgnoreHTTPStatusCodeErrors() const
+{
+    // This is a workaround for <rdar://problem/13916291>
+    // REGRESSION (r119759): Adobe Flash Player "smaller" installer relies on the incorrect firing
+    // of a load event and needs an app-specific hack for compatibility.
+    // The installer in question tries to load .js file that doesn't exist, causing the server to
+    // return a 404 response. Normally, this would trigger an error event to be dispatched, but the
+    // installer expects a load event instead so we work around it here.
+    if (applicationIsSolidStateNetworksDownloader())
+        return true;
+
+    return CachedResource::shouldIgnoreHTTPStatusCodeErrors();
+}
+
 } // namespace WebCore
index 5a23816..5d8b27e 100644 (file)
@@ -54,6 +54,8 @@ namespace WebCore {
         virtual PurgePriority purgePriority() const { return PurgeLast; }
         virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 
+        virtual bool shouldIgnoreHTTPStatusCodeErrors() const OVERRIDE;
+
         String m_script;
         RefPtr<TextResourceDecoder> m_decoder;
     };
index 90c81df..178949f 100644 (file)
@@ -108,4 +108,10 @@ bool applicationIsVersions()
     return isVersions;
 }
 
+bool applicationIsSolidStateNetworksDownloader()
+{
+    static bool isSolidStateNetworksDownloader = mainBundleIsEqualTo("com.solidstatenetworks.awkhost");
+    return isSolidStateNetworksDownloader;
+}
+
 } // namespace WebCore
index 032a546..2ff49a7 100644 (file)
@@ -36,6 +36,7 @@ bool applicationIsMicrosoftMessenger();
 bool applicationIsMicrosoftMyDay();
 bool applicationIsMicrosoftOutlook();
 bool applicationIsSafari();
+bool applicationIsSolidStateNetworksDownloader();
 bool applicationIsVersions();
 
 } // namespace WebCore