Chromium Code Reviews| Index: Source/modules/cachestorage/Cache.cpp |
| diff --git a/Source/modules/cachestorage/Cache.cpp b/Source/modules/cachestorage/Cache.cpp |
| index 73c7f8a64a7ab64cd16ffe11f1e07517eb8ae14b..77d3b338018c1297909434d0ae198c53c7530321 100644 |
| --- a/Source/modules/cachestorage/Cache.cpp |
| +++ b/Source/modules/cachestorage/Cache.cpp |
| @@ -14,6 +14,7 @@ |
| #include "bindings/modules/v8/V8Response.h" |
| #include "core/dom/DOMException.h" |
| #include "core/dom/ExceptionCode.h" |
| +#include "core/inspector/ConsoleMessage.h" |
| #include "modules/cachestorage/CacheStorageError.h" |
| #include "modules/fetch/BodyStreamBuffer.h" |
| #include "modules/fetch/FetchDataLoader.h" |
| @@ -27,6 +28,16 @@ namespace blink { |
| namespace { |
| +void checkCacheQueryOptions(ExecutionContext* context, const CacheQueryOptions& options) |
|
jkarlin
2015/08/27 11:29:15
Switch the argument order as options is an input v
nhiroki
2015/08/27 13:41:53
Done.
|
| +{ |
| + 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. |
| class CacheMatchCallbacks : public WebServiceWorkerCache::CacheMatchCallbacks { |
| WTF_MAKE_NONCOPYABLE(CacheMatchCallbacks); |
| @@ -397,6 +408,7 @@ ScriptPromise Cache::matchImpl(ScriptState* scriptState, const Request* request, |
| { |
| WebServiceWorkerRequest webRequest; |
| request->populateWebServiceWorkerRequest(webRequest); |
| + checkCacheQueryOptions(scriptState->executionContext(), options); |
| ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| const ScriptPromise promise = resolver->promise(); |
| @@ -416,6 +428,7 @@ ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, const Request* reque |
| { |
| WebServiceWorkerRequest webRequest; |
| request->populateWebServiceWorkerRequest(webRequest); |
| + checkCacheQueryOptions(scriptState->executionContext(), options); |
| ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| const ScriptPromise promise = resolver->promise(); |
| @@ -450,6 +463,7 @@ ScriptPromise Cache::deleteImpl(ScriptState* scriptState, const Request* request |
| WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1)); |
| batchOperations[0].operationType = WebServiceWorkerCache::OperationTypeDelete; |
| request->populateWebServiceWorkerRequest(batchOperations[0].request); |
| + checkCacheQueryOptions(scriptState->executionContext(), options); |
| batchOperations[0].matchParams = toWebQueryParams(options); |
| ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| @@ -519,6 +533,7 @@ ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request, |
| { |
| WebServiceWorkerRequest webRequest; |
| request->populateWebServiceWorkerRequest(webRequest); |
| + checkCacheQueryOptions(scriptState->executionContext(), options); |
| ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); |
| const ScriptPromise promise = resolver->promise(); |