OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 17 matching lines...) Expand all Loading... |
28 #define ResourceError_h | 28 #define ResourceError_h |
29 | 29 |
30 #include <wtf/text/WTFString.h> | 30 #include <wtf/text/WTFString.h> |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 extern const char* const errorDomainWebKitInternal; // Used for errors that won'
t be exposed to clients. | 34 extern const char* const errorDomainWebKitInternal; // Used for errors that won'
t be exposed to clients. |
35 | 35 |
36 class ResourceError { | 36 class ResourceError { |
37 public: | 37 public: |
| 38 static ResourceError cancelledError(const String& failingURL); |
| 39 |
38 ResourceError() | 40 ResourceError() |
39 : m_errorCode(0) | 41 : m_errorCode(0) |
40 , m_isNull(true) | 42 , m_isNull(true) |
41 , m_isCancellation(false) | 43 , m_isCancellation(false) |
42 , m_isTimeout(false) | 44 , m_isTimeout(false) |
43 { | 45 { |
44 } | 46 } |
45 | 47 |
46 ResourceError(const String& domain, int errorCode, const String& failingURL,
const String& localizedDescription) | 48 ResourceError(const String& domain, int errorCode, const String& failingURL,
const String& localizedDescription) |
47 : m_domain(domain) | 49 : m_domain(domain) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool m_isCancellation; | 83 bool m_isCancellation; |
82 bool m_isTimeout; | 84 bool m_isTimeout; |
83 }; | 85 }; |
84 | 86 |
85 inline bool operator==(const ResourceError& a, const ResourceError& b) { return
ResourceError::compare(a, b); } | 87 inline bool operator==(const ResourceError& a, const ResourceError& b) { return
ResourceError::compare(a, b); } |
86 inline bool operator!=(const ResourceError& a, const ResourceError& b) { return
!(a == b); } | 88 inline bool operator!=(const ResourceError& a, const ResourceError& b) { return
!(a == b); } |
87 | 89 |
88 } // namespace WebCore | 90 } // namespace WebCore |
89 | 91 |
90 #endif // ResourceError_h | 92 #endif // ResourceError_h |
OLD | NEW |