summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/permissions_apitest.cc1
-rw-r--r--chrome/browser/plugin_service.cc4
-rw-r--r--chrome/common/extensions/extension.cc3
-rw-r--r--chrome/common/extensions/extension.h1
-rw-r--r--chrome/renderer/render_process_impl.cc14
-rw-r--r--chrome/renderer/render_view.cc7
-rw-r--r--chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json2
7 files changed, 17 insertions, 15 deletions
diff --git a/chrome/browser/extensions/permissions_apitest.cc b/chrome/browser/extensions/permissions_apitest.cc
index 628faa8..027f5d8 100644
--- a/chrome/browser/extensions/permissions_apitest.cc
+++ b/chrome/browser/extensions/permissions_apitest.cc
@@ -49,6 +49,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FavIconPermission) {
// Mark as Flaky. http://crbug.com/51861
#if defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, FLAKY_NaClPermissionEnabled) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switches::kInternalNaCl);
ASSERT_TRUE(RunExtensionTest("permissions/nacl_enabled")) << message_;
}
#endif
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index 2a3dcb5..5ab9368 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -110,7 +110,9 @@ PluginService::PluginService()
}
#ifndef DISABLE_NACL
- RegisterInternalNaClPlugin();
+ if (command_line->HasSwitch(switches::kInternalNaCl)) {
+ RegisterInternalNaClPlugin();
+ }
#endif
chrome::RegisterInternalGPUPlugin();
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index a8aa6d8..e10b92b 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -159,7 +159,6 @@ const char Extension::kNotificationPermission[] = "notifications";
const char Extension::kProxyPermission[] = "proxy";
const char Extension::kTabPermission[] = "tabs";
const char Extension::kUnlimitedStoragePermission[] = "unlimitedStorage";
-const char Extension::kNativeClientPermission[] = "nativeClient";
const char Extension::kWebstorePrivatePermission[] = "webstorePrivate";
const char* const Extension::kPermissionNames[] = {
@@ -175,7 +174,6 @@ const char* const Extension::kPermissionNames[] = {
Extension::kProxyPermission,
Extension::kTabPermission,
Extension::kUnlimitedStoragePermission,
- Extension::kNativeClientPermission,
Extension::kWebstorePrivatePermission,
};
const size_t Extension::kNumPermissions =
@@ -186,7 +184,6 @@ const char* const Extension::kHostedAppPermissionNames[] = {
Extension::kGeolocationPermission,
Extension::kNotificationPermission,
Extension::kUnlimitedStoragePermission,
- Extension::kNativeClientPermission,
Extension::kWebstorePrivatePermission,
};
const size_t Extension::kNumHostedAppPermissions =
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 13e019d..624d1b7 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -109,7 +109,6 @@ class Extension {
static const char kProxyPermission[];
static const char kTabPermission[];
static const char kUnlimitedStoragePermission[];
- static const char kNativeClientPermission[];
static const char kWebstorePrivatePermission[];
static const char* const kPermissionNames[];
diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc
index 25773c2..6fa10ee 100644
--- a/chrome/renderer/render_process_impl.cc
+++ b/chrome/renderer/render_process_impl.cc
@@ -185,12 +185,14 @@ RenderProcessImpl::RenderProcessImpl()
}
#ifndef DISABLE_NACL
- std::map<std::string, uintptr_t> funcs;
- funcs["launch_nacl_process"] =
- reinterpret_cast<uintptr_t>(LaunchNaClProcess);
- funcs["launch_nacl_process_multi_fd"] =
- reinterpret_cast<uintptr_t>(LaunchNaClProcessMultiFD);
- RegisterInternalNaClPlugin(funcs);
+ if (command_line.HasSwitch(switches::kInternalNaCl)) {
+ std::map<std::string, uintptr_t> funcs;
+ funcs["launch_nacl_process"] =
+ reinterpret_cast<uintptr_t>(LaunchNaClProcess);
+ funcs["launch_nacl_process_multi_fd"] =
+ reinterpret_cast<uintptr_t>(LaunchNaClProcessMultiFD);
+ RegisterInternalNaClPlugin(funcs);
+ }
#endif
if (!command_line.HasSwitch(switches::kDisableByteRangeSupport)) {
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 803abae..9185d48 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -3491,11 +3491,11 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate(
}
// Check for Native Client modules.
- if (mime_type == "application/x-nacl-srpc") {
+ if (mime_type == "application/x-nacl-srpc" &&
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) {
// NaCl is only permitted when we're in an extension/application with the
// appropriate permission, or when explicitly enabled on the command line.
- // TODO(cbiffle): need browser test for this before M7 (bug 45881)
GURL main_frame_url(webview()->mainFrame()->url());
ExtensionRendererInfo* extension =
ExtensionRendererInfo::GetByURL(main_frame_url);
@@ -3504,8 +3504,9 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate(
CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl);
if (in_ext) {
+ // TODO(cbiffle): NaCl is back to experimental for M7.
if (ExtensionProcessBindings::HasPermission(extension->id(),
- Extension::kNativeClientPermission)) {
+ Extension::kExperimentalPermission)) {
in_process_plugin = true;
use_pepper_host = true;
} else {
diff --git a/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json
index c2c7c82..4c13c47 100644
--- a/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json
+++ b/chrome/test/data/extensions/api_test/permissions/nacl_enabled/manifest.json
@@ -3,5 +3,5 @@
"description": "nacl permission enabled extension",
"version": "0.1",
"background_page": "background.html",
- "permissions": [ "nativeClient" ]
+ "permissions": [ "experimental" ]
}