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

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

Issue 664263002: Restructure SDCH layering to allow more separation (observer/1->[0,n] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated more comments. Created 6 years, 1 month 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 | « no previous file | chrome/browser/net/chrome_sdch_policy.cc » ('j') | chrome/browser/net/chrome_sdch_policy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_sdch_policy.h
diff --git a/chrome/browser/net/chrome_sdch_policy.h b/chrome/browser/net/chrome_sdch_policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..000f2c40ae9a05cc41f30013e2f845fc949c4601
--- /dev/null
+++ b/chrome/browser/net/chrome_sdch_policy.h
@@ -0,0 +1,41 @@
+// 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.
+
+// Implementation of chrome embedder policy for SDCH. Handles fetches.
+// TODO(rdsmith): Implement dictionary prioritization.
mmenke 2014/11/06 15:30:12 nit: Comments like this generally go above the cl
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 Done.
+
+#ifndef CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_
+#define CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_
+
+#include "net/base/sdch_observer.h"
+#include "net/url_request/sdch_dictionary_fetcher.h"
+
+namespace net {
+class SdchManager;
+class URLRequestContext;
+}
+
+class ChromeSdchPolicy : public net::SdchObserver {
mmenke 2014/11/06 15:30:12 I wonder about the name... "Policy" indicates to
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 Yeah. The context here is that we want an embedde
+ public:
+ // Consumer must guarantee that |sdch_manager| and |context| outlive
+ // this object.
+ ChromeSdchPolicy(net::SdchManager* sdch_manager,
+ net::URLRequestContext* context);
+ virtual ~ChromeSdchPolicy();
mmenke 2014/11/06 15:30:12 nit: -virtual +override
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 Done.
+
+ void OnDictionaryFetched(const std::string& dictionary_text,
mmenke 2014/11/06 15:30:12 #include <string>
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 Done.
+ const GURL& dictionary_url);
+
+ // SdchObserver implementation.
+ virtual void OnGetDictionary(net::SdchManager* manager,
+ const GURL& request_url,
mmenke 2014/11/06 15:30:12 Maybe forward declare GURL? Know it's part of the
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 I think if we really want consistency, we'd need t
+ const GURL& dictionary_url) override;
+ virtual void OnClearDictionaries(net::SdchManager* manager) override;
mmenke 2014/11/06 15:30:11 nit: -virtual +override (x2)
Randy Smith (Not in Mondays) 2014/11/06 16:39:04 Done.
+
+ private:
+ net::SdchManager* manager_;
+ net::SdchDictionaryFetcher fetcher_;
+};
+
+#endif // CHROME_BROWSER_NET_CHROME_SDCH_POLICY_H_
« no previous file with comments | « no previous file | chrome/browser/net/chrome_sdch_policy.cc » ('j') | chrome/browser/net/chrome_sdch_policy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698