| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/cachestorage/CacheStorage.h" | 6 #include "modules/cachestorage/CacheStorage.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool commonChecks(ScriptState* scriptState, ExceptionState& exceptionState) | 28 bool commonChecks(ScriptState* scriptState, ExceptionState& exceptionState) |
| 29 { | 29 { |
| 30 ExecutionContext* executionContext = scriptState->executionContext(); | 30 ExecutionContext* executionContext = scriptState->executionContext(); |
| 31 // FIXME: May be null due to worker termination: http://crbug.com/413518. | 31 // FIXME: May be null due to worker termination: http://crbug.com/413518. |
| 32 if (!executionContext) | 32 if (!executionContext) |
| 33 return false; | 33 return false; |
| 34 | 34 |
| 35 String errorMessage; | 35 String errorMessage; |
| 36 if (!executionContext->isPrivilegedContext(errorMessage)) { | 36 if (!executionContext->isSecureContext(errorMessage)) { |
| 37 exceptionState.throwSecurityError(errorMessage); | 37 exceptionState.throwSecurityError(errorMessage); |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void checkCacheQueryOptions(const CacheQueryOptions& options, ExecutionContext*
context) | 43 void checkCacheQueryOptions(const CacheQueryOptions& options, ExecutionContext*
context) |
| 44 { | 44 { |
| 45 if (options.ignoreSearch()) | 45 if (options.ignoreSearch()) |
| 46 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "Cache.match() does not support 'ignoreSearch' option yet. See h
ttp://crbug.com/520784")); | 46 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "Cache.match() does not support 'ignoreSearch' option yet. See h
ttp://crbug.com/520784")); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 m_webCacheStorage.clear(); | 340 m_webCacheStorage.clear(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 DEFINE_TRACE(CacheStorage) | 343 DEFINE_TRACE(CacheStorage) |
| 344 { | 344 { |
| 345 visitor->trace(m_scopedFetcher); | 345 visitor->trace(m_scopedFetcher); |
| 346 visitor->trace(m_nameToCacheMap); | 346 visitor->trace(m_nameToCacheMap); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace blink | 349 } // namespace blink |
| OLD | NEW |