mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Pass information to the renderer process synchronously on render thread creation and new browser creation to avoid race conditions (issue #744).
- Add the ability to pass extra information to child processes using a new CefBrowserProcessHandler::OnRenderProcessThreadCreated callback (issue #744). - Fix OnBeforeChildProcessLaunch documentation (issue #754). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@910 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -247,6 +247,44 @@ CefContentBrowserClient::CefContentBrowserClient()
|
||||
CefContentBrowserClient::~CefContentBrowserClient() {
|
||||
}
|
||||
|
||||
// static
|
||||
CefContentBrowserClient* CefContentBrowserClient::Get() {
|
||||
return static_cast<CefContentBrowserClient*>(
|
||||
content::GetContentClient()->browser());
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::GetNewPopupBrowserInfo(
|
||||
int render_process_id, int render_view_id, NewPopupBrowserInfo* info) {
|
||||
base::AutoLock lock_scope(new_popup_browser_lock_);
|
||||
|
||||
NewPopupBrowserInfoMap::const_iterator it =
|
||||
new_popup_browser_info_map_.find(
|
||||
std::make_pair(render_process_id, render_view_id));
|
||||
if (it != new_popup_browser_info_map_.end()) {
|
||||
*info = it->second;
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the info now.
|
||||
NewPopupBrowserInfo new_info;
|
||||
new_info.browser_id = _Context->GetNextBrowserID();
|
||||
new_popup_browser_info_map_.insert(
|
||||
std::make_pair(
|
||||
std::make_pair(render_process_id, render_view_id), new_info));
|
||||
*info = new_info;
|
||||
}
|
||||
|
||||
void CefContentBrowserClient::ClearNewPopupBrowserInfo(int render_process_id,
|
||||
int render_view_id) {
|
||||
base::AutoLock lock_scope(new_popup_browser_lock_);
|
||||
|
||||
NewPopupBrowserInfoMap::iterator it =
|
||||
new_popup_browser_info_map_.find(
|
||||
std::make_pair(render_process_id, render_view_id));
|
||||
if (it != new_popup_browser_info_map_.end())
|
||||
new_popup_browser_info_map_.erase(it);
|
||||
}
|
||||
|
||||
content::BrowserMainParts* CefContentBrowserClient::CreateBrowserMainParts(
|
||||
const content::MainFunctionParams& parameters) {
|
||||
browser_main_parts_ = new CefBrowserMainParts(parameters);
|
||||
|
Reference in New Issue
Block a user