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

Side by Side Diff: chrome/install_static/user_data_dir.cc

Issue 2867063002: Stability instrumentation Crashpad integration (Closed)
Patch Set: process type: auto init + crashpad handler type Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/install_static/user_data_dir.h" 5 #include "chrome/install_static/user_data_dir.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <assert.h> 8 #include <assert.h>
9 9
10 #include "chrome/install_static/install_details.h" 10 #include "chrome/install_static/install_details.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // don't as this function is used to initialize crash reporting, so 128 // don't as this function is used to initialize crash reporting, so
129 // we would get no report of this failure. 129 // we would get no report of this failure.
130 assert(got_valid_directory); 130 assert(got_valid_directory);
131 if (!got_valid_directory) 131 if (!got_valid_directory)
132 return false; 132 return false;
133 133
134 *result = MakeAbsoluteFilePath(user_data_dir); 134 *result = MakeAbsoluteFilePath(user_data_dir);
135 return true; 135 return true;
136 } 136 }
137 137
138 bool GetUserDataDirectory(std::wstring* user_data_dir, 138 bool GetAndCacheUserDataDirectory(const InstallConstants& mode,
139 std::wstring* invalid_user_data_dir) { 139 std::wstring* user_data_dir,
140 std::wstring* invalid_user_data_dir) {
140 if (!g_user_data_dir) { 141 if (!g_user_data_dir) {
141 g_user_data_dir = new std::wstring(); 142 g_user_data_dir = new std::wstring();
142 g_invalid_user_data_dir = new std::wstring(); 143 g_invalid_user_data_dir = new std::wstring();
143 if (!GetUserDataDirectoryUsingProcessCommandLine( 144 if (!GetUserDataDirectoryUsingProcessCommandLine(mode, g_user_data_dir,
144 InstallDetails::Get().mode(), g_user_data_dir, 145 g_invalid_user_data_dir)) {
145 g_invalid_user_data_dir)) {
146 return false; 146 return false;
147 } 147 }
148 assert(!g_user_data_dir->empty()); 148 assert(!g_user_data_dir->empty());
149 } 149 }
150 *user_data_dir = *g_user_data_dir; 150 *user_data_dir = *g_user_data_dir;
151 if (invalid_user_data_dir) 151 if (invalid_user_data_dir)
152 *invalid_user_data_dir = *g_invalid_user_data_dir; 152 *invalid_user_data_dir = *g_invalid_user_data_dir;
153 return true; 153 return true;
154 } 154 }
155 155
156 } // namespace install_static 156 } // namespace install_static
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698