Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: components/crash/content/browser/crash_dump_observer_android.cc

Issue 2304733002: crash: Fixes following r413431 (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // static 23 // static
24 CrashDumpObserver* CrashDumpObserver::GetInstance() { 24 CrashDumpObserver* CrashDumpObserver::GetInstance() {
25 return base::Singleton<CrashDumpObserver>::get(); 25 return base::Singleton<CrashDumpObserver>::get();
Lei Zhang 2016/09/01 23:17:58 For later, I guess. Speaking of Singletons, is it
boliu 2016/09/01 23:26:18 Err, I'll leave that one to original CL author. P
Lei Zhang 2016/09/01 23:30:44 Right, not directed at you.
26 } 26 }
27 27
28 CrashDumpObserver::CrashDumpObserver() { 28 CrashDumpObserver::CrashDumpObserver() {
29 notification_registrar_.Add(this, 29 notification_registrar_.Add(this,
30 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 30 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
31 content::NotificationService::AllSources()); 31 content::NotificationService::AllSources());
32 notification_registrar_.Add(this, 32 notification_registrar_.Add(this,
33 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, 33 content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
34 content::NotificationService::AllSources()); 34 content::NotificationService::AllSources());
35 BrowserChildProcessObserver::Add(this);
Lei Zhang 2016/09/01 23:17:58 Does the dtor need a BrowserChildProcessObserver::
boliu 2016/09/01 23:26:18 Ahh, good point. Done (Although.. this is android
Lei Zhang 2016/09/01 23:30:44 Right, just wondering what the policy is on Androi
35 } 36 }
36 37
37 CrashDumpObserver::~CrashDumpObserver() {} 38 CrashDumpObserver::~CrashDumpObserver() {}
38 39
39 void CrashDumpObserver::OnChildExitOnBlockingPool( 40 void CrashDumpObserver::OnChildExitOnBlockingPool(
40 Client* client, 41 Client* client,
41 int child_process_id, 42 int child_process_id,
42 base::ProcessHandle pid, 43 base::ProcessHandle pid,
43 content::ProcessType process_type, 44 content::ProcessType process_type,
44 base::TerminationStatus termination_status, 45 base::TerminationStatus termination_status,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 default: 144 default:
144 NOTREACHED(); 145 NOTREACHED();
145 return; 146 return;
146 } 147 }
147 148
148 OnChildExit(rph->GetID(), rph->GetHandle(), content::PROCESS_TYPE_RENDERER, 149 OnChildExit(rph->GetID(), rph->GetHandle(), content::PROCESS_TYPE_RENDERER,
149 term_status, app_state); 150 term_status, app_state);
150 } 151 }
151 152
152 } // namespace breakpad 153 } // namespace breakpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698