Merge "Remove RefBase.h dependency on TextOutput.h"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7f97c4ef12
@ -18,7 +18,6 @@
|
||||
#define ANDROID_REF_BASE_H
|
||||
|
||||
#include <cutils/atomic.h>
|
||||
#include <utils/TextOutput.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
@ -27,6 +26,10 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
namespace android {
|
||||
|
||||
class TextOutput;
|
||||
TextOutput& printStrongPointer(TextOutput& to, const void* val);
|
||||
TextOutput& printWeakPointer(TextOutput& to, const void* val);
|
||||
|
||||
template<typename T> class wp;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -427,8 +430,7 @@ sp<T>::sp(T* p, weakref_type* refs)
|
||||
template <typename T>
|
||||
inline TextOutput& operator<<(TextOutput& to, const sp<T>& val)
|
||||
{
|
||||
to << "sp<>(" << val.get() << ")";
|
||||
return to;
|
||||
return printStrongPointer(to, val.get());
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -585,8 +587,7 @@ void wp<T>::clear()
|
||||
template <typename T>
|
||||
inline TextOutput& operator<<(TextOutput& to, const wp<T>& val)
|
||||
{
|
||||
to << "wp<>(" << val.unsafe_get() << ")";
|
||||
return to;
|
||||
return printWeakPointer(to, val.unsafe_get());
|
||||
}
|
||||
|
||||
}; // namespace android
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/Log.h>
|
||||
#include <utils/threads.h>
|
||||
#include <utils/TextOutput.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@ -530,5 +531,20 @@ bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
|
||||
void RefBase::onLastWeakRef(const void* /*id*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
TextOutput& printStrongPointer(TextOutput& to, const void* val)
|
||||
{
|
||||
to << "sp<>(" << val << ")";
|
||||
return to;
|
||||
}
|
||||
|
||||
TextOutput& printWeakPointer(TextOutput& to, const void* val)
|
||||
{
|
||||
to << "wp<>(" << val << ")";
|
||||
return to;
|
||||
}
|
||||
|
||||
|
||||
}; // namespace android
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#define AMR_EXTRACTOR_H_
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <media/stagefright/MediaExtractor.h>
|
||||
|
||||
namespace android {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#define MP3_EXTRACTOR_H_
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <media/stagefright/MediaExtractor.h>
|
||||
|
||||
namespace android {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#define OGG_EXTRACTOR_H_
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <media/stagefright/MediaExtractor.h>
|
||||
|
||||
namespace android {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#define WAV_EXTRACTOR_H_
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <media/stagefright/MediaExtractor.h>
|
||||
|
||||
namespace android {
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define AVC_UTILS_H_
|
||||
|
||||
#include <media/stagefright/foundation/ABuffer.h>
|
||||
#include <utils/Errors.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define ES_QUEUE_H_
|
||||
|
||||
#include <media/stagefright/foundation/ABase.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/List.h>
|
||||
#include <utils/RefBase.h>
|
||||
|
||||
|
Reference in New Issue
Block a user