Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/predictors/predictor_database.cc

Issue 10825188: Add comment explaining fix and added explicit HistoryService dependency in predictor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/predictors/predictor_database.h" 5 #include "chrome/browser/predictors/predictor_database.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 : db_path_(profile->GetPath().Append(kPredictorDatabaseName)), 63 : db_path_(profile->GetPath().Append(kPredictorDatabaseName)),
64 autocomplete_table_(new AutocompleteActionPredictorTable()), 64 autocomplete_table_(new AutocompleteActionPredictorTable()),
65 resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) { 65 resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) {
66 } 66 }
67 67
68 PredictorDatabaseInternal::~PredictorDatabaseInternal() { 68 PredictorDatabaseInternal::~PredictorDatabaseInternal() {
69 } 69 }
70 70
71 void PredictorDatabaseInternal::Initialize() { 71 void PredictorDatabaseInternal::Initialize() {
72 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB)); 72 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB));
73
74 db_.set_exclusive_locking(); 73 db_.set_exclusive_locking();
75 bool success = db_.Open(db_path_); 74 bool success = db_.Open(db_path_);
76 75
77 if (!success) 76 if (!success)
78 return; 77 return;
79 78
80 autocomplete_table_->Initialize(&db_); 79 autocomplete_table_->Initialize(&db_);
81 resource_prefetch_tables_->Initialize(&db_); 80 resource_prefetch_tables_->Initialize(&db_);
82 81
83 LogDatabaseStats(); 82 LogDatabaseStats();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 scoped_refptr<ResourcePrefetchPredictorTables> 123 scoped_refptr<ResourcePrefetchPredictorTables>
125 PredictorDatabase::resource_prefetch_tables() { 124 PredictorDatabase::resource_prefetch_tables() {
126 return db_->resource_prefetch_tables_; 125 return db_->resource_prefetch_tables_;
127 } 126 }
128 127
129 sql::Connection* PredictorDatabase::GetDatabase() { 128 sql::Connection* PredictorDatabase::GetDatabase() {
130 return &db_->db_; 129 return &db_->db_;
131 } 130 }
132 131
133 } // namespace predictors 132 } // namespace predictors
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698