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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp

Issue 2879893004: Add UseCounter for FTS3 virtual tables in WebSQL. (Closed)
Patch Set: Rebased Created 3 years, 7 months 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
Index: third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp
index 5c370389e6a3d82183158f0dd08ff3182042ad8b..ea08141ca8f640f4920c87ad19e888a54e7c990a 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp
@@ -28,6 +28,8 @@
#include "modules/webdatabase/DatabaseAuthorizer.h"
+#include "core/frame/UseCounter.h"
+#include "modules/webdatabase/DatabaseContext.h"
#include "platform/wtf/HashSet.h"
#include "platform/wtf/StdLibExtras.h"
#include "platform/wtf/Threading.h"
@@ -36,13 +38,16 @@
namespace blink {
DatabaseAuthorizer* DatabaseAuthorizer::Create(
+ DatabaseContext* database_context,
const String& database_info_table_name) {
- return new DatabaseAuthorizer(database_info_table_name);
+ return new DatabaseAuthorizer(database_context, database_info_table_name);
}
-DatabaseAuthorizer::DatabaseAuthorizer(const String& database_info_table_name)
+DatabaseAuthorizer::DatabaseAuthorizer(DatabaseContext* database_context,
+ const String& database_info_table_name)
: security_enabled_(false),
- database_info_table_name_(database_info_table_name) {
+ database_info_table_name_(database_info_table_name),
+ database_context_(database_context) {
DCHECK(IsMainThread());
Reset();
@@ -247,6 +252,8 @@ int DatabaseAuthorizer::CreateVTable(const String& table_name,
if (!DeprecatedEqualIgnoringCase(module_name, "fts3"))
return kSQLAuthDeny;
+ UseCounter::Count(database_context_->GetExecutionContext(),
+ UseCounter::kWebDatabaseCreateDropFTS3Table);
last_action_changed_database_ = true;
return DenyBasedOnTableName(table_name);
}
@@ -260,6 +267,8 @@ int DatabaseAuthorizer::DropVTable(const String& table_name,
if (!DeprecatedEqualIgnoringCase(module_name, "fts3"))
return kSQLAuthDeny;
+ UseCounter::Count(database_context_->GetExecutionContext(),
+ UseCounter::kWebDatabaseCreateDropFTS3Table);
return UpdateDeletesBasedOnTableName(table_name);
}
@@ -369,4 +378,8 @@ int DatabaseAuthorizer::UpdateDeletesBasedOnTableName(
return allow;
}
+DEFINE_TRACE(DatabaseAuthorizer) {
+ visitor->Trace(database_context_);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.h ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698