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

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

Issue 13933017: Revert 194504 "Fix build break" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | no next file » | 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_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 scoped_refptr<ResourcePrefetchPredictorTables> resource_prefetch_tables_; 61 scoped_refptr<ResourcePrefetchPredictorTables> resource_prefetch_tables_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(PredictorDatabaseInternal); 63 DISALLOW_COPY_AND_ASSIGN(PredictorDatabaseInternal);
64 }; 64 };
65 65
66 66
67 PredictorDatabaseInternal::PredictorDatabaseInternal(Profile* profile) 67 PredictorDatabaseInternal::PredictorDatabaseInternal(Profile* profile)
68 : db_path_(profile->GetPath().Append(kPredictorDatabaseName)), 68 : db_path_(profile->GetPath().Append(kPredictorDatabaseName)),
69 db_(new sql::Connection()), 69 db_(new sql::Connection()),
70 autocomplete_table_(new AutocompleteActionPredictorTable()), 70 autocomplete_table_(new AutocompleteActionPredictorTable()),
71 logged_in_table_(new LoggedInPredictorTable()),
71 resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) { 72 resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) {
72 // TODO (tburkard): initialize logged_in_table_ member.
73 ResourcePrefetchPredictorConfig config; 73 ResourcePrefetchPredictorConfig config;
74 is_resource_prefetch_predictor_enabled_ = 74 is_resource_prefetch_predictor_enabled_ =
75 IsSpeculativeResourcePrefetchingEnabled(profile, &config); 75 IsSpeculativeResourcePrefetchingEnabled(profile, &config);
76 } 76 }
77 77
78 PredictorDatabaseInternal::~PredictorDatabaseInternal() { 78 PredictorDatabaseInternal::~PredictorDatabaseInternal() {
79 // The connection pointer needs to be deleted on the DB thread since there 79 // The connection pointer needs to be deleted on the DB thread since there
80 // might be a task in progress on the DB thread which uses this connection. 80 // might be a task in progress on the DB thread which uses this connection.
81 BrowserThread::DeleteSoon(BrowserThread::DB, FROM_HERE, db_.release()); 81 BrowserThread::DeleteSoon(BrowserThread::DB, FROM_HERE, db_.release());
82 } 82 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 scoped_refptr<ResourcePrefetchPredictorTables> 137 scoped_refptr<ResourcePrefetchPredictorTables>
138 PredictorDatabase::resource_prefetch_tables() { 138 PredictorDatabase::resource_prefetch_tables() {
139 return db_->resource_prefetch_tables_; 139 return db_->resource_prefetch_tables_;
140 } 140 }
141 141
142 sql::Connection* PredictorDatabase::GetDatabase() { 142 sql::Connection* PredictorDatabase::GetDatabase() {
143 return db_->db_.get(); 143 return db_->db_.get();
144 } 144 }
145 145
146 } // namespace predictors 146 } // namespace predictors
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698