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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return; | 53 return; |
54 | 54 |
55 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
? navigator.frame()->page() : 0); | 55 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
? navigator.frame()->page() : 0); |
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 RefPtr<UserMediaRequest> request = UserMediaRequest::create(navigator.frame(
)->document(), userMedia, options, successCallback, errorCallback, exceptionStat
e); | 61 RefPtr<UserMediaRequest> request = UserMediaRequest::create(navigator.frame(
)->document(), userMedia, options, successCallback, errorCallback, exceptionStat
e); |
62 if (!request) { | 62 if (!request) { |
63 if (!exceptionState.hadException()) | 63 ASSERT(exceptionState.hadException()); |
64 exceptionState.throwDOMException(NotSupportedError, "Failed to reque
st user media."); | |
65 return; | 64 return; |
66 } | 65 } |
67 | 66 |
68 request->start(); | 67 request->start(); |
69 } | 68 } |
70 | 69 |
71 void NavigatorMediaStream::getMediaDevices(Navigator& navigator, PassOwnPtr<Medi
aDeviceInfoCallback> callback, ExceptionState& exceptionState) | 70 void NavigatorMediaStream::getMediaDevices(Navigator& navigator, PassOwnPtr<Medi
aDeviceInfoCallback> callback, ExceptionState& exceptionState) |
72 { | 71 { |
73 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
? navigator.frame()->page() : 0); | 72 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
? navigator.frame()->page() : 0); |
74 if (!userMedia) { | 73 if (!userMedia) { |
75 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?"); |
76 return; | 75 return; |
77 } | 76 } |
78 | 77 |
79 RefPtr<MediaDevicesRequest> request = MediaDevicesRequest::create(navigator.
frame()->document(), userMedia, callback, exceptionState); | 78 RefPtr<MediaDevicesRequest> request = MediaDevicesRequest::create(navigator.
frame()->document(), userMedia, callback, exceptionState); |
80 if (!request) { | 79 if (!request) { |
81 if (!exceptionState.hadException()) | 80 if (!exceptionState.hadException()) |
82 exceptionState.throwDOMException(NotSupportedError, "Failed to reque
st media devices."); | 81 exceptionState.throwDOMException(NotSupportedError, "Failed to reque
st media devices."); |
83 return; | 82 return; |
84 } | 83 } |
85 | 84 |
86 request->start(); | 85 request->start(); |
87 } | 86 } |
88 | 87 |
89 } // namespace WebCore | 88 } // namespace WebCore |
OLD | NEW |