Index: base/debug/activity_analyzer.cc |
diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc |
index 54e566b31a98169bc42b0392f49a90d2411e1f1a..0bbcfe2298ecfc9831d6ce85d1b6e000d0533ab2 100644 |
--- a/base/debug/activity_analyzer.cc |
+++ b/base/debug/activity_analyzer.cc |
@@ -4,6 +4,8 @@ |
#include "base/debug/activity_analyzer.h" |
+#include <utility> |
bcwhite
2016/08/04 13:38:11
Why this?
manzagop (departed)
2016/08/10 15:59:51
It's where std::move is defined.
|
+ |
#include "base/files/file.h" |
#include "base/files/file_path.h" |
#include "base/files/memory_mapped_file.h" |
@@ -42,7 +44,9 @@ GlobalActivityAnalyzer::~GlobalActivityAnalyzer() {} |
std::unique_ptr<GlobalActivityAnalyzer> GlobalActivityAnalyzer::CreateWithFile( |
const FilePath& file_path) { |
std::unique_ptr<MemoryMappedFile> mmfile(new MemoryMappedFile()); |
- mmfile->Initialize(file_path); |
+ // Note: write access is required for snapshotting, which writes a sentinel to |
+ // ensure the snapshot's consistency. |
+ mmfile->Initialize(file_path, MemoryMappedFile::READ_WRITE); |
if (!mmfile->IsValid()) |
return nullptr; |