CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t attributeFlags) : m_elementId(elementId) , m_bitfieldsSupported(attributeFlags) { ASSERT(isControlThread()); ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, threadSafeBind(&incrementProxyCountForElement, m_elementId)); }
CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t compositorMutableProperties, CompositorProxyClient* client) : CompositorProxy(elementId, compositorMutableProperties) { m_client = client; DCHECK(m_client); DCHECK(isControlThread()); m_client->registerCompositorProxy(this); }
static bool raiseExceptionIfMutationNotAllowed(ExceptionState& exceptionState) { if (!isControlThread()) { exceptionState.throwDOMException(NoModificationAllowedError, "Cannot mutate a proxy attribute from the main page."); return true; } if (!isCallingCompositorFrameCallback()) { exceptionState.throwDOMException(NoModificationAllowedError, "Cannot mutate a proxy attribute outside of a requestCompositorFrame callback."); return true; } return false; }