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..50aa1872b7e1d3a73e63df762ed025b9a0d5d327 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" |
@@ -47,14 +48,18 @@ IndexedDBClient* IndexedDBClientImpl::create() |
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); |