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

Unified Diff: mi_exe_stub/process.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « mi_exe_stub/process.h ('k') | mi_exe_stub/ptrdiff_t.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mi_exe_stub/process.cc
diff --git a/mi_exe_stub/process.cc b/mi_exe_stub/process.cc
deleted file mode 100644
index 46c852f376d2313a2fa5e1ad62336d8eceb1d94b..0000000000000000000000000000000000000000
--- a/mi_exe_stub/process.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2006-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#include "omaha/mi_exe_stub/process.h"
-
-namespace omaha {
-
-namespace {
-
-bool run_and_wait(const CString& command_line,
- DWORD* exit_code,
- bool wait,
- int cmd_show) {
- CString cmd_line(command_line);
- STARTUPINFO si = {};
- PROCESS_INFORMATION pi = {};
-
- GetStartupInfo(&si);
- si.dwFlags |= STARTF_FORCEOFFFEEDBACK | STARTF_USESHOWWINDOW;
- si.wShowWindow = static_cast<WORD>(cmd_show);
-
- BOOL create_process_result = CreateProcess(NULL,
- cmd_line.GetBuffer(),
- NULL,
- NULL,
- FALSE,
- CREATE_UNICODE_ENVIRONMENT,
- NULL,
- NULL,
- &si,
- &pi);
- if (!create_process_result) {
- *exit_code = GetLastError();
- return false;
- }
-
- if (wait) {
- WaitForSingleObject(pi.hProcess, INFINITE);
- }
-
- bool result = true;
- if (exit_code) {
- result = !!GetExitCodeProcess(pi.hProcess, exit_code);
- }
-
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
-
- return result;
-}
-
-} // namespace
-
-bool RunAndWaitHidden(const CString& command_line, DWORD *exit_code) {
- return run_and_wait(command_line, exit_code, true, SW_HIDE);
-}
-
-bool RunAndWait(const CString& command_line, DWORD *exit_code) {
- return run_and_wait(command_line, exit_code, true, SW_SHOWNORMAL);
-}
-
-bool Run(const CString& command_line) {
- return run_and_wait(command_line, NULL, false, SW_SHOWNORMAL);
-}
-
-} // namespace omaha
« no previous file with comments | « mi_exe_stub/process.h ('k') | mi_exe_stub/ptrdiff_t.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698