Chromium Code Reviews| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 return WebUserMediaRequest(request); | 55 return WebUserMediaRequest(request); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void WebUserMediaRequest::reset() | 58 void WebUserMediaRequest::reset() |
| 59 { | 59 { |
| 60 m_private.reset(); | 60 m_private.reset(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool WebUserMediaRequest::audio() const | 63 bool WebUserMediaRequest::audio() const |
| 64 { | 64 { |
| 65 ASSERT(!isNull()); | 65 DCHECK(!isNull()); |
| 66 return m_private->audio(); | 66 return m_private->audio(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool WebUserMediaRequest::video() const | 69 bool WebUserMediaRequest::video() const |
| 70 { | 70 { |
| 71 ASSERT(!isNull()); | 71 DCHECK(!isNull()); |
| 72 return m_private->video(); | 72 return m_private->video(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 WebMediaConstraints WebUserMediaRequest::audioConstraints() const | 75 WebMediaConstraints WebUserMediaRequest::audioConstraints() const |
| 76 { | 76 { |
| 77 ASSERT(!isNull()); | 77 DCHECK(!isNull()); |
| 78 return m_private->audioConstraints(); | 78 return m_private->audioConstraints(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 WebMediaConstraints WebUserMediaRequest::videoConstraints() const | 81 WebMediaConstraints WebUserMediaRequest::videoConstraints() const |
| 82 { | 82 { |
| 83 ASSERT(!isNull()); | 83 DCHECK(!isNull()); |
| 84 return m_private->videoConstraints(); | 84 return m_private->videoConstraints(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 WebSecurityOrigin WebUserMediaRequest::getSecurityOrigin() const | 87 WebSecurityOrigin WebUserMediaRequest::getSecurityOrigin() const |
| 88 { | 88 { |
| 89 ASSERT(!isNull()); | 89 DCHECK(!isNull()); |
| 90 if (!m_private->getExecutionContext()) | 90 if (!m_private->getExecutionContext()) |
| 91 return WebSecurityOrigin::createFromString("test://test"); | 91 return WebSecurityOrigin::createFromString("test://test"); |
| 92 return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin ()); | 92 return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin ()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 WebDocument WebUserMediaRequest::ownerDocument() const | 95 WebDocument WebUserMediaRequest::ownerDocument() const |
| 96 { | 96 { |
| 97 ASSERT(!isNull()); | 97 DCHECK(!isNull()); |
| 98 return WebDocument(m_private->ownerDocument()); | 98 return WebDocument(m_private->ownerDocument()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void WebUserMediaRequest::requestSucceeded(const WebMediaStream& streamDescripto r) | 101 void WebUserMediaRequest::requestSucceeded(const WebMediaStream& streamDescripto r) |
| 102 { | 102 { |
| 103 ASSERT(!isNull() && !streamDescriptor.isNull()); | 103 DCHECK(!isNull() && !streamDescriptor.isNull()); |
|
tkent
2016/03/31 23:05:21
Please split this into two.
DCHECK(!isNull());
| |
| 104 m_private->succeed(streamDescriptor); | 104 m_private->succeed(streamDescriptor); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void WebUserMediaRequest::requestDenied(const WebString& description) | 107 void WebUserMediaRequest::requestDenied(const WebString& description) |
| 108 { | 108 { |
| 109 ASSERT(!isNull()); | 109 DCHECK(!isNull()); |
| 110 m_private->failPermissionDenied(description); | 110 m_private->failPermissionDenied(description); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WebUserMediaRequest::requestFailedConstraint(const WebString& constraintNam e, const WebString& description) | 113 void WebUserMediaRequest::requestFailedConstraint(const WebString& constraintNam e, const WebString& description) |
| 114 { | 114 { |
| 115 ASSERT(!isNull()); | 115 DCHECK(!isNull()); |
| 116 m_private->failConstraint(constraintName, description); | 116 m_private->failConstraint(constraintName, description); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void WebUserMediaRequest::requestFailedUASpecific(const WebString& name, const W ebString& constraintName, const WebString& description) | 119 void WebUserMediaRequest::requestFailedUASpecific(const WebString& name, const W ebString& constraintName, const WebString& description) |
| 120 { | 120 { |
| 121 ASSERT(!isNull()); | 121 DCHECK(!isNull()); |
| 122 m_private->failUASpecific(name, constraintName, description); | 122 m_private->failUASpecific(name, constraintName, description); |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const | 125 bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const |
| 126 { | 126 { |
| 127 if (isNull() || other.isNull()) | 127 if (isNull() || other.isNull()) |
| 128 return false; | 128 return false; |
| 129 return m_private.get() == other.m_private.get(); | 129 return m_private.get() == other.m_private.get(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void WebUserMediaRequest::assign(const WebUserMediaRequest& other) | 132 void WebUserMediaRequest::assign(const WebUserMediaRequest& other) |
| 133 { | 133 { |
| 134 m_private = other.m_private; | 134 m_private = other.m_private; |
| 135 } | 135 } |
| 136 | 136 |
| 137 WebUserMediaRequest::operator UserMediaRequest*() const | 137 WebUserMediaRequest::operator UserMediaRequest*() const |
| 138 { | 138 { |
| 139 return m_private.get(); | 139 return m_private.get(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |