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

Unified Diff: third_party/crashpad/crashpad/util/misc/paths_mac.cc

Issue 2804713002: Update Crashpad to b4095401639ebe2ad33169e5c1d994065cbff1b8 (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/crashpad/crashpad/util/misc/paths_mac.cc
diff --git a/third_party/crashpad/crashpad/test/paths_mac.cc b/third_party/crashpad/crashpad/util/misc/paths_mac.cc
similarity index 76%
rename from third_party/crashpad/crashpad/test/paths_mac.cc
rename to third_party/crashpad/crashpad/util/misc/paths_mac.cc
index d16049e82bdad3ac58b07165227df28e77317b50..036f84b5aa81b41afc57a024fde9e3a6227b02d5 100644
--- a/third_party/crashpad/crashpad/test/paths_mac.cc
+++ b/third_party/crashpad/crashpad/util/misc/paths_mac.cc
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "test/paths.h"
+#include "util/misc/paths.h"
#include <mach-o/dyld.h>
#include <stdint.h>
@@ -20,20 +20,25 @@
#include "base/logging.h"
namespace crashpad {
-namespace test {
// static
-base::FilePath Paths::Executable() {
+bool Paths::Executable(base::FilePath* path) {
uint32_t executable_length = 0;
_NSGetExecutablePath(nullptr, &executable_length);
- CHECK_GT(executable_length, 1u);
+ if (executable_length <= 1) {
+ LOG(ERROR) << "_NSGetExecutablePath";
+ return false;
+ }
std::string executable_path(executable_length - 1, std::string::value_type());
int rv = _NSGetExecutablePath(&executable_path[0], &executable_length);
- CHECK_EQ(rv, 0);
+ if (rv != 0) {
+ LOG(ERROR) << "_NSGetExecutablePath";
+ return false;
+ }
- return base::FilePath(executable_path);
+ *path = base::FilePath(executable_path);
+ return true;
}
-} // namespace test
} // namespace crashpad
« no previous file with comments | « third_party/crashpad/crashpad/util/misc/paths_linux.cc ('k') | third_party/crashpad/crashpad/util/misc/paths_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698