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

Unified Diff: chrome/browser/operation_output_win.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/operation_output_win.h
diff --git a/chrome/browser/operation_output_win.h b/chrome/browser/operation_output_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe8b51dc5cae137852048374dff6d3b31bb0a6f4
--- /dev/null
+++ b/chrome/browser/operation_output_win.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// See apps/app_host/operation_launcher.h for information on how operation
+// output channels are established on Windows.
+
+#ifndef CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_
+#define CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_
+
+#include "chrome/browser/operation_output.h"
+
+#include <windows.h>
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/win/scoped_handle.h"
+
+// Implements an OperationOutput channel on Windows, using one writable HANDLE
+// each for the output and the exit code.
+class OperationOutputWin : public OperationOutput {
+ public:
+ // Instantiates an OperationOutputWin. |output_pipe| and |exit_code_pipe| must
+ // be valid in the current process.
+ OperationOutputWin(base::win::ScopedHandle output_pipe,
+ base::win::ScopedHandle exit_code_pipe);
+
+ // OperationOutput implementation.
+ virtual bool Write(const char* data, unsigned int length) OVERRIDE;
+
+ private:
+ // OperationOutput implementation.
+ virtual bool SetExitCode(unsigned int exit_code) OVERRIDE;
+
+ base::win::ScopedHandle output_pipe_;
+ base::win::ScopedHandle exit_code_pipe_;
+
+ DISALLOW_COPY_AND_ASSIGN(OperationOutputWin);
+};
+
+#endif // CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698