Changeset 85966 in webkit


Ignore:
Timestamp:
May 6, 2011 12:09:31 PM (13 years ago)
Author:
jam@chromium.org
Message:

2011-05-06 John Abd-El-Malek <jam@chromium.org>

Reviewed by James Robinson.

[chromium]: Reland using WebPermissionClient for checking indexed db usage
https://bugs.webkit.org/show_bug.cgi?id=60386

  • public/WebPermissionClient.h: (WebKit::WebPermissionClient::allowIndexedDB):
  • src/IDBFactoryBackendProxy.cpp: (WebKit::IDBFactoryBackendProxy::open):
Location:
trunk/Source/WebKit/chromium
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r85954 r85966  
     12011-05-06  John Abd-El-Malek  <jam@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium]: Reland using WebPermissionClient for checking indexed db usage
     6        https://bugs.webkit.org/show_bug.cgi?id=60386
     7
     8        * public/WebPermissionClient.h:
     9        (WebKit::WebPermissionClient::allowIndexedDB):
     10        * src/IDBFactoryBackendProxy.cpp:
     11        (WebKit::IDBFactoryBackendProxy::open):
     12
    1132011-05-06  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebKit/chromium/public/WebPermissionClient.h

    r85954 r85966  
    3535
    3636class WebFrame;
     37class WebSecurityOrigin;
    3738class WebString;
    3839
     
    4445    // Controls whether images are allowed for this frame.
    4546    virtual bool allowImages(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
     47
     48    // Controls whether access to Indexed DB are allowed for this frame.
     49    virtual bool allowIndexedDB(WebFrame*, const WebString& name, const WebSecurityOrigin&) { return true; }
    4650
    4751    // Controls whether plugins are allowed for this frame.
  • trunk/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp

    r85954 r85966  
    4343#include "WebKit.h"
    4444#include "WebKitClient.h"
     45#include "WebPermissionClient.h"
    4546#include "WebVector.h"
     47#include "WebViewImpl.h"
    4648
    4749using namespace WebCore;
     
    6365}
    6466
    65 void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType)
     67void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType)
    6668{
    67     WebFrame* webFrame = WebFrameImpl::fromFrame(frame);
     69    WebSecurityOrigin origin(prpOrigin);
     70    WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
     71    WebViewImpl* webView = webFrame->viewImpl();
     72    if (webView->permissionClient() && !webView->permissionClient()->allowIndexedDB(webFrame, name, origin)) {
     73        callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to access the database."));
     74        return;
     75    }
     76
    6877    m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType));
    6978}
Note: See TracChangeset for help on using the changeset viewer.