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

Unified Diff: net/base/sdch_observer.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: Results of self review. Created 6 years, 2 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
Index: net/base/sdch_observer.h
diff --git a/net/base/sdch_observer.h b/net/base/sdch_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..59c3c77f343dc5ccd2cb7865bccd73be505c7cfb
--- /dev/null
+++ b/net/base/sdch_observer.h
@@ -0,0 +1,47 @@
+// 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.
+
+// Observer interface for SDCH. Observers can register with
+// the SdchManager to receive notifications of various SDCH events.
+
+#ifndef NET_BASE_SDCH_OBSERVER_H_
+#define NET_BASE_SDCH_OBSERVER_H_
+
+#include "net/base/net_export.h"
+
+class GURL;
+
+namespace net {
+
+class SdchManager;
+class URLRequest;
+
+class NET_EXPORT SdchObserver {
+ public:
+ // Notification that SDCH has seen a "Get-Dictionary" header.
+ virtual void OnGetDictionary(SdchManager* manager,
+ const GURL& request_url,
+ const GURL& dictionary_url);
Ryan Sleevi 2014/10/20 22:42:04 Why aren't these pure virtual methods, if this is
Randy Smith (Not in Mondays) 2014/10/21 19:05:37 Ah, this issue :-}. So I'm following where John A
+
+ // Notification that SDCH has received a request to clear all
+ // its dictionaries.
+ virtual void OnClearDictionaries(SdchManager* manager);
+
+ virtual ~SdchObserver();
+ SdchObserver();
Ryan Sleevi 2014/10/20 22:42:04 STYLE: Why isn't this ctor, dtor, methods?
Randy Smith (Not in Mondays) 2014/10/21 19:05:36 No clue; maybe my fingers slipped? :-}. Fixed.
+
+ private:
+ // Reference count implementation to confirm no reference to
+ // this class is left on the SdchManager after class destruction.
+ friend class SdchManager;
+
+ void AddRef();
+ void RemoveRef();
+
+ int reference_count_;
Ryan Sleevi 2014/10/20 22:42:04 This is all sorts of danger zone for me. I need a
Randy Smith (Not in Mondays) 2014/10/21 19:05:36 See response in SdchManager to the dual of this qu
+};
+
+} // namespace net
+
+#endif // NET_BASE_SDCH_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698