Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 921 manifest_url_path.find("photos/nacl/") == 1); | 921 manifest_url_path.find("photos/nacl/") == 1); |
| 922 | 922 |
| 923 std::string manifest_fs_host; | 923 std::string manifest_fs_host; |
| 924 if (manifest_url.SchemeIsFileSystem() && manifest_url.inner_url()) { | 924 if (manifest_url.SchemeIsFileSystem() && manifest_url.inner_url()) { |
| 925 manifest_fs_host = manifest_url.inner_url()->host(); | 925 manifest_fs_host = manifest_url.inner_url()->host(); |
| 926 } | 926 } |
| 927 bool is_hangouts_app = | 927 bool is_hangouts_app = |
| 928 // Whitelisted apps must be served over secure scheme. | 928 // Whitelisted apps must be served over secure scheme. |
| 929 app_url.SchemeIsCryptographic() && manifest_url.SchemeIsFileSystem() && | 929 app_url.SchemeIsCryptographic() && manifest_url.SchemeIsFileSystem() && |
| 930 manifest_url.inner_url()->SchemeIsCryptographic() && | 930 manifest_url.inner_url()->SchemeIsCryptographic() && |
| 931 (base::EndsWith(app_url_host, "talkgadget.google.com", | 931 (base::EndsWith(app_url_host, "hangouts.google.com", |
|
tommi (sloooow) - chröme
2016/05/16 19:51:56
It looks like this change doesn't make a differenc
AlexZ
2016/05/17 16:43:56
Was just making the two lists the same. Moving to
| |
| 932 base::CompareCase::INSENSITIVE_ASCII) || | |
| 933 base::EndsWith(app_url_host, "talkgadget.google.com", | |
| 932 base::CompareCase::INSENSITIVE_ASCII) || | 934 base::CompareCase::INSENSITIVE_ASCII) || |
| 933 base::EndsWith(app_url_host, "plus.google.com", | 935 base::EndsWith(app_url_host, "plus.google.com", |
| 934 base::CompareCase::INSENSITIVE_ASCII) || | 936 base::CompareCase::INSENSITIVE_ASCII) || |
| 935 base::EndsWith(app_url_host, "plus.sandbox.google.com", | 937 base::EndsWith(app_url_host, "plus.sandbox.google.com", |
| 936 base::CompareCase::INSENSITIVE_ASCII) || | |
| 937 base::EndsWith(app_url_host, "hangouts.google.com", | |
| 938 base::CompareCase::INSENSITIVE_ASCII)) && | 938 base::CompareCase::INSENSITIVE_ASCII)) && |
| 939 // The manifest must be loaded from the host's FileSystem. | 939 // The manifest must be loaded from the host's FileSystem. |
| 940 (manifest_fs_host == app_url_host); | 940 (manifest_fs_host == app_url_host); |
| 941 | 941 |
| 942 bool is_whitelisted_app = is_photo_app || is_hangouts_app; | 942 bool is_whitelisted_app = is_photo_app || is_hangouts_app; |
| 943 | 943 |
| 944 bool is_invoked_by_webstore_installed_extension = false; | 944 bool is_invoked_by_webstore_installed_extension = false; |
| 945 bool is_extension_unrestricted = false; | 945 bool is_extension_unrestricted = false; |
| 946 bool is_extension_force_installed = false; | 946 bool is_extension_force_installed = false; |
| 947 #if defined(ENABLE_EXTENSIONS) | 947 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 } | 1228 } |
| 1229 | 1229 |
| 1230 bool ChromeContentRendererClient::AllowPepperMediaStreamAPI( | 1230 bool ChromeContentRendererClient::AllowPepperMediaStreamAPI( |
| 1231 const GURL& url) { | 1231 const GURL& url) { |
| 1232 #if !defined(OS_ANDROID) | 1232 #if !defined(OS_ANDROID) |
| 1233 // Allow only the Hangouts app to use the MediaStream APIs. It's OK to check | 1233 // Allow only the Hangouts app to use the MediaStream APIs. It's OK to check |
| 1234 // the whitelist in the renderer, since we're only preventing access until | 1234 // the whitelist in the renderer, since we're only preventing access until |
| 1235 // these APIs are public and stable. | 1235 // these APIs are public and stable. |
| 1236 std::string url_host = url.host(); | 1236 std::string url_host = url.host(); |
| 1237 if (url.SchemeIs("https") && | 1237 if (url.SchemeIs("https") && |
| 1238 (base::EndsWith(url_host, "talkgadget.google.com", | 1238 (base::EndsWith(url_host, "hangouts.google.com", |
|
tommi (sloooow) - chröme
2016/05/16 19:51:56
I guess this is the real change. Since this looks
AlexZ
2016/05/17 16:43:56
Moving to single domain check.
| |
| 1239 base::CompareCase::INSENSITIVE_ASCII) || | |
| 1240 base::EndsWith(url_host, "talkgadget.google.com", | |
| 1239 base::CompareCase::INSENSITIVE_ASCII) || | 1241 base::CompareCase::INSENSITIVE_ASCII) || |
| 1240 base::EndsWith(url_host, "plus.google.com", | 1242 base::EndsWith(url_host, "plus.google.com", |
| 1241 base::CompareCase::INSENSITIVE_ASCII) || | 1243 base::CompareCase::INSENSITIVE_ASCII) || |
| 1242 base::EndsWith(url_host, "plus.sandbox.google.com", | 1244 base::EndsWith(url_host, "plus.sandbox.google.com", |
| 1243 base::CompareCase::INSENSITIVE_ASCII)) && | 1245 base::CompareCase::INSENSITIVE_ASCII)) && |
| 1244 base::StartsWith(url.path(), "/hangouts/", | 1246 base::StartsWith(url.path(), "/hangouts/", |
| 1245 base::CompareCase::INSENSITIVE_ASCII)) { | 1247 base::CompareCase::INSENSITIVE_ASCII)) { |
| 1246 return true; | 1248 return true; |
| 1247 } | 1249 } |
| 1248 // Allow access for tests. | 1250 // Allow access for tests. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1423 // chrome.system.network.getNetworkInterfaces provides the same | 1425 // chrome.system.network.getNetworkInterfaces provides the same |
| 1424 // information. Also, the enforcement of sending and binding UDP is already done | 1426 // information. Also, the enforcement of sending and binding UDP is already done |
| 1425 // by chrome extension permission model. | 1427 // by chrome extension permission model. |
| 1426 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1428 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1427 #if defined(ENABLE_EXTENSIONS) | 1429 #if defined(ENABLE_EXTENSIONS) |
| 1428 return !IsStandaloneExtensionProcess(); | 1430 return !IsStandaloneExtensionProcess(); |
| 1429 #else | 1431 #else |
| 1430 return true; | 1432 return true; |
| 1431 #endif | 1433 #endif |
| 1432 } | 1434 } |
| OLD | NEW |