Chromium Code Reviews| 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/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 plugins->push_back(pdf); | 162 plugins->push_back(pdf); |
| 163 | 163 |
| 164 skip_pdf_file_check = true; | 164 skip_pdf_file_check = true; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Handle Native Client just like the PDF plugin. This means that it is | 168 // Handle Native Client just like the PDF plugin. This means that it is |
| 169 // enabled by default for the non-portable case. This allows apps installed | 169 // enabled by default for the non-portable case. This allows apps installed |
| 170 // from the Chrome Web Store to use NaCl even if the command line switch | 170 // from the Chrome Web Store to use NaCl even if the command line switch |
| 171 // isn't set. For other uses of NaCl we check for the command line switch. | 171 // isn't set. For other uses of NaCl we check for the command line switch. |
| 172 // Specifically, Portable Native Client is only enabled by the command line | 172 // Specifically, Portable Native Client is only enabled by the command line |
|
jvoung (off chromium)
2014/07/15 22:04:16
Can remove this old comment about PNaCl being only
teravest
2014/07/15 23:08:51
Done.
| |
| 173 // switch. | 173 // switch. |
| 174 static bool skip_nacl_file_check = false; | 174 static bool skip_nacl_file_check = false; |
| 175 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { | 175 if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) { |
| 176 if (skip_nacl_file_check || base::PathExists(path)) { | 176 if (skip_nacl_file_check || base::PathExists(path)) { |
|
jvoung (off chromium)
2014/07/15 22:04:16
It seems like we need to be careful about register
teravest
2014/07/15 23:08:51
I'd expect the behavior for registering the nacl m
jvoung (off chromium)
2014/07/15 23:24:15
You're right that registering the nacl mime type s
teravest
2014/07/16 01:38:46
Ah, okay.
| |
| 177 content::PepperPluginInfo nacl; | 177 content::PepperPluginInfo nacl; |
| 178 nacl.path = path; | 178 nacl.path = path; |
| 179 nacl.name = ChromeContentClient::kNaClPluginName; | 179 nacl.name = ChromeContentClient::kNaClPluginName; |
| 180 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, | 180 content::WebPluginMimeType nacl_mime_type(kNaClPluginMimeType, |
| 181 kNaClPluginExtension, | 181 kNaClPluginExtension, |
| 182 kNaClPluginDescription); | 182 kNaClPluginDescription); |
| 183 nacl.mime_types.push_back(nacl_mime_type); | 183 nacl.mime_types.push_back(nacl_mime_type); |
| 184 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 184 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, |
| 185 switches::kDisablePnacl)) { | 185 kPnaclPluginExtension, |
| 186 content::WebPluginMimeType pnacl_mime_type(kPnaclPluginMimeType, | 186 kPnaclPluginDescription); |
| 187 kPnaclPluginExtension, | 187 nacl.mime_types.push_back(pnacl_mime_type); |
| 188 kPnaclPluginDescription); | |
| 189 nacl.mime_types.push_back(pnacl_mime_type); | |
| 190 } | |
| 191 nacl.permissions = kNaClPluginPermissions; | 188 nacl.permissions = kNaClPluginPermissions; |
| 192 plugins->push_back(nacl); | 189 plugins->push_back(nacl); |
| 193 | 190 |
| 194 skip_nacl_file_check = true; | 191 skip_nacl_file_check = true; |
| 195 } | 192 } |
| 196 } | 193 } |
| 197 | 194 |
| 198 static bool skip_o1d_file_check = false; | 195 static bool skip_o1d_file_check = false; |
| 199 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { | 196 if (PathService::Get(chrome::FILE_O1D_PLUGIN, &path)) { |
| 200 if (skip_o1d_file_check || base::PathExists(path)) { | 197 if (skip_o1d_file_check || base::PathExists(path)) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 int sandbox_type, | 529 int sandbox_type, |
| 533 int* sandbox_profile_resource_id) const { | 530 int* sandbox_profile_resource_id) const { |
| 534 DCHECK(sandbox_profile_resource_id); | 531 DCHECK(sandbox_profile_resource_id); |
| 535 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 532 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
| 536 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 533 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 537 return true; | 534 return true; |
| 538 } | 535 } |
| 539 return false; | 536 return false; |
| 540 } | 537 } |
| 541 #endif | 538 #endif |
| OLD | NEW |