Changeset 64403 in webkit


Ignore:
Timestamp:
Jul 30, 2010 8:38:13 PM (14 years ago)
Author:
Joseph Pecoraro
Message:

2010-07-30 Joseph Pecoraro <Joseph Pecoraro>

Fix for tests that broke after r64400. Tracking a more
ideal solution in https://bugs.webkit.org/show_bug.cgi?id=40627

Switch the interface back to (unsigned long long), and move
the WebDatabaseSecurityOrigin implementation up into WebSecurityOrigin.
The subclasses' implementations were not getting called.

  • Storage/WebDatabaseSecurityOrigin.mm:
  • WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: (-[WebApplicationCacheSecurityOrigin quota]): (-[WebApplicationCacheSecurityOrigin setQuota:]):
  • WebCoreSupport/WebSecurityOrigin.mm: (-[WebSecurityOrigin usage]): (-[WebSecurityOrigin quota]): (-[WebSecurityOrigin setQuota:]):
  • WebCoreSupport/WebSecurityOriginPrivate.h:
Location:
trunk/WebKit/mac
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r64400 r64403  
     12010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Fix for tests that broke after r64400. Tracking a more
     4        ideal solution in https://bugs.webkit.org/show_bug.cgi?id=40627
     5
     6        Switch the interface back to (unsigned long long), and move
     7        the WebDatabaseSecurityOrigin implementation up into WebSecurityOrigin.
     8        The subclasses' implementations were not getting called.
     9
     10        * Storage/WebDatabaseSecurityOrigin.mm:
     11        * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm:
     12        (-[WebApplicationCacheSecurityOrigin quota]):
     13        (-[WebApplicationCacheSecurityOrigin setQuota:]):
     14        * WebCoreSupport/WebSecurityOrigin.mm:
     15        (-[WebSecurityOrigin usage]):
     16        (-[WebSecurityOrigin quota]):
     17        (-[WebSecurityOrigin setQuota:]):
     18        * WebCoreSupport/WebSecurityOriginPrivate.h:
     19
    1202010-07-30  Joseph Pecoraro  <joepeck@webkit.org>
    221
  • trunk/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm

    r64400 r64403  
    2525
    2626#import "WebDatabaseSecurityOrigin.h"
    27 
    28 #import <WebCore/DatabaseTracker.h>
    2927#import <WebCore/SecurityOrigin.h>
    3028
     
    3331@implementation WebDatabaseSecurityOrigin
    3432
    35 - (long long)usage
    36 {
    37 #if ENABLE(DATABASE)
    38     return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
    39 #else
    40     return 0;
    41 #endif
    42 }
    43 
    44 - (long long)quota
    45 {
    46 #if ENABLE(DATABASE)
    47     return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
    48 #else
    49     return 0;
    50 #endif
    51 }
    52 
    53 // If the quota is set to a value lower than the current usage, that quota will
    54 // "stick" but no data will be purged to meet the new quota. This will simply
    55 // prevent new data from being added to databases in that origin
    56 - (void)setQuota:(long long)quota
    57 {
    58 #if ENABLE(DATABASE)
    59     DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota);
    60 #endif
    61 }
     33// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627
     34// Proper steps should be taken to have subclass implementations of SecurityOrigin's
     35// origin, quota, and setQuota methods.
    6236
    6337@end
  • trunk/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm

    r64400 r64403  
    3232@implementation WebApplicationCacheSecurityOrigin
    3333
    34 - (long long)usage
     34- (unsigned long long)usage
    3535{
    3636#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     
    4444}
    4545
    46 - (long long)quota
     46- (unsigned long long)quota
    4747{
    4848#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     
    5656}
    5757
    58 - (void)setQuota:(long long)quota
     58- (void)setQuota:(unsigned long long)quota
    5959{
    6060#if ENABLE(OFFLINE_WEB_APPLICATIONS)
  • trunk/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm

    r64400 r64403  
    3131#import <WebCore/KURL.h>
    3232#import <WebCore/SecurityOrigin.h>
     33#import <WebCore/DatabaseTracker.h>
    3334
    3435using namespace WebCore;
     
    6970}
    7071
    71 // Meant to be implemented in a subclass.
    72 - (long long)usage
     72// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627
     73// Proper steps should be taken to have subclass implementations of SecurityOrigin's
     74// origin, quota, and setQuota methods.
     75
     76- (unsigned long long)usage
    7377{
     78#if ENABLE(DATABASE)
     79    return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
     80#else
    7481    return 0;
     82#endif
    7583}
    7684
    77 // Meant to be implemented in a subclass.
    78 - (long long)quota
     85- (unsigned long long)quota
    7986{
     87#if ENABLE(DATABASE)
     88    return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
     89#else
    8090    return 0;
     91#endif
    8192}
    8293
    83 // Meant to be implemented in a subclass.
    84 - (void)setQuota:(long long)quota
     94// If the quota is set to a value lower than the current usage, that quota will
     95// "stick" but no data will be purged to meet the new quota. This will simply
     96// prevent new data from being added to databases in that origin
     97- (void)setQuota:(unsigned long long)quota
    8598{
     99#if ENABLE(DATABASE)
     100    DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota);
     101#endif
    86102}
    87103
  • trunk/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h

    r64400 r64403  
    4343// Meant to be implemented in a subclass.
    4444// Returns the current total usage of all relevant items in this security origin in bytes.
    45 - (long long)usage;
     45- (unsigned long long)usage;
    4646
    4747// Meant to be implemented in a subclass.
    4848// Returns the quota of this security origin in bytes.
    49 - (long long)quota;
     49- (unsigned long long)quota;
    5050
    5151// Meant to be implemented in a subclass.
    5252// Sets the storage quota in bytes.
    53 - (void)setQuota:(long long)quota;
     53- (void)setQuota:(unsigned long long)quota;
    5454
    5555@end
Note: See TracChangeset for help on using the changeset viewer.