| 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 14 matching lines...) Expand all Loading... |
| 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 #include "wtf/text/WTFString.h" |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 class NavigatorUserMediaError FINAL : public RefCounted<NavigatorUserMediaError>
, public ScriptWrappable { | 35 class NavigatorUserMediaError FINAL : public RefCountedWillBeGarbageCollectedFin
alized<NavigatorUserMediaError>, public ScriptWrappable { |
| 36 public: | 36 public: |
| 37 enum Name { | 37 enum Name { |
| 38 NamePermissionDenied, | 38 NamePermissionDenied, |
| 39 NameConstraintNotSatisfied | 39 NameConstraintNotSatisfied |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 static PassRefPtr<NavigatorUserMediaError> create(Name name, const String& m
essage, const String& constraintName) | 42 static PassRefPtrWillBeRawPtr<NavigatorUserMediaError> create(Name name, con
st String& message, const String& constraintName) |
| 43 { | 43 { |
| 44 return adoptRef(new NavigatorUserMediaError(name, message, constraintNam
e)); | 44 return adoptRefWillBeNoop(new NavigatorUserMediaError(name, message, con
straintName)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 String name() const; | 47 String name() const; |
| 48 const String& message() const { return m_message; } | 48 const String& message() const { return m_message; } |
| 49 const String& constraintName() const { return m_constraintName; } | 49 const String& constraintName() const { return m_constraintName; } |
| 50 | 50 |
| 51 void trace(Visitor*) { } |
| 52 |
| 51 private: | 53 private: |
| 52 NavigatorUserMediaError(Name name, const String& message, const String& cons
traintName) | 54 NavigatorUserMediaError(Name name, const String& message, const String& cons
traintName) |
| 53 : m_name(name), m_message(message), m_constraintName(constraintName) | 55 : m_name(name), m_message(message), m_constraintName(constraintName) |
| 54 { | 56 { |
| 55 ScriptWrappable::init(this); | 57 ScriptWrappable::init(this); |
| 56 } | 58 } |
| 57 | 59 |
| 58 Name m_name; | 60 Name m_name; |
| 59 String m_message; | 61 String m_message; |
| 60 String m_constraintName; | 62 String m_constraintName; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } // namespace WebCore | 65 } // namespace WebCore |
| 64 | 66 |
| 65 #endif // NavigatorUserMediaError_h | 67 #endif // NavigatorUserMediaError_h |
| OLD | NEW |