OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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" | |
6 #include "modules/cachestorage/CacheStorageError.h" | 5 #include "modules/cachestorage/CacheStorageError.h" |
7 | 6 |
8 #include "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
9 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
10 #include "modules/cachestorage/Cache.h" | 9 #include "modules/cachestorage/Cache.h" |
11 #include "public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" | 10 #include "public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 DOMException* CacheStorageError::createException(WebServiceWorkerCacheError webE
rror) | 14 DOMException* CacheStorageError::createException(WebServiceWorkerCacheError webE
rror) |
16 { | 15 { |
17 switch (webError) { | 16 switch (webError) { |
18 case WebServiceWorkerCacheErrorNotImplemented: | 17 case WebServiceWorkerCacheErrorNotImplemented: |
19 return DOMException::create(NotSupportedError, "Method is not implemente
d."); | 18 return DOMException::create(NotSupportedError, "Method is not implemente
d."); |
20 case WebServiceWorkerCacheErrorNotFound: | 19 case WebServiceWorkerCacheErrorNotFound: |
21 return DOMException::create(NotFoundError, "Entry was not found."); | 20 return DOMException::create(NotFoundError, "Entry was not found."); |
22 case WebServiceWorkerCacheErrorExists: | 21 case WebServiceWorkerCacheErrorExists: |
23 return DOMException::create(InvalidAccessError, "Entry already exists.")
; | 22 return DOMException::create(InvalidAccessError, "Entry already exists.")
; |
24 default: | 23 default: |
25 ASSERT_NOT_REACHED(); | 24 ASSERT_NOT_REACHED(); |
26 return DOMException::create(NotSupportedError, "Unknown error."); | 25 return DOMException::create(NotSupportedError, "Unknown error."); |
27 } | 26 } |
28 } | 27 } |
29 | 28 |
30 } // namespace blink | 29 } // namespace blink |
OLD | NEW |