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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 12681030: Proudly fixing funny indents since 1969 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Chasing HEAD Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 #include "ipc/ipc_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/nullable_string16.h" 10 #include "base/nullable_string16.h"
(...skipping 25 matching lines...) Expand all
36 // On POSIX, we log to stdout, which we assume can display ASCII. 36 // On POSIX, we log to stdout, which we assume can display ASCII.
37 static const size_t kMaxBytesToLog = 100; 37 static const size_t kMaxBytesToLog = 100;
38 for (size_t i = 0; i < std::min(data.size(), kMaxBytesToLog); ++i) { 38 for (size_t i = 0; i < std::min(data.size(), kMaxBytesToLog); ++i) {
39 if (isprint(data[i])) 39 if (isprint(data[i]))
40 out->push_back(data[i]); 40 out->push_back(data[i]);
41 else 41 else
42 out->append( 42 out->append(
43 base::StringPrintf("[%02X]", static_cast<unsigned char>(data[i]))); 43 base::StringPrintf("[%02X]", static_cast<unsigned char>(data[i])));
44 } 44 }
45 if (data.size() > kMaxBytesToLog) { 45 if (data.size() > kMaxBytesToLog) {
46 out->append( 46 out->append(base::StringPrintf(
47 base::StringPrintf(" and %u more bytes", 47 " and %u more bytes",
48 static_cast<unsigned>(data.size() - kMaxBytesToLog))); 48 static_cast<unsigned>(data.size() - kMaxBytesToLog)));
49 } 49 }
50 #endif 50 #endif
51 } 51 }
52 52
53 bool ReadValue(const Message* m, PickleIterator* iter, Value** value, 53 bool ReadValue(const Message* m, PickleIterator* iter, Value** value,
54 int recursion); 54 int recursion);
55 55
56 void WriteValue(Message* m, const Value* value, int recursion) { 56 void WriteValue(Message* m, const Value* value, int recursion) {
57 bool result; 57 bool result;
58 if (recursion > kMaxRecursionDepth) { 58 if (recursion > kMaxRecursionDepth) {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 return result; 818 return result;
819 } 819 }
820 820
821 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 821 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
822 l->append("<MSG>"); 822 l->append("<MSG>");
823 } 823 }
824 824
825 #endif // OS_WIN 825 #endif // OS_WIN
826 826
827 } // namespace IPC 827 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698