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

Unified Diff: webrtc/base/callback.h

Issue 2976633002: Revert of Remove remains of webrtc/base (patchset #7 id:120001 of https://codereview.webrtc.org/297… (Closed)
Patch Set: Created 3 years, 5 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 | « webrtc/base/byteorder.h ('k') | webrtc/base/checks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/callback.h
diff --git a/webrtc/rtc_base/callback.h.pump b/webrtc/base/callback.h
similarity index 68%
copy from webrtc/rtc_base/callback.h.pump
copy to webrtc/base/callback.h
index cceddf7343adb2efafc74b50487948a6a6b5d49d..4da1e6dfab7e3da099ef6cdd048773b1836099c2 100644
--- a/webrtc/rtc_base/callback.h.pump
+++ b/webrtc/base/callback.h
@@ -1,3 +1,7 @@
+// This file was GENERATED by command:
+// pump.py callback.h.pump
+// DO NOT EDIT BY HAND!!!
+
/*
* Copyright 2012 The WebRTC Project Authors. All rights reserved.
*
@@ -27,7 +31,8 @@
// all platforms we support) and a lightweight alternative to sigslots. Since
// they effectively hide the type of the object they call, they're useful in
// breaking dependencies between objects that need to interact with one another.
-// Notably, they can hold the results of Bind(), std::bind*, etc, without needing
+// Notably, they can hold the results of Bind(), std::bind*, etc, without
+// needing
// to know the resulting object type of those calls.
//
// Sigslots, on the other hand, provide a fuller feature set, such as multiple
@@ -54,50 +59,12 @@
// my_callback = Callback1<int, int>();
// cout << my_callback.empty() << endl; // true
-#ifndef WEBRTC_RTC_BASE_CALLBACK_H_
-#define WEBRTC_RTC_BASE_CALLBACK_H_
-
-#include "webrtc/rtc_base/refcount.h"
-#include "webrtc/rtc_base/scoped_ref_ptr.h"
-
-namespace rtc {
-
-$var n = 5
-$range i 0..n
-$for i [[
-$range j 1..i
-
-template <class R$for j [[,
- class P$j]]>
-class Callback$i {
- public:
- // Default copy operations are appropriate for this class.
- Callback$i() {}
- template <class T> Callback$i(const T& functor)
- : helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
- R operator()($for j , [[P$j p$j]]) {
- if (empty())
- return R();
- return helper_->Run($for j , [[p$j]]);
- }
- bool empty() const { return !helper_; }
+#ifndef WEBRTC_BASE_CALLBACK_H_
+#define WEBRTC_BASE_CALLBACK_H_
- private:
- struct Helper : RefCountInterface {
- virtual ~Helper() {}
- virtual R Run($for j , [[P$j p$j]]) = 0;
- };
- template <class T> struct HelperImpl : Helper {
- explicit HelperImpl(const T& functor) : functor_(functor) {}
- virtual R Run($for j , [[P$j p$j]]) {
- return functor_($for j , [[p$j]]);
- }
- T functor_;
- };
- scoped_refptr<Helper> helper_;
-};
-]]
-} // namespace rtc
+// This header is deprecated and is just left here temporarily during
+// refactoring. See https://bugs.webrtc.org/7634 for more details.
+#include "webrtc/rtc_base/callback.h"
-#endif // WEBRTC_RTC_BASE_CALLBACK_H_
+#endif // WEBRTC_BASE_CALLBACK_H_
« no previous file with comments | « webrtc/base/byteorder.h ('k') | webrtc/base/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698