author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Sun, 18 Jun 2017 20:35:11 +0200 | |
changeset 364569 | 95543bdc59bd038a3d5d084b85a4fec493c349ee |
parent 364568 | ae20db43e8157d48d2e8376eddaabadfdcdd041c (current diff) |
parent 364542 | 8c7dd6a9e9354565c209f77ec9720b76eae334b2 (diff) |
child 364570 | e79c16c97d47e3d87b7d317708c716d63a59dcba |
child 364598 | 35bc216e83145c998ea604b198f5443fe0fe0ca9 |
push id | 91573 |
push user | archaeopteryx@coole-files.de |
push date | Sun, 18 Jun 2017 18:51:59 +0000 |
treeherder | mozilla-inbound@e79c16c97d47 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | merge, merge |
milestone | 56.0a1 |
first release with | nightly linux32
95543bdc59bd
/
56.0a1
/
20170619100247
/
files
nightly linux64
95543bdc59bd
/
56.0a1
/
20170619100247
/
files
nightly mac
95543bdc59bd
/
56.0a1
/
20170619030208
/
files
nightly win32
95543bdc59bd
/
56.0a1
/
20170619030208
/
files
nightly win64
95543bdc59bd
/
56.0a1
/
20170619030208
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
56.0a1
/
20170619100247
/
pushlog to previous
nightly linux64
56.0a1
/
20170619100247
/
pushlog to previous
nightly mac
56.0a1
/
20170619030208
/
pushlog to previous
nightly win32
56.0a1
/
20170619030208
/
pushlog to previous
nightly win64
56.0a1
/
20170619030208
/
pushlog to previous
|
--- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -890,38 +890,16 @@ public: bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override { mFetchBody->ContinueConsumeBlobBody(mBlobImpl); return true; } }; -// OnStreamComplete always adopts the buffer, utility class to release it in -// a couple of places. -class MOZ_STACK_CLASS AutoFreeBuffer final { - uint8_t* mBuffer; - -public: - explicit AutoFreeBuffer(uint8_t* aBuffer) - : mBuffer(aBuffer) - {} - - ~AutoFreeBuffer() - { - free(mBuffer); - } - - void - Reset() - { - mBuffer= nullptr; - } -}; - template <class Derived> class FailConsumeBodyWorkerRunnable : public MainThreadWorkerControlRunnable { FetchBody<Derived>* mBody; public: explicit FailConsumeBodyWorkerRunnable(FetchBody<Derived>* aBody) : MainThreadWorkerControlRunnable(aBody->mWorkerPrivate) , mBody(aBody) @@ -1350,17 +1328,19 @@ FetchBody<Derived>::ContinueConsumeBody( // sync with a body read. MOZ_ASSERT(mBodyUsed); MOZ_ASSERT(!mReadDone); MOZ_ASSERT_IF(mWorkerPrivate, mWorkerHolder); #ifdef DEBUG mReadDone = true; #endif - AutoFreeBuffer autoFree(aResult); + auto autoFree = mozilla::MakeScopeExit([&] { + free(aResult); + }); MOZ_ASSERT(mConsumePromise); RefPtr<Promise> localPromise = mConsumePromise.forget(); RefPtr<Derived> derivedClass = DerivedClass(); ReleaseObject(); if (NS_WARN_IF(NS_FAILED(aStatus))) { @@ -1424,28 +1404,28 @@ FetchBody<Derived>::ContinueConsumeBody( error); if (!error.Failed()) { JS::Rooted<JS::Value> val(cx); val.setObjectOrNull(arrayBuffer); localPromise->MaybeResolve(cx, val); // ArrayBuffer takes over ownership. - autoFree.Reset(); + autoFree.release(); } break; } case CONSUME_BLOB: { MOZ_CRASH("This should not happen."); break; } case CONSUME_FORMDATA: { nsCString data; data.Adopt(reinterpret_cast<char*>(aResult), aResultLength); - autoFree.Reset(); + autoFree.release(); RefPtr<dom::FormData> fd = BodyUtil::ConsumeFormData( derivedClass->GetParentObject(), mMimeType, data, error); if (!error.Failed()) { localPromise->MaybeResolve(fd); } break;
--- a/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp +++ b/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp @@ -44,17 +44,17 @@ WebRenderPaintedLayerBlob::RenderLayer(w if (!regionToPaint.IsEmpty() && !WrManager()->GetPaintedLayerCallback()) { WrManager()->SetTransactionIncomplete(); return; } IntSize imageSize(size.ToUnknownSize()); if (!regionToPaint.IsEmpty() && WrManager()->GetPaintedLayerCallback()) { RefPtr<gfx::DrawEventRecorderMemory> recorder = MakeAndAddRef<gfx::DrawEventRecorderMemory>(); - RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget(gfx::BackendType::SKIA, imageSize, gfx::SurfaceFormat::B8G8R8X8); + RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget(gfx::BackendType::SKIA, IntSize(1, 1), gfx::SurfaceFormat::B8G8R8X8); RefPtr<gfx::DrawTarget> dt = gfx::Factory::CreateRecordingDrawTarget(recorder, dummyDt, imageSize); dt->ClearRect(Rect(0, 0, imageSize.width, imageSize.height)); dt->SetTransform(Matrix().PreTranslate(-bounds.x, -bounds.y)); RefPtr<gfxContext> ctx = gfxContext::CreatePreservingTransformOrNull(dt); MOZ_ASSERT(ctx); // already checked the target above WrManager()->GetPaintedLayerCallback()(this,
--- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -72,26 +72,22 @@ NativeIterator::trace(JSTracer* trc) typedef HashSet<jsid, DefaultHasher<jsid>> IdSet; static inline bool NewKeyValuePair(JSContext* cx, jsid id, const Value& val, MutableHandleValue rval) { return NewValuePair(cx, IdToValue(id), val, rval); } +template <bool CheckForDuplicates> static inline bool Enumerate(JSContext* cx, HandleObject pobj, jsid id, bool enumerable, unsigned flags, Maybe<IdSet>& ht, AutoIdVector* props) { - // Allow duplicate properties from Proxy's [[OwnPropertyKeys]]. - bool proxyOwnProperty = pobj->is<ProxyObject>() && (flags & JSITER_OWNONLY); - - if (!proxyOwnProperty && (!(flags & JSITER_OWNONLY) || pobj->is<ProxyObject>() || - pobj->getClass()->getNewEnumerate())) - { + if (CheckForDuplicates) { if (!ht) { ht.emplace(cx); // Most of the time there are only a handful of entries. if (!ht->init(5)) return false; } // If we've already seen this, we definitely won't add it. @@ -106,27 +102,29 @@ Enumerate(JSContext* cx, HandleObject po pobj->staticPrototype() || pobj->getClass()->getNewEnumerate()) { if (!ht->add(p, id)) return false; } } + if (!enumerable && !(flags & JSITER_HIDDEN)) + return true; + // Symbol-keyed properties and nonenumerable properties are skipped unless // the caller specifically asks for them. A caller can also filter out // non-symbols by asking for JSITER_SYMBOLSONLY. if (JSID_IS_SYMBOL(id) ? !(flags & JSITER_SYMBOLS) : (flags & JSITER_SYMBOLSONLY)) return true; - if (!enumerable && !(flags & JSITER_HIDDEN)) - return true; return props->append(id); } +template <bool CheckForDuplicates> static bool EnumerateExtraProperties(JSContext* cx, HandleObject obj, unsigned flags, Maybe<IdSet>& ht, AutoIdVector* props) { MOZ_ASSERT(obj->getClass()->getNewEnumerate()); AutoIdVector properties(cx); bool enumerableOnly = !(flags & JSITER_HIDDEN); @@ -137,33 +135,34 @@ EnumerateExtraProperties(JSContext* cx, for (size_t n = 0; n < properties.length(); n++) { id = properties[n]; // The enumerate hook does not indicate whether the properties // it returns are enumerable or not. Since we already passed // `enumerableOnly` to the hook to filter out non-enumerable // properties, it doesn't really matter what we pass here. bool enumerable = true; - if (!Enumerate(cx, obj, id, enumerable, flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, obj, id, enumerable, flags, ht, props)) return false; } return true; } static bool SortComparatorIntegerIds(jsid a, jsid b, bool* lessOrEqualp) { uint32_t indexA, indexB; MOZ_ALWAYS_TRUE(IdIsIndex(a, &indexA)); MOZ_ALWAYS_TRUE(IdIsIndex(b, &indexB)); *lessOrEqualp = (indexA <= indexB); return true; } +template <bool CheckForDuplicates> static bool EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags, Maybe<IdSet>& ht, AutoIdVector* props, Handle<UnboxedPlainObject*> unboxed = nullptr) { bool enumerateSymbols; if (flags & JSITER_SYMBOLSONLY) { enumerateSymbols = true; } else { @@ -172,45 +171,54 @@ EnumerateNativeProperties(JSContext* cx, size_t initlen = pobj->getDenseInitializedLength(); const Value* vp = pobj->getDenseElements(); bool hasHoles = false; for (size_t i = 0; i < initlen; ++i, ++vp) { if (vp->isMagic(JS_ELEMENTS_HOLE)) { hasHoles = true; } else { /* Dense arrays never get so large that i would not fit into an integer id. */ - if (!Enumerate(cx, pobj, INT_TO_JSID(i), /* enumerable = */ true, flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i), + /* enumerable = */ true, flags, ht, props)) + { return false; + } } } /* Collect any typed array or shared typed array elements from this object. */ if (pobj->is<TypedArrayObject>()) { size_t len = pobj->as<TypedArrayObject>().length(); for (size_t i = 0; i < len; i++) { - if (!Enumerate(cx, pobj, INT_TO_JSID(i), /* enumerable = */ true, flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i), + /* enumerable = */ true, flags, ht, props)) + { return false; + } } } // Collect any sparse elements from this object. bool isIndexed = pobj->isIndexed(); if (isIndexed) { // If the dense elements didn't have holes, we don't need to include // them in the sort. if (!hasHoles) firstElemIndex = props->length(); for (Shape::Range<NoGC> r(pobj->lastProperty()); !r.empty(); r.popFront()) { Shape& shape = r.front(); jsid id = shape.propid(); uint32_t dummy; if (IdIsIndex(id, &dummy)) { - if (!Enumerate(cx, pobj, id, shape.enumerable(), flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, pobj, id, shape.enumerable(), flags, ht, + props)) + { return false; + } } } MOZ_ASSERT(firstElemIndex <= props->length()); jsid* ids = props->begin() + firstElemIndex; size_t n = props->length() - firstElemIndex; @@ -224,17 +232,17 @@ EnumerateNativeProperties(JSContext* cx, } if (unboxed) { // If |unboxed| is set then |pobj| is the expando for an unboxed // plain object we are enumerating. Add the unboxed properties // themselves here since they are all property names that were // given to the object before any of the expando's properties. MOZ_ASSERT(pobj->is<UnboxedExpandoObject>()); - if (!EnumerateExtraProperties(cx, unboxed, flags, ht, props)) + if (!EnumerateExtraProperties<CheckForDuplicates>(cx, unboxed, flags, ht, props)) return false; } size_t initialLength = props->length(); /* Collect all unique property names from this object's shape. */ bool symbolsFound = false; Shape::Range<NoGC> r(pobj->lastProperty()); @@ -246,43 +254,105 @@ EnumerateNativeProperties(JSContext* cx, symbolsFound = true; continue; } uint32_t dummy; if (isIndexed && IdIsIndex(id, &dummy)) continue; - if (!Enumerate(cx, pobj, id, shape.enumerable(), flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, pobj, id, shape.enumerable(), flags, ht, props)) return false; } ::Reverse(props->begin() + initialLength, props->end()); enumerateSymbols = symbolsFound && (flags & JSITER_SYMBOLS); } if (enumerateSymbols) { // Do a second pass to collect symbols. ES6 draft rev 25 (2014 May 22) // 9.1.12 requires that all symbols appear after all strings in the // result. size_t initialLength = props->length(); for (Shape::Range<NoGC> r(pobj->lastProperty()); !r.empty(); r.popFront()) { Shape& shape = r.front(); jsid id = shape.propid(); if (JSID_IS_SYMBOL(id)) { - if (!Enumerate(cx, pobj, id, shape.enumerable(), flags, ht, props)) + if (!Enumerate<CheckForDuplicates>(cx, pobj, id, shape.enumerable(), flags, ht, + props)) + { return false; + } } } ::Reverse(props->begin() + initialLength, props->end()); } return true; } +static bool +EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags, Maybe<IdSet>& ht, + AutoIdVector* props, bool checkForDuplicates, + Handle<UnboxedPlainObject*> unboxed = nullptr) +{ + if (checkForDuplicates) + return EnumerateNativeProperties<true>(cx, pobj, flags, ht, props, unboxed); + return EnumerateNativeProperties<false>(cx, pobj, flags, ht, props, unboxed); +} + +template <bool CheckForDuplicates> +static bool +EnumerateProxyProperties(JSContext* cx, HandleObject pobj, unsigned flags, Maybe<IdSet>& ht, + AutoIdVector* props) +{ + MOZ_ASSERT(pobj->is<ProxyObject>()); + + AutoIdVector proxyProps(cx); + + if (flags & JSITER_HIDDEN || flags & JSITER_SYMBOLS) { + // This gets all property keys, both strings and symbols. The call to + // Enumerate in the loop below will filter out unwanted keys, per the + // flags. + if (!Proxy::ownPropertyKeys(cx, pobj, proxyProps)) + return false; + + Rooted<PropertyDescriptor> desc(cx); + for (size_t n = 0, len = proxyProps.length(); n < len; n++) { + bool enumerable = false; + + // We need to filter, if the caller just wants enumerable symbols. + if (!(flags & JSITER_HIDDEN)) { + if (!Proxy::getOwnPropertyDescriptor(cx, pobj, proxyProps[n], &desc)) + return false; + enumerable = desc.enumerable(); + } + + if (!Enumerate<CheckForDuplicates>(cx, pobj, proxyProps[n], enumerable, flags, ht, + props)) + { + return false; + } + } + + return true; + } + + // Returns enumerable property names (no symbols). + if (!Proxy::getOwnEnumerablePropertyKeys(cx, pobj, proxyProps)) + return false; + + for (size_t n = 0, len = proxyProps.length(); n < len; n++) { + if (!Enumerate<CheckForDuplicates>(cx, pobj, proxyProps[n], true, flags, ht, props)) + return false; + } + + return true; +} + #ifdef JS_MORE_DETERMINISTIC struct SortComparatorIds { JSContext* const cx; SortComparatorIds(JSContext* cx) : cx(cx) {} @@ -351,76 +421,76 @@ struct SortComparatorIds static bool Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags, AutoIdVector* props) { // We initialize |ht| lazily (in Enumerate()) because it ends up unused // anywhere from 67--99.9% of the time. Maybe<IdSet> ht; RootedObject pobj(cx, pobj_); + // Don't check for duplicates if we're only interested in own properties. + // This does the right thing for most objects: native objects don't have + // duplicate property ids and we allow the [[OwnPropertyKeys]] proxy trap to + // return duplicates. + // + // The only special case is when the object has a newEnumerate hook: it + // can return duplicate properties and we have to filter them. This is + // handled below. + bool checkForDuplicates = !(flags & JSITER_OWNONLY); + do { if (pobj->getClass()->getNewEnumerate()) { if (pobj->is<UnboxedPlainObject>() && pobj->as<UnboxedPlainObject>().maybeExpando()) { // Special case unboxed objects with an expando object. RootedNativeObject expando(cx, pobj->as<UnboxedPlainObject>().maybeExpando()); - if (!EnumerateNativeProperties(cx, expando, flags, ht, props, + if (!EnumerateNativeProperties(cx, expando, flags, ht, props, checkForDuplicates, pobj.as<UnboxedPlainObject>())) { return false; } } else { - if (!EnumerateExtraProperties(cx, pobj, flags, ht, props)) - return false; + // The newEnumerate hook may return duplicates. Whitelist the + // unboxed object hooks because we know they are well-behaved. + if (!pobj->is<UnboxedPlainObject>() && !pobj->is<UnboxedArrayObject>()) + checkForDuplicates = true; + + if (checkForDuplicates) { + if (!EnumerateExtraProperties<true>(cx, pobj, flags, ht, props)) + return false; + } else { + if (!EnumerateExtraProperties<false>(cx, pobj, flags, ht, props)) + return false; + } if (pobj->isNative()) { - if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props)) + if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props, + checkForDuplicates)) + { return false; + } } } } else if (pobj->isNative()) { // Give the object a chance to resolve all lazy properties if (JSEnumerateOp enumerate = pobj->getClass()->getEnumerate()) { if (!enumerate(cx, pobj.as<NativeObject>())) return false; } - if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props)) + if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props, + checkForDuplicates)) + { return false; + } } else if (pobj->is<ProxyObject>()) { - AutoIdVector proxyProps(cx); - if (flags & JSITER_HIDDEN || flags & JSITER_SYMBOLS) { - // This gets all property keys, both strings and - // symbols. The call to Enumerate in the loop below - // will filter out unwanted keys, per the flags. - if (!Proxy::ownPropertyKeys(cx, pobj, proxyProps)) + if (checkForDuplicates) { + if (!EnumerateProxyProperties<true>(cx, pobj, flags, ht, props)) return false; - - Rooted<PropertyDescriptor> desc(cx); - for (size_t n = 0, len = proxyProps.length(); n < len; n++) { - bool enumerable = false; - - // We need to filter, if the caller just wants enumerable - // symbols. - if (!(flags & JSITER_HIDDEN)) { - if (!Proxy::getOwnPropertyDescriptor(cx, pobj, proxyProps[n], &desc)) - return false; - enumerable = desc.enumerable(); - } - - if (!Enumerate(cx, pobj, proxyProps[n], enumerable, flags, ht, props)) - return false; - } } else { - // Returns enumerable property names (no symbols). - if (!Proxy::getOwnEnumerablePropertyKeys(cx, pobj, proxyProps)) + if (!EnumerateProxyProperties<false>(cx, pobj, flags, ht, props)) return false; - - for (size_t n = 0, len = proxyProps.length(); n < len; n++) { - if (!Enumerate(cx, pobj, proxyProps[n], true, flags, ht, props)) - return false; - } } } else { MOZ_CRASH("non-native objects must have an enumerate op"); } if (flags & JSITER_OWNONLY) break;
--- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -666,16 +666,17 @@ void nsCaret::ResetBlinking() } } void nsCaret::StopBlinking() { if (mBlinkTimer) { mBlinkTimer->Cancel(); + mBlinkRate = 0; } } nsresult nsCaret::GetCaretFrameForNodeOffset(nsFrameSelection* aFrameSelection, nsIContent* aContentNode, int32_t aOffset, CaretAssociationHint aFrameHint,
--- a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc @@ -36,24 +36,24 @@ extern "C" static_cast<webrtc::AudioDeviceSndio *>(arg)->_recDelay += delta; } } namespace webrtc { AudioDeviceSndio::AudioDeviceSndio(const int32_t id) : _ptrAudioBuffer(NULL), + _playHandle(NULL), + _recHandle(NULL), _critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id), _recordingBuffer(NULL), _playoutBuffer(NULL), _playBufType(AudioDeviceModule::kFixedBufferSize), _initialized(false), - _playHandle(NULL), - _recHandle(NULL), _recording(false), _playing(false), _AGC(false), _playWarning(0), _playError(0), _recWarning(0), _recError(0), _playBufDelay(80), @@ -102,29 +102,29 @@ void AudioDeviceSndio::AttachAudioBuffer int32_t AudioDeviceSndio::ActiveAudioLayer( AudioDeviceModule::AudioLayer& audioLayer) const { audioLayer = AudioDeviceModule::kSndioAudio; return 0; } -int32_t AudioDeviceSndio::Init() +AudioDeviceGeneric::InitStatus AudioDeviceSndio::Init() { CriticalSectionScoped lock(&_critSect); if (_initialized) { - return 0; + return InitStatus::OK; } _playError = 0; _recError = 0; _initialized = true; - return 0; + return InitStatus::OK; } int32_t AudioDeviceSndio::Terminate() { if (!_initialized) { return 0; } @@ -681,18 +681,16 @@ int32_t AudioDeviceSndio::InitRecording( _recDelay = 0; sio_onmove(_recHandle, recOnmove, this); return 0; } int32_t AudioDeviceSndio::StartRecording() { - const char* threadName = "webrtc_audio_module_capture_thread"; - if (_recHandle == NULL) { return -1; } if (_recording) { return 0; @@ -768,18 +766,16 @@ bool AudioDeviceSndio::Recording() const bool AudioDeviceSndio::PlayoutIsInitialized() const { return (_playHandle != NULL); } int32_t AudioDeviceSndio::StartPlayout() { - const char* threadName = "webrtc_audio_module_play_thread"; - if (_playHandle == NULL) { return -1; } if (_playing) { return 0;
--- a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h @@ -6,16 +6,18 @@ * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_SNDIO_H #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_SNDIO_H +#include <memory> + #include <sndio.h> #include "webrtc/modules/audio_device/audio_device_generic.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" #include "webrtc/base/platform_thread.h" namespace webrtc { @@ -25,17 +27,17 @@ public: AudioDeviceSndio(const int32_t id); virtual ~AudioDeviceSndio(); // Retrieve the currently utilized audio layer virtual int32_t ActiveAudioLayer( AudioDeviceModule::AudioLayer& audioLayer) const override; // Main initializaton and termination - virtual int32_t Init() override; + virtual InitStatus Init() override; virtual int32_t Terminate() override; virtual bool Initialized() const override; // Device enumeration virtual int16_t PlayoutDevices() override; virtual int16_t RecordingDevices() override; virtual int32_t PlayoutDeviceName( uint16_t index, @@ -164,18 +166,18 @@ private: AudioDeviceBuffer* _ptrAudioBuffer; struct sio_hdl* _playHandle; struct sio_hdl* _recHandle; struct sio_par _playParams, _recParams; CriticalSectionWrapper& _critSect; - rtc::scoped_refptr<rtc::PlatformThread> _ptrThreadRec; - rtc::scoped_refptr<rtc::PlatformThread> _ptrThreadPlay; + std::unique_ptr<rtc::PlatformThread> _ptrThreadRec; + std::unique_ptr<rtc::PlatformThread> _ptrThreadPlay; int32_t _id; int8_t* _recordingBuffer; int8_t* _playoutBuffer; uint8_t _recChannels; uint8_t _playChannels;
--- a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc @@ -11,43 +11,42 @@ #include "webrtc/system_wrappers/include/cpu_info.h" #if defined(WEBRTC_WIN) #include <winsock2.h> #include <windows.h> #ifndef EXCLUDE_D3D9 #include <d3d9.h> #endif -#elif defined(WEBRTC_LINUX) +#elif defined(WEBRTC_MAC) +#include <sys/sysctl.h> +#else // WEBRTC_POSIX #include <unistd.h> #endif -#if defined(WEBRTC_MAC) -#include <sys/sysctl.h> -#endif #include "webrtc/base/logging.h" namespace internal { static int DetectNumberOfCores() { // We fall back on assuming a single core in case of errors. int number_of_cores = 1; #if defined(WEBRTC_WIN) SYSTEM_INFO si; GetSystemInfo(&si); number_of_cores = static_cast<int>(si.dwNumberOfProcessors); -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) - number_of_cores = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN)); #elif defined(WEBRTC_MAC) int name[] = {CTL_HW, HW_AVAILCPU}; size_t size = sizeof(number_of_cores); if (0 != sysctl(name, 2, &number_of_cores, &size, NULL, 0)) { LOG(LS_ERROR) << "Failed to get number of cores"; number_of_cores = 1; } +#elif defined(_SC_NPROCESSORS_ONLN) + number_of_cores = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN)); #else LOG(LS_ERROR) << "No function to get number of cores"; #endif LOG(LS_INFO) << "Available number of cores: " << number_of_cores; return number_of_cores; }