Chromium Code Reviews| Index: chrome/browser/history/history.cc |
| =================================================================== |
| --- chrome/browser/history/history.cc (revision 103916) |
| +++ chrome/browser/history/history.cc (working copy) |
| @@ -37,6 +37,7 @@ |
| #include "chrome/browser/history/history_types.h" |
| #include "chrome/browser/history/in_memory_database.h" |
| #include "chrome/browser/history/in_memory_history_backend.h" |
| +#include "chrome/browser/history/in_memory_url_index.h" |
| #include "chrome/browser/history/top_sites.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| @@ -172,6 +173,9 @@ |
| // Get rid of the in-memory backend. |
| in_memory_backend_.reset(); |
| + // Give the InMemoryURLIndex a chance to shutdown. |
| + InMemoryIndex()->ShutDown(); |
|
Peter Kasting
2011/10/07 17:50:37
Nit: Shouldn't this be "Shutdown()" since it's one
mrossetti
2011/10/07 22:24:37
I was viewing it as the verb "shut down" vs. the n
|
| + |
| // The backend's destructor must run on the history thread since it is not |
| // threadsafe. So this thread must not be the last thread holding a reference |
| // to the backend, or a crash could happen. |
| @@ -232,8 +236,8 @@ |
| // LoadBackendIfNecessary() here even though it won't affect the return value |
| // for this call. |
| LoadBackendIfNecessary(); |
| - if (in_memory_backend_.get()) |
| - return in_memory_backend_->InMemoryIndex(); |
| + if (history_backend_.get()) |
| + return history_backend_->InMemoryIndex(); |
| return NULL; |
| } |
| @@ -788,7 +792,8 @@ |
| ++current_backend_id_; |
| scoped_refptr<HistoryBackend> backend( |
| - new HistoryBackend(history_dir_, |
| + new HistoryBackend(profile_, |
| + history_dir_, |
| current_backend_id_, |
| new BackendDelegate(this, profile_), |
| bookmark_service_)); |