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

Method OnQuit

cpp/iedriver/Browser.cpp:63–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void __stdcall Browser::OnQuit() {
64 LOG(TRACE) << "Entering Browser::OnQuit";
65 if (!this->is_explicit_close_requested_) {
66 if (this->is_awaiting_new_process()) {
67 LOG(WARN) << "A new browser process was requested. This means a Protected "
68 << "Mode boundary has been crossed, and that future commands to "
69 << "the current browser instance will fail. The driver will "
70 << "attempt to reconnect to the newly created browser object, "
71 << "but there is no guarantee it will work.";
72 DWORD process_id;
73 HWND window_handle = this->GetBrowserWindowHandle();
74 ::GetWindowThreadProcessId(window_handle, &process_id);
75
76 BrowserReattachInfo* info = new BrowserReattachInfo;
77 info->browser_id = this->browser_id();
78 info->current_process_id = process_id;
79 info->known_process_ids = this->known_process_ids_;
80
81 this->DetachEvents();
82 this->browser_ = NULL;
83 ::PostMessage(this->executor_handle(),
84 WD_BROWSER_REATTACH,
85 NULL,
86 reinterpret_cast<LPARAM>(info));
87 return;
88 } else {
89 LOG(WARN) << "This instance of Internet Explorer (" << this->browser_id()
90 << ") is exiting without an explicit request to close it. "
91 << "Unless you clicked a link that specifically attempts to "
92 << "close the page, that likely means a Protected Mode "
93 << "boundary has been crossed (either entering or exiting "
94 << "Protected Mode). It is highly likely that any subsequent "
95 << "commands to this driver instance will fail. THIS IS NOT A "
96 << "BUG IN THE IE DRIVER! Fix your code and/or browser "
97 << "configuration so that a Protected Mode boundary is not "
98 << "crossed.";
99 }
100 }
101 this->PostQuitMessage();
102}
103
104void __stdcall Browser::NewProcess(DWORD lCauseFlag,
105 IDispatch* pWB2,

Callers

nothing calls this directly

Calls 7

DetachEventsMethod · 0.95
browser_idMethod · 0.80
executor_handleMethod · 0.80
PostQuitMessageMethod · 0.80
LOGClass · 0.50

Tested by

no test coverage detected