summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 23:12:31 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 23:12:31 +0000
commit654e494ef00266ed802db8cc7f5464fa68615815 (patch)
tree58cab9f4dde051acf5e5505d0bcf6e176e15a51e
parent1c571ca94c8121957e326fbcd2b9c5c497cd5a12 (diff)
downloadchromium_src-654e494ef00266ed802db8cc7f5464fa68615815.zip
chromium_src-654e494ef00266ed802db8cc7f5464fa68615815.tar.gz
chromium_src-654e494ef00266ed802db8cc7f5464fa68615815.tar.bz2
Disable the in memory URL index. This is a temporary test to see if it affects crashes in Chrome.
Review URL: http://codereview.chromium.org/7796011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100530 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc4
-rw-r--r--chrome/browser/history/in_memory_history_backend.cc12
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h2
4 files changed, 16 insertions, 8 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 8d1a363..73928fb 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -790,8 +790,8 @@ AutocompleteController::AutocompleteController(
providers_.push_back(search_provider_);
// TODO(mrossetti): Remove the following and permanently modify the
// HistoryURLProvider to not search titles once HQP is turned on permanently.
- bool hqp_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableHistoryQuickProvider);
+ bool hqp_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableHistoryQuickProvider);
if (hqp_enabled)
providers_.push_back(new HistoryQuickProvider(this, profile));
if (CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/chrome/browser/history/in_memory_history_backend.cc b/chrome/browser/history/in_memory_history_backend.cc
index 79c6a34..7d230a86 100644
--- a/chrome/browser/history/in_memory_history_backend.cc
+++ b/chrome/browser/history/in_memory_history_backend.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/command_line.h"
+#include "base/file_util.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -38,10 +39,17 @@ bool InMemoryHistoryBackend::Init(const FilePath& history_filename,
const std::string& languages) {
db_.reset(new InMemoryDatabase);
bool success = db_->InitFromDisk(history_filename);
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableHistoryQuickProvider)) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableHistoryQuickProvider)) {
index_.reset(new InMemoryURLIndex(history_dir));
index_->Init(db, languages);
+ } else {
+ // We switched the default from on to off for the HQP. So delete any old
+ // provider cache that's now orphaned with the in memory backend being
+ // disabled. This will be automatically regenerated when we re-enable HQP.
+ FilePath provider_cache = history_dir.Append(
+ FILE_PATH_LITERAL("History Provider Cache"));
+ file_util::Delete(provider_cache, false);
}
return success;
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 79a5da2..9ca489e 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -247,9 +247,6 @@ const char kDisableExtensionsFileAccessCheck[] =
// Disables the sandbox for the built-in flash player.
const char kDisableFlashSandbox[] = "disable-flash-sandbox";
-// Disable the use of the HistoryQuickProvider for autocomplete results.
-const char kDisableHistoryQuickProvider[] = "disable-history-quick-provider";
-
// Disable the use of the HistoryURLProvider for autocomplete results.
const char kDisableHistoryURLProvider[] = "disable-history-url-provider";
@@ -446,6 +443,9 @@ const char kEnableFastback[] = "enable-fastback";
// testing, for example page cycler and layout tests. See bug 1157243.
const char kEnableFileCookies[] = "enable-file-cookies";
+// Enable the use of the HistoryQuickProvider for autocomplete results.
+const char kEnableHistoryQuickProvider[] = "enable-history-quick-provider";
+
// Enable the in-browser thumbnailing, which is more efficient than the
// in-renderer thumbnailing, as we can use more information to determine
// if we need to update thumbnails.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 73b4f33..0c538fd 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -77,7 +77,6 @@ extern const char kDisableDhcpWpad[];
extern const char kDisableExtensionsFileAccessCheck[];
extern const char kDisableExtensions[];
extern const char kDisableFlashSandbox[];
-extern const char kDisableHistoryQuickProvider[];
extern const char kDisableHistoryURLProvider[];
extern const char kDisableInteractiveFormValidation[];
extern const char kDisableInternalFlash[];
@@ -130,6 +129,7 @@ extern const char kEnableExperimentalExtensionApis[];
extern const char kEnableExtensionTimelineApi[];
extern const char kEnableFastback[];
extern const char kEnableFileCookies[];
+extern const char kEnableHistoryQuickProvider[];
extern const char kEnableInBrowserThumbnailing[];
extern const char kEnableInlineWebstoreInstall[];
extern const char kEnableIPv6[];