Don't use LOG() in callback.h
Because chromium is compiled with a different version of logging macros defined in logging.h that header cannot be used in headers that can also included from chromium code. Removed LOG_F(LS_WARNING) from callback.h . That issue would block this code from being rolled in chromium. R=mallinath@webrtc.org Review URL: https://webrtc-codereview.appspot.com/8279004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5507 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -93,10 +93,8 @@ class Callback0 {
|
||||
template <class T> Callback0(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()() {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run();
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -125,10 +123,8 @@ class Callback1 {
|
||||
template <class T> Callback1(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()(P1 p1) {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run(p1);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -158,10 +154,8 @@ class Callback2 {
|
||||
template <class T> Callback2(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()(P1 p1, P2 p2) {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run(p1, p2);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -192,10 +186,8 @@ class Callback3 {
|
||||
template <class T> Callback3(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()(P1 p1, P2 p2, P3 p3) {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run(p1, p2, p3);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -227,10 +219,8 @@ class Callback4 {
|
||||
template <class T> Callback4(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()(P1 p1, P2 p2, P3 p3, P4 p4) {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run(p1, p2, p3, p4);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -263,10 +253,8 @@ class Callback5 {
|
||||
template <class T> Callback5(const T& functor)
|
||||
: helper_(new RefCountedObject< HelperImpl<T> >(functor)) {}
|
||||
R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
|
||||
if (empty()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run(p1, p2, p3, p4, p5);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
@ -287,5 +275,4 @@ class Callback5 {
|
||||
};
|
||||
} // namespace talk_base
|
||||
|
||||
|
||||
#endif // TALK_BASE_CALLBACK_H_
|
||||
|
@ -74,7 +74,6 @@
|
||||
#ifndef TALK_BASE_CALLBACK_H_
|
||||
#define TALK_BASE_CALLBACK_H_
|
||||
|
||||
#include "talk/base/logging.h"
|
||||
#include "talk/base/refcount.h"
|
||||
#include "talk/base/scoped_ref_ptr.h"
|
||||
|
||||
@ -94,10 +93,8 @@ 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()) {
|
||||
LOG_F(LS_WARNING) << "Tried to execute an empty callback.";
|
||||
if (empty())
|
||||
return R();
|
||||
}
|
||||
return helper_->Run($for j , [[p$j]]);
|
||||
}
|
||||
bool empty() const { return !helper_; }
|
||||
|
Reference in New Issue
Block a user