Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 21 matching lines...) Expand all Loading... | |
| 32 #include "bindings/v8/ScriptWrappable.h" | 32 #include "bindings/v8/ScriptWrappable.h" |
| 33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 typedef int ExceptionCode; | 38 typedef int ExceptionCode; |
| 39 | 39 |
| 40 class DOMException : public RefCounted<DOMException>, public ScriptWrappable { | 40 class DOMException : public RefCounted<DOMException>, public ScriptWrappable { |
| 41 public: | 41 public: |
| 42 static PassRefPtr<DOMException> create(ExceptionCode); | 42 static PassRefPtr<DOMException> create(ExceptionCode, const char* message = 0); |
| 43 | 43 |
| 44 unsigned short code() const { return m_code; } | 44 unsigned short code() const { return m_code; } |
| 45 String name() const { return m_name; } | 45 String name() const { return m_name; } |
| 46 String message() const { return m_message; } | 46 String message() const { return m_message; } |
| 47 | 47 |
| 48 String toString() const; | 48 String toString() const; |
| 49 | 49 |
| 50 static String getErrorName(ExceptionCode); | 50 static String getErrorName(ExceptionCode); |
| 51 static String getErrorMessage(ExceptionCode); | 51 static String getErrorMessage(ExceptionCode); |
| 52 static unsigned short getLegacyErrorCode(ExceptionCode); | 52 static unsigned short getLegacyErrorCode(ExceptionCode); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 explicit DOMException(ExceptionCode); | 55 explicit DOMException(unsigned short m_code, const char* name, const char* m essage); |
|
Mike West
2013/07/10 09:40:30
You can drop 'explicit'.
arv (Not doing code reviews)
2013/07/10 15:37:24
Done.
| |
| 56 | 56 |
| 57 unsigned short m_code; | 57 unsigned short m_code; |
| 58 String m_name; | 58 String m_name; |
| 59 String m_message; | 59 String m_message; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace WebCore | 62 } // namespace WebCore |
| 63 | 63 |
| 64 #endif // DOMException_h | 64 #endif // DOMException_h |
| OLD | NEW |