diff options
| author | Ben Murdoch <benm@google.com> | 2010-08-11 14:44:44 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2010-08-12 19:15:41 +0100 |
| commit | dd8bb3de4f353a81954234999f1fea748aee2ea9 (patch) | |
| tree | 729b52bf09294f0d6c67cd5ea80aee1b727b7bd8 /WebKit/mac/Storage | |
| parent | f3d41ba51d86bf719c7a65ab5297aea3c17e2d98 (diff) | |
| download | external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.zip external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.gz external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.bz2 | |
Merge WebKit at r65072 : Initial merge by git.
Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
Diffstat (limited to 'WebKit/mac/Storage')
| -rw-r--r-- | WebKit/mac/Storage/WebDatabaseQuotaManager.h (renamed from WebKit/mac/Storage/WebDatabaseSecurityOrigin.h) | 7 | ||||
| -rw-r--r-- | WebKit/mac/Storage/WebDatabaseQuotaManager.mm (renamed from WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm) | 53 | ||||
| -rw-r--r-- | WebKit/mac/Storage/WebDatabaseTrackerClient.h | 2 |
3 files changed, 53 insertions, 9 deletions
diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h b/WebKit/mac/Storage/WebDatabaseQuotaManager.h index a06ca3d..8219da4 100644 --- a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.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 WebDatabaseSecurityOrigin : 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(); }; |
