Chromium Code Reviews| Index: chrome/browser/nacl_host/nacl_browser_delegate_impl.cc |
| diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc |
| index b30a3ae0789a1dfb82969b250b67b19187abd5e8..c43d7cb24bd9b9407d01ba7c044bc8d1c49d670d 100644 |
| --- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc |
| +++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc |
| @@ -17,6 +17,7 @@ |
| #include "chrome/common/chrome_paths_internal.h" |
| #include "chrome/common/chrome_version_info.h" |
| #include "chrome/common/logging_chrome.h" |
| +#include "chrome/common/pepper_permission_util.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/site_instance.h" |
| @@ -33,6 +34,11 @@ using extensions::SharedModuleInfo; |
| namespace { |
| +const char* kAllowedNonSfiOrigins[] = { |
| + "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/355141 |
|
Mark Seaborn
2014/05/03 01:37:59
Is there a way I can check these IDs?
elijahtaylor1
2014/05/06 05:56:15
Yes, sorry, I meant to update the linked bug with
|
| + "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see crbug.com/355141 |
| +}; |
| + |
| // Handles an extension's NaCl process transitioning in or out of idle state by |
| // relaying the state to the extension's process manager. |
| // |
| @@ -105,7 +111,11 @@ void OnKeepalive( |
| NaClBrowserDelegateImpl::NaClBrowserDelegateImpl( |
| extensions::InfoMap* extension_info_map) |
| - : extension_info_map_(extension_info_map), inverse_debug_patterns_(false) {} |
| + : extension_info_map_(extension_info_map), inverse_debug_patterns_(false) { |
| + for (size_t i = 0; i < arraysize(kAllowedNonSfiOrigins); ++i) { |
| + allowed_nonsfi_origins_.insert(kAllowedNonSfiOrigins[i]); |
| + } |
| +} |
| NaClBrowserDelegateImpl::~NaClBrowserDelegateImpl() { |
| } |
| @@ -265,3 +275,10 @@ content::BrowserPpapiHost::OnKeepaliveCallback |
| NaClBrowserDelegateImpl::GetOnKeepaliveCallback() { |
| return base::Bind(&OnKeepalive); |
| } |
| + |
| +bool NaClBrowserDelegateImpl::IsNonSfiModeAllowed(const GURL& manifest_url) { |
| + const extensions::ExtensionSet* extension_set = |
| + &extension_info_map_->extensions(); |
| + return chrome::IsExtensionOrSharedModuleWhitelisted( |
| + manifest_url, extension_set, allowed_nonsfi_origins_); |
| +} |