Index: net/base/sdch_observer.cc |
diff --git a/net/base/sdch_observer.cc b/net/base/sdch_observer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..671fae6b7552514792b35092ebe6fae9a65daa44 |
--- /dev/null |
+++ b/net/base/sdch_observer.cc |
@@ -0,0 +1,30 @@ |
+// 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 "net/base/sdch_observer.h" |
+ |
+#include "base/logging.h" |
+ |
+namespace net { |
+ |
+SdchObserver::SdchObserver() : reference_count_(0) {} |
+ |
+// Null implementations to allow subclasses to received just notifications |
+// that they are interested in. |
Ryan Sleevi
2014/10/20 22:42:04
I'd rather be explicit and force classes to consum
Randy Smith (Not in Mondays)
2014/10/21 19:05:36
Define "our"? This pattern is all through the con
Ryan Sleevi
2014/10/21 23:09:29
See http://google-styleguide.googlecode.com/svn/tr
Randy Smith (Not in Mondays)
2014/10/23 20:57:07
Done.
|
+void SdchObserver::OnGetDictionary(SdchManager* manager, |
+ const GURL& request_url, |
+ const GURL& dictionary_url) { } |
+void SdchObserver::OnClearDictionaries(SdchManager* manager) {} |
+ |
+void SdchObserver::AddRef() { ++reference_count_; } |
+ |
+void SdchObserver::RemoveRef() { --reference_count_; } |
+ |
+SdchObserver::~SdchObserver() { |
+ // If the reference count is zero, this object is still on an SdchManager's |
+ // observer list, and so is dangerous to delete. |
+ DCHECK_EQ(0, reference_count_); |
+} |
+ |
+} |