Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 29943005: Prepare CrashHandlerHostLinux for move to breakpad component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #include "chrome/browser/ui/chrome_select_file_policy.h" 86 #include "chrome/browser/ui/chrome_select_file_policy.h"
87 #include "chrome/browser/ui/sync/sync_promo_ui.h" 87 #include "chrome/browser/ui/sync/sync_promo_ui.h"
88 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" 88 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
89 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 89 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
90 #include "chrome/browser/user_style_sheet_watcher.h" 90 #include "chrome/browser/user_style_sheet_watcher.h"
91 #include "chrome/browser/user_style_sheet_watcher_factory.h" 91 #include "chrome/browser/user_style_sheet_watcher_factory.h"
92 #include "chrome/browser/validation_message_message_filter.h" 92 #include "chrome/browser/validation_message_message_filter.h"
93 #include "chrome/common/chrome_constants.h" 93 #include "chrome/common/chrome_constants.h"
94 #include "chrome/common/chrome_paths.h" 94 #include "chrome/common/chrome_paths.h"
95 #include "chrome/common/chrome_switches.h" 95 #include "chrome/common/chrome_switches.h"
96 #include "chrome/common/env_vars.h"
96 #include "chrome/common/extensions/background_info.h" 97 #include "chrome/common/extensions/background_info.h"
97 #include "chrome/common/extensions/extension.h" 98 #include "chrome/common/extensions/extension.h"
98 #include "chrome/common/extensions/extension_process_policy.h" 99 #include "chrome/common/extensions/extension_process_policy.h"
99 #include "chrome/common/extensions/extension_set.h" 100 #include "chrome/common/extensions/extension_set.h"
100 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" 101 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
101 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" 102 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h"
102 #include "chrome/common/extensions/permissions/permissions_data.h" 103 #include "chrome/common/extensions/permissions/permissions_data.h"
103 #include "chrome/common/extensions/permissions/socket_permission.h" 104 #include "chrome/common/extensions/permissions/socket_permission.h"
104 #include "chrome/common/extensions/web_accessible_resources_handler.h" 105 #include "chrome/common/extensions/web_accessible_resources_handler.h"
105 #include "chrome/common/logging_chrome.h" 106 #include "chrome/common/logging_chrome.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 #include "chrome/browser/android/crash_dump_manager.h" 167 #include "chrome/browser/android/crash_dump_manager.h"
167 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" 168 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
168 #include "chrome/browser/chrome_browser_main_android.h" 169 #include "chrome/browser/chrome_browser_main_android.h"
169 #include "chrome/browser/media/encrypted_media_message_filter_android.h" 170 #include "chrome/browser/media/encrypted_media_message_filter_android.h"
170 #include "chrome/common/descriptors_android.h" 171 #include "chrome/common/descriptors_android.h"
171 #elif defined(OS_POSIX) 172 #elif defined(OS_POSIX)
172 #include "chrome/browser/chrome_browser_main_posix.h" 173 #include "chrome/browser/chrome_browser_main_posix.h"
173 #endif 174 #endif
174 175
175 #if defined(OS_POSIX) && !defined(OS_MACOSX) 176 #if defined(OS_POSIX) && !defined(OS_MACOSX)
177 #include "base/debug/leak_annotations.h"
176 #include "base/linux_util.h" 178 #include "base/linux_util.h"
177 #include "chrome/app/breakpad_linux.h" 179 #include "chrome/app/breakpad_linux.h"
178 #include "chrome/browser/crash_handler_host_linux.h" 180 #include "chrome/browser/crash_handler_host_linux.h"
179 #endif 181 #endif
180 182
181 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 183 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
182 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 184 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
183 #endif 185 #endif
184 186
185 #if defined(OS_ANDROID) 187 #if defined(OS_ANDROID)
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { 488 for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) {
487 const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; 489 const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i];
488 std::string pref_name = base::StringPrintf("%s.%s", map_name, script); 490 std::string pref_name = base::StringPrintf("%s.%s", map_name, script);
489 std::string font_family = prefs->GetString(pref_name.c_str()); 491 std::string font_family = prefs->GetString(pref_name.c_str());
490 if (!font_family.empty()) 492 if (!font_family.empty())
491 (*map)[script] = UTF8ToUTF16(font_family); 493 (*map)[script] = UTF8ToUTF16(font_family);
492 } 494 }
493 } 495 }
494 496
495 #if defined(OS_POSIX) && !defined(OS_MACOSX) 497 #if defined(OS_POSIX) && !defined(OS_MACOSX)
498 CrashHandlerHostLinux* CreateCrashHandlerHost(const std::string& process_type) {
499 base::FilePath dumps_path;
500 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
501 {
502 ANNOTATE_SCOPED_MEMORY_LEAK;
503 return new CrashHandlerHostLinux(
504 process_type, dumps_path, (getenv(env_vars::kHeadless) == NULL));
Nico 2013/10/19 01:28:46 no parens for the 3rd param here (compilers usuall
jochen (gone - plz use gerrit) 2013/10/19 02:38:36 Done.
505 }
506 }
507
496 int GetCrashSignalFD(const CommandLine& command_line) { 508 int GetCrashSignalFD(const CommandLine& command_line) {
497 if (command_line.HasSwitch(switches::kExtensionProcess)) { 509 if (command_line.HasSwitch(switches::kExtensionProcess)) {
498 ExtensionCrashHandlerHostLinux* crash_handler = 510 static CrashHandlerHostLinux* crash_handler = NULL;
499 ExtensionCrashHandlerHostLinux::GetInstance(); 511 if (!crash_handler)
512 crash_handler = CreateCrashHandlerHost("extension");
500 return crash_handler->GetDeathSignalSocket(); 513 return crash_handler->GetDeathSignalSocket();
501 } 514 }
502 515
503 std::string process_type = 516 std::string process_type =
504 command_line.GetSwitchValueASCII(switches::kProcessType); 517 command_line.GetSwitchValueASCII(switches::kProcessType);
505 518
506 if (process_type == switches::kRendererProcess) 519 if (process_type == switches::kRendererProcess) {
507 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 520 static CrashHandlerHostLinux* crash_handler = NULL;
521 if (!crash_handler)
522 crash_handler = CreateCrashHandlerHost(process_type);
523 return crash_handler->GetDeathSignalSocket();
524 }
508 525
509 if (process_type == switches::kPluginProcess) 526 if (process_type == switches::kPluginProcess) {
510 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 527 static CrashHandlerHostLinux* crash_handler = NULL;
528 if (!crash_handler)
529 crash_handler = CreateCrashHandlerHost(process_type);
530 return crash_handler->GetDeathSignalSocket();
531 }
511 532
512 if (process_type == switches::kPpapiPluginProcess) 533 if (process_type == switches::kPpapiPluginProcess) {
513 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 534 static CrashHandlerHostLinux* crash_handler = NULL;
535 if (!crash_handler)
536 crash_handler = CreateCrashHandlerHost(process_type);
537 return crash_handler->GetDeathSignalSocket();
538 }
514 539
515 if (process_type == switches::kGpuProcess) 540 if (process_type == switches::kGpuProcess) {
516 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 541 static CrashHandlerHostLinux* crash_handler = NULL;
542 if (!crash_handler)
543 crash_handler = CreateCrashHandlerHost(process_type);
544 return crash_handler->GetDeathSignalSocket();
545 }
517 546
518 return -1; 547 return -1;
519 } 548 }
520 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 549 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
521 550
522 #if !defined(OS_CHROMEOS) 551 #if !defined(OS_CHROMEOS)
523 GURL GetEffectiveURLForSignin(const GURL& url) { 552 GURL GetEffectiveURLForSignin(const GURL& url) {
524 CHECK(SigninManager::IsWebBasedSigninFlowURL(url)); 553 CHECK(SigninManager::IsWebBasedSigninFlowURL(url));
525 554
526 GURL effective_url(SigninManager::kChromeSigninEffectiveSite); 555 GURL effective_url(SigninManager::kChromeSigninEffectiveSite);
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, 2608 return IsExtensionOrSharedModuleWhitelisted(url, extension_set,
2580 allowed_file_handle_origins_) || 2609 allowed_file_handle_origins_) ||
2581 IsHostAllowedByCommandLine(url, extension_set, 2610 IsHostAllowedByCommandLine(url, extension_set,
2582 switches::kAllowNaClFileHandleAPI); 2611 switches::kAllowNaClFileHandleAPI);
2583 #else 2612 #else
2584 return false; 2613 return false;
2585 #endif 2614 #endif
2586 } 2615 }
2587 2616
2588 } // namespace chrome 2617 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/crash_handler_host_linux.h » ('j') | chrome/browser/crash_handler_host_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698