| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); | 48 UserMediaController* userMedia = UserMediaController::from(navigator.frame()
); |
| 49 if (!userMedia) { | 49 if (!userMedia) { |
| 50 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); | 50 exceptionState.throwDOMException(NotSupportedError, "No user media contr
oller available; is this a detached window?"); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 | 53 |
| 54 MediaErrorState errorState; | 54 MediaErrorState errorState; |
| 55 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, errorState); | 55 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu
ment(), userMedia, options, successCallback, errorCallback, errorState); |
| 56 if (!request) { | 56 if (!request) { |
| 57 ASSERT(errorState.hadException()); | 57 DCHECK(errorState.hadException()); |
| 58 if (errorState.canGenerateException()) { | 58 if (errorState.canGenerateException()) { |
| 59 errorState.raiseException(exceptionState); | 59 errorState.raiseException(exceptionState); |
| 60 } else { | 60 } else { |
| 61 errorCallback->handleEvent(errorState.createError()); | 61 errorCallback->handleEvent(errorState.createError()); |
| 62 } | 62 } |
| 63 return; | 63 return; |
| 64 } | 64 } |
| 65 | 65 |
| 66 String errorMessage; | 66 String errorMessage; |
| 67 if (!request->isSecureContextUse(errorMessage)) { | 67 if (!request->isSecureContextUse(errorMessage)) { |
| 68 request->failPermissionDenied(errorMessage); | 68 request->failPermissionDenied(errorMessage); |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 | 71 |
| 72 request->start(); | 72 request->start(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |