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 28 matching lines...) Expand all Loading... |
39 static ResourceError cancelledError(const String& failingURL); | 39 static ResourceError cancelledError(const String& failingURL); |
40 static ResourceError cancelledDueToAccessCheckError(const String& failingURL
); | 40 static ResourceError cancelledDueToAccessCheckError(const String& failingURL
); |
41 | 41 |
42 ResourceError() | 42 ResourceError() |
43 : m_errorCode(0) | 43 : m_errorCode(0) |
44 , m_isNull(true) | 44 , m_isNull(true) |
45 , m_isCancellation(false) | 45 , m_isCancellation(false) |
46 , m_isAccessCheck(false) | 46 , m_isAccessCheck(false) |
47 , m_isTimeout(false) | 47 , m_isTimeout(false) |
48 , m_staleCopyInCache(false) | 48 , m_staleCopyInCache(false) |
| 49 , m_wasIgnoredByHandler(false) |
49 { | 50 { |
50 } | 51 } |
51 | 52 |
52 ResourceError(const String& domain, int errorCode, const String& failingURL,
const String& localizedDescription) | 53 ResourceError(const String& domain, int errorCode, const String& failingURL,
const String& localizedDescription) |
53 : m_domain(domain) | 54 : m_domain(domain) |
54 , m_errorCode(errorCode) | 55 , m_errorCode(errorCode) |
55 , m_failingURL(failingURL) | 56 , m_failingURL(failingURL) |
56 , m_localizedDescription(localizedDescription) | 57 , m_localizedDescription(localizedDescription) |
57 , m_isNull(false) | 58 , m_isNull(false) |
58 , m_isCancellation(false) | 59 , m_isCancellation(false) |
59 , m_isAccessCheck(false) | 60 , m_isAccessCheck(false) |
60 , m_isTimeout(false) | 61 , m_isTimeout(false) |
61 , m_staleCopyInCache(false) | 62 , m_staleCopyInCache(false) |
| 63 , m_wasIgnoredByHandler(false) |
62 { | 64 { |
63 } | 65 } |
64 | 66 |
65 // Makes a deep copy. Useful for when you need to use a ResourceError on ano
ther thread. | 67 // Makes a deep copy. Useful for when you need to use a ResourceError on ano
ther thread. |
66 ResourceError copy() const; | 68 ResourceError copy() const; |
67 | 69 |
68 bool isNull() const { return m_isNull; } | 70 bool isNull() const { return m_isNull; } |
69 | 71 |
70 const String& domain() const { return m_domain; } | 72 const String& domain() const { return m_domain; } |
71 int errorCode() const { return m_errorCode; } | 73 int errorCode() const { return m_errorCode; } |
72 const String& failingURL() const { return m_failingURL; } | 74 const String& failingURL() const { return m_failingURL; } |
73 const String& localizedDescription() const { return m_localizedDescription;
} | 75 const String& localizedDescription() const { return m_localizedDescription;
} |
74 | 76 |
75 void setIsCancellation(bool isCancellation) { m_isCancellation = isCancellat
ion; } | 77 void setIsCancellation(bool isCancellation) { m_isCancellation = isCancellat
ion; } |
76 bool isCancellation() const { return m_isCancellation; } | 78 bool isCancellation() const { return m_isCancellation; } |
77 | 79 |
78 void setIsAccessCheck(bool isAccessCheck) { m_isAccessCheck = isAccessCheck;
} | 80 void setIsAccessCheck(bool isAccessCheck) { m_isAccessCheck = isAccessCheck;
} |
79 bool isAccessCheck() const { return m_isAccessCheck; } | 81 bool isAccessCheck() const { return m_isAccessCheck; } |
80 | 82 |
81 void setIsTimeout(bool isTimeout) { m_isTimeout = isTimeout; } | 83 void setIsTimeout(bool isTimeout) { m_isTimeout = isTimeout; } |
82 bool isTimeout() const { return m_isTimeout; } | 84 bool isTimeout() const { return m_isTimeout; } |
83 void setStaleCopyInCache(bool staleCopyInCache) { m_staleCopyInCache = stale
CopyInCache; } | 85 void setStaleCopyInCache(bool staleCopyInCache) { m_staleCopyInCache = stale
CopyInCache; } |
84 bool staleCopyInCache() const { return m_staleCopyInCache; } | 86 bool staleCopyInCache() const { return m_staleCopyInCache; } |
85 | 87 |
| 88 void setWasIgnoredByHandler(bool ignoredByHandler) { m_wasIgnoredByHandler =
ignoredByHandler; } |
| 89 bool wasIgnoredByHandler() const { return m_wasIgnoredByHandler; } |
| 90 |
86 static bool compare(const ResourceError&, const ResourceError&); | 91 static bool compare(const ResourceError&, const ResourceError&); |
87 | 92 |
88 private: | 93 private: |
89 String m_domain; | 94 String m_domain; |
90 int m_errorCode; | 95 int m_errorCode; |
91 String m_failingURL; | 96 String m_failingURL; |
92 String m_localizedDescription; | 97 String m_localizedDescription; |
93 bool m_isNull; | 98 bool m_isNull; |
94 bool m_isCancellation; | 99 bool m_isCancellation; |
95 bool m_isAccessCheck; | 100 bool m_isAccessCheck; |
96 bool m_isTimeout; | 101 bool m_isTimeout; |
97 bool m_staleCopyInCache; | 102 bool m_staleCopyInCache; |
| 103 bool m_wasIgnoredByHandler; |
98 }; | 104 }; |
99 | 105 |
100 inline bool operator==(const ResourceError& a, const ResourceError& b) { return
ResourceError::compare(a, b); } | 106 inline bool operator==(const ResourceError& a, const ResourceError& b) { return
ResourceError::compare(a, b); } |
101 inline bool operator!=(const ResourceError& a, const ResourceError& b) { return
!(a == b); } | 107 inline bool operator!=(const ResourceError& a, const ResourceError& b) { return
!(a == b); } |
102 | 108 |
103 } // namespace blink | 109 } // namespace blink |
104 | 110 |
105 #endif // ResourceError_h | 111 #endif // ResourceError_h |
OLD | NEW |