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

Side by Side Diff: mojo/runner/child_process.cc

Issue 1139973002: Make mojo_shell_child not crash when done (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/runner/child_process.h" 5 #include "mojo/runner/child_process.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Copy and assign allowed. 60 // Copy and assign allowed.
61 }; 61 };
62 62
63 Blocker() : event_(true, false) {} 63 Blocker() : event_(true, false) {}
64 ~Blocker() {} 64 ~Blocker() {}
65 65
66 void Block() { 66 void Block() {
67 DCHECK(run_after_.is_null()); 67 DCHECK(run_after_.is_null());
68 event_.Wait(); 68 event_.Wait();
69 run_after_.Run(); 69 if (!run_after_.is_null())
70 run_after_.Run();
70 } 71 }
71 72
72 Unblocker GetUnblocker() { return Unblocker(this); } 73 Unblocker GetUnblocker() { return Unblocker(this); }
73 74
74 private: 75 private:
75 base::WaitableEvent event_; 76 base::WaitableEvent event_;
76 base::Closure run_after_; 77 base::Closure run_after_;
77 78
78 DISALLOW_COPY_AND_ASSIGN(Blocker); 79 DISALLOW_COPY_AND_ASSIGN(Blocker);
79 }; 80 };
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // This will block, then run whatever the controller wants. 299 // This will block, then run whatever the controller wants.
299 blocker.Block(); 300 blocker.Block();
300 301
301 app_context.Shutdown(); 302 app_context.Shutdown();
302 303
303 return 0; 304 return 0;
304 } 305 }
305 306
306 } // namespace runner 307 } // namespace runner
307 } // namespace mojo 308 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698