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

Unified Diff: Source/modules/cachestorage/CacheStorage.cpp

Issue 1320823003: CacheStorage: Show a warning message when unsupported CacheQueryOptions are specified (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: swap arguments Created 5 years, 4 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
« no previous file with comments | « Source/modules/cachestorage/Cache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/cachestorage/CacheStorage.cpp
diff --git a/Source/modules/cachestorage/CacheStorage.cpp b/Source/modules/cachestorage/CacheStorage.cpp
index f6f4f0cf1280f7fe18b2dca35884369da1e59589..4fa27362c890dd96d5749ced0767ac578bf0bb0f 100644
--- a/Source/modules/cachestorage/CacheStorage.cpp
+++ b/Source/modules/cachestorage/CacheStorage.cpp
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptState.h"
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
+#include "core/inspector/ConsoleMessage.h"
#include "modules/cachestorage/CacheStorageError.h"
#include "modules/fetch/Request.h"
#include "modules/fetch/Response.h"
@@ -39,6 +40,16 @@ bool commonChecks(ScriptState* scriptState, ExceptionState& exceptionState)
return true;
}
+void checkCacheQueryOptions(const CacheQueryOptions& options, ExecutionContext* context)
+{
+ if (options.ignoreSearch())
+ context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Cache.match() does not support 'ignoreSearch' option yet. See http://crbug.com/520784"));
+ if (options.ignoreMethod())
+ context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Cache.match() does not support 'ignoreMethod' option yet. See http://crbug.com/482256"));
+ if (options.ignoreVary())
+ context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Cache.match() does not support 'ignoreVary' option yet. See http://crbug.com/499216"));
+}
+
}
// FIXME: Consider using CallbackPromiseAdapter.
@@ -301,6 +312,7 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState, const Request* r
{
WebServiceWorkerRequest webRequest;
request->populateWebServiceWorkerRequest(webRequest);
+ checkCacheQueryOptions(options, scriptState->executionContext());
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
const ScriptPromise promise = resolver->promise();
« no previous file with comments | « Source/modules/cachestorage/Cache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698