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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 2468853002: Do not kill renderer when enumerateDevices is called from about:blank. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 std::string guid_from_raw_device_id = 1967 std::string guid_from_raw_device_id =
1968 GetHMACForMediaDeviceID(salt, security_origin, raw_unique_id); 1968 GetHMACForMediaDeviceID(salt, security_origin, raw_unique_id);
1969 return guid_from_raw_device_id == device_guid; 1969 return guid_from_raw_device_id == device_guid;
1970 } 1970 }
1971 1971
1972 // static 1972 // static
1973 bool MediaStreamManager::IsOriginAllowed(int render_process_id, 1973 bool MediaStreamManager::IsOriginAllowed(int render_process_id,
1974 const url::Origin& origin) { 1974 const url::Origin& origin) {
1975 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL( 1975 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL(
1976 render_process_id, origin.GetURL())) { 1976 render_process_id, origin.GetURL())) {
1977 LOG(ERROR) << "MSM: Renderer requested a URL it's not allowed to use."; 1977 LOG(ERROR) << "MSM: Renderer requested a URL it's not allowed to use: "
1978 << origin.Serialize();
1978 return false; 1979 return false;
1979 } 1980 }
1980 1981
1981 return true; 1982 return true;
1982 } 1983 }
1983 1984
1984 void MediaStreamManager::SetCapturingLinkSecured(int render_process_id, 1985 void MediaStreamManager::SetCapturingLinkSecured(int render_process_id,
1985 int session_id, 1986 int session_id,
1986 content::MediaStreamType type, 1987 content::MediaStreamType type,
1987 bool is_secure) { 1988 bool is_secure) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 } 2044 }
2044 } 2045 }
2045 } 2046 }
2046 2047
2047 void MediaStreamManager::SetGenerateStreamCallbackForTesting( 2048 void MediaStreamManager::SetGenerateStreamCallbackForTesting(
2048 GenerateStreamTestCallback test_callback) { 2049 GenerateStreamTestCallback test_callback) {
2049 generate_stream_test_callback_ = test_callback; 2050 generate_stream_test_callback_ = test_callback;
2050 } 2051 }
2051 2052
2052 } // namespace content 2053 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698