/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// We can't reuse the definition in the `MediaEngineUtils.h` due to the // restriction of not being able to use XPCOM string in the external library. #ifndef RETURN_IF_FAILED # define RETURN_IF_FAILED(x) \ do { \
HRESULT rv = x; \ if (FAILED(rv)) { \
LOG("("#x") failed, rv=%lx", rv); \ return rv; \
} \
} while (false) #endif
#ifndef NOT_IMPLEMENTED # define NOT_IMPLEMENTED() \ do { \
LOG("WARNING : '%s' NOT IMPLEMENTED!", PRETTY_FUNC); \
} while (0) #endif
#ifndef ENTRY_LOG # define ENTRY_LOG(...) \ do { \
LOG("%s [%p]", PRETTY_FUNC, this); \
} while (0) # define ENTRY_LOG_ARGS(fmt, ...) \ do { \
LOG("%s [%p]: " fmt, PRETTY_FUNC, this, ##__VA_ARGS__); \
(void)(0, ##__VA_ARGS__); \
} while (0) #endif
// TODO : should we use Microsoft's definition or Chromium's defintion?
// A PROPVARIANT that is automatically initialized and cleared upon respective // construction and destruction of this class. class AutoPropVar final { public:
AutoPropVar() { PropVariantInit(&mVar); }
// Returns a pointer to the underlying PROPVARIANT for use as an out param // in a function call.
PROPVARIANT* Receive() {
MOZ_ASSERT(mVar.vt == VT_EMPTY); return &mVar;
}
// Clears the instance to prepare it for re-use (e.g., via Receive). void Reset() { if (mVar.vt != VT_EMPTY) {
HRESULT hr = PropVariantClear(&mVar);
MOZ_ASSERT(SUCCEEDED(hr));
Unused << hr;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.