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

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: remove obsolete #include 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..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

Powered by Google App Engine
This is Rietveld 408576698