| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 else { | 56 else { |
| 57 bool mediaRequested = false; | 57 bool mediaRequested = false; |
| 58 options.get(mediaType, mediaRequested); | 58 options.get(mediaType, mediaRequested); |
| 59 if (mediaRequested) | 59 if (mediaRequested) |
| 60 constraints = MediaConstraintsImpl::create(); | 60 constraints = MediaConstraintsImpl::create(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 return constraints.release(); | 63 return constraints.release(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context,
UserMediaController* controller, const Dictionary& options, PassRefPtr<Navigato
rUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCa
llback> errorCallback, ExceptionState& exceptionState) | 66 PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context,
UserMediaController* controller, const Dictionary& options, PassOwnPtr<Navigato
rUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCa
llback> errorCallback, ExceptionState& exceptionState) |
| 67 { | 67 { |
| 68 RefPtr<MediaConstraintsImpl> audio = parseOptions(options, "audio", exceptio
nState); | 68 RefPtr<MediaConstraintsImpl> audio = parseOptions(options, "audio", exceptio
nState); |
| 69 if (exceptionState.hadException()) | 69 if (exceptionState.hadException()) |
| 70 return 0; | 70 return 0; |
| 71 | 71 |
| 72 RefPtr<MediaConstraintsImpl> video = parseOptions(options, "video", exceptio
nState); | 72 RefPtr<MediaConstraintsImpl> video = parseOptions(options, "video", exceptio
nState); |
| 73 if (exceptionState.hadException()) | 73 if (exceptionState.hadException()) |
| 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(ExecutionContext* context, UserMediaControlle
r* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstrain
tsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, Pa
ssRefPtr<NavigatorUserMediaErrorCallback> errorCallback) | 82 UserMediaRequest::UserMediaRequest(ExecutionContext* context, UserMediaControlle
r* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstrain
tsImpl> video, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, Pa
ssOwnPtr<NavigatorUserMediaErrorCallback> errorCallback) |
| 83 : ContextLifecycleObserver(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() |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 if (m_controller) { | 178 if (m_controller) { |
| 179 m_controller->cancelUserMediaRequest(this); | 179 m_controller->cancelUserMediaRequest(this); |
| 180 m_controller = 0; | 180 m_controller = 0; |
| 181 } | 181 } |
| 182 | 182 |
| 183 ContextLifecycleObserver::contextDestroyed(); | 183 ContextLifecycleObserver::contextDestroyed(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace WebCore | 186 } // namespace WebCore |
| OLD | NEW |