| Index: third_party/WebKit/Source/web/IndexedDBClientImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp b/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp
|
| index 5a1b9002a53ddbc0786aa461d98306f730d9deeb..f3303ff35a9ee8326a18f9b27e58bdb85316ade7 100644
|
| --- a/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
|
| #include "core/dom/Document.h"
|
| +#include "core/dom/ExecutionContext.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "platform/weborigin/SecurityOrigin.h"
|
| #include "public/platform/WebSecurityOrigin.h"
|
| @@ -45,20 +46,37 @@ IndexedDBClient* IndexedDBClientImpl::create()
|
| return new IndexedDBClientImpl();
|
| }
|
|
|
| +IndexedDBClientImpl::~IndexedDBClientImpl()
|
| +{
|
| +}
|
| +
|
| +DEFINE_TRACE(IndexedDBClientImpl)
|
| +{
|
| + IndexedDBClient::trace(visitor);
|
| +}
|
| +
|
| bool IndexedDBClientImpl::allowIndexedDB(ExecutionContext* context, const String& name)
|
| {
|
| + DCHECK(context->isContextThread());
|
| ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope());
|
|
|
| if (context->isDocument()) {
|
| WebSecurityOrigin origin(context->getSecurityOrigin());
|
| Document* document = toDocument(context);
|
| WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
|
| - // FIXME: webFrame->contentSettingsClient() returns 0 in test_shell and content_shell http://crbug.com/137269
|
| - return !webFrame->contentSettingsClient() || webFrame->contentSettingsClient()->allowIndexedDB(name, origin);
|
| + if (!webFrame)
|
| + return false;
|
| + if (webFrame->contentSettingsClient())
|
| + return webFrame->contentSettingsClient()->allowIndexedDB(name, origin);
|
| + return true;
|
| }
|
|
|
| WorkerGlobalScope& workerGlobalScope = *toWorkerGlobalScope(context);
|
| return WorkerContentSettingsClient::from(workerGlobalScope)->allowIndexedDB(name);
|
| }
|
|
|
| +IndexedDBClientImpl::IndexedDBClientImpl()
|
| +{
|
| +}
|
| +
|
| } // namespace blink
|
|
|