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

Unified Diff: net/sdch/sdch_owner.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « net/sdch/README.md ('k') | net/sdch/sdch_owner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/sdch/sdch_owner.h
diff --git a/net/sdch/sdch_owner.h b/net/sdch/sdch_owner.h
deleted file mode 100644
index 9620326118c661bedc13eb6785980520aa5171de..0000000000000000000000000000000000000000
--- a/net/sdch/sdch_owner.h
+++ /dev/null
@@ -1,97 +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.
-
-#ifndef NET_SDCH_SDCH_OWNER_H_
-#define NET_SDCH_SDCH_OWNER_H_
-
-#include <string>
-
-#include "base/memory/memory_pressure_listener.h"
-#include "net/base/sdch_observer.h"
-#include "net/url_request/sdch_dictionary_fetcher.h"
-
-class GURL;
-
-namespace base {
-class Clock;
-}
-
-namespace net {
-class SdchManager;
-class URLRequestContext;
-
-// This class owns the SDCH objects not owned as part of URLRequestContext, and
-// exposes interface for setting SDCH policy. It should be instantiated by
-// the net/ embedder.
-// TODO(rdsmith): Implement dictionary prioritization.
-class NET_EXPORT SdchOwner : public net::SdchObserver {
- public:
- static const size_t kMaxTotalDictionarySize;
- static const size_t kMinSpaceForDictionaryFetch;
-
- // Consumer must guarantee that |sdch_manager| and |context| outlive
- // this object.
- SdchOwner(net::SdchManager* sdch_manager, net::URLRequestContext* context);
- ~SdchOwner() override;
-
- // Defaults to kMaxTotalDictionarySize.
- void SetMaxTotalDictionarySize(size_t max_total_dictionary_size);
-
- // Defaults to kMinSpaceForDictionaryFetch.
- void SetMinSpaceForDictionaryFetch(size_t min_space_for_dictionary_fetch);
-
- // SdchObserver implementation.
- void OnDictionaryUsed(SdchManager* manager,
- const std::string& server_hash) override;
- void OnGetDictionary(net::SdchManager* manager,
- const GURL& request_url,
- const GURL& dictionary_url) override;
- void OnClearDictionaries(net::SdchManager* manager) override;
-
- // Implementation detail--this is the pathway through which the
- // fetcher informs the SdchOwner that it's gotten the dictionary.
- // Public for testing.
- void OnDictionaryFetched(const std::string& dictionary_text,
- const GURL& dictionary_url,
- const net::BoundNetLog& net_log);
-
- void SetClockForTesting(scoped_ptr<base::Clock> clock);
-
- private:
- // For each active dictionary, stores local info.
- // Indexed by server hash.
- struct DictionaryInfo {
- base::Time last_used;
- int use_count;
- size_t size;
-
- DictionaryInfo() : use_count(0), size(0) {}
- DictionaryInfo(const base::Time& last_used, size_t size)
- : last_used(last_used), use_count(0), size(size) {}
- DictionaryInfo(const DictionaryInfo& rhs) = default;
- DictionaryInfo& operator=(const DictionaryInfo& rhs) = default;
- };
-
- void OnMemoryPressure(
- base::MemoryPressureListener::MemoryPressureLevel level);
-
- net::SdchManager* manager_;
- net::SdchDictionaryFetcher fetcher_;
-
- std::map<std::string, DictionaryInfo> local_dictionary_info_;
- size_t total_dictionary_bytes_;
-
- scoped_ptr<base::Clock> clock_;
-
- size_t max_total_dictionary_size_;
- size_t min_space_for_dictionary_fetch_;
-
- base::MemoryPressureListener memory_pressure_listener_;
-
- DISALLOW_COPY_AND_ASSIGN(SdchOwner);
-};
-
-} // namespace net
-
-#endif // NET_SDCH_SDCH_OWNER_H_
« no previous file with comments | « net/sdch/README.md ('k') | net/sdch/sdch_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698