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

Unified Diff: chrome/browser/process_singleton_startup_lock.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: Forgotten review responses. Created 7 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: chrome/browser/process_singleton_startup_lock.h
diff --git a/chrome/browser/process_singleton_startup_lock.h b/chrome/browser/process_singleton_startup_lock.h
index 26c00bc9da6741bd6bb867878a9cba57a963e35f..6a962c22bdcacaece5354e7fea5186484cce82cb 100644
--- a/chrome/browser/process_singleton_startup_lock.h
+++ b/chrome/browser/process_singleton_startup_lock.h
@@ -15,6 +15,8 @@
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/process_singleton.h"
+class OperationOutput;
+
// Provides a ProcessSingleton::NotificationCallback that can queue up
// command-line invocations during startup and execute them when startup
// completes.
@@ -25,8 +27,13 @@
// Once unlocked, notifications are forwarded to a wrapped NotificationCallback.
class ProcessSingletonStartupLock : public base::NonThreadSafe {
public:
+ typedef base::Callback<bool(const CommandLine& command_line,
+ const base::FilePath& current_directory,
+ scoped_ptr<OperationOutput> operation_output)>
+ OperationCallback;
+
explicit ProcessSingletonStartupLock(
- const ProcessSingleton::NotificationCallback& original_callback);
+ const OperationCallback& operation_callback);
~ProcessSingletonStartupLock();
// Returns the ProcessSingleton::NotificationCallback.
@@ -41,15 +48,23 @@ class ProcessSingletonStartupLock : public base::NonThreadSafe {
bool locked() { return locked_; }
private:
- typedef std::pair<CommandLine::StringVector, base::FilePath>
- DelayedStartupMessage;
+ struct DelayedStartupMessage {
+ DelayedStartupMessage(const CommandLine::StringVector& argv,
+ const base::FilePath& current_directory,
+ OperationOutput* operation_output);
+ ~DelayedStartupMessage();
+
+ CommandLine::StringVector argv_;
+ base::FilePath current_directory_;
+ OperationOutput* operation_output_;
+ };
bool NotificationCallbackImpl(const CommandLine& command_line,
const base::FilePath& current_directory);
bool locked_;
std::vector<DelayedStartupMessage> saved_startup_messages_;
- ProcessSingleton::NotificationCallback original_callback_;
+ OperationCallback operation_callback_;
DISALLOW_COPY_AND_ASSIGN(ProcessSingletonStartupLock);
};

Powered by Google App Engine
This is Rietveld 408576698