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

Side by Side Diff: content/common/process_watcher_win.cc

Issue 8382021: Move resource_codes to content/public/common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/handle_enumerator_win.cc ('k') | content/common/result_codes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/process_watcher.h" 5 #include "content/common/process_watcher.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h"
9 #include "base/win/object_watcher.h" 10 #include "base/win/object_watcher.h"
10 #include "content/common/result_codes.h" 11 #include "content/public/common/result_codes.h"
11 12
12 // Maximum amount of time (in milliseconds) to wait for the process to exit. 13 // Maximum amount of time (in milliseconds) to wait for the process to exit.
13 static const int kWaitInterval = 2000; 14 static const int kWaitInterval = 2000;
14 15
15 namespace { 16 namespace {
16 17
17 class TimerExpiredTask : public Task, 18 class TimerExpiredTask : public Task,
18 public base::win::ObjectWatcher::Delegate { 19 public base::win::ObjectWatcher::Delegate {
19 public: 20 public:
20 explicit TimerExpiredTask(base::ProcessHandle process) : process_(process) { 21 explicit TimerExpiredTask(base::ProcessHandle process) : process_(process) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // If already signaled, then we are done! 76 // If already signaled, then we are done!
76 if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) { 77 if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) {
77 CloseHandle(process); 78 CloseHandle(process);
78 return; 79 return;
79 } 80 }
80 81
81 MessageLoop::current()->PostDelayedTask(FROM_HERE, 82 MessageLoop::current()->PostDelayedTask(FROM_HERE,
82 new TimerExpiredTask(process), 83 new TimerExpiredTask(process),
83 kWaitInterval); 84 kWaitInterval);
84 } 85 }
OLDNEW
« no previous file with comments | « content/common/handle_enumerator_win.cc ('k') | content/common/result_codes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698