Update to Chromium revision c03558c9 (#326273)

This commit is contained in:
Marshall Greenblatt
2015-04-23 13:03:42 +03:00
parent aeb35d2f36
commit faafdd2cd7
28 changed files with 154 additions and 103 deletions

View File

@@ -479,7 +479,7 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::CreateInternal(
#if defined(OS_LINUX) || defined(OS_ANDROID)
content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs();
CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params,
(gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL)));
(gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), NULL)));
prefs->should_antialias_text = params.antialiasing;
prefs->use_subpixel_positioning = params.subpixel_positioning;
prefs->hinting = params.hinting;
@@ -2183,14 +2183,6 @@ bool CefBrowserHostImpl::TakeFocus(content::WebContents* source,
return false;
}
void CefBrowserHostImpl::WebContentsFocused(content::WebContents* contents) {
if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get())
handler->OnGotFocus(this);
}
}
bool CefBrowserHostImpl::HandleContextMenu(
const content::ContextMenuParams& params) {
if (!menu_creator_.get())
@@ -2641,6 +2633,14 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
return handled;
}
void CefBrowserHostImpl::OnWebContentsFocused() {
if (client_.get()) {
CefRefPtr<CefFocusHandler> handler = client_->GetFocusHandler();
if (handler.get())
handler->OnGotFocus(this);
}
}
bool CefBrowserHostImpl::Send(IPC::Message* message) {
if (CEF_CURRENTLY_ON_UIT()) {
if (queue_messages_) {

View File

@@ -363,7 +363,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool* proceed_to_fire_unload) override;
bool TakeFocus(content::WebContents* source,
bool reverse) override;
void WebContentsFocused(content::WebContents* contents) override;
bool HandleContextMenu(
const content::ContextMenuParams& params) override;
bool PreHandleKeyboardEvent(
@@ -451,6 +450,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& candidates) override;
bool OnMessageReceived(const IPC::Message& message) override;
void OnWebContentsFocused() override;
// Override to provide a thread safe implementation.
bool Send(IPC::Message* message) override;

View File

@@ -45,6 +45,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/storage_quota_params.h"
#include "content/public/common/web_preferences.h"
#include "gin/v8_initializer.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/ui_base_switches.h"
#include "url/gurl.h"
@@ -642,6 +643,15 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
arraysize(kSwitchNames));
}
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (process_type != switches::kZygoteProcess) {
command_line->AppendSwitch(switches::kV8NativesPassedByFD);
command_line->AppendSwitch(switches::kV8SnapshotPassedByFD);
}
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#endif // OS_POSIX && !OS_MACOSX
#if defined(OS_LINUX)
if (process_type == switches::kZygoteProcess) {
// Propagate the following switches to the zygone command line (along with
@@ -902,6 +912,21 @@ void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::FileDescriptorInfo* mappings) {
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
int v8_natives_fd = -1;
int v8_snapshot_fd = -1;
if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
&v8_snapshot_fd)) {
v8_natives_fd_.reset(v8_natives_fd);
v8_snapshot_fd_.reset(v8_snapshot_fd);
}
}
DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
#endif // V8_USE_EXTERNAL_STARTUP_DATA
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);

View File

@@ -168,6 +168,11 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
scoped_ptr<CefResourceDispatcherHostDelegate>
resource_dispatcher_host_delegate_;
#if defined(OS_POSIX) && !defined(OS_MACOSX)
base::ScopedFD v8_natives_fd_;
base::ScopedFD v8_snapshot_fd_;
#endif
base::Lock browser_info_lock_;
// Access must be protected by |browser_info_lock_|.

View File

@@ -17,7 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/devtools_agent_host.h"
#include "base/time/time.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/devtools_target.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
@@ -42,7 +42,7 @@ const char kTargetTypeOther[] = "other";
const int kBackLog = 10;
class TCPServerSocketFactory
: public content::DevToolsHttpHandler::ServerSocketFactory {
: public devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory {
public:
TCPServerSocketFactory(const std::string& address, uint16 port)
: address_(address), port_(port) {
@@ -65,10 +65,11 @@ class TCPServerSocketFactory
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>
scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory(uint16 port) {
return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port));
return scoped_ptr<
devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port));
}
class Target : public content::DevToolsTarget {
@@ -137,11 +138,15 @@ bool Target::Close() const {
// CefDevToolsDelegate
CefDevToolsDelegate::CefDevToolsDelegate(uint16 port) {
devtools_http_handler_.reset(content::DevToolsHttpHandler::Start(
devtools_http_handler_.reset(new devtools_http_handler::DevToolsHttpHandler(
CreateSocketFactory(port),
std::string(),
this,
base::FilePath()));
new CefDevToolsManagerDelegate(),
base::FilePath(),
base::FilePath(),
std::string(),
CefContentClient::Get()->GetUserAgent()));
}
CefDevToolsDelegate::~CefDevToolsDelegate() {
@@ -152,7 +157,8 @@ void CefDevToolsDelegate::Stop() {
// Release the reference before deleting the handler. Deleting the handler
// will delete |this| and no members of |this| should be accessed after that
// call.
content::DevToolsHttpHandler* handler = devtools_http_handler_.release();
devtools_http_handler::DevToolsHttpHandler* handler =
devtools_http_handler_.release();
delete handler;
}
@@ -161,12 +167,9 @@ std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {
IDR_CEF_DEVTOOLS_DISCOVERY_PAGE, ui::SCALE_FACTOR_NONE).as_string();
}
bool CefDevToolsDelegate::BundlesFrontendResources() {
return true;
}
base::FilePath CefDevToolsDelegate::GetDebugFrontendDir() {
return base::FilePath();
std::string CefDevToolsDelegate::GetFrontendResource(
const std::string& path) {
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
}
std::string CefDevToolsDelegate::GetChromeDevToolsURL() {

View File

@@ -12,16 +12,17 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "components/devtools_http_handler/devtools_http_handler.h"
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/devtools_http_handler_delegate.h"
#include "content/public/browser/devtools_manager_delegate.h"
namespace content {
class RenderViewHost;
}
class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
class CefDevToolsDelegate :
public devtools_http_handler::DevToolsHttpHandlerDelegate {
public:
explicit CefDevToolsDelegate(uint16 port);
~CefDevToolsDelegate() override;
@@ -31,14 +32,13 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
// DevToolsHttpHandlerDelegate overrides.
std::string GetDiscoveryPageHTML() override;
bool BundlesFrontendResources() override;
base::FilePath GetDebugFrontendDir() override;
std::string GetFrontendResource(const std::string& path) override;
// Returns the chrome-devtools URL.
std::string GetChromeDevToolsURL();
private:
scoped_ptr<content::DevToolsHttpHandler> devtools_http_handler_;
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate);
};

View File

@@ -17,7 +17,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -251,6 +250,22 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id)));
fetcher->Start();
return;
} else if (method == "getPreferences") {
SendMessageAck(request_id, &preferences_);
return;
} else if (method == "setPreference") {
std::string name;
std::string value;
if (!params->GetString(0, &name) ||
!params->GetString(1, &value)) {
return;
}
preferences_.SetStringWithoutPathExpansion(name, value);
} else if (method == "removePreference") {
std::string name;
if (!params->GetString(0, &name))
return;
preferences_.RemoveWithoutPathExpansion(name, nullptr);
} else {
return;
}

