Update to Chromium revision 242756.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1553 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2014-01-02 22:41:11 +00:00
parent 9daee785bd
commit 30c36156ea
42 changed files with 456 additions and 236 deletions

View File

@ -17,5 +17,5 @@
{ {
'chromium_url': 'http://src.chromium.org/svn/trunk/src', 'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '241258', 'chromium_revision': '242756',
} }

View File

@ -86,8 +86,8 @@ class CefGeolocationPermissionContext
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id, CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id); render_view_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {
@ -120,8 +120,8 @@ class CefGeolocationPermissionContext
RemoveCallback(bridge_id); RemoveCallback(bridge_id);
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id, CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id); render_view_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {

View File

@ -35,8 +35,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h" #include "content/common/view_messages.h"
#include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.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_details.h"
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.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/resource_request_info.h"
#include "content/public/browser/web_contents_view.h" #include "content/public/browser/web_contents_view.h"
#include "content/public/common/file_chooser_params.h" #include "content/public/common/file_chooser_params.h"
@ -494,8 +496,21 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForHost(
const content::RenderViewHost* host) { const content::RenderViewHost* host) {
DCHECK(host); DCHECK(host);
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
content::WebContentsImpl* web_contents = content::WebContents* web_contents =
static_cast<content::WebContentsImpl*>(host->GetDelegate()); 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) if (web_contents)
return static_cast<CefBrowserHostImpl*>(web_contents->GetDelegate()); return static_cast<CefBrowserHostImpl*>(web_contents->GetDelegate());
return NULL; return NULL;
@ -515,42 +530,77 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForRequest(
DCHECK(request); DCHECK(request);
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();
int render_process_id = -1; int render_process_id = -1;
int render_view_id = MSG_ROUTING_NONE; int render_frame_id = MSG_ROUTING_NONE;
if (!content::ResourceRequestInfo::GetRenderViewForRequest( if (!content::ResourceRequestInfo::GetRenderFrameForRequest(
request, &render_process_id, &render_view_id) || request, &render_process_id, &render_frame_id) ||
render_process_id == -1 || render_process_id == -1 ||
render_view_id == MSG_ROUTING_NONE) { render_frame_id == MSG_ROUTING_NONE) {
return NULL; return NULL;
} }
return GetBrowserByRoutingID(render_process_id, render_view_id); return GetBrowserForFrame(render_process_id, render_frame_id);
} }
// static // static
CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserByRoutingID( CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForView(
int render_process_id, int render_view_id) { int render_process_id, int render_routing_id) {
if (render_process_id == -1 || render_view_id == MSG_ROUTING_NONE) if (render_process_id == -1 || render_routing_id == MSG_ROUTING_NONE)
return NULL; return NULL;
if (CEF_CURRENTLY_ON_UIT()) { if (CEF_CURRENTLY_ON_UIT()) {
// Use the non-thread-safe but potentially faster approach. // Use the non-thread-safe but potentially faster approach.
content::RenderViewHost* render_view_host = 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) if (!render_view_host)
return NULL; return NULL;
return GetBrowserForHost(render_view_host); return GetBrowserForHost(render_view_host);
} else { } else {
// Use the thread-safe approach. // Use the thread-safe approach.
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetBrowserInfo(render_process_id, CefContentBrowserClient::Get()->GetBrowserInfoForView(
render_view_id); render_process_id,
render_routing_id);
if (info.get()) { if (info.get()) {
CefRefPtr<CefBrowserHostImpl> browser = info->browser(); CefRefPtr<CefBrowserHostImpl> browser = info->browser();
if (!browser.get()) { if (!browser.get()) {
LOG(WARNING) << "Found browser id " << info->browser_id() << LOG(WARNING) << "Found browser id " << info->browser_id() <<
" but no browser object matching process id " << " but no browser object matching view process id " <<
render_process_id << " and view id " << render_view_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 frame process id " <<
render_process_id << " and routing id " <<
render_routing_id;
} }
return browser; return browser;
} }
@ -1894,11 +1944,16 @@ void CefBrowserHostImpl::WebContentsCreated(
} }
DCHECK(pending_popup_info.get()); DCHECK(pending_popup_info.get());
content::RenderViewHost* view_host = new_contents->GetRenderViewHost();
content::RenderFrameHost* main_frame_host = new_contents->GetMainFrame();
CefWindowHandle opener = NULL; CefWindowHandle opener = NULL;
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo( CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
new_contents->GetRenderProcessHost()->GetID(), view_host->GetProcess()->GetID(),
new_contents->GetRoutingID()); view_host->GetRoutingID(),
main_frame_host->GetProcess()->GetID(),
main_frame_host->GetRoutingID());
if (source_contents) { if (source_contents) {
DCHECK(info->is_popup()); DCHECK(info->is_popup());
@ -2005,10 +2060,22 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
// content::WebContentsObserver methods. // 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( void CefBrowserHostImpl::RenderViewCreated(
content::RenderViewHost* render_view_host) { content::RenderViewHost* render_view_host) {
browser_info_->add_render_id(render_view_host->GetProcess()->GetID(), browser_info_->add_render_view_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID()); render_view_host->GetRoutingID());
// May be already registered if the renderer crashed previously. // May be already registered if the renderer crashed previously.
if (!registrar_->IsRegistered( if (!registrar_->IsRegistered(
@ -2021,8 +2088,8 @@ void CefBrowserHostImpl::RenderViewCreated(
void CefBrowserHostImpl::RenderViewDeleted( void CefBrowserHostImpl::RenderViewDeleted(
content::RenderViewHost* render_view_host) { content::RenderViewHost* render_view_host) {
browser_info_->remove_render_id(render_view_host->GetProcess()->GetID(), browser_info_->remove_render_view_id(render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID()); render_view_host->GetRoutingID());
if (registrar_->IsRegistered( if (registrar_->IsRegistered(
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,

View File

@ -104,15 +104,21 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Returns the browser associated with the specified RenderViewHost. // Returns the browser associated with the specified RenderViewHost.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost( static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
const content::RenderViewHost* host); 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. // Returns the browser associated with the specified WebContents.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents( static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents(
content::WebContents* contents); content::WebContents* contents);
// Returns the browser associated with the specified URLRequest. // Returns the browser associated with the specified URLRequest.
static CefRefPtr<CefBrowserHostImpl> GetBrowserForRequest( static CefRefPtr<CefBrowserHostImpl> GetBrowserForRequest(
net::URLRequest* request); net::URLRequest* request);
// Returns the browser associated with the specified routing IDs. // Returns the browser associated with the specified view routing IDs.
static CefRefPtr<CefBrowserHostImpl> GetBrowserByRoutingID( static CefRefPtr<CefBrowserHostImpl> GetBrowserForView(
int render_process_id, int render_view_id); 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. // Returns true if window rendering is disabled in CefWindowInfo.
static bool IsWindowRenderingDisabled(const CefWindowInfo& info); static bool IsWindowRenderingDisabled(const CefWindowInfo& info);
@ -367,6 +373,10 @@ class CefBrowserHostImpl : public CefBrowserHost,
// content::WebContentsObserver methods. // content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired; using content::WebContentsObserver::BeforeUnloadFired;
using content::WebContentsObserver::WasHidden; 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( virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE; content::RenderViewHost* render_view_host) OVERRIDE;
virtual void RenderViewDeleted( virtual void RenderViewDeleted(

View File

@ -164,7 +164,7 @@ bool RunFileDialog(const content::FileChooserParams& params,
std::string title; std::string title;
if (!params.title.empty()) { if (!params.title.empty()) {
title = UTF16ToUTF8(params.title); title = base::UTF16ToUTF8(params.title);
} else { } else {
int string_id = 0; int string_id = 0;
switch (params.mode) { switch (params.mode) {

View File

@ -163,7 +163,7 @@ std::wstring FormatFilterForExtensions(
include_all_files = true; include_all_files = true;
desc = l10n_util::GetStringFUTF16( desc = l10n_util::GetStringFUTF16(
IDS_APP_SAVEAS_EXTENSION_FORMAT, IDS_APP_SAVEAS_EXTENSION_FORMAT,
base::i18n::ToUpper(WideToUTF16(ext_name)), base::i18n::ToUpper(base::WideToUTF16(ext_name)),
ext_name); ext_name);
} }
} }
@ -216,7 +216,7 @@ std::wstring GetFilterStringFromAcceptTypes(
if (ascii_type.length()) { if (ascii_type.length()) {
// Just treat as extension if contains '.' as the first character. // Just treat as extension if contains '.' as the first character.
if (ascii_type[0] == '.') { if (ascii_type[0] == '.') {
extensions.push_back(L"*" + ASCIIToWide(ascii_type)); extensions.push_back(L"*" + base::ASCIIToWide(ascii_type));
descriptions.push_back(std::wstring()); descriptions.push_back(std::wstring());
} else { } else {
// Otherwise convert mime type to one or more extensions. // Otherwise convert mime type to one or more extensions.
@ -415,7 +415,7 @@ const int kMaxAddressLengthChars = 2048;
bool HasExternalHandler(const std::string& scheme) { bool HasExternalHandler(const std::string& scheme) {
base::win::RegKey key; base::win::RegKey key;
const std::wstring registry_path = 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); key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
if (key.Valid()) { if (key.Valid()) {
DWORD size = 0; DWORD size = 0;

View File

@ -19,51 +19,38 @@ void CefBrowserInfo::set_window_rendering_disabled(bool disabled) {
is_window_rendering_disabled_ = disabled; is_window_rendering_disabled_ = disabled;
} }
void CefBrowserInfo::add_render_id( void CefBrowserInfo::add_render_view_id(
int render_process_id, int render_view_id) { int render_process_id, int render_routing_id) {
DCHECK_GT(render_process_id, 0); add_render_id(&render_view_id_set_, render_process_id, render_routing_id);
DCHECK_GT(render_view_id, 0);
base::AutoLock lock_scope(lock_);
if (!render_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())
return;
}
render_id_set_.insert(std::make_pair(render_process_id, render_view_id));
} }
void CefBrowserInfo::remove_render_id( void CefBrowserInfo::add_render_frame_id(
int render_process_id, int render_view_id) { int render_process_id, int render_routing_id) {
DCHECK_GT(render_process_id, 0); add_render_id(&render_frame_id_set_, render_process_id, render_routing_id);
DCHECK_GT(render_view_id, 0);
base::AutoLock lock_scope(lock_);
DCHECK(!render_id_set_.empty());
if (render_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 CefBrowserInfo::is_render_id_match( void CefBrowserInfo::remove_render_view_id(
int render_process_id, int render_view_id) { int render_process_id, int render_routing_id) {
base::AutoLock lock_scope(lock_); remove_render_id(&render_view_id_set_, render_process_id, render_routing_id);
}
if (render_id_set_.empty()) void CefBrowserInfo::remove_render_frame_id(
return false; int render_process_id, int render_routing_id) {
remove_render_id(&render_frame_id_set_, render_process_id, render_routing_id);
}
RenderIdSet::const_iterator it = bool CefBrowserInfo::is_render_view_id_match(
render_id_set_.find(std::make_pair(render_process_id, render_view_id)); int render_process_id, int render_routing_id) {
return (it != render_id_set_.end()); 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() { CefRefPtr<CefBrowserHostImpl> CefBrowserInfo::browser() {
@ -75,3 +62,51 @@ void CefBrowserInfo::set_browser(CefRefPtr<CefBrowserHostImpl> browser) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
browser_ = browser; 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_routing_id, 0);
base::AutoLock lock_scope(lock_);
if (!id_set->empty()) {
RenderIdSet::const_iterator it =
id_set->find(std::make_pair(render_process_id, render_routing_id));
if (it != id_set->end())
return;
}
id_set->insert(std::make_pair(render_process_id, render_routing_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_routing_id, 0);
base::AutoLock lock_scope(lock_);
DCHECK(!id_set->empty());
if (id_set->empty())
return;
bool erased = id_set->erase(
std::make_pair(render_process_id, render_routing_id)) != 0;
DCHECK(erased);
}
bool CefBrowserInfo::is_render_id_match(const RenderIdSet* id_set,
int render_process_id,
int render_routing_id) {
base::AutoLock lock_scope(lock_);
if (id_set->empty())
return false;
RenderIdSet::const_iterator it =
id_set->find(std::make_pair(render_process_id, render_routing_id));
return (it != id_set->end());
}

View File

@ -30,18 +30,34 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
void set_window_rendering_disabled(bool disabled); void set_window_rendering_disabled(bool disabled);
void add_render_id(int render_process_id, int render_view_id); // Adds an ID pair if it doesn't already exist.
void remove_render_id(int render_process_id, int render_view_id); 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 // Remove an ID pair if it exists.
// |render_view_id| is -1 any browser with the specified |render_process_id| void remove_render_view_id(int render_process_id, int render_routing_id);
// will match. void remove_render_frame_id(int render_process_id, int render_routing_id);
bool is_render_id_match(int render_process_id, int render_view_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(); CefRefPtr<CefBrowserHostImpl> browser();
void set_browser(CefRefPtr<CefBrowserHostImpl> browser); void set_browser(CefRefPtr<CefBrowserHostImpl> browser);
private: 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_; int browser_id_;
bool is_popup_; bool is_popup_;
bool is_window_rendering_disabled_; bool is_window_rendering_disabled_;
@ -50,8 +66,8 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// The below members must be protected by |lock_|. // The below members must be protected by |lock_|.
// Set of mapped (process_id, view_id) pairs. Keeping this set is necessary // Set of mapped (process_id, routing_id) pairs. Keeping this set is
// for the following reasons: // necessary for the following reasons:
// 1. When navigating cross-origin the new (pending) RenderViewHost will be // 1. When navigating cross-origin the new (pending) RenderViewHost will be
// created before the old (current) RenderViewHost is destroyed. // created before the old (current) RenderViewHost is destroyed.
// 2. When canceling and asynchronously continuing navigation of the same URL // 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. // 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 // 3. Out-of-process iframes have their own render IDs which must also be
// associated with the host browser. // associated with the host browser.
typedef std::set<std::pair<int, int> > RenderIdSet; RenderIdSet render_view_id_set_;
RenderIdSet render_id_set_; RenderIdSet render_frame_id_set_;
// May be NULL if the browser has not yet been created or if the browser has // May be NULL if the browser has not yet been created or if the browser has
// been destroyed. // been destroyed.

View File

@ -76,11 +76,19 @@ void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
} }
void CefBrowserMessageFilter::OnGetNewBrowserInfo( 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. // Popup windows may not have info yet.
scoped_refptr<CefBrowserInfo> info = scoped_refptr<CefBrowserInfo> info =
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(host_->GetID(), CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
routing_id); host_->GetID(),
render_view_routing_id,
host_->GetID(),
render_frame_routing_id);
params->browser_id = info->browser_id(); params->browser_id = info->browser_id();
params->is_popup = info->is_popup(); params->is_popup = info->is_popup();
params->is_window_rendering_disabled = info->is_window_rendering_disabled(); params->is_window_rendering_disabled = info->is_window_rendering_disabled();

View File

@ -34,8 +34,10 @@ class CefBrowserMessageFilter : public IPC::ChannelProxy::MessageFilter {
// Message handlers. // Message handlers.
void OnGetNewRenderThreadInfo( void OnGetNewRenderThreadInfo(
CefProcessHostMsg_GetNewRenderThreadInfo_Params* params); CefProcessHostMsg_GetNewRenderThreadInfo_Params* params);
void OnGetNewBrowserInfo(int routing_id, void OnGetNewBrowserInfo(
CefProcessHostMsg_GetNewBrowserInfo_Params* params); int render_view_routing_id,
int render_frame_routing_id,
CefProcessHostMsg_GetNewBrowserInfo_Params* params);
void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params, void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params,
IPC::Message* reply_msg); IPC::Message* reply_msg);

View File

@ -93,7 +93,8 @@ std::string GetOSType() {
std::string GetCommandLine() { std::string GetCommandLine() {
#if defined(OS_WIN) #if defined(OS_WIN)
return WideToUTF8(CommandLine::ForCurrentProcess()->GetCommandLineString()); return base::WideToUTF8(
CommandLine::ForCurrentProcess()->GetCommandLineString());
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
std::string command_line = ""; std::string command_line = "";
typedef std::vector<std::string> ArgvList; typedef std::vector<std::string> ArgvList;

View File

@ -187,8 +187,8 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
bool handled = false; bool handled = false;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id, CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id); render_view_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {
@ -229,8 +229,8 @@ class CefPluginServiceFilter : public content::PluginServiceFilter {
bool allowed = true; bool allowed = true;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id, CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id); render_view_id);
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) { if (client.get()) {
@ -376,21 +376,39 @@ scoped_refptr<CefBrowserInfo> CefContentBrowserClient::CreateBrowserInfo(
} }
scoped_refptr<CefBrowserInfo> scoped_refptr<CefBrowserInfo>
CefContentBrowserClient::GetOrCreateBrowserInfo(int render_process_id, CefContentBrowserClient::GetOrCreateBrowserInfo(
int render_view_id) { 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_); base::AutoLock lock_scope(browser_info_lock_);
BrowserInfoList::const_iterator it = browser_info_list_.begin(); BrowserInfoList::const_iterator it = browser_info_list_.begin();
for (; it != browser_info_list_.end(); ++it) { for (; it != browser_info_list_.end(); ++it) {
const scoped_refptr<CefBrowserInfo>& browser_info = *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; 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. // Must be a popup if it hasn't already been created.
scoped_refptr<CefBrowserInfo> browser_info = scoped_refptr<CefBrowserInfo> browser_info =
new CefBrowserInfo(++next_browser_id_, true); 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); browser_info_list_.push_back(browser_info);
return browser_info; return browser_info;
} }
@ -444,19 +462,40 @@ void CefContentBrowserClient::DestroyAllBrowsers() {
#endif #endif
} }
scoped_refptr<CefBrowserInfo> CefContentBrowserClient::GetBrowserInfo( scoped_refptr<CefBrowserInfo> CefContentBrowserClient::GetBrowserInfoForView(
int render_process_id, int render_view_id) { int render_process_id, int render_routing_id) {
base::AutoLock lock_scope(browser_info_lock_); base::AutoLock lock_scope(browser_info_lock_);
BrowserInfoList::const_iterator it = browser_info_list_.begin(); BrowserInfoList::const_iterator it = browser_info_list_.begin();
for (; it != browser_info_list_.end(); ++it) { for (; it != browser_info_list_.end(); ++it) {
const scoped_refptr<CefBrowserInfo>& browser_info = *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_process_id, render_routing_id)) {
return browser_info; return browser_info;
}
} }
LOG(WARNING) << "No browser info matching process id " << LOG(WARNING) << "No browser info matching view process id " <<
render_process_id << " and view id " << render_view_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_);
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_frame_id_match(
render_process_id, render_routing_id)) {
return browser_info;
}
}
LOG(WARNING) << "No browser info matching frame process id " <<
render_process_id << " and routing id " << render_routing_id;
return scoped_refptr<CefBrowserInfo>(); return scoped_refptr<CefBrowserInfo>();
} }
@ -517,7 +556,7 @@ CefContentBrowserClient::OverrideCreateWebContentsView(
return view; return view;
} }
void CefContentBrowserClient::RenderProcessHostCreated( void CefContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) { content::RenderProcessHost* host) {
host->GetChannel()->AddFilter(new CefBrowserMessageFilter(host)); host->GetChannel()->AddFilter(new CefBrowserMessageFilter(host));
host->AddFilter(new PrintingMessageFilter(host->GetID())); host->AddFilter(new PrintingMessageFilter(host->GetID()));
@ -664,8 +703,8 @@ void CefContentBrowserClient::AllowCertificateError(
} }
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(render_process_id, CefBrowserHostImpl::GetBrowserForView(render_process_id,
render_view_id); render_view_id);
if (!browser.get()) if (!browser.get())
return; return;
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
@ -717,7 +756,7 @@ bool CefContentBrowserClient::CanCreateWindow(
return false; return false;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID( CefBrowserHostImpl::GetBrowserForView(
last_create_window_params_.opener_process_id, last_create_window_params_.opener_process_id,
last_create_window_params_.opener_view_id); last_create_window_params_.opener_view_id);
DCHECK(browser.get()); DCHECK(browser.get());

View File

@ -51,17 +51,22 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
// this race CefBrowserInfo may be created when requested for the first time // this race CefBrowserInfo may be created when requested for the first time
// and before the associated CefBrowserHostImpl is created. // and before the associated CefBrowserHostImpl is created.
scoped_refptr<CefBrowserInfo> CreateBrowserInfo(bool is_popup); scoped_refptr<CefBrowserInfo> CreateBrowserInfo(bool is_popup);
scoped_refptr<CefBrowserInfo> GetOrCreateBrowserInfo(int render_process_id, scoped_refptr<CefBrowserInfo> GetOrCreateBrowserInfo(
int render_view_id); int render_view_process_id,
int render_view_routing_id,
int render_frame_process_id,
int render_frame_routing_id);
void RemoveBrowserInfo(scoped_refptr<CefBrowserInfo> browser_info); void RemoveBrowserInfo(scoped_refptr<CefBrowserInfo> browser_info);
void DestroyAllBrowsers(); void DestroyAllBrowsers();
// Retrieves the CefBrowserInfo matching the specified IDs or an empty // Retrieves the CefBrowserInfo matching the specified IDs or an empty
// pointer if no match is found. It is allowed to add new callers of this // pointer if no match is found. It is allowed to add new callers of this
// method but consider using CefBrowserHostImpl::GetBrowserByRoutingID() // method but consider using CefBrowserHostImpl::GetBrowserFor[View|Frame]()
// instead. // instead.
scoped_refptr<CefBrowserInfo> GetBrowserInfo(int render_process_id, scoped_refptr<CefBrowserInfo> GetBrowserInfoForView(int render_process_id,
int render_view_id); int render_routing_id);
scoped_refptr<CefBrowserInfo> GetBrowserInfoForFrame(int render_process_id,
int render_routing_id);
// Create and return a new CefBrowserContextProxy object. // Create and return a new CefBrowserContextProxy object.
CefBrowserContext* CreateBrowserContextProxy( CefBrowserContext* CreateBrowserContextProxy(
@ -79,7 +84,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
virtual content::WebContentsViewPort* OverrideCreateWebContentsView( virtual content::WebContentsViewPort* OverrideCreateWebContentsView(
content::WebContents* web_contents, content::WebContents* web_contents,
content::RenderViewHostDelegateView** rvhdv) OVERRIDE; content::RenderViewHostDelegateView** rvhdv) OVERRIDE;
virtual void RenderProcessHostCreated( virtual void RenderProcessWillLaunch(
content::RenderProcessHost* host) OVERRIDE; content::RenderProcessHost* host) OVERRIDE;
virtual net::URLRequestContextGetter* CreateRequestContext( virtual net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context, content::BrowserContext* browser_context,

View File

@ -73,7 +73,7 @@ Target::Target(content::WebContents* web_contents) {
content::DevToolsAgentHost::GetOrCreateFor( content::DevToolsAgentHost::GetOrCreateFor(
web_contents->GetRenderViewHost()); web_contents->GetRenderViewHost());
id_ = agent_host_->GetId(); id_ = agent_host_->GetId();
title_ = UTF16ToUTF8(web_contents->GetTitle()); title_ = base::UTF16ToUTF8(web_contents->GetTitle());
url_ = web_contents->GetURL(); url_ = web_contents->GetURL();
content::NavigationController& controller = web_contents->GetController(); content::NavigationController& controller = web_contents->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry(); content::NavigationEntry* entry = controller.GetActiveEntry();

View File

@ -86,7 +86,7 @@ void CefDevToolsFrontend::RenderViewCreated(
void CefDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) { void CefDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) {
web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
base::string16(), base::string16(),
ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);"));
} }
void CefDevToolsFrontend::WebContentsDestroyed( void CefDevToolsFrontend::WebContentsDestroyed(

View File

@ -23,7 +23,7 @@ base::string16 GetPromptText(GtkDialog* dialog) {
GtkWidget* widget = static_cast<GtkWidget*>( GtkWidget* widget = static_cast<GtkWidget*>(
g_object_get_data(G_OBJECT(dialog), kPromptTextId)); g_object_get_data(G_OBJECT(dialog), kPromptTextId));
if (widget) if (widget)
return UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(widget))); return base::UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(widget)));
return base::string16(); return base::string16();
} }
@ -67,7 +67,7 @@ CefJavaScriptDialog::CefJavaScriptDialog(
if (!display_url.empty()) { if (!display_url.empty()) {
title += " - "; title += " - ";
title += UTF16ToUTF8(display_url).c_str(); title += base::UTF16ToUTF8(display_url).c_str();
} }
GtkWidget* window = GtkWidget* window =
@ -79,7 +79,7 @@ CefJavaScriptDialog::CefJavaScriptDialog(
gtk_message_type, gtk_message_type,
buttons, buttons,
"%s", "%s",
UTF16ToUTF8(message_text).c_str()); base::UTF16ToUTF8(message_text).c_str());
g_signal_connect(gtk_dialog_, g_signal_connect(gtk_dialog_,
"delete-event", "delete-event",
G_CALLBACK(gtk_widget_hide_on_delete), G_CALLBACK(gtk_widget_hide_on_delete),
@ -99,7 +99,7 @@ CefJavaScriptDialog::CefJavaScriptDialog(
gtk_dialog_get_content_area(GTK_DIALOG(gtk_dialog_)); gtk_dialog_get_content_area(GTK_DIALOG(gtk_dialog_));
GtkWidget* text_box = gtk_entry_new(); GtkWidget* text_box = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(text_box), gtk_entry_set_text(GTK_ENTRY(text_box),
UTF16ToUTF8(default_prompt_text).c_str()); base::UTF16ToUTF8(default_prompt_text).c_str());
gtk_box_pack_start(GTK_BOX(content_area), text_box, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(content_area), text_box, TRUE, TRUE, 0);
g_object_set_data(G_OBJECT(gtk_dialog_), kPromptTextId, text_box); g_object_set_data(G_OBJECT(gtk_dialog_), kPromptTextId, text_box);
gtk_entry_set_activates_default(GTK_ENTRY(text_box), TRUE); gtk_entry_set_activates_default(GTK_ENTRY(text_box), TRUE);

View File

@ -116,17 +116,17 @@ CefJavaScriptDialog::CefJavaScriptDialog(
base::string16 label; base::string16 label;
switch (message_type) { switch (message_type) {
case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: case content::JAVASCRIPT_MESSAGE_TYPE_ALERT:
label = ASCIIToUTF16("JavaScript Alert"); label = base::ASCIIToUTF16("JavaScript Alert");
break; break;
case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT:
label = ASCIIToUTF16("JavaScript Prompt"); label = base::ASCIIToUTF16("JavaScript Prompt");
break; break;
case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM:
label = ASCIIToUTF16("JavaScript Confirm"); label = base::ASCIIToUTF16("JavaScript Confirm");
break; break;
} }
if (!display_url.empty()) if (!display_url.empty())
label += ASCIIToUTF16(" - ") + display_url; label += base::ASCIIToUTF16(" - ") + display_url;
[alert setMessageText:base::SysUTF16ToNSString(label)]; [alert setMessageText:base::SysUTF16ToNSString(label)];

View File

@ -170,7 +170,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog(
base::string16 new_message_text = base::string16 new_message_text =
message_text + message_text +
ASCIIToUTF16("\n\nIs it OK to leave/reload this page?"); base::ASCIIToUTF16("\n\nIs it OK to leave/reload this page?");
dialog_.reset( dialog_.reset(
new CefJavaScriptDialog(this, new CefJavaScriptDialog(this,

View File

@ -130,7 +130,8 @@ CefJavaScriptDialog::CefJavaScriptDialog(
TCHAR text[64]; TCHAR text[64];
GetWindowText(dialog_win_, text, sizeof(text)/sizeof(TCHAR)); GetWindowText(dialog_win_, text, sizeof(text)/sizeof(TCHAR));
base::string16 new_window_text = text + ASCIIToUTF16(" - ") + display_url; base::string16 new_window_text =
text + base::ASCIIToUTF16(" - ") + display_url;
SetWindowText(dialog_win_, new_window_text.c_str()); SetWindowText(dialog_win_, new_window_text.c_str());
} }

View File

@ -409,7 +409,7 @@ void PrintingMessageFilter::UpdateFileDescriptor(int render_view_id, int fd) {
#endif #endif
void PrintingMessageFilter::OnUpdatePrintSettings( void PrintingMessageFilter::OnUpdatePrintSettings(
int document_cookie, const DictionaryValue& job_settings, int document_cookie, const base::DictionaryValue& job_settings,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query; scoped_refptr<printing::PrinterQuery> printer_query;
printer_query = queue_->PopPrinterQuery(document_cookie); printer_query = queue_->PopPrinterQuery(document_cookie);

View File

@ -237,7 +237,7 @@ void CefRenderWidgetHostViewOSR::DidUpdateBackingStore(
const gfx::Rect& scroll_rect, const gfx::Rect& scroll_rect,
const gfx::Vector2d& scroll_delta, const gfx::Vector2d& scroll_delta,
const std::vector<gfx::Rect>& copy_rects, const std::vector<gfx::Rect>& copy_rects,
const ui::LatencyInfo& latency_info) { const std::vector<ui::LatencyInfo>& latency_info) {
if (!scroll_rect.IsEmpty()) { if (!scroll_rect.IsEmpty()) {
std::vector<gfx::Rect> dirty_rects(copy_rects); std::vector<gfx::Rect> dirty_rects(copy_rects);
dirty_rects.push_back(scroll_rect); dirty_rects.push_back(scroll_rect);
@ -321,8 +321,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
return gfx::Rect(); return gfx::Rect();
} }
void CefRenderWidgetHostViewOSR::OnAccessibilityEvents( void CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManagerIfNeeded() {
const std::vector<AccessibilityHostMsg_EventParams>& params) {
} }
void CefRenderWidgetHostViewOSR::Destroy() { void CefRenderWidgetHostViewOSR::Destroy() {

View File

@ -132,7 +132,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
const gfx::Rect& scroll_rect, const gfx::Rect& scroll_rect,
const gfx::Vector2d& scroll_delta, const gfx::Vector2d& scroll_delta,
const std::vector<gfx::Rect>& copy_rects, const std::vector<gfx::Rect>& copy_rects,
const ui::LatencyInfo& latency_info) OVERRIDE; const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status, virtual void RenderProcessGone(base::TerminationStatus status,
int error_code) OVERRIDE; int error_code) OVERRIDE;
#if defined(OS_WIN) && !defined(USE_AURA) #if defined(OS_WIN) && !defined(USE_AURA)
@ -145,9 +145,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
#endif #endif
virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
virtual void OnAccessibilityEvents( virtual void CreateBrowserAccessibilityManagerIfNeeded() OVERRIDE;
const std::vector<AccessibilityHostMsg_EventParams>& params)
OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE;
virtual void SelectionBoundsChanged( virtual void SelectionBoundsChanged(

View File

@ -21,14 +21,14 @@ namespace {
bool NavigationOnUIThread( bool NavigationOnUIThread(
int64 frame_id, int64 frame_id,
CefRefPtr<CefRequestImpl> request, CefRefPtr<CefRequestImpl> request,
content::RenderViewHost* source, content::WebContents* source,
const navigation_interception::NavigationParams& params) { const navigation_interception::NavigationParams& params) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
bool ignore_navigation = false; bool ignore_navigation = false;
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForHost(source); CefBrowserHostImpl::GetBrowserForContents(source);
DCHECK(browser.get()); DCHECK(browser.get());
if (browser.get()) { if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient(); CefRefPtr<CefClient> client = browser->GetClient();
@ -95,7 +95,7 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(const GURL& url,
int child_id, int child_id,
int route_id) { int route_id) {
CefRefPtr<CefBrowserHostImpl> browser = CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserByRoutingID(child_id, route_id); CefBrowserHostImpl::GetBrowserForView(child_id, route_id);
if (browser.get()) if (browser.get())
browser->HandleExternalProtocol(url); browser->HandleExternalProtocol(url);
return false; return false;

View File

@ -29,7 +29,7 @@ void InstallInternalProtectedHandlers(
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
new net::DataProtocolHandler))); new net::DataProtocolHandler)));
protocol_handlers->insert( protocol_handlers->insert(
std::make_pair(chrome::kFileScheme, std::make_pair(content::kFileScheme,
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
new net::FileProtocolHandler( new net::FileProtocolHandler(
content::BrowserThread::GetBlockingPool()-> content::BrowserThread::GetBlockingPool()->

View File

@ -245,7 +245,3 @@ int CefNetworkDelegate::OnBeforeSocketStreamConnect(
const net::CompletionCallback& callback) { const net::CompletionCallback& callback) {
return net::OK; return net::OK;
} }
void CefNetworkDelegate::OnRequestWaitStateChange(const net::URLRequest& request,
RequestWaitState state) {
}

View File

@ -57,8 +57,6 @@ class CefNetworkDelegate : public net::NetworkDelegate {
virtual int OnBeforeSocketStreamConnect( virtual int OnBeforeSocketStreamConnect(
net::SocketStream* stream, net::SocketStream* stream,
const net::CompletionCallback& callback) OVERRIDE; const net::CompletionCallback& callback) OVERRIDE;
virtual void OnRequestWaitStateChange(const net::URLRequest& request,
RequestWaitState state) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(CefNetworkDelegate); DISALLOW_COPY_AND_ASSIGN(CefNetworkDelegate);
}; };

View File

@ -153,7 +153,8 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() {
url_request_context_.get(), url_request_context_.get(),
url_request_context_->network_delegate(), url_request_context_->network_delegate(),
CefContentBrowserClient::Get()->proxy_config_service().release(), CefContentBrowserClient::Get()->proxy_config_service().release(),
command_line)); command_line,
true));
storage_->set_proxy_service(system_proxy_service.release()); storage_->set_proxy_service(system_proxy_service.release());
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);

View File

@ -62,6 +62,16 @@ class CefCookieStoreProxy : public net::CookieStore {
callback); callback);
} }
virtual void DeleteAllCreatedBetweenForHostAsync(
const base::Time delete_begin,
const base::Time delete_end,
const GURL& url,
const DeleteCallback& callback) OVERRIDE {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore();
cookie_store->DeleteAllCreatedBetweenForHostAsync(delete_begin, delete_end,
url, callback);
}
virtual void DeleteSessionCookiesAsync(const DeleteCallback& callback) virtual void DeleteSessionCookiesAsync(const DeleteCallback& callback)
OVERRIDE { OVERRIDE {
scoped_refptr<net::CookieStore> cookie_store = GetCookieStore(); scoped_refptr<net::CookieStore> cookie_store = GetCookieStore();

View File

@ -23,8 +23,8 @@ void CefBreakpadClient::GetProductNameAndVersion(
base::string16* version, base::string16* version,
base::string16* special_build, base::string16* special_build,
base::string16* channel_name) { base::string16* channel_name) {
*product_name = ASCIIToUTF16("cef"); *product_name = base::ASCIIToUTF16("cef");
*version = UTF8ToUTF16(base::StringPrintf( *version = base::UTF8ToUTF16(base::StringPrintf(
"%d.%d.%d", CEF_VERSION_MAJOR, CHROME_VERSION_BUILD, CEF_REVISION)); "%d.%d.%d", CEF_VERSION_MAJOR, CHROME_VERSION_BUILD, CEF_REVISION));
*special_build = base::string16(); *special_build = base::string16();
*channel_name = base::string16(); *channel_name = base::string16();

View File

@ -40,7 +40,7 @@ IPC_STRUCT_BEGIN(Cef_Request_Params)
IPC_STRUCT_MEMBER(std::string, name) IPC_STRUCT_MEMBER(std::string, name)
// List of message arguments. // List of message arguments.
IPC_STRUCT_MEMBER(ListValue, arguments) IPC_STRUCT_MEMBER(base::ListValue, arguments)
IPC_STRUCT_END() IPC_STRUCT_END()
// Parameters structure for a response. // Parameters structure for a response.
@ -138,7 +138,7 @@ IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewRenderThreadInfo_Params)
IPC_STRUCT_MEMBER(std::vector<Cef_CrossOriginWhiteListEntry_Params>, IPC_STRUCT_MEMBER(std::vector<Cef_CrossOriginWhiteListEntry_Params>,
cross_origin_whitelist_entries) cross_origin_whitelist_entries)
IPC_STRUCT_MEMBER(ListValue, extra_info) IPC_STRUCT_MEMBER(base::ListValue, extra_info)
IPC_STRUCT_END() IPC_STRUCT_END()
// Retrieve information about a newly created render thread. // Retrieve information about a newly created render thread.
@ -153,10 +153,11 @@ IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewBrowserInfo_Params)
IPC_STRUCT_MEMBER(bool, is_window_rendering_disabled) IPC_STRUCT_MEMBER(bool, is_window_rendering_disabled)
IPC_STRUCT_END() IPC_STRUCT_END()
// Retrieve information about a newly created browser window. // Retrieve information about a newly created browser.
IPC_SYNC_MESSAGE_CONTROL1_1( IPC_SYNC_MESSAGE_CONTROL2_1(
CefProcessHostMsg_GetNewBrowserInfo, CefProcessHostMsg_GetNewBrowserInfo,
int /* routing_id */, int /* render_view_routing_id */,
int /* render_frame_routing_id */,
CefProcessHostMsg_GetNewBrowserInfo_Params /* params*/) CefProcessHostMsg_GetNewBrowserInfo_Params /* params*/)
// Sent when a frame is identified for the first time. // Sent when a frame is identified for the first time.

View File

@ -29,8 +29,8 @@ bool IsInternalHandledScheme(const std::string& scheme) {
chrome::kChromeDevToolsScheme, chrome::kChromeDevToolsScheme,
chrome::kChromeUIScheme, chrome::kChromeUIScheme,
chrome::kDataScheme, chrome::kDataScheme,
chrome::kFileScheme, content::kFileScheme,
chrome::kFileSystemScheme, content::kFileSystemScheme,
}; };
for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) { for (size_t i = 0; i < sizeof(schemes) / sizeof(schemes[0]); ++i) {
@ -49,8 +49,8 @@ bool IsInternalProtectedScheme(const std::string& scheme) {
chrome::kBlobScheme, chrome::kBlobScheme,
chrome::kChromeUIScheme, chrome::kChromeUIScheme,
chrome::kDataScheme, chrome::kDataScheme,
chrome::kFileScheme, content::kFileScheme,
chrome::kFileSystemScheme, content::kFileSystemScheme,
#if !defined(DISABLE_FTP_SUPPORT) #if !defined(DISABLE_FTP_SUPPORT)
content::kFtpScheme, content::kFtpScheme,
#endif #endif

View File

@ -171,7 +171,7 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
cef_string_utf8_t* output) { cef_string_utf8_t* output) {
std::string str; std::string str;
bool ret = WideToUTF8(src, src_len, &str); bool ret = base::WideToUTF8(src, src_len, &str);
if (!cef_string_utf8_set(str.c_str(), str.length(), output, true)) if (!cef_string_utf8_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -180,7 +180,7 @@ CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len,
cef_string_wide_t* output) { cef_string_wide_t* output) {
std::wstring str; std::wstring str;
bool ret = UTF8ToWide(src, src_len, &str); bool ret = base::UTF8ToWide(src, src_len, &str);
if (!cef_string_wide_set(str.c_str(), str.length(), output, true)) if (!cef_string_wide_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -189,7 +189,7 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len,
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len,
cef_string_utf16_t* output) { cef_string_utf16_t* output) {
base::string16 str; base::string16 str;
bool ret = WideToUTF16(src, src_len, &str); bool ret = base::WideToUTF16(src, src_len, &str);
if (!cef_string_utf16_set(str.c_str(), str.length(), output, true)) if (!cef_string_utf16_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -198,7 +198,7 @@ CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len,
CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len,
cef_string_wide_t* output) { cef_string_wide_t* output) {
std::wstring str; std::wstring str;
bool ret = UTF16ToWide(src, src_len, &str); bool ret = base::UTF16ToWide(src, src_len, &str);
if (!cef_string_wide_set(str.c_str(), str.length(), output, true)) if (!cef_string_wide_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -207,7 +207,7 @@ CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len,
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len,
cef_string_utf16_t* output) { cef_string_utf16_t* output) {
base::string16 str; base::string16 str;
bool ret = UTF8ToUTF16(src, src_len, &str); bool ret = base::UTF8ToUTF16(src, src_len, &str);
if (!cef_string_utf16_set(str.c_str(), str.length(), output, true)) if (!cef_string_utf16_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -216,7 +216,7 @@ CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len,
CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len,
cef_string_utf8_t* output) { cef_string_utf8_t* output) {
std::string str; std::string str;
bool ret = UTF16ToUTF8(src, src_len, &str); bool ret = base::UTF16ToUTF8(src, src_len, &str);
if (!cef_string_utf8_set(str.c_str(), str.length(), output, true)) if (!cef_string_utf8_set(str.c_str(), str.length(), output, true))
return false; return false;
return ret; return ret;
@ -224,13 +224,13 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len,
CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len,
cef_string_wide_t* output) { cef_string_wide_t* output) {
std::wstring str = ASCIIToWide(std::string(src, src_len)); std::wstring str = base::ASCIIToWide(std::string(src, src_len));
return cef_string_wide_set(str.c_str(), str.length(), output, true); return cef_string_wide_set(str.c_str(), str.length(), output, true);
} }
CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len,
cef_string_utf16_t* output) { cef_string_utf16_t* output) {
base::string16 str = ASCIIToUTF16(std::string(src, src_len)); base::string16 str = base::ASCIIToUTF16(std::string(src, src_len));
return cef_string_utf16_set(str.c_str(), str.length(), output, true); return cef_string_utf16_set(str.c_str(), str.length(), output, true);
} }

View File

@ -227,8 +227,10 @@ bool CefDictionaryValueImpl::HasKey(const CefString& key) {
bool CefDictionaryValueImpl::GetKeys(KeyList& keys) { bool CefDictionaryValueImpl::GetKeys(KeyList& keys) {
CEF_VALUE_VERIFY_RETURN(false, 0); CEF_VALUE_VERIFY_RETURN(false, 0);
for (DictionaryValue::Iterator i(const_value()); !i.IsAtEnd(); i.Advance()) for (base::DictionaryValue::Iterator i(const_value());
!i.IsAtEnd(); i.Advance()) {
keys.push_back(i.key()); keys.push_back(i.key());
}
return true; return true;
} }

View File

@ -52,9 +52,9 @@ const int64 kInvalidFrameId = -1;
blink::WebString FilePathStringToWebString( blink::WebString FilePathStringToWebString(
const base::FilePath::StringType& str) { const base::FilePath::StringType& str) {
#if defined(OS_POSIX) #if defined(OS_POSIX)
return WideToUTF16Hack(base::SysNativeMBToWide(str)); return base::WideToUTF16Hack(base::SysNativeMBToWide(str));
#elif defined(OS_WIN) #elif defined(OS_WIN)
return WideToUTF16Hack(str); return base::WideToUTF16Hack(str);
#endif #endif
} }
@ -296,7 +296,7 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) {
request.setRequestorID(-1); request.setRequestorID(-1);
if (!params.method.empty()) if (!params.method.empty())
request.setHTTPMethod(ASCIIToUTF16(params.method)); request.setHTTPMethod(base::ASCIIToUTF16(params.method));
if (params.referrer.is_valid()) { if (params.referrer.is_valid()) {
WebString referrer = blink::WebSecurityPolicy::generateReferrerHeader( WebString referrer = blink::WebSecurityPolicy::generateReferrerHeader(
@ -321,13 +321,16 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) {
if (params.upload_data.get()) { if (params.upload_data.get()) {
base::string16 method = request.httpMethod(); base::string16 method = request.httpMethod();
if (method == ASCIIToUTF16("GET") || method == ASCIIToUTF16("HEAD")) if (method == base::ASCIIToUTF16("GET") ||
request.setHTTPMethod(ASCIIToUTF16("POST")); method == base::ASCIIToUTF16("HEAD")) {
request.setHTTPMethod(base::ASCIIToUTF16("POST"));
}
if (request.httpHeaderField(ASCIIToUTF16("Content-Type")).length() == 0) { if (request.httpHeaderField(
base::ASCIIToUTF16("Content-Type")).length() == 0) {
request.setHTTPHeaderField( request.setHTTPHeaderField(
ASCIIToUTF16("Content-Type"), base::ASCIIToUTF16("Content-Type"),
ASCIIToUTF16("application/x-www-form-urlencoded")); base::ASCIIToUTF16("application/x-www-form-urlencoded"));
} }
blink::WebHTTPBody body; blink::WebHTTPBody body;
@ -670,7 +673,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
if (is_javascript) { if (is_javascript) {
web_frame->executeScript( web_frame->executeScript(
WebScriptSource(UTF8ToUTF16(code), WebScriptSource(base::UTF8ToUTF16(code),
GURL(script_url), GURL(script_url),
script_start_line)); script_start_line));
success = true; success = true;
@ -699,7 +702,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) {
} else if (LowerCaseEqualsASCII(command, "gettext")) { } else if (LowerCaseEqualsASCII(command, "gettext")) {
response = webkit_glue::DumpDocumentText(web_frame); response = webkit_glue::DumpDocumentText(web_frame);
success = true; success = true;
} else if (web_frame->executeCommand(UTF8ToUTF16(command))) { } else if (web_frame->executeCommand(base::UTF8ToUTF16(command))) {
success = true; success = true;
} }
} }

View File

@ -421,40 +421,14 @@ void CefContentRendererClient::RenderThreadStarted() {
} }
} }
void CefContentRendererClient::RenderFrameCreated(
content::RenderFrame* render_frame) {
BrowserCreated(render_frame->GetRenderView(), render_frame);
}
void CefContentRendererClient::RenderViewCreated( void CefContentRendererClient::RenderViewCreated(
content::RenderView* render_view) { content::RenderView* render_view) {
// Retrieve the new browser information synchronously. BrowserCreated(render_view, render_view->GetMainRenderFrame());
CefProcessHostMsg_GetNewBrowserInfo_Params params;
content::RenderThread::Get()->Send(
new CefProcessHostMsg_GetNewBrowserInfo(render_view->GetRoutingID(),
&params));
DCHECK_GT(params.browser_id, 0);
#if defined(OS_MACOSX)
// FIXME: It would be better if this API would be a callback from the
// WebKit layer, or if it would be exposed as an WebView instance method; the
// current implementation uses a static variable, and WebKit needs to be
// patched in order to make it work for each WebView instance
render_view->GetWebView()->setUseExternalPopupMenusThisInstance(
!params.is_window_rendering_disabled);
#endif
CefRefPtr<CefBrowserImpl> browser =
new CefBrowserImpl(render_view, params.browser_id, params.is_popup,
params.is_window_rendering_disabled);
browsers_.insert(std::make_pair(render_view, browser));
new CefPrerendererClient(render_view);
new printing::PrintWebViewHelper(render_view);
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get())
handler->OnBrowserCreated(browser.get());
}
} }
bool CefContentRendererClient::OverrideCreatePlugin( bool CefContentRendererClient::OverrideCreatePlugin(
@ -666,6 +640,50 @@ void CefContentRendererClient::WillDestroyCurrentMessageLoop() {
single_process_cleanup_complete_ = true; single_process_cleanup_complete_ = true;
} }
void CefContentRendererClient::BrowserCreated(
content::RenderView* render_view,
content::RenderFrame* render_frame) {
// Retrieve the browser information synchronously. This will also register
// the routing ids with the browser info object in the browser process.
CefProcessHostMsg_GetNewBrowserInfo_Params params;
content::RenderThread::Get()->Send(
new CefProcessHostMsg_GetNewBrowserInfo(
render_view->GetRoutingID(),
render_frame->GetRoutingID(),
&params));
DCHECK_GT(params.browser_id, 0);
// Don't create another browser object if one already exists for the view.
if (GetBrowserForView(render_view))
return;
#if defined(OS_MACOSX)
// FIXME: It would be better if this API would be a callback from the
// WebKit layer, or if it would be exposed as an WebView instance method; the
// current implementation uses a static variable, and WebKit needs to be
// patched in order to make it work for each WebView instance
render_view->GetWebView()->setUseExternalPopupMenusThisInstance(
!params.is_window_rendering_disabled);
#endif
CefRefPtr<CefBrowserImpl> browser =
new CefBrowserImpl(render_view, params.browser_id, params.is_popup,
params.is_window_rendering_disabled);
browsers_.insert(std::make_pair(render_view, browser));
new CefPrerendererClient(render_view);
new printing::PrintWebViewHelper(render_view);
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get())
handler->OnBrowserCreated(browser.get());
}
}
void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() { void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));

View File

@ -75,6 +75,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
private: private:
// ContentRendererClient implementation. // ContentRendererClient implementation.
virtual void RenderThreadStarted() OVERRIDE; virtual void RenderThreadStarted() OVERRIDE;
virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE;
virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE;
virtual bool OverrideCreatePlugin( virtual bool OverrideCreatePlugin(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
@ -100,6 +101,9 @@ class CefContentRendererClient : public content::ContentRendererClient,
// MessageLoop::DestructionObserver implementation. // MessageLoop::DestructionObserver implementation.
virtual void WillDestroyCurrentMessageLoop() OVERRIDE; virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
void BrowserCreated(content::RenderView* render_view,
content::RenderFrame* render_frame);
// Perform cleanup work for single-process mode. // Perform cleanup work for single-process mode.
void RunSingleProcessCleanupOnUIThread(); void RunSingleProcessCleanupOnUIThread();

View File

@ -242,11 +242,11 @@ CefString CefDOMNodeImpl::GetValue() {
base::string16 value; base::string16 value;
const base::string16& form_control_type = formElement.formControlType(); const base::string16& form_control_type = formElement.formControlType();
if (form_control_type == ASCIIToUTF16("text")) { if (form_control_type == base::ASCIIToUTF16("text")) {
const WebInputElement& input_element = const WebInputElement& input_element =
formElement.toConst<WebInputElement>(); formElement.toConst<WebInputElement>();
value = input_element.value(); value = input_element.value();
} else if (form_control_type == ASCIIToUTF16("select-one")) { } else if (form_control_type == base::ASCIIToUTF16("select-one")) {
const WebSelectElement& select_element = const WebSelectElement& select_element =
formElement.toConst<WebSelectElement>(); formElement.toConst<WebSelectElement>();
value = select_element.value(); value = select_element.value();

View File

@ -1053,12 +1053,13 @@ CefV8ValueImpl::Handle::~Handle() {
(tracker_ ? (tracker_ ?
new CefV8MakeWeakParam(isolate(), context_state_, tracker_) : NULL), new CefV8MakeWeakParam(isolate(), context_state_, tracker_) : NULL),
TrackDestructor); TrackDestructor);
} else { } else if (tracker_) {
handle_.Reset(); delete tracker_;
if (tracker_)
delete tracker_;
} }
// Always call Reset() on a persistent handle to avoid the
// CHECK(state() != NEAR_DEATH) in V8's PostGarbageCollectionProcessing.
handle_.Reset();
tracker_ = NULL; tracker_ = NULL;
} }

View File

@ -1,6 +1,6 @@
Index: public/renderer/content_renderer_client.cc Index: public/renderer/content_renderer_client.cc
=================================================================== ===================================================================
--- public/renderer/content_renderer_client.cc (revision 240657) --- public/renderer/content_renderer_client.cc (revision 242756)
+++ public/renderer/content_renderer_client.cc (working copy) +++ public/renderer/content_renderer_client.cc (working copy)
@@ -91,7 +91,6 @@ @@ -91,7 +91,6 @@
return false; return false;
@ -20,7 +20,7 @@ Index: public/renderer/content_renderer_client.cc
const GURL& url, const GURL& url,
Index: public/renderer/content_renderer_client.h Index: public/renderer/content_renderer_client.h
=================================================================== ===================================================================
--- public/renderer/content_renderer_client.h (revision 240657) --- public/renderer/content_renderer_client.h (revision 242756)
+++ public/renderer/content_renderer_client.h (working copy) +++ public/renderer/content_renderer_client.h (working copy)
@@ -172,7 +172,6 @@ @@ -172,7 +172,6 @@
// Returns true if a popup window should be allowed. // Returns true if a popup window should be allowed.
@ -40,9 +40,9 @@ Index: public/renderer/content_renderer_client.h
// If |send_referrer| is set to false (which is the default), no referrer // If |send_referrer| is set to false (which is the default), no referrer
Index: renderer/render_view_impl.cc Index: renderer/render_view_impl.cc
=================================================================== ===================================================================
--- renderer/render_view_impl.cc (revision 240657) --- renderer/render_view_impl.cc (revision 242756)
+++ renderer/render_view_impl.cc (working copy) +++ renderer/render_view_impl.cc (working copy)
@@ -3134,7 +3134,6 @@ @@ -3124,7 +3124,6 @@
WebFrame* frame, WebDataSource::ExtraData* extraData, WebFrame* frame, WebDataSource::ExtraData* extraData,
const WebURLRequest& request, WebNavigationType type, const WebURLRequest& request, WebNavigationType type,
WebNavigationPolicy default_policy, bool is_redirect) { WebNavigationPolicy default_policy, bool is_redirect) {
@ -50,7 +50,7 @@ Index: renderer/render_view_impl.cc
// The handlenavigation API is deprecated and will be removed once // The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved. // crbug.com/325351 is resolved.
if (request.url() != GURL(kSwappedOutURL) && if (request.url() != GURL(kSwappedOutURL) &&
@@ -3149,7 +3148,6 @@ @@ -3139,7 +3138,6 @@
is_redirect)) { is_redirect)) {
return blink::WebNavigationPolicyIgnore; return blink::WebNavigationPolicyIgnore;
} }

View File

@ -1,6 +1,6 @@
Index: desktop_aura/desktop_root_window_host_win.cc Index: desktop_aura/desktop_root_window_host_win.cc
=================================================================== ===================================================================
--- desktop_aura/desktop_root_window_host_win.cc (revision 241258) --- desktop_aura/desktop_root_window_host_win.cc (revision 242756)
+++ desktop_aura/desktop_root_window_host_win.cc (working copy) +++ desktop_aura/desktop_root_window_host_win.cc (working copy)
@@ -131,7 +131,9 @@ @@ -131,7 +131,9 @@
native_widget_delegate_); native_widget_delegate_);
@ -13,7 +13,7 @@ Index: desktop_aura/desktop_root_window_host_win.cc
parent_hwnd = parent_hwnd =
params.parent->GetDispatcher()->host()->GetAcceleratedWidget(); params.parent->GetDispatcher()->host()->GetAcceleratedWidget();
} }
@@ -751,7 +753,7 @@ @@ -752,7 +754,7 @@
void DesktopRootWindowHostWin::HandleCreate() { void DesktopRootWindowHostWin::HandleCreate() {
// TODO(beng): moar // TODO(beng): moar
@ -24,7 +24,7 @@ Index: desktop_aura/desktop_root_window_host_win.cc
Index: desktop_aura/desktop_screen_win.cc Index: desktop_aura/desktop_screen_win.cc
=================================================================== ===================================================================
--- desktop_aura/desktop_screen_win.cc (revision 241258) --- desktop_aura/desktop_screen_win.cc (revision 242756)
+++ desktop_aura/desktop_screen_win.cc (working copy) +++ desktop_aura/desktop_screen_win.cc (working copy)
@@ -54,6 +54,8 @@ @@ -54,6 +54,8 @@
} }
@ -37,9 +37,9 @@ Index: desktop_aura/desktop_screen_win.cc
} }
Index: widget.h Index: widget.h
=================================================================== ===================================================================
--- widget.h (revision 241258) --- widget.h (revision 242756)
+++ widget.h (working copy) +++ widget.h (working copy)
@@ -201,6 +201,7 @@ @@ -197,6 +197,7 @@
// Should the widget be double buffered? Default is false. // Should the widget be double buffered? Default is false.
bool double_buffer; bool double_buffer;
gfx::NativeView parent; gfx::NativeView parent;

View File

@ -1,33 +1,33 @@
Index: public/web/WebView.h Index: public/web/WebView.h
=================================================================== ===================================================================
--- public/web/WebView.h (revision 163979) --- public/web/WebView.h (revision 164381)
+++ public/web/WebView.h (working copy) +++ public/web/WebView.h (working copy)
@@ -441,6 +441,7 @@ @@ -417,6 +417,7 @@
// Sets whether select popup menus should be rendered by the browser. // Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool); BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0; + virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Hides any popup (suggestions, selects...) that might be showing.
// Visited link state -------------------------------------------------- virtual void hidePopups() = 0;
Index: Source/web/ChromeClientImpl.cpp Index: Source/web/ChromeClientImpl.cpp
=================================================================== ===================================================================
--- Source/web/ChromeClientImpl.cpp (revision 163979) --- Source/web/ChromeClientImpl.cpp (revision 164381)
+++ Source/web/ChromeClientImpl.cpp (working copy) +++ Source/web/ChromeClientImpl.cpp (working copy)
@@ -867,7 +867,7 @@ @@ -851,7 +851,7 @@
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
{ {
- if (WebViewImpl::useExternalPopupMenus()) - if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus()) + if (m_webView->useExternalPopupMenus())
return adoptRef(new ExternalPopupMenu(frame, client, m_webView->client())); return adoptRef(new ExternalPopupMenu(frame, client, *m_webView));
return adoptRef(new PopupMenuChromium(frame, client)); return adoptRef(new PopupMenuChromium(frame, client));
Index: Source/web/WebViewImpl.cpp Index: Source/web/WebViewImpl.cpp
=================================================================== ===================================================================
--- Source/web/WebViewImpl.cpp (revision 163979) --- Source/web/WebViewImpl.cpp (revision 164381)
+++ Source/web/WebViewImpl.cpp (working copy) +++ Source/web/WebViewImpl.cpp (working copy)
@@ -393,6 +393,7 @@ @@ -348,6 +348,7 @@
, m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false) , m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false) , m_contextMenuAllowed(false)
@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp
, m_doingDragAndDrop(false) , m_doingDragAndDrop(false)
, m_ignoreInputEvents(false) , m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0) , m_compositorDeviceScaleFactorOverride(0)
@@ -3708,9 +3709,14 @@ @@ -3552,9 +3553,14 @@
updateLayerTreeViewport(); updateLayerTreeViewport();
} }
@ -53,9 +53,9 @@ Index: Source/web/WebViewImpl.cpp
void WebViewImpl::startDragging(Frame* frame, void WebViewImpl::startDragging(Frame* frame,
Index: Source/web/WebViewImpl.h Index: Source/web/WebViewImpl.h
=================================================================== ===================================================================
--- Source/web/WebViewImpl.h (revision 163979) --- Source/web/WebViewImpl.h (revision 164381)
+++ Source/web/WebViewImpl.h (working copy) +++ Source/web/WebViewImpl.h (working copy)
@@ -416,7 +416,8 @@ @@ -398,7 +398,8 @@
// Returns true if popup menus should be rendered by the browser, false if // Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default). // they should be rendered by WebKit (which is the default).
@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h
bool contextMenuAllowed() const bool contextMenuAllowed() const
{ {
@@ -714,6 +715,8 @@ @@ -680,6 +681,8 @@
bool m_contextMenuAllowed; bool m_contextMenuAllowed;

View File

@ -52,6 +52,11 @@ class TitleTestHandler : public TestHandler {
} else if (step_ == 1 || step_ == 3) { } else if (step_ == 1 || step_ == 3) {
EXPECT_STREQ(kTitleStr2, title_str.c_str()); EXPECT_STREQ(kTitleStr2, title_str.c_str());
} else if (step_ == 4) { } else if (step_ == 4) {
// Ignore the unexpected notification of the page URL.
// Related bug: http://crbug.com/331351
if (title_str == &kTitleUrl2[7])
return;
EXPECT_STREQ(kTitleStr3, title_str.c_str()); EXPECT_STREQ(kTitleStr3, title_str.c_str());
} }