| 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/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
| 37 #include "base/android/path_utils.h" | 37 #include "base/android/path_utils.h" |
| 38 #include "base/path_service.h" | 38 #include "base/path_service.h" |
| 39 #include "components/breakpad/browser/crash_dump_manager_android.h" | 39 #include "components/breakpad/browser/crash_dump_manager_android.h" |
| 40 #include "content/shell/android/shell_descriptors.h" | 40 #include "content/shell/android/shell_descriptors.h" |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 43 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 44 #include "base/debug/leak_annotations.h" | 44 #include "base/debug/leak_annotations.h" |
| 45 #include "base/platform_file.h" | |
| 46 #include "components/breakpad/app/breakpad_linux.h" | 45 #include "components/breakpad/app/breakpad_linux.h" |
| 47 #include "components/breakpad/browser/crash_handler_host_linux.h" | 46 #include "components/breakpad/browser/crash_handler_host_linux.h" |
| 48 #include "content/public/common/content_descriptors.h" | 47 #include "content/public/common/content_descriptors.h" |
| 49 #endif | 48 #endif |
| 50 | 49 |
| 51 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 52 #include "content/common/sandbox_win.h" | 51 #include "content/common/sandbox_win.h" |
| 53 #include "sandbox/win/src/sandbox.h" | 52 #include "sandbox/win/src/sandbox.h" |
| 54 #endif | 53 #endif |
| 55 | 54 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 const GURL& new_url) { | 288 const GURL& new_url) { |
| 290 return g_swap_processes_for_redirect; | 289 return g_swap_processes_for_redirect; |
| 291 } | 290 } |
| 292 | 291 |
| 293 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 292 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 294 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 293 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 295 const CommandLine& command_line, | 294 const CommandLine& command_line, |
| 296 int child_process_id, | 295 int child_process_id, |
| 297 std::vector<FileDescriptorInfo>* mappings) { | 296 std::vector<FileDescriptorInfo>* mappings) { |
| 298 #if defined(OS_ANDROID) | 297 #if defined(OS_ANDROID) |
| 299 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; | 298 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| 300 base::FilePath pak_file; | 299 base::FilePath pak_file; |
| 301 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); | 300 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); |
| 302 CHECK(r); | 301 CHECK(r); |
| 303 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); | 302 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); |
| 304 pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak")); | 303 pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak")); |
| 305 | 304 |
| 306 base::File f(pak_file, flags); | 305 base::File f(pak_file, flags); |
| 307 if (!f.IsValid()) { | 306 if (!f.IsValid()) { |
| 308 NOTREACHED() << "Failed to open file when creating renderer process: " | 307 NOTREACHED() << "Failed to open file when creating renderer process: " |
| 309 << "content_shell.pak"; | 308 << "content_shell.pak"; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 ShellBrowserContext* | 364 ShellBrowserContext* |
| 366 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 365 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 367 BrowserContext* content_browser_context) { | 366 BrowserContext* content_browser_context) { |
| 368 if (content_browser_context == browser_context()) | 367 if (content_browser_context == browser_context()) |
| 369 return browser_context(); | 368 return browser_context(); |
| 370 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 369 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 371 return off_the_record_browser_context(); | 370 return off_the_record_browser_context(); |
| 372 } | 371 } |
| 373 | 372 |
| 374 } // namespace content | 373 } // namespace content |
| OLD | NEW |