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

Unified Diff: chrome/browser/net/chrome_sdch_policy.cc

Issue 841883002: Add an eviction mechanism for SDCH dictionaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd to p310544 Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/chrome_sdch_policy.h ('k') | chrome/browser/net/sdch_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_sdch_policy.cc
diff --git a/chrome/browser/net/chrome_sdch_policy.cc b/chrome/browser/net/chrome_sdch_policy.cc
deleted file mode 100644
index 8ab62b53014131b2cb897163b8e291bfd88197bb..0000000000000000000000000000000000000000
--- a/chrome/browser/net/chrome_sdch_policy.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/net/chrome_sdch_policy.h"
-
-#include "base/bind.h"
-#include "net/base/sdch_manager.h"
-#include "net/base/sdch_net_log_params.h"
-
-ChromeSdchPolicy::ChromeSdchPolicy(net::SdchManager* sdch_manager,
- net::URLRequestContext* context)
- : manager_(sdch_manager),
- // Because |fetcher_| is owned by ChromeSdchPolicy, the
- // ChromeSdchPolicy object will be available for the lifetime
- // of |fetcher_|.
- fetcher_(context,
- base::Bind(&ChromeSdchPolicy::OnDictionaryFetched,
- base::Unretained(this))) {
- manager_->AddObserver(this);
-}
-
-ChromeSdchPolicy::~ChromeSdchPolicy() {
- manager_->RemoveObserver(this);
-}
-
-void ChromeSdchPolicy::OnDictionaryFetched(const std::string& dictionary_text,
- const GURL& dictionary_url,
- const net::BoundNetLog& net_log) {
- net::SdchProblemCode rv =
- manager_->AddSdchDictionary(dictionary_text, dictionary_url);
- if (rv != net::SDCH_OK) {
- net::SdchManager::SdchErrorRecovery(rv);
- net_log.AddEvent(net::NetLog::TYPE_SDCH_DICTIONARY_ERROR,
- base::Bind(&net::NetLogSdchDictionaryFetchProblemCallback,
- rv, dictionary_url, true));
- }
-}
-
-void ChromeSdchPolicy::OnGetDictionary(net::SdchManager* manager,
- const GURL& request_url,
- const GURL& dictionary_url) {
- fetcher_.Schedule(dictionary_url);
-}
-
-void ChromeSdchPolicy::OnClearDictionaries(net::SdchManager* manager) {
- fetcher_.Cancel();
-}
« no previous file with comments | « chrome/browser/net/chrome_sdch_policy.h ('k') | chrome/browser/net/sdch_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698