Chromium Code Reviews| Index: chrome/browser/chrome_content_browser_client.cc |
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
| index 5abfa6ce2538a5c407410ced9a78e5d16d08ead3..b2d723bd4f2863eb0f6e441f423bfc613b102b2b 100644 |
| --- a/chrome/browser/chrome_content_browser_client.cc |
| +++ b/chrome/browser/chrome_content_browser_client.cc |
| @@ -99,6 +99,7 @@ |
| #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" |
| #include "chrome/common/extensions/permissions/permissions_data.h" |
| #include "chrome/common/extensions/permissions/socket_permission.h" |
| +#include "chrome/common/ipc_fuzzer_messages.h" |
|
Tom Sepez
2013/07/12 18:47:20
#if defined(EABLE_IPC_FUZZER) and move down lower.
aedla
2013/07/15 16:12:08
Oh, the include wasn't necessary actually.
|
| #include "chrome/common/logging_chrome.h" |
| #include "chrome/common/pepper_permission_util.h" |
| #include "chrome/common/pref_names.h" |
| @@ -202,6 +203,10 @@ |
| #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" |
| #endif |
| +#if defined(ENABLE_IPC_FUZZER) |
| +#include "chrome/browser/ipc_fuzzer_host.h" |
| +#endif |
| + |
| using base::FileDescriptor; |
| using content::AccessTokenStore; |
| using content::BrowserChildProcessHostIterator; |
| @@ -826,6 +831,10 @@ void ChromeContentBrowserClient::RenderProcessHostCreated( |
| SendExtensionWebRequestStatusToHost(host); |
| +#if defined(ENABLE_IPC_FUZZER) |
| + SendTestcaseToIpcFuzzer(host); |
| +#endif |
| + |
| RendererContentSettingRules rules; |
| GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
| host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
| @@ -1296,6 +1305,12 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
| if (!user_data_dir.empty()) |
| command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| + |
| +#if defined(ENABLE_IPC_FUZZER) |
| + if (browser_command_line.HasSwitch(switches::kIpcFuzzerTestcase)) |
| + command_line->AppendSwitch(switches::kIpcFuzzerOverride); |
| +#endif |
| + |
| #if defined(OS_CHROMEOS) |
| const std::string& login_profile = |
| browser_command_line.GetSwitchValueASCII( |
| @@ -2331,6 +2346,16 @@ void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( |
| #endif |
| } |
| +bool ChromeContentBrowserClient::ShouldKillChildOnBadMessage() { |
| +#if defined(ENABLE_IPC_FUZZER) |
| + // Don't kill the IPC fuzzer process, if it sends a bad message. |
| + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kIpcFuzzerTestcase)) |
| + return false; |
| +#endif |
| + |
| + return true; |
| +} |
| + |
| #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| const CommandLine& command_line, |