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

Side by Side Diff: chrome/browser/shell_integration_linux.cc

Issue 7377012: Change base::LaunchProcess API slightly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/shell_integration.h" 5 #include "chrome/browser/shell_integration.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <glib.h> 8 #include <glib.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // not, to avoid locking everything up waiting for mv. 52 // not, to avoid locking everything up waiting for mv.
53 *exit_code = EXIT_FAILURE; 53 *exit_code = EXIT_FAILURE;
54 int devnull = open("/dev/null", O_RDONLY); 54 int devnull = open("/dev/null", O_RDONLY);
55 if (devnull < 0) 55 if (devnull < 0)
56 return false; 56 return false;
57 base::file_handle_mapping_vector no_stdin; 57 base::file_handle_mapping_vector no_stdin;
58 no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); 58 no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO));
59 59
60 base::ProcessHandle handle; 60 base::ProcessHandle handle;
61 base::LaunchOptions options; 61 base::LaunchOptions options;
62 options.process_handle = &handle;
63 options.fds_to_remap = &no_stdin; 62 options.fds_to_remap = &no_stdin;
64 if (!base::LaunchProcess(argv, options)) { 63 if (!base::LaunchProcess(argv, options, &handle)) {
65 close(devnull); 64 close(devnull);
66 return false; 65 return false;
67 } 66 }
68 close(devnull); 67 close(devnull);
69 68
70 return base::WaitForExitCode(handle, exit_code); 69 return base::WaitForExitCode(handle, exit_code);
71 } 70 }
72 71
73 std::string CreateShortcutIcon( 72 std::string CreateShortcutIcon(
74 const ShellIntegration::ShortcutInfo& shortcut_info, 73 const ShellIntegration::ShortcutInfo& shortcut_info,
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 shortcut_info.extension_id, 592 shortcut_info.extension_id,
594 shortcut_info.title, 593 shortcut_info.title,
595 icon_name); 594 icon_name);
596 595
597 if (shortcut_info.create_on_desktop) 596 if (shortcut_info.create_on_desktop)
598 CreateShortcutOnDesktop(shortcut_filename, contents); 597 CreateShortcutOnDesktop(shortcut_filename, contents);
599 598
600 if (shortcut_info.create_in_applications_menu) 599 if (shortcut_info.create_in_applications_menu)
601 CreateShortcutInApplicationsMenu(shortcut_filename, contents); 600 CreateShortcutInApplicationsMenu(shortcut_filename, contents);
602 } 601 }
OLDNEW
« no previous file with comments | « chrome/browser/service/service_process_control.cc ('k') | chrome/browser/ui/webui/options/advanced_options_utils_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698