diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index f84958c1..a61f980 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -101,6 +101,7 @@
         GetDepConfig(p) for p in direct_deps_config_paths]
     self.all_deps_configs = [
         GetDepConfig(p) for p in self.all_deps_config_paths]
+    self.direct_deps_config_paths = direct_deps_config_paths
 
   def All(self, wanted_type=None):
     if type is None:
@@ -115,6 +116,11 @@
   def AllConfigPaths(self):
     return self.all_deps_config_paths
 
+  def RemoveNonDirectDep(self, path):
+    if path in self.direct_deps_config_paths:
+      raise Exception('Cannot remove direct dep.')
+    self.all_deps_config_paths.remove(path)
+    self.all_deps_configs.remove(GetDepConfig(path))
 
 def _MergeAssets(all_assets):
   """Merges all assets from the given deps.
@@ -180,6 +186,8 @@
   parser.add_option('--package-name',
       help='Java package name for these resources.')
   parser.add_option('--android-manifest', help='Path to android manifest.')
+  parser.add_option('--is-locale-resource', action='store_true',
+                    help='Whether it is locale resource.')
 
   # android_assets options
   parser.add_option('--asset-sources', help='List of asset sources.')
@@ -216,6 +224,8 @@
       help='Whether proguard is enabled for this apk.')
   parser.add_option('--proguard-info',
       help='Path to the proguard .info output for this apk.')
+  parser.add_option('--has-alternative-locale-resource', action='store_true',
+      help='Whether there is alternative-locale-resource in direct deps')
 
   options, args = parser.parse_args(argv)
 
@@ -265,6 +275,21 @@
 
   deps = Deps(direct_deps_config_paths)
 
+  # Remove other locale resources if there is alternative_locale_resource in
+  # direct deps.
+  if options.has_alternative_locale_resource:
+    alternative = [r['path'] for r in deps.Direct('android_resources')
+                   if r.get('is_locale_resource')]
+    # We can only have one locale resources in direct deps.
+    if len(alternative) != 1:
+      raise Exception('The number of locale resource in direct deps is wrong %d'
+                       % len(alternative))
+    unwanted = [r['path'] for r in deps.All('android_resources')
+                if r.get('is_locale_resource') and r['path'] not in alternative]
+    for p in unwanted:
+      deps.RemoveNonDirectDep(p)
+
+
   direct_library_deps = deps.Direct('java_library')
   all_library_deps = deps.All('java_library')
 
@@ -362,6 +387,8 @@
       deps_info['package_name'] = options.package_name
     if options.r_text:
       deps_info['r_text'] = options.r_text
+    if options.is_locale_resource:
+      deps_info['is_locale_resource'] = True
 
   if options.type in ('android_resources','android_apk', 'resource_rewriter'):
     config['resources'] = {}
diff --git a/build/android/pylib/gtest/filter/webkit_unit_tests_disabled b/build/android/pylib/gtest/filter/webkit_unit_tests_disabled
index 1ffa325..64cedc0 100644
--- a/build/android/pylib/gtest/filter/webkit_unit_tests_disabled
+++ b/build/android/pylib/gtest/filter/webkit_unit_tests_disabled
@@ -3,7 +3,7 @@
 # crbug.com/159935
 WebCompositorInputHandlerImplTest.gestureFlingAnimates
 WebCompositorInputHandlerImplTest.gestureFlingTransferResets
-WebPageSerializerTest.HTMLNodes
+WebFrameSerializerTest.HTMLNodes
 
 # crbug.com/241730
 ScrollAnimatorNoneTest.CurveMathQuartic
diff --git a/build/common.gypi b/build/common.gypi
index c3bc3dff..cbea957 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3140,12 +3140,8 @@
         },
         'conditions': [
           [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
-            # We don't want to get warnings from third-party code,
-            # so remove any existing warning-enabling flags like -Wall.
-            'cflags!': [
-              '-Wall',
-              '-Wextra',
-            ],
+            # Remove -Wextra for third-party code.
+            'cflags!': [ '-Wextra' ],
             'cflags_cc': [
               # Don't warn about hash_map in third-party code.
               '-Wno-deprecated',
@@ -3155,10 +3151,11 @@
               # This is off by default in gcc but on in Ubuntu's gcc(!).
               '-Wno-format',
             ],
-            'cflags_cc!': [
-              # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
-              '-Wsign-compare',
-            ]
+          }],
+          [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', {
+            # When we don't control the compiler, don't use -Wall for
+            # third-party code either.
+            'cflags!': [ '-Wall' ],
           }],
           # TODO: Fix all warnings on chromeos too.
           [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
@@ -3210,7 +3207,7 @@
 
           [ 'OS=="mac" or OS=="ios"', {
             'xcode_settings': {
-              'WARNING_CFLAGS!': ['-Wall', '-Wextra'],
+              'WARNING_CFLAGS!': ['-Wextra'],
             },
             'conditions': [
               ['buildtype=="Official"', {
@@ -3723,6 +3720,10 @@
         'variables': {
           'werror%': '-Werror',
           'libraries_for_target%': '',
+          'conditions' : [
+            # Enable -Wextra for chromium_code when we control the compiler.
+            ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
+          ],
         },
         'defines': [
           '_FILE_OFFSET_BITS=64',
@@ -3732,6 +3733,7 @@
           '-pthread',
           '-fno-strict-aliasing',  # See http://crbug.com/32204
           '-Wall',
+          '<(wextra)',
           # Don't warn about unused function params.  We use those everywhere.
           '-Wno-unused-parameter',
           # Don't warn about the "struct foo f = {0};" initialization pattern.
@@ -3748,9 +3750,6 @@
           # Make inline functions have hidden visiblity by default.
           # Surprisingly, not covered by -fvisibility=hidden.
           '-fvisibility-inlines-hidden',
-          # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
-          # so we specify it explicitly.  (llvm.org/PR10448, crbug.com/90453)
-          '-Wsign-compare',
         ],
         'ldflags': [
           '-pthread', '-Wl,-z,noexecstack',
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 2c9e0c59..9432170 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -16,7 +16,7 @@
 
 android_sdk_jar = "$android_sdk/android.jar"
 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
-android_aapt_path = "$rebased_android_sdk_build_tools/aapt"
+android_default_aapt_path = "$rebased_android_sdk_build_tools/aapt"
 
 android_configuration_name = "Release"
 if (is_debug) {
@@ -89,9 +89,16 @@
     _proguard_jar_path = "//third_party/proguard/lib/proguard.jar"
     _output_jar_path = invoker.output_jar_path
     inputs = [
-      android_sdk_jar,
       _proguard_jar_path,
     ]
+    if (defined(invoker.alternative_android_sdk_jar)) {
+      inputs += [ invoker.alternative_android_sdk_jar ]
+      _rebased_android_sdk_jar =
+          rebase_path(invoker.alternative_android_sdk_jar)
+    } else {
+      inputs += [ android_sdk_jar ]
+      _rebased_android_sdk_jar = rebased_android_sdk_jar
+    }
     if (defined(invoker.inputs)) {
       inputs += invoker.inputs
     }
@@ -112,7 +119,7 @@
       "--output-path",
       rebase_path(_output_jar_path, root_build_dir),
       "--classpath",
-      rebased_android_sdk_jar,
+      _rebased_android_sdk_jar,
     ]
     if (defined(invoker.args)) {
       args += invoker.args
@@ -489,6 +496,13 @@
           rebase_path(invoker.r_text, root_build_dir),
         ]
       }
+      if (defined(invoker.is_locale_resource) && invoker.is_locale_resource) {
+        args += [ "--is-locale-resource" ]
+      }
+      if (defined(invoker.has_alternative_locale_resource) &&
+          invoker.has_alternative_locale_resource) {
+        args += [ "--has-alternative-locale-resource" ]
+      }
     }
 
     if (is_apk) {
@@ -868,6 +882,10 @@
   _shared_resources =
       defined(invoker.shared_resources) && invoker.shared_resources
   assert(_shared_resources || true)  # Mark as used.
+  _app_as_shared_lib =
+      defined(invoker.app_as_shared_lib) && invoker.app_as_shared_lib
+  assert(_app_as_shared_lib || true)  # Mark as used.
+  assert(!(_shared_resources && _app_as_shared_lib))
 
   _keystore_path = invoker.keystore_path
   _keystore_name = invoker.keystore_name
@@ -906,13 +924,19 @@
         invoker.resource_packaged_apk_path,
       ]
 
+      if (defined(invoker.android_aapt_path)) {
+        _android_aapt_path = invoker.android_aapt_path
+      } else {
+        _android_aapt_path = android_default_aapt_path
+      }
+
       args = [
         "--depfile",
         rebase_path(depfile, root_build_dir),
         "--android-sdk",
         rebased_android_sdk,
         "--aapt-path",
-        android_aapt_path,
+        _android_aapt_path,
         "--configuration-name=$android_configuration_name",
         "--android-manifest",
         rebase_path(invoker.android_manifest, root_build_dir),
@@ -933,6 +957,9 @@
       if (_shared_resources) {
         args += [ "--shared-resources" ]
       }
+      if (_app_as_shared_lib) {
+        args += [ "--app-as-shared-lib" ]
+      }
       if (_split_densities != []) {
         args += [ "--create-density-splits" ]
         foreach(_density, _split_densities) {
@@ -956,7 +983,11 @@
 
   _package_resources_target_name = "${target_name}__package_resources"
   package_resources_helper(_package_resources_target_name) {
-    forward_variables_from(invoker, [ "extensions_to_not_compress" ])
+    forward_variables_from(invoker,
+                           [
+                             "android_aapt_path",
+                             "extensions_to_not_compress",
+                           ])
     deps = _deps
     android_manifest = _android_manifest
     resource_packaged_apk_path = _resource_packaged_apk_path
@@ -999,7 +1030,11 @@
   # TODO(agrieve): See if we can speed up this step by swapping the manifest
   # from the result of the main package_resources step.
   package_resources_helper(_incremental_package_resources_target_name) {
-    forward_variables_from(invoker, [ "extensions_to_not_compress" ])
+    forward_variables_from(invoker,
+                           [
+                             "android_aapt_path",
+                             "extensions_to_not_compress",
+                           ])
     deps =
         _incremental_deps + [ ":$_generate_incremental_manifest_target_name" ]
     android_manifest = _incremental_android_manifest
@@ -1735,13 +1770,20 @@
 
     _rebased_all_resource_dirs = rebase_path(_all_resource_dirs, root_build_dir)
     rebase_build_config = rebase_path(build_config, root_build_dir)
+
+    if (defined(invoker.android_aapt_path)) {
+      _android_aapt_path = invoker.android_aapt_path
+    } else {
+      _android_aapt_path = android_default_aapt_path
+    }
+
     args = [
       "--depfile",
       rebase_path(depfile, root_build_dir),
       "--android-sdk",
       rebase_path(android_sdk, root_build_dir),
       "--aapt-path",
-      android_aapt_path,
+      _android_aapt_path,
       "--android-manifest",
       rebase_path(android_manifest, root_build_dir),
       "--resource-dirs=$_rebased_all_resource_dirs",
@@ -1775,6 +1817,10 @@
       args += [ "--shared-resources" ]
     }
 
+    if (defined(invoker.app_as_shared_lib) && invoker.app_as_shared_lib) {
+      args += [ "--app-as-shared-lib" ]
+    }
+
     if (defined(invoker.include_all_resources) &&
         invoker.include_all_resources) {
       args += [ "--include-all-resources" ]
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index c9388af8..7d93fe6 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -517,6 +517,7 @@
     build_config = _build_config
     resources_zip = _resources_zip
     type = "android_resources"
+    is_locale_resource = true
   }
 
   action("${target_name}__create_resources_zip") {
@@ -576,10 +577,10 @@
 #   custom_package: java package for generated .java files.
 #   v14_skip: If true, don't run v14 resource generator on this. Defaults to
 #     false. (see build/android/gyp/generate_v14_compatible_resources.py)
-#
 #   shared_resources: If true make a resource package that can be loaded by a
 #     different application at runtime to access the package's resources.
-#
+#   app_as_shared_lib: If true make a resource package that can be loaded as
+#     both shared_resources and normal application.
 
 # Example:
 #   android_resources("foo_resources") {
@@ -635,6 +636,7 @@
     deps = []
     forward_variables_from(invoker,
                            [
+                             "app_as_shared_lib",
                              "android_manifest",
                              "custom_package",
                              "deps",
@@ -1182,6 +1184,10 @@
 # and (possibly) native libraries.
 #
 # Variables
+#   alternative_android_sdk_jar: The alternative android sdk jar used in
+#     proguard.
+#   android_aapt_path: Android aapt tool to replace default one to build
+#     resource.
 #   android_manifest: Path to AndroidManifest.xml.
 #   android_manifest_dep: Target that generates AndroidManifest (if applicable)
 #   chromium_code: If true, extra analysis warning/errors will be enabled.
@@ -1221,6 +1227,8 @@
 #   testonly: Marks this target as "test-only".
 #   write_asset_list: Adds an extra file to the assets, which contains a list of
 #     all other asset files.
+#   alternative_locale_resource_dep: The locale resource target which overrides
+#     any exsting locale resources in dep graph.
 #
 #   DEPRECATED_java_in_dir: Directory containing java files. All .java files in
 #     this directory will be included in the library. This is only supported to
@@ -1394,6 +1402,11 @@
       deps += invoker.deps
     }
 
+    if (defined(invoker.alternative_locale_resource_dep)) {
+      deps += [ invoker.alternative_locale_resource_dep ]
+      has_alternative_locale_resource = true
+    }
+
     proguard_enabled = _proguard_enabled
     if (_proguard_enabled) {
       proguard_info = "$_proguard_jar_path.info"
@@ -1409,6 +1422,8 @@
   process_resources(process_resources_target) {
     forward_variables_from(invoker,
                            [
+                             "android_aapt_path",
+                             "app_as_shared_lib",
                              "include_all_resources",
                              "shared_resources",
                            ])
@@ -1540,6 +1555,7 @@
     }
     _proguard_target = "${_template_name}__proguard"
     proguard(_proguard_target) {
+      forward_variables_from(invoker, [ "alternative_android_sdk_jar" ])
       deps = [
         ":$build_config_target",
         ":$java_target",
@@ -1669,6 +1685,8 @@
     deps = []
     forward_variables_from(invoker,
                            [
+                             "android_aapt_path",
+                             "app_as_shared_lib",
                              "deps",
                              "extensions_to_not_compress",
                              "language_splits",
@@ -1761,6 +1779,7 @@
       deps = []
       forward_variables_from(invoker,
                              [
+                               "android_aapt_path",
                                "deps",
                                "native_lib_placeholders",
                                "public_deps",
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 97eb672..732f71ac 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -894,15 +894,11 @@
   if (is_win) {
     cflags = [ "/W4" ]  # Warning level 4.
   } else {
-    cflags = [
-      "-Wall",
-
-      # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
-      # so we specify it explicitly.
-      # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it.
-      # http://code.google.com/p/chromium/issues/detail?id=90453
-      "-Wsign-compare",
-    ]
+    cflags = [ "-Wall" ]
+    if (is_clang) {
+      # Enable -Wextra for chromium_code when we control the compiler.
+      cflags += [ "-Wextra" ]
+    }
 
     # In Chromium code, we define __STDC_foo_MACROS in order to get the
     # C99 macros on Mac and Linux.
@@ -944,6 +940,10 @@
       "_CRT_NONSTDC_NO_WARNINGS",
       "_CRT_NONSTDC_NO_DEPRECATE",
     ]
+  } else if (is_clang && !is_nacl) {
+    # TODO(thakis): Remove !is_nacl once
+    # https://codereview.webrtc.org/1552863002/ made its way into chromium.
+    cflags += [ "-Wall" ]
   }
 
   if (is_linux) {
diff --git a/build/linux/sysroot_scripts/packagelist.wheezy.amd64 b/build/linux/sysroot_scripts/packagelist.wheezy.amd64
index 6ec0440..aafb84a 100644
--- a/build/linux/sysroot_scripts/packagelist.wheezy.amd64
+++ b/build/linux/sysroot_scripts/packagelist.wheezy.amd64
@@ -100,6 +100,7 @@
 main/libx/libxdamage/libxdamage1_1.1.3-2_amd64.deb
 main/libx/libxdamage/libxdamage-dev_1.1.3-2_amd64.deb
 main/libx/libxdmcp/libxdmcp6_1.1.1-1_amd64.deb
+main/libx/libxdmcp/libxdmcp-dev_1.1.1-1_amd64.deb
 main/libx/libxext/libxext6_1.3.1-2+deb7u1_amd64.deb
 main/libx/libxext/libxext-dev_1.3.1-2+deb7u1_amd64.deb
 main/libx/libxfixes/libxfixes3_5.0-4+deb7u1_amd64.deb
@@ -160,5 +161,6 @@
 main/x/x11proto-render/x11proto-render-dev_0.11.1-2_all.deb
 main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb
 main/x/x11proto-xext/x11proto-xext-dev_7.2.1-1_all.deb
+main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb
 main/z/zlib/zlib1g_1.2.7.dfsg-13_amd64.deb
 main/z/zlib/zlib1g-dev_1.2.7.dfsg-13_amd64.deb
diff --git a/build/linux/sysroot_scripts/packagelist.wheezy.arm b/build/linux/sysroot_scripts/packagelist.wheezy.arm
index 5efb90e..76d0f597 100644
--- a/build/linux/sysroot_scripts/packagelist.wheezy.arm
+++ b/build/linux/sysroot_scripts/packagelist.wheezy.arm
@@ -99,6 +99,7 @@
 main/libx/libxdamage/libxdamage1_1.1.3-2+b1_armhf.deb
 main/libx/libxdamage/libxdamage-dev_1.1.3-2+b1_armhf.deb
 main/libx/libxdmcp/libxdmcp6_1.1.1-1_armhf.deb
+main/libx/libxdmcp/libxdmcp-dev_1.1.1-1_armhf.deb
 main/libx/libxext/libxext6_1.3.1-2+deb7u1_armhf.deb
 main/libx/libxext/libxext-dev_1.3.1-2+deb7u1_armhf.deb
 main/libx/libxfixes/libxfixes3_5.0-4+deb7u1_armhf.deb
@@ -159,5 +160,6 @@
 main/x/x11proto-render/x11proto-render-dev_0.11.1-2_all.deb
 main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb
 main/x/x11proto-xext/x11proto-xext-dev_7.2.1-1_all.deb
+main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb
 main/z/zlib/zlib1g_1.2.7.dfsg-13_armhf.deb
 main/z/zlib/zlib1g-dev_1.2.7.dfsg-13_armhf.deb
diff --git a/build/linux/sysroot_scripts/packagelist.wheezy.i386 b/build/linux/sysroot_scripts/packagelist.wheezy.i386
index 86feb8e..d29229d8 100644
--- a/build/linux/sysroot_scripts/packagelist.wheezy.i386
+++ b/build/linux/sysroot_scripts/packagelist.wheezy.i386
@@ -100,6 +100,7 @@
 main/libx/libxdamage/libxdamage1_1.1.3-2_i386.deb
 main/libx/libxdamage/libxdamage-dev_1.1.3-2_i386.deb
 main/libx/libxdmcp/libxdmcp6_1.1.1-1_i386.deb
+main/libx/libxdmcp/libxdmcp-dev_1.1.1-1_i386.deb
 main/libx/libxext/libxext6_1.3.1-2+deb7u1_i386.deb
 main/libx/libxext/libxext-dev_1.3.1-2+deb7u1_i386.deb
 main/libx/libxfixes/libxfixes3_5.0-4+deb7u1_i386.deb
@@ -160,5 +161,6 @@
 main/x/x11proto-render/x11proto-render-dev_0.11.1-2_all.deb
 main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb
 main/x/x11proto-xext/x11proto-xext-dev_7.2.1-1_all.deb
+main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb
 main/z/zlib/zlib1g_1.2.7.dfsg-13_i386.deb
 main/z/zlib/zlib1g-dev_1.2.7.dfsg-13_i386.deb
diff --git a/build/linux/sysroot_scripts/packagelist.wheezy.mipsel b/build/linux/sysroot_scripts/packagelist.wheezy.mipsel
index 95a1a41..4160d39b 100644
--- a/build/linux/sysroot_scripts/packagelist.wheezy.mipsel
+++ b/build/linux/sysroot_scripts/packagelist.wheezy.mipsel
@@ -98,6 +98,7 @@
 main/libx/libxdamage/libxdamage1_1.1.3-2_mipsel.deb
 main/libx/libxdamage/libxdamage-dev_1.1.3-2_mipsel.deb
 main/libx/libxdmcp/libxdmcp6_1.1.1-1_mipsel.deb
+main/libx/libxdmcp/libxdmcp-dev_1.1.1-1_mipsel.deb
 main/libx/libxext/libxext6_1.3.1-2+deb7u1_mipsel.deb
 main/libx/libxext/libxext-dev_1.3.1-2+deb7u1_mipsel.deb
 main/libx/libxfixes/libxfixes3_5.0-4+deb7u1_mipsel.deb
@@ -158,5 +159,6 @@
 main/x/x11proto-render/x11proto-render-dev_0.11.1-2_all.deb
 main/x/x11proto-scrnsaver/x11proto-scrnsaver-dev_1.2.2-1_all.deb
 main/x/x11proto-xext/x11proto-xext-dev_7.2.1-1_all.deb
+main/x/x11proto-xinerama/x11proto-xinerama-dev_1.2.1-2_all.deb
 main/z/zlib/zlib1g_1.2.7.dfsg-13_mipsel.deb
 main/z/zlib/zlib1g-dev_1.2.7.dfsg-13_mipsel.deb
diff --git a/build/linux/sysroot_scripts/sysroot-creator-wheezy.sh b/build/linux/sysroot_scripts/sysroot-creator-wheezy.sh
index c04f1157..bb17d3fed 100755
--- a/build/linux/sysroot_scripts/sysroot-creator-wheezy.sh
+++ b/build/linux/sysroot_scripts/sysroot-creator-wheezy.sh
@@ -142,6 +142,7 @@
   libxdamage1
   libxdamage-dev
   libxdmcp6
+  libxdmcp-dev
   libxext6
   libxext-dev
   libxfixes3
@@ -175,6 +176,7 @@
   x11proto-render-dev
   x11proto-scrnsaver-dev
   x11proto-xext-dev
+  x11proto-xinerama-dev
   zlib1g
   zlib1g-dev
 "