Bug 1119072, Part 15: Replace uses of hash_map with unordered_map (toolkit), r=ted
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h
+++ b/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h
@@ -30,27 +30,27 @@
// PDBSourceLineWriter uses a pdb file produced by Visual C++ to output
// a line/address map for use with BasicSourceLineResolver.
#ifndef _PDB_SOURCE_LINE_WRITER_H__
#define _PDB_SOURCE_LINE_WRITER_H__
#include <atlcomcli.h>
-#include <hash_map>
+#include <unordered_map>
#include <string>
struct IDiaEnumLineNumbers;
struct IDiaSession;
struct IDiaSymbol;
namespace google_breakpad {
using std::wstring;
-using stdext::hash_map;
+using std::unordered_map;
// A structure that carries information that identifies a pdb file.
struct PDBModuleInfo {
public:
// The basename of the pdb file from which information was loaded.
wstring debug_file;
// The pdb's identifier. For recent pdb files, the identifier consists
@@ -171,29 +171,29 @@ class PDBSourceLineWriter {
// Cache this filename and ID for later reuse.
void CacheFileID(const wstring &file, DWORD id) {
unique_files_[file] = id;
};
// Store this ID in the cache as a duplicate for this filename.
void StoreDuplicateFileID(const wstring &file, DWORD id) {
- hash_map<wstring, DWORD>::iterator iter = unique_files_.find(file);
+ unordered_map<wstring, DWORD>::iterator iter = unique_files_.find(file);
if (iter != unique_files_.end()) {
// map this id to the previously seen one
file_ids_[id] = iter->second;
}
};
// Given a file's unique ID, return the ID that should be used to
// reference it. There may be multiple files with identical filenames
// but different unique IDs. The cache attempts to coalesce these into
// one ID per unique filename.
DWORD GetRealFileID(DWORD id) {
- hash_map<DWORD, DWORD>::iterator iter = file_ids_.find(id);
+ unordered_map<DWORD, DWORD>::iterator iter = file_ids_.find(id);
if (iter == file_ids_.end())
return id;
return iter->second;
};
// Find the PE file corresponding to the loaded PDB file, and
// set the code_file_ member. Returns false on failure.
bool FindPEFile();
@@ -219,19 +219,19 @@ class PDBSourceLineWriter {
CComPtr<IDiaSession> session_;
// The current output file for this WriteMap invocation.
FILE *output_;
// There may be many duplicate filenames with different IDs.
// This maps from the DIA "unique ID" to a single ID per unique
// filename.
- hash_map<DWORD, DWORD> file_ids_;
+ unordered_map<DWORD, DWORD> file_ids_;
// This maps unique filenames to file IDs.
- hash_map<wstring, DWORD> unique_files_;
+ unordered_map<wstring, DWORD> unique_files_;
// Disallow copy ctor and operator=
PDBSourceLineWriter(const PDBSourceLineWriter&);
void operator=(const PDBSourceLineWriter&);
};
} // namespace google_breakpad