| OLD | NEW |
| 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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
| 6 | 6 |
| 7 #include "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // On Android, the browser process isn't the parent. A bunch | 196 // On Android, the browser process isn't the parent. A bunch |
| 197 // of work will be required before callers of this routine will | 197 // of work will be required before callers of this routine will |
| 198 // get what they want. | 198 // get what they want. |
| 199 // | 199 // |
| 200 // Note: On Linux, base::GetParentProcessId() is defined in | 200 // Note: On Linux, base::GetParentProcessId() is defined in |
| 201 // process_util_linux.cc. Note that *_linux.cc is excluded from | 201 // process_util_linux.cc. Note that *_linux.cc is excluded from |
| 202 // Android builds but a special exception is made in base.gypi | 202 // Android builds but a special exception is made in base.gypi |
| 203 // for a few files including process_util_linux.cc. | 203 // for a few files including process_util_linux.cc. |
| 204 LOG(ERROR) << "GetBrowserPid() not implemented for Android()."; | 204 LOG(ERROR) << "GetBrowserPid() not implemented for Android()."; |
| 205 #elif defined(OS_POSIX) | 205 #elif defined(OS_POSIX) |
| 206 // On linux, we're in the zygote here; so we need the parent process' id. | 206 // On linux, we're in a process forked from the zygote here; so we need the |
| 207 browser_pid = base::GetParentProcessId(base::GetCurrentProcId()); | 207 // parent's parent process' id. |
| 208 browser_pid = |
| 209 base::GetParentProcessId( |
| 210 base::GetParentProcessId(base::GetCurrentProcId())); |
| 208 #endif | 211 #endif |
| 209 } | 212 } |
| 210 return browser_pid; | 213 return browser_pid; |
| 211 } | 214 } |
| 212 | 215 |
| 213 static void InitializeStatsTable(const CommandLine& command_line) { | 216 static void InitializeStatsTable(const CommandLine& command_line) { |
| 214 // Initialize the Stats Counters table. With this initialized, | 217 // Initialize the Stats Counters table. With this initialized, |
| 215 // the StatsViewer can be utilized to read counters outside of | 218 // the StatsViewer can be utilized to read counters outside of |
| 216 // Chrome. These lines can be commented out to effectively turn | 219 // Chrome. These lines can be commented out to effectively turn |
| 217 // counters 'off'. The table is created and exists for the life | 220 // counters 'off'. The table is created and exists for the life |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 685 |
| 683 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 686 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 684 }; | 687 }; |
| 685 | 688 |
| 686 // static | 689 // static |
| 687 ContentMainRunner* ContentMainRunner::Create() { | 690 ContentMainRunner* ContentMainRunner::Create() { |
| 688 return new ContentMainRunnerImpl(); | 691 return new ContentMainRunnerImpl(); |
| 689 } | 692 } |
| 690 | 693 |
| 691 } // namespace content | 694 } // namespace content |
| OLD | NEW |