Commit c3a561b4 authored by andersca@apple.com's avatar andersca@apple.com

WebCore:

2008-04-25  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Add and honor offlineWebApplicationCacheEnabled setting.
        
        * WebCore.base.exp:
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::scheduleApplicationCacheLoad):
        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::load):
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::selectCache):
        (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        (WebCore::Settings::setOfflineWebApplicationCacheEnabled):
        * page/Settings.h:
        (WebCore::Settings::offlineWebApplicationCacheEnabled):

WebKit/mac:

2008-04-25  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Add offlineWebApplicationCacheEnabled preference.
        
        * WebView/WebPreferenceKeysPrivate.h:
        * WebView/WebPreferences.m:
        (+[WebPreferences initialize]):
        (-[WebPreferences offlineWebApplicationCacheEnabled]):
        (-[WebPreferences setOfflineWebApplicationCacheEnabled:]):
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _updateSettingsFromPreferences:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83b826c1
2008-04-25 Anders Carlsson <andersca@apple.com>
Reviewed by Sam.
Add and honor offlineWebApplicationCacheEnabled setting.
* WebCore.base.exp:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::scheduleApplicationCacheLoad):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::load):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setOfflineWebApplicationCacheEnabled):
* page/Settings.h:
(WebCore::Settings::offlineWebApplicationCacheEnabled):
2008-04-25 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
......@@ -557,6 +557,7 @@ __ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
__ZN7WebCore8Settings29setWebArchiveDebugModeEnabledEb
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
__ZN7WebCore8Settings36setOfflineWebApplicationCacheEnabledEb
__ZN7WebCore8Settings40setJavaScriptCanOpenWindowsAutomaticallyEb
__ZN7WebCore8Settings41setNeedsKeyboardEventDisambiguationQuirksEb
__ZN7WebCore8Settings41setUsesDashboardBackwardCompatibilityModeEb
......
......@@ -858,6 +858,9 @@ ApplicationCache* DocumentLoader::mainResourceApplicationCache() const
bool DocumentLoader::scheduleApplicationCacheLoad(ResourceLoader* loader, const ResourceRequest& request, const KURL& originalURL)
{
if (!frameLoader()->frame()->settings() || !frameLoader()->frame()->offlineWebApplicationCacheEnabled())
return false;
if (request.url() != originalURL)
return false;
......
......@@ -41,6 +41,7 @@
#include "HTMLFormElement.h"
#include "ResourceError.h"
#include "ResourceHandle.h"
#include "Settings.h"
// FIXME: More that is in common with SubresourceLoader should move up into ResourceLoader.
......@@ -408,7 +409,7 @@ bool MainResourceLoader::load(const ResourceRequest& r, const SubstituteData& su
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
// Check if this request should be loaded from the application cache
if (!m_substituteData.isValid()) {
if (!m_substituteData.isValid() && frameLoader()->frame()->settings() && frameLoader()->frame()->settings()->offlineWebApplicationCacheEnabled()) {
ASSERT(!m_applicationCache);
m_applicationCache = frameLoader()->documentLoader()->topLevelApplicationCache();
......
......@@ -38,6 +38,7 @@
#include "MainResourceLoader.h"
#include "ManifestParser.h"
#include "Page.h"
#include "Settings.h"
#include <wtf/HashMap.h>
namespace WebCore {
......@@ -111,6 +112,9 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& manifestURL)
{
ASSERT(frame && frame->page());
if (!frame->settings()->offlineWebApplicationCacheEnabled())
return;
DocumentLoader* documentLoader = frame->loader()->documentLoader();
ASSERT(!documentLoader->applicationCache());
......@@ -215,6 +219,9 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& manifestURL)
void ApplicationCacheGroup::selectCacheWithoutManifestURL(Frame* frame)
{
if (!frame->settings()->offlineWebApplicationCacheEnabled())
return;
DocumentLoader* documentLoader = frame->loader()->documentLoader();
ASSERT(!documentLoader->applicationCache());
......
......@@ -72,6 +72,7 @@ Settings::Settings(Page* page)
, m_needsSiteSpecificQuirks(false)
, m_fontRenderingMode(0)
, m_webArchiveDebugModeEnabled(false)
, m_offlineWebApplicationCacheEnabled(false)
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
......@@ -334,4 +335,10 @@ void Settings::setLocalStorageDatabasePath(const String& path)
m_localStorageDatabasePath = path;
}
void Settings::setOfflineWebApplicationCacheEnabled(bool enabled)
{
m_offlineWebApplicationCacheEnabled = enabled;
}
} // namespace WebCore
......@@ -155,6 +155,8 @@ namespace WebCore {
void setLocalStorageDatabasePath(const String&);
const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; }
void setOfflineWebApplicationCacheEnabled(bool);
bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; }
private:
Page* m_page;
......@@ -194,6 +196,7 @@ namespace WebCore {
bool m_needsSiteSpecificQuirks : 1;
unsigned m_fontRenderingMode : 1;
bool m_webArchiveDebugModeEnabled : 1;
bool m_offlineWebApplicationCacheEnabled : 1;
};
} // namespace WebCore
......
2008-04-25 Anders Carlsson <andersca@apple.com>
Reviewed by Sam.
Add offlineWebApplicationCacheEnabled preference.
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.m:
(+[WebPreferences initialize]):
(-[WebPreferences offlineWebApplicationCacheEnabled]):
(-[WebPreferences setOfflineWebApplicationCacheEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _updateSettingsFromPreferences:]):
2008-04-24 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
......
......@@ -66,6 +66,7 @@
#define WebKitAuthorAndUserStylesEnabledPreferenceKey @"WebKitAuthorAndUserStylesEnabledPreferenceKey"
#define WebKitWebArchiveDebugModeEnabledPreferenceKey @"WebKitWebArchiveDebugModeEnabledPreferenceKey"
#define WebKitLocalStorageDatabasePathPreferenceKey @"WebKitLocalStorageDatabasePathPreferenceKey"
#define WebKitOfflineWebApplicationCacheEnabledPreferenceKey @"WebKitOfflineWebApplicationCacheEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
......
......@@ -333,6 +333,7 @@ + (void)initialize
[NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebArchiveDebugModeEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
......@@ -766,6 +767,16 @@ - (void)setWebArchiveDebugModeEnabled:(BOOL)flag
[self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
}
- (BOOL)offlineWebApplicationCacheEnabled
{
return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
}
- (void)setOfflineWebApplicationCacheEnabled:(BOOL)flag
{
[self _setBoolValue:flag forKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
}
- (BOOL)respectStandardStyleKeyEquivalents
{
return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
......
......@@ -71,6 +71,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)webArchiveDebugModeEnabled;
- (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled;
- (BOOL)offlineWebApplicationCacheEnabled;
- (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled;
// zero means do AutoScale
- (float)PDFScaleFactor;
- (void)setPDFScaleFactor:(float)scale;
......
......@@ -981,6 +981,7 @@ static bool debugWidget = true;
settings->setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]);
settings->setNeedsSiteSpecificQuirks(_private->useSiteSpecificSpoofing);
settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]);
settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]);
}
- (void)_preferencesChangedNotification:(NSNotification *)notification
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment