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

Side by Side Diff: runtime/bin/error_exit.cc

Issue 2681193002: Factor out snapshot helpers from main.cc. (Closed)
Patch Set: . Created 3 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "bin/error_exit.h"
6
7 #include "bin/log.h"
8 #include "bin/platform.h"
9 #include "bin/process.h"
10 #include "bin/eventhandler.h"
zra 2017/02/10 15:42:34 alphabetize.
rmacnak 2017/02/13 19:17:03 Done.
11 #include "include/dart_api.h"
12 #include "platform/assert.h"
13 #include "platform/globals.h"
14
15 namespace dart {
16 namespace bin {
17
18 void ErrorExit(int exit_code, const char* format, ...) {
19 va_list arguments;
20 va_start(arguments, format);
21 Log::VPrintErr(format, arguments);
22 va_end(arguments);
23
24 Dart_ExitScope();
25 Dart_ShutdownIsolate();
26
27 // Terminate process exit-code handler.
28 Process::TerminateExitCodeHandler();
29
30 char* error = Dart_Cleanup();
31 if (error != NULL) {
32 Log::PrintErr("VM cleanup failed: %s\n", error);
33 free(error);
34 }
35
36 EventHandler::Stop();
37 Platform::Exit(exit_code);
38 }
39
40 } // namespace bin
41 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698