Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: Source/modules/mediastream/NavigatorMediaStream.cpp

Issue 1284193003: Removal of getUserMedia() on insecure origins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 String errorMessage; 64 String errorMessage;
65 if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) { 65 if (navigator.frame()->document()->isPrivilegedContext(errorMessage)) {
66 UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigi n); 66 UseCounter::count(navigator.frame(), UseCounter::GetUserMediaSecureOrigi n);
67 } else { 67 } else {
68 UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMedia InsecureOrigin); 68 UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMedia InsecureOrigin);
69 OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), Orig insUsingFeatures::Feature::GetUserMediaInsecureOrigin); 69 OriginsUsingFeatures::countAnyWorld(*navigator.frame()->document(), Orig insUsingFeatures::Feature::GetUserMediaInsecureOrigin);
70 if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) { 70 exceptionState.throwSecurityError(errorMessage);
Mike West 2015/08/18 00:28:38 Why throw? Why not go through the error callback l
philipj_slow 2015/08/18 08:35:10 Looking at http://w3c.github.io/mediacapture-main/
jww 2015/08/18 16:27:12 Looking at https://w3c.github.io/mediacapture-main
philipj_slow 2015/08/19 12:26:43 Oh, I didn't see the "Permission Failure" bit in t
philipj_slow 2015/08/19 12:39:24 Oh, I see the difficulty now, this is webkitGetUse
jww 2015/08/19 17:10:33 Okay, I've modified to call the error callback wit
71 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute ("webkitGetUserMedia", "Navigator", errorMessage)); 71 return;
72 return;
73 }
74 } 72 }
75 73
76 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState); 74 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState);
77 if (!request) { 75 if (!request) {
78 ASSERT(exceptionState.hadException()); 76 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698