MCPcopy Create free account
hub / github.com/chromium/crashpad / Executable

Method Executable

util/misc/paths_mac.cc:25–42  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

23
24// static
25bool Paths::Executable(base::FilePath* path) {
26 uint32_t executable_length = 0;
27 _NSGetExecutablePath(nullptr, &executable_length);
28 if (executable_length <= 1) {
29 LOG(ERROR) << "_NSGetExecutablePath";
30 return false;
31 }
32
33 std::string executable_path(executable_length - 1, std::string::value_type());
34 int rv = _NSGetExecutablePath(&executable_path[0], &executable_length);
35 if (rv != 0) {
36 LOG(ERROR) << "_NSGetExecutablePath";
37 return false;
38 }
39
40 *path = base::FilePath(executable_path);
41 return true;
42}
43
44} // namespace crashpad

Callers

nothing calls this directly

Calls 1

FilePathClass · 0.85

Tested by

no test coverage detected