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

Unified Diff: chrome/browser/android/crash_dump_manager.h

Issue 31243002: Move Linux/Android breakpad implementation to breakpad component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/client_util.cc ('k') | chrome/browser/android/crash_dump_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/crash_dump_manager.h
diff --git a/chrome/browser/android/crash_dump_manager.h b/chrome/browser/android/crash_dump_manager.h
deleted file mode 100644
index 9b0438ef4b0ef42cd6666c6d6bf0ff9955af4a15..0000000000000000000000000000000000000000
--- a/chrome/browser/android/crash_dump_manager.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_ANDROID_CRASH_DUMP_MANAGER_H_
-#define CHROME_BROWSER_ANDROID_CRASH_DUMP_MANAGER_H_
-
-#include <map>
-
-#include "base/files/file_path.h"
-#include "base/platform_file.h"
-#include "base/process/process.h"
-#include "base/synchronization/lock.h"
-#include "content/public/browser/browser_child_process_observer.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-
-namespace content {
-class RenderProcessHost;
-}
-
-// This class manages the crash minidumps.
-// On Android, because of process isolation, each renderer process runs with a
-// different UID. As a result, we cannot generate the minidumps in the browser
-// (as the browser process does not have access to some system files for the
-// crashed process). So the minidump is generated in the renderer process.
-// Since the isolated process cannot open files, we provide it on creation with
-// a file descriptor where to write the minidump in the event of a crash.
-// This class creates these file descriptors and associates them with render
-// processes and take the appropriate action when the render process terminates.
-class CrashDumpManager : public content::BrowserChildProcessObserver,
- public content::NotificationObserver {
- public:
- // This object is a singleton created and owned by the
- // ChromeBrowserMainPartsAndroid.
- static CrashDumpManager* GetInstance();
-
- virtual ~CrashDumpManager();
-
- // Returns a file descriptor that should be used to generate a minidump for
- // the process |child_process_id|.
- int CreateMinidumpFile(int child_process_id);
-
- private:
- friend class ChromeBrowserMainPartsAndroid;
-
- // Should be created on the UI thread.
- explicit CrashDumpManager(const base::FilePath& crash_dump_dir);
-
- typedef std::map<int, base::FilePath> ChildProcessIDToMinidumpPath;
-
- static void ProcessMinidump(const base::FilePath& minidump_path,
- base::ProcessHandle pid);
-
- // content::BrowserChildProcessObserver implementation:
- virtual void BrowserChildProcessHostDisconnected(
- const content::ChildProcessData& data) OVERRIDE;
- virtual void BrowserChildProcessCrashed(
- const content::ChildProcessData& data) OVERRIDE;
-
- // NotificationObserver implementation:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Called on child process exit (including crash).
- void OnChildExit(int child_process_id, base::ProcessHandle pid);
-
- content::NotificationRegistrar notification_registrar_;
-
- // This map should only be accessed with its lock aquired as it is accessed
- // from the PROCESS_LAUNCHER and UI threads.
- base::Lock child_process_id_to_minidump_path_lock_;
- ChildProcessIDToMinidumpPath child_process_id_to_minidump_path_;
-
- base::FilePath crash_dump_dir_;
-
- static CrashDumpManager* instance_;
-
- DISALLOW_COPY_AND_ASSIGN(CrashDumpManager);
-};
-
-#endif // CHROME_BROWSER_ANDROID_CRASH_DUMP_MANAGER_H_
« no previous file with comments | « chrome/app/client_util.cc ('k') | chrome/browser/android/crash_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698