1/* 2 * Copyright (C) 2012 Intel Corporation. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 * THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#ifndef ErrorsEfl_h 27#define ErrorsEfl_h 28 29#include <wtf/text/WTFString.h> 30 31namespace WebCore { 32 33class ResourceError; 34class ResourceRequest; 35class ResourceResponse; 36class URL; 37 38static const char errorDomainNetwork[] = "WebKitNetworkError"; 39static const char errorDomainPolicy[] = "WebKitPolicyError"; 40static const char errorDomainPlugin[] = "WebKitPluginError"; 41static const char errorDomainDownload[] = "WebKitDownloadError"; 42static const char errorDomainPrint[] = "WebKitPrintError"; 43 44enum NetworkError { 45 NetworkErrorFailed = 399, 46 NetworkErrorTransport = 300, 47 NetworkErrorUnknownProtocol = 301, 48 NetworkErrorCancelled = 302, 49 NetworkErrorFileDoesNotExist = 303 50}; 51 52// Sync'd with Mac's WebKit Errors at: 53// Source/WebKit/mac/Misc/WebKitErrors[Private].h 54enum PolicyError { 55 PolicyErrorFailed = 199, 56 PolicyErrorCannotShowMimeType = 100, 57 PolicyErrorCannotShowURL = 101, 58 PolicyErrorFrameLoadInterruptedByPolicyChange = 102, 59 PolicyErrorCannotUseRestrictedPort = 103 60}; 61 62enum PluginError { 63 PluginErrorFailed = 299, 64 PluginErrorCannotFindPlugin = 200, 65 PluginErrorCannotLoadPlugin = 201, 66 PluginErrorJavaUnavailable = 202, 67 PluginErrorConnectionCancelled = 203, 68 PluginErrorWillHandleLoad = 204 69}; 70 71enum DownloadError { 72 DownloadErrorNetwork = 499, 73 DownloadErrorCancelledByUser = 400, 74 DownloadErrorDestination = 401 75}; 76 77enum PrintError { 78 PrintErrorGeneral = 599, 79 PrintErrorPrinterNotFound = 500, 80 PrintErrorInvalidPageRange = 501 81}; 82 83ResourceError cancelledError(const ResourceRequest&); 84ResourceError blockedError(const ResourceRequest&); 85ResourceError cannotShowURLError(const ResourceRequest&); 86ResourceError interruptedForPolicyChangeError(const ResourceRequest&); 87ResourceError cannotShowMIMETypeError(const ResourceResponse&); 88ResourceError fileDoesNotExistError(const ResourceResponse&); 89ResourceError pluginWillHandleLoadError(const ResourceResponse&); 90ResourceError downloadNetworkError(const ResourceError&); 91ResourceError downloadCancelledByUserError(const ResourceResponse&); 92ResourceError downloadDestinationError(const ResourceResponse&, const String& errorMessage); 93ResourceError printError(const URL& failingURL, const String& errorMessage); 94ResourceError printerNotFoundError(const URL& failingURL); 95ResourceError invalidPageRangeToPrint(const URL& failingURL); 96 97} 98 99#endif // ErrorsEfl_h 100