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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 8918005: Adding UMA stats for requestFileSystem error analysis. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/sandbox_mount_point_provider.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index 25b4f233cb1ffc61bdbbfc1675ce6e2c22b86805..661d760ffab35a2fcd12623a95da155b664d3c0d 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);
kinuko 2011/12/15 04:34:05 Tzik-san, I know this patch has been already lande
+ }
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698