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

Unified Diff: chrome/installer/setup/setup_main.cc

Issue 160283002: chrome/installer: Make InitializeCrashReporting() return a scoped_ptr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include scoped_ptr.h Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 6df112f0bbef1e6a149526cc3c76031c96dad22a..32c26ea86061f84e86c99d0b159eac2e47e3fd4c 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -18,6 +18,7 @@
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
+#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/strings/string16.h"
@@ -1278,16 +1279,16 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* exe_path) {
// Initialize crash reporting for this process. This involves connecting to
// breakpad, etc.
-google_breakpad::ExceptionHandler* InitializeCrashReporting(
+scoped_ptr<google_breakpad::ExceptionHandler> InitializeCrashReporting(
bool system_install) {
// Only report crashes if the user allows it.
if (!GoogleUpdateSettings::GetCollectStatsConsent())
- return NULL;
+ return scoped_ptr<google_breakpad::ExceptionHandler>();
// Get the alternate dump directory. We use the temp path.
base::FilePath temp_directory;
if (!base::GetTempDir(&temp_directory) || temp_directory.empty())
- return NULL;
+ return scoped_ptr<google_breakpad::ExceptionHandler>();
wchar_t exe_path[MAX_PATH * 2] = {0};
GetModuleFileName(NULL, exe_path, arraysize(exe_path));
@@ -1299,19 +1300,18 @@ google_breakpad::ExceptionHandler* InitializeCrashReporting(
if (!system_install) {
if (!base::win::GetUserSidString(&user_sid)) {
- return NULL;
+ return scoped_ptr<google_breakpad::ExceptionHandler>();
}
}
base::string16 pipe_name = kGoogleUpdatePipeName;
pipe_name += user_sid;
- google_breakpad::ExceptionHandler* breakpad =
+ return scoped_ptr<google_breakpad::ExceptionHandler>(
new google_breakpad::ExceptionHandler(
temp_directory.value(), NULL, NULL, NULL,
google_breakpad::ExceptionHandler::HANDLER_ALL, kLargerDumpType,
- pipe_name.c_str(), GetCustomInfo(exe_path));
- return breakpad;
+ pipe_name.c_str(), GetCustomInfo(exe_path)));
}
// Uninstalls multi-install Chrome Frame if the current operation is a
@@ -1695,7 +1695,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install);
VLOG(1) << "system install is " << system_install;
- google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
+ scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
InitializeCrashReporting(system_install));
InstallationState original_state;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698