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