Commit 30c36156 authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision 242756.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1553 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
parent 9daee785
......@@ -17,5 +17,5 @@
{
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '241258',
'chromium_revision': '242756',
}
......@@ -86,8 +86,8 @@ class CefGeolocationPermissionContext
CEF_REQUIRE_IOT();
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
render_view_id);
CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
......@@ -120,8 +120,8 @@ class CefGeolocationPermissionContext
RemoveCallback(bridge_id);
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
render_view_id);
CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
......
......@@ -35,8 +35,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.h"
......@@ -46,6 +45,9 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/file_chooser_params.h"
......@@ -494,8 +496,21 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForHost(
const content::RenderViewHost* host) {
DCHECK(host);
CEF_REQUIRE_UIT();
content::WebContentsImpl* web_contents =
static_cast<content::WebContentsImpl*>(host->GetDelegate());
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(host);
if (web_contents)
return static_cast<CefBrowserHostImpl*>(web_contents->GetDelegate());
return NULL;
}
// static
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForHost(
const content::RenderFrameHost* host) {
DCHECK(host);
CEF_REQUIRE_UIT();
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(
const_cast<content::RenderFrameHost*>(host));
if (web_contents)
return static_cast<CefBrowserHostImpl*>(web_contents->GetDelegate());
return NULL;
......@@ -515,42 +530,77 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForRequest(
DCHECK(request);
CEF_REQUIRE_IOT();
int render_process_id = -1;
int render_view_id = MSG_ROUTING_NONE;
int render_frame_id = MSG_ROUTING_NONE;
if (!content::ResourceRequestInfo::GetRenderViewForRequest(
request, &render_process_id, &render_view_id) ||
if (!content::ResourceRequestInfo::GetRenderFrameForRequest(
request, &render_process_id, &render_frame_id) ||
render_process_id == -1 ||
render_view_id == MSG_ROUTING_NONE) {
render_frame_id == MSG_ROUTING_NONE) {
return NULL;
}
return GetBrowserByRoutingID(render_process_id, render_view_id);
return GetBrowserForFrame(render_process_id, render_frame_id);
}
// static
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserByRoutingID(
int render_process_id, int render_view_id) {
if (render_process_id == -1 || render_view_id == MSG_ROUTING_NONE)
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForView(
int render_process_id, int render_routing_id) {
if (render_process_id == -1 || render_routing_id == MSG_ROUTING_NONE)
return NULL;
if (CEF_CURRENTLY_ON_UIT()) {
// Use the non-thread-safe but potentially faster approach.
content::RenderViewHost* render_view_host =
content::RenderViewHost::FromID(render_process_id, render_view_id);
content::RenderViewHost::FromID(render_process_id, render_routing_id);
if (!render_view_host)
return NULL;
return GetBrowserForHost(render_view_host);
} else {
// Use the thread-safe approach.
scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetBrowserInfo(render_process_id,
render_view_id);
CefContentBrowserClient::Get()->GetBrowserInfoForView(
render_process_id,
render_routing_id);
if (info.get()) {
CefRefPtr<CefBrowserHostImpl> browser = info->browser();
if (!browser.get()) {
LOG(WARNING) << "Found browser id " << info->browser_id() <<
" but no browser object matching view process id " <<
render_process_id << " and routing id " <<
render_routing_id;
}
return browser;
}
return NULL;
}
}
// static
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForFrame(
int render_process_id, int render_routing_id) {
if (render_process_id == -1 || render_routing_id == MSG_ROUTING_NONE)
return NULL;
if (CEF_CURRENTLY_ON_UIT()) {
// Use the non-thread-safe but potentially faster approach.
content::RenderFrameHost* render_frame_host =
content::RenderFrameHost::FromID(render_process_id, render_routing_id);
if (!render_frame_host)
return NULL;
return GetBrowserForHost(render_frame_host);
} else {
// Use the thread-safe approach.
scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetBrowserInfoForFrame(
render_process_id,
render_routing_id);
if (info.get()) {
CefRefPtr<CefBrowserHostImpl> browser = info->browser();
if (!browser.get()) {
LOG(WARNING) << "Found browser id " << info->browser_id() <<
" but no browser object matching process id " <<
render_process_id << " and view id " << render_view_id;
" but no browser object matching frame process id " <<
render_process_id << " and routing id " <<
render_routing_id;
}
return browser;
}
......@@ -1894,11 +1944,16 @@ void CefBrowserHostImpl::WebContentsCreated(
}
DCHECK(pending_popup_info.get());
content::RenderViewHost* view_host = new_contents->GetRenderViewHost();
content::RenderFrameHost* main_frame_host = new_contents->GetMainFrame();
CefWindowHandle opener = NULL;
scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
new_contents->GetRenderProcessHost()->GetID(),
new_contents->GetRoutingID());
view_host->GetProcess()->GetID(),
view_host->GetRoutingID(),
main_frame_host->GetProcess()->GetID(),
main_frame_host->GetRoutingID());
if (source_contents) {
DCHECK(info->is_popup());
......@@ -2005,10 +2060,22 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
// content::WebContentsObserver methods.
// -----------------------------------------------------------------------------
void CefBrowserHostImpl::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
browser_info_->add_render_frame_id(render_frame_host->GetProcess()->GetID(),
render_frame_host->GetRoutingID());
}
void CefBrowserHostImpl::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
browser_info_->remove_render_frame_id(render_frame_host->GetProcess()->GetID(),
render_frame_host->GetRoutingID());
}
void CefBrowserHostImpl::RenderViewCreated(
content::RenderViewHost* render_view_host) {
browser_info_->add_render_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
browser_info_->add_render_view_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
// May be already registered if the renderer crashed previously.
if (!registrar_->IsRegistered(
......@@ -2021,8 +2088,8 @@ void CefBrowserHostImpl::RenderViewCreated(
void CefBrowserHostImpl::RenderViewDeleted(
content::RenderViewHost* render_view_host) {
browser_info_->remove_render_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
browser_info_->remove_render_view_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
if (registrar_->IsRegistered(
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
......
......@@ -104,15 +104,21 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Returns the browser associated with the specified RenderViewHost.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
const content::RenderViewHost* host);
// Returns the browser associated with the specified RenderFrameHost.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
const content::RenderFrameHost* host);
// Returns the browser associated with the specified WebContents.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents(
content::WebContents* contents);
// Returns the browser associated with the specified URLRequest.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForRequest(
net::URLRequest* request);
// Returns the browser associated with the specified routing IDs.
static CefRefPtr<CefBrowserHostImpl> GetBrowserByRoutingID(
int render_process_id, int render_view_id);
// Returns the browser associated with the specified view routing IDs.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForView(
int render_process_id, int render_routing_id);
// Returns the browser associated with the specified frame routing IDs.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrame(
int render_process_id, int render_routing_id);
// Returns true if window rendering is disabled in CefWindowInfo.
static bool IsWindowRenderingDisabled(const CefWindowInfo& info);
......@@ -367,6 +373,10 @@ class CefBrowserHostImpl : public CefBrowserHost,
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;
using content::WebContentsObserver::WasHidden;
virtual void RenderFrameCreated(
content::RenderFrameHost* render_frame_host) OVERRIDE;
virtual void RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) OVERRIDE;
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void RenderViewDeleted(
......
......@@ -164,7 +164,7 @@ bool RunFileDialog(const content::FileChooserParams& params,
std::string title;
if (!params.title.empty()) {
title = UTF16ToUTF8(params.title);
title = base::UTF16ToUTF8(params.title);
} else {
int string_id = 0;
switch (params.mode) {
......
......@@ -163,7 +163,7 @@ std::wstring FormatFilterForExtensions(
include_all_files = true;
desc = l10n_util::GetStringFUTF16(
IDS_APP_SAVEAS_EXTENSION_FORMAT,
base::i18n::ToUpper(WideToUTF16(ext_name)),
base::i18n::ToUpper(base::WideToUTF16(ext_name)),
ext_name);
}
}
......@@ -216,7 +216,7 @@ std::wstring GetFilterStringFromAcceptTypes(
if (ascii_type.length()) {
// Just treat as extension if contains '.' as the first character.
if (ascii_type[0] == '.') {
extensions.push_back(L"*" + ASCIIToWide(ascii_type));
extensions.push_back(L"*" + base::ASCIIToWide(ascii_type));
descriptions.push_back(std::wstring());
} else {
// Otherwise convert mime type to one or more extensions.
......@@ -415,7 +415,7 @@ const int kMaxAddressLengthChars = 2048;
bool HasExternalHandler(const std::string& scheme) {
base::win::RegKey key;
const std::wstring registry_path =
ASCIIToWide(scheme + "\\shell\\open\\command");
base::ASCIIToWide(scheme + "\\shell\\open\\command");
key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
if (key.Valid()) {
DWORD size = 0;
......
......@@ -19,59 +19,94 @@ void CefBrowserInfo::set_window_rendering_disabled(bool disabled) {
is_window_rendering_disabled_ = disabled;
}
void CefBrowserInfo::add_render_id(
int render_process_id, int render_view_id) {
void CefBrowserInfo::add_render_view_id(
int render_process_id, int render_routing_id) {
add_render_id(&render_view_id_set_, render_process_id, render_routing_id);
}
void CefBrowserInfo::add_render_frame_id(
int render_process_id, int render_routing_id) {
add_render_id(&render_frame_id_set_, render_process_id, render_routing_id);
}
void CefBrowserInfo::remove_render_view_id(
int render_process_id, int render_routing_id) {
remove_render_id(&render_view_id_set_, render_process_id, render_routing_id);
}
void CefBrowserInfo::remove_render_frame_id(
int render_process_id, int render_routing_id) {
remove_render_id(&render_frame_id_set_, render_process_id, render_routing_id);
}
bool CefBrowserInfo::is_render_view_id_match(
int render_process_id, int render_routing_id) {
return is_render_id_match(&render_view_id_set_,
render_process_id,
render_routing_id);
}
bool CefBrowserInfo::is_render_frame_id_match(
int render_process_id, int render_routing_id) {
return is_render_id_match(&render_frame_id_set_,
render_process_id,
render_routing_id);
}
CefRefPtr<CefBrowserHostImpl> CefBrowserInfo::browser() {
base::AutoLock lock_scope(lock_);
return browser_;
}
void CefBrowserInfo::set_browser(CefRefPtr<CefBrowserHostImpl> browser) {
base::AutoLock lock_scope(lock_);
browser_ = browser;
}
void CefBrowserInfo::add_render_id(RenderIdSet* id_set,
int render_process_id,
int render_routing_id) {
DCHECK_GT(render_process_id, 0);
DCHECK_GT(render_view_id, 0);
DCHECK_GT(render_routing_id, 0);
base::AutoLock lock_scope(lock_);
if (!render_id_set_.empty()) {
if (!id_set->empty()) {
RenderIdSet::const_iterator it =
render_id_set_.find(std::make_pair(render_process_id, render_view_id));
if (it != render_id_set_.end())
id_set->find(std::make_pair(render_process_id, render_routing_id));
if (it != id_set->end())
return;
}
render_id_set_.insert(std::make_pair(render_process_id, render_view_id));
id_set->insert(std::make_pair(render_process_id, render_routing_id));
}
void CefBrowserInfo::remove_render_id(
int render_process_id, int render_view_id) {
void CefBrowserInfo::remove_render_id(RenderIdSet* id_set,
int render_process_id,
int render_routing_id) {
DCHECK_GT(render_process_id, 0);
DCHECK_GT(render_view_id, 0);
DCHECK_GT(render_routing_id, 0);
base::AutoLock lock_scope(lock_);
DCHECK(!render_id_set_.empty());
if (render_id_set_.empty())
DCHECK(!id_set->empty());
if (id_set->empty())
return;
RenderIdSet::iterator it =
render_id_set_.find(std::make_pair(render_process_id, render_view_id));
DCHECK(it != render_id_set_.end());
if (it != render_id_set_.end())
render_id_set_.erase(it);
bool erased = id_set->erase(
std::make_pair(render_process_id, render_routing_id)) != 0;
DCHECK(erased);
}
bool CefBrowserInfo::is_render_id_match(
int render_process_id, int render_view_id) {
bool CefBrowserInfo::is_render_id_match(const RenderIdSet* id_set,
int render_process_id,
int render_routing_id) {
base::AutoLock lock_scope(lock_);
if (render_id_set_.empty())
if (id_set->empty())
return false;
RenderIdSet::const_iterator it =
render_id_set_.find(std::make_pair(render_process_id, render_view_id));
return (it != render_id_set_.end());
}
CefRefPtr<CefBrowserHostImpl> CefBrowserInfo::browser() {
base::AutoLock lock_scope(lock_);
return browser_;
}
void CefBrowserInfo::set_browser(CefRefPtr<CefBrowserHostImpl> browser) {
base::AutoLock lock_scope(lock_);
browser_ = browser;
id_set->find(std::make_pair(render_process_id, render_routing_id));
return (it != id_set->end());
}
......@@ -30,18 +30,34 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
void set_window_rendering_disabled(bool disabled);
void add_render_id(int render_process_id, int render_view_id);
void remove_render_id(int render_process_id, int render_view_id);
// Adds an ID pair if it doesn't already exist.
void add_render_view_id(int render_process_id, int render_routing_id);
void add_render_frame_id(int render_process_id, int render_routing_id);
// Returns true if this browser matches the specified ID values. If
// |render_view_id| is -1 any browser with the specified |render_process_id|
// will match.
bool is_render_id_match(int render_process_id, int render_view_id);
// Remove an ID pair if it exists.
void remove_render_view_id(int render_process_id, int render_routing_id);
void remove_render_frame_id(int render_process_id, int render_routing_id);
// Returns true if this browser matches the specified ID pair.
bool is_render_view_id_match(int render_process_id, int render_routing_id);
bool is_render_frame_id_match(int render_process_id, int render_routing_id);
CefRefPtr<CefBrowserHostImpl> browser();
void set_browser(CefRefPtr<CefBrowserHostImpl> browser);
private:
typedef std::set<std::pair<int, int> > RenderIdSet;
void add_render_id(RenderIdSet* id_set,
int render_process_id,
int render_routing_id);
void remove_render_id(RenderIdSet* id_set,
int render_process_id,
int render_routing_id);
bool is_render_id_match(const RenderIdSet* id_set,
int render_process_id,
int render_routing_id);
int browser_id_;
bool is_popup_;
bool is_window_rendering_disabled_;
......@@ -50,8 +66,8 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// The below members must be protected by |lock_|.
// Set of mapped (process_id, view_id) pairs. Keeping this set is necessary
// for the following reasons:
// Set of mapped (process_id, routing_id) pairs. Keeping this set is
// necessary for the following reasons:
// 1. When navigating cross-origin the new (pending) RenderViewHost will be
// created before the old (current) RenderViewHost is destroyed.
// 2. When canceling and asynchronously continuing navigation of the same URL
......@@ -59,8 +75,8 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// and then destroyed as a result of the second (allowed) navigation.
// 3. Out-of-process iframes have their own render IDs which must also be
// associated with the host browser.
typedef std::set<std::pair<int, int> > RenderIdSet;
RenderIdSet render_id_set_;
RenderIdSet render_view_id_set_;
RenderIdSet render_frame_id_set_;
// May be NULL if the browser has not yet been created or if the browser has
// been destroyed.
......
......@@ -76,11 +76,19 @@ void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
}
void CefBrowserMessageFilter::OnGetNewBrowserInfo(
int routing_id, CefProcessHostMsg_GetNewBrowserInfo_Params* params) {
int render_view_routing_id,
int render_frame_routing_id,
CefProcessHostMsg_GetNewBrowserInfo_Params* params) {
DCHECK_GT(render_view_routing_id, 0);
DCHECK_GT(render_frame_routing_id, 0);
// Popup windows may not have info yet.
scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(host_->GetID(),
routing_id);
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
host_->GetID(),
render_view_routing_id,
host_->GetID(),
render_frame_routing_id);
params->browser_id = info->browser_id();
params->is_popup = info->is_popup();
params->is_window_rendering_disabled = info->is_window_rendering_disabled();
......
......@@ -34,8 +34,10 @@ class CefBrowserMessageFilter : public IPC::ChannelProxy::MessageFilter {
// Message handlers.
void OnGetNewRenderThreadInfo(
CefProcessHostMsg_GetNewRenderThreadInfo_Params* params);
void OnGetNewBrowserInfo(int routing_id,
CefProcessHostMsg_GetNewBrowserInfo_Params* params);
void OnGetNewBrowserInfo(
int render_view_routing_id,
int render_frame_routing_id,
CefProcessHostMsg_GetNewBrowserInfo_Params* params);
void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params,
IPC::Message* reply_msg);
......
......@@ -93,7 +93,8 @@ std::string GetOSType() {
std::string GetCommandLine() {
#if defined(OS_WIN)
return WideToUTF8(CommandLine::ForCurrentProcess()->GetCommandLineString());
return base::WideToUTF8(
CommandLine::ForCurrentProcess()->GetCommandLineString());
#elif defined(OS_POSIX)
std::string command_line = "";
typedef std::vector<std::string> ArgvList;
......
......@@ -187,8 +187,8 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
bool handled = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
render_view_id);
CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
......@@ -229,8 +229,8 @@ class CefPluginServiceFilter : public content::PluginServiceFilter {
bool allowed = true;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id,
render_view_id);
CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
......@@ -376,21 +376,39 @@ scoped_refptr<CefBrowserInfo> CefContentBrowserClient::CreateBrowserInfo(
}
scoped_refptr<CefBrowserInfo>
CefContentBrowserClient::GetOrCreateBrowserInfo(int render_process_id,
int render_view_id) {
CefContentBrowserClient::GetOrCreateBrowserInfo(
int render_view_process_id,
int render_view_routing_id,
int render_frame_process_id,
int render_frame_routing_id) {
base::AutoLock lock_scope(browser_info_lock_);
BrowserInfoList::const_iterator it = browser_info_list_.begin();
for (; it != browser_info_list_.end(); ++it) {
const scoped_refptr<CefBrowserInfo>& browser_info = *it;
if (browser_info->is_render_id_match(render_process_id, render_view_id))
if (browser_info->is_render_view_id_match(render_view_process_id,
render_view_routing_id)) {
// Make sure the frame id is also registered.
browser_info->add_render_frame_id(render_frame_process_id,
render_frame_routing_id);
return browser_info;
} else if (browser_info->is_render_frame_id_match(
render_frame_process_id,
render_frame_routing_id)) {
// Make sure the view id is also registered.
browser_info->add_render_view_id(render_view_process_id,
render_view_routing_id);
return browser_info;
}
}
// Must be a popup if it hasn't already been created.
scoped_refptr<CefBrowserInfo> browser_info =
new CefBrowserInfo(++next_browser_id_, true);
browser_info->add_render_id(render_process_id, render_view_id);
browser_info->add_render_view_id(render_view_process_id,
render_view_routing_id);
browser_info->add_render_frame_id(render_frame_process_id,
render_frame_routing_id);
browser_info_list_.push_back(browser_info);
return browser_info;
}
......@@ -444,19 +462,40 @@ void CefContentBrowserClient::DestroyAllBrowsers() {
#endif
}
scoped_refptr<CefBrowserInfo> CefContentBrowserClient::GetBrowserInfo(
int render_process_id, int render_view_id) {
scoped_refptr<CefBrowserInfo> CefContentBrowserClient::GetBrowserInfoForView(
int render_process_id, int render_routing_id) {
base::AutoLock lock_scope(browser_info_lock_);
BrowserInfoList::const_iterator it = browser_info_list_.begin();
for (; it != browser_info_list_.end(); ++it) {
const scoped_refptr<CefBrowserInfo>& browser_info = *it;
if (browser_info->is_render_view_id_match(
render_process_id, render_routing_id)) {
return browser_info;
}
}
LOG(WARNING) << "No browser info matching view process id " <<
render_process_id << " and routing id " << render_routing_id;
return scoped_refptr<CefBrowserInfo>();
}
scoped_refptr<CefBrowserInfo> CefContentBrowserClient::GetBrowserInfoForFrame(
int render_process_id, int render_routing_id) {
base::AutoLock lock_scope(browser_info_lock_);