1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
[NaCl] Build fix for disable_nacl=1 desktop chrome build.
https://codereview.chromium.org/398273002
Index: chrome/browser/extensions/plugin_manager.cc
diff --git a/chrome/browser/extensions/plugin_manager.cc b/chrome/browser/extensions/plugin_manager.cc
index b018c6d1e0cbe296e8ac93592b1f3b63f6c7e213..86bbe93ca3550ddcf984ed3515a370d6be9a6b50 100644
--- a/chrome/browser/extensions/plugin_manager.cc
+++ b/chrome/browser/extensions/plugin_manager.cc
@@ -21,7 +21,9 @@
using content::PluginService;
+#if !defined(DISABLE_NACL)
static const char kNaClPluginMimeType[] = "application/x-nacl";
+#endif
namespace extensions {
@@ -67,6 +69,7 @@ void PluginManager::OnExtensionLoaded(content::BrowserContext* browser_context,
}
}
+#if !defined(DISABLE_NACL)
const NaClModuleInfo::List* nacl_modules =
NaClModuleInfo::GetNaClModules(extension);
if (nacl_modules) {
@@ -78,6 +81,7 @@ void PluginManager::OnExtensionLoaded(content::BrowserContext* browser_context,
}
UpdatePluginListWithNaClModules();
}
+#endif
const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension);
if (handler && !handler->handler_url().empty()) {
@@ -122,6 +126,7 @@ void PluginManager::OnExtensionUnloaded(
}
}
+#if !defined(DISABLE_NACL)
const NaClModuleInfo::List* nacl_modules =
NaClModuleInfo::GetNaClModules(extension);
if (nacl_modules) {
@@ -133,6 +138,7 @@ void PluginManager::OnExtensionUnloaded(
}
UpdatePluginListWithNaClModules();
}
+#endif
const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension);
if (handler && !handler->handler_url().empty()) {
@@ -148,6 +154,8 @@ void PluginManager::OnExtensionUnloaded(
PluginService::GetInstance()->PurgePluginListCache(profile_, false);
}
+#if !defined(DISABLE_NACL)
+
void PluginManager::RegisterNaClModule(const NaClModuleInfo& info) {
DCHECK(FindNaClModule(info.url) == nacl_module_list_.end());
nacl_module_list_.push_front(info);
@@ -216,4 +224,6 @@ NaClModuleInfo::List::iterator PluginManager::FindNaClModule(const GURL& url) {
return nacl_module_list_.end();
}
+#endif // !defined(DISABLE_NACL)
+
} // namespace extensions
Index: chrome/browser/extensions/plugin_manager.h
diff --git a/chrome/browser/extensions/plugin_manager.h b/chrome/browser/extensions/plugin_manager.h
index 56eb9f7eb51cd05ae156d79caac76d294a4cfc43..79854ab437c15e28c34aafa7d900cf517288ab93 100644
--- a/chrome/browser/extensions/plugin_manager.h
+++ b/chrome/browser/extensions/plugin_manager.h
@@ -35,6 +35,8 @@ class PluginManager : public BrowserContextKeyedAPI,
private:
friend class BrowserContextKeyedAPIFactory<PluginManager>;
+#if !defined(DISABLE_NACL)
+
// We implement some Pepper plug-ins using NaCl to take advantage of NaCl's
// strong sandbox. Typically, these NaCl modules are stored in extensions
// and registered here. Not all NaCl modules need to register for a MIME
@@ -50,6 +52,8 @@ class PluginManager : public BrowserContextKeyedAPI,
extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url);
+#endif // !defined(DISABLE_NACL)
+
// ExtensionRegistryObserver implementation.
virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
const Extension* extension) OVERRIDE;
Index: chrome/browser/ui/startup/bad_flags_prompt.cc
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc
index 4ce4ea19465e9070bea7a64f913919bcdc0dc57b..e3161d71d1d4f8a9dfe37f3499f2b7ed56081f3f 100644
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -43,7 +43,9 @@ void ShowBadFlagsPrompt(Browser* browser) {
switches::kDisableSeccompFilterSandbox,
switches::kDisableSetuidSandbox,
switches::kDisableWebSecurity,
+#if !defined(DISABLE_NACL)
switches::kNaClDangerousNoSandboxNonSfi,
+#endif
switches::kNoSandbox,
switches::kSingleProcess,
Index: chrome/common/extensions/chrome_manifest_handlers.cc
diff --git a/chrome/common/extensions/chrome_manifest_handlers.cc b/chrome/common/extensions/chrome_manifest_handlers.cc
index b08d004790fdfa14cc2b5495ffb54a74fa9ff86d..c05117d7c04a4aae2066501e820fa75b09555566 100644
--- a/chrome/common/extensions/chrome_manifest_handlers.cc
+++ b/chrome/common/extensions/chrome_manifest_handlers.cc
@@ -61,7 +61,9 @@ void RegisterChromeManifestHandlers() {
#endif
(new MimeTypesHandlerParser)->Register();
(new MinimumChromeVersionChecker)->Register();
+#if !defined(DISABLE_NACL)
(new NaClModulesHandler)->Register();
+#endif
(new OAuth2ManifestHandler)->Register();
(new OmniboxHandler)->Register();
(new OptionsPageHandler)->Register();
Index: chrome/test/ppapi/ppapi_test.cc
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 7bd3284cd51752b57d6668b2d7f53087a3e5ba58..9a951458a71585b80c17ff6d234eda62b0de1738 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -426,8 +426,10 @@ void PPAPIPrivateNaClPNaClTest::SetUpCommandLine(
void PPAPINaClPNaClNonSfiTest::SetUpCommandLine(
base::CommandLine* command_line) {
+#if !defined(DISABLE_NACL)
PPAPINaClTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kEnableNaClNonSfiMode);
+#endif
}
std::string PPAPINaClPNaClNonSfiTest::BuildQuery(
|