| 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 16 matching lines...) Expand all Loading... |
| 27 #ifndef ResourceError_h | 27 #ifndef ResourceError_h |
| 28 #define ResourceError_h | 28 #define ResourceError_h |
| 29 | 29 |
| 30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
| 31 #include "wtf/Allocator.h" | 31 #include "wtf/Allocator.h" |
| 32 #include "wtf/text/WTFString.h" | 32 #include "wtf/text/WTFString.h" |
| 33 #include <iosfwd> | 33 #include <iosfwd> |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 PLATFORM_EXPORT extern const char errorDomainBlinkInternal | 37 // Used for errors that won't be exposed to clients. |
| 38 []; // Used for errors that won't be exposed to clients. | 38 PLATFORM_EXPORT extern const char errorDomainBlinkInternal[]; |
| 39 | 39 |
| 40 class PLATFORM_EXPORT ResourceError final { | 40 class PLATFORM_EXPORT ResourceError final { |
| 41 DISALLOW_NEW(); | 41 DISALLOW_NEW(); |
| 42 | 42 |
| 43 public: | 43 public: |
| 44 static ResourceError cancelledError(const String& failingURL); | 44 static ResourceError cancelledError(const String& failingURL); |
| 45 static ResourceError cancelledDueToAccessCheckError(const String& failingURL); | 45 static ResourceError cancelledDueToAccessCheckError(const String& failingURL); |
| 46 | 46 |
| 47 ResourceError() | 47 ResourceError() |
| 48 : m_errorCode(0), | 48 : m_errorCode(0), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 m_errorCode(errorCode), | 61 m_errorCode(errorCode), |
| 62 m_failingURL(failingURL), | 62 m_failingURL(failingURL), |
| 63 m_localizedDescription(localizedDescription), | 63 m_localizedDescription(localizedDescription), |
| 64 m_isNull(false), | 64 m_isNull(false), |
| 65 m_isCancellation(false), | 65 m_isCancellation(false), |
| 66 m_isAccessCheck(false), | 66 m_isAccessCheck(false), |
| 67 m_isTimeout(false), | 67 m_isTimeout(false), |
| 68 m_staleCopyInCache(false), | 68 m_staleCopyInCache(false), |
| 69 m_wasIgnoredByHandler(false) {} | 69 m_wasIgnoredByHandler(false) {} |
| 70 | 70 |
| 71 // Makes a deep copy. Useful for when you need to use a ResourceError on anoth
er thread. | 71 // Makes a deep copy. Useful for when you need to use a ResourceError on |
| 72 // another thread. |
| 72 ResourceError copy() const; | 73 ResourceError copy() const; |
| 73 | 74 |
| 74 bool isNull() const { return m_isNull; } | 75 bool isNull() const { return m_isNull; } |
| 75 | 76 |
| 76 const String& domain() const { return m_domain; } | 77 const String& domain() const { return m_domain; } |
| 77 int errorCode() const { return m_errorCode; } | 78 int errorCode() const { return m_errorCode; } |
| 78 const String& failingURL() const { return m_failingURL; } | 79 const String& failingURL() const { return m_failingURL; } |
| 79 const String& localizedDescription() const { return m_localizedDescription; } | 80 const String& localizedDescription() const { return m_localizedDescription; } |
| 80 | 81 |
| 81 void setIsCancellation(bool isCancellation) { | 82 void setIsCancellation(bool isCancellation) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 inline bool operator!=(const ResourceError& a, const ResourceError& b) { | 120 inline bool operator!=(const ResourceError& a, const ResourceError& b) { |
| 120 return !(a == b); | 121 return !(a == b); |
| 121 } | 122 } |
| 122 | 123 |
| 123 // Pretty printer for gtest. Declared here to avoid ODR violations. | 124 // Pretty printer for gtest. Declared here to avoid ODR violations. |
| 124 std::ostream& operator<<(std::ostream&, const ResourceError&); | 125 std::ostream& operator<<(std::ostream&, const ResourceError&); |
| 125 | 126 |
| 126 } // namespace blink | 127 } // namespace blink |
| 127 | 128 |
| 128 #endif // ResourceError_h | 129 #endif // ResourceError_h |
| OLD | NEW |