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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 if (logging::DialogsAreSuppressed()) | 1336 if (logging::DialogsAreSuppressed()) |
1337 command_line->AppendSwitch(switches::kNoErrorDialogs); | 1337 command_line->AppendSwitch(switches::kNoErrorDialogs); |
1338 | 1338 |
1339 std::string process_type = | 1339 std::string process_type = |
1340 command_line->GetSwitchValueASCII(switches::kProcessType); | 1340 command_line->GetSwitchValueASCII(switches::kProcessType); |
1341 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 1341 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
1342 | 1342 |
1343 if (browser_command_line.HasSwitch(switches::kChromeFrame)) | 1343 if (browser_command_line.HasSwitch(switches::kChromeFrame)) |
1344 command_line->AppendSwitch(switches::kChromeFrame); | 1344 command_line->AppendSwitch(switches::kChromeFrame); |
1345 | 1345 |
| 1346 #if defined(ENABLE_IPC_FUZZER) |
| 1347 command_line->CopySwitchFrom(browser_command_line, |
| 1348 switches::kIpcFuzzerTestcase); |
| 1349 #endif |
| 1350 |
1346 if (process_type == switches::kRendererProcess) { | 1351 if (process_type == switches::kRendererProcess) { |
1347 base::FilePath user_data_dir = | 1352 base::FilePath user_data_dir = |
1348 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 1353 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
1349 if (!user_data_dir.empty()) | 1354 if (!user_data_dir.empty()) |
1350 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 1355 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
1351 #if defined(OS_CHROMEOS) | 1356 #if defined(OS_CHROMEOS) |
1352 const std::string& login_profile = | 1357 const std::string& login_profile = |
1353 browser_command_line.GetSwitchValueASCII( | 1358 browser_command_line.GetSwitchValueASCII( |
1354 chromeos::switches::kLoginProfile); | 1359 chromeos::switches::kLoginProfile); |
1355 if (!login_profile.empty()) | 1360 if (!login_profile.empty()) |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2425 external_mount_points, | 2430 external_mount_points, |
2426 fileapi::ExternalMountPoints::GetSystemInstance()); | 2431 fileapi::ExternalMountPoints::GetSystemInstance()); |
2427 backend->AddSystemMountPoints(); | 2432 backend->AddSystemMountPoints(); |
2428 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); | 2433 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); |
2429 additional_backends->push_back(backend); | 2434 additional_backends->push_back(backend); |
2430 #endif | 2435 #endif |
2431 | 2436 |
2432 additional_backends->push_back(new sync_file_system::SyncFileSystemBackend()); | 2437 additional_backends->push_back(new sync_file_system::SyncFileSystemBackend()); |
2433 } | 2438 } |
2434 | 2439 |
| 2440 bool ChromeContentBrowserClient::ShouldKillChildProcessOnBadMessage() { |
| 2441 #if defined(ENABLE_IPC_FUZZER) |
| 2442 // Don't kill the IPC fuzzer process, if it sends a bad message. |
| 2443 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kIpcFuzzerTestcase)) |
| 2444 return false; |
| 2445 #endif |
| 2446 |
| 2447 return true; |
| 2448 } |
| 2449 |
2435 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 2450 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
2436 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 2451 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
2437 const CommandLine& command_line, | 2452 const CommandLine& command_line, |
2438 int child_process_id, | 2453 int child_process_id, |
2439 std::vector<FileDescriptorInfo>* mappings) { | 2454 std::vector<FileDescriptorInfo>* mappings) { |
2440 #if defined(OS_ANDROID) | 2455 #if defined(OS_ANDROID) |
2441 base::FilePath data_path; | 2456 base::FilePath data_path; |
2442 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 2457 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
2443 DCHECK(!data_path.empty()); | 2458 DCHECK(!data_path.empty()); |
2444 | 2459 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 #if defined(USE_NSS) | 2539 #if defined(USE_NSS) |
2525 crypto::CryptoModuleBlockingPasswordDelegate* | 2540 crypto::CryptoModuleBlockingPasswordDelegate* |
2526 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 2541 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
2527 const GURL& url) { | 2542 const GURL& url) { |
2528 return chrome::NewCryptoModuleBlockingDialogDelegate( | 2543 return chrome::NewCryptoModuleBlockingDialogDelegate( |
2529 chrome::kCryptoModulePasswordKeygen, url.host()); | 2544 chrome::kCryptoModulePasswordKeygen, url.host()); |
2530 } | 2545 } |
2531 #endif | 2546 #endif |
2532 | 2547 |
2533 } // namespace chrome | 2548 } // namespace chrome |
OLD | NEW |