OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef NavigatorUserMediaError_h | 25 #ifndef NavigatorUserMediaError_h |
26 #define NavigatorUserMediaError_h | 26 #define NavigatorUserMediaError_h |
27 | 27 |
28 #include "bindings/v8/ScriptWrappable.h" | 28 #include "bindings/v8/ScriptWrappable.h" |
29 #include "wtf/PassRefPtr.h" | 29 #include "wtf/PassRefPtr.h" |
30 #include "wtf/RefCounted.h" | 30 #include "wtf/RefCounted.h" |
| 31 #include "wtf/text/WTFString.h" |
31 | 32 |
32 namespace WebCore { | 33 namespace WebCore { |
33 | 34 |
34 class NavigatorUserMediaError : public RefCounted<NavigatorUserMediaError>, publ
ic ScriptWrappable { | 35 class NavigatorUserMediaError : public RefCounted<NavigatorUserMediaError>, publ
ic ScriptWrappable { |
35 public: | 36 public: |
36 static PassRefPtr<NavigatorUserMediaError> create(const String& name, const
String& message, const String& constraintName) | 37 enum Name { |
| 38 NamePermissionDenied, |
| 39 NameConstraintNotSatisfied |
| 40 }; |
| 41 |
| 42 static PassRefPtr<NavigatorUserMediaError> create(Name name, const String& m
essage, const String& constraintName) |
37 { | 43 { |
38 return adoptRef(new NavigatorUserMediaError(name, message, constraintNam
e)); | 44 return adoptRef(new NavigatorUserMediaError(name, message, constraintNam
e)); |
39 } | 45 } |
40 | 46 |
41 virtual ~NavigatorUserMediaError() { } | 47 virtual ~NavigatorUserMediaError() { } |
42 | 48 |
43 const String& name() const { return m_name; } | 49 String name() const; |
44 const String& message() const { return m_message; } | 50 const String& message() const { return m_message; } |
45 const String& constraintName() const { return m_constraintName; } | 51 const String& constraintName() const { return m_constraintName; } |
46 | 52 |
47 private: | 53 private: |
48 NavigatorUserMediaError(const String& name, const String& message, const Str
ing& constraintName) : m_name(name), m_message(message), m_constraintName(constr
aintName) | 54 NavigatorUserMediaError(Name name, const String& message, const String& cons
traintName) |
| 55 : m_name(name), m_message(message), m_constraintName(constraintName) |
49 { | 56 { |
50 ScriptWrappable::init(this); | 57 ScriptWrappable::init(this); |
51 } | 58 } |
52 | 59 |
53 String m_name; | 60 Name m_name; |
54 String m_message; | 61 String m_message; |
55 String m_constraintName; | 62 String m_constraintName; |
56 }; | 63 }; |
57 | 64 |
58 } // namespace WebCore | 65 } // namespace WebCore |
59 | 66 |
60 #endif // NavigatorUserMediaError_h | 67 #endif // NavigatorUserMediaError_h |
OLD | NEW |