| Index: chrome/common/json_pref_store.cc
|
| diff --git a/chrome/common/json_pref_store.cc b/chrome/common/json_pref_store.cc
|
| index b6e76c9670bd84fce931fd3bdb929ed565f4c132..d20d05b7404614fb27052b5100d84e6d5262695d 100644
|
| --- a/chrome/common/json_pref_store.cc
|
| +++ b/chrome/common/json_pref_store.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -26,8 +26,7 @@ JsonPrefStore::JsonPrefStore(const FilePath& filename,
|
| }
|
|
|
| JsonPrefStore::~JsonPrefStore() {
|
| - if (writer_.HasPendingWrite() && !read_only_)
|
| - writer_.DoScheduledWrite();
|
| + CommitPendingWrite();
|
| }
|
|
|
| PrefStore::ReadResult JsonPrefStore::GetValue(const std::string& key,
|
| @@ -159,6 +158,11 @@ void JsonPrefStore::ScheduleWritePrefs() {
|
| writer_.ScheduleWrite(this);
|
| }
|
|
|
| +void JsonPrefStore::CommitPendingWrite() {
|
| + if (writer_.HasPendingWrite() && !read_only_)
|
| + writer_.DoScheduledWrite();
|
| +}
|
| +
|
| void JsonPrefStore::ReportValueChanged(const std::string& key) {
|
| FOR_EACH_OBSERVER(PrefStore::Observer, observers_, OnPrefValueChanged(key));
|
| }
|
|
|