Commit e9e86ccc authored by dominich@chromium.org's avatar dominich@chromium.org

Add comment explaining fix and added explicit HistoryService dependency in predictor.

R=scottbyer@chromium.org,shishir@chromium.org
BUG=140466


Review URL: https://chromiumcodereview.appspot.com/10825188

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150120 0039d316-1c4b-4281-b951-d872f2087c98
parent 57bd6676
...@@ -70,7 +70,6 @@ PredictorDatabaseInternal::~PredictorDatabaseInternal() { ...@@ -70,7 +70,6 @@ PredictorDatabaseInternal::~PredictorDatabaseInternal() {
void PredictorDatabaseInternal::Initialize() { void PredictorDatabaseInternal::Initialize() {
CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB)); CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB));
db_.set_exclusive_locking(); db_.set_exclusive_locking();
bool success = db_.Open(db_path_); bool success = db_.Open(db_path_);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/predictors/predictor_database_factory.h" #include "chrome/browser/predictors/predictor_database_factory.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h" #include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -27,8 +28,7 @@ ResourcePrefetchPredictorFactory::GetInstance() { ...@@ -27,8 +28,7 @@ ResourcePrefetchPredictorFactory::GetInstance() {
ResourcePrefetchPredictorFactory::ResourcePrefetchPredictorFactory() ResourcePrefetchPredictorFactory::ResourcePrefetchPredictorFactory()
: ProfileKeyedServiceFactory("ResourcePrefetchPredictor", : ProfileKeyedServiceFactory("ResourcePrefetchPredictor",
ProfileDependencyManager::GetInstance()) { ProfileDependencyManager::GetInstance()) {
// TODO(shishir): Uncomment this when crbug.com/97804 is fixed. DependsOn(HistoryServiceFactory::GetInstance());
// DependsOn(HistoryServiceFactory::GetInstance());
DependsOn(PredictorDatabaseFactory::GetInstance()); DependsOn(PredictorDatabaseFactory::GetInstance());
} }
......
...@@ -58,6 +58,10 @@ IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, NormalPassedFlag) { ...@@ -58,6 +58,10 @@ IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, NormalPassedFlag) {
IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, CloudPrintPolicyFlag) { IN_PROC_BROWSER_TEST_F(CloudPrintPolicyTest, CloudPrintPolicyFlag) {
CommandLine new_command_line(GetCommandLineForRelaunch()); CommandLine new_command_line(GetCommandLineForRelaunch());
new_command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); new_command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy);
// This is important for the test as the way the browser process is launched
// here causes the predictor databases to be initialized multiple times. This
// is not an issue for production where the process is launched as a service
// and a Profile is not created. See http://crbug.com/140466 for more details.
new_command_line.AppendSwitchASCII( new_command_line.AppendSwitchASCII(
switches::kSpeculativeResourcePrefetching, switches::kSpeculativeResourcePrefetching,
switches::kSpeculativeResourcePrefetchingDisabled); switches::kSpeculativeResourcePrefetchingDisabled);
......
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