Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 switch (webError.errorType) { | 48 switch (webError.errorType) { |
| 49 case WebServiceWorkerError::ErrorTypeAbort: | 49 case WebServiceWorkerError::ErrorTypeAbort: |
| 50 return createException(AbortError, "The Service Worker operation was abo rted.", webError.message); | 50 return createException(AbortError, "The Service Worker operation was abo rted.", webError.message); |
| 51 case WebServiceWorkerError::ErrorTypeActivate: | 51 case WebServiceWorkerError::ErrorTypeActivate: |
| 52 // Not currently returned as a promise rejection. | 52 // Not currently returned as a promise rejection. |
| 53 // FIXME: Introduce new ActivateError type to ExceptionCodes? | 53 // FIXME: Introduce new ActivateError type to ExceptionCodes? |
| 54 return createException(AbortError, "The Service Worker activation failed .", webError.message); | 54 return createException(AbortError, "The Service Worker activation failed .", webError.message); |
| 55 case WebServiceWorkerError::ErrorTypeDisabled: | 55 case WebServiceWorkerError::ErrorTypeDisabled: |
| 56 return createException(NotSupportedError, "Service Worker support is dis abled.", webError.message); | 56 return createException(NotSupportedError, "Service Worker support is dis abled.", webError.message); |
| 57 case WebServiceWorkerError::ErrorTypeInstall: | 57 case WebServiceWorkerError::ErrorTypeInstall: |
| 58 case WebServiceWorkerError::ErrorTypeScriptEvaluateFailed: | |
|
falken
2016/06/14 02:27:53
The SERVICE_WORKER_ERROR_SCRIPT_EVALUATE_FAILED er
e_hakkinen
2016/06/16 20:55:14
This is mainly for not to break other callers of t
falken
2016/06/17 02:12:14
It'd be unfortunate for each callsite to have to s
| |
| 58 // FIXME: Introduce new InstallError type to ExceptionCodes? | 59 // FIXME: Introduce new InstallError type to ExceptionCodes? |
| 59 return createException(AbortError, "The Service Worker installation fail ed.", webError.message); | 60 return createException(AbortError, "The Service Worker installation fail ed.", webError.message); |
| 60 case WebServiceWorkerError::ErrorTypeNavigation: | 61 case WebServiceWorkerError::ErrorTypeNavigation: |
| 61 // ErrorTypeNavigation should have bailed out before calling this. | 62 // ErrorTypeNavigation should have bailed out before calling this. |
| 62 ASSERT_NOT_REACHED(); | 63 ASSERT_NOT_REACHED(); |
| 63 return DOMException::create(UnknownError); | 64 return DOMException::create(UnknownError); |
| 64 case WebServiceWorkerError::ErrorTypeNetwork: | 65 case WebServiceWorkerError::ErrorTypeNetwork: |
| 65 return createException(NetworkError, "The Service Worker failed by netwo rk.", webError.message); | 66 return createException(NetworkError, "The Service Worker failed by netwo rk.", webError.message); |
| 66 case WebServiceWorkerError::ErrorTypeNotFound: | 67 case WebServiceWorkerError::ErrorTypeNotFound: |
| 67 return createException(NotFoundError, "The specified Service Worker reso urce was not found.", webError.message); | 68 return createException(NotFoundError, "The specified Service Worker reso urce was not found.", webError.message); |
| 68 case WebServiceWorkerError::ErrorTypeSecurity: | 69 case WebServiceWorkerError::ErrorTypeSecurity: |
| 69 return createException(SecurityError, "The Service Worker security polic y prevented an action.", webError.message); | 70 return createException(SecurityError, "The Service Worker security polic y prevented an action.", webError.message); |
| 70 case WebServiceWorkerError::ErrorTypeState: | 71 case WebServiceWorkerError::ErrorTypeState: |
| 71 return createException(InvalidStateError, "The Service Worker state was not valid.", webError.message); | 72 return createException(InvalidStateError, "The Service Worker state was not valid.", webError.message); |
| 72 case WebServiceWorkerError::ErrorTypeTimeout: | 73 case WebServiceWorkerError::ErrorTypeTimeout: |
| 73 return createException(AbortError, "The Service Worker operation timed o ut.", webError.message); | 74 return createException(AbortError, "The Service Worker operation timed o ut.", webError.message); |
| 74 case WebServiceWorkerError::ErrorTypeUnknown: | 75 case WebServiceWorkerError::ErrorTypeUnknown: |
| 75 return createException(UnknownError, "An unknown error occurred within S ervice Worker.", webError.message); | 76 return createException(UnknownError, "An unknown error occurred within S ervice Worker.", webError.message); |
| 76 case WebServiceWorkerError::ErrorTypeType: | 77 case WebServiceWorkerError::ErrorTypeType: |
| 77 // ErrorTypeType should have been handled before reaching this point. | 78 // ErrorTypeType should have been handled before reaching this point. |
| 78 ASSERT_NOT_REACHED(); | 79 ASSERT_NOT_REACHED(); |
| 79 return DOMException::create(UnknownError); | 80 return DOMException::create(UnknownError); |
| 80 } | 81 } |
| 81 ASSERT_NOT_REACHED(); | 82 ASSERT_NOT_REACHED(); |
| 82 return DOMException::create(UnknownError); | 83 return DOMException::create(UnknownError); |
| 83 } | 84 } |
| 84 | 85 |
| 85 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |