diff options
Diffstat (limited to 'WebKit/mac')
37 files changed, 593 insertions, 265 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index bb42e9d..269110f 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,172 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-04 MORITA Hajime <morrita@google.com> + + Reviewed by Tony Chang. + + Pasting should fire textInput event. + https://bugs.webkit.org/show_bug.cgi?id=42958 + + On paste, invoke Editor instead of direct command invocation, + which allows dispatching events before actual paste. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): + +2010-08-06 Yongjun Zhang <yongjun_zhang@apple.com> + + Reviewed by Eric Seidel. + + add "const" to WebChromeClient::webView(). + https://bugs.webkit.org/show_bug.cgi?id=43631 + + Change WebChromeClient::webView() to be const because ChromeClient::didReceiveViewportArguments + is const method now, and calling webView() inside port-specific didReceiveViewportArguments + implementation fails compiling if webView() is not const. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::webView): + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-05 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Remove Invalid Asserts for Application Cache Quotas + https://bugs.webkit.org/show_bug.cgi?id=43585 + + Removed Invalid ASSERTs that would always happen for quotas + that were not noQuota(). + + * WebView/WebPreferences.mm: + (-[WebPreferences applicationCacheTotalQuota]): + (-[WebPreferences applicationCacheDefaultOriginQuota]): + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-05 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Unify blob related feature defines to ENABLE(BLOB). + https://bugs.webkit.org/show_bug.cgi?id=43081 + + * Configurations/FeatureDefines.xcconfig: + +2010-08-03 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 6 - LayoutTest and Cleanup + + * WebCoreSupport/WebApplicationCache.h: + * WebCoreSupport/WebApplicationCache.mm: + (+[WebApplicationCache setMaximumSize:]): refactor out deleting the application caches. + (+[WebApplicationCache deleteAllApplicationCaches]): delete application caches. + +2010-08-03 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 5 - Refactor Quota Management in WebSecurityOrigin into Managers + + Per-Origin quotas exist for Databases and Application Caches. Clients + given a WebSecurityOrigin have the ability to set the quota for any + per-origin quota type. This puts quota management into an interface + and WebSecurityOrigin allows access to quota managers for the + different types of quotas. + + This also deprecates the old methods on WebSecurityOrigin. They are + left in for now to prevent breaking older clients. + + The WebQuotaManager interface allows querying and modifying a + per-origin quota. This is implemented for both Databases and + Application Caches. + + * Misc/WebQuotaManager.h: Added. Interface for quota management (usage, quota, setQuota). + * Storage/WebDatabaseQuotaManager.h: Added. + * Storage/WebDatabaseQuotaManager.mm: Added. + (-[WebDatabaseQuotaManager origin]): + (-[WebDatabaseQuotaManager usage]): + (-[WebDatabaseQuotaManager quota]): + (-[WebDatabaseQuotaManager setQuota:]): + * Storage/WebDatabaseSecurityOrigin.h: Removed. + * Storage/WebDatabaseSecurityOrigin.mm: Removed. + * WebCoreSupport/WebApplicationCacheQuotaManager.h: Added. + * WebCoreSupport/WebApplicationCacheQuotaManager.mm: Added. + (-[WebApplicationCacheQuotaManager origin]): + (-[WebApplicationCacheQuotaManager usage]): + (-[WebApplicationCacheQuotaManager quota]): + (-[WebApplicationCacheQuotaManager setQuota:]): + * WebCoreSupport/WebSecurityOriginPrivate.h: Added a category to access managers. Deprecated old methods. + + Remove the WebSecurityOrigin sub-classes. Managers are better. + + * WebCoreSupport/WebApplicationCacheSecurityOrigin.h: Removed. + * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: Removed. + + Create the managers lazily. Change old style calls to make use + of the managers. + + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::exceededDatabaseQuota): + (WebChromeClient::reachedApplicationCacheOriginQuota): + * WebCoreSupport/WebSecurityOrigin.mm: + (-[WebSecurityOrigin applicationCacheQuotaManager]): + (-[WebSecurityOrigin databaseQuotaManager]): + (-[WebSecurityOrigin dealloc]): release the managers if they exist. + +2010-08-03 Alex Milowski <alex@milowski.com> + + Reviewed by Beth Dakin. + + Changed the ENABLE_MATHML value to enable MathML by default. + + * Configurations/FeatureDefines.xcconfig: + 2010-08-02 Brady Eidson <beidson@apple.com> Reviewed by Anders Carlsson. diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 9810cf7..f2b4c09 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -46,8 +46,8 @@ ENABLE_3D_RENDERING_macosx_1050 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_macosx_1060 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_macosx_1070 = ENABLE_3D_RENDERING; -ENABLE_BLOB_SLICE = $(ENABLE_BLOB_SLICE_$(REAL_PLATFORM_NAME)); -ENABLE_BLOB_SLICE_macosx = ENABLE_BLOB_SLICE; +ENABLE_BLOB = $(ENABLE_BLOB_$(REAL_PLATFORM_NAME)); +ENABLE_BLOB_macosx = ENABLE_BLOB; ENABLE_CHANNEL_MESSAGING = $(ENABLE_CHANNEL_MESSAGING_$(REAL_PLATFORM_NAME)); ENABLE_CHANNEL_MESSAGING_macosx = ENABLE_CHANNEL_MESSAGING; @@ -69,9 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME)); ENABLE_FILTERS_macosx = ENABLE_FILTERS; -ENABLE_FILE_READER = $(ENABLE_FILE_READER_$(REAL_PLATFORM_NAME)); -ENABLE_FILE_READER_macosx = ENABLE_FILE_READER; - ENABLE_FILE_WRITER = ; ENABLE_FILE_SYSTEM = ; ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; @@ -83,7 +80,7 @@ ENABLE_IMAGE_RESIZER = ; ENABLE_INDEXED_DATABASE = ; ENABLE_INPUT_SPEECH = ; ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; -ENABLE_MATHML = ; +ENABLE_MATHML = ENABLE_MATHML; ENABLE_METER_TAG = ENABLE_METER_TAG; ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; @@ -123,4 +120,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index cc30ce9..deb52b6 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 5; +MINOR_VERSION = 6; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/Misc/WebQuotaManager.h b/WebKit/mac/Misc/WebQuotaManager.h new file mode 100644 index 0000000..45074e4 --- /dev/null +++ b/WebKit/mac/Misc/WebQuotaManager.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 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. ``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 + * 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. + */ + +@class WebSecurityOrigin; + +/*! + @protocol WebQuotaManager + @discussion This protocol is used to view and manipulate a per-origin storage quota. +*/ +@protocol WebQuotaManager + +/*! + @method initWithOrigin: + @param The security origin this will manage. + @result A new WebQuotaManager object. +*/ +- (id)initWithOrigin:(WebSecurityOrigin *)origin; + +/*! + @method origin + @result The security origin this manager is managing. +*/ +- (WebSecurityOrigin *)origin; + +/*! + @method usage + @result The current total usage of all relevant items in this security origin in bytes. +*/ +- (unsigned long long)usage; + +/*! + @method quota + @result The current quota of security origin in bytes. +*/ +- (unsigned long long)quota; + +/*! + @method setQuota: + @param Sets a new quota, in bytes, on this security origin. +*/ +- (void)setQuota:(unsigned long long)quota; + +@end diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h index e1f02ac..b88f1a4 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h @@ -44,28 +44,28 @@ class NetscapePluginHostManager { public: static NetscapePluginHostManager& shared(); - PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); + PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); void pluginHostDied(NetscapePluginHostProxy*); - static void createPropertyListFile(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture); + static void createPropertyListFile(const WTF::String& pluginPath, cpu_type_t pluginArchitecture); void didCreateWindow(); private: - NetscapePluginHostProxy* hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, bool useProxiedOpenPanel); + NetscapePluginHostProxy* hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier, bool useProxiedOpenPanel); NetscapePluginHostManager(); ~NetscapePluginHostManager(); - bool spawnPluginHost(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); + bool spawnPluginHost(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); bool initializeVendorPort(); mach_port_t m_pluginVendorPort; // FIXME: This should really be a HashMap of RetainPtrs, but that doesn't work right now. - typedef HashMap<WebCore::String, NetscapePluginHostProxy*> PluginHostMap; + typedef HashMap<WTF::String, NetscapePluginHostProxy*> PluginHostMap; PluginHostMap m_pluginHosts; }; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm index baec6ba..22874df 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm @@ -70,7 +70,7 @@ NetscapePluginHostManager::~NetscapePluginHostManager() { } -NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel) +NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel) { pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(pluginPath, 0); diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 9ca5b5a..3081120 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -32,16 +32,13 @@ #include <WebCore/Timer.h> #include <WebKit/npapi.h> #include <wtf/Deque.h> +#include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> #include "WebKitPluginHostTypes.h" -namespace WebCore { - class String; -} - namespace JSC { namespace Bindings { class Instance; @@ -112,7 +109,7 @@ public: bool getPluginElementNPObject(uint32_t& objectID); bool forgetBrowserObjectID(uint32_t objectID); // Will fail if the ID is being sent to plug-in right now (i.e., retain/release calls aren't balanced). - bool evaluate(uint32_t objectID, const WebCore::String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups); + bool evaluate(uint32_t objectID, const WTF::String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups); bool invoke(uint32_t objectID, const JSC::Identifier& methodName, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); @@ -170,7 +167,7 @@ public: void didDraw(); void privateBrowsingModeDidChange(bool isPrivateBrowsingEnabled); - static void setGlobalException(const WebCore::String&); + static void setGlobalException(const WTF::String&); static void moveGlobalExceptionToExecState(JSC::ExecState*); // Reply structs diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h index 4c8ea84..9a29cc2 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h @@ -31,6 +31,7 @@ #import "WebNetscapePluginPackage.h" #import "WebPluginContainerCheck.h" +#import <wtf/Forward.h> #import <wtf/OwnPtr.h> #import <wtf/PassRefPtr.h> #import <wtf/RefPtr.h> @@ -41,10 +42,6 @@ @class WebFrame; @class WebView; -namespace WTF { - class CString; -} - namespace WebCore { class HTMLPlugInElement; } diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.h b/WebKit/mac/Plugins/WebBasePluginPackage.h index ca2ddcd..a42a82e 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.h +++ b/WebKit/mac/Plugins/WebBasePluginPackage.h @@ -57,7 +57,7 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); { NSMutableSet *pluginDatabases; - WebCore::String path; + WTF::String path; WebCore::PluginInfo pluginInfo; RetainPtr<CFBundleRef> cfBundle; @@ -73,16 +73,16 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); - (BOOL)load; - (void)unload; -- (const WebCore::String&)path; +- (const WTF::String&)path; - (const WebCore::PluginInfo&)pluginInfo; -- (WebCore::String)bundleIdentifier; +- (WTF::String)bundleIdentifier; -- (BOOL)supportsExtension:(const WebCore::String&)extension; -- (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType; +- (BOOL)supportsExtension:(const WTF::String&)extension; +- (BOOL)supportsMIMEType:(const WTF::String&)MIMEType; -- (NSString *)MIMETypeForExtension:(const WebCore::String&)extension; +- (NSString *)MIMETypeForExtension:(const WTF::String&)extension; - (BOOL)isQuickTimePlugIn; - (BOOL)isJavaPlugIn; diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm index 70e5889..78b0a7f 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.mm +++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -303,7 +303,7 @@ static NSString *pathByResolvingSymlinksAndAliases(NSString *thePath) return NO; } -- (BOOL)supportsMIMEType:(const WebCore::String&)mimeType +- (BOOL)supportsMIMEType:(const WTF::String&)mimeType { ASSERT(mimeType.lower() == mimeType); @@ -445,7 +445,7 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) [pluginDatabases removeObject:database]; } -- (WebCore::String)bundleIdentifier +- (WTF::String)bundleIdentifier { return CFBundleGetIdentifier(cfBundle.get()); } diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.h b/WebKit/mac/Plugins/WebNetscapePluginStream.h index 8ee9e7f..20beee2 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginStream.h +++ b/WebKit/mac/Plugins/WebNetscapePluginStream.h @@ -90,7 +90,7 @@ private: void deliverDataToFile(NSData *data); void deliverData(); - void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, const WebCore::String& mimeType, NSData *headers); + void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, const WTF::String& mimeType, NSData *headers); NSError *pluginCancelledConnectionError() const; diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h b/WebKit/mac/Storage/WebDatabaseQuotaManager.h index 09c0610..8219da4 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h +++ b/WebKit/mac/Storage/WebDatabaseQuotaManager.h @@ -23,7 +23,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebSecurityOriginInternal.h" +#import "WebQuotaManager.h" + +@interface WebDatabaseQuotaManager : NSObject <WebQuotaManager> { + WebSecurityOrigin *_origin; +} -@interface WebApplicationCacheSecurityOrigin : WebSecurityOrigin @end diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm b/WebKit/mac/Storage/WebDatabaseQuotaManager.mm index a0c3529..e26ae33 100644 --- a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm +++ b/WebKit/mac/Storage/WebDatabaseQuotaManager.mm @@ -23,15 +23,56 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebDatabaseSecurityOrigin.h" -#import <WebCore/SecurityOrigin.h> +#import "WebDatabaseQuotaManager.h" + +#import "WebSecurityOriginInternal.h" +#import <WebCore/DatabaseTracker.h> using namespace WebCore; -@implementation WebDatabaseSecurityOrigin +@implementation WebDatabaseQuotaManager + +- (id)initWithOrigin:(WebSecurityOrigin *)origin +{ + self = [super init]; + if (!self) + return nil; + + _origin = origin; + return self; +} + +- (WebSecurityOrigin *)origin +{ + return _origin; +} + +- (unsigned long long)usage +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().usageForOrigin([_origin _core]); +#else + return 0; +#endif +} + +- (unsigned long long)quota +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().quotaForOrigin([_origin _core]); +#else + return 0; +#endif +} -// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 -// Proper steps should be taken to have subclass implementations of SecurityOrigin's -// origin, quota, and setQuota methods. +// If the quota is set to a value lower than the current usage, that quota will +// "stick" but no data will be purged to meet the new quota. This will simply +// prevent new data from being added to databases in that origin. +- (void)setQuota:(unsigned long long)quota +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().setQuota([_origin _core], quota); +#endif +} @end diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.h b/WebKit/mac/Storage/WebDatabaseTrackerClient.h index d06cfe9..cbb5eb7 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.h +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.h @@ -36,7 +36,7 @@ public: virtual ~WebDatabaseTrackerClient(); virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*); - virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseIdentifier); + virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WTF::String& databaseIdentifier); private: WebDatabaseTrackerClient(); }; diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.h b/WebKit/mac/WebCoreSupport/WebApplicationCache.h index 78b06b7..976ce18 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.h +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.h @@ -33,4 +33,6 @@ + (long long)defaultOriginQuota; + (void)setDefaultOriginQuota:(long long)size; ++ (void)deleteAllApplicationCaches; + @end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm index 5c2a208..45f0703 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm @@ -39,8 +39,7 @@ using namespace WebCore; + (void)setMaximumSize:(long long)size { - cacheStorage().empty(); - cacheStorage().vacuumDatabaseFile(); + [WebApplicationCache deleteAllApplicationCaches]; cacheStorage().setMaximumSize(size); } @@ -54,6 +53,12 @@ using namespace WebCore; cacheStorage().setDefaultOriginQuota(size); } ++ (void)deleteAllApplicationCaches +{ + cacheStorage().empty(); + cacheStorage().vacuumDatabaseFile(); +} + @end #endif diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.h index a06ca3d..6d30148 100644 --- a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.h @@ -23,7 +23,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebSecurityOriginInternal.h" +#import "WebQuotaManager.h" + +@interface WebApplicationCacheQuotaManager : NSObject <WebQuotaManager> { + WebSecurityOrigin *_origin; +} -@interface WebDatabaseSecurityOrigin : WebSecurityOrigin @end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm index dac41ae..562bb29 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm @@ -23,19 +23,35 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebApplicationCacheSecurityOrigin.h" +#import "WebApplicationCacheQuotaManager.h" +#import "WebSecurityOriginInternal.h" #import <WebCore/ApplicationCacheStorage.h> using namespace WebCore; -@implementation WebApplicationCacheSecurityOrigin +@implementation WebApplicationCacheQuotaManager + +- (id)initWithOrigin:(WebSecurityOrigin *)origin +{ + self = [super init]; + if (!self) + return nil; + + _origin = origin; + return self; +} + +- (WebSecurityOrigin *)origin +{ + return _origin; +} - (unsigned long long)usage { #if ENABLE(OFFLINE_WEB_APPLICATIONS) long long usage; - if (cacheStorage().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private), usage)) + if (cacheStorage().usageForOrigin([_origin _core], usage)) return usage; return 0; #else @@ -47,7 +63,7 @@ using namespace WebCore; { #if ENABLE(OFFLINE_WEB_APPLICATIONS) long long quota; - if (cacheStorage().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota)) + if (cacheStorage().quotaForOrigin([_origin _core], quota)) return quota; return 0; #else @@ -58,7 +74,7 @@ using namespace WebCore; - (void)setQuota:(unsigned long long)quota { #if ENABLE(OFFLINE_WEB_APPLICATIONS) - cacheStorage().storeUpdatedQuotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota); + cacheStorage().storeUpdatedQuotaForOrigin([_origin _core], quota); #endif } diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index 50c159c..e5de14d 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -36,7 +36,7 @@ class WebChromeClient : public WebCore::ChromeClient { public: WebChromeClient(WebView *webView); - WebView *webView() { return m_webView; } + WebView *webView() const { return m_webView; } virtual void chromeDestroyed(); @@ -75,16 +75,16 @@ public: virtual void setResizable(bool); - virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL); + virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceURL); virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; @@ -102,18 +102,18 @@ public: virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const; virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; - virtual void setStatusbarText(const WebCore::String&); + virtual void setStatusbarText(const WTF::String&); virtual void scrollbarsModeDidChange() const { } virtual bool shouldMissingPluginMessageBeButton() const; virtual void missingPluginButtonClicked(WebCore::Element*) const; virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); - virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); + virtual void setToolTip(const WTF::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName); + virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); @@ -126,13 +126,13 @@ public: #endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void setCursor(const WebCore::Cursor&); - virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type, + virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WTF::AtomicString& type, const WebCore::FloatRect& lineRect); - virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type, + virtual void paintCustomHighlight(WebCore::Node*, const WTF::AtomicString& type, const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect, bool behindText, bool entireLine); @@ -143,8 +143,8 @@ public: virtual void willPopUpMenu(NSMenu *); - virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename); - virtual WebCore::String generateReplacementFile(const WebCore::String& path); + virtual bool shouldReplaceWithGeneratedFileForUpload(const WTF::String& path, WTF::String &generatedFilename); + virtual WTF::String generateReplacementFile(const WTF::String& path); virtual void formStateDidChange(const WebCore::Node*) { } diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 1a3736e..c80721f 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -30,8 +30,6 @@ #import "WebChromeClient.h" #import "DOMNodeInternal.h" -#import "WebApplicationCacheSecurityOrigin.h" -#import "WebDatabaseSecurityOrigin.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebElementDictionary.h" @@ -43,6 +41,7 @@ #import "WebKitSystemInterface.h" #import "WebNSURLRequestExtras.h" #import "WebPlugin.h" +#import "WebQuotaManager.h" #import "WebSecurityOriginInternal.h" #import "WebUIDelegatePrivate.h" #import "WebView.h" @@ -559,11 +558,11 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database { BEGIN_BLOCK_OBJC_EXCEPTIONS; - WebDatabaseSecurityOrigin *webOrigin = [[WebDatabaseSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; + WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented. if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) { const unsigned long long defaultQuota = 5 * 1024 * 1024; // 5 megabytes should hopefully be enough to test storage support. - [webOrigin setQuota:defaultQuota]; + [[webOrigin databaseQuotaManager] setQuota:defaultQuota]; } else CallUIDelegate(m_webView, @selector(webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:), kit(frame), webOrigin, (NSString *)databaseName); [webOrigin release]; @@ -582,7 +581,7 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin) { BEGIN_BLOCK_OBJC_EXCEPTIONS; - WebApplicationCacheSecurityOrigin *webOrigin = [[WebApplicationCacheSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]; + WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]; CallUIDelegate(m_webView, @selector(webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:), webOrigin); [webOrigin release]; diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h index c3ff4dd..077cd16 100644 --- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h +++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h @@ -43,7 +43,7 @@ public: virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); virtual bool isSpeaking(); - virtual void speak(const WebCore::String&); + virtual void speak(const WTF::String&); virtual void stopSpeaking(); virtual void searchWithSpotlight(); diff --git a/WebKit/mac/WebCoreSupport/WebDragClient.h b/WebKit/mac/WebCoreSupport/WebDragClient.h index 234090e..216a2fb 100644 --- a/WebKit/mac/WebCoreSupport/WebDragClient.h +++ b/WebKit/mac/WebCoreSupport/WebDragClient.h @@ -36,7 +36,7 @@ public: virtual void dragControllerDestroyed(); virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WebCore::String& label, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WTF::String& label, WebCore::Frame*); virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*); private: WebView* m_webView; diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h index 1cb2a59..e6426aa 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.h +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h @@ -57,7 +57,7 @@ public: virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting); virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*); @@ -116,17 +116,17 @@ public: virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, WTF::Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String&, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); private: diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h index d750a10..d932e66 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h @@ -43,7 +43,6 @@ namespace WebCore { class CachedFrame; class HistoryItem; class ProtectionSpace; - class String; class ResourceLoader; class ResourceRequest; } @@ -102,7 +101,7 @@ private: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String& title); + virtual void dispatchDidReceiveTitle(const WTF::String& title); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -116,9 +115,9 @@ private: virtual void dispatchShow(); virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, - const WebCore::String& MIMEType, const WebCore::ResourceRequest&); + const WTF::String& MIMEType, const WebCore::ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, - const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); + const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WTF::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>); virtual void cancelPolicyCheck(); @@ -170,16 +169,16 @@ private: virtual bool shouldFallBack(const WebCore::ResourceError&); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; - virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; + virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(WebCore::HistoryItem*); @@ -189,27 +188,27 @@ private: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); - virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, - const Vector<WebCore::String>&, const WebCore::String&, bool); + virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, + const Vector<WTF::String>&, const WTF::String&, bool); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, - const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues); + const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) virtual PassRefPtr<WebCore::Widget> createMediaPlayerProxyPlugin(const WebCore::IntSize&, WebCore::HTMLMediaElement*, const WebCore::KURL&, - const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&); + const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&); virtual void hideMediaPlayerProxyPlugin(WebCore::Widget*); virtual void showMediaPlayerProxyPlugin(WebCore::Widget*); #endif - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); - virtual WebCore::String overrideMediaType() const; + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType); + virtual WTF::String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h index e908242..3f9df13 100644 --- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h +++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h @@ -27,14 +27,11 @@ */ #import <WebCore/IconDatabaseClient.h> - -namespace WebCore { - class String; -} +#import <wtf/Forward.h> class WebIconDatabaseClient : public WebCore::IconDatabaseClient { public: virtual bool performImport(); virtual void dispatchDidRemoveAllIcons(); - virtual void dispatchDidAddIconForPageURL(const WebCore::String& pageURL); + virtual void dispatchDidAddIconForPageURL(const WTF::String& pageURL); }; diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm index 1b0c834..3651dea 100644 --- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm +++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm @@ -48,7 +48,7 @@ void WebIconDatabaseClient::dispatchDidRemoveAllIcons() [pool drain]; } -void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WebCore::String& pageURL) +void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WTF::String& pageURL) { // This is a quick notification that is likely to fire in a rapidly iterating loop // Therefore we let WebCore handle autorelease by draining its pool "from time to time" diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h index bd52954..d33e3b9 100644 --- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h @@ -59,10 +59,10 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); void releaseFrontendPage(); @@ -79,8 +79,8 @@ public: virtual void frontendLoaded(); - virtual WebCore::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String localizedStringsURL(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -89,12 +89,12 @@ public: virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); - virtual void inspectedURLChanged(const WebCore::String& newURL); + virtual void inspectedURLChanged(const WTF::String& newURL); private: void updateWindowTitle() const; WebView* m_inspectedWebView; RetainPtr<WebInspectorWindowController> m_windowController; - WebCore::String m_inspectedURL; + WTF::String m_inspectedURL; }; diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h index 7092157..2aa37a6 100644 --- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h +++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h @@ -34,8 +34,8 @@ class WebPasteboardHelper : public WebCore::PasteboardHelper { public: WebPasteboardHelper(WebHTMLView* view) : m_view(view) {} - virtual WebCore::String urlFromPasteboard(NSPasteboard*, WebCore::String* title) const; - virtual WebCore::String plainTextFromPasteboard(NSPasteboard*) const; + virtual WTF::String urlFromPasteboard(NSPasteboard*, WTF::String* title) const; + virtual WTF::String plainTextFromPasteboard(NSPasteboard*) const; virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const; virtual NSArray* insertablePasteboardTypes() const; private: diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h index 3d34dbe..53f39f8 100644 --- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h @@ -48,108 +48,108 @@ private: virtual void getPluginInfo(Vector<WebCore::PluginInfo>&); // WebCore::LocalizationStrategy - virtual WebCore::String inputElementAltText(); - virtual WebCore::String resetButtonDefaultLabel(); - virtual WebCore::String searchableIndexIntroduction(); - virtual WebCore::String submitButtonDefaultLabel(); - virtual WebCore::String fileButtonChooseFileLabel(); - virtual WebCore::String fileButtonNoFileSelectedLabel(); - virtual WebCore::String copyImageUnknownFileLabel(); + virtual WTF::String inputElementAltText(); + virtual WTF::String resetButtonDefaultLabel(); + virtual WTF::String searchableIndexIntroduction(); + virtual WTF::String submitButtonDefaultLabel(); + virtual WTF::String fileButtonChooseFileLabel(); + virtual WTF::String fileButtonNoFileSelectedLabel(); + virtual WTF::String copyImageUnknownFileLabel(); #if ENABLE(CONTEXT_MENUS) - virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow(); - virtual WebCore::String contextMenuItemTagDownloadLinkToDisk(); - virtual WebCore::String contextMenuItemTagCopyLinkToClipboard(); - virtual WebCore::String contextMenuItemTagOpenImageInNewWindow(); - virtual WebCore::String contextMenuItemTagDownloadImageToDisk(); - virtual WebCore::String contextMenuItemTagCopyImageToClipboard(); - virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow(); - virtual WebCore::String contextMenuItemTagCopy(); - virtual WebCore::String contextMenuItemTagGoBack(); - virtual WebCore::String contextMenuItemTagGoForward(); - virtual WebCore::String contextMenuItemTagStop(); - virtual WebCore::String contextMenuItemTagReload(); - virtual WebCore::String contextMenuItemTagCut(); - virtual WebCore::String contextMenuItemTagPaste(); - virtual WebCore::String contextMenuItemTagNoGuessesFound(); - virtual WebCore::String contextMenuItemTagIgnoreSpelling(); - virtual WebCore::String contextMenuItemTagLearnSpelling(); - virtual WebCore::String contextMenuItemTagSearchWeb(); - virtual WebCore::String contextMenuItemTagLookUpInDictionary(); - virtual WebCore::String contextMenuItemTagOpenLink(); - virtual WebCore::String contextMenuItemTagIgnoreGrammar(); - virtual WebCore::String contextMenuItemTagSpellingMenu(); - virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show); - virtual WebCore::String contextMenuItemTagCheckSpelling(); - virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping(); - virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling(); - virtual WebCore::String contextMenuItemTagFontMenu(); - virtual WebCore::String contextMenuItemTagBold(); - virtual WebCore::String contextMenuItemTagItalic(); - virtual WebCore::String contextMenuItemTagUnderline(); - virtual WebCore::String contextMenuItemTagOutline(); - virtual WebCore::String contextMenuItemTagWritingDirectionMenu(); - virtual WebCore::String contextMenuItemTagTextDirectionMenu(); - virtual WebCore::String contextMenuItemTagDefaultDirection(); - virtual WebCore::String contextMenuItemTagLeftToRight(); - virtual WebCore::String contextMenuItemTagRightToLeft(); - virtual WebCore::String contextMenuItemTagSearchInSpotlight(); - virtual WebCore::String contextMenuItemTagShowFonts(); - virtual WebCore::String contextMenuItemTagStyles(); - virtual WebCore::String contextMenuItemTagShowColors(); - virtual WebCore::String contextMenuItemTagSpeechMenu(); - virtual WebCore::String contextMenuItemTagStartSpeaking(); - virtual WebCore::String contextMenuItemTagStopSpeaking(); - virtual WebCore::String contextMenuItemTagCorrectSpellingAutomatically(); - virtual WebCore::String contextMenuItemTagSubstitutionsMenu(); - virtual WebCore::String contextMenuItemTagShowSubstitutions(bool show); - virtual WebCore::String contextMenuItemTagSmartCopyPaste(); - virtual WebCore::String contextMenuItemTagSmartQuotes(); - virtual WebCore::String contextMenuItemTagSmartDashes(); - virtual WebCore::String contextMenuItemTagSmartLinks(); - virtual WebCore::String contextMenuItemTagTextReplacement(); - virtual WebCore::String contextMenuItemTagTransformationsMenu(); - virtual WebCore::String contextMenuItemTagMakeUpperCase(); - virtual WebCore::String contextMenuItemTagMakeLowerCase(); - virtual WebCore::String contextMenuItemTagCapitalize(); - virtual WebCore::String contextMenuItemTagChangeBack(const WebCore::String& replacedString); - virtual WebCore::String contextMenuItemTagInspectElement(); + virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); + virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); + virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadImageToDisk(); + virtual WTF::String contextMenuItemTagCopyImageToClipboard(); + virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); + virtual WTF::String contextMenuItemTagCopy(); + virtual WTF::String contextMenuItemTagGoBack(); + virtual WTF::String contextMenuItemTagGoForward(); + virtual WTF::String contextMenuItemTagStop(); + virtual WTF::String contextMenuItemTagReload(); + virtual WTF::String contextMenuItemTagCut(); + virtual WTF::String contextMenuItemTagPaste(); + virtual WTF::String contextMenuItemTagNoGuessesFound(); + virtual WTF::String contextMenuItemTagIgnoreSpelling(); + virtual WTF::String contextMenuItemTagLearnSpelling(); + virtual WTF::String contextMenuItemTagSearchWeb(); + virtual WTF::String contextMenuItemTagLookUpInDictionary(); + virtual WTF::String contextMenuItemTagOpenLink(); + virtual WTF::String contextMenuItemTagIgnoreGrammar(); + virtual WTF::String contextMenuItemTagSpellingMenu(); + virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); + virtual WTF::String contextMenuItemTagCheckSpelling(); + virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); + virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); + virtual WTF::String contextMenuItemTagFontMenu(); + virtual WTF::String contextMenuItemTagBold(); + virtual WTF::String contextMenuItemTagItalic(); + virtual WTF::String contextMenuItemTagUnderline(); + virtual WTF::String contextMenuItemTagOutline(); + virtual WTF::String contextMenuItemTagWritingDirectionMenu(); + virtual WTF::String contextMenuItemTagTextDirectionMenu(); + virtual WTF::String contextMenuItemTagDefaultDirection(); + virtual WTF::String contextMenuItemTagLeftToRight(); + virtual WTF::String contextMenuItemTagRightToLeft(); + virtual WTF::String contextMenuItemTagSearchInSpotlight(); + virtual WTF::String contextMenuItemTagShowFonts(); + virtual WTF::String contextMenuItemTagStyles(); + virtual WTF::String contextMenuItemTagShowColors(); + virtual WTF::String contextMenuItemTagSpeechMenu(); + virtual WTF::String contextMenuItemTagStartSpeaking(); + virtual WTF::String contextMenuItemTagStopSpeaking(); + virtual WTF::String contextMenuItemTagCorrectSpellingAutomatically(); + virtual WTF::String contextMenuItemTagSubstitutionsMenu(); + virtual WTF::String contextMenuItemTagShowSubstitutions(bool show); + virtual WTF::String contextMenuItemTagSmartCopyPaste(); + virtual WTF::String contextMenuItemTagSmartQuotes(); + virtual WTF::String contextMenuItemTagSmartDashes(); + virtual WTF::String contextMenuItemTagSmartLinks(); + virtual WTF::String contextMenuItemTagTextReplacement(); + virtual WTF::String contextMenuItemTagTransformationsMenu(); + virtual WTF::String contextMenuItemTagMakeUpperCase(); + virtual WTF::String contextMenuItemTagMakeLowerCase(); + virtual WTF::String contextMenuItemTagCapitalize(); + virtual WTF::String contextMenuItemTagChangeBack(const WTF::String& replacedString); + virtual WTF::String contextMenuItemTagInspectElement(); #endif // ENABLE(CONTEXT_MENUS) - virtual WebCore::String searchMenuNoRecentSearchesText(); - virtual WebCore::String searchMenuRecentSearchesText(); - virtual WebCore::String searchMenuClearRecentSearchesText(); - virtual WebCore::String AXWebAreaText(); - virtual WebCore::String AXLinkText(); - virtual WebCore::String AXListMarkerText(); - virtual WebCore::String AXImageMapText(); - virtual WebCore::String AXHeadingText(); - virtual WebCore::String AXDefinitionListTermText(); - virtual WebCore::String AXDefinitionListDefinitionText(); - virtual WebCore::String AXARIAContentGroupText(const WebCore::String& ariaType); - virtual WebCore::String AXButtonActionVerb(); - virtual WebCore::String AXRadioButtonActionVerb(); - virtual WebCore::String AXTextFieldActionVerb(); - virtual WebCore::String AXCheckedCheckBoxActionVerb(); - virtual WebCore::String AXUncheckedCheckBoxActionVerb(); - virtual WebCore::String AXMenuListActionVerb(); - virtual WebCore::String AXMenuListPopupActionVerb(); - virtual WebCore::String AXLinkActionVerb(); - virtual WebCore::String missingPluginText(); - virtual WebCore::String crashedPluginText(); - virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles); - virtual WebCore::String unknownFileSizeText(); - virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize& size); - virtual WebCore::String mediaElementLoadingStateText(); - virtual WebCore::String mediaElementLiveBroadcastStateText(); - virtual WebCore::String localizedMediaControlElementString(const WebCore::String&); - virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&); - virtual WebCore::String localizedMediaTimeDescription(float); - virtual WebCore::String validationMessageValueMissingText(); - virtual WebCore::String validationMessageTypeMismatchText(); - virtual WebCore::String validationMessagePatternMismatchText(); - virtual WebCore::String validationMessageTooLongText(); - virtual WebCore::String validationMessageRangeUnderflowText(); - virtual WebCore::String validationMessageRangeOverflowText(); - virtual WebCore::String validationMessageStepMismatchText(); + virtual WTF::String searchMenuNoRecentSearchesText(); + virtual WTF::String searchMenuRecentSearchesText(); + virtual WTF::String searchMenuClearRecentSearchesText(); + virtual WTF::String AXWebAreaText(); + virtual WTF::String AXLinkText(); + virtual WTF::String AXListMarkerText(); + virtual WTF::String AXImageMapText(); + virtual WTF::String AXHeadingText(); + virtual WTF::String AXDefinitionListTermText(); + virtual WTF::String AXDefinitionListDefinitionText(); + virtual WTF::String AXARIAContentGroupText(const WTF::String& ariaType); + virtual WTF::String AXButtonActionVerb(); + virtual WTF::String AXRadioButtonActionVerb(); + virtual WTF::String AXTextFieldActionVerb(); + virtual WTF::String AXCheckedCheckBoxActionVerb(); + virtual WTF::String AXUncheckedCheckBoxActionVerb(); + virtual WTF::String AXMenuListActionVerb(); + virtual WTF::String AXMenuListPopupActionVerb(); + virtual WTF::String AXLinkActionVerb(); + virtual WTF::String missingPluginText(); + virtual WTF::String crashedPluginText(); + virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); + virtual WTF::String unknownFileSizeText(); + virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize& size); + virtual WTF::String mediaElementLoadingStateText(); + virtual WTF::String mediaElementLiveBroadcastStateText(); + virtual WTF::String localizedMediaControlElementString(const WTF::String&); + virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); + virtual WTF::String localizedMediaTimeDescription(float); + virtual WTF::String validationMessageValueMissingText(); + virtual WTF::String validationMessageTypeMismatchText(); + virtual WTF::String validationMessagePatternMismatchText(); + virtual WTF::String validationMessageTooLongText(); + virtual WTF::String validationMessageRangeUnderflowText(); + virtual WTF::String validationMessageRangeOverflowText(); + virtual WTF::String validationMessageStepMismatchText(); // WebCore::VisitedLinkStrategy virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); diff --git a/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h b/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h index a0d398d..ed4ff11 100644 --- a/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h +++ b/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h @@ -24,10 +24,10 @@ */ #import <WebCore/PluginHalterClient.h> +#import <wtf/Forward.h> namespace WebCore { class Node; - class String; } @class WebView; @@ -36,7 +36,7 @@ class WebPluginHalterClient : public WebCore::PluginHalterClient { public: WebPluginHalterClient(WebView *); - virtual bool shouldHaltPlugin(WebCore::Node*, bool, const WebCore::String&) const; + virtual bool shouldHaltPlugin(WebCore::Node*, bool, const WTF::String&) const; virtual bool enabled() const; private: diff --git a/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm index 0d49445..f19dcb5 100644 --- a/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm +++ b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm @@ -28,9 +28,12 @@ #import "WebSecurityOriginInternal.h" +#import "WebApplicationCacheQuotaManager.h" +#import "WebDatabaseQuotaManager.h" +#import "WebQuotaManager.h" #import <WebCore/KURL.h> -#import <WebCore/SecurityOrigin.h> #import <WebCore/DatabaseTracker.h> +#import <WebCore/SecurityOrigin.h> using namespace WebCore; @@ -69,38 +72,6 @@ using namespace WebCore; return reinterpret_cast<SecurityOrigin*>(_private)->port(); } -// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 -// Proper steps should be taken to have subclass implementations of SecurityOrigin's -// origin, quota, and setQuota methods. - -- (unsigned long long)usage -{ -#if ENABLE(DATABASE) - return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); -#else - return 0; -#endif -} - -- (unsigned long long)quota -{ -#if ENABLE(DATABASE) - return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); -#else - return 0; -#endif -} - -// If the quota is set to a value lower than the current usage, that quota will -// "stick" but no data will be purged to meet the new quota. This will simply -// prevent new data from being added to databases in that origin -- (void)setQuota:(unsigned long long)quota -{ -#if ENABLE(DATABASE) - DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); -#endif -} - - (BOOL)isEqual:(id)anObject { if (![anObject isMemberOfClass:[WebSecurityOrigin class]]) { @@ -114,6 +85,10 @@ using namespace WebCore; { if (_private) reinterpret_cast<SecurityOrigin*>(_private)->deref(); + if (_applicationCacheQuotaManager) + [(NSObject *)_applicationCacheQuotaManager release]; + if (_databaseQuotaManager) + [(NSObject *)_databaseQuotaManager release]; [super dealloc]; } @@ -147,3 +122,62 @@ using namespace WebCore; } @end + + +#pragma mark - +#pragma mark WebQuotaManagers + +@implementation WebSecurityOrigin (WebQuotaManagers) + +- (id<WebQuotaManager>)applicationCacheQuotaManager +{ + if (!_applicationCacheQuotaManager) + _applicationCacheQuotaManager = [[WebApplicationCacheQuotaManager alloc] initWithOrigin:self]; + return _applicationCacheQuotaManager; +} + +- (id<WebQuotaManager>)databaseQuotaManager +{ + if (!_databaseQuotaManager) + _databaseQuotaManager = [[WebDatabaseQuotaManager alloc] initWithOrigin:self]; + return _databaseQuotaManager; +} + +@end + + +#pragma mark - +#pragma mark Deprecated + +// FIXME: The following methods are deprecated and should removed later. +// Clients should instead get a WebQuotaManager, and query / set the quota via the Manager. +// NOTE: the <WebCore/DatabaseTracker.h> #include should be removed as well. + +@implementation WebSecurityOrigin (Deprecated) + +- (unsigned long long)usage +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif +} + +- (unsigned long long)quota +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif +} + +- (void)setQuota:(unsigned long long)quota +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); +#endif +} + +@end diff --git a/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h index 6518a16..2973d92 100644 --- a/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h +++ b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,9 +27,12 @@ */ @class WebSecurityOriginPrivate; +@protocol WebQuotaManager; @interface WebSecurityOrigin : NSObject { WebSecurityOriginPrivate *_private; + id<WebQuotaManager> _applicationCacheQuotaManager; + id<WebQuotaManager> _databaseQuotaManager; } - (id)initWithURL:(NSURL *)url; @@ -40,16 +43,17 @@ // Returns zero if the port is the default port for the protocol, non-zero otherwise. - (unsigned short)port; -// Meant to be implemented in a subclass. -// Returns the current total usage of all relevant items in this security origin in bytes. -- (unsigned long long)usage; +@end -// Meant to be implemented in a subclass. -// Returns the quota of this security origin in bytes. -- (unsigned long long)quota; +@interface WebSecurityOrigin (WebQuotaManagers) +- (id<WebQuotaManager>)applicationCacheQuotaManager; +- (id<WebQuotaManager>)databaseQuotaManager; +@end -// Meant to be implemented in a subclass. -// Sets the storage quota in bytes. +// FIXME: The following methods are deprecated and should removed later. +// Clients should instead get a WebQuotaManager, and query / set the quota via the Manager. +@interface WebSecurityOrigin (Deprecated) +- (unsigned long long)usage; +- (unsigned long long)quota; - (void)setQuota:(unsigned long long)quota; - @end diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h index 586b4c3..240b09c 100644 --- a/WebKit/mac/WebView/WebFrameInternal.h +++ b/WebKit/mac/WebView/WebFrameInternal.h @@ -92,8 +92,8 @@ WebView *getWebView(WebFrame *webFrame); @interface WebFrame (WebInternal) -+ (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; -+ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; ++ (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WTF::String&)name frameView:(WebFrameView *)frameView; ++ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WTF::String&)name frameView:(WebFrameView *)frameView; - (id)_initWithWebFrameView:(WebFrameView *)webFrameView webView:(WebView *)webView; - (void)_clearCoreFrame; diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 58ce124..0e559b4 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -849,11 +849,12 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) [webView _setInsertionPasteboard:pasteboard]; DOMRange *range = [self _selectedRange]; + Frame* coreFrame = core([self _frame]); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted]) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); #else // Mail is ignoring the frament passed to the delegate and creates a new one. // We want to avoid creating the fragment twice. @@ -861,12 +862,12 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) if ([self _shouldInsertFragment:nil replacingDOMRange:range givenAction:WebViewInsertActionPasted]) { DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); } } else { DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted]) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); } #endif [webView _setInsertionPasteboard:nil]; diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 7ec2439..c46dca7 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -998,7 +998,6 @@ static WebCacheModel cacheModelForMainBundle(void) - (int64_t)applicationCacheTotalQuota { - ASSERT([self _longLongValueForKey:WebKitApplicationCacheTotalQuota] == [WebApplicationCache maximumSize]); return [self _longLongValueForKey:WebKitApplicationCacheTotalQuota]; } @@ -1012,7 +1011,6 @@ static WebCacheModel cacheModelForMainBundle(void) - (int64_t)applicationCacheDefaultOriginQuota { - ASSERT([self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota] == [WebApplicationCache defaultOriginQuota]); return [self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota]; } diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h index d097c4c..3b80a89 100644 --- a/WebKit/mac/WebView/WebViewData.h +++ b/WebKit/mac/WebView/WebViewData.h @@ -79,7 +79,7 @@ extern int pluginDatabaseClientCount; float zoomMultiplier; NSString *applicationNameForUserAgent; - WebCore::String userAgent; + WTF::String userAgent; BOOL userAgentOverridden; WebPreferences *preferences; diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h index f95d3d3..71a2660 100644 --- a/WebKit/mac/WebView/WebViewInternal.h +++ b/WebKit/mac/WebView/WebViewInternal.h @@ -36,8 +36,9 @@ #ifdef __cplusplus #import <WebCore/WebCoreKeyboardUIMode.h> +#include <wtf/Forward.h> + namespace WebCore { - class String; class Frame; class KURL; class KeyboardEvent; |