summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 20:45:33 +0000
committergroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 20:45:33 +0000
commit62aec8516d064fcf66fc9751d1d61caf8c0714ad (patch)
tree4e9df770bf61fcc5bab1b2346d318f6ab1ea0ed4
parent3966144855a0b20a8ec11a053395478f280ea599 (diff)
downloadchromium_src-62aec8516d064fcf66fc9751d1d61caf8c0714ad.zip
chromium_src-62aec8516d064fcf66fc9751d1d61caf8c0714ad.tar.gz
chromium_src-62aec8516d064fcf66fc9751d1d61caf8c0714ad.tar.bz2
Fix WeakPtrFactory member placement.
WeakPtrFactory should always be declared last, see class comments on it. BUG=303818 Review URL: https://codereview.chromium.org/26329003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227584 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/spellchecker/spellcheck_custom_dictionary.cc4
-rw-r--r--chrome/browser/spellchecker/spellcheck_custom_dictionary.h6
-rw-r--r--chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc4
-rw-r--r--chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h4
4 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
index 6654d68..536c130 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -218,8 +218,8 @@ bool SpellcheckCustomDictionary::Change::empty() const {
SpellcheckCustomDictionary::SpellcheckCustomDictionary(
const base::FilePath& path)
: custom_dictionary_path_(),
- weak_ptr_factory_(this),
- is_loaded_(false) {
+ is_loaded_(false),
+ weak_ptr_factory_(this) {
custom_dictionary_path_ =
path.Append(chrome::kCustomDictionaryFileName);
}
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.h b/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
index 848022a..a7b705b 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
@@ -166,9 +166,6 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
// A path for custom dictionary.
base::FilePath custom_dictionary_path_;
- // Used to create weak pointers for an instance of this class.
- base::WeakPtrFactory<SpellcheckCustomDictionary> weak_ptr_factory_;
-
// Observers for changes in dictionary load status and content changes.
ObserverList<Observer> observers_;
@@ -181,6 +178,9 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
// True if the dictionary has been loaded. Otherwise false.
bool is_loaded_;
+ // Used to create weak pointers for an instance of this class.
+ base::WeakPtrFactory<SpellcheckCustomDictionary> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(SpellcheckCustomDictionary);
};
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index b39f7a90..6cc0fa2 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -165,10 +165,10 @@ SpellcheckHunspellDictionary::SpellcheckHunspellDictionary(
: language_(language),
use_platform_spellchecker_(false),
request_context_getter_(request_context_getter),
- weak_ptr_factory_(this),
spellcheck_service_(spellcheck_service),
download_status_(DOWNLOAD_NONE),
- dictionary_file_(new DictionaryFile) {
+ dictionary_file_(new DictionaryFile),
+ weak_ptr_factory_(this) {
}
SpellcheckHunspellDictionary::~SpellcheckHunspellDictionary() {
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 52c952d..528e42a 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -123,8 +123,6 @@ class SpellcheckHunspellDictionary
// Used for downloading the dictionary file.
scoped_ptr<net::URLFetcher> fetcher_;
- base::WeakPtrFactory<SpellcheckHunspellDictionary> weak_ptr_factory_;
-
SpellcheckService* spellcheck_service_;
// Observers of Hunspell dictionary events.
@@ -136,6 +134,8 @@ class SpellcheckHunspellDictionary
// Dictionary file path and descriptor.
scoped_ptr<DictionaryFile> dictionary_file_;
+ base::WeakPtrFactory<SpellcheckHunspellDictionary> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(SpellcheckHunspellDictionary);
};