Update to Chromium revision fea84635 (#321386)

- Use a separate utility process for V8 proxy resolution (see http://crbug.com/11746).
This commit is contained in:
Marshall Greenblatt
2015-03-19 18:06:16 -04:00
parent aaab7bdb35
commit d7f7c61ddd
34 changed files with 137 additions and 266 deletions

View File

@@ -62,7 +62,7 @@ void WriteTempFileAndView(scoped_refptr<base::RefCountedString> str) {
int write_ct = base::WriteFile(tmp_file, data.c_str(), data.size());
DCHECK_EQ(static_cast<int>(data.size()), write_ct);
ui::win::OpenItemViaShell(tmp_file);
ui::win::OpenFileViaShell(tmp_file);
}
// From ui/base/dialogs/select_file_dialog_win.cc.

View File

@@ -72,6 +72,11 @@ chrome_variations::VariationsService*
return NULL;
}
PromoResourceService* ChromeBrowserProcessStub::promo_resource_service() {
NOTIMPLEMENTED();
return NULL;
}
BrowserProcessPlatformPart* ChromeBrowserProcessStub::platform_part() {
NOTIMPLEMENTED();
return NULL;
@@ -217,11 +222,6 @@ ChromeNetLog* ChromeBrowserProcessStub::net_log() {
return NULL;
}
prerender::PrerenderTracker* ChromeBrowserProcessStub::prerender_tracker() {
NOTIMPLEMENTED();
return NULL;
}
component_updater::ComponentUpdateService*
ChromeBrowserProcessStub::component_updater() {
NOTIMPLEMENTED();

View File

@@ -40,6 +40,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
PrefService* local_state() override;
net::URLRequestContextGetter* system_request_context() override;
chrome_variations::VariationsService* variations_service() override;
PromoResourceService* promo_resource_service() override;
BrowserProcessPlatformPart* platform_part() override;
extensions::EventRouterForwarder*
extension_event_router_forwarder() override;
@@ -80,7 +81,6 @@ class ChromeBrowserProcessStub : public BrowserProcess {
#endif
ChromeNetLog* net_log() override;
prerender::PrerenderTracker* prerender_tracker() override;
component_updater::ComponentUpdateService*
component_updater() override;
CRLSetFetcher* crl_set_fetcher() override;

View File

@@ -184,8 +184,7 @@ class CefAllowCertificateErrorCallbackImpl
class CefGeolocationCallbackImpl : public CefGeolocationCallback {
public:
typedef base::Callback<void(bool)> // NOLINT(readability/function)
CallbackType;
typedef base::Callback<void(content::PermissionStatus)> CallbackType;
explicit CefGeolocationCallbackImpl(const CallbackType& callback)
: callback_(callback) {}
@@ -198,7 +197,8 @@ class CefGeolocationCallbackImpl : public CefGeolocationCallback {
UserDidOptIntoLocationServices();
}
callback_.Run(allow);
callback_.Run(allow ? content::PERMISSION_STATUS_GRANTED :
content::PERMISSION_STATUS_DENIED);
callback_.Reset();
}
} else {
@@ -212,9 +212,10 @@ class CefGeolocationCallbackImpl : public CefGeolocationCallback {
}
private:
static void Run(const CallbackType& callback, bool allow) {
static void Run(const CallbackType& callback,
content::PermissionStatus status) {
CEF_REQUIRE_UIT();
callback.Run(allow);
callback.Run(status);
}
CallbackType callback_;
@@ -767,11 +768,11 @@ void CefContentBrowserClient::RequestPermission(
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
const base::Callback<void(bool)>& result_callback) {
const base::Callback<void(content::PermissionStatus)>& result_callback) {
CEF_REQUIRE_UIT();
if (permission != content::PermissionType::PERMISSION_GEOLOCATION) {
result_callback.Run(false);
result_callback.Run(content::PERMISSION_STATUS_DENIED);
return;
}
@@ -800,7 +801,7 @@ void CefContentBrowserClient::RequestPermission(
if (!proceed) {
// Disallow geolocation access by default.
result_callback.Run(false);
result_callback.Run(content::PERMISSION_STATUS_DENIED);
}
}

View File

@@ -112,11 +112,12 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
const base::Callback<void(bool)>& result_callback) override;
const base::Callback<void(content::PermissionStatus)>& result_callback)
override;
void CancelPermissionRequest(content::PermissionType permission,
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame) override;
content::WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame) override;
bool CanCreateWindow(const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,

View File

@@ -19,7 +19,6 @@
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/net/sqlite_persistent_cookie_store.h"
#include "content/public/browser/cookie_crypto_delegate.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/parsed_cookie.h"
#include "net/url_request/url_request_context.h"

View File

@@ -112,17 +112,19 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
inspected_browser->GetWindowHandle(), true,
inspected_browser->GetRequestContext());
scoped_refptr<content::DevToolsAgentHost> agent_host =
content::DevToolsAgentHost::GetOrCreateFor(
inspected_browser->GetWebContents());
if (!inspect_element_at.IsEmpty())
content::WebContents* inspected_contents =
inspected_browser->GetWebContents();
if (!inspect_element_at.IsEmpty()) {
scoped_refptr<content::DevToolsAgentHost> agent_host =
content::DevToolsAgentHost::GetOrCreateFor(inspected_contents);
agent_host->InspectElement(inspect_element_at.x, inspect_element_at.y);
}
// CefDevToolsFrontend will delete itself when the frontend WebContents is
// destroyed.
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
agent_host.get());
inspected_contents);
// Need to load the URL after creating the DevTools objects.
CefDevToolsDelegate* delegate =
@@ -163,10 +165,10 @@ void CefDevToolsFrontend::DisconnectFromTarget() {
CefDevToolsFrontend::CefDevToolsFrontend(
CefRefPtr<CefBrowserHostImpl> frontend_browser,
content::DevToolsAgentHost* agent_host)
content::WebContents* inspected_contents)
: WebContentsObserver(frontend_browser->GetWebContents()),
frontend_browser_(frontend_browser),
agent_host_(agent_host),
inspected_contents_(inspected_contents),
weak_factory_(this) {
}
@@ -184,11 +186,10 @@ void CefDevToolsFrontend::RenderViewCreated(
}
}
void CefDevToolsFrontend::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
if (agent_host_)
agent_host_->AttachClient(this);
void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
agent_host_ =
content::DevToolsAgentHost::GetOrCreateFor(inspected_contents_);
agent_host_->AttachClient(this);
}
void CefDevToolsFrontend::WebContentsDestroyed() {
@@ -340,11 +341,6 @@ void CefDevToolsFrontend::SendMessageAck(int request_id,
&id_value, arg, nullptr);
}
void CefDevToolsFrontend::AttachTo(content::WebContents* inspected_contents) {
DisconnectFromTarget();
agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(inspected_contents);
}
void CefDevToolsFrontend::AgentHostClosed(
content::DevToolsAgentHost* agent_host,
bool replaced) {

View File

@@ -56,7 +56,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
private:
CefDevToolsFrontend(CefRefPtr<CefBrowserHostImpl> frontend_browser,
content::DevToolsAgentHost* agent_host);
content::WebContents* inspected_contents);
~CefDevToolsFrontend() override;
// content::DevToolsAgentHostClient implementation.
@@ -64,13 +64,10 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
bool replaced) override;
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
const std::string& message) override;
void AttachTo(content::WebContents* inspected_contents);
// WebContentsObserver overrides
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) override;
void DocumentAvailableInMainFrame() override;
void WebContentsDestroyed() override;
// content::DevToolsFrontendHost::Delegate implementation.
@@ -85,6 +82,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
const base::Value* arg1);
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
content::WebContents* inspected_contents_;
scoped_refptr<content::DevToolsAgentHost> agent_host_;
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;

