Commit 077d1b20 authored by dcheng's avatar dcheng Committed by Commit bot

Manual fixups for scoped_refptr operator T* removal in base/

BUG=110610

Review URL: https://codereview.chromium.org/511153002

Cr-Commit-Position: refs/heads/master@{#292429}
parent 260631aa
......@@ -88,8 +88,9 @@ bool ImportantFileWriter::WriteFileAtomically(const FilePath& path,
return true;
}
ImportantFileWriter::ImportantFileWriter(const FilePath& path,
base::SequencedTaskRunner* task_runner)
ImportantFileWriter::ImportantFileWriter(
const FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& task_runner)
: path_(path),
task_runner_(task_runner),
serializer_(NULL),
......
......@@ -62,8 +62,9 @@ class BASE_EXPORT ImportantFileWriter : public NonThreadSafe {
// |task_runner| is the SequencedTaskRunner instance where on which we will
// execute file I/O operations.
// All non-const methods, ctor and dtor must be called on the same thread.
ImportantFileWriter(const FilePath& path,
base::SequencedTaskRunner* task_runner);
ImportantFileWriter(
const FilePath& path,
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
// You have to ensure that there are no pending writes at the moment
// of destruction.
......
......@@ -124,9 +124,10 @@ scoped_refptr<base::SequencedTaskRunner> JsonPrefStore::GetTaskRunnerForFile(
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
}
JsonPrefStore::JsonPrefStore(const base::FilePath& filename,
base::SequencedTaskRunner* sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter)
JsonPrefStore::JsonPrefStore(
const base::FilePath& filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter)
: path_(filename),
sequenced_task_runner_(sequenced_task_runner),
prefs_(new base::DictionaryValue()),
......@@ -138,10 +139,11 @@ JsonPrefStore::JsonPrefStore(const base::FilePath& filename,
read_error_(PREF_READ_ERROR_NONE) {
}
JsonPrefStore::JsonPrefStore(const base::FilePath& filename,
const base::FilePath& alternate_filename,
base::SequencedTaskRunner* sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter)
JsonPrefStore::JsonPrefStore(
const base::FilePath& filename,
const base::FilePath& alternate_filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter)
: path_(filename),
alternate_path_(alternate_filename),
sequenced_task_runner_(sequenced_task_runner),
......
......@@ -47,9 +47,10 @@ class BASE_PREFS_EXPORT JsonPrefStore
base::SequencedWorkerPool* worker_pool);
// Same as the constructor below with no alternate filename.
JsonPrefStore(const base::FilePath& pref_filename,
base::SequencedTaskRunner* sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter);
JsonPrefStore(
const base::FilePath& pref_filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter);
// |sequenced_task_runner| must be a shutdown-blocking task runner, ideally
// created by the GetTaskRunnerForFile() method above.
......@@ -58,10 +59,11 @@ class BASE_PREFS_EXPORT JsonPrefStore
// desired prefs may have previously been written to. If |pref_filename|
// doesn't exist and |pref_alternate_filename| does, |pref_alternate_filename|
// will be moved to |pref_filename| before the read occurs.
JsonPrefStore(const base::FilePath& pref_filename,
const base::FilePath& pref_alternate_filename,
base::SequencedTaskRunner* sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter);
JsonPrefStore(
const base::FilePath& pref_filename,
const base::FilePath& pref_alternate_filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
scoped_ptr<PrefFilter> pref_filter);
// PrefStore overrides:
virtual bool GetValue(const std::string& key,
......
......@@ -10,7 +10,8 @@
namespace base {
ThreadTestHelper::ThreadTestHelper(MessageLoopProxy* target_thread)
ThreadTestHelper::ThreadTestHelper(
const scoped_refptr<MessageLoopProxy>& target_thread)
: test_result_(false),
target_thread_(target_thread),
done_event_(false, false) {
......
......@@ -18,7 +18,8 @@ namespace base {
// until all pending tasks on a given thread have been executed.
class ThreadTestHelper : public RefCountedThreadSafe<ThreadTestHelper> {
public:
explicit ThreadTestHelper(MessageLoopProxy* target_thread);
explicit ThreadTestHelper(
const scoped_refptr<MessageLoopProxy>& target_thread);
// True if RunTest() was successfully executed on the target thread.
bool Run() WARN_UNUSED_RESULT;
......
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