diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 17:22:30 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 17:22:30 +0000 |
commit | b80f6843f26b8b48672b104a5cac38be0b1f5bc1 (patch) | |
tree | 98a4248a1a217d209858ba2357c6e9607248e954 | |
parent | 2ec3d508d2fd7b33763b2ae22afd2804e6b881a0 (diff) | |
download | chromium_src-b80f6843f26b8b48672b104a5cac38be0b1f5bc1.zip chromium_src-b80f6843f26b8b48672b104a5cac38be0b1f5bc1.tar.gz chromium_src-b80f6843f26b8b48672b104a5cac38be0b1f5bc1.tar.bz2 |
Remove safe_browsing code from BrowserRenderProcessHost. Also remove crash reporting glue in content.
BUG=77089,77093
Review URL: http://codereview.chromium.org/6901137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83734 0039d316-1c4b-4281-b951-d872f2087c98
28 files changed, 213 insertions, 268 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index f2328d2..e0a0899 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -4,6 +4,9 @@ #include "chrome/browser/chrome_content_browser_client.h" +#include "base/command_line.h" +#include "chrome/app/breakpad_mac.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/debugger/devtools_handler.h" #include "chrome/browser/desktop_notification_handler.h" @@ -19,11 +22,18 @@ #include "chrome/browser/search_engines/search_provider_install_state_message_filter.h" #include "chrome/browser/spellcheck_message_filter.h" #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" +#include "chrome/common/child_process_logging.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "content/browser/renderer_host/browser_render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#if defined(OS_LINUX) +#include "base/linux_util.h" +#include "chrome/browser/crash_handler_host_linux.h" +#endif // OS_LINUX + namespace chrome { void ChromeContentBrowserClient::RenderViewHostCreated( @@ -112,4 +122,74 @@ std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); } +void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( + CommandLine* command_line, int child_process_id) { +#if defined(USE_LINUX_BREAKPAD) + if (IsCrashReporterEnabled()) { + command_line->AppendSwitchASCII(switches::kEnableCrashReporter, + child_process_logging::GetClientId() + "," + base::GetLinuxDistro()); + } +#elif defined(OS_MACOSX) + if (IsCrashReporterEnabled()) { + command_line->AppendSwitchASCII(switches::kEnableCrashReporter, + child_process_logging::GetClientId()); + } +#endif // OS_MACOSX + + std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + if (process_type == switches::kExtensionProcess || + process_type == switches::kRendererProcess) { + const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + FilePath user_data_dir = + browser_command_line.GetSwitchValuePath(switches::kUserDataDir); + if (!user_data_dir.empty()) + command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); +#if defined(OS_CHROMEOS) + const std::string& login_profile = + browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); + if (!login_profile.empty()) + command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); +#endif + + RenderProcessHost* process = RenderProcessHost::FromID(child_process_id); + + PrefService* prefs = process->profile()->GetPrefs(); + // Currently this pref is only registered if applied via a policy. + if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && + prefs->GetBoolean(prefs::kDisable3DAPIs)) { + // Turn this policy into a command line switch. + command_line->AppendSwitch(switches::kDisable3DAPIs); + } + + // Disable client-side phishing detection in the renderer if it is disabled + // in the browser process. + if (!g_browser_process->safe_browsing_detection_service()) + command_line->AppendSwitch(switches::kDisableClientSidePhishingDetection); + } +} + +std::string ChromeContentBrowserClient::GetApplicationLocale() { + return g_browser_process->GetApplicationLocale(); +} + +#if defined(OS_LINUX) +int ChromeContentBrowserClient::GetCrashSignalFD( + const std::string& process_type) { + if (process_type == switches::kRendererProcess) + return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); + + if (process_type == switches::kPluginProcess) + return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); + + if (process_type == switches::kPpapiPluginProcess) + return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); + + if (process_type == switches::kGpuProcess) + return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); + + return -1; +} +#endif + } // namespace chrome diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 8b96a44..faac34e 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -22,6 +22,13 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual GURL GetAlternateErrorPageURL(const TabContents* tab); virtual std::string GetCanonicalEncodingNameByAliasName( const std::string& alias_name); + virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + int child_process_id); + virtual std::string GetApplicationLocale(); +#if defined(OS_LINUX) + // Can return an optional fd for crash handling, otherwise returns -1. + virtual int GetCrashSignalFD(const std::string& process_type); +#endif }; } // namespace chrome diff --git a/chrome/browser/importer/profile_import_process_host.cc b/chrome/browser/importer/profile_import_process_host.cc index 453a343..8df0a2f 100644 --- a/chrome/browser/importer/profile_import_process_host.cc +++ b/chrome/browser/importer/profile_import_process_host.cc @@ -93,8 +93,6 @@ bool ProfileImportProcessHost::StartProcess() { switches::kProfileImportProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kChromeFrame)) cmd_line->AppendSwitch(switches::kChromeFrame); diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index 38dfcad..2b9409d 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -147,8 +147,6 @@ bool NaClProcessHost::LaunchSelLdr() { cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); - // On Windows we might need to start the broker process to launch a new loader #if defined(OS_WIN) if (running_on_wow64_) { diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc index 7a76bbd..9637580 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc @@ -18,6 +18,8 @@ #include "chrome/test/ui_test_utils.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/test_render_view_host.h" +#include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_test_sink.h" @@ -106,7 +108,7 @@ void QuitUIMessageLoop() { new MessageLoop::QuitTask()); } -class ClientSideDetectionHostTest : public RenderViewHostTestHarness { +class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { public: virtual void SetUp() { // Set custom profile object so that we can mock calls to IsOffTheRecord. @@ -115,7 +117,7 @@ class ClientSideDetectionHostTest : public RenderViewHostTestHarness { mock_profile_ = new NiceMock<MockTestingProfile>(); profile_.reset(mock_profile_); - RenderViewHostTestHarness::SetUp(); + TabContentsWrapperTestHarness::SetUp(); ui_thread_.reset(new BrowserThread(BrowserThread::UI, &message_loop_)); // Note: we're starting a real IO thread to make sure our DCHECKs that // verify which thread is running are actually tested. @@ -130,7 +132,7 @@ class ClientSideDetectionHostTest : public RenderViewHostTestHarness { csd_service_.reset(new StrictMock<MockClientSideDetectionService>( model_path)); sb_service_ = new StrictMock<MockSafeBrowsingService>(); - csd_host_ = contents()->safebrowsing_detection_host(); + csd_host_ = contents_wrapper()->safebrowsing_detection_host(); csd_host_->set_client_side_detection_service(csd_service_.get()); csd_host_->set_safe_browsing_service(sb_service_.get()); @@ -142,7 +144,7 @@ class ClientSideDetectionHostTest : public RenderViewHostTestHarness { virtual void TearDown() { io_thread_.reset(); ui_thread_.reset(); - RenderViewHostTestHarness::TearDown(); + TabContentsWrapperTestHarness::TearDown(); // Restore the command-line like it was before we ran the test. *CommandLine::ForCurrentProcess() = *original_cmd_line_; } diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc index 0be6287..8bcf7df 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service.cc @@ -18,8 +18,12 @@ #include "chrome/common/net/http_return.h" #include "chrome/common/net/url_fetcher.h" #include "chrome/common/safe_browsing/csd.pb.h" +#include "chrome/common/safe_browsing/safebrowsing_messages.h" #include "content/browser/browser_thread.h" +#include "content/browser/renderer_host/render_process_host.h" +#include "content/common/notification_service.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_platform_file.h" #include "net/base/load_flags.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" @@ -57,14 +61,16 @@ ClientSideDetectionService::ClientSideDetectionService( model_file_(base::kInvalidPlatformFileValue), ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), - request_context_getter_(request_context_getter) {} + request_context_getter_(request_context_getter) { + registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, + NotificationService::AllSources()); +} ClientSideDetectionService::~ClientSideDetectionService() { method_factory_.RevokeAll(); STLDeleteContainerPairPointers(client_phishing_reports_.begin(), client_phishing_reports_.end()); client_phishing_reports_.clear(); - STLDeleteElements(&open_callbacks_); CloseModelFile(); } @@ -96,14 +102,6 @@ ClientSideDetectionService* ClientSideDetectionService::Create( return service.release(); } -void ClientSideDetectionService::GetModelFile(OpenModelDoneCallback* callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->PostTask( - FROM_HERE, - method_factory_.NewRunnableMethod( - &ClientSideDetectionService::StartGetModelFile, callback)); -} - void ClientSideDetectionService::SendClientReportPhishingRequest( ClientPhishingRequest* verdict, ClientReportPhishingRequestCallback* callback) { @@ -151,16 +149,41 @@ void ClientSideDetectionService::OnURLFetchComplete( } } +void ClientSideDetectionService::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + DCHECK(type == NotificationType::RENDERER_PROCESS_CREATED); + if (model_status_ == UNKNOWN_STATUS) { + // The model isn't ready. When it's known, we'll call all renderers. + return; + } + + RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); + SendModelToProcess(process); +} + +void ClientSideDetectionService::SendModelToProcess( + RenderProcessHost* process) { + if (model_file_ == base::kInvalidPlatformFileValue) + return; + + IPC::PlatformFileForTransit file; +#if defined(OS_POSIX) + file = base::FileDescriptor(model_file_, false); +#elif defined(OS_WIN) + ::DuplicateHandle(::GetCurrentProcess(), model_file_, process->GetHandle(), + &file, 0, false, DUPLICATE_SAME_ACCESS); +#endif + process->Send(new SafeBrowsingMsg_SetPhishingModel(file)); +} + void ClientSideDetectionService::SetModelStatus(ModelStatus status) { DCHECK_NE(READY_STATUS, model_status_); model_status_ = status; - if (READY_STATUS == status || ERROR_STATUS == status) { - for (size_t i = 0; i < open_callbacks_.size(); ++i) { - open_callbacks_[i]->Run(model_file_); - } - STLDeleteElements(&open_callbacks_); - } else { - NOTREACHED(); + + for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); + !i.IsAtEnd(); i.Advance()) { + SendModelToProcess(i.GetCurrentValue()); } } @@ -237,21 +260,6 @@ void ClientSideDetectionService::CloseModelFile() { model_file_ = base::kInvalidPlatformFileValue; } -void ClientSideDetectionService::StartGetModelFile( - OpenModelDoneCallback* callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - if (UNKNOWN_STATUS == model_status_) { - // Store the callback which will be called once we know the status of the - // model file. - open_callbacks_.push_back(callback); - } else { - // The model is either in READY or ERROR state which means we can - // call the callback right away. - callback->Run(model_file_); - delete callback; - } -} - void ClientSideDetectionService::StartClientReportPhishingRequest( ClientPhishingRequest* verdict, ClientReportPhishingRequestCallback* callback) { diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h index ce8dfab..29321e0 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.h +++ b/chrome/browser/safe_browsing/client_side_detection_service.h @@ -7,10 +7,9 @@ // descriptor to the client-side phishing model and also to send a ping back to // Google to verify if a particular site is really phishing or not. // -// This class is not thread-safe and expects all calls to GetModelFile() and -// SendClientReportPhishingRequest() to be made on the UI thread. We also -// expect that the calling thread runs a message loop and that there is a FILE -// thread running to execute asynchronous file operations. +// This class is not thread-safe and expects all calls to be made on the UI +// thread. We also expect that the calling thread runs a message loop and that +// there is a FILE thread running to execute asynchronous file operations. #ifndef CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ #define CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ @@ -34,9 +33,13 @@ #include "base/task.h" #include "base/time.h" #include "chrome/common/net/url_fetcher.h" +#include "content/common/notification_observer.h" +#include "content/common/notification_registrar.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" +class RenderProcessHost; + namespace net { class URLRequestContextGetter; class URLRequestStatus; @@ -45,10 +48,9 @@ class URLRequestStatus; namespace safe_browsing { class ClientPhishingRequest; -class ClientSideDetectionService : public URLFetcher::Delegate { +class ClientSideDetectionService : public URLFetcher::Delegate, + public NotificationObserver { public: - typedef Callback1<base::PlatformFile>::Type OpenModelDoneCallback; - typedef Callback2<GURL /* phishing URL */, bool /* is phishing */>::Type ClientReportPhishingRequestCallback; @@ -69,13 +71,10 @@ class ClientSideDetectionService : public URLFetcher::Delegate { const ResponseCookies& cookies, const std::string& data); - // Gets the model file descriptor once the model is ready and stored - // on disk. If there was an error the callback is called and the - // platform file is set to kInvalidPlatformFileValue. The - // ClientSideDetectionService takes ownership of the |callback|. - // The callback is always called after GetModelFile() returns and on the - // same thread as GetModelFile() was called. - void GetModelFile(OpenModelDoneCallback* callback); + // NotificationObserver overrides: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); // Sends a request to the SafeBrowsing servers with the ClientPhishingRequest. // The URL scheme of the |url()| in the request should be HTTP. This method @@ -184,9 +183,6 @@ class ClientSideDetectionService : public URLFetcher::Delegate { ClientPhishingRequest* verdict, ClientReportPhishingRequestCallback* callback); - // Starts getting the model file. - void StartGetModelFile(OpenModelDoneCallback* callback); - // Called by OnURLFetchComplete to handle the response from fetching the // model. void HandleModelResponse(const URLFetcher* source, @@ -215,12 +211,14 @@ class ClientSideDetectionService : public URLFetcher::Delegate { // that we consider non-public IP addresses. Returns true on success. bool InitializePrivateNetworks(); + // Send the model to the given renderer. + void SendModelToProcess(RenderProcessHost* process); + FilePath model_path_; ModelStatus model_status_; base::PlatformFile model_file_; scoped_ptr<URLFetcher> model_fetcher_; scoped_ptr<std::string> tmp_model_string_; - std::vector<OpenModelDoneCallback*> open_callbacks_; // Map of client report phishing request to the corresponding callback that // has to be invoked when the request is done. @@ -240,7 +238,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate { // TODO(gcasto): Serialize this so that it doesn't reset on browser restart. std::queue<base::Time> phishing_report_times_; - // Used to asynchronously call the callbacks for GetModelFile and + // Used to asynchronously call the callbacks for // SendClientReportPhishingRequest. ScopedRunnableMethodFactory<ClientSideDetectionService> method_factory_; @@ -256,6 +254,8 @@ class ClientSideDetectionService : public URLFetcher::Delegate { // The network blocks that we consider private IP address ranges. std::vector<AddressRange> private_networks_; + NotificationRegistrar registrar_; + DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); }; diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index 203dd93..63a6dc0 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc @@ -47,15 +47,6 @@ class ClientSideDetectionServiceTest : public testing::Test { browser_thread_.reset(); } - base::PlatformFile GetModelFile() { - model_file_ = base::kInvalidPlatformFileValue; - csd_service_->GetModelFile(NewCallback( - this, &ClientSideDetectionServiceTest::GetModelFileDone)); - // This method will block this thread until GetModelFileDone is called. - msg_loop_.Run(); - return model_file_; - } - std::string ReadModelFile(base::PlatformFile model_file) { char buf[1024]; int n = base::ReadPlatformFile(model_file, 0, buf, 1024); @@ -155,11 +146,6 @@ class ClientSideDetectionServiceTest : public testing::Test { MessageLoop msg_loop_; private: - void GetModelFileDone(base::PlatformFile model_file) { - model_file_ = model_file; - msg_loop_.Quit(); - } - void SendRequestDone(GURL phishing_url, bool is_phishing) { ASSERT_EQ(phishing_url, phishing_url_); is_phishing_ = is_phishing; @@ -167,45 +153,12 @@ class ClientSideDetectionServiceTest : public testing::Test { } scoped_ptr<BrowserThread> browser_thread_; - base::PlatformFile model_file_; scoped_ptr<BrowserThread> file_thread_; GURL phishing_url_; bool is_phishing_; }; -TEST_F(ClientSideDetectionServiceTest, TestFetchingModel) { - ScopedTempDir tmp_dir; - ASSERT_TRUE(tmp_dir.CreateUniqueTempDir()); - FilePath model_path = tmp_dir.path().AppendASCII("model"); - - // The first time we create the csd service the model file does not exist so - // we expect there to be a fetch. - SetModelFetchResponse("BOGUS MODEL", true); - csd_service_.reset(ClientSideDetectionService::Create(model_path, NULL)); - base::PlatformFile model_file = GetModelFile(); - EXPECT_NE(model_file, base::kInvalidPlatformFileValue); - EXPECT_EQ(ReadModelFile(model_file), "BOGUS MODEL"); - - // If you call GetModelFile() multiple times you always get the same platform - // file back. We don't re-open the file. - EXPECT_EQ(GetModelFile(), model_file); - - // The second time the model already exists on disk. In this case there - // should not be any fetch. To ensure that we clear the factory. - factory_->ClearFakeReponses(); - csd_service_.reset(ClientSideDetectionService::Create(model_path, NULL)); - model_file = GetModelFile(); - EXPECT_NE(model_file, base::kInvalidPlatformFileValue); - EXPECT_EQ(ReadModelFile(model_file), "BOGUS MODEL"); - - // If the model does not exist and the fetch fails we should get an error. - model_path = tmp_dir.path().AppendASCII("another_model"); - SetModelFetchResponse("", false /* success */); - csd_service_.reset(ClientSideDetectionService::Create(model_path, NULL)); - EXPECT_EQ(GetModelFile(), base::kInvalidPlatformFileValue); -} - TEST_F(ClientSideDetectionServiceTest, ServiceObjectDeletedBeforeCallbackDone) { SetModelFetchResponse("bogus model", true /* success */); ScopedTempDir tmp_dir; diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index ca17ac0..e723645 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -25,6 +25,7 @@ #include "chrome/browser/prerender/prerender_observer.h" #include "chrome/browser/printing/print_preview_message_handler.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/safe_browsing/client_side_detection_host.h" #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" #include "chrome/browser/tab_contents/thumbnail_generator.h" #include "chrome/browser/translate/translate_tab_helper.h" @@ -73,6 +74,8 @@ TabContentsWrapper::TabContentsWrapper(TabContents* contents) password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents)); password_manager_.reset( new PasswordManager(contents, password_manager_delegate_.get())); + safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( + contents)); search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); translate_tab_helper_.reset(new TranslateTabHelper(contents)); print_view_manager_.reset(new printing::PrintViewManager(contents)); diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h index a90366c..46ae069 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h @@ -43,6 +43,10 @@ class TabContentsWrapperDelegate; class ThumbnailGenerator; class TranslateTabHelper; +namespace safe_browsing { +class ClientSideDetectionHost; +} + // Wraps TabContents and all of its supporting objects in order to control // their ownership and lifetime, while allowing TabContents to remain generic // and re-usable in other projects. @@ -132,6 +136,10 @@ class TabContentsWrapper : public NotificationObserver, return print_view_manager_.get(); } + safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { + return safebrowsing_detection_host_.get(); + } + SearchEngineTabHelper* search_engine_tab_helper() { return search_engine_tab_helper_.get(); } @@ -211,6 +219,10 @@ class TabContentsWrapper : public NotificationObserver, // Handles print job for this contents. scoped_ptr<printing::PrintViewManager> print_view_manager_; + // Handles IPCs related to SafeBrowsing client-side phishing detection. + scoped_ptr<safe_browsing::ClientSideDetectionHost> + safebrowsing_detection_host_; + scoped_ptr<SearchEngineTabHelper> search_engine_tab_helper_; scoped_ptr<TranslateTabHelper> translate_tab_helper_; diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index a663462..c9200b8 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -141,8 +141,6 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { std::string locale = g_browser_process->GetApplicationLocale(); cmd_line->AppendSwitchASCII(switches::kLang, locale); - SetCrashReporterCommandLine(cmd_line); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kChromeFrame)) cmd_line->AppendSwitch(switches::kChromeFrame); diff --git a/content/browser/DEPS b/content/browser/DEPS index c60ec03..d5c8522 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -4,10 +4,6 @@ include_rules = [ # Listing of the remaining #chrome includes in content\browser. People are
# actively working on reducing this to 0. Do not add anymore!
- # http://crbug.com/77093
- "+chrome/app/breakpad_mac.h",
- "+chrome/browser/crash_handler_host_linux.h",
-
"+chrome/browser/accessibility/browser_accessibility_state.h",
"+chrome/browser/automation/automation_resource_message_filter.h",
@@ -103,11 +99,8 @@ include_rules = [ "+chrome/browser/renderer_preferences_util.h",
# http://crbug.com/77089
- "+chrome/browser/safe_browsing/client_side_detection_host.h",
- "+chrome/browser/safe_browsing/client_side_detection_service.h",
"+chrome/browser/safe_browsing/safe_browsing_service.h",
"+chrome/browser/renderer_host/safe_browsing_resource_handler.h",
- "+chrome/common/safe_browsing/safebrowsing_messages.h",
"+chrome/browser/sessions/session_id.h",
"+chrome/browser/sessions/session_types.h",
@@ -135,11 +128,9 @@ include_rules = [ "+chrome/browser/ui/gtk/gtk_util.h",
- "+chrome/common/child_process_logging.h",
"+chrome/common/chrome_constants.h",
"+chrome/common/chrome_switches.h",
"+chrome/common/chrome_paths.h",
- "+chrome/common/chrome_paths_internal.h",
"+chrome/common/logging_chrome.h",
"+chrome/common/render_messages.h",
"+chrome/common/url_constants.h",
diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc index e6375f0..c5528d6 100644 --- a/content/browser/browser_child_process_host.cc +++ b/content/browser/browser_child_process_host.cc @@ -13,12 +13,10 @@ #include "base/process_util.h" #include "base/stl_util-inl.h" #include "base/string_util.h" -#include "chrome/app/breakpad_mac.h" -#include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" +#include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/resource_message_filter.h" #include "content/browser/trace_message_filter.h" #include "content/common/notification_service.h" @@ -26,10 +24,6 @@ #include "content/common/process_watcher.h" #include "content/common/result_codes.h" -#if defined(OS_LINUX) -#include "base/linux_util.h" -#endif // OS_LINUX - namespace { typedef std::list<BrowserChildProcessHost*> ChildProcessList; @@ -72,22 +66,6 @@ BrowserChildProcessHost::~BrowserChildProcessHost() { } // static -void BrowserChildProcessHost::SetCrashReporterCommandLine( - CommandLine* command_line) { -#if defined(USE_LINUX_BREAKPAD) - if (IsCrashReporterEnabled()) { - command_line->AppendSwitchASCII(switches::kEnableCrashReporter, - child_process_logging::GetClientId() + "," + base::GetLinuxDistro()); - } -#elif defined(OS_MACOSX) - if (IsCrashReporterEnabled()) { - command_line->AppendSwitchASCII(switches::kEnableCrashReporter, - child_process_logging::GetClientId()); - } -#endif // OS_MACOSX -} - -// static void BrowserChildProcessHost::TerminateAll() { // Make a copy since the ChildProcessHost dtor mutates the original list. ChildProcessList copy = g_child_process_list.Get(); @@ -102,6 +80,10 @@ void BrowserChildProcessHost::Launch( const base::environment_vector& environ, #endif CommandLine* cmd_line) { + + content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( + cmd_line, id()); + child_process_.reset(new ChildProcessLauncher( #if defined(OS_WIN) exposed_dir, diff --git a/content/browser/browser_child_process_host.h b/content/browser/browser_child_process_host.h index 327ac2e..07bc44d 100644 --- a/content/browser/browser_child_process_host.h +++ b/content/browser/browser_child_process_host.h @@ -23,13 +23,6 @@ class BrowserChildProcessHost : public ChildProcessHost, public: virtual ~BrowserChildProcessHost(); - // Prepares command_line for crash reporting as appropriate. On Linux and - // Mac, a command-line flag to enable crash reporting in the child process - // will be appended if needed, because the child process may not have access - // to the data that determines the status of crash reporting in the - // currently-executing process. This function is a no-op on Windows. - static void SetCrashReporterCommandLine(CommandLine* command_line); - // Terminates all child processes and deletes each ChildProcessHost instance. static void TerminateAll(); diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 49d8221..785d8a1 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -13,6 +13,7 @@ #include "base/threading/thread.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" +#include "content/browser/content_browser_client.h" #include "content/common/chrome_descriptors.h" #include "content/common/process_watcher.h" #include "content/common/result_codes.h" @@ -22,7 +23,6 @@ #include "chrome/common/sandbox_policy.h" #elif defined(OS_LINUX) #include "base/memory/singleton.h" -#include "chrome/browser/crash_handler_host_linux.h" #include "content/browser/zygote_host_linux.h" #include "content/browser/renderer_host/render_sandbox_host_linux.h" #endif @@ -114,25 +114,8 @@ class ChildProcessLauncher::Context // On Linux, we need to add some extra file descriptors for crash handling. std::string process_type = cmd_line->GetSwitchValueASCII(switches::kProcessType); - bool is_renderer = process_type == switches::kRendererProcess; - bool is_plugin = process_type == switches::kPluginProcess; - bool is_ppapi = process_type == switches::kPpapiPluginProcess; - bool is_gpu = process_type == switches::kGpuProcess; - int crash_signal_fd = -1; - if (is_renderer) { - crash_signal_fd = - RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); - } else if (is_plugin) { - crash_signal_fd = - PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); - } else if (is_ppapi) { - crash_signal_fd = - PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); - } else if (is_gpu) { - crash_signal_fd = - GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); - } - + int crash_signal_fd = + content::GetContentClient()->browser()->GetCrashSignalFD(process_type); if (use_zygote) { base::GlobalDescriptors::Mapping mapping; mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd)); @@ -157,7 +140,7 @@ class ChildProcessLauncher::Context crash_signal_fd, kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor)); } - if (is_renderer) { + if (process_type == switches::kRendererProcess) { const int sandbox_fd = RenderSandboxHostLinux::GetInstance()->GetRendererSocket(); fds_to_map.push_back(std::make_pair( diff --git a/content/browser/content_browser_client.cc b/content/browser/content_browser_client.cc index c444733..973dc02 100644 --- a/content/browser/content_browser_client.cc +++ b/content/browser/content_browser_client.cc @@ -40,4 +40,18 @@ std::string ContentBrowserClient::GetCanonicalEncodingNameByAliasName( return alias_name; } +void ContentBrowserClient::AppendExtraCommandLineSwitches( + CommandLine* command_line, int child_process_id) { +} + +std::string ContentBrowserClient::GetApplicationLocale() { + return std::string(); +} + +#if defined(OS_LINUX) +int ContentBrowserClient::GetCrashSignalFD(const std::string& process_type) { + return -1; +} +#endif + } // namespace content diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index 49a2bbf..abb654f 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -11,6 +11,7 @@ #include "content/common/content_client.h" class BrowserRenderProcessHost; +class CommandLine; class GURL; class Profile; class RenderViewHost; @@ -47,6 +48,19 @@ class ContentBrowserClient { // See CharacterEncoding's comment. virtual std::string GetCanonicalEncodingNameByAliasName( const std::string& alias_name); + + // Allows the embedder to pass extra command line flags. + // switches::kProcessType will already be set at this point. + virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, + int child_process_id); + + // Returns the locale used by the application. + virtual std::string GetApplicationLocale(); + +#if defined(OS_LINUX) + // Can return an optional fd for crash handling, otherwise returns -1. + virtual int GetCrashSignalFD(const std::string& process_type); +#endif }; } // namespace content diff --git a/content/browser/gpu_data_manager.cc b/content/browser/gpu_data_manager.cc index eafb467..4b59c0c 100644 --- a/content/browser/gpu_data_manager.cc +++ b/content/browser/gpu_data_manager.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "base/metrics/histogram.h" #include "base/string_number_conversions.h" -#include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/gpu_blacklist.h" #include "content/browser/gpu_process_host.h" +#include "content/common/content_client.h" #include "content/common/gpu/gpu_messages.h" #include "content/gpu/gpu_info_collector.h" #include "ui/gfx/gl/gl_implementation.h" @@ -48,7 +48,8 @@ void GpuDataManager::UpdateGpuInfo(const GPUInfo& gpu_info) { base::AutoLock auto_lock(gpu_info_lock_); if (!gpu_info_.Merge(gpu_info)) return; - child_process_logging::SetGpuInfo(gpu_info_); + + content::GetContentClient()->SetGpuInfo(gpu_info_); } const GPUInfo& GpuDataManager::gpu_info() const { diff --git a/content/browser/gpu_process_host.cc b/content/browser/gpu_process_host.cc index 033e543..df4d9a6 100644 --- a/content/browser/gpu_process_host.cc +++ b/content/browser/gpu_process_host.cc @@ -485,8 +485,6 @@ bool GpuProcessHost::LaunchGpuProcess() { cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); - // Propagate relevant command line switches. static const char* const kSwitchNames[] = { switches::kUseGL, diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index bc26361..a543200 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -214,8 +214,6 @@ bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); - #if defined(OS_POSIX) base::environment_vector env; #if defined(OS_MACOSX) && !defined(__LP64__) diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index f1729d8..482ee98 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -45,8 +45,6 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { switches::kPpapiPluginProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); - if (!plugin_launcher.empty()) cmd_line->PrependWrapper(plugin_launcher); diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc index eeb7d9f..ee0e253 100644 --- a/content/browser/renderer_host/browser_render_process_host.cc +++ b/content/browser/renderer_host/browser_render_process_host.cc @@ -31,16 +31,12 @@ #include "chrome/browser/io_thread.h" #include "chrome/browser/net/resolve_proxy_msg_helper.h" #include "chrome/browser/platform_util.h" -#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/web_cache_manager.h" -#include "chrome/browser/safe_browsing/client_side_detection_service.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" -#include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" -#include "chrome/common/safe_browsing/safebrowsing_messages.h" #include "content/browser/appcache/appcache_dispatcher_host.h" #include "content/browser/browser_child_process_host.h" #include "content/browser/child_process_security_policy.h" @@ -197,8 +193,7 @@ BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile) base::TimeDelta::FromSeconds(5), this, &BrowserRenderProcessHost::ClearTransportDIBCache)), accessibility_enabled_(false), - extension_process_(false), - callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { + extension_process_(false) { widget_helper_ = new RenderWidgetHelper(); WebCacheManager::GetInstance()->Add(id()); @@ -493,7 +488,8 @@ void BrowserRenderProcessHost::AppendRendererCommandLine( PropagateBrowserCommandLineToRenderer(browser_command_line, command_line); // Pass on the browser locale. - const std::string locale = g_browser_process->GetApplicationLocale(); + const std::string locale = + content::GetContentClient()->browser()->GetApplicationLocale(); command_line->AppendSwitchASCII(switches::kLang, locale); // If we run base::FieldTrials, we want to pass to their state to the @@ -506,26 +502,8 @@ void BrowserRenderProcessHost::AppendRendererCommandLine( field_trial_states); } - BrowserChildProcessHost::SetCrashReporterCommandLine(command_line); - - FilePath user_data_dir = - browser_command_line.GetSwitchValuePath(switches::kUserDataDir); - if (!user_data_dir.empty()) - command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); -#if defined(OS_CHROMEOS) - const std::string& login_profile = - browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); - if (!login_profile.empty()) - command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); -#endif - - PrefService* prefs = profile()->GetPrefs(); - // Currently this pref is only registered if applied via a policy. - if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && - prefs->GetBoolean(prefs::kDisable3DAPIs)) { - // Turn this policy into a command line switch. - command_line->AppendSwitch(switches::kDisable3DAPIs); - } + content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( + command_line, id()); // Appending disable-gpu-feature switches due to software rendering list. GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); @@ -654,12 +632,6 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( !browser_cmd.HasSwitch(switches::kDisableDatabases)) { renderer_cmd->AppendSwitch(switches::kDisableDatabases); } - - // Disable client-side phishing detection in the renderer if it is disabled - // in the browser process. - if (!g_browser_process->safe_browsing_detection_service()) { - renderer_cmd->AppendSwitch(switches::kDisableClientSidePhishingDetection); - } } base::ProcessHandle BrowserRenderProcessHost::GetHandle() { @@ -947,8 +919,6 @@ void BrowserRenderProcessHost::OnProcessLaunched() { Send(new ViewMsg_SetIsIncognitoProcess(profile()->IsOffTheRecord())); - InitClientSidePhishingDetection(); - if (max_page_id_ != -1) Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); @@ -973,29 +943,3 @@ void BrowserRenderProcessHost::OnUserMetricsRecordAction( const std::string& action) { UserMetrics::RecordComputedAction(action); } - -void BrowserRenderProcessHost::InitClientSidePhishingDetection() { - if (g_browser_process->safe_browsing_detection_service()) { - // The BrowserRenderProcessHost object might get deleted before the - // safe browsing client-side detection service class is done with opening - // the model file. To avoid crashing we use the callback factory which will - // cancel the callback if |this| is destroyed. - g_browser_process->safe_browsing_detection_service()->GetModelFile( - callback_factory_.NewCallback( - &BrowserRenderProcessHost::OpenPhishingModelDone)); - } -} - -void BrowserRenderProcessHost::OpenPhishingModelDone( - base::PlatformFile model_file) { - if (model_file != base::kInvalidPlatformFileValue) { - IPC::PlatformFileForTransit file; -#if defined(OS_POSIX) - file = base::FileDescriptor(model_file, false); -#elif defined(OS_WIN) - ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, - false, DUPLICATE_SAME_ACCESS); -#endif - Send(new SafeBrowsingMsg_SetPhishingModel(file)); - } -} diff --git a/content/browser/renderer_host/browser_render_process_host.h b/content/browser/renderer_host/browser_render_process_host.h index 1c14322..d3eee33 100644 --- a/content/browser/renderer_host/browser_render_process_host.h +++ b/content/browser/renderer_host/browser_render_process_host.h @@ -10,9 +10,7 @@ #include <queue> #include <string> -#include "base/memory/scoped_callback_factory.h" #include "base/memory/scoped_ptr.h" -#include "base/platform_file.h" #include "base/process.h" #include "base/timer.h" #include "content/browser/child_process_launcher.h" @@ -100,15 +98,6 @@ class BrowserRenderProcessHost : public RenderProcessHost, // Callers can reduce the RenderProcess' priority. void SetBackgrounded(bool backgrounded); - // Initializes client-side phishing detection. Starts reading the phishing - // model from the client-side detection service class. Once the model is read - // OpenPhishingModelDone() is invoked. - void InitClientSidePhishingDetection(); - - // Called once the client-side detection service class is done with opening - // the model file. - void OpenPhishingModelDone(base::PlatformFile model_file); - // The count of currently visible widgets. Since the host can be a container // for multiple widgets, it uses this count to determine when it should be // backgrounded. @@ -154,8 +143,6 @@ class BrowserRenderProcessHost : public RenderProcessHost, // because the queued messages may have dependencies on the init messages. std::queue<IPC::Message*> queued_messages_; - base::ScopedCallbackFactory<BrowserRenderProcessHost> callback_factory_; - DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); }; diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index 310e1cf..90974b8 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -11,11 +11,9 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browser_about_handler.h" #include "chrome/browser/browser_url_handler.h" -#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/in_process_webkit/session_storage_namespace.h" diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 2868d35..26a0493 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -36,7 +36,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/web_cache_manager.h" #include "chrome/browser/renderer_preferences_util.h" -#include "chrome/browser/safe_browsing/client_side_detection_host.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" @@ -348,8 +347,6 @@ TabContents::~TabContents() { void TabContents::AddObservers() { favicon_tab_helper_.reset(new FaviconTabHelper(this)); plugin_observer_.reset(new PluginObserver(this)); - safebrowsing_detection_host_.reset(new safe_browsing::ClientSideDetectionHost( - this)); net::NetworkChangeNotifier::AddOnlineStateObserver(this); } diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 3ef1372..ff7cd79 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -47,10 +47,6 @@ namespace history { class HistoryAddPageArgs; } -namespace safe_browsing { -class ClientSideDetectionHost; -} - class WebUI; class DownloadItem; class Extension; @@ -576,10 +572,6 @@ class TabContents : public PageNavigator, int content_restrictions() const { return content_restrictions_; } void SetContentRestrictions(int restrictions); - safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { - return safebrowsing_detection_host_.get(); - } - // Query the WebUIFactory for the TypeID for the current URL. WebUI::TypeID GetWebUITypeForCurrentState(); @@ -908,10 +900,6 @@ class TabContents : public PageNavigator, // RenderViewHost::ContentSettingsDelegate. scoped_ptr<TabSpecificContentSettings> content_settings_delegate_; - // Handles IPCs related to SafeBrowsing client-side phishing detection. - scoped_ptr<safe_browsing::ClientSideDetectionHost> - safebrowsing_detection_host_; - // Data for loading state ---------------------------------------------------- // Indicates whether we're currently loading a resource. diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 47783a1..82ec1cf 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -125,7 +125,6 @@ bool WorkerProcessHost::Init(int render_process_id) { CommandLine* cmd_line = new CommandLine(exe_path); cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kWorkerProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); - SetCrashReporterCommandLine(cmd_line); static const char* const kSwitchNames[] = { switches::kWebWorkerShareProcesses, diff --git a/content/common/content_client.h b/content/common/content_client.h index f0a272e..e985f4b 100644 --- a/content/common/content_client.h +++ b/content/common/content_client.h @@ -9,6 +9,7 @@ #include <vector> #include "base/basictypes.h" +#include "build/build_config.h" class GURL; struct GPUInfo; |