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

Unified Diff: chrome/browser/nacl_host/nacl_browser_delegate_impl.cc

Issue 468913006: Added extension macro checks for android plugin files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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 3251a8e697a7ead9a833185127716f50e556527d..bbe3e7b4d74ee4f0cde07a49945300307ffd2612 100644
--- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
+++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
@@ -62,10 +62,12 @@ void OnKeepaliveOnUIThread(
if (instance_data.size() < 1)
return;
+#if defined(ENABLE_EXTENSIONS)
extensions::ProcessManager::OnKeepaliveFromPlugin(
instance_data[0].render_process_id,
instance_data[0].render_frame_id,
instance_data[0].document_url.host());
+#endif
}
// Calls OnKeepaliveOnUIThread on UI thread.
@@ -190,10 +192,14 @@ bool NaClBrowserDelegateImpl::MapUrlToLocalFilePath(
bool use_blocking_api,
const base::FilePath& profile_directory,
base::FilePath* file_path) {
+#if defined(ENABLE_EXTENSIONS)
scoped_refptr<extensions::InfoMap> extension_info_map =
GetExtensionInfoMap(profile_directory);
return extension_info_map->MapUrlToLocalFilePath(
file_url, use_blocking_api, file_path);
+#else
+ return false;
+#endif
}
content::BrowserPpapiHost::OnKeepaliveCallback
@@ -204,14 +210,19 @@ NaClBrowserDelegateImpl::GetOnKeepaliveCallback() {
bool NaClBrowserDelegateImpl::IsNonSfiModeAllowed(
const base::FilePath& profile_directory,
const GURL& manifest_url) {
+#if defined(ENABLE_EXTENSIONS)
const extensions::ExtensionSet* extension_set =
&GetExtensionInfoMap(profile_directory)->extensions();
return chrome::IsExtensionOrSharedModuleWhitelisted(
manifest_url, extension_set, allowed_nonsfi_origins_);
+#else
+ return false;
+#endif
}
scoped_refptr<extensions::InfoMap> NaClBrowserDelegateImpl::GetExtensionInfoMap(
const base::FilePath& profile_directory) {
+#if defined(ENABLE_EXTENSIONS)
// Get the profile associated with the renderer.
Profile* profile = profile_manager_->GetProfileByPath(profile_directory);
DCHECK(profile);
@@ -219,4 +230,7 @@ scoped_refptr<extensions::InfoMap> NaClBrowserDelegateImpl::GetExtensionInfoMap(
extensions::ExtensionSystem::Get(profile)->info_map();
DCHECK(extension_info_map);
return extension_info_map;
+#else
+ return NULL;
Mark Seaborn 2014/08/19 23:41:30 It doesn't look like all the call sites handle Get
David Yen 2014/08/21 17:31:48 This function is private so I believe you are righ
+#endif
}

Powered by Google App Engine
This is Rietveld 408576698