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