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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void setStaleCopyInCache(bool staleCopyInCache) { | 92 void setStaleCopyInCache(bool staleCopyInCache) { |
93 m_staleCopyInCache = staleCopyInCache; | 93 m_staleCopyInCache = staleCopyInCache; |
94 } | 94 } |
95 bool staleCopyInCache() const { return m_staleCopyInCache; } | 95 bool staleCopyInCache() const { return m_staleCopyInCache; } |
96 | 96 |
97 void setWasIgnoredByHandler(bool ignoredByHandler) { | 97 void setWasIgnoredByHandler(bool ignoredByHandler) { |
98 m_wasIgnoredByHandler = ignoredByHandler; | 98 m_wasIgnoredByHandler = ignoredByHandler; |
99 } | 99 } |
100 bool wasIgnoredByHandler() const { return m_wasIgnoredByHandler; } | 100 bool wasIgnoredByHandler() const { return m_wasIgnoredByHandler; } |
101 | 101 |
| 102 bool isCacheMiss() const; |
| 103 |
102 static bool compare(const ResourceError&, const ResourceError&); | 104 static bool compare(const ResourceError&, const ResourceError&); |
103 | 105 |
104 private: | 106 private: |
105 String m_domain; | 107 String m_domain; |
106 int m_errorCode; | 108 int m_errorCode; |
107 String m_failingURL; | 109 String m_failingURL; |
108 String m_localizedDescription; | 110 String m_localizedDescription; |
109 bool m_isNull; | 111 bool m_isNull; |
110 bool m_isCancellation; | 112 bool m_isCancellation; |
111 bool m_isAccessCheck; | 113 bool m_isAccessCheck; |
112 bool m_isTimeout; | 114 bool m_isTimeout; |
113 bool m_staleCopyInCache; | 115 bool m_staleCopyInCache; |
114 bool m_wasIgnoredByHandler; | 116 bool m_wasIgnoredByHandler; |
115 }; | 117 }; |
116 | 118 |
117 inline bool operator==(const ResourceError& a, const ResourceError& b) { | 119 inline bool operator==(const ResourceError& a, const ResourceError& b) { |
118 return ResourceError::compare(a, b); | 120 return ResourceError::compare(a, b); |
119 } | 121 } |
120 inline bool operator!=(const ResourceError& a, const ResourceError& b) { | 122 inline bool operator!=(const ResourceError& a, const ResourceError& b) { |
121 return !(a == b); | 123 return !(a == b); |
122 } | 124 } |
123 | 125 |
124 // Pretty printer for gtest. Declared here to avoid ODR violations. | 126 // Pretty printer for gtest. Declared here to avoid ODR violations. |
125 std::ostream& operator<<(std::ostream&, const ResourceError&); | 127 std::ostream& operator<<(std::ostream&, const ResourceError&); |
126 | 128 |
127 } // namespace blink | 129 } // namespace blink |
128 | 130 |
129 #endif // ResourceError_h | 131 #endif // ResourceError_h |
OLD | NEW |