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

Side by Side Diff: tools/android/forwarder2/common.h

Issue 1549203002: Switch to standard integer types in tools/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « tools/android/forwarder2/command.h ('k') | tools/android/forwarder2/daemon.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Common helper functions/classes used both in the host and device forwarder. 5 // Common helper functions/classes used both in the host and device forwarder.
6 6
7 #ifndef TOOLS_ANDROID_FORWARDER2_COMMON_H_ 7 #ifndef TOOLS_ANDROID_FORWARDER2_COMMON_H_
8 #define TOOLS_ANDROID_FORWARDER2_COMMON_H_ 8 #define TOOLS_ANDROID_FORWARDER2_COMMON_H_
9 9
10 #include <errno.h>
10 #include <stdarg.h> 11 #include <stdarg.h>
11 #include <stdio.h> 12 #include <stdio.h>
12 #include <errno.h>
13 13
14 #include "base/basictypes.h"
15 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/macros.h"
17 #include "base/posix/eintr_wrapper.h" 17 #include "base/posix/eintr_wrapper.h"
18 18
19 // Preserving errno for Close() is important because the function is very often 19 // Preserving errno for Close() is important because the function is very often
20 // used in cleanup code, after an error occurred, and it is very easy to pass an 20 // used in cleanup code, after an error occurred, and it is very easy to pass an
21 // invalid file descriptor to close() in this context, or more rarely, a 21 // invalid file descriptor to close() in this context, or more rarely, a
22 // spurious signal might make close() return -1 + setting errno to EINTR, 22 // spurious signal might make close() return -1 + setting errno to EINTR,
23 // masking the real reason for the original error. This leads to very unpleasant 23 // masking the real reason for the original error. This leads to very unpleasant
24 // debugging sessions. 24 // debugging sessions.
25 #define PRESERVE_ERRNO_HANDLE_EINTR(Func) \ 25 #define PRESERVE_ERRNO_HANDLE_EINTR(Func) \
26 do { \ 26 do { \
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 char* write_ptr_; 80 char* write_ptr_;
81 char buffer_[BufferSize]; 81 char buffer_[BufferSize];
82 82
83 static_assert(BufferSize >= 1, "size of buffer must be at least one"); 83 static_assert(BufferSize >= 1, "size of buffer must be at least one");
84 DISALLOW_COPY_AND_ASSIGN(FixedSizeStringBuilder); 84 DISALLOW_COPY_AND_ASSIGN(FixedSizeStringBuilder);
85 }; 85 };
86 86
87 } // namespace forwarder2 87 } // namespace forwarder2
88 88
89 #endif // TOOLS_ANDROID_FORWARDER2_COMMON_H_ 89 #endif // TOOLS_ANDROID_FORWARDER2_COMMON_H_
OLDNEW
« no previous file with comments | « tools/android/forwarder2/command.h ('k') | tools/android/forwarder2/daemon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698