View File

@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/web_contents_observer.h"
@@ -64,6 +65,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
bool replaced) override;
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
const std::string& message) override;
base::DictionaryValue* preferences() { return &preferences_; }
// WebContentsObserver overrides
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
@@ -87,6 +89,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
PendingRequestsMap pending_requests_;
base::DictionaryValue preferences_;
base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);

View File

@@ -208,7 +208,7 @@ void CefJavaScriptDialogManager::CancelActiveAndPendingDialogs(
#endif
}
void CefJavaScriptDialogManager::WebContentsDestroyed(
void CefJavaScriptDialogManager::ResetDialogState(
content::WebContents* web_contents) {
}

View File

@@ -41,7 +41,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
void CancelActiveAndPendingDialogs(
content::WebContents* web_contents) override;
void WebContentsDestroyed(
void ResetDialogState(
content::WebContents* web_contents) override;
// Called by the CefJavaScriptDialog when it closes.

View File

@@ -541,13 +541,13 @@ void AccessorSetterCallbackImpl(
}
}
v8::Local<v8::Value> CallV8Function(v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
int argc,
v8::Local<v8::Value> args[],
v8::Isolate* isolate) {
v8::Local<v8::Value> func_rv;
v8::MaybeLocal<v8::Value> CallV8Function(v8::Local<v8::Context> context,
v8::Local<v8::Function> function,
v8::Local<v8::Object> receiver,
int argc,
v8::Local<v8::Value> args[],
v8::Isolate* isolate) {
v8::MaybeLocal<v8::Value> func_rv;
// Execute the function call using the ScriptController so that inspector
// instrumentation works.
@@ -954,14 +954,14 @@ bool CefV8ContextImpl::Eval(const CefString& code,
retval = NULL;
exception = NULL;
v8::Local<v8::Value> func_rv =
v8::MaybeLocal<v8::Value> func_rv =
CallV8Function(context, func, obj, 1, &code_val, handle_->isolate());
if (try_catch.HasCaught()) {
exception = new CefV8ExceptionImpl(try_catch.Message());
return false;
} else if (!func_rv.IsEmpty()) {
retval = new CefV8ValueImpl(isolate, func_rv);
retval = new CefV8ValueImpl(isolate, func_rv.ToLocalChecked());
}
return true;
}
@@ -1999,12 +1999,12 @@ CefRefPtr<CefV8Value> CefV8ValueImpl::ExecuteFunctionWithContext(
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
v8::Local<v8::Value> func_rv =
v8::MaybeLocal<v8::Value> func_rv =
CallV8Function(context_local, func, recv, argc, argv,
handle_->isolate());
if (!HasCaught(try_catch) && !func_rv.IsEmpty())
retval = new CefV8ValueImpl(isolate, func_rv);
retval = new CefV8ValueImpl(isolate, func_rv.ToLocalChecked());
}
if (argv)

View File

@@ -10,12 +10,6 @@
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
namespace v8 {
class Context;
template <class T> class Handle;
class Isolate;
}
namespace blink {
class WebFrame;
class WebNode;

View File

@@ -327,6 +327,11 @@ need to be translated for each locale.-->
<message name="IDS_PRINT_INVALID_PRINTER_SETTINGS" desc="Message to display when selected printer is not reachable or its settings are invalid.">
The selected printer is not available or not installed correctly. Check your printer or try selecting another printer.
</message>
<if expr="is_win">
<message name="IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME" desc="The name of the utility process used for converting PDFs to EMFs.">
EMF Convertor
</message>
</if>
<!-- Proxy settings -->
<message name="IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME" desc="The name of the utility process used for out-of-process V8 proxy resolution.">