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 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 #ifndef ResourceError_h | 27 #ifndef ResourceError_h |
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 // An internal error code. Used to note a policy change error resulting from | |
37 // dispatchDecidePolicyForMIMEType not passing the PolicyUse option. | |
38 extern const int policyChangeError; | |
darin (slow to review)
2013/04/16 20:25:39
nit: this is a bit of a layering violation. platf
Nate Chapin
2013/04/16 20:40:43
I'm wondering if we actually need to differentiate
| |
39 | |
36 class ResourceError { | 40 class ResourceError { |
37 public: | 41 public: |
42 static ResourceError createCancelledError(const String& failingURL); | |
darin (slow to review)
2013/04/16 20:25:39
nit: create* methods usually return a heap allocat
| |
43 static ResourceError createPolicyChangeError(const String& failingURL); | |
44 | |
38 ResourceError() | 45 ResourceError() |
39 : m_errorCode(0) | 46 : m_errorCode(0) |
40 , m_isNull(true) | 47 , m_isNull(true) |
41 , m_isCancellation(false) | 48 , m_isCancellation(false) |
42 , m_isTimeout(false) | 49 , m_isTimeout(false) |
43 { | 50 { |
44 } | 51 } |
45 | 52 |
46 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) |
47 : m_domain(domain) | 54 : m_domain(domain) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 bool m_isCancellation; | 88 bool m_isCancellation; |
82 bool m_isTimeout; | 89 bool m_isTimeout; |
83 }; | 90 }; |
84 | 91 |
85 inline bool operator==(const ResourceError& a, const ResourceError& b) { return ResourceError::compare(a, b); } | 92 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); } | 93 inline bool operator!=(const ResourceError& a, const ResourceError& b) { return !(a == b); } |
87 | 94 |
88 } // namespace WebCore | 95 } // namespace WebCore |
89 | 96 |
90 #endif // ResourceError_h | 97 #endif // ResourceError_h |
OLD | NEW |