зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1048252 - Fix some bad implicit constructors in chromium IPC code; r=bent
This commit is contained in:
Родитель
3a6aef3468
Коммит
13da4e4c33
|
@ -458,7 +458,7 @@ public:
|
|||
//
|
||||
class MessageLoopForUI : public MessageLoop {
|
||||
public:
|
||||
MessageLoopForUI(Type type=TYPE_UI) : MessageLoop(type) {
|
||||
explicit MessageLoopForUI(Type type=TYPE_UI) : MessageLoop(type) {
|
||||
}
|
||||
|
||||
// Returns the MessageLoopForUI of the current thread.
|
||||
|
|
|
@ -77,7 +77,7 @@ class ObserverList {
|
|||
};
|
||||
|
||||
ObserverList() : notify_depth_(0), type_(NOTIFY_ALL) {}
|
||||
ObserverList(NotificationType type) : notify_depth_(0), type_(type) {}
|
||||
explicit ObserverList(NotificationType type) : notify_depth_(0), type_(type) {}
|
||||
~ObserverList() {
|
||||
// When check_empty is true, assert that the list is empty on destruction.
|
||||
if (check_empty) {
|
||||
|
@ -118,7 +118,7 @@ class ObserverList {
|
|||
// also the FOREACH_OBSERVER macro defined below.
|
||||
class Iterator {
|
||||
public:
|
||||
Iterator(const ObserverList<ObserverType>& list)
|
||||
explicit Iterator(const ObserverList<ObserverType>& list)
|
||||
: list_(list),
|
||||
index_(0),
|
||||
max_index_(list.type_ == NOTIFY_ALL ?
|
||||
|
|
|
@ -120,7 +120,7 @@ template<typename T>
|
|||
class RefCountedData : public base::RefCounted< base::RefCountedData<T> > {
|
||||
public:
|
||||
RefCountedData() : data() {}
|
||||
RefCountedData(const T& in_value) : data(in_value) {}
|
||||
explicit RefCountedData(const T& in_value) : data(in_value) {}
|
||||
|
||||
T data;
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ class scoped_refptr {
|
|||
scoped_refptr() : ptr_(NULL) {
|
||||
}
|
||||
|
||||
scoped_refptr(T* p) : ptr_(p) {
|
||||
MOZ_IMPLICIT scoped_refptr(T* p) : ptr_(p) {
|
||||
if (ptr_)
|
||||
ptr_->AddRef();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class RevocableStore {
|
|||
// require the store.
|
||||
class StoreRef : public base::RefCounted<StoreRef> {
|
||||
public:
|
||||
StoreRef(RevocableStore* store) : store_(store) { }
|
||||
explicit StoreRef(RevocableStore* store) : store_(store) { }
|
||||
|
||||
void set_store(RevocableStore* store) { store_ = store; }
|
||||
RevocableStore* store() const { return store_; }
|
||||
|
@ -32,7 +32,7 @@ class RevocableStore {
|
|||
// store.
|
||||
class Revocable {
|
||||
public:
|
||||
Revocable(RevocableStore* store);
|
||||
explicit Revocable(RevocableStore* store);
|
||||
~Revocable();
|
||||
|
||||
// This item has been revoked if it no longer has a pointer to the store.
|
||||
|
|
|
@ -37,9 +37,9 @@ class StringPiece {
|
|||
// in a "const char*" or a "string" wherever a "StringPiece" is
|
||||
// expected.
|
||||
StringPiece() : ptr_(NULL), length_(0) { }
|
||||
StringPiece(const char* str)
|
||||
MOZ_IMPLICIT StringPiece(const char* str)
|
||||
: ptr_(str), length_((str == NULL) ? 0 : strlen(str)) { }
|
||||
StringPiece(const std::string& str)
|
||||
MOZ_IMPLICIT StringPiece(const std::string& str)
|
||||
: ptr_(str.data()), length_(str.size()) { }
|
||||
StringPiece(const char* offset, size_type len)
|
||||
: ptr_(offset), length_(len) { }
|
||||
|
|
|
@ -142,7 +142,7 @@ struct DCheckAsserter : public AsserterBase {
|
|||
class ThreadCollisionWarner {
|
||||
public:
|
||||
// The parameter asserter is there only for test purpose
|
||||
ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
|
||||
explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter())
|
||||
: valid_thread_id_(0),
|
||||
counter_(0),
|
||||
asserter_(asserter) {}
|
||||
|
|
|
@ -51,7 +51,7 @@ int64_t TimeDelta::InMicroseconds() const {
|
|||
Time Time::FromTimeT(time_t tt) {
|
||||
if (tt == 0)
|
||||
return Time(); // Preserve 0 so we can tell it doesn't exist.
|
||||
return (tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset;
|
||||
return Time((tt * kMicrosecondsPerSecond) + kTimeTToMicrosecondsOffset);
|
||||
}
|
||||
|
||||
time_t Time::ToTimeT() const {
|
||||
|
@ -62,8 +62,8 @@ time_t Time::ToTimeT() const {
|
|||
|
||||
// static
|
||||
Time Time::FromDoubleT(double dt) {
|
||||
return (dt * static_cast<double>(kMicrosecondsPerSecond)) +
|
||||
kTimeTToMicrosecondsOffset;
|
||||
return Time((dt * static_cast<double>(kMicrosecondsPerSecond)) +
|
||||
kTimeTToMicrosecondsOffset);
|
||||
}
|
||||
|
||||
double Time::ToDoubleT() const {
|
||||
|
|
|
@ -297,10 +297,10 @@ class Time {
|
|||
|
||||
// Return a new time modified by some delta.
|
||||
Time operator+(TimeDelta delta) const {
|
||||
return us_ + delta.delta_;
|
||||
return Time(us_ + delta.delta_);
|
||||
}
|
||||
Time operator-(TimeDelta delta) const {
|
||||
return us_ - delta.delta_;
|
||||
return Time(us_ - delta.delta_);
|
||||
}
|
||||
|
||||
// Comparison operators
|
||||
|
@ -334,7 +334,7 @@ class Time {
|
|||
// |is_local = true| or UTC |is_local = false|.
|
||||
static Time FromExploded(bool is_local, const Exploded& exploded);
|
||||
|
||||
Time(int64_t us) : us_(us) {
|
||||
explicit Time(int64_t us) : us_(us) {
|
||||
}
|
||||
|
||||
// The representation of Jan 1, 1970 UTC in microseconds since the
|
||||
|
|
|
@ -85,7 +85,7 @@ class BaseTimer_Helper {
|
|||
// We have access to the timer_ member so we can orphan this task.
|
||||
class TimerTask : public Task {
|
||||
public:
|
||||
TimerTask(TimeDelta delay) : delay_(delay) {
|
||||
explicit TimerTask(TimeDelta delay) : delay_(delay) {
|
||||
// timer_ is set in InitiateDelayedTask.
|
||||
}
|
||||
virtual ~TimerTask() {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче