OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (ec) | 73 if (ec) |
74 return 0; | 74 return 0; |
75 | 75 |
76 if (!audio && !video) | 76 if (!audio && !video) |
77 return 0; | 77 return 0; |
78 | 78 |
79 return adoptRef(new UserMediaRequest(context, controller, audio.release(), v
ideo.release(), successCallback, errorCallback)); | 79 return adoptRef(new UserMediaRequest(context, controller, audio.release(), v
ideo.release(), successCallback, errorCallback)); |
80 } | 80 } |
81 | 81 |
82 UserMediaRequest::UserMediaRequest(ScriptExecutionContext* context, UserMediaCon
troller* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaCon
straintsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallba
ck, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback) | 82 UserMediaRequest::UserMediaRequest(ScriptExecutionContext* context, UserMediaCon
troller* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaCon
straintsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallba
ck, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback) |
83 : ContextDestructionObserver(context) | 83 : ContextLifecycleObserver(context) |
84 , m_audio(audio) | 84 , m_audio(audio) |
85 , m_video(video) | 85 , m_video(video) |
86 , m_controller(controller) | 86 , m_controller(controller) |
87 , m_successCallback(successCallback) | 87 , m_successCallback(successCallback) |
88 , m_errorCallback(errorCallback) | 88 , m_errorCallback(errorCallback) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 UserMediaRequest::~UserMediaRequest() | 92 UserMediaRequest::~UserMediaRequest() |
93 { | 93 { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 void UserMediaRequest::contextDestroyed() | 179 void UserMediaRequest::contextDestroyed() |
180 { | 180 { |
181 RefPtr<UserMediaRequest> protect(this); | 181 RefPtr<UserMediaRequest> protect(this); |
182 | 182 |
183 if (m_controller) { | 183 if (m_controller) { |
184 m_controller->cancelUserMediaRequest(this); | 184 m_controller->cancelUserMediaRequest(this); |
185 m_controller = 0; | 185 m_controller = 0; |
186 } | 186 } |
187 | 187 |
188 ContextDestructionObserver::contextDestroyed(); | 188 ContextLifecycleObserver::contextDestroyed(); |
189 } | 189 } |
190 | 190 |
191 } // namespace WebCore | 191 } // namespace WebCore |
OLD | NEW |