MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / SetAsyncScriptDocument

Method SetAsyncScriptDocument

cpp/iedriver/Script.cpp:512–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512int Script::SetAsyncScriptDocument(HWND async_executor_handle) {
513 LOG(TRACE) << "Entering Script::SetAsyncScriptDocument";
514 // Marshal the document and the element to click to streams for use in another thread.
515 LOG(DEBUG) << "Marshaling document to stream to send to new thread";
516 LPSTREAM document_stream;
517 HRESULT hr = ::CoMarshalInterThreadInterfaceInStream(IID_IHTMLDocument2,
518 this->script_engine_host_,
519 &document_stream);
520 if (FAILED(hr)) {
521 LOGHR(WARN, hr) << "CoMarshalInterfaceThreadInStream() for document failed";
522 CComVariant result = L"";
523 CComBSTR error_description = L"";
524 result.Clear();
525 result.vt = VT_BSTR;
526 error_description = L"Couldn't marshal the IHTMLDocument2 interface to a stream. This is an internal COM error.";
527 result.bstrVal = error_description;
528 this->result_.Copy(&result);
529 return EUNEXPECTEDJSERROR;
530 }
531 ::SendMessage(async_executor_handle,
532 WD_ASYNC_SCRIPT_SET_DOCUMENT,
533 NULL,
534 reinterpret_cast<LPARAM>(document_stream));
535 return WD_SUCCESS;
536}
537
538int Script::SetAsyncScriptElementArgument(HWND async_executor_handle,
539 const IECommandExecutor& command_executor,

Callers 1

ExecuteAsyncMethod · 0.95

Calls 3

LOGClass · 0.50
ClearMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected