IDBTransaction* IDBTransaction::create(ExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, blink::WebIDBTransactionMode mode, IDBDatabase* db) { IDBOpenDBRequest* openDBRequest = 0; IDBTransaction* transaction = adoptRefCountedGarbageCollectedWillBeNoop(new IDBTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())); transaction->suspendIfNeeded(); return transaction; }
ChannelMergerNode* ChannelMergerNode::create(AudioContext* context, float sampleRate, unsigned numberOfInputs) { if (!numberOfInputs || numberOfInputs > AudioContext::maxNumberOfChannels()) return 0; return adoptRefCountedGarbageCollectedWillBeNoop(new ChannelMergerNode(context, sampleRate, numberOfInputs)); }
RTCDataChannel* RTCDataChannel::create(ExecutionContext* context, RTCPeerConnection* connection, blink::WebRTCPeerConnectionHandler* peerConnectionHandler, const String& label, const blink::WebRTCDataChannelInit& init, ExceptionState& exceptionState) { OwnPtr<blink::WebRTCDataChannelHandler> handler = adoptPtr(peerConnectionHandler->createDataChannel(label, init)); if (!handler) { exceptionState.throwDOMException(NotSupportedError, "RTCDataChannel is not supported"); return nullptr; } return adoptRefCountedGarbageCollectedWillBeNoop(new RTCDataChannel(context, connection, handler.release())); }
IDBRequest* IDBRequest::create(ScriptState* scriptState, IDBAny* source, IDBTransaction* transaction) { IDBRequest* request = adoptRefCountedGarbageCollectedWillBeNoop(new IDBRequest(scriptState, source, transaction)); request->suspendIfNeeded(); // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions. if (transaction) transaction->registerRequest(request); return request; }
RTCDTMFSender* RTCDTMFSender::create(ExecutionContext* context, blink::WebRTCPeerConnectionHandler* peerConnectionHandler, MediaStreamTrack* track, ExceptionState& exceptionState) { OwnPtr<blink::WebRTCDTMFSenderHandler> handler = adoptPtr(peerConnectionHandler->createDTMFSender(track->component())); if (!handler) { exceptionState.throwDOMException(NotSupportedError, "The MediaStreamTrack provided is not an element of a MediaStream that's currently in the local streams set."); return nullptr; } RTCDTMFSender* dtmfSender = adoptRefCountedGarbageCollectedWillBeNoop(new RTCDTMFSender(context, track, handler.release())); dtmfSender->suspendIfNeeded(); return dtmfSender; }
// static ScreenOrientation* ScreenOrientation::create(LocalFrame* frame) { ASSERT(frame); ScreenOrientation* orientation = adoptRefCountedGarbageCollectedWillBeNoop(new ScreenOrientation(frame)); ASSERT(orientation->controller()); // FIXME: ideally, we would like to provide the ScreenOrientationController // the case where it is not defined but for the moment, it is eagerly // created when the LocalFrame is created so we shouldn't be in that // situtaion. // In order to create the ScreenOrientationController lazily, we would need // to be able to access WebFrameClient from modules/. orientation->controller()->setOrientation(orientation); return orientation; }
RTCPeerConnection* RTCPeerConnection::create(ExecutionContext* context, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState& exceptionState) { RefPtr<RTCConfiguration> configuration = parseConfiguration(rtcConfiguration, exceptionState); if (exceptionState.hadException()) return nullptr; blink::WebMediaConstraints constraints = MediaConstraintsImpl::create(mediaConstraints, exceptionState); if (exceptionState.hadException()) return nullptr; RTCPeerConnection* peerConnection = adoptRefCountedGarbageCollectedWillBeNoop(new RTCPeerConnection(context, configuration.release(), constraints, exceptionState)); peerConnection->suspendIfNeeded(); if (exceptionState.hadException()) return nullptr; return peerConnection; }
MediaStreamTrack* MediaStreamTrack::create(ExecutionContext* context, MediaStreamComponent* component) { MediaStreamTrack* track = adoptRefCountedGarbageCollectedWillBeNoop(new MediaStreamTrack(context, component)); track->suspendIfNeeded(); return track; }
RTCDataChannel* RTCDataChannel::create(ExecutionContext* context, RTCPeerConnection* connection, PassOwnPtr<blink::WebRTCDataChannelHandler> handler) { ASSERT(handler); return adoptRefCountedGarbageCollectedWillBeNoop(new RTCDataChannel(context, connection, handler)); }
FileWriter* FileWriter::create(ExecutionContext* context) { FileWriter* fileWriter = adoptRefCountedGarbageCollectedWillBeNoop(new FileWriter(context)); fileWriter->suspendIfNeeded(); return fileWriter; }
MIDIInput* MIDIInput::create(MIDIAccess* access, const String& id, const String& manufacturer, const String& name, const String& version) { ASSERT(access); return adoptRefCountedGarbageCollectedWillBeNoop(new MIDIInput(access, id, manufacturer, name, version)); }
SpeechRecognition* SpeechRecognition::create(ExecutionContext* context) { SpeechRecognition* speechRecognition = adoptRefCountedGarbageCollectedWillBeNoop(new SpeechRecognition(context)); speechRecognition->suspendIfNeeded(); return speechRecognition; }
SpeechSynthesis* SpeechSynthesis::create(ExecutionContext* context) { return adoptRefCountedGarbageCollectedWillBeNoop(new SpeechSynthesis(context)); }
IDBTransaction* IDBTransaction::create(ExecutionContext* context, int64_t id, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata) { IDBTransaction* transaction = adoptRefCountedGarbageCollectedWillBeNoop(new IDBTransaction(context, id, Vector<String>(), blink::WebIDBTransactionModeVersionChange, db, openDBRequest, previousMetadata)); transaction->suspendIfNeeded(); return transaction; }