Commit 2f820398 authored by Olivier Li's avatar Olivier Li Committed by Commit Bot

Have directory_backing_store.cc access its SequencedTaskRunner instead of ThreadTaskRunner.

This is ground work for moving ProfileSyncService to the ThreadPool (see bug) but also a logical
change by itself since these functions have no specific need to be run on a dedicated thread.

Change-Id: I45bdbeb0a768af838700a37945613c1ddc475ea0

Bug: 1014464
Change-Id: I45bdbeb0a768af838700a37945613c1ddc475ea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862666Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Oliver Li <olivierli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706523}
parent 11fea80e
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#include "base/location.h" #include "base/location.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h" #include "build/build_config.h"
...@@ -228,10 +228,10 @@ void OnSqliteError(const base::Closure& catastrophic_error_handler, ...@@ -228,10 +228,10 @@ void OnSqliteError(const base::Closure& catastrophic_error_handler,
// An error has been detected. Ignore unless it is catastrophic. // An error has been detected. Ignore unless it is catastrophic.
if (sql::IsErrorCatastrophic(err)) { if (sql::IsErrorCatastrophic(err)) {
// At this point sql::* and DirectoryBackingStore may be on the callstack so // At this point sql::* and DirectoryBackingStore may be on the callstack so
// don't invoke the error handler directly. Instead, PostTask to this thread // don't invoke the error handler directly. Instead, PostTask to this
// to avoid potential reentrancy issues. // sequence to avoid potential reentrancy issues.
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, base::SequencedTaskRunnerHandle::Get()->PostTask(
catastrophic_error_handler); FROM_HERE, catastrophic_error_handler);
} }
} }
...@@ -283,7 +283,7 @@ DirectoryBackingStore::DirectoryBackingStore( ...@@ -283,7 +283,7 @@ DirectoryBackingStore::DirectoryBackingStore(
database_page_size_(kCurrentPageSizeKB), database_page_size_(kCurrentPageSizeKB),
needs_metas_column_refresh_(false), needs_metas_column_refresh_(false),
needs_share_info_column_refresh_(false) { needs_share_info_column_refresh_(false) {
DCHECK(base::ThreadTaskRunnerHandle::IsSet()); DCHECK(base::SequencedTaskRunnerHandle::IsSet());
ResetAndCreateConnection(); ResetAndCreateConnection();
} }
...@@ -297,7 +297,7 @@ DirectoryBackingStore::DirectoryBackingStore( ...@@ -297,7 +297,7 @@ DirectoryBackingStore::DirectoryBackingStore(
db_(db), db_(db),
needs_metas_column_refresh_(false), needs_metas_column_refresh_(false),
needs_share_info_column_refresh_(false) { needs_share_info_column_refresh_(false) {
DCHECK(base::ThreadTaskRunnerHandle::IsSet()); DCHECK(base::SequencedTaskRunnerHandle::IsSet());
} }
DirectoryBackingStore::~DirectoryBackingStore() { DirectoryBackingStore::~DirectoryBackingStore() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment