Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Roll Chromium 53.0.2785.143
Browse files Browse the repository at this point in the history
Big thanks to Maksim Sisov, Mrunal Kapade and Chuan Liu for their work
on this rebase.

Starting with this release, Crosswalk is following upstream's decision
and gyp is deprecated and not expected to work. All the gyp code will be
removed in the future.

There are no release-worthy changes here, and this commit mostly just
adapts the code to upstream changes, such as:
* https://codereview.chromium.org/1473273002
* https://codereview.chromium.org/1692503002
* https://codereview.chromium.org/1692503002
* https://codereview.chromium.org/1819753003
* https://codereview.chromium.org/1996723002
* https://codereview.chromium.org/2000803003
* https://codereview.chromium.org/2000803003
* https://codereview.chromium.org/2014803002
* https://codereview.chromium.org/2014803002
* https://codereview.chromium.org/2019423005
* https://codereview.chromium.org/2030683005
* https://codereview.chromium.org/2030683005
* https://codereview.chromium.org/2030683005
* https://codereview.chromium.org/2034153002
* https://codereview.chromium.org/2034153002
* https://codereview.chromium.org/2047833002
* https://codereview.chromium.org/2048173003
* https://codereview.chromium.org/2048523002
* https://codereview.chromium.org/2050623005
* https://codereview.chromium.org/2059533002
* https://codereview.chromium.org/2059533002
* https://codereview.chromium.org/2067843003
* https://codereview.chromium.org/2068473002
* https://codereview.chromium.org/2082453003
* https://codereview.chromium.org/2082453003
* https://codereview.chromium.org/2094733002
* https://codereview.chromium.org/2098553002
* https://codereview.chromium.org/2104193002
* https://codereview.chromium.org/2109293003

BUG=XWALK-7227
  • Loading branch information
Raphael Kubo da Costa committed Oct 17, 2016
1 parent 9338f8d commit 02104a7
Show file tree
Hide file tree
Showing 64 changed files with 299 additions and 259 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ source_set("xwalk_runtime") {
"//components/app_modal",
"//components/constrained_window",
"//components/guest_view/browser",
"//components/ui/zoom",
"//components/zoom",
"//ui/events",
"//ui/resources",
"//ui/strings:ui_strings",
Expand Down
6 changes: 3 additions & 3 deletions DEPS.xwalk
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
# Edit these when rolling DEPS.xwalk.
# -----------------------------------

chromium_crosswalk_rev = '49772a4e4fb093da8897681f706091d6daed3a9b'
v8_crosswalk_rev = '9e7fe2bdeef4d269aec6bbca0e5052b03f3d4806'
chromium_crosswalk_rev = 'ee335c1f5e8887ae568a795962580d6dca069d34'
v8_crosswalk_rev = 'a48e44faef59edeb1fb254233a1c12b5d5999432'

# We need our own copy of src/buildtools in order to have the gn and
# clang-format binaries in a location that can be found automatically both by
# our bots as well as locally for our developers. Its hash does not necessarily
# need to be rolled together with |chromium_crosswalk_rev|, but it is good
# practice to not have it lag behind too much.
buildtools_rev = '06e80a0e17319868d4a9b13f9bb6a248dc8d8b20'
buildtools_rev = '454e53abae6e4d68ee992b0a93a4174b75519393'

chromium_git = 'https://chromium.googlesource.com'
crosswalk_git = 'https://github.com/crosswalk-project'
Expand Down
10 changes: 4 additions & 6 deletions app/android/runtime_client_embedded_shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ import("//build/config/android/rules.gni")
android_apk("xwalk_runtime_client_embedded_shell_apk") {
apk_name = "XWalkRuntimeClientEmbeddedShell"
android_manifest = "AndroidManifest.xml"
native_libs = [
"$root_out_dir/libxwalkdummy.so",
"$root_out_dir/libxwalkcore.so",
"$root_out_dir/libecho_extension.so",
shared_libraries = [
"//xwalk/runtime/android/dummy_lib:libxwalkdummy",
"//xwalk/runtime/app/android:libxwalkcore",
]
loadable_modules = [ "$root_out_dir/libecho_extension.so" ]
deps = [
":xwalk_runtime_client_embedded_shell_apk_assets",
":xwalk_runtime_client_embedded_shell_apk_java",
":xwalk_runtime_client_embedded_shell_apk_resources",
"//base:base_java",
"//xwalk/extensions/test:echo_extension",
"//xwalk/runtime/android/core_internal:xwalk_core_internal_java",
"//xwalk/runtime/android/dummy_lib:libxwalkdummy",
"//xwalk/runtime/app/android:libxwalkcore",
]
}

Expand Down
7 changes: 2 additions & 5 deletions app/android/runtime_client_shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ import("//build/config/android/rules.gni")
android_apk("xwalk_runtime_client_shell_apk") {
apk_name = "XWalkRuntimeClientShell"
android_manifest = "AndroidManifest.xml"
native_libs = [
"$root_out_dir/libecho_extension.so",
"$root_out_dir/libxwalkdummy.so",
]
shared_libraries = [ "//xwalk/runtime/android/dummy_lib:libxwalkdummy" ]
loadable_modules = [ "$root_out_dir/libecho_extension.so" ]
deps = [
":xwalk_runtime_client_shell_apk_assets",
":xwalk_runtime_client_shell_apk_java",
":xwalk_runtime_client_shell_apk_resources",
"//base:base_java",
"//xwalk/extensions/test:echo_extension",
"//xwalk/runtime/android/dummy_lib:libxwalkdummy",
]
}

Expand Down
2 changes: 1 addition & 1 deletion application/browser/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ bool Application::RegisterPermissions(const std::string& extension_name,
return false;

base::DictionaryValue* dict_val =
static_cast<base::DictionaryValue*>(*iter);
static_cast<base::DictionaryValue*>(iter->get());
std::string permission_name;
if (!dict_val->GetString("permission_name", &permission_name))
return false;
Expand Down
4 changes: 2 additions & 2 deletions application/common/manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ void Manifest::ParseWGTI18nEachPath(const std::string& path) {
bool get_first_one = false;
for (base::ListValue::iterator it = list->begin();
it != list->end(); ++it) {
ParseWGTI18nEachElement(*it, path);
ParseWGTI18nEachElement(it->get(), path);
if (!get_first_one)
get_first_one = ParseWGTI18nEachElement(*it, path, kLocaleFirstOne);
get_first_one = ParseWGTI18nEachElement(it->get(), path, kLocaleFirstOne);
}
}
}
Expand Down
41 changes: 31 additions & 10 deletions build/android/generate_android_project.gni
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ template("generate_xwalk_core_library") {
# added to res/raw.
# js_bindings [required]
# List of Crosswalk extension bindings .js files to add to res/raw.
# native_libs [optional]
# List of architecture-dependent shared libraries to include in the
# project.
# resource_excluded_patterns [optional]
# A list that accepts fnmatch-style wildcards with resource classes that
# should be left out of the JARs being built.
# shared_libraries [optional]
# List of architecture-dependent shared library targets to bundle. If these
# targets depend on other shared_library targets, they will also be
# included.
# template_dir [required]
# Directory to the template directory containing a ant.properties,
# AndroidManifest.xml and others.
Expand All @@ -109,9 +110,19 @@ template("generate_android_project") {
_resource_jar_path = "${_base_path}_resources.jar"
_target_name = target_name

_native_libs = []
if (defined(invoker.native_libs)) {
_native_libs = invoker.native_libs
_native_libs_deps = []
if (defined(invoker.shared_libraries) && invoker.shared_libraries != []) {
_native_libs_deps += invoker.shared_libraries

# To determine the filenames of all dependent shared libraries, write the
# runtime deps of |shared_libraries| to a file during "gn gen".
# write_build_config.py will then grep this file for *.so to obtain the
# complete list.
_runtime_deps_file = "${_base_path}.native.runtimedeps"
group("${_target_name}__runtime_deps") {
deps = _native_libs_deps
write_runtime_deps = _runtime_deps_file
}
}

# Write a build_config file. Its contents are used by several other targets
Expand All @@ -125,16 +136,24 @@ template("generate_android_project") {
write_build_config(_build_config_target) {
type = "android_apk"
deps = invoker.deps
possible_config_deps = invoker.deps

build_config = _build_config
jar_path = _merged_jar_path
native_libs = _native_libs

# The following are required to write an android_apk build config file, but
# we do not use them for anything.
android_manifest = invoker.android_manifest
dex_path = _base_path + "__unused.dex"
resources_zip = _base_path + "__unused.resources.zip"

# Don't depend on the runtime_deps target in order to avoid having to
# build the native libraries just to create the .build_config file.
# The dep is unnecessary since the runtime_deps file is created by gn gen
# and the runtime_deps file is added to write_build_config.py's depfile.
if (_native_libs_deps != []) {
shared_libraries_runtime_deps_file = _runtime_deps_file
}
}

_srcjar_deps = []
Expand All @@ -160,9 +179,11 @@ template("generate_android_project") {

# If we are shipping native libraries, we need to create a wrapper to be able
# to load them at runtime.
if (_native_libs != []) {
if (_native_libs_deps != []) {
# TODO(rakuco): We may need an additional block adding libc++_shared.so for
# the is_component_build case. See the android_apk template in rules.gni.
# M53 also added a block to order the library dependencies, but we do not
# need that for now.

java_cpp_template("${target_name}__native_libraries_java") {
package_name = "org/chromium/base/library_loader"
Expand Down Expand Up @@ -252,7 +273,7 @@ template("generate_android_project") {
])
output_dir = "$root_out_dir/$_target_name"

if (_native_libs != []) {
if (_native_libs_deps != []) {
has_native_libraries = true
}
}
Expand Down Expand Up @@ -288,7 +309,7 @@ template("generate_android_project") {
rebase_path(_r_file_path, root_build_dir),
]

if (_native_libs != []) {
if (_native_libs_deps != []) {
args += [
"--jni-abi",
android_app_abi,
Expand Down
10 changes: 5 additions & 5 deletions extensions/browser/xwalk_extension_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ XWalkExtensionProcessHost::XWalkExtensionProcessHost(
content::RenderProcessHost* render_process_host,
const base::FilePath& external_extensions_path,
XWalkExtensionProcessHost::Delegate* delegate,
std::unique_ptr<base::ValueMap> runtime_variables)
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables)
: ep_rp_channel_handle_(""),
render_process_host_(render_process_host),
render_process_message_filter_(new RenderProcessMessageFilter(this)),
Expand All @@ -138,12 +138,12 @@ XWalkExtensionProcessHost::~XWalkExtensionProcessHost() {

namespace {

void ToListValue(base::ValueMap* vm, base::ListValue* lv) {
void ToListValue(base::DictionaryValue::Storage* vm, base::ListValue* lv) {
lv->Clear();

for (base::ValueMap::iterator it = vm->begin(); it != vm->end(); it++) {
for (base::DictionaryValue::Storage::iterator it = vm->begin(); it != vm->end(); it++) {
base::DictionaryValue* dv = new base::DictionaryValue();
dv->Set(it->first, it->second);
dv->Set(it->first, std::move(it->second));
lv->Append(dv);
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ void XWalkExtensionProcessHost::StartProcess() {
cmd_line.release(), true);

base::ListValue runtime_variables_lv;
ToListValue(&const_cast<base::ValueMap&>(*runtime_variables_),
ToListValue(&const_cast<base::DictionaryValue::Storage&>(*runtime_variables_),
&runtime_variables_lv);
Send(new XWalkExtensionProcessMsg_RegisterExtensions(
external_extensions_path_, runtime_variables_lv));
Expand Down
4 changes: 2 additions & 2 deletions extensions/browser/xwalk_extension_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class XWalkExtensionProcessHost
XWalkExtensionProcessHost(content::RenderProcessHost* render_process_host,
const base::FilePath& external_extensions_path,
XWalkExtensionProcessHost::Delegate* delegate,
std::unique_ptr<base::ValueMap> runtime_variables);
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables);
~XWalkExtensionProcessHost() override;

// IPC::Sender implementation
Expand Down Expand Up @@ -106,7 +106,7 @@ class XWalkExtensionProcessHost

XWalkExtensionProcessHost::Delegate* delegate_;

std::unique_ptr<base::ValueMap> runtime_variables_;
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables_;

// IPC channel for launcher to communicate with BP in service mode.
std::unique_ptr<IPC::Channel> channel_;
Expand Down
10 changes: 5 additions & 5 deletions extensions/browser/xwalk_extension_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void XWalkExtensionService::OnRenderProcessHostCreatedInternal(
content::RenderProcessHost* host,
XWalkExtensionVector* ui_thread_extensions,
XWalkExtensionVector* extension_thread_extensions,
std::unique_ptr<base::ValueMap> runtime_variables) {
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables) {
XWalkExtensionData* data = new XWalkExtensionData;
data->set_render_process_host(host);

Expand All @@ -243,12 +243,12 @@ void XWalkExtensionService::OnRenderProcessWillLaunch(
content::RenderProcessHost* host,
XWalkExtensionVector* ui_thread_extensions,
XWalkExtensionVector* extension_thread_extensions,
std::unique_ptr<base::ValueMap> runtime_variables) {
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables) {
CHECK(host);

if (!g_external_extensions_path_for_testing_.empty()) {
(*runtime_variables)["runtime_name"] =
new base::StringValue("xwalk");
(*runtime_variables)["runtime_name"] = base::WrapUnique(
new base::StringValue("xwalk"));
OnRenderProcessHostCreatedInternal(host, ui_thread_extensions,
extension_thread_extensions, std::move(runtime_variables));
return;
Expand Down Expand Up @@ -372,7 +372,7 @@ void XWalkExtensionService::CreateInProcessExtensionServers(

void XWalkExtensionService::CreateExtensionProcessHost(
content::RenderProcessHost* host, XWalkExtensionData* data,
std::unique_ptr<base::ValueMap> runtime_variables) {
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables) {
data->set_extension_process_host(base::WrapUnique(
new XWalkExtensionProcessHost(host, external_extensions_path_, this,
std::move(runtime_variables))));
Expand Down
6 changes: 3 additions & 3 deletions extensions/browser/xwalk_extension_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class XWalkExtensionService : public content::NotificationObserver,
content::RenderProcessHost* host,
XWalkExtensionVector* ui_thread_extensions,
XWalkExtensionVector* extension_thread_extensions,
std::unique_ptr<base::ValueMap> runtime_variables);
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables);

// To be called when a RenderProcess died, so we can gracefully shutdown the
// associated ExtensionProcess. See Runtime::RenderProcessGone() and
Expand All @@ -98,7 +98,7 @@ class XWalkExtensionService : public content::NotificationObserver,
content::RenderProcessHost* host,
XWalkExtensionVector* ui_thread_extensions,
XWalkExtensionVector* extension_thread_extensions,
std::unique_ptr<base::ValueMap> runtime_variables);
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables);

// XWalkExtensionProcessHost::Delegate implementation.
void OnExtensionProcessDied(XWalkExtensionProcessHost* eph,
Expand Down Expand Up @@ -130,7 +130,7 @@ class XWalkExtensionService : public content::NotificationObserver,
XWalkExtensionVector* extension_thread_extensions);

void CreateExtensionProcessHost(content::RenderProcessHost* host,
XWalkExtensionData* data, std::unique_ptr<base::ValueMap> runtime_variables);
XWalkExtensionData* data, std::unique_ptr<base::DictionaryValue::Storage> runtime_variables);

// The server that handles in process extensions will live in the
// extension_thread_.
Expand Down
15 changes: 7 additions & 8 deletions extensions/common/xwalk_extension_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,19 +360,18 @@ void XWalkExtensionServer::Invalidate() {

namespace {
base::FilePath::StringType GetNativeLibraryPattern() {
const base::string16 library_pattern = base::GetNativeLibraryName(
base::UTF8ToUTF16("*"));
const std::string library_pattern = base::GetNativeLibraryName("*");
#if defined(OS_WIN)
return library_pattern;
return base::UTF8ToUTF16(library_pattern);
#else
return base::UTF16ToUTF8(library_pattern);
return library_pattern;
#endif
}
} // namespace

std::vector<std::string> RegisterExternalExtensionsInDirectory(
XWalkExtensionServer* server, const base::FilePath& dir,
std::unique_ptr<base::ValueMap> runtime_variables) {
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables) {
CHECK(server);

std::vector<std::string> registered_extensions;
Expand All @@ -394,10 +393,10 @@ std::vector<std::string> RegisterExternalExtensionsInDirectory(
// Let the extension know about its own path, so it can be used
// as an identifier in case you have symlinks to extensions to force it
// load multiple times.
(*runtime_variables)["extension_path"] =
new base::StringValue(extension_path.AsUTF8Unsafe());
(*runtime_variables)["extension_path"] = base::WrapUnique(
new base::StringValue(extension_path.AsUTF8Unsafe()));

extension->set_runtime_variables(*runtime_variables);
extension->set_runtime_variables(runtime_variables.get());
if (server->permissions_delegate())
extension->set_permissions_delegate(server->permissions_delegate());
if (extension->Initialize()) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/common/xwalk_extension_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class XWalkExtensionServer : public IPC::Listener,

std::vector<std::string> RegisterExternalExtensionsInDirectory(
XWalkExtensionServer* server, const base::FilePath& dir,
std::unique_ptr<base::ValueMap> runtime_variables);
std::unique_ptr<base::DictionaryValue::Storage> runtime_variables);

bool ValidateExtensionNameForTesting(const std::string& extension_name);

Expand Down
2 changes: 1 addition & 1 deletion extensions/common/xwalk_external_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void XWalkExternalExtension::EntryPointsSetExtraJSEntryPoints(

void XWalkExternalExtension::RuntimeGetStringVariable(const char* key,
char* value, size_t value_len) {
const base::ValueMap::const_iterator it = runtime_variables_.find(key);
const base::DictionaryValue::Storage::const_iterator it = runtime_variables_.find(key);
if (it != runtime_variables_.end()) {
std::string json;
base::JSONWriter::Write(*(it->second), &json);
Expand Down
7 changes: 4 additions & 3 deletions extensions/common/xwalk_external_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "xwalk/extensions/public/XW_Extension.h"
#include "xwalk/extensions/public/XW_Extension_Message_2.h"
#include "xwalk/extensions/public/XW_Extension_SyncMessage.h"
#include "base/memory/ptr_util.h"

namespace base {
class FilePath;
Expand All @@ -39,8 +40,8 @@ class XWalkExternalExtension : public XWalkExtension {

bool Initialize();

void set_runtime_variables(const base::ValueMap& runtime_variables) {
runtime_variables_ = runtime_variables;
void set_runtime_variables(base::DictionaryValue::Storage* runtime_variables) {
runtime_variables_.swap(*runtime_variables);
}

protected:
Expand All @@ -53,7 +54,7 @@ class XWalkExternalExtension : public XWalkExtension {

// Variables from the browser process. Usually things like currently-running
// application ID.
base::ValueMap runtime_variables_;
base::DictionaryValue::Storage runtime_variables_;

// XW_CoreInterface_1 (from XW_Extension.h) implementation.
void CoreSetExtensionName(const char* name);
Expand Down
Loading

0 comments on commit 02104a7

Please sign in to comment.