summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaeln <michaeln@chromium.org>2015-08-04 13:23:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-04 20:26:24 +0000
commit0d7deec6a4f22a09b15d4a611b48fa63919dfc5c (patch)
tree7f4992cc1baefc37073ad084f136b5e6097cbf44
parentbbcbf5be6f584402cd757e8736be51808ad99cec (diff)
downloadchromium_src-0d7deec6a4f22a09b15d4a611b48fa63919dfc5c.zip
chromium_src-0d7deec6a4f22a09b15d4a611b48fa63919dfc5c.tar.gz
chromium_src-0d7deec6a4f22a09b15d4a611b48fa63919dfc5c.tar.bz2
Record histograms AppCache and WebDatabase usage for secure vs insecure origins.
Two new histograms are appcache.MainPageLoad and websql.OpenDatabase. Review URL: https://codereview.chromium.org/1259123006 Cr-Commit-Position: refs/heads/master@{#341779}
-rw-r--r--content/browser/appcache/appcache_histograms.cc4
-rw-r--r--content/browser/renderer_host/database_message_filter.cc6
-rw-r--r--tools/metrics/histograms/histograms.xml14
3 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/appcache/appcache_histograms.cc b/content/browser/appcache/appcache_histograms.cc
index ff221b0..ff2baf6 100644
--- a/content/browser/appcache/appcache_histograms.cc
+++ b/content/browser/appcache/appcache_histograms.cc
@@ -5,6 +5,7 @@
#include "content/browser/appcache/appcache_histograms.h"
#include "base/metrics/histogram.h"
+#include "content/public/common/origin_util.h"
namespace content {
@@ -59,6 +60,9 @@ void AppCacheHistograms::CountResponseRetrieval(
if (is_main_resource) {
label = "appcache.MainResourceResponseRetrieval";
UMA_HISTOGRAM_BOOLEAN(label, success);
+
+ // Also count HTTP vs HTTPS appcache usage.
+ UMA_HISTOGRAM_BOOLEAN("appcache.MainPageLoad", IsOriginSecure(origin_url));
} else {
label = "appcache.SubResourceResponseRetrieval";
UMA_HISTOGRAM_BOOLEAN(label, success);
diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc
index ce06242..cf0e228 100644
--- a/content/browser/renderer_host/database_message_filter.cc
+++ b/content/browser/renderer_host/database_message_filter.cc
@@ -7,12 +7,14 @@
#include <string>
#include "base/bind.h"
+#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h"
#include "content/browser/bad_message.h"
#include "content/common/database_messages.h"
#include "content/public/browser/user_metrics.h"
+#include "content/public/common/origin_util.h"
#include "content/public/common/result_codes.h"
#include "storage/browser/database/database_util.h"
#include "storage/browser/database/vfs_backend.h"
@@ -301,6 +303,10 @@ void DatabaseMessageFilter::OnDatabaseOpened(
return;
}
+ UMA_HISTOGRAM_BOOLEAN(
+ "websql.OpenDatabase",
+ IsOriginSecure(storage::GetOriginFromIdentifier(origin_identifier)));
+
int64 database_size = 0;
db_tracker_->DatabaseOpened(origin_identifier, database_name, description,
estimated_size, &database_size);
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 24ee0bf..39a2a12 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -391,6 +391,13 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="appcache.MainPageLoad" enum="BooleanSecure">
+ <owner>michaeln@chromium.org</owner>
+ <summary>
+ Counts the number of appcached page loads for secure vs insecure origins.
+ </summary>
+</histogram>
+
<histogram name="appcache.MainResourceResponseRetrieval" enum="BooleanSuccess">
<owner>michaeln@chromium.org</owner>
<summary>
@@ -50362,6 +50369,13 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<summary>The time required to successfully open a Web SQL database.</summary>
</histogram>
+<histogram name="websql.OpenDatabase" enum="BooleanSecure">
+ <owner>michaeln@chromium.org</owner>
+ <summary>
+ Counts the number of WebSQL databases opened for secure vs insecure origins.
+ </summary>
+</histogram>
+
<histogram name="Webstore.ExtensionInstallResult" enum="BooleanSuccess">
<owner>jackhou@chromium.org</owner>
<summary>