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

Unified Diff: third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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: third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
diff --git a/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h b/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
index d9c9cc2e0a8b29e5fc31559eaa63f40295a0446f..c7814bd8851a0ee968069c37f57eb97dede51c32 100644
--- a/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
+++ b/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
@@ -39,61 +39,48 @@
namespace WTF {
class WTF_EXPORT ThreadSafeRefCountedBase {
- WTF_MAKE_NONCOPYABLE(ThreadSafeRefCountedBase);
- USING_FAST_MALLOC(ThreadSafeRefCountedBase);
-public:
- ThreadSafeRefCountedBase(int initialRefCount = 1)
- : m_refCount(initialRefCount)
- {
- }
+ WTF_MAKE_NONCOPYABLE(ThreadSafeRefCountedBase);
+ USING_FAST_MALLOC(ThreadSafeRefCountedBase);
- void ref()
- {
- atomicIncrement(&m_refCount);
- }
+ public:
+ ThreadSafeRefCountedBase(int initialRefCount = 1)
+ : m_refCount(initialRefCount) {}
- bool hasOneRef()
- {
- return refCount() == 1;
- }
+ void ref() { atomicIncrement(&m_refCount); }
- int refCount() const
- {
- return static_cast<int const volatile &>(m_refCount);
- }
+ bool hasOneRef() { return refCount() == 1; }
-protected:
- // Returns whether the pointer should be freed or not.
- bool derefBase()
- {
- WTF_ANNOTATE_HAPPENS_BEFORE(&m_refCount);
- if (atomicDecrement(&m_refCount) <= 0) {
- WTF_ANNOTATE_HAPPENS_AFTER(&m_refCount);
- return true;
- }
- return false;
+ int refCount() const { return static_cast<int const volatile&>(m_refCount); }
+
+ protected:
+ // Returns whether the pointer should be freed or not.
+ bool derefBase() {
+ WTF_ANNOTATE_HAPPENS_BEFORE(&m_refCount);
+ if (atomicDecrement(&m_refCount) <= 0) {
+ WTF_ANNOTATE_HAPPENS_AFTER(&m_refCount);
+ return true;
}
+ return false;
+ }
-private:
- int m_refCount;
+ private:
+ int m_refCount;
};
-template<class T> class ThreadSafeRefCounted : public ThreadSafeRefCountedBase {
-public:
- void deref()
- {
- if (derefBase())
- delete static_cast<T*>(this);
- }
+template <class T>
+class ThreadSafeRefCounted : public ThreadSafeRefCountedBase {
+ public:
+ void deref() {
+ if (derefBase())
+ delete static_cast<T*>(this);
+ }
-protected:
- ThreadSafeRefCounted()
- {
- }
+ protected:
+ ThreadSafeRefCounted() {}
};
-} // namespace WTF
+} // namespace WTF
using WTF::ThreadSafeRefCounted;
-#endif // ThreadSafeRefCounted_h
+#endif // ThreadSafeRefCounted_h
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h ('k') | third_party/WebKit/Source/wtf/ThreadSpecific.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698