Changeset 128190 in webkit


Ignore:
Timestamp:
Sep 11, 2012 8:23:37 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[WK2][WKTR] TestRunner needs to implement setApplicationCacheOriginQuota
https://bugs.webkit.org/show_bug.cgi?id=96379

Patch by Christophe Dumez <Christophe Dumez> on 2012-09-11
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add Bundle C API to set the application cache quota for a
given security origin. This is needed by WebKitTestRunner
to implement setApplicationCacheOriginQuota().

  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleSetApplicationCacheOriginQuota):

  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setApplicationCacheOriginQuota):
(WebKit):

  • WebProcess/InjectedBundle/InjectedBundle.h:

(InjectedBundle):

Tools:

Add implementation for setApplicationCacheOriginQuota
to WebKitTestRunner.

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setApplicationCacheOriginQuota):
(WTR):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:

(TestRunner):

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r128186 r128190  
     12012-09-11  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2][WKTR] TestRunner needs to implement setApplicationCacheOriginQuota
     4        https://bugs.webkit.org/show_bug.cgi?id=96379
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add Bundle C API to set the application cache quota for a
     9        given security origin. This is needed by WebKitTestRunner
     10        to implement setApplicationCacheOriginQuota().
     11
     12        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     13        (WKBundleSetApplicationCacheOriginQuota):
     14        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
     15        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     16        (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
     17        (WebKit):
     18        * WebProcess/InjectedBundle/InjectedBundle.h:
     19        (InjectedBundle):
     20
    1212012-09-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    222
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r128186 r128190  
    247247}
    248248
     249void WKBundleSetApplicationCacheOriginQuota(WKBundleRef bundleRef, WKStringRef origin, uint64_t bytes)
     250{
     251    return toImpl(bundleRef)->setApplicationCacheOriginQuota(toImpl(origin)->string(), bytes);
     252}
     253
    249254void WKBundleSetMinimumTimerInterval(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, double seconds)
    250255{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h

    r128186 r128190  
    9999WK_EXPORT void WKBundleSetAppCacheMaximumSize(WKBundleRef bundle, uint64_t size);
    100100WK_EXPORT uint64_t WKBundleGetAppCacheUsageForOrigin(WKBundleRef bundle, WKStringRef origin);
     101WK_EXPORT void WKBundleSetApplicationCacheOriginQuota(WKBundleRef bundle, WKStringRef origin, uint64_t bytes);
    101102
    102103// Garbage collection API
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r128186 r128190  
    4848#include <JavaScriptCore/JSLock.h>
    4949#include <WebCore/ApplicationCache.h>
     50#include <WebCore/ApplicationCacheStorage.h>
    5051#include <WebCore/Frame.h>
    5152#include <WebCore/FrameView.h>
     
    352353}
    353354
     355void InjectedBundle::setApplicationCacheOriginQuota(const String& originString, uint64_t bytes)
     356{
     357    RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromString(originString);
     358    cacheStorage().storeUpdatedQuotaForOrigin(origin.get(), bytes);
     359}
     360
    354361int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
    355362{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

    r128186 r128190  
    150150    void setAppCacheMaximumSize(uint64_t);
    151151    uint64_t appCacheUsageForOrigin(const String& origin);
     152    void setApplicationCacheOriginQuota(const String& origin, uint64_t);
    152153
    153154    // Garbage collection API
  • trunk/Tools/ChangeLog

    r128189 r128190  
     12012-09-11  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2][WKTR] TestRunner needs to implement setApplicationCacheOriginQuota
     4        https://bugs.webkit.org/show_bug.cgi?id=96379
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add implementation for setApplicationCacheOriginQuota
     9        to WebKitTestRunner.
     10
     11        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     12        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     13        (WTR::TestRunner::setApplicationCacheOriginQuota):
     14        (WTR):
     15        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     16        (TestRunner):
     17
    1182012-09-11  Luciano Wolf  <luciano.wolf@openbossa.org>
    219
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r128186 r128190  
    112112        long long applicationCacheDiskUsageForOrigin(in DOMString origin);
    113113        void clearApplicationCacheForOrigin(in DOMString name);
     114        void setApplicationCacheOriginQuota(in unsigned long long bytes);
    114115
    115116        // Compositing testing.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r128186 r128190  
    318318}
    319319
     320void TestRunner::setApplicationCacheOriginQuota(unsigned long long bytes)
     321{
     322    WKRetainPtr<WKStringRef> origin(AdoptWK, WKStringCreateWithUTF8CString("http://127.0.0.1:8000"));
     323    WKBundleSetApplicationCacheOriginQuota(InjectedBundle::shared().bundle(), origin.get(), bytes);
     324}
     325
    320326bool TestRunner::isCommandEnabled(JSStringRef name)
    321327{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r128186 r128190  
    149149    void setAppCacheMaximumSize(uint64_t);
    150150    long long applicationCacheDiskUsageForOrigin(JSStringRef origin);
     151    void setApplicationCacheOriginQuota(unsigned long long);
    151152
    152153    // Printing
Note: See TracChangeset for help on using the changeset viewer.