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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 { | 54 { |
55 if (!successCallback) | 55 if (!successCallback) |
56 return; | 56 return; |
57 | 57 |
58 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); | 58 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); |
59 if (!userMedia) { | 59 if (!userMedia) { |
60 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); | 60 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); |
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
| 64 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, exceptionState); |
| 65 if (!request) { |
| 66 ASSERT(exceptionState.hadException()); |
| 67 return; |
| 68 } |
| 69 |
64 String errorMessage; | 70 String errorMessage; |
65 if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) { | 71 if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) { |
66 UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigi
n); | 72 UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigi
n); |
67 } else { | 73 } else { |
68 UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMedia
InsecureOrigin); | 74 UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMedia
InsecureOrigin); |
69 OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), Orig
insUsingFeatures::Feature::GetUserMediaInsecureOrigin); | 75 OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), Orig
insUsingFeatures::Feature::GetUserMediaInsecureOrigin); |
70 if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions())
{ | 76 request->failPermissionDenied(errorMessage); |
71 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute
("webkitGetUserMedia", "Navigator", errorMessage)); | |
72 return; | |
73 } | |
74 } | |
75 | |
76 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, exceptionState); | |
77 if (!request) { | |
78 ASSERT(exceptionState.hadException()); | |
79 return; | 77 return; |
80 } | 78 } |
81 | 79 |
82 request->start(); | 80 request->start(); |
83 } | 81 } |
84 | 82 |
85 } // namespace blink | 83 } // namespace blink |
OLD | NEW |