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

Side by Side Diff: ipc/ipc_test_sink.cc

Issue 1322253003: ipc: Convert int types from basictypes.h to the ones from stdint.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 3 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 | « ipc/ipc_test_sink.h ('k') | ipc/message_filter.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) 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 "ipc/ipc_test_sink.h" 5 #include "ipc/ipc_test_sink.h"
6 6
7 #include "ipc/ipc_listener.h" 7 #include "ipc/ipc_listener.h"
8 #include "ipc/ipc_message.h" 8 #include "ipc/ipc_message.h"
9 9
10 namespace IPC { 10 namespace IPC {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void TestSink::ClearMessages() { 56 void TestSink::ClearMessages() {
57 messages_.clear(); 57 messages_.clear();
58 } 58 }
59 59
60 const Message* TestSink::GetMessageAt(size_t index) const { 60 const Message* TestSink::GetMessageAt(size_t index) const {
61 if (index >= messages_.size()) 61 if (index >= messages_.size())
62 return NULL; 62 return NULL;
63 return &messages_[index]; 63 return &messages_[index];
64 } 64 }
65 65
66 const Message* TestSink::GetFirstMessageMatching(uint32 id) const { 66 const Message* TestSink::GetFirstMessageMatching(uint32_t id) const {
67 for (size_t i = 0; i < messages_.size(); i++) { 67 for (size_t i = 0; i < messages_.size(); i++) {
68 if (messages_[i].type() == id) 68 if (messages_[i].type() == id)
69 return &messages_[i]; 69 return &messages_[i];
70 } 70 }
71 return NULL; 71 return NULL;
72 } 72 }
73 73
74 const Message* TestSink::GetUniqueMessageMatching(uint32 id) const { 74 const Message* TestSink::GetUniqueMessageMatching(uint32_t id) const {
75 size_t found_index = 0; 75 size_t found_index = 0;
76 size_t found_count = 0; 76 size_t found_count = 0;
77 for (size_t i = 0; i < messages_.size(); i++) { 77 for (size_t i = 0; i < messages_.size(); i++) {
78 if (messages_[i].type() == id) { 78 if (messages_[i].type() == id) {
79 found_count++; 79 found_count++;
80 found_index = i; 80 found_index = i;
81 } 81 }
82 } 82 }
83 if (found_count != 1) 83 if (found_count != 1)
84 return NULL; // Didn't find a unique one. 84 return NULL; // Didn't find a unique one.
(...skipping 16 matching lines...) Expand all
101 } 101 }
102 102
103 base::ScopedFD TestSink::TakeClientFileDescriptor() { 103 base::ScopedFD TestSink::TakeClientFileDescriptor() {
104 NOTREACHED(); 104 NOTREACHED();
105 return base::ScopedFD(); 105 return base::ScopedFD();
106 } 106 }
107 107
108 #endif // defined(OS_POSIX) && !defined(OS_NACL) 108 #endif // defined(OS_POSIX) && !defined(OS_NACL)
109 109
110 } // namespace IPC 110 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_test_sink.h ('k') | ipc/message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698