OLD | NEW |
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 "base/linux_util.h" | 5 #include "base/linux_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <glib.h> | 10 #include <glib.h> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (STATE_DID_NOT_CHECK == state_) { | 55 if (STATE_DID_NOT_CHECK == state_) { |
56 state_ = STATE_CHECK_STARTED; | 56 state_ = STATE_CHECK_STARTED; |
57 return STATE_DID_NOT_CHECK; | 57 return STATE_DID_NOT_CHECK; |
58 } | 58 } |
59 return state_; | 59 return state_; |
60 } | 60 } |
61 | 61 |
62 // Indicate the check finished, move to STATE_CHECK_FINISHED. | 62 // Indicate the check finished, move to STATE_CHECK_FINISHED. |
63 void CheckFinished() { | 63 void CheckFinished() { |
64 base::AutoLock scoped_lock(lock_); | 64 base::AutoLock scoped_lock(lock_); |
65 DCHECK(state_ == STATE_CHECK_STARTED); | 65 DCHECK_EQ(STATE_CHECK_STARTED, state_); |
66 state_ = STATE_CHECK_FINISHED; | 66 state_ = STATE_CHECK_FINISHED; |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 base::Lock lock_; | 70 base::Lock lock_; |
71 LinuxDistroState state_; | 71 LinuxDistroState state_; |
72 }; | 72 }; |
73 #endif // if defined(OS_LINUX) | 73 #endif // if defined(OS_LINUX) |
74 | 74 |
75 // expected prefix of the target of the /proc/self/fd/%d link for a socket | 75 // expected prefix of the target of the /proc/self/fd/%d link for a socket |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), | 289 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), |
290 expected_data.length())) { | 290 expected_data.length())) { |
291 return current_tid; | 291 return current_tid; |
292 } | 292 } |
293 } | 293 } |
294 return -1; | 294 return -1; |
295 } | 295 } |
296 | 296 |
297 } // namespace base | 297 } // namespace base |
OLD | NEW |