diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 18:35:33 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 18:35:33 +0000 |
commit | ad640d646b4a2aa5f5426d75b89f6ca13044d3a5 (patch) | |
tree | 555436822e1bd48b85d16a0325d17184396846d3 /base/file_util_win.cc | |
parent | 27e05c13c72fa4f026dff1e515ee74136b076990 (diff) | |
download | chromium_src-ad640d646b4a2aa5f5426d75b89f6ca13044d3a5.zip chromium_src-ad640d646b4a2aa5f5426d75b89f6ca13044d3a5.tar.gz chromium_src-ad640d646b4a2aa5f5426d75b89f6ca13044d3a5.tar.bz2 |
Add histograms to see if we can find out why we're failing
to load resources.pak on Windows.
BUG=58056
Review URL: http://codereview.chromium.org/3616007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r-- | base/file_util_win.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index a376d0d..876b89d 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -13,6 +13,7 @@ #include <string> #include "base/file_path.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/pe_image.h" #include "base/scoped_comptr_win.h" @@ -897,11 +898,24 @@ bool MemoryMappedFile::MapFileToMemoryInternal() { // therefore the cast here is safe. file_mapping_ = ::CreateFileMapping(file_, NULL, PAGE_READONLY, 0, static_cast<DWORD>(length_), NULL); - if (file_mapping_ == INVALID_HANDLE_VALUE) + if (file_mapping_ == INVALID_HANDLE_VALUE) { + // According to msdn, system error codes are only reserved up to 15999. + // http://msdn.microsoft.com/en-us/library/ms681381(v=VS.85).aspx. + UMA_HISTOGRAM_ENUMERATION("MemoryMappedFile.CreateFileMapping", + std::min(logging::GetLastSystemErrorCode(), + static_cast<logging::SystemErrorCode>(15999)), + 16000); return false; + } data_ = static_cast<uint8*>( ::MapViewOfFile(file_mapping_, FILE_MAP_READ, 0, 0, length_)); + if (!data_) { + UMA_HISTOGRAM_ENUMERATION("MemoryMappedFile.MapViewOfFile", + std::min(logging::GetLastSystemErrorCode(), + static_cast<logging::SystemErrorCode>(15999)), + 16000); + } return data_ != NULL; } |