| 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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 const Extension* extension = | 1033 const Extension* extension = |
| 1034 extension_service->extensions()->GetExtensionOrAppByURL(effective_url); | 1034 extension_service->extensions()->GetExtensionOrAppByURL(effective_url); |
| 1035 if (!extension) | 1035 if (!extension) |
| 1036 return false; | 1036 return false; |
| 1037 | 1037 |
| 1038 // If the URL is part of a hosted app that does not have the background | 1038 // If the URL is part of a hosted app that does not have the background |
| 1039 // permission, or that does not allow JavaScript access to the background | 1039 // permission, or that does not allow JavaScript access to the background |
| 1040 // page, we want to give each instance its own process to improve | 1040 // page, we want to give each instance its own process to improve |
| 1041 // responsiveness. | 1041 // responsiveness. |
| 1042 if (extension->GetType() == Manifest::TYPE_HOSTED_APP) { | 1042 if (extension->GetType() == Manifest::TYPE_HOSTED_APP) { |
| 1043 if (!extension->HasAPIPermission(APIPermission::kBackground) || | 1043 if (!extension->permissions_data()->HasAPIPermission( |
| 1044 APIPermission::kBackground) || |
| 1044 !extensions::BackgroundInfo::AllowJSAccess(extension)) { | 1045 !extensions::BackgroundInfo::AllowJSAccess(extension)) { |
| 1045 return false; | 1046 return false; |
| 1046 } | 1047 } |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 // Hosted apps that have script access to their background page must use | 1050 // Hosted apps that have script access to their background page must use |
| 1050 // process per site, since all instances can make synchronous calls to the | 1051 // process per site, since all instances can make synchronous calls to the |
| 1051 // background window. Other extensions should use process per site as well. | 1052 // background window. Other extensions should use process per site as well. |
| 1052 return true; | 1053 return true; |
| 1053 } | 1054 } |
| (...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 switches::kDisableWebRtcEncryption, | 2762 switches::kDisableWebRtcEncryption, |
| 2762 }; | 2763 }; |
| 2763 to_command_line->CopySwitchesFrom(from_command_line, | 2764 to_command_line->CopySwitchesFrom(from_command_line, |
| 2764 kWebRtcDevSwitchNames, | 2765 kWebRtcDevSwitchNames, |
| 2765 arraysize(kWebRtcDevSwitchNames)); | 2766 arraysize(kWebRtcDevSwitchNames)); |
| 2766 } | 2767 } |
| 2767 } | 2768 } |
| 2768 #endif // defined(ENABLE_WEBRTC) | 2769 #endif // defined(ENABLE_WEBRTC) |
| 2769 | 2770 |
| 2770 } // namespace chrome | 2771 } // namespace chrome |
| OLD | NEW |