part of <rdar://problem/8675177>
Move Quicklook quirk down into WebCore so it can be caculated when the user
starts a reload. Restructure the conditions so it only called when absolutely
necessary.
Reviewed by Brady Eidson.
No change in functionality so no new tests.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
* platform/network/cf/ResourceRequest.h:
* platform/network/mac/ResourceRequestMac.mm:
(WebCore::initQuickLookResourceCachingQuirks):
(WebCore::ResourceRequest::useQuickLookResourceCachingQuirks):
Source/WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=61407
part of <rdar://problem/8675177>
Remove Quicklook pref. Moving it enirely down into WebCore so it can
be calculated only on reloads.
Reviewed by Brady Eidson.
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87329
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-05-25 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=61407
+ part of <rdar://problem/8675177>
+ Move Quicklook quirk down into WebCore so it can be caculated when the user
+ starts a reload. Restructure the conditions so it only called when absolutely
+ necessary.
+
+ No change in functionality so no new tests.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::subresourceCachePolicy):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+ * platform/network/cf/ResourceRequest.h:
+ * platform/network/mac/ResourceRequestMac.mm:
+ (WebCore::initQuickLookResourceCachingQuirks):
+ (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks):
+
2011-05-24 Jer Noble <jer.noble@apple.com>
Reviewed by Darin Adler.
if (parentCachePolicy != CachePolicyVerify)
return parentCachePolicy;
}
-
- const ResourceRequest& request(documentLoader()->request());
- Settings* settings = m_frame->settings();
- if (settings && settings->useQuickLookResourceCachingQuirks() && request.cachePolicy() == ReloadIgnoringCacheData && !equalIgnoringCase(request.httpMethod(), "post"))
+
+ if (m_loadType == FrameLoadTypeReload)
return CachePolicyRevalidate;
- if (m_loadType == FrameLoadTypeReload)
+ const ResourceRequest& request(documentLoader()->request());
+#if PLATFORM(MAC)
+ if (request.cachePolicy() == ReloadIgnoringCacheData && !equalIgnoringCase(request.httpMethod(), "post") && ResourceRequest::useQuickLookResourceCachingQuirks())
return CachePolicyRevalidate;
+#endif
if (request.cachePolicy() == ReturnCacheDataElseLoad)
return CachePolicyHistoryBuffer;
, m_usePreHTML5ParserQuirks(false)
, m_hyperlinkAuditingEnabled(false)
, m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
- , m_useQuickLookResourceCachingQuirks(false)
, m_forceCompositingMode(false)
, m_shouldInjectUserScriptsInInitialEmptyDocument(false)
, m_allowDisplayOfInsecureContent(true)
void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
- void setUseQuickLookResourceCachingQuirks(bool flag) { m_useQuickLookResourceCachingQuirks = flag; }
- bool useQuickLookResourceCachingQuirks() const { return m_useQuickLookResourceCachingQuirks; }
-
void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
bool forceCompositingMode() { return m_forceCompositingMode; }
bool m_usePreHTML5ParserQuirks: 1;
bool m_hyperlinkAuditingEnabled : 1;
bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
- bool m_useQuickLookResourceCachingQuirks : 1;
bool m_forceCompositingMode : 1;
bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
bool m_allowDisplayOfInsecureContent : 1;
static bool httpPipeliningEnabled();
static void setHTTPPipeliningEnabled(bool);
+#if PLATFORM(MAC)
+ static bool useQuickLookResourceCachingQuirks();
+#endif
+
private:
friend class ResourceRequestBase;
#import "FormDataStreamMac.h"
#import "ResourceRequestCFNet.h"
+#import "RuntimeApplicationChecks.h"
#import "WebCoreSystemInterface.h"
#import <Foundation/Foundation.h>
}
#endif
+
+static bool initQuickLookResourceCachingQuirks()
+{
+ if (applicationIsSafari())
+ return false;
+
+ NSArray* frameworks = [NSBundle allFrameworks];
+
+ if (!frameworks)
+ return false;
+
+ for (unsigned int i = 0; i < [frameworks count]; i++) {
+ NSBundle* bundle = [frameworks objectAtIndex: i];
+ const char* bundleID = [[bundle bundleIdentifier] UTF8String];
+ if (bundleID && !strcasecmp(bundleID, "com.apple.QuickLookUIFramework"))
+ return true;
+ }
+ return false;
+}
+
+bool ResourceRequest::useQuickLookResourceCachingQuirks()
+{
+ static bool flag = initQuickLookResourceCachingQuirks();
+ return flag;
+}
} // namespace WebCore
+2011-05-25 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=61407
+ part of <rdar://problem/8675177>
+ Remove Quicklook pref. Moving it enirely down into WebCore so it can
+ be calculated only on reloads.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2011-05-24 Jer Noble <jer.noble@apple.com>
Reviewed by Darin Adler.
#define WebKitAsynchronousSpellCheckingEnabledPreferenceKey @"WebKitAsynchronousSpellCheckingEnabled"
#define WebKitMemoryInfoEnabledPreferenceKey @"WebKitMemoryInfoEnabled"
#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
-#define WebKitUseQuickLookResourceCachingQuirksPreferenceKey @"WebKitUseQuickLookResourceCachingQuirks"
#define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
// These are private both because callers should be using the cover methods and because the
return cacheModel;
}
-static bool useQuickLookQuirks(void)
-{
- NSArray* frameworks = [NSBundle allFrameworks];
-
- if (!frameworks)
- return false;
-
- for (unsigned int i = 0; i < [frameworks count]; i++) {
- NSBundle* bundle = [frameworks objectAtIndex: i];
- const char* bundleID = [[bundle bundleIdentifier] UTF8String];
- if (bundleID && !strcasecmp(bundleID, "com.apple.QuickLookUIFramework"))
- return true;
- }
- return false;
-}
-
@interface WebPreferencesPrivate : NSObject
{
@public
[NSNumber numberWithBool:YES], WebKitHyperlinkAuditingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitUsePreHTML5ParserQuirksKey,
[NSNumber numberWithBool:YES], WebKitAVFoundationEnabledKey,
- [NSNumber numberWithBool:useQuickLookQuirks()], WebKitUseQuickLookResourceCachingQuirksPreferenceKey,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
nil];
[self _setBoolValue:flag forKey:WebKitUsePreHTML5ParserQuirksKey];
}
-- (BOOL)useQuickLookResourceCachingQuirks
-{
- return [self _boolValueForKey:WebKitUseQuickLookResourceCachingQuirksPreferenceKey];
-}
-
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
- (void)setUsePreHTML5ParserQuirks:(BOOL)flag;
- (BOOL)usePreHTML5ParserQuirks;
-- (BOOL)useQuickLookResourceCachingQuirks;
-
- (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
- (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
settings->setHyperlinkAuditingEnabled([preferences hyperlinkAuditingEnabled]);
settings->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
- settings->setUseQuickLookResourceCachingQuirks([preferences useQuickLookResourceCachingQuirks]);
settings->setCrossOriginCheckInGetMatchedCSSRulesDisabled([self _needsUnrestrictedGetMatchedCSSRules]);
settings->setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
settings->setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);