Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/WebKit/Source/web/IndexedDBClientImpl.cpp

Issue 1865213006: Replace setIndexedDBClientCreateFunction madness with Supplements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify per review feedback Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « third_party/WebKit/Source/web/IndexedDBClientImpl.h ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698