| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "content/public/common/content_descriptors.h" | 48 #include "content/public/common/content_descriptors.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 namespace content { | 51 namespace content { |
| 52 | 52 |
| 53 namespace { | 53 namespace { |
| 54 | 54 |
| 55 ShellContentBrowserClient* g_browser_client; | 55 ShellContentBrowserClient* g_browser_client; |
| 56 bool g_swap_processes_for_redirect = false; | 56 bool g_swap_processes_for_redirect = false; |
| 57 | 57 |
| 58 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 58 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 59 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( | 59 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
| 60 const std::string& process_type) { | 60 const std::string& process_type) { |
| 61 base::FilePath dumps_path = | 61 base::FilePath dumps_path = |
| 62 CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 62 CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 63 switches::kCrashDumpsDir); | 63 switches::kCrashDumpsDir); |
| 64 { | 64 { |
| 65 ANNOTATE_SCOPED_MEMORY_LEAK; | 65 ANNOTATE_SCOPED_MEMORY_LEAK; |
| 66 breakpad::CrashHandlerHostLinux* crash_handler = | 66 breakpad::CrashHandlerHostLinux* crash_handler = |
| 67 new breakpad::CrashHandlerHostLinux( | 67 new breakpad::CrashHandlerHostLinux( |
| 68 process_type, dumps_path, false); | 68 process_type, dumps_path, false); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 if (process_type == switches::kGpuProcess) { | 102 if (process_type == switches::kGpuProcess) { |
| 103 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | 103 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; |
| 104 if (!crash_handler) | 104 if (!crash_handler) |
| 105 crash_handler = CreateCrashHandlerHost(process_type); | 105 crash_handler = CreateCrashHandlerHost(process_type); |
| 106 return crash_handler->GetDeathSignalSocket(); | 106 return crash_handler->GetDeathSignalSocket(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 return -1; | 109 return -1; |
| 110 } | 110 } |
| 111 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 111 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| 114 | 114 |
| 115 ShellContentBrowserClient* ShellContentBrowserClient::Get() { | 115 ShellContentBrowserClient* ShellContentBrowserClient::Get() { |
| 116 return g_browser_client; | 116 return g_browser_client; |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) { | 119 void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) { |
| 120 g_swap_processes_for_redirect = swap; | 120 g_swap_processes_for_redirect = swap; |
| 121 } | 121 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 ShellBrowserContext* | 367 ShellBrowserContext* |
| 368 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 368 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 369 BrowserContext* content_browser_context) { | 369 BrowserContext* content_browser_context) { |
| 370 if (content_browser_context == browser_context()) | 370 if (content_browser_context == browser_context()) |
| 371 return browser_context(); | 371 return browser_context(); |
| 372 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 372 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 373 return off_the_record_browser_context(); | 373 return off_the_record_browser_context(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace content | 376 } // namespace content |
| OLD | NEW |