Chromium Code Reviews| 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 "base/debug/stack_trace.h" | 5 #include "base/debug/stack_trace.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 // at ../sysdeps/x86_64/../ia64/backtrace.c:104 | 437 // at ../sysdeps/x86_64/../ia64/backtrace.c:104 |
| 438 // #20 0x0000000000752a54 in base::debug::StackTrace::StackTrace | 438 // #20 0x0000000000752a54 in base::debug::StackTrace::StackTrace |
| 439 // at base/debug/stack_trace_posix.cc:175 | 439 // at base/debug/stack_trace_posix.cc:175 |
| 440 // #21 0x00000000007a4ae5 in | 440 // #21 0x00000000007a4ae5 in |
| 441 // base::(anonymous namespace)::StackDumpSignalHandler | 441 // base::(anonymous namespace)::StackDumpSignalHandler |
| 442 // at base/process_util_posix.cc:172 | 442 // at base/process_util_posix.cc:172 |
| 443 // #22 <signal handler called> | 443 // #22 <signal handler called> |
| 444 StackTrace stack_trace; | 444 StackTrace stack_trace; |
| 445 } | 445 } |
| 446 | 446 |
| 447 } // namespace | 447 } // namespace |
|
Lei Zhang
2016/08/09 00:39:28
BTW, this can be moved down to just abouve EnableI
robliao
2016/08/09 18:06:52
Done
| |
| 448 | 448 |
| 449 #if defined(USE_SYMBOLIZE) | 449 #if defined(USE_SYMBOLIZE) |
| 450 | 450 |
| 451 // class SandboxSymbolizeHelper. | 451 // class SandboxSymbolizeHelper. |
| 452 // | 452 // |
| 453 // The purpose of this class is to prepare and install a "file open" callback | 453 // The purpose of this class is to prepare and install a "file open" callback |
| 454 // needed by the stack trace symbolization code | 454 // needed by the stack trace symbolization code |
| 455 // (base/third_party/symbolize/symbolize.h) so that it can function properly | 455 // (base/third_party/symbolize/symbolize.h) so that it can function properly |
| 456 // in a sandboxed process. The caveat is that this class must be instantiated | 456 // in a sandboxed process. The caveat is that this class must be instantiated |
| 457 // before the sandboxing is enabled so that it can get the chance to open all | 457 // before the sandboxing is enabled so that it can get the chance to open all |
| 458 // the object files that are loaded in the virtual address space of the current | 458 // the object files that are loaded in the virtual address space of the current |
| 459 // process. | 459 // process. |
| 460 class SandboxSymbolizeHelper { | 460 class SandboxSymbolizeHelper { |
| 461 public: | 461 public: |
| 462 // Returns the singleton instance. | 462 // Returns the singleton instance. |
| 463 static SandboxSymbolizeHelper* GetInstance() { | 463 static SandboxSymbolizeHelper* GetInstance() { |
| 464 return Singleton<SandboxSymbolizeHelper>::get(); | 464 return Singleton<SandboxSymbolizeHelper, |
| 465 LeakySingletonTraits<SandboxSymbolizeHelper>>::get(); | |
| 465 } | 466 } |
| 466 | 467 |
| 467 private: | 468 private: |
| 468 friend struct DefaultSingletonTraits<SandboxSymbolizeHelper>; | 469 friend struct DefaultSingletonTraits<SandboxSymbolizeHelper>; |
| 469 | 470 |
| 470 SandboxSymbolizeHelper() | 471 SandboxSymbolizeHelper() |
| 471 : is_initialized_(false) { | 472 : is_initialized_(false) { |
| 472 Init(); | 473 Init(); |
| 473 } | 474 } |
| 474 | 475 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 804 *ptr = *start; | 805 *ptr = *start; |
| 805 *start++ = ch; | 806 *start++ = ch; |
| 806 } | 807 } |
| 807 return buf; | 808 return buf; |
| 808 } | 809 } |
| 809 | 810 |
| 810 } // namespace internal | 811 } // namespace internal |
| 811 | 812 |
| 812 } // namespace debug | 813 } // namespace debug |
| 813 } // namespace base | 814 } // namespace base |
| OLD | NEW |