| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) | 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) |
| 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) | 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 NavigatorMediaStream::NavigatorMediaStream() | 42 NavigatorMediaStream::NavigatorMediaStream() |
| 43 { | 43 { |
| 44 } | 44 } |
| 45 | 45 |
| 46 NavigatorMediaStream::~NavigatorMediaStream() | 46 NavigatorMediaStream::~NavigatorMediaStream() |
| 47 { | 47 { |
| 48 } | 48 } |
| 49 | 49 |
| 50 void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const Dictio
nary& options, PassOwnPtrWillBeRawPtr<NavigatorUserMediaSuccessCallback> success
Callback, PassOwnPtrWillBeRawPtr<NavigatorUserMediaErrorCallback> errorCallback,
ExceptionState& exceptionState) | 50 void NavigatorMediaStream::webkitGetUserMedia(Navigator& navigator, const Dictio
nary& options, NavigatorUserMediaSuccessCallback* successCallback, NavigatorUser
MediaErrorCallback* errorCallback, ExceptionState& exceptionState) |
| 51 { | 51 { |
| 52 if (!successCallback) | 52 if (!successCallback) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); | 55 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); |
| 56 if (!userMedia) { | 56 if (!userMedia) { |
| 57 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); | 57 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 | 60 |
| 61 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, exceptionState); | 61 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, exceptionState); |
| 62 if (!request) { | 62 if (!request) { |
| 63 ASSERT(exceptionState.hadException()); | 63 ASSERT(exceptionState.hadException()); |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 | 66 |
| 67 request->start(); | 67 request->start(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void NavigatorMediaStream::getMediaDevices(Navigator& navigator, PassOwnPtrWillB
eRawPtr<MediaDeviceInfoCallback> callback, ExceptionState& exceptionState) | 70 void NavigatorMediaStream::getMediaDevices(Navigator& navigator, MediaDeviceInfo
Callback* callback, ExceptionState& exceptionState) |
| 71 { | 71 { |
| 72 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); | 72 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); |
| 73 if (!userMedia) { | 73 if (!userMedia) { |
| 74 exceptionState.throwDOMException(NotSupportedError, "No media device con
troller available; is this a detached window?"); | 74 exceptionState.throwDOMException(NotSupportedError, "No media device con
troller available; is this a detached window?"); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 MediaDevicesRequest* request = MediaDevicesRequest::create(navigator.frame()
->document(), userMedia, callback, exceptionState); | 78 MediaDevicesRequest* request = MediaDevicesRequest::create(navigator.frame()
->document(), userMedia, callback, exceptionState); |
| 79 if (!request) { | 79 if (!request) { |
| 80 if (!exceptionState.hadException()) | 80 if (!exceptionState.hadException()) |
| 81 exceptionState.throwDOMException(NotSupportedError, "Failed to reque
st media devices."); | 81 exceptionState.throwDOMException(NotSupportedError, "Failed to reque
st media devices."); |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 | 84 |
| 85 request->start(); | 85 request->start(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |