- Make sure BrowserRequestContextProxy is only used on the IO thread (issue #542).

- Windows: Reset the window procedure in the WebWidgetHost destructor to avoid crashes if messages are delivered after the window is destroyed.
- Add thread-related DCHECKS in browser_resource_loader_bridge.cc.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@650 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-05-25 20:44:34 +00:00
parent ab96ec27a4
commit cf5665ca3e
6 changed files with 102 additions and 22 deletions

View File

@@ -180,9 +180,6 @@ CefBrowserImpl::CefBrowserImpl(const CefWindowInfo& windowInfo,
popup_delegate_.reset(new BrowserWebViewDelegate(this));
nav_controller_.reset(new BrowserNavigationController(this));
request_context_proxy_.reset(
new BrowserRequestContextProxy(_Context->request_context(), this));
if (!file_system_root_.CreateUniqueTempDir()) {
LOG(WARNING) << "Failed to create a temp dir for the filesystem."
"FileSystem feature will be disabled.";
@@ -785,7 +782,10 @@ void CefBrowserImpl::UIT_DestroyBrowser() {
UIT_ClearMainWndHandle();
main_frame_ = NULL;
request_context_proxy_.reset(NULL);
// Delete the proxy on the IO thread.
CefThread::DeleteSoon(CefThread::IO, FROM_HERE,
request_context_proxy_.release());
// Remove the reference added in UIT_CreateBrowser().
Release();
@@ -1585,6 +1585,16 @@ GURL CefBrowserImpl::pending_url() {
return pending_url_;
}
net::URLRequestContext* CefBrowserImpl::request_context_proxy() {
DCHECK(CefThread::CurrentlyOn(CefThread::IO));
if (!request_context_proxy_.get()) {
request_context_proxy_.reset(
new BrowserRequestContextProxy(_Context->request_context(), this));
}
return request_context_proxy_.get();
}
void CefBrowserImpl::UIT_CreateDevToolsClient(BrowserDevToolsAgent *agent) {
dev_tools_client_.reset(new BrowserDevToolsClient(this, agent));
}