OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/sync/sessions/unrecoverable_error_info.h" | |
6 namespace browser_sync { | |
7 namespace sessions { | |
8 | |
9 UnrecoverableErrorInfo::UnrecoverableErrorInfo() | |
10 : set_(false) { | |
11 } | |
12 | |
13 UnrecoverableErrorInfo::UnrecoverableErrorInfo( | |
14 const tracked_objects::Location& location, | |
15 const std::string& message) | |
16 : location_(location), | |
17 message_(message), | |
18 set_(true) { | |
19 } | |
20 | |
21 UnrecoverableErrorInfo::~UnrecoverableErrorInfo() { | |
22 } | |
23 | |
24 void UnrecoverableErrorInfo::Set( | |
25 const tracked_objects::Location& location, | |
26 const std::string& message) { | |
27 DCHECK(IsSet() == false); | |
akalin
2011/10/25 03:20:06
i think it's fine to allow resetting, i.e. this DC
lipalani1
2011/10/26 00:12:13
Done.
| |
28 location_ = location; | |
29 message_ = message; | |
30 set_ = true; | |
31 } | |
32 | |
33 bool UnrecoverableErrorInfo::IsSet() const { | |
34 return set_; | |
35 } | |
36 | |
37 const tracked_objects::Location& UnrecoverableErrorInfo::location() const { | |
38 DCHECK(set_); | |
39 return location_; | |
40 } | |
41 | |
42 const std::string& UnrecoverableErrorInfo::message() const { | |
akalin
2011/10/25 03:20:06
DCHECK(set_) here, too
lipalani1
2011/10/26 00:12:13
Done.
| |
43 return message_; | |
44 } | |
45 | |
46 } // namespace sessions | |
47 } // namespace browser_sync | |
OLD | NEW |