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

Side by Side Diff: tools/ipc_fuzzer/message_lib/message_names.h

Issue 2241413003: Roll clang 277962:278861 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix Created 4 years, 4 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/ipc_fuzzer/message_lib/message_file_reader.cc ('k') | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_ 5 #ifndef TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_
6 #define TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_ 6 #define TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <unordered_map> 11 #include <unordered_map>
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 14
15 namespace ipc_fuzzer { 15 namespace ipc_fuzzer {
16 16
17 class MessageNames { 17 class MessageNames {
18 public: 18 public:
19 MessageNames(); 19 MessageNames();
20 ~MessageNames(); 20 ~MessageNames();
21 static MessageNames* GetInstance(); 21 static MessageNames* GetInstance();
22 22
23 void Add(uint32_t type, const std::string& name) { 23 void Add(uint32_t type, const char* name) {
24 name_map_[type] = name; 24 name_map_[type] = name;
25 type_map_[name] = type; 25 type_map_[name] = type;
26 } 26 }
27 27
28 bool TypeExists(uint32_t type) { 28 bool TypeExists(uint32_t type) {
29 return name_map_.find(type) != name_map_.end(); 29 return name_map_.find(type) != name_map_.end();
30 } 30 }
31 31
32 bool NameExists(const std::string& name) { 32 bool NameExists(const std::string& name) {
33 return type_map_.find(name) != type_map_.end(); 33 return type_map_.find(name) != type_map_.end();
(...skipping 18 matching lines...) Expand all
52 NameToTypeMap type_map_; 52 NameToTypeMap type_map_;
53 53
54 static MessageNames* all_names_; 54 static MessageNames* all_names_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(MessageNames); 56 DISALLOW_COPY_AND_ASSIGN(MessageNames);
57 }; 57 };
58 58
59 } // namespace ipc_fuzzer 59 } // namespace ipc_fuzzer
60 60
61 #endif // TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_ 61 #endif // TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_NAMES_H_
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_file_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698