OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // See apps/app_host/operation_launcher.h for information on how operation |
| 6 // output channels are established on Windows. |
| 7 |
| 8 #ifndef CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_ |
| 9 #define CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_ |
| 10 |
| 11 #include "chrome/browser/operation_output.h" |
| 12 |
| 13 #include <windows.h> |
| 14 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" |
| 16 #include "base/win/scoped_handle.h" |
| 17 |
| 18 // Implements an OperationOutput channel on Windows, using one writable HANDLE |
| 19 // each for the output and the exit code. |
| 20 class OperationOutputWin : public OperationOutput { |
| 21 public: |
| 22 // Instantiates an OperationOutputWin. |output_pipe| and |exit_code_pipe| must |
| 23 // be valid in the current process. |
| 24 OperationOutputWin(base::win::ScopedHandle output_pipe, |
| 25 base::win::ScopedHandle exit_code_pipe); |
| 26 |
| 27 // OperationOutput implementation. |
| 28 virtual bool Write(const char* data, unsigned int length) OVERRIDE; |
| 29 |
| 30 private: |
| 31 // OperationOutput implementation. |
| 32 virtual bool SetExitCode(unsigned int exit_code) OVERRIDE; |
| 33 |
| 34 base::win::ScopedHandle output_pipe_; |
| 35 base::win::ScopedHandle exit_code_pipe_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(OperationOutputWin); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_OPERATION_OUTPUT_WIN_H_ |
OLD | NEW |