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

Unified Diff: chrome/app/chrome_exe_main_mac.cc

Issue 2907663002: Rename chrome_exe_main_mac.c to chrome_exe_main_mac.cc (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/chrome_exe_main_mac.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_exe_main_mac.cc
diff --git a/chrome/app/chrome_exe_main_mac.c b/chrome/app/chrome_exe_main_mac.cc
similarity index 91%
rename from chrome/app/chrome_exe_main_mac.c
rename to chrome/app/chrome_exe_main_mac.cc
index 135e547414cf7762f4e7925f931efe4b9c2b1c23..b8595246a42d77a3c21b64e84906a95dad22f1e3 100644
--- a/chrome/app/chrome_exe_main_mac.c
+++ b/chrome/app/chrome_exe_main_mac.cc
@@ -38,7 +38,7 @@ __attribute__((visibility("default"))) int main(int argc, char* argv[]) {
abort();
}
- char* exec_path = malloc(exec_path_size);
+ char* exec_path = new char[exec_path_size];
if (!exec_path) {
fprintf(stderr, "malloc %u: %s\n", exec_path_size, strerror(errno));
abort();
@@ -57,13 +57,13 @@ __attribute__((visibility("default"))) int main(int argc, char* argv[]) {
fprintf(stderr, "dirname %s: %s\n", exec_path, strerror(errno));
abort();
}
- free(exec_path);
+ delete[] exec_path;
const size_t parent_path_len = strlen(parent_dir);
const size_t rel_path_len = strlen(rel_path);
// 2 accounts for a trailing NUL byte and the '/' in the middle of the paths.
const size_t framework_path_size = parent_path_len + rel_path_len + 2;
- char* framework_path = malloc(framework_path_size);
+ char* framework_path = new char[framework_path_size];
if (!framework_path) {
fprintf(stderr, "malloc %zu: %s\n", framework_path_size, strerror(errno));
abort();
@@ -75,9 +75,10 @@ __attribute__((visibility("default"))) int main(int argc, char* argv[]) {
fprintf(stderr, "dlopen %s: %s\n", framework_path, dlerror());
abort();
}
- free(framework_path);
+ delete[] framework_path;
- const ChromeMainPtr chrome_main = dlsym(library, "ChromeMain");
+ const ChromeMainPtr chrome_main =
+ reinterpret_cast<ChromeMainPtr>(dlsym(library, "ChromeMain"));
if (!chrome_main) {
fprintf(stderr, "dlsym ChromeMain: %s\n", dlerror());
abort();
« no previous file with comments | « chrome/app/chrome_exe_main_mac.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698