summaryrefslogtreecommitdiff
path: root/chromium/components/history
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-06 12:48:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:33:43 +0000
commit7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch)
treefa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/components/history
parent79b4f909db1049fca459c07cca55af56a9b54fe3 (diff)
downloadqtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/history')
-rw-r--r--chromium/components/history/README13
-rw-r--r--chromium/components/history/content/browser/content_visit_delegate.cc2
-rw-r--r--chromium/components/history/content/browser/download_conversions.cc3
-rw-r--r--chromium/components/history/content/browser/web_contents_top_sites_observer.cc2
-rw-r--r--chromium/components/history/core/browser/android/android_urls_sql_handler.cc2
-rw-r--r--chromium/components/history/core/browser/android/favicon_sql_handler.cc2
-rw-r--r--chromium/components/history/core/browser/android/visit_sql_handler.cc2
-rw-r--r--chromium/components/history/core/browser/browsing_history_service.cc3
-rw-r--r--chromium/components/history/core/browser/domain_mixing_metrics.cc3
-rw-r--r--chromium/components/history/core/browser/download_types.cc3
-rw-r--r--chromium/components/history/core/browser/expire_history_backend.cc2
-rw-r--r--chromium/components/history/core/browser/history_backend.cc3
-rw-r--r--chromium/components/history/core/browser/history_service.cc8
-rw-r--r--chromium/components/history/core/browser/history_service_unittest.cc1
-rw-r--r--chromium/components/history/core/browser/history_types.cc3
-rw-r--r--chromium/components/history/core/browser/history_types.h6
-rw-r--r--chromium/components/history/core/browser/in_memory_database.cc2
-rw-r--r--chromium/components/history/core/browser/sync/delete_directive_handler.cc31
-rw-r--r--chromium/components/history/core/browser/sync/delete_directive_handler.h6
-rw-r--r--chromium/components/history/core/browser/sync/delete_directive_handler_unittest.cc18
-rw-r--r--chromium/components/history/core/browser/sync/typed_url_sync_bridge.cc33
-rw-r--r--chromium/components/history/core/browser/sync/typed_url_sync_bridge.h12
-rw-r--r--chromium/components/history/core/browser/top_sites_impl.cc2
-rw-r--r--chromium/components/history/core/browser/url_database.cc1
-rw-r--r--chromium/components/history/core/browser/visitsegment_database.cc2
-rw-r--r--chromium/components/history/core/common/thumbnail_score.cc1
-rw-r--r--chromium/components/history/ios/browser/web_state_top_sites_observer.mm2
27 files changed, 58 insertions, 110 deletions
diff --git a/chromium/components/history/README b/chromium/components/history/README
deleted file mode 100644
index 206d6547f24..00000000000
--- a/chromium/components/history/README
+++ /dev/null
@@ -1,13 +0,0 @@
-History is in the process of becoming a layered compoent
-(https://sites.google.com/a/chromium.org/dev/developers/design-documents/layered-components-design)
-to enable it to be shared cleanly on iOS.
-
-When this process is complete, this component will have the following structure:
-
-core/: shared code that does not depends on src/content/ or src/ios/
- browser/: browser process code
- common/: code shared by the browser and the renderer
-content/: driver for the shared code based on the content layer
- browser/: browser process code
- common/: code shared by the browser and the renderer
-ios/: driver for the shared code based on src/ios
diff --git a/chromium/components/history/content/browser/content_visit_delegate.cc b/chromium/components/history/content/browser/content_visit_delegate.cc
index 19209adffbe..becf500d2cd 100644
--- a/chromium/components/history/content/browser/content_visit_delegate.cc
+++ b/chromium/components/history/content/browser/content_visit_delegate.cc
@@ -6,7 +6,7 @@
#include <utility>
-#include "base/logging.h"
+#include "base/check.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "components/history/core/browser/history_backend.h"
diff --git a/chromium/components/history/content/browser/download_conversions.cc b/chromium/components/history/content/browser/download_conversions.cc
index 71d5a889be8..0b4294127bc 100644
--- a/chromium/components/history/content/browser/download_conversions.cc
+++ b/chromium/components/history/content/browser/download_conversions.cc
@@ -4,7 +4,8 @@
#include "components/history/content/browser/download_conversions.h"
-#include "base/logging.h"
+#include "base/check_op.h"
+#include "base/notreached.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/history/core/browser/download_constants.h"
diff --git a/chromium/components/history/content/browser/web_contents_top_sites_observer.cc b/chromium/components/history/content/browser/web_contents_top_sites_observer.cc
index f0ffbdc858e..2945d43d531 100644
--- a/chromium/components/history/content/browser/web_contents_top_sites_observer.cc
+++ b/chromium/components/history/content/browser/web_contents_top_sites_observer.cc
@@ -4,7 +4,7 @@
#include "components/history/content/browser/web_contents_top_sites_observer.h"
-#include "base/logging.h"
+#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "components/history/core/browser/top_sites.h"
#include "content/public/browser/navigation_details.h"
diff --git a/chromium/components/history/core/browser/android/android_urls_sql_handler.cc b/chromium/components/history/core/browser/android/android_urls_sql_handler.cc
index db1f0d53bfb..1bf2de93563 100644
--- a/chromium/components/history/core/browser/android/android_urls_sql_handler.cc
+++ b/chromium/components/history/core/browser/android/android_urls_sql_handler.cc
@@ -4,7 +4,7 @@
#include "components/history/core/browser/android/android_urls_sql_handler.h"
-#include "base/logging.h"
+#include "base/check.h"
#include "base/stl_util.h"
#include "components/history/core/browser/android/android_urls_database.h"
diff --git a/chromium/components/history/core/browser/android/favicon_sql_handler.cc b/chromium/components/history/core/browser/android/favicon_sql_handler.cc
index 08577647b5d..5f2c06f9dbe 100644
--- a/chromium/components/history/core/browser/android/favicon_sql_handler.cc
+++ b/chromium/components/history/core/browser/android/favicon_sql_handler.cc
@@ -4,7 +4,7 @@
#include "components/history/core/browser/android/favicon_sql_handler.h"
-#include "base/logging.h"
+#include "base/check.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
#include "base/stl_util.h"
diff --git a/chromium/components/history/core/browser/android/visit_sql_handler.cc b/chromium/components/history/core/browser/android/visit_sql_handler.cc
index 21353449f26..64b8753f42a 100644
--- a/chromium/components/history/core/browser/android/visit_sql_handler.cc
+++ b/chromium/components/history/core/browser/android/visit_sql_handler.cc
@@ -6,7 +6,7 @@
#include <stdint.h>
-#include "base/logging.h"
+#include "base/check.h"
#include "base/stl_util.h"
#include "components/history/core/browser/url_database.h"
#include "components/history/core/browser/visit_database.h"
diff --git a/chromium/components/history/core/browser/browsing_history_service.cc b/chromium/components/history/core/browser/browsing_history_service.cc
index 5fa1dbda459..7c456bf405a 100644
--- a/chromium/components/history/core/browser/browsing_history_service.cc
+++ b/chromium/components/history/core/browser/browsing_history_service.cc
@@ -12,8 +12,9 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/logging.h"
+#include "base/check.h"
#include "base/metrics/histogram_macros.h"
+#include "base/notreached.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/default_clock.h"
diff --git a/chromium/components/history/core/browser/domain_mixing_metrics.cc b/chromium/components/history/core/browser/domain_mixing_metrics.cc
index 1c5df368419..841263fb838 100644
--- a/chromium/components/history/core/browser/domain_mixing_metrics.cc
+++ b/chromium/components/history/core/browser/domain_mixing_metrics.cc
@@ -4,9 +4,10 @@
#include "components/history/core/browser/domain_mixing_metrics.h"
+#include "base/check_op.h"
#include "base/containers/flat_map.h"
-#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
+#include "base/notreached.h"
#include "ui/gfx/geometry/safe_integer_conversions.h"
namespace history {
diff --git a/chromium/components/history/core/browser/download_types.cc b/chromium/components/history/core/browser/download_types.cc
index 68dfa918002..033530b20fd 100644
--- a/chromium/components/history/core/browser/download_types.cc
+++ b/chromium/components/history/core/browser/download_types.cc
@@ -6,7 +6,8 @@
#include <ostream>
-#include "base/logging.h"
+#include "base/check_op.h"
+#include "base/notreached.h"
#include "components/history/core/browser/download_constants.h"
namespace history {
diff --git a/chromium/components/history/core/browser/expire_history_backend.cc b/chromium/components/history/core/browser/expire_history_backend.cc
index b71a81cd9e8..7fee452e0a6 100644
--- a/chromium/components/history/core/browser/expire_history_backend.cc
+++ b/chromium/components/history/core/browser/expire_history_backend.cc
@@ -12,11 +12,11 @@
#include <utility>
#include "base/bind.h"
+#include "base/check.h"
#include "base/compiler_specific.h"
#include "base/containers/flat_set.h"
#include "base/files/file_util.h"
#include "base/location.h"
-#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
diff --git a/chromium/components/history/core/browser/history_backend.cc b/chromium/components/history/core/browser/history_backend.cc
index f51ccbd2552..4d45f5268a2 100644
--- a/chromium/components/history/core/browser/history_backend.cc
+++ b/chromium/components/history/core/browser/history_backend.cc
@@ -2541,7 +2541,8 @@ void HistoryBackend::Commit() {
#if defined(OS_IOS)
// Attempts to get the application running long enough to commit the database
// transaction if it is currently being backgrounded.
- base::ios::ScopedCriticalAction scoped_critical_action;
+ base::ios::ScopedCriticalAction scoped_critical_action(
+ "HistoryBackend::Commit");
#endif
// Note that a commit may not actually have been scheduled if a caller
diff --git a/chromium/components/history/core/browser/history_service.cc b/chromium/components/history/core/browser/history_service.cc
index 6500d2b85eb..2efe9d7a667 100644
--- a/chromium/components/history/core/browser/history_service.cc
+++ b/chromium/components/history/core/browser/history_service.cc
@@ -188,9 +188,11 @@ void HistoryService::HandleBackgrounding() {
if (!backend_task_runner_ || !history_backend_.get())
return;
- ScheduleTask(PRIORITY_NORMAL,
- base::MakeCriticalClosure(base::BindOnce(
- &HistoryBackend::PersistState, history_backend_.get())));
+ ScheduleTask(
+ PRIORITY_NORMAL,
+ base::MakeCriticalClosure("HistoryService::HandleBackgrounding",
+ base::BindOnce(&HistoryBackend::PersistState,
+ history_backend_.get())));
}
#endif
diff --git a/chromium/components/history/core/browser/history_service_unittest.cc b/chromium/components/history/core/browser/history_service_unittest.cc
index c8ddc9251ff..b511b942c59 100644
--- a/chromium/components/history/core/browser/history_service_unittest.cc
+++ b/chromium/components/history/core/browser/history_service_unittest.cc
@@ -49,7 +49,6 @@
#include "components/sync/model/sync_change_processor_wrapper_for_test.h"
#include "components/sync/model/sync_error.h"
#include "components/sync/model/sync_error_factory.h"
-#include "components/sync/model/sync_merge_result.h"
#include "components/sync/protocol/history_delete_directive_specifics.pb.h"
#include "components/sync/protocol/sync.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromium/components/history/core/browser/history_types.cc b/chromium/components/history/core/browser/history_types.cc
index a962b81d4d1..c7a81f63a32 100644
--- a/chromium/components/history/core/browser/history_types.cc
+++ b/chromium/components/history/core/browser/history_types.cc
@@ -6,7 +6,8 @@
#include <limits>
-#include "base/logging.h"
+#include "base/check.h"
+#include "base/notreached.h"
#include "base/stl_util.h"
#include "components/history/core/browser/page_usage_data.h"
diff --git a/chromium/components/history/core/browser/history_types.h b/chromium/components/history/core/browser/history_types.h
index c33148686e1..0a8e1799d2d 100644
--- a/chromium/components/history/core/browser/history_types.h
+++ b/chromium/components/history/core/browser/history_types.h
@@ -14,6 +14,7 @@
#include <utility>
#include <vector>
+#include "base/callback.h"
#include "base/containers/stack_container.h"
#include "base/macros.h"
#include "base/memory/ref_counted_memory.h"
@@ -353,13 +354,10 @@ struct HistoryAddPageArgs {
// The default constructor is equivalent to:
//
// HistoryAddPageArgs(
- // GURL(), base::Time(), NULL, 0, GURL(),
+ // GURL(), base::Time(), nullptr, 0, GURL(),
// RedirectList(), ui::PAGE_TRANSITION_LINK,
// false, SOURCE_BROWSED, false, true,
// base::nullopt)
- //
- // TODO(avi): Is ContextID needed, now that we have a globally-unique
- // nav_entry_id? https://crbug.com/859902
HistoryAddPageArgs();
HistoryAddPageArgs(const GURL& url,
base::Time time,
diff --git a/chromium/components/history/core/browser/in_memory_database.cc b/chromium/components/history/core/browser/in_memory_database.cc
index 2d2d229a998..24e3d094a06 100644
--- a/chromium/components/history/core/browser/in_memory_database.cc
+++ b/chromium/components/history/core/browser/in_memory_database.cc
@@ -5,8 +5,8 @@
#include "components/history/core/browser/in_memory_database.h"
#include "base/files/file_path.h"
-#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
+#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
diff --git a/chromium/components/history/core/browser/sync/delete_directive_handler.cc b/chromium/components/history/core/browser/sync/delete_directive_handler.cc
index 7e243524ea5..8248ca34dd2 100644
--- a/chromium/components/history/core/browser/sync/delete_directive_handler.cc
+++ b/chromium/components/history/core/browser/sync/delete_directive_handler.cc
@@ -378,8 +378,9 @@ bool DeleteDirectiveHandler::CreateDeleteDirectives(
global_id_directive->set_end_time_usec(end_time_usecs);
}
}
- syncer::SyncError error = ProcessLocalDeleteDirective(delete_directive);
- return !error.IsSet();
+ base::Optional<syncer::ModelError> error =
+ ProcessLocalDeleteDirective(delete_directive);
+ return !error.has_value();
}
bool DeleteDirectiveHandler::CreateUrlDeleteDirective(const GURL& url) {
@@ -391,17 +392,18 @@ bool DeleteDirectiveHandler::CreateUrlDeleteDirective(const GURL& url) {
url_directive->set_url(url.spec());
url_directive->set_end_time_usec(TimeToUnixUsec(base::Time::Now()));
- syncer::SyncError error = ProcessLocalDeleteDirective(delete_directive);
- return !error.IsSet();
+ base::Optional<syncer::ModelError> error =
+ ProcessLocalDeleteDirective(delete_directive);
+ return !error.has_value();
}
-syncer::SyncError DeleteDirectiveHandler::ProcessLocalDeleteDirective(
+base::Optional<syncer::ModelError>
+DeleteDirectiveHandler::ProcessLocalDeleteDirective(
const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!sync_processor_) {
- return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
- "Cannot send local delete directive to sync",
- syncer::HISTORY_DELETE_DIRECTIVES);
+ return syncer::ModelError(FROM_HERE,
+ "Cannot send local delete directive to sync");
}
#if !defined(NDEBUG)
CheckDeleteDirectiveValid(delete_directive);
@@ -431,7 +433,8 @@ void DeleteDirectiveHandler::WaitUntilReadyToSync(base::OnceClosure done) {
}
}
-syncer::SyncMergeResult DeleteDirectiveHandler::MergeDataAndStartSyncing(
+base::Optional<syncer::ModelError>
+DeleteDirectiveHandler::MergeDataAndStartSyncing(
syncer::ModelType type,
const syncer::SyncDataList& initial_sync_data,
std::unique_ptr<syncer::SyncChangeProcessor> sync_processor,
@@ -449,7 +452,7 @@ syncer::SyncMergeResult DeleteDirectiveHandler::MergeDataAndStartSyncing(
&internal_tracker_);
}
- return syncer::SyncMergeResult(type);
+ return base::nullopt;
}
void DeleteDirectiveHandler::StopSyncing(syncer::ModelType type) {
@@ -458,15 +461,13 @@ void DeleteDirectiveHandler::StopSyncing(syncer::ModelType type) {
sync_processor_.reset();
}
-syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges(
+base::Optional<syncer::ModelError> DeleteDirectiveHandler::ProcessSyncChanges(
const base::Location& from_here,
const syncer::SyncChangeList& change_list) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!sync_processor_) {
- return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
- "Sync is disabled.",
- syncer::HISTORY_DELETE_DIRECTIVES);
+ return syncer::ModelError(FROM_HERE, "Sync is disabled.");
}
syncer::SyncDataList delete_directives;
@@ -495,7 +496,7 @@ syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges(
&internal_tracker_);
}
- return syncer::SyncError();
+ return base::nullopt;
}
void DeleteDirectiveHandler::FinishProcessing(
diff --git a/chromium/components/history/core/browser/sync/delete_directive_handler.h b/chromium/components/history/core/browser/sync/delete_directive_handler.h
index 76850818514..cdf2b1fcbf8 100644
--- a/chromium/components/history/core/browser/sync/delete_directive_handler.h
+++ b/chromium/components/history/core/browser/sync/delete_directive_handler.h
@@ -62,18 +62,18 @@ class DeleteDirectiveHandler : public syncer::SyncableService {
// history entries that match. Caller still needs to call other
// interfaces, e.g. HistoryService::ExpireHistoryBetween(), to delete
// local history entries.
- syncer::SyncError ProcessLocalDeleteDirective(
+ base::Optional<syncer::ModelError> ProcessLocalDeleteDirective(
const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive);
// syncer::SyncableService implementation.
void WaitUntilReadyToSync(base::OnceClosure done) override;
- syncer::SyncMergeResult MergeDataAndStartSyncing(
+ base::Optional<syncer::ModelError> MergeDataAndStartSyncing(
syncer::ModelType type,
const syncer::SyncDataList& initial_sync_data,
std::unique_ptr<syncer::SyncChangeProcessor> sync_processor,
std::unique_ptr<syncer::SyncErrorFactory> error_handler) override;
void StopSyncing(syncer::ModelType type) override;
- syncer::SyncError ProcessSyncChanges(
+ base::Optional<syncer::ModelError> ProcessSyncChanges(
const base::Location& from_here,
const syncer::SyncChangeList& change_list) override;
diff --git a/chromium/components/history/core/browser/sync/delete_directive_handler_unittest.cc b/chromium/components/history/core/browser/sync/delete_directive_handler_unittest.cc
index 853b35b38b8..13f28b9be71 100644
--- a/chromium/components/history/core/browser/sync/delete_directive_handler_unittest.cc
+++ b/chromium/components/history/core/browser/sync/delete_directive_handler_unittest.cc
@@ -176,17 +176,16 @@ TEST_F(HistoryDeleteDirectiveHandlerTest,
std::make_unique<syncer::SyncChangeProcessorWrapperForTest>(
&change_processor),
std::unique_ptr<syncer::SyncErrorFactory>())
- .error()
- .IsSet());
+ .has_value());
- syncer::SyncError err =
+ base::Optional<syncer::ModelError> err =
handler()->ProcessLocalDeleteDirective(delete_directive);
- EXPECT_FALSE(err.IsSet());
+ EXPECT_FALSE(err.has_value());
EXPECT_EQ(1u, change_processor.changes().size());
handler()->StopSyncing(syncer::HISTORY_DELETE_DIRECTIVES);
err = handler()->ProcessLocalDeleteDirective(delete_directive);
- EXPECT_TRUE(err.IsSet());
+ EXPECT_TRUE(err.has_value());
EXPECT_EQ(1u, change_processor.changes().size());
}
@@ -235,8 +234,7 @@ TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessGlobalIdDeleteDirective) {
new syncer::SyncChangeProcessorWrapperForTest(
&change_processor)),
std::unique_ptr<syncer::SyncErrorFactory>())
- .error()
- .IsSet());
+ .has_value());
// Inject a task to check status and keep message loop filled before directive
// processing finishes.
@@ -303,8 +301,7 @@ TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessTimeRangeDeleteDirective) {
new syncer::SyncChangeProcessorWrapperForTest(
&change_processor)),
std::unique_ptr<syncer::SyncErrorFactory>())
- .error()
- .IsSet());
+ .has_value());
// Inject a task to check status and keep message loop filled before
// directive processing finishes.
@@ -371,8 +368,7 @@ TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessUrlDeleteDirective) {
new syncer::SyncChangeProcessorWrapperForTest(
&change_processor)),
std::unique_ptr<syncer::SyncErrorFactory>())
- .error()
- .IsSet());
+ .has_value());
// Inject a task to check status and keep message loop filled before
// directive processing finishes.
diff --git a/chromium/components/history/core/browser/sync/typed_url_sync_bridge.cc b/chromium/components/history/core/browser/sync/typed_url_sync_bridge.cc
index 305b8c57247..156ff929fba 100644
--- a/chromium/components/history/core/browser/sync/typed_url_sync_bridge.cc
+++ b/chromium/components/history/core/browser/sync/typed_url_sync_bridge.cc
@@ -84,9 +84,7 @@ TypedURLSyncBridge::TypedURLSyncBridge(
: ModelTypeSyncBridge(std::move(change_processor)),
history_backend_(history_backend),
processing_syncer_changes_(false),
- sync_metadata_database_(sync_metadata_database),
- num_db_accesses_(0),
- num_db_errors_(0) {
+ sync_metadata_database_(sync_metadata_database) {
DCHECK(history_backend_);
DCHECK(sequence_checker_.CalledOnValidSequence());
}
@@ -177,10 +175,6 @@ base::Optional<ModelError> TypedURLSyncBridge::MergeSyncData(
metadata_change_list.get());
}
- UMA_HISTOGRAM_PERCENTAGE("Sync.TypedUrlMergeAndStartSyncingErrors",
- GetErrorPercentage());
- ClearErrorStats();
-
return static_cast<syncer::SyncMetadataStoreChangeList*>(
metadata_change_list.get())
->TakeError();
@@ -267,7 +261,6 @@ void TypedURLSyncBridge::GetData(StorageKeyList storage_keys,
URLRow url_row;
URLID url_id = TypedURLSyncMetadataDatabase::StorageKeyToURLID(key);
- ++num_db_accesses_;
if (!history_backend_->GetURLByID(url_id, &url_row)) {
// Ignoring the case which no matching URLRow with URLID |url_id|.
DLOG(ERROR) << "Could not find URL for id: " << url_id;
@@ -294,9 +287,7 @@ void TypedURLSyncBridge::GetAllDataForDebugging(DataCallback callback) {
DCHECK(sequence_checker_.CalledOnValidSequence());
URLRows typed_urls;
- ++num_db_accesses_;
if (!history_backend_->GetAllTypedURLs(&typed_urls)) {
- ++num_db_errors_;
change_processor()->ReportError(
{FROM_HERE, "Could not get the typed_url entries."});
return;
@@ -455,10 +446,6 @@ void TypedURLSyncBridge::OnDatabaseError() {
{FROM_HERE, "HistoryDatabase encountered error"});
}
-int TypedURLSyncBridge::GetErrorPercentage() const {
- return num_db_accesses_ ? (100 * num_db_errors_ / num_db_accesses_) : 0;
-}
-
// static
bool TypedURLSyncBridge::WriteToTypedUrlSpecifics(
const URLRow& url,
@@ -749,11 +736,6 @@ void TypedURLSyncBridge::LoadMetadata() {
change_processor()->ModelReadyToSync(std::move(batch));
}
-void TypedURLSyncBridge::ClearErrorStats() {
- num_db_accesses_ = 0;
- num_db_errors_ = 0;
-}
-
void TypedURLSyncBridge::MergeURLWithSync(
const sync_pb::TypedUrlSpecifics& server_typed_url,
TypedURLMap* local_typed_urls,
@@ -982,7 +964,6 @@ base::Optional<ModelError> TypedURLSyncBridge::WriteToHistoryBackend(
}
if (updated_urls) {
- ++num_db_accesses_;
// This is an existing entry in the URL database. We don't verify the
// visit_count or typed_count values here, because either one (or both)
// could be zero in the case of bookmarks, or in the case of a URL
@@ -990,8 +971,7 @@ base::Optional<ModelError> TypedURLSyncBridge::WriteToHistoryBackend(
// In the field we sometimes run into errors on specific URLs. It's OK
// to just continue on (we can try writing again on the next model
// association).
- size_t num_successful_updates = history_backend_->UpdateURLs(*updated_urls);
- num_db_errors_ += updated_urls->size() - num_successful_updates;
+ history_backend_->UpdateURLs(*updated_urls);
}
if (new_visits) {
@@ -999,19 +979,15 @@ base::Optional<ModelError> TypedURLSyncBridge::WriteToHistoryBackend(
// If there are no visits to add, just skip this.
if (visits.second.empty())
continue;
- ++num_db_accesses_;
if (!history_backend_->AddVisits(visits.first, visits.second,
SOURCE_SYNCED)) {
- ++num_db_errors_;
return ModelError(FROM_HERE, "Could not add visits to HistoryBackend.");
}
}
}
if (deleted_visits) {
- ++num_db_accesses_;
if (!history_backend_->RemoveVisits(*deleted_visits)) {
- ++num_db_errors_;
return ModelError(FROM_HERE,
"Could not remove visits from HistoryBackend.");
// This is bad news, since it means we may end up resurrecting history
@@ -1099,10 +1075,8 @@ bool TypedURLSyncBridge::ShouldSyncVisit(int typed_count,
bool TypedURLSyncBridge::FixupURLAndGetVisits(URLRow* url,
VisitVector* visits) {
- ++num_db_accesses_;
if (!history_backend_->GetMostRecentVisitsForURL(url->id(), kMaxVisitsToFetch,
visits)) {
- ++num_db_errors_;
// Couldn't load the visits for this URL due to some kind of DB error.
// Don't bother writing this URL to the history DB (if we ignore the
// error and continue, we might end up duplicating existing visits).
@@ -1184,9 +1158,7 @@ bool TypedURLSyncBridge::GetValidURLsAndVisits(URLVisitVectorMap* url_to_visit,
DCHECK(url_to_urlrow);
URLRows local_typed_urls;
- ++num_db_accesses_;
if (!history_backend_->GetAllTypedURLs(&local_typed_urls)) {
- ++num_db_errors_;
return false;
}
for (URLRow& url : local_typed_urls) {
@@ -1208,7 +1180,6 @@ std::string TypedURLSyncBridge::GetStorageKeyInternal(const std::string& url) {
DCHECK(history_backend_);
URLRow existing_url;
- ++num_db_accesses_;
bool is_existing_url = history_backend_->GetURL(GURL(url), &existing_url);
if (!is_existing_url) {
diff --git a/chromium/components/history/core/browser/sync/typed_url_sync_bridge.h b/chromium/components/history/core/browser/sync/typed_url_sync_bridge.h
index 339584c52c2..84548c00464 100644
--- a/chromium/components/history/core/browser/sync/typed_url_sync_bridge.h
+++ b/chromium/components/history/core/browser/sync/typed_url_sync_bridge.h
@@ -71,9 +71,6 @@ class TypedURLSyncBridge : public syncer::ModelTypeSyncBridge,
// DatabaseErrorCallback.
void OnDatabaseError();
- // Returns the percentage of DB accesses that have resulted in an error.
- int GetErrorPercentage() const;
-
// Return true if this function successfully converts the passed URL
// information to a TypedUrlSpecifics structure for writing to the sync DB.
static bool WriteToTypedUrlSpecifics(const URLRow& url,
@@ -136,10 +133,6 @@ class TypedURLSyncBridge : public syncer::ModelTypeSyncBridge,
// pass it to the processor so that it can start tracking changes.
void LoadMetadata();
- // Helper function that clears our error counters (used to reset stats after
- // merge so we can track merge errors separately).
- void ClearErrorStats();
-
// Compares |server_typed_url| from the server against local history to decide
// how to merge any existing data, and updates appropriate data containers to
// write to server and backend.
@@ -248,11 +241,6 @@ class TypedURLSyncBridge : public syncer::ModelTypeSyncBridge,
// metadata and state.
TypedURLSyncMetadataDatabase* sync_metadata_database_;
- // Statistics for the purposes of tracking the percentage of DB accesses that
- // fail for each client via UMA.
- int num_db_accesses_;
- int num_db_errors_;
-
// Since HistoryBackend use SequencedTaskRunner, so should use SequenceChecker
// here.
base::SequenceChecker sequence_checker_;
diff --git a/chromium/components/history/core/browser/top_sites_impl.cc b/chromium/components/history/core/browser/top_sites_impl.cc
index 0d5e7fafea6..3d18e0a18c9 100644
--- a/chromium/components/history/core/browser/top_sites_impl.cc
+++ b/chromium/components/history/core/browser/top_sites_impl.cc
@@ -11,9 +11,9 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/check.h"
#include "base/hash/md5.h"
#include "base/location.h"
-#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
diff --git a/chromium/components/history/core/browser/url_database.cc b/chromium/components/history/core/browser/url_database.cc
index 43a149630da..ae8991208e6 100644
--- a/chromium/components/history/core/browser/url_database.cc
+++ b/chromium/components/history/core/browser/url_database.cc
@@ -10,6 +10,7 @@
#include "base/i18n/case_conversion.h"
#include "base/stl_util.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/url_formatter/url_formatter.h"
diff --git a/chromium/components/history/core/browser/visitsegment_database.cc b/chromium/components/history/core/browser/visitsegment_database.cc
index b94487174c5..e1b6b6011fa 100644
--- a/chromium/components/history/core/browser/visitsegment_database.cc
+++ b/chromium/components/history/core/browser/visitsegment_database.cc
@@ -14,7 +14,7 @@
#include <vector>
#include "base/callback.h"
-#include "base/logging.h"
+#include "base/check_op.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
diff --git a/chromium/components/history/core/common/thumbnail_score.cc b/chromium/components/history/core/common/thumbnail_score.cc
index 2f6ec5cb95e..cfeed7cbaf7 100644
--- a/chromium/components/history/core/common/thumbnail_score.cc
+++ b/chromium/components/history/core/common/thumbnail_score.cc
@@ -4,7 +4,6 @@
#include "components/history/core/common/thumbnail_score.h"
-#include "base/logging.h"
#include "base/strings/stringprintf.h"
namespace history {
diff --git a/chromium/components/history/ios/browser/web_state_top_sites_observer.mm b/chromium/components/history/ios/browser/web_state_top_sites_observer.mm
index 414365a636f..5b3ef70f9a2 100644
--- a/chromium/components/history/ios/browser/web_state_top_sites_observer.mm
+++ b/chromium/components/history/ios/browser/web_state_top_sites_observer.mm
@@ -4,7 +4,7 @@
#include "components/history/ios/browser/web_state_top_sites_observer.h"
-#include "base/logging.h"
+#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "components/history/core/browser/top_sites.h"
#import "ios/web/public/navigation/navigation_context.h"