Skip to content

Commit

Permalink
Remove the speculative resource prefetching code. This was experiment…
Browse files Browse the repository at this point in the history
…al code added 1.5 years ago and not used for the last year.

BUG=164207,304341
R=cbentzel@chromium.org

Review URL: https://codereview.chromium.org/117933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243098 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jam@chromium.org committed Jan 6, 2014
1 parent 2aa5bfa commit c7c265f
Show file tree
Hide file tree
Showing 38 changed files with 1 addition and 5,713 deletions.
7 changes: 0 additions & 7 deletions chrome/browser/android/tab_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "chrome/browser/net/net_error_tab_helper.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/password_manager/password_manager_delegate_impl.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h"
#include "chrome/browser/prerender/prerender_tab_helper.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/profiles/profile.h"
Expand Down Expand Up @@ -113,11 +111,6 @@ void BrowserTabContents::AttachTabHelpers(content::WebContents* contents) {
TranslateTabHelper::CreateForWebContents(contents);
WindowAndroidHelper::CreateForWebContents(contents);

if (predictors::ResourcePrefetchPredictorFactory::GetForProfile(profile)) {
predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents(
contents);
}

#if defined(ENABLE_MANAGED_USERS)
if (profile->IsManaged())
ManagedModeNavigationObserver::CreateForWebContents(contents);
Expand Down
201 changes: 0 additions & 201 deletions chrome/browser/net/resource_prefetch_predictor_observer.cc

This file was deleted.

50 changes: 0 additions & 50 deletions chrome/browser/net/resource_prefetch_predictor_observer.h

This file was deleted.

19 changes: 1 addition & 18 deletions chrome/browser/predictors/predictor_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/predictors/autocomplete_action_predictor_table.h"
#include "chrome/browser/predictors/logged_in_predictor_table.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
#include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
Expand Down Expand Up @@ -52,15 +50,13 @@ class PredictorDatabaseInternal
// Cancels pending DB transactions. Should only be called on the UI thread.
void SetCancelled();

bool is_resource_prefetch_predictor_enabled_;
base::FilePath db_path_;
scoped_ptr<sql::Connection> db_;

// TODO(shishir): These tables may not need to be refcounted. Maybe move them
// to using a WeakPtr instead.
scoped_refptr<AutocompleteActionPredictorTable> autocomplete_table_;
scoped_refptr<LoggedInPredictorTable> logged_in_table_;
scoped_refptr<ResourcePrefetchPredictorTables> resource_prefetch_tables_;

DISALLOW_COPY_AND_ASSIGN(PredictorDatabaseInternal);
};
Expand All @@ -70,12 +66,8 @@ PredictorDatabaseInternal::PredictorDatabaseInternal(Profile* profile)
: db_path_(profile->GetPath().Append(kPredictorDatabaseName)),
db_(new sql::Connection()),
autocomplete_table_(new AutocompleteActionPredictorTable()),
logged_in_table_(new LoggedInPredictorTable()),
resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) {
logged_in_table_(new LoggedInPredictorTable()) {
db_->set_histogram_tag("Predictor");
ResourcePrefetchPredictorConfig config;
is_resource_prefetch_predictor_enabled_ =
IsSpeculativeResourcePrefetchingEnabled(profile, &config);
}

PredictorDatabaseInternal::~PredictorDatabaseInternal() {
Expand All @@ -97,7 +89,6 @@ void PredictorDatabaseInternal::Initialize() {

autocomplete_table_->Initialize(db_.get());
logged_in_table_->Initialize(db_.get());
resource_prefetch_tables_->Initialize(db_.get());

LogDatabaseStats();
}
Expand All @@ -108,7 +99,6 @@ void PredictorDatabaseInternal::SetCancelled() {

autocomplete_table_->SetCancelled();
logged_in_table_->SetCancelled();
resource_prefetch_tables_->SetCancelled();
}

void PredictorDatabaseInternal::LogDatabaseStats() {
Expand All @@ -123,8 +113,6 @@ void PredictorDatabaseInternal::LogDatabaseStats() {

autocomplete_table_->LogDatabaseStats();
logged_in_table_->LogDatabaseStats();
if (is_resource_prefetch_predictor_enabled_)
resource_prefetch_tables_->LogDatabaseStats();
}

PredictorDatabase::PredictorDatabase(Profile* profile)
Expand All @@ -150,11 +138,6 @@ scoped_refptr<LoggedInPredictorTable>
return db_->logged_in_table_;
}

scoped_refptr<ResourcePrefetchPredictorTables>
PredictorDatabase::resource_prefetch_tables() {
return db_->resource_prefetch_tables_;
}

sql::Connection* PredictorDatabase::GetDatabase() {
return db_->db_.get();
}
Expand Down
2 changes: 0 additions & 2 deletions chrome/browser/predictors/predictor_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ namespace predictors {
class AutocompleteActionPredictorTable;
class LoggedInPredictorTable;
class PredictorDatabaseInternal;
class ResourcePrefetchPredictorTables;

class PredictorDatabase : public BrowserContextKeyedService {
public:
explicit PredictorDatabase(Profile* profile);
virtual ~PredictorDatabase();

scoped_refptr<AutocompleteActionPredictorTable> autocomplete_table();
scoped_refptr<ResourcePrefetchPredictorTables> resource_prefetch_tables();
scoped_refptr<LoggedInPredictorTable> logged_in_table();

// Used for testing.
Expand Down
Loading

0 comments on commit c7c265f

Please sign in to comment.