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

Side by Side Diff: runtime/bin/utils.h

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made Dart OSError constructor const Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, 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 #ifndef BIN_UTILS_H_
6 #define BIN_UTILS_H_
7
8 class OSError {
9 public:
10 OSError() : code_(0), message_(NULL) {}
11 virtual ~OSError() { free(message_); }
12
13 int code() { return code_; }
14 void set_code(int code) { code_ = code; }
15 char* message() { return message_; }
16 void SetMessage(char* message) { message_ = strdup(message); }
Mads Ager (google) 2012/03/09 09:40:13 Let's add an ASSERT(message_ == NULL) here to guar
Søren Gjesse 2012/03/13 08:25:55 Added freeing of message_ instead.
17
18 private:
19 int code_;
20 char* message_;
21
22 DISALLOW_COPY_AND_ASSIGN(OSError);
23 };
24
25
26 #endif // BIN_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698