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

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

Issue 1115913002: Add deprecation warnings to old powerful features on insecure origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updates from nits Created 5 years, 7 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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::count(navigator.frame(), UseCounter::GetUserMediaInsecureOri gin); 68 UseCounter::countDeprecation(navigator.frame(), UseCounter::GetUserMedia InsecureOrigin);
69 if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) { 69 if (navigator.frame()->settings()->strictPowerfulFeatureRestrictions()) {
70 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute ("webkitGetUserMedia", "Navigator", errorMessage)); 70 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute ("webkitGetUserMedia", "Navigator", errorMessage));
71 return; 71 return;
72 } 72 }
73 } 73 }
74 74
75 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState); 75 UserMediaRequest* request = UserMediaRequest::create(navigator.frame()->docu ment(), userMedia, options, successCallback, errorCallback, exceptionState);
76 if (!request) { 76 if (!request) {
77 ASSERT(exceptionState.hadException()); 77 ASSERT(exceptionState.hadException());
78 return; 78 return;
(...skipping 14 matching lines...) Expand all
93 if (!request) { 93 if (!request) {
94 if (!exceptionState.hadException()) 94 if (!exceptionState.hadException())
95 exceptionState.throwDOMException(NotSupportedError, "Failed to reque st media devices."); 95 exceptionState.throwDOMException(NotSupportedError, "Failed to reque st media devices.");
96 return; 96 return;
97 } 97 }
98 98
99 request->start(); 99 request->start();
100 } 100 }
101 101
102 } // namespace blink 102 } // namespace blink
OLDNEW
« Source/core/frame/UseCounter.cpp ('K') | « Source/modules/geolocation/Geolocation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698