View File

@@ -187,8 +187,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
void PrintViewManagerBase::OnShowInvalidPrinterSettingsError() {
}
void PrintViewManagerBase::DidStartLoading(
content::RenderViewHost* render_view_host) {
void PrintViewManagerBase::DidStartLoading() {
UpdateScriptedPrintingBlocked();
}

View File

@@ -70,8 +70,7 @@ class PrintViewManagerBase : public content::NotificationObserver,
const content::NotificationDetails& details) override;
// content::WebContentsObserver implementation.
void DidStartLoading(
content::RenderViewHost* render_view_host) override;
void DidStartLoading() override;
// Cancels the print job.
void NavigationStopped() override;

View File

@@ -294,12 +294,17 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
[content_view setWantsLayer:YES];
browser_compositor_ = content::BrowserCompositorMac::Create();
compositor_.reset(browser_compositor_->compositor());
compositor_->SetRootLayer(root_layer_.get());
browser_compositor_->accelerated_widget_mac()->SetNSView(this);
browser_compositor_->compositor()->SetVisible(true);
DCHECK(compositor_);
// CEF needs the browser compositor to remain responsive whereas normal
// rendering on OS X does not. This effectively reverts the changes from
// https://crbug.com/463988#c6
compositor_->SetLocksWillTimeOut(true);
browser_compositor_->Unsuspend();
}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {

View File

@@ -27,7 +27,6 @@
#include "chrome/browser/net/proxy_service_factory.h"
#include "content/browser/net/sqlite_persistent_cookie_store.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_crypto_delegate.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"

View File

@@ -24,6 +24,7 @@
#include "content/public/renderer/document_state.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view.h"
#include "content/renderer/navigation_state_impl.h"
#include "content/renderer/render_view_impl.h"
#include "net/http/http_util.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -582,8 +583,10 @@ void CefBrowserImpl::DidCreateDataSource(blink::WebLocalFrame* frame,
content::DocumentState* document_state =
content::DocumentState::FromDataSource(ds);
document_state->set_navigation_state(
content::NavigationState::CreateBrowserInitiated(-1, -1, false,
ui::PAGE_TRANSITION_LINK));
content::NavigationStateImpl::CreateBrowserInitiated(
content::CommonNavigationParams(),
content::StartNavigationParams(),
content::HistoryNavigationParams()));
}
if (frame->parent() == 0) {

View File

@@ -624,8 +624,10 @@ bool CefContentRendererClient::HandleNavigation(
}
void CefContentRendererClient::DidCreateScriptContext(
blink::WebFrame* frame, v8::Handle<v8::Context> context,
int extension_group, int world_id) {
blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
int world_id) {
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
DCHECK(browserPtr.get());

View File

@@ -94,7 +94,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect) override;
void DidCreateScriptContext(blink::WebFrame* frame,
void DidCreateScriptContext(blink::WebLocalFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
int world_id) override;

View File

@@ -7,7 +7,9 @@
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/utility/utility_message_handler.h"
#include "content/public/common/service_registry.h"
#include "content/public/utility/utility_thread.h"
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
#if defined(OS_WIN)
#include "libcef/utility/printing_handler.h"
@@ -19,6 +21,15 @@ bool Send(IPC::Message* message) {
return content::UtilityThread::Get()->Send(message);
}
void CreateProxyResolverFactory(
mojo::InterfaceRequest<net::interfaces::ProxyResolverFactory> request) {
// MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it
// is connected to. When that message pipe is closed, either explicitly on the
// other end (in the browser process), or by a connection error, this object
// will be destroyed.
new net::MojoProxyResolverFactoryImpl(request.Pass());
}
} // namespace
CefContentUtilityClient::CefContentUtilityClient() {
@@ -47,6 +58,12 @@ bool CefContentUtilityClient::OnMessageReceived(
return handled;
}
void CefContentUtilityClient::RegisterMojoServices(
content::ServiceRegistry* registry) {
registry->AddService<net::interfaces::ProxyResolverFactory>(
base::Bind(CreateProxyResolverFactory));
}
void CefContentUtilityClient::OnStartupPing() {
Send(new ChromeUtilityHostMsg_ProcessStarted);
// Don't release the process, we assume further messages are on the way.

View File

@@ -17,6 +17,7 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
~CefContentUtilityClient() override;
bool OnMessageReceived(const IPC::Message& message) override;
void RegisterMojoServices(content::ServiceRegistry* registry) override;
private:
// IPC message handlers.