summaryrefslogtreecommitdiff
path: root/chromium/sql
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-31 16:33:43 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-06 16:33:22 +0000
commitda51f56cc21233c2d30f0fe0d171727c3102b2e0 (patch)
tree4e579ab70ce4b19bee7984237f3ce05a96d59d83 /chromium/sql
parentc8c2d1901aec01e934adf561a9fdf0cc776cdef8 (diff)
downloadqtwebengine-chromium-da51f56cc21233c2d30f0fe0d171727c3102b2e0.tar.gz
BASELINE: Update Chromium to 65.0.3525.40
Also imports missing submodules Change-Id: I36901b7c6a325cda3d2c10cedb2186c25af3b79b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/sql')
-rw-r--r--chromium/sql/connection.cc20
-rw-r--r--chromium/sql/recovery.cc10
2 files changed, 14 insertions, 16 deletions
diff --git a/chromium/sql/connection.cc b/chromium/sql/connection.cc
index a8547d2675c..76f9371b7c8 100644
--- a/chromium/sql/connection.cc
+++ b/chromium/sql/connection.cc
@@ -21,6 +21,7 @@
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/single_thread_task_runner.h"
@@ -248,10 +249,7 @@ void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) {
std::string debug_info = GetDiagnosticInfo(extended_error, stmt);
if (!debug_info.empty() && RegisterIntentToUpload()) {
- char debug_buf[2000];
- base::strlcpy(debug_buf, debug_info.c_str(), arraysize(debug_buf));
- base::debug::Alias(&debug_buf);
-
+ DEBUG_ALIAS_FOR_CSTR(debug_buf, debug_info.c_str(), 2000);
base::debug::DumpWithoutCrashing();
}
}
@@ -465,7 +463,7 @@ void Connection::CloseInternal(bool forced) {
int rc = sqlite3_close(db_);
if (rc != SQLITE_OK) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.CloseFailure", rc);
+ base::UmaHistogramSparse("Sqlite.CloseFailure", rc);
DLOG(DCHECK) << "sqlite3_close failed: " << GetErrorMessage();
}
}
@@ -1124,7 +1122,7 @@ bool Connection::Raze() {
const char* kMain = "main";
int rc = BackupDatabase(null_db.db_, db_, kMain);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RazeDatabase",rc);
+ base::UmaHistogramSparse("Sqlite.RazeDatabase", rc);
// The destination database was locked.
if (rc == SQLITE_BUSY) {
@@ -1147,13 +1145,13 @@ bool Connection::Raze() {
rc = file->pMethods->xTruncate(file, 0);
if (rc != SQLITE_OK) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RazeDatabaseTruncate",rc);
+ base::UmaHistogramSparse("Sqlite.RazeDatabaseTruncate", rc);
DLOG(DCHECK) << "Failed to truncate file.";
return false;
}
rc = BackupDatabase(null_db.db_, db_, kMain);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RazeDatabase2",rc);
+ base::UmaHistogramSparse("Sqlite.RazeDatabase2", rc);
DCHECK_EQ(rc, SQLITE_DONE) << "Failed retrying Raze().";
}
@@ -1698,7 +1696,7 @@ bool Connection::OpenInternal(const std::string& file_name,
// Histogram failures specific to initial open for debugging
// purposes.
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.OpenFailure", err);
+ base::UmaHistogramSparse("Sqlite.OpenFailure", err);
OnSqliteError(err, NULL, "-- sqlite3_open()");
bool was_poisoned = poisoned_;
@@ -1757,7 +1755,7 @@ bool Connection::OpenInternal(const std::string& file_name,
// be razed.
err = ExecuteAndReturnErrorCode("PRAGMA auto_vacuum");
if (err != SQLITE_OK) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.OpenProbeFailure", err);
+ base::UmaHistogramSparse("Sqlite.OpenProbeFailure", err);
OnSqliteError(err, nullptr, "PRAGMA auto_vacuum");
// Retry or bail out if the error handler poisoned the handle.
@@ -1932,7 +1930,7 @@ void Connection::AddTaggedHistogram(const std::string& name,
int Connection::OnSqliteError(
int err, sql::Statement *stmt, const char* sql) const {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.Error", err);
+ base::UmaHistogramSparse("Sqlite.Error", err);
AddTaggedHistogram("Sqlite.Error", err);
// Always log the error.
diff --git a/chromium/sql/recovery.cc b/chromium/sql/recovery.cc
index 64eefa51104..848ce36e350 100644
--- a/chromium/sql/recovery.cc
+++ b/chromium/sql/recovery.cc
@@ -9,8 +9,8 @@
#include "base/files/file_path.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
-#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "sql/connection.h"
@@ -261,8 +261,8 @@ bool Recovery::Init(const base::FilePath& db_path) {
if (!recover_db_.AttachDatabase(db_path, "corrupt")) {
RecordRecoveryEvent(RECOVERY_FAILED_ATTACH);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RecoveryAttachError",
- recover_db_.GetErrorCode());
+ base::UmaHistogramSparse("Sqlite.RecoveryAttachError",
+ recover_db_.GetErrorCode());
return false;
}
@@ -313,7 +313,7 @@ bool Recovery::Backup() {
// Error code is in the destination database handle.
int err = sqlite3_extended_errcode(db_->db_);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RecoveryHandle", err);
+ base::UmaHistogramSparse("Sqlite.RecoveryHandle", err);
LOG(ERROR) << "sqlite3_backup_init() failed: "
<< sqlite3_errmsg(db_->db_);
@@ -332,7 +332,7 @@ bool Recovery::Backup() {
if (rc != SQLITE_DONE) {
RecordRecoveryEvent(RECOVERY_FAILED_BACKUP_STEP);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.RecoveryStep", rc);
+ base::UmaHistogramSparse("Sqlite.RecoveryStep", rc);
LOG(ERROR) << "sqlite3_backup_step() failed: "
<< sqlite3_errmsg(db_->db_);
}