| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/crash/content/browser/crash_dump_observer_android.h" | 5 #include "components/crash/content/browser/crash_dump_observer_android.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/browser/child_process_data.h" | 14 #include "content/public/browser/child_process_data.h" |
| 15 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
| 16 #include "content/public/browser/notification_types.h" | 16 #include "content/public/browser/notification_types.h" |
| 17 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 18 | 18 |
| 19 using content::BrowserThread; | 19 using content::BrowserThread; |
| 20 | 20 |
| 21 namespace breakpad { | 21 namespace breakpad { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 base::LazyInstance<CrashDumpObserver> g_instance = LAZY_INSTANCE_INITIALIZER; | 24 base::LazyInstance<CrashDumpObserver>::DestructorAtExit g_instance = |
| 25 LAZY_INSTANCE_INITIALIZER; |
| 25 } | 26 } |
| 26 | 27 |
| 27 // static | 28 // static |
| 28 void CrashDumpObserver::Create() { | 29 void CrashDumpObserver::Create() { |
| 29 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 30 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 30 // If this DCHECK fails in a unit test then a previously executing | 31 // If this DCHECK fails in a unit test then a previously executing |
| 31 // test that makes use of CrashDumpObserver forgot to create a | 32 // test that makes use of CrashDumpObserver forgot to create a |
| 32 // ShadowingAtExitManager. | 33 // ShadowingAtExitManager. |
| 33 DCHECK(g_instance == nullptr); | 34 DCHECK(g_instance == nullptr); |
| 34 g_instance.Get(); | 35 g_instance.Get(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (pid == base::kNullProcessHandle) { | 162 if (pid == base::kNullProcessHandle) { |
| 162 pid = iter->second; | 163 pid = iter->second; |
| 163 } | 164 } |
| 164 child_process_id_to_pid_.erase(iter); | 165 child_process_id_to_pid_.erase(iter); |
| 165 } | 166 } |
| 166 OnChildExit(rph->GetID(), pid, content::PROCESS_TYPE_RENDERER, term_status, | 167 OnChildExit(rph->GetID(), pid, content::PROCESS_TYPE_RENDERER, term_status, |
| 167 app_state); | 168 app_state); |
| 168 } | 169 } |
| 169 | 170 |
| 170 } // namespace breakpad | 171 } // namespace breakpad |
| OLD | NEW |