diff options
author | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 17:36:31 +0000 |
---|---|---|
committer | tzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 17:36:31 +0000 |
commit | aa968c9dec37b6406c2ff86208c61cc6b4cd4eb6 (patch) | |
tree | 32257a7d79ea1c2f25a323554cee5fd569cb81c2 /webkit/fileapi | |
parent | 76725780d66d25c47726974b7583f2dc521167e4 (diff) | |
download | chromium_src-aa968c9dec37b6406c2ff86208c61cc6b4cd4eb6.zip chromium_src-aa968c9dec37b6406c2ff86208c61cc6b4cd4eb6.tar.gz chromium_src-aa968c9dec37b6406c2ff86208c61cc6b4cd4eb6.tar.bz2 |
Adding UMA stats for requestFileSystem error analysis.
BUG=
TEST=
Review URL: http://codereview.chromium.org/8918005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/sandbox_mount_point_provider.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc index 25b4f23..661d760 100644 --- a/webkit/fileapi/sandbox_mount_point_provider.cc +++ b/webkit/fileapi/sandbox_mount_point_provider.cc @@ -14,6 +14,7 @@ #include "base/rand_util.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/metrics/histogram.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" #include "webkit/fileapi/file_system_operation_context.h" @@ -36,6 +37,15 @@ static const int kOldFileSystemUniqueLength = 16; static const unsigned kOldFileSystemUniqueDirectoryNameLength = kOldFileSystemUniqueLength + arraysize(kOldFileSystemUniqueNamePrefix) - 1; +const char kOpenFileSystem[] = "FileSystem.OpenFileSystem"; +enum FileSystemError { + kOK = 0, + kIncognito, + kInvalidScheme, + kCreateDirectoryError, + kFileSystemErrorMax, +}; + // Restricted names. // http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#naming-restrictions static const char* const kRestrictedNames[] = { @@ -343,6 +353,11 @@ class SandboxMountPointProvider::GetFileSystemRootPathTask } void DispatchCallbackOnCallerThread(const FilePath& root_path) { + if (root_path.empty()) { + UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, + kCreateDirectoryError, + kFileSystemErrorMax); + } origin_message_loop_proxy_->PostTask( FROM_HERE, base::Bind(&GetFileSystemRootPathTask::DispatchCallback, this, @@ -355,6 +370,10 @@ class SandboxMountPointProvider::GetFileSystemRootPathTask FileSystemPathManager::GetFileSystemTypeString(type_); DCHECK(!type_string.empty()); std::string name = origin_identifier + ":" + type_string; + + if (!root_path.empty()) + UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, kOK, kFileSystemErrorMax); + callback_.Run(!root_path.empty(), root_path, name); callback_.Reset(); } @@ -425,11 +444,17 @@ void SandboxMountPointProvider::ValidateFileSystemRootAndGetURL( if (path_manager_->is_incognito()) { // TODO(kinuko): return an isolated temporary directory. callback.Run(false, FilePath(), std::string()); + UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, + kIncognito, + kFileSystemErrorMax); return; } if (!path_manager_->IsAllowedScheme(origin_url)) { callback.Run(false, FilePath(), std::string()); + UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, + kInvalidScheme, + kFileSystemErrorMax); return; } |