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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.h

Issue 12674028: Report text output and exit code for command-line operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Line endings. Created 7 years, 9 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: chrome/browser/ui/startup/startup_browser_creator.h
diff --git a/chrome/browser/ui/startup/startup_browser_creator.h b/chrome/browser/ui/startup/startup_browser_creator.h
index 33091a5dfd23657c737c61c229db588beddd8a0e..c092167c3e7c197f8b323a279a20a1a7a4669194 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.h
+++ b/chrome/browser/ui/startup/startup_browser_creator.h
@@ -21,6 +21,7 @@ class Browser;
class CommandLine;
class GURL;
class PrefService;
+class OperationOutput;
// class containing helpers for BrowserMain to spin up a new instance and
// initialize the profile.
@@ -37,14 +38,15 @@ class StartupBrowserCreator {
// This function is equivalent to ProcessCommandLine but should only be
// called during actual process startup.
robertshield 2013/03/28 14:31:48 Nit: ProcessCommandLine -> ProcessCommandLineImpl
+ // Returns true if the current process should continue running.
+ // |operation_output| will be notified of the outcome of the operation
+ // requested via cmd_line. If the process is to exit immediately, this will
+ // happen before Start() returns. Otherwise it may happen asynchronously.
bool Start(const CommandLine& cmd_line,
const base::FilePath& cur_dir,
Profile* last_used_profile,
const Profiles& last_opened_profiles,
- int* return_code) {
- return ProcessCmdLineImpl(cmd_line, cur_dir, true, last_used_profile,
- last_opened_profiles, return_code, this);
- }
+ scoped_ptr<OperationOutput> operation_output);
// This function performs command-line handling and is invoked only after
// start up (for example when we get a start request for another process).
@@ -56,7 +58,8 @@ class StartupBrowserCreator {
static void ProcessCommandLineAlreadyRunning(
const CommandLine& command_line,
const base::FilePath& cur_dir,
- const base::FilePath& startup_profile_dir);
+ const base::FilePath& startup_profile_dir,
+ scoped_ptr<OperationOutput> operation_output);
template <class AutomationProviderClass>
static bool CreateAutomationProvider(const std::string& channel_id,
@@ -130,13 +133,14 @@ class StartupBrowserCreator {
bool process_startup,
Profile* last_used_profile,
const Profiles& last_opened_profiles,
- int* return_code,
- StartupBrowserCreator* browser_creator);
+ StartupBrowserCreator* browser_creator,
+ scoped_ptr<OperationOutput> operation_output);
// Callback after a profile has been created.
static void ProcessCommandLineOnProfileCreated(
const CommandLine& command_line,
const base::FilePath& cur_dir,
+ scoped_ptr<OperationOutput> operation_output,
Profile* profile,
Profile::CreateStatus status);

Powered by Google App Engine
This is Rietveld 408576698