Merge from Chromium at DEPS revision r213371

This commit was generated by merge_to_master.py.

Change-Id: I35a74205de4bff52a2dd6b15330f8a002a39efaf
diff --git a/.DEPS.git b/.DEPS.git
index 48dba70..aaef337 100644
--- a/.DEPS.git
+++ b/.DEPS.git
@@ -11,7 +11,7 @@
     'git_url':
          'https://chromium.googlesource.com',
     'webkit_rev':
-         '@eef0bde6e5b4334743da7e28f3cd26265c3b4c3e'
+         '@e976d5810ac68f54fccc88dccc2e8b95f8754737'
 }
 
 deps = {
@@ -28,7 +28,7 @@
     'src/googleurl':
         Var('git_url') + '/external/google-url.git@ca8c31644137b3b46021ee37973c8749aae5c3bf',
     'src/native_client':
-        Var('git_url') + '/native_client/src/native_client.git@58f3f57126f702f3b49347f10e836936f7777fc2',
+        Var('git_url') + '/native_client/src/native_client.git@546aa650653b95269f666262d93a7a633c3ce4ec',
     'src/sdch/open-vcdiff':
         Var('git_url') + '/external/open-vcdiff.git@438f2a5be6d809bc21611a94cd37bfc8c28ceb33',
     'src/testing/gmock':
@@ -54,7 +54,7 @@
     'src/third_party/hunspell_dictionaries':
         Var('git_url') + '/chromium/deps/hunspell_dictionaries.git@bc7edb352e97fa71e387b9a5522f1bbd5b11a5eb',
     'src/third_party/icu':
-        Var('git_url') + '/chromium/deps/icu46.git@364ba1d000a5b85f577f36701c6fd43810a1daa5',
+        Var('git_url') + '/chromium/deps/icu46.git@a485deab4a5c90b60dd905726619b3a7804ee71a',
     'src/third_party/jsoncpp/source/include':
         Var('git_url') + '/external/jsoncpp/jsoncpp/include.git@b0dd48e02b6e6248328db78a65b5c601f150c349',
     'src/third_party/jsoncpp/source/src/lib_json':
@@ -98,11 +98,11 @@
     'src/third_party/sfntly/cpp/src':
         Var('git_url') + '/external/sfntly/cpp/src.git@cfb2f1743f0169ad8d01035458617bce97107539',
     'src/third_party/skia/gyp':
-        Var('git_url') + '/external/skia/gyp.git@cffde48ad4ce59eaba92c40da9993c48fa8a7d55',
+        Var('git_url') + '/external/skia/gyp.git@6488041938586522ce313bc5000a2a4516e45052',
     'src/third_party/skia/include':
-        Var('git_url') + '/external/skia/include.git@dea179dd5f11ea56446c60408bb35f1a90da5b17',
+        Var('git_url') + '/external/skia/include.git@9de8c6d9afed64d2b1129952f353ee49e3155e1c',
     'src/third_party/skia/src':
-        Var('git_url') + '/external/skia/src.git@0a0f9f0779dc23177700ab225b2ae3d2608a6671',
+        Var('git_url') + '/external/skia/src.git@6b8cd0006c55d1cf1a13dbb049018c16e6696ef6',
     'src/third_party/smhasher/src':
         Var('git_url') + '/external/smhasher.git@6f63a4882e6b2cf87e8eec1a3ef8644e0d963283',
     'src/third_party/snappy/src':
@@ -112,7 +112,7 @@
     'src/third_party/swig/Lib':
         Var('git_url') + '/chromium/deps/swig/Lib.git@549f0b084ad9c40ef42d111303d831eb8d91252e',
     'src/third_party/trace-viewer':
-        Var('git_url') + '/external/trace-viewer.git@608187083bbf1f39d34fcdd05f99df6cc2a2b64b',
+        Var('git_url') + '/external/trace-viewer.git@9740e3440e25b0df338592eecd4ca13deb8bbf10',
     'src/third_party/usrsctp/usrsctplib':
         Var('git_url') + '/external/usrsctplib.git@062bff767b4ad4c70476e94c7d0e2a62f57306bb',
     'src/third_party/v8-i18n':
@@ -138,7 +138,7 @@
     'src/tools/swarm_client':
         Var('git_url') + '/chromium/tools/swarm_client.git@db18a94a727a8fb042de269d07fb104cde267527',
     'src/v8':
-        Var('git_url') + '/external/v8.git@ba72ec861b69b67139c93fc6dd56f4a73c9b3135',
+        Var('git_url') + '/external/v8.git@6fe0fda6a144bf4a3991162c622e8745376b755a',
     'src/webkit/renderer/media/crypto/ppapi/cdm':
         Var('git_url') + '/chromium/cdm.git@c2b192a02546916d28233cfd8b7717ffcdcc8347',
 }
@@ -288,7 +288,7 @@
         'src/third_party/cros_dbus_cplusplus/source':
             Var('git_url') + '/chromiumos/third_party/dbus-cplusplus.git@5e8f6d9db5c2abfb91d91f751184f25bb5cd0900',
         'src/third_party/cros_system_api':
-            Var('git_url') + '/chromiumos/platform/system_api.git@59a6e103fd972817e3bb69a65b91170ea40d877f',
+            Var('git_url') + '/chromiumos/platform/system_api.git@295836580061cb441c11ee3b2a6c7225ecf9ebbb',
         'src/third_party/freetype2/src':
             Var('git_url') + '/chromium/src/third_party/freetype2.git@d699c2994ecc178c4ed05ac2086061b2034c2178',
         'src/third_party/gold':
diff --git a/DEPS b/DEPS
index 6bceb61..b37eadd 100644
--- a/DEPS
+++ b/DEPS
@@ -8,11 +8,11 @@
   "sourceforge_url": "http://%(repo)s.svn.sourceforge.net/svnroot/%(repo)s",
   "webkit_trunk": "http://src.chromium.org/blink/trunk",
   "nacl_trunk": "http://src.chromium.org/native_client/trunk",
-  "webkit_revision": "154672",
+  "webkit_revision": "154818",
   "chromium_git": "https://chromium.googlesource.com",
   "chromiumos_git": "https://chromium.googlesource.com/chromiumos",
   "swig_revision": "69281",
-  "nacl_revision": "11819",
+  "nacl_revision": "11830",
   # After changing nacl_revision, run 'glient sync' and check native_client/DEPS
   # to update other nacl_*_revision's.
   "nacl_tools_revision": "11437",  # native_client/DEPS: tools_rev
@@ -29,11 +29,11 @@
   "ffmpeg_hash": "245a8c0cdfdd5ab3da9045089661017e9ddd8d0e",
 
   "sfntly_revision": "134",
-  "skia_revision": "10169",
+  "skia_revision": "10239",
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and V8 without interference from each other.
-  "v8_revision": "15795",
+  "v8_revision": "15825",
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling WebRTC
   # and V8 without interference from each other.
@@ -71,13 +71,13 @@
     "/external/angle.git@9b344317b2ced9123da6e0e55aeb75e8abca84c5",
 
   "src/third_party/trace-viewer":
-    (Var("googlecode_url") % "trace-viewer") + "/trunk@731",
+    (Var("googlecode_url") % "trace-viewer") + "/trunk@784",
 
   "src/third_party/WebKit":
     Var("webkit_trunk") + "@" + Var("webkit_revision"),
 
   "src/third_party/icu":
-    "/trunk/deps/third_party/icu46@212871",
+    "/trunk/deps/third_party/icu46@213354",
 
   "src/third_party/libexif/sources":
     "/trunk/deps/third_party/libexif/sources@146817",
@@ -435,7 +435,7 @@
     # For Linux and Chromium OS.
     "src/third_party/cros_system_api":
       Var("chromiumos_git") + "/platform/system_api.git" +
-      "@59a6e103fd972817e3bb69a65b91170ea40d877f",
+      "@295836580061cb441c11ee3b2a6c7225ecf9ebbb",
 
     # Note that this is different from Android's freetype repo.
     "src/third_party/freetype2/src":
diff --git a/GypAndroid.darwin-arm.mk b/GypAndroid.darwin-arm.mk
index ca73d56..5f41e70 100644
--- a/GypAndroid.darwin-arm.mk
+++ b/GypAndroid.darwin-arm.mk
@@ -98,6 +98,9 @@
 include $(LOCAL_PATH)/sandbox/seccomp_bpf.target.darwin-arm.mk
 include $(LOCAL_PATH)/sdch/sdch.target.darwin-arm.mk
 include $(LOCAL_PATH)/skia/skia.target.darwin-arm.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.darwin-arm.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.darwin-arm.mk
+include $(LOCAL_PATH)/skia/skia_library.target.darwin-arm.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.darwin-arm.mk
 include $(LOCAL_PATH)/skia/skia_opts_neon.target.darwin-arm.mk
 include $(LOCAL_PATH)/sql/sql.target.darwin-arm.mk
@@ -227,7 +230,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.darwin-arm.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-arm.mk
@@ -236,7 +238,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.darwin-arm.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.darwin-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.darwin-arm.mk
diff --git a/GypAndroid.darwin-mips.mk b/GypAndroid.darwin-mips.mk
index 820cafe..275bcce 100644
--- a/GypAndroid.darwin-mips.mk
+++ b/GypAndroid.darwin-mips.mk
@@ -96,6 +96,9 @@
 include $(LOCAL_PATH)/sandbox/sandbox_services.target.darwin-mips.mk
 include $(LOCAL_PATH)/sdch/sdch.target.darwin-mips.mk
 include $(LOCAL_PATH)/skia/skia.target.darwin-mips.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.darwin-mips.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.darwin-mips.mk
+include $(LOCAL_PATH)/skia/skia_library.target.darwin-mips.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.darwin-mips.mk
 include $(LOCAL_PATH)/sql/sql.target.darwin-mips.mk
 include $(LOCAL_PATH)/testing/gtest_prod.target.darwin-mips.mk
@@ -223,7 +226,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.darwin-mips.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-mips.mk
@@ -232,7 +234,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.darwin-mips.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.darwin-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.darwin-mips.mk
diff --git a/GypAndroid.darwin-x86.mk b/GypAndroid.darwin-x86.mk
index 05e4f61..a5088ab 100644
--- a/GypAndroid.darwin-x86.mk
+++ b/GypAndroid.darwin-x86.mk
@@ -103,6 +103,9 @@
 include $(LOCAL_PATH)/sandbox/seccomp_bpf.target.darwin-x86.mk
 include $(LOCAL_PATH)/sdch/sdch.target.darwin-x86.mk
 include $(LOCAL_PATH)/skia/skia.target.darwin-x86.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.darwin-x86.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.darwin-x86.mk
+include $(LOCAL_PATH)/skia/skia_library.target.darwin-x86.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.darwin-x86.mk
 include $(LOCAL_PATH)/sql/sql.target.darwin-x86.mk
 include $(LOCAL_PATH)/testing/gtest_prod.target.darwin-x86.mk
@@ -240,7 +243,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.darwin-x86.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-x86.mk
@@ -249,7 +251,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.darwin-x86.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.darwin-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.darwin-x86.mk
diff --git a/GypAndroid.linux-arm.mk b/GypAndroid.linux-arm.mk
index 739aeb2..9e1e5e9 100644
--- a/GypAndroid.linux-arm.mk
+++ b/GypAndroid.linux-arm.mk
@@ -98,6 +98,9 @@
 include $(LOCAL_PATH)/sandbox/seccomp_bpf.target.linux-arm.mk
 include $(LOCAL_PATH)/sdch/sdch.target.linux-arm.mk
 include $(LOCAL_PATH)/skia/skia.target.linux-arm.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.linux-arm.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.linux-arm.mk
+include $(LOCAL_PATH)/skia/skia_library.target.linux-arm.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.linux-arm.mk
 include $(LOCAL_PATH)/skia/skia_opts_neon.target.linux-arm.mk
 include $(LOCAL_PATH)/sql/sql.target.linux-arm.mk
@@ -227,7 +230,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.linux-arm.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-arm.mk
@@ -236,7 +238,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.linux-arm.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.linux-arm.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.linux-arm.mk
diff --git a/GypAndroid.linux-mips.mk b/GypAndroid.linux-mips.mk
index 895fbe0..dcd10a2 100644
--- a/GypAndroid.linux-mips.mk
+++ b/GypAndroid.linux-mips.mk
@@ -96,6 +96,9 @@
 include $(LOCAL_PATH)/sandbox/sandbox_services.target.linux-mips.mk
 include $(LOCAL_PATH)/sdch/sdch.target.linux-mips.mk
 include $(LOCAL_PATH)/skia/skia.target.linux-mips.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.linux-mips.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.linux-mips.mk
+include $(LOCAL_PATH)/skia/skia_library.target.linux-mips.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.linux-mips.mk
 include $(LOCAL_PATH)/sql/sql.target.linux-mips.mk
 include $(LOCAL_PATH)/testing/gtest_prod.target.linux-mips.mk
@@ -223,7 +226,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.linux-mips.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-mips.mk
@@ -232,7 +234,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.linux-mips.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.linux-mips.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.linux-mips.mk
diff --git a/GypAndroid.linux-x86.mk b/GypAndroid.linux-x86.mk
index da0a22f..83b8db9 100644
--- a/GypAndroid.linux-x86.mk
+++ b/GypAndroid.linux-x86.mk
@@ -103,6 +103,9 @@
 include $(LOCAL_PATH)/sandbox/seccomp_bpf.target.linux-x86.mk
 include $(LOCAL_PATH)/sdch/sdch.target.linux-x86.mk
 include $(LOCAL_PATH)/skia/skia.target.linux-x86.mk
+include $(LOCAL_PATH)/skia/skia_chrome.target.linux-x86.mk
+include $(LOCAL_PATH)/skia/skia_chrome_opts.target.linux-x86.mk
+include $(LOCAL_PATH)/skia/skia_library.target.linux-x86.mk
 include $(LOCAL_PATH)/skia/skia_opts.target.linux-x86.mk
 include $(LOCAL_PATH)/sql/sql.target.linux-x86.mk
 include $(LOCAL_PATH)/testing/gtest_prod.target.linux-x86.mk
@@ -240,7 +243,6 @@
 include $(LOCAL_PATH)/webkit/common/user_agent/user_agent.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/common/user_agent/webkit_version.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/common/webkit_common.target.linux-x86.mk
-include $(LOCAL_PATH)/webkit/glue/glue_common.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/plugins/plugins_common.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-x86.mk
@@ -249,7 +251,6 @@
 include $(LOCAL_PATH)/webkit/support/glue_child.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/support/overscroller_jni_headers.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/support/plugins.target.linux-x86.mk
-include $(LOCAL_PATH)/webkit/support/webkit_media.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_resources.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_browser.target.linux-x86.mk
 include $(LOCAL_PATH)/webkit/webkit_storage_common.target.linux-x86.mk
diff --git a/android_webview/android_webview_common.target.darwin-arm.mk b/android_webview/android_webview_common.target.darwin-arm.mk
index 59ab14e..ca0eabd 100644
--- a/android_webview/android_webview_common.target.darwin-arm.mk
+++ b/android_webview/android_webview_common.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -112,17 +113,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -221,17 +221,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/android_webview_common.target.darwin-mips.mk b/android_webview/android_webview_common.target.darwin-mips.mk
index 35256dd..7596a9e 100644
--- a/android_webview/android_webview_common.target.darwin-mips.mk
+++ b/android_webview/android_webview_common.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -111,17 +112,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -219,17 +219,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -323,7 +322,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/android_webview_common.target.darwin-x86.mk b/android_webview/android_webview_common.target.darwin-x86.mk
index 8511f60..a49c063 100644
--- a/android_webview/android_webview_common.target.darwin-x86.mk
+++ b/android_webview/android_webview_common.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -114,17 +115,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -226,17 +226,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/android_webview_common.target.linux-arm.mk b/android_webview/android_webview_common.target.linux-arm.mk
index 59ab14e..ca0eabd 100644
--- a/android_webview/android_webview_common.target.linux-arm.mk
+++ b/android_webview/android_webview_common.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -112,17 +113,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -221,17 +221,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/android_webview_common.target.linux-mips.mk b/android_webview/android_webview_common.target.linux-mips.mk
index 35256dd..7596a9e 100644
--- a/android_webview/android_webview_common.target.linux-mips.mk
+++ b/android_webview/android_webview_common.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -111,17 +112,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -219,17 +219,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -323,7 +322,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/android_webview_common.target.linux-x86.mk b/android_webview/android_webview_common.target.linux-x86.mk
index 8511f60..a49c063 100644
--- a/android_webview/android_webview_common.target.linux-x86.mk
+++ b/android_webview/android_webview_common.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_gyp)/content.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_android_webview_pak_gyp)/android_webview_pak.stamp
 
@@ -114,17 +115,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -226,17 +226,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc
index 2b60bea..7b70cff 100644
--- a/android_webview/browser/in_process_view_renderer.cc
+++ b/android_webview/browser/in_process_view_renderer.cc
@@ -197,7 +197,6 @@
                                    bool is_hardware_canvas,
                                    const gfx::Vector2d& scroll,
                                    const gfx::Rect& clip) {
-  fallback_tick_.Cancel();
   scroll_at_start_of_frame_  = scroll;
   if (is_hardware_canvas && attached_to_window_ && HardwareEnabled()) {
     // We should be performing a hardware draw here. If we don't have the
@@ -279,6 +278,7 @@
 bool InProcessViewRenderer::DrawSWInternal(jobject java_canvas,
                                            const gfx::Rect& clip) {
   TRACE_EVENT0("android_webview", "InProcessViewRenderer::DrawSW");
+  fallback_tick_.Cancel();
 
   if (clip.IsEmpty()) {
     TRACE_EVENT_INSTANT0(
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
index 46bb312..95f2358 100644
--- a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
+++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc
@@ -25,6 +25,7 @@
     AwRenderViewHostExtClient* client, content::WebContents* contents)
     : content::WebContentsObserver(contents),
       client_(client),
+      background_color_(SK_ColorWHITE),
       has_new_hit_test_data_(false) {
   DCHECK(client_);
 }
@@ -85,6 +86,22 @@
                                          page_scale_factor));
 }
 
+void AwRenderViewHostExt::SetBackgroundColor(SkColor c) {
+  if (background_color_ == c)
+    return;
+  background_color_ = c;
+  if (web_contents()->GetRenderViewHost()) {
+    Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(),
+                                          background_color_));
+  }
+}
+
+void AwRenderViewHostExt::RenderViewCreated(
+    content::RenderViewHost* render_view_host) {
+  Send(new AwViewMsg_SetBackgroundColor(web_contents()->GetRoutingID(),
+                                        background_color_));
+}
+
 void AwRenderViewHostExt::RenderProcessGone(base::TerminationStatus status) {
   DCHECK(CalledOnValidThread());
   for (std::map<int, DocumentHasImagesResult>::iterator pending_req =
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.h b/android_webview/browser/renderer_host/aw_render_view_host_ext.h
index 1f764f8..da9bcac 100644
--- a/android_webview/browser/renderer_host/aw_render_view_host_ext.h
+++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.h
@@ -10,6 +10,7 @@
 #include "android_webview/common/aw_hit_test_data.h"
 #include "base/callback_forward.h"
 #include "base/threading/non_thread_safe.h"
+#include "third_party/skia/include/core/SkColor.h"
 
 class GURL;
 
@@ -70,9 +71,11 @@
   // Sets the initial page scale. This overrides initial scale set by
   // the meta viewport tag.
   void SetInitialPageScale(double page_scale_factor);
+  void SetBackgroundColor(SkColor c);
 
  private:
   // content::WebContentsObserver implementation.
+  virtual void RenderViewCreated(content::RenderViewHost* view_host) OVERRIDE;
   virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
   virtual void DidNavigateAnyFrame(
       const content::LoadCommittedDetails& details,
@@ -87,6 +90,8 @@
 
   AwRenderViewHostExtClient* client_;
 
+  SkColor background_color_;
+
   std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_;
 
   // Master copy of hit test data on the browser side. This is updated
diff --git a/android_webview/browser/scoped_app_gl_state_restore.cc b/android_webview/browser/scoped_app_gl_state_restore.cc
index 70e5075..4928464 100644
--- a/android_webview/browser/scoped_app_gl_state_restore.cc
+++ b/android_webview/browser/scoped_app_gl_state_restore.cc
@@ -4,6 +4,7 @@
 
 #include "android_webview/browser/scoped_app_gl_state_restore.h"
 
+#include "base/debug/trace_event.h"
 #include "base/lazy_instance.h"
 #include "ui/gl/gl_context.h"
 #include "ui/gl/gl_surface_stub.h"
@@ -40,15 +41,23 @@
   g_app_context_surface.Get().MakeCurrent();
 }
 
+void GLEnableDisable(GLenum cap, bool enable) {
+  if (enable)
+    glEnable(cap);
+  else
+    glDisable(cap);
+}
+
 }  // namespace
 
-ScopedAppGLStateRestore::ScopedAppGLStateRestore(CallMode mode) {
+ScopedAppGLStateRestore::ScopedAppGLStateRestore(CallMode mode) : mode_(mode) {
+  TRACE_EVENT0("android_webview", "AppGLStateSave");
   MakeAppContextCurrent();
 
   glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &vertex_array_buffer_binding_);
   glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &index_array_buffer_binding_);
 
-  switch(mode) {
+  switch(mode_) {
     case MODE_DRAW:
       // TODO(boliu): These should always be 0 in draw case. When we have
       // guarantee that we are no longer making GL calls outside of draw, DCHECK
@@ -64,6 +73,15 @@
       index_array_buffer_binding_ = 0;
       break;
     case MODE_DETACH_FROM_WINDOW:
+      glGetBooleanv(GL_BLEND, &blend_enabled_);
+      glGetIntegerv(GL_BLEND_SRC_RGB, &blend_src_rgb_);
+      glGetIntegerv(GL_BLEND_SRC_ALPHA, &blend_src_alpha_);
+      glGetIntegerv(GL_BLEND_DST_RGB, &blend_dest_rgb_);
+      glGetIntegerv(GL_BLEND_DST_ALPHA, &blend_dest_alpha_);
+      glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture_);
+      glGetIntegerv(GL_VIEWPORT, viewport_);
+      glGetBooleanv(GL_SCISSOR_TEST, &scissor_test_);
+      glGetIntegerv(GL_SCISSOR_BOX, scissor_box_);
       break;
   }
 
@@ -89,20 +107,32 @@
 
   glGetBooleanv(GL_DEPTH_TEST, &depth_test_);
   glGetBooleanv(GL_CULL_FACE, &cull_face_);
+  glGetIntegerv(GL_CULL_FACE_MODE, &cull_face_mode_);
   glGetBooleanv(GL_COLOR_WRITEMASK, color_mask_);
-  glGetBooleanv(GL_BLEND, &blend_enabled_);
-  glGetIntegerv(GL_BLEND_SRC_RGB, &blend_src_rgb_);
-  glGetIntegerv(GL_BLEND_SRC_ALPHA, &blend_src_alpha_);
-  glGetIntegerv(GL_BLEND_DST_RGB, &blend_dest_rgb_);
-  glGetIntegerv(GL_BLEND_DST_ALPHA, &blend_dest_alpha_);
-  glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture_);
-  glGetIntegerv(GL_VIEWPORT, viewport_);
-  glGetBooleanv(GL_SCISSOR_TEST, &scissor_test_);
-  glGetIntegerv(GL_SCISSOR_BOX, scissor_box_);
   glGetIntegerv(GL_CURRENT_PROGRAM, &current_program_);
+  glGetFloatv(GL_COLOR_CLEAR_VALUE, color_clear_);
+  glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depth_clear_);
+  glGetIntegerv(GL_DEPTH_FUNC, &depth_func_);
+  glGetBooleanv(GL_DEPTH_WRITEMASK, &depth_mask_);
+  glGetFloatv(GL_DEPTH_RANGE, depth_rage_);
+  glGetIntegerv(GL_FRONT_FACE, &front_face_);
+  glGetIntegerv(GL_GENERATE_MIPMAP_HINT, &hint_generate_mipmap_);
+  glGetFloatv(GL_LINE_WIDTH, &line_width_);
+  glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &polygon_offset_factor_);
+  glGetFloatv(GL_POLYGON_OFFSET_UNITS, &polygon_offset_units_);
+  glGetFloatv(GL_SAMPLE_COVERAGE_VALUE, &sample_coverage_value_);
+  glGetBooleanv(GL_SAMPLE_COVERAGE_INVERT, &sample_coverage_invert_);
+
+  glGetBooleanv(GL_DITHER, &enable_dither_);
+  glGetBooleanv(GL_POLYGON_OFFSET_FILL, &enable_polygon_offset_fill_);
+  glGetBooleanv(GL_SAMPLE_ALPHA_TO_COVERAGE, &enable_sample_alpha_to_coverage_);
+  glGetBooleanv(GL_SAMPLE_COVERAGE, &enable_sample_coverage_);
+
+  // Intentionally not saving/restoring stencil related state.
 }
 
 ScopedAppGLStateRestore::~ScopedAppGLStateRestore() {
+  TRACE_EVENT0("android_webview", "AppGLStateRestore");
   MakeAppContextCurrent();
 
   glBindBuffer(GL_ARRAY_BUFFER, vertex_array_buffer_binding_);
@@ -127,42 +157,47 @@
     }
   }
 
-  if (depth_test_) {
-    glEnable(GL_DEPTH_TEST);
-  } else {
-    glDisable(GL_DEPTH_TEST);
-  }
+  GLEnableDisable(GL_DEPTH_TEST, depth_test_);
 
-  if (cull_face_) {
-    glEnable(GL_CULL_FACE);
-  } else {
-    glDisable(GL_CULL_FACE);
-  }
+  GLEnableDisable(GL_CULL_FACE, cull_face_);
+  glCullFace(cull_face_mode_);
 
   glColorMask(color_mask_[0], color_mask_[1], color_mask_[2], color_mask_[3]);
 
-  if (blend_enabled_) {
-    glEnable(GL_BLEND);
-  } else {
-    glDisable(GL_BLEND);
-  }
-
-  glBlendFuncSeparate(
-      blend_src_rgb_, blend_dest_rgb_, blend_src_alpha_, blend_dest_alpha_);
-  glActiveTexture(active_texture_);
-
-  glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3]);
-
-  if (scissor_test_) {
-    glEnable(GL_SCISSOR_TEST);
-  } else {
-    glDisable(GL_SCISSOR_TEST);
-  }
-
-  glScissor(
-      scissor_box_[0], scissor_box_[1], scissor_box_[2], scissor_box_[3]);
-
   glUseProgram(current_program_);
+
+  glClearColor(
+      color_clear_[0], color_clear_[1], color_clear_[2], color_clear_[3]);
+  glClearDepth(depth_clear_);
+  glDepthFunc(depth_func_);
+  glDepthMask(depth_mask_);
+  glDepthRange(depth_rage_[0], depth_rage_[1]);
+  glFrontFace(front_face_);
+  glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap_);
+  // TODO(boliu): GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES ??
+  glLineWidth(line_width_);
+  glPolygonOffset(polygon_offset_factor_, polygon_offset_units_);
+  glSampleCoverage(sample_coverage_value_, sample_coverage_invert_);
+
+  GLEnableDisable(GL_DITHER, enable_dither_);
+  GLEnableDisable(GL_POLYGON_OFFSET_FILL, enable_polygon_offset_fill_);
+  GLEnableDisable(GL_SAMPLE_ALPHA_TO_COVERAGE,
+                  enable_sample_alpha_to_coverage_);
+  GLEnableDisable(GL_SAMPLE_COVERAGE, enable_sample_coverage_);
+
+  if (mode_ == MODE_DETACH_FROM_WINDOW) {
+    GLEnableDisable(GL_BLEND, blend_enabled_);
+    glBlendFuncSeparate(
+        blend_src_rgb_, blend_dest_rgb_, blend_src_alpha_, blend_dest_alpha_);
+    glActiveTexture(active_texture_);
+
+    glViewport(viewport_[0], viewport_[1], viewport_[2], viewport_[3]);
+
+    GLEnableDisable(GL_SCISSOR_TEST, scissor_test_);
+
+    glScissor(
+        scissor_box_[0], scissor_box_[1], scissor_box_[2], scissor_box_[3]);
+  }
 }
 
 }  // namespace android_webview
diff --git a/android_webview/browser/scoped_app_gl_state_restore.h b/android_webview/browser/scoped_app_gl_state_restore.h
index c8eb0ba..f856de8 100644
--- a/android_webview/browser/scoped_app_gl_state_restore.h
+++ b/android_webview/browser/scoped_app_gl_state_restore.h
@@ -23,6 +23,8 @@
   ~ScopedAppGLStateRestore();
 
  private:
+  const CallMode mode_;
+
   GLint texture_external_oes_binding_;
   GLint pack_alignment_;
   GLint unpack_alignment_;
@@ -41,7 +43,28 @@
 
   GLboolean depth_test_;
   GLboolean cull_face_;
+  GLint cull_face_mode_;
   GLboolean color_mask_[4];
+  GLfloat color_clear_[4];
+  GLfloat depth_clear_;
+  GLint current_program_;
+  GLint depth_func_;
+  GLboolean depth_mask_;
+  GLfloat depth_rage_[2];
+  GLint front_face_;
+  GLint hint_generate_mipmap_;
+  GLfloat line_width_;
+  GLfloat polygon_offset_factor_;
+  GLfloat polygon_offset_units_;
+  GLfloat sample_coverage_value_;
+  GLboolean sample_coverage_invert_;
+
+  GLboolean enable_dither_;
+  GLboolean enable_polygon_offset_fill_;
+  GLboolean enable_sample_alpha_to_coverage_;
+  GLboolean enable_sample_coverage_;
+
+  // Not saved/restored in MODE_DRAW.
   GLboolean blend_enabled_;
   GLint blend_src_rgb_;
   GLint blend_src_alpha_;
@@ -51,7 +74,6 @@
   GLint viewport_[4];
   GLboolean scissor_test_;
   GLint scissor_box_[4];
-  GLint current_program_;
 
   DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore);
 };
diff --git a/android_webview/common/render_view_messages.h b/android_webview/common/render_view_messages.h
index 68ce3bc..69f826c 100644
--- a/android_webview/common/render_view_messages.h
+++ b/android_webview/common/render_view_messages.h
@@ -8,6 +8,7 @@
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_message_macros.h"
 #include "ipc/ipc_platform_file.h"
+#include "third_party/skia/include/core/SkColor.h"
 
 // Singly-included section for enums and custom IPC traits.
 #ifndef ANDROID_WEBVIEW_COMMON_RENDER_VIEW_MESSAGES_H_
@@ -66,6 +67,10 @@
 IPC_MESSAGE_ROUTED1(AwViewMsg_SetInitialPageScale,
                     double /* page_scale_factor */)
 
+// Sets the base background color for this view.
+IPC_MESSAGE_ROUTED1(AwViewMsg_SetBackgroundColor,
+                    SkColor);
+
 //-----------------------------------------------------------------------------
 // RenderView messages
 // These are messages sent from the renderer to the browser process.
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 40075d7..c94c1ab 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -156,12 +156,15 @@
     // TODO(boliu): This should be in a global context, not per webview.
     private final double mDIPScale;
 
+    // The base background color, i.e. not accounting for any CSS body from the current page.
+    private int mBaseBackgroundColor = Color.WHITE;
+
     // Must call nativeUpdateLastHitTestData first to update this before use.
     private final HitTestData mPossiblyStaleHitTestData = new HitTestData();
 
     private DefaultVideoPosterRequestHandler mDefaultVideoPosterRequestHandler;
 
-    // Bound method for suppling Picture instances to the AwContentClient. Will be null if the
+    // Bound method for suppling Picture instances to the AwContentsClient. Will be null if the
     // picture listener API has not yet been enabled, or if it is using invalidation-only mode.
     private Callable<Picture> mPictureListenerContentProvider;
 
@@ -641,7 +644,10 @@
     private final Rect mClipBoundsTemporary = new Rect();
 
     public void onDraw(Canvas canvas) {
-        if (mNativeAwContents == 0) return;
+        if (mNativeAwContents == 0) {
+            canvas.drawColor(getEffectiveBackgroundColor());
+            return;
+        }
 
         mScrollOffsetManager.syncScrollOffsetFromOnDraw();
 
@@ -651,8 +657,7 @@
                     mClipBoundsTemporary.left, mClipBoundsTemporary.top,
                     mClipBoundsTemporary.right, mClipBoundsTemporary.bottom )) {
             Log.w(TAG, "nativeOnDraw failed; clearing to background color.");
-            int c = mContentViewCore.getBackgroundColor();
-            canvas.drawRGB(Color.red(c), Color.green(c), Color.blue(c));
+            canvas.drawColor(getEffectiveBackgroundColor());
         }
     }
 
@@ -818,6 +823,21 @@
         }
     }
 
+    public void setBackgroundColor(int color) {
+        mBaseBackgroundColor = color;
+        if (mNativeAwContents != 0) nativeSetBackgroundColor(mNativeAwContents, color);
+    }
+
+    private int getEffectiveBackgroundColor() {
+        // Do not ask the ContentViewCore for the background color, as it will always
+        // report white prior to initial navigation or post destruction,  whereas we want
+        // to use the client supplied base value in those cases.
+        if (mNativeAwContents == 0 || !mContentsClient.isCachedRendererBackgroundColorValid()) {
+            return mBaseBackgroundColor;
+        }
+        return mContentsClient.getCachedRendererBackgroundColor();
+    }
+
     public boolean isMultiTouchZoomSupported() {
         return mSettings.supportsMultiTouchZoom();
     }
@@ -1718,6 +1738,7 @@
 
     private native int nativeReleasePopupAwContents(int nativeAwContents);
     private native void nativeFocusFirstNode(int nativeAwContents);
+    private native void nativeSetBackgroundColor(int nativeAwContents, int color);
 
     private native int nativeGetAwDrawGLViewContext(int nativeAwContents);
     private native Picture nativeCapturePicture(int nativeAwContents);
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
index 7de19e5..fe42ad3 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -52,6 +52,12 @@
 
     private double mDIPScale;
 
+    // Last background color reported from the renderer. Holds the sentinal value INVALID_COLOR
+    // if not valid.
+    private int mCachedRendererBackgroundColor = INVALID_COLOR;
+
+    private static final int INVALID_COLOR = 0;
+
     class AwWebContentsObserver extends WebContentsObserverAndroid {
         public AwWebContentsObserver(ContentViewCore contentViewCore) {
             super(contentViewCore);
@@ -90,6 +96,12 @@
     }
 
     private class AwContentViewClient extends ContentViewClient {
+        @Override
+        public void onBackgroundColorChanged(int color) {
+            // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both
+            // fully transparent so this transpose makes no visible difference).
+            mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color;
+        }
 
         @Override
         public void onScaleChanged(float oldScale, float newScale) {
@@ -174,6 +186,15 @@
         return mContentViewClient;
     }
 
+    final int getCachedRendererBackgroundColor() {
+        assert isCachedRendererBackgroundColorValid();
+        return mCachedRendererBackgroundColor;
+    }
+
+    final boolean isCachedRendererBackgroundColorValid() {
+        return mCachedRendererBackgroundColor != INVALID_COLOR;
+    }
+
     //--------------------------------------------------------------------------------------------
     //             WebView specific methods that map directly to WebViewClient / WebChromeClient
     //--------------------------------------------------------------------------------------------
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
new file mode 100644
index 0000000..05d44ee
--- /dev/null
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
@@ -0,0 +1,119 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android_webview.test;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.net.Proxy;
+import android.test.FlakyTest;
+import android.test.mock.MockContext;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.android_webview.AwContents;
+import org.chromium.base.test.util.DisabledTest;
+import org.chromium.base.test.util.Feature;
+import org.chromium.base.test.util.UrlUtils;
+import org.chromium.base.ThreadUtils;
+import org.chromium.content.browser.ContentViewCore;
+import org.chromium.content.browser.ContentViewStatics;
+import org.chromium.net.ProxyChangeListener;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.Callable;
+
+/**
+ * AwContents rendering / pixel tests.
+ */
+public class AwContentsRenderTest extends AwTestBase {
+
+    private TestAwContentsClient mContentsClient;
+    private AwContents mAwContents;
+
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        mContentsClient = new TestAwContentsClient();
+        final AwTestContainerView testContainerView =
+                createAwTestContainerViewOnMainSync(mContentsClient);
+        mAwContents = testContainerView.getAwContents();
+    }
+
+    void setBackgroundColorOnUiThread(final int c) {
+        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+            @Override
+            public void run() {
+                mAwContents.setBackgroundColor(c);
+            }
+        });
+    }
+
+    Bitmap grabViewToBitmap() {
+        final Bitmap result = Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888);
+        mAwContents.onDraw(new android.graphics.Canvas(result));
+        return result;
+    }
+
+    void waitForBackgroundColor(final int c) throws Throwable {
+        pollOnUiThread(new Callable<Boolean>() {
+            @Override
+            public Boolean call() throws Exception {
+                return grabViewToBitmap().getPixel(0, 0) == c;
+            }
+        });
+    }
+
+    @SmallTest
+    @Feature({"AndroidWebView"})
+    public void testSetGetBackgroundColor() throws Throwable {
+        setBackgroundColorOnUiThread(Color.MAGENTA);
+        waitForBackgroundColor(Color.MAGENTA);
+
+        setBackgroundColorOnUiThread(Color.CYAN);
+        waitForBackgroundColor(Color.CYAN);
+
+        loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), "about:blank");
+
+        // TODO(joth): Remove this bogus check  and replace with commented out block when
+        // AwRenderViewExt::OnSetBackgroundColor() is fully implemented (i.e. when
+        // crrev.com/19883002/ has rolled in)
+        waitForBackgroundColor(Color.WHITE);
+
+        // waitForBackgroundColor(Color.CYAN);
+        // setBackgroundColorOnUiThread(Color.YELLOW);
+        // waitForBackgroundColor(Color.YELLOW);
+        // loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
+        //     "data:text/html,<html><head><style>body {background-color:#227788}</style></head>" +
+        //     "<body><br>HelloWorld</body></html>");
+        // waitForBackgroundColor(Color.rgb(0x22, 0x77, 0x88));
+        //
+        // // Changing the base background should not override CSS background.
+        // setBackgroundColorOnUiThread(Color.MAGENTA);
+        // Thread.sleep(1000);
+        // waitForBackgroundColor(Color.rgb(0x22, 0x77, 0x88));
+
+    }
+
+    @SmallTest
+    @Feature({"AndroidWebView"})
+    public void testPictureListener() throws Throwable {
+        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+            @Override
+            public void run() {
+                mAwContents.enableOnNewPicture(true, true);
+            }
+        });
+
+        int pictureCount = mContentsClient.getPictureListenerHelper().getCallCount();
+        loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), "about:blank");
+        mContentsClient.getPictureListenerHelper().waitForCallback(pictureCount, 1);
+        // Invalidation only, so picture should be null.
+        assertNull(mContentsClient.getPictureListenerHelper().getPicture());
+    }
+}
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java
index 5998b34..42de0be 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java
@@ -8,8 +8,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.graphics.Bitmap;
-import android.graphics.Color;
 import android.net.Proxy;
 import android.test.FlakyTest;
 import android.test.mock.MockContext;
@@ -113,28 +111,4 @@
         receiverRef.get().onReceive(context, intent);
         assertEquals(true, proxyChanged.get());
     }
-
-    /**
-     * @SmallTest
-     * @Feature({"AndroidWebView"})
-     * Bug 6931901
-     */
-    @DisabledTest
-    public void testSetGetBackgroundColor() throws Throwable {
-        loadUrlSync(mAwContents , mContentsClient.getOnPageFinishedHelper(), "about:blank");
-        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
-            @Override
-            public void run() {
-                mContentViewCore.setBackgroundColor(Color.MAGENTA);
-            }
-        });
-        int backgroundColor = ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
-            @Override
-            public Integer call() {
-                Bitmap map = mContentViewCore.getBitmap(1, 1);
-                return map.getPixel(0,0);
-            }
-        });
-        assertEquals(Color.MAGENTA, backgroundColor);
-    }
 }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java b/android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java
index 512184d..cd85ef5 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java
@@ -4,6 +4,7 @@
 
 package org.chromium.android_webview.test;
 
+import android.graphics.Picture;
 import android.webkit.ConsoleMessage;
 
 import org.chromium.content.browser.test.util.CallbackHelper;
@@ -20,6 +21,7 @@
     private final OnEvaluateJavaScriptResultHelper mOnEvaluateJavaScriptResultHelper;
     private final AddMessageToConsoleHelper mAddMessageToConsoleHelper;
     private final OnScaleChangedHelper mOnScaleChangedHelper;
+    private final PictureListenerHelper mPictureListenerHelper;
 
     public TestAwContentsClient() {
         mOnPageStartedHelper = new OnPageStartedHelper();
@@ -28,6 +30,7 @@
         mOnEvaluateJavaScriptResultHelper = new OnEvaluateJavaScriptResultHelper();
         mAddMessageToConsoleHelper = new AddMessageToConsoleHelper();
         mOnScaleChangedHelper = new OnScaleChangedHelper();
+        mPictureListenerHelper = new PictureListenerHelper();
     }
 
     public OnPageStartedHelper getOnPageStartedHelper() {
@@ -68,6 +71,10 @@
         return mOnScaleChangedHelper;
     }
 
+    public PictureListenerHelper getPictureListenerHelper() {
+        return mPictureListenerHelper;
+    }
+
     @Override
     public void onReceivedTitle(String title) {
         mUpdatedTitle = title;
@@ -138,4 +145,24 @@
     public void onScaleChangedScaled(float oldScale, float newScale) {
         mOnScaleChangedHelper.notifyCalled(oldScale, newScale);
     }
+
+    public static class PictureListenerHelper extends CallbackHelper {
+        // Generally null, depending on |invalidationOnly| in enableOnNewPicture()
+        private Picture mPicture;
+
+        public Picture getPicture() {
+            assert getCallCount() > 0;
+            return mPicture;
+        }
+
+        void notifyCalled(Picture picture) {
+            mPicture = picture;
+            notifyCalled();
+        }
+    }
+
+    @Override
+    public void onNewPicture(Picture picture) {
+        mPictureListenerHelper.notifyCalled(picture);
+    }
 }
diff --git a/android_webview/libwebviewchromium.target.darwin-arm.mk b/android_webview/libwebviewchromium.target.darwin-arm.mk
index 7fd005c..546dfd2 100644
--- a/android_webview/libwebviewchromium.target.darwin-arm.mk
+++ b/android_webview/libwebviewchromium.target.darwin-arm.mk
@@ -33,13 +33,16 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_neon_gyp)/skia_skia_opts_neon_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -97,6 +100,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -147,11 +152,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_arm_neon_gyp)/third_party_WebKit_Source_core_webcore_arm_neon_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -164,7 +166,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -180,8 +181,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -291,10 +292,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -375,10 +376,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -483,11 +484,13 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	skia_skia_opts_neon_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -522,6 +525,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -550,11 +555,8 @@
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_core_webcore_arm_neon_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -564,7 +566,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -575,8 +576,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	sandbox_seccomp_bpf_gyp \
diff --git a/android_webview/libwebviewchromium.target.darwin-mips.mk b/android_webview/libwebviewchromium.target.darwin-mips.mk
index 3350dba..3237968 100644
--- a/android_webview/libwebviewchromium.target.darwin-mips.mk
+++ b/android_webview/libwebviewchromium.target.darwin-mips.mk
@@ -33,12 +33,15 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -96,6 +99,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -145,11 +150,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_svg_gyp)/third_party_WebKit_Source_core_webcore_svg_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -162,7 +164,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -178,8 +179,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -286,10 +287,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -369,10 +370,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -473,10 +474,12 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -511,6 +514,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -537,11 +542,8 @@
 	third_party_WebKit_Source_core_webcore_svg_gyp \
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -551,7 +553,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -562,8 +563,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	components_webdata_common_gyp \
diff --git a/android_webview/libwebviewchromium.target.darwin-x86.mk b/android_webview/libwebviewchromium.target.darwin-x86.mk
index 03f23f9..dfefc41 100644
--- a/android_webview/libwebviewchromium.target.darwin-x86.mk
+++ b/android_webview/libwebviewchromium.target.darwin-x86.mk
@@ -33,12 +33,15 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -101,6 +104,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -150,11 +155,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_svg_gyp)/third_party_WebKit_Source_core_webcore_svg_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -167,7 +169,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -183,8 +184,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -296,10 +297,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -383,10 +384,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -486,10 +487,12 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -529,6 +532,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -555,11 +560,8 @@
 	third_party_WebKit_Source_core_webcore_svg_gyp \
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -569,7 +571,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -580,8 +581,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	sandbox_seccomp_bpf_gyp \
diff --git a/android_webview/libwebviewchromium.target.linux-arm.mk b/android_webview/libwebviewchromium.target.linux-arm.mk
index 7fd005c..546dfd2 100644
--- a/android_webview/libwebviewchromium.target.linux-arm.mk
+++ b/android_webview/libwebviewchromium.target.linux-arm.mk
@@ -33,13 +33,16 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_neon_gyp)/skia_skia_opts_neon_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -97,6 +100,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -147,11 +152,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_arm_neon_gyp)/third_party_WebKit_Source_core_webcore_arm_neon_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -164,7 +166,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -180,8 +181,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -291,10 +292,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -375,10 +376,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -483,11 +484,13 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	skia_skia_opts_neon_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -522,6 +525,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -550,11 +555,8 @@
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_core_webcore_arm_neon_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -564,7 +566,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -575,8 +576,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	sandbox_seccomp_bpf_gyp \
diff --git a/android_webview/libwebviewchromium.target.linux-mips.mk b/android_webview/libwebviewchromium.target.linux-mips.mk
index 3350dba..3237968 100644
--- a/android_webview/libwebviewchromium.target.linux-mips.mk
+++ b/android_webview/libwebviewchromium.target.linux-mips.mk
@@ -33,12 +33,15 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -96,6 +99,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -145,11 +150,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_svg_gyp)/third_party_WebKit_Source_core_webcore_svg_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -162,7 +164,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -178,8 +179,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -286,10 +287,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -369,10 +370,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -473,10 +474,12 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -511,6 +514,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -537,11 +542,8 @@
 	third_party_WebKit_Source_core_webcore_svg_gyp \
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -551,7 +553,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -562,8 +563,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	components_webdata_common_gyp \
diff --git a/android_webview/libwebviewchromium.target.linux-x86.mk b/android_webview/libwebviewchromium.target.linux-x86.mk
index 03f23f9..dfefc41 100644
--- a/android_webview/libwebviewchromium.target.linux-x86.mk
+++ b/android_webview/libwebviewchromium.target.linux-x86.mk
@@ -33,12 +33,15 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,media_media_gyp)/media_media_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,crypto_crypto_gyp)/crypto_crypto_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openssl_openssl_gyp)/third_party_openssl_openssl_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_opts_gyp)/skia_skia_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
 	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_freetype_ft2_gyp)/third_party_freetype_ft2_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_opts_gyp)/skia_skia_chrome_opts_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_opus_opus_gyp)/third_party_opus_opus_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,base_base_i18n_gyp)/base_base_i18n_gyp.a \
@@ -101,6 +104,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_browser_gyp)/webkit_webkit_storage_browser_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,sql_sql_gyp)/sql_sql_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_WebKit_chromium_webkit_gyp)/third_party_WebKit_Source_WebKit_chromium_webkit_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
@@ -150,11 +155,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_svg_gyp)/third_party_WebKit_Source_core_webcore_svg_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_modules_modules_gyp)/third_party_WebKit_Source_modules_modules_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_leveldatabase_leveldatabase_gyp)/third_party_leveldatabase_leveldatabase_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_webkit_storage_common_gyp)/webkit_webkit_storage_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,printing_printing_gyp)/printing_printing_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_glue_glue_common_gyp)/webkit_glue_glue_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_plugins_plugins_common_gyp)/webkit_plugins_plugins_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_support_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_support_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp)/webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp.a \
@@ -167,7 +169,6 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_native_theme_native_theme_gyp)/ui_native_theme_native_theme_gyp.a \
 	$(call intermediates-dir-for,GYP,webkit_support_overscroller_jni_headers_gyp)/overscroller_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_webkit_media_gyp)/webkit_support_webkit_media_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_java_set_jni_headers_gyp)/java_set_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,content_common_aidl_gyp)/common_aidl.stamp \
@@ -183,8 +184,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_minizip_gyp)/third_party_zlib_minizip_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_snapshot_snapshot_gyp)/ui_snapshot_snapshot_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_gpu_gyp)/content_content_gpu_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_child_gyp)/content_content_child_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,content_content_utility_gyp)/content_content_utility_gyp.a \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_devtools_html_gyp)/devtools_html.stamp \
@@ -296,10 +297,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -383,10 +384,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -486,10 +487,12 @@
 	media_media_gyp \
 	crypto_crypto_gyp \
 	third_party_openssl_openssl_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	skia_skia_opts_gyp \
 	third_party_zlib_zlib_gyp \
 	third_party_freetype_ft2_gyp \
+	skia_skia_chrome_gyp \
+	skia_skia_chrome_opts_gyp \
 	third_party_opus_opus_gyp \
 	ui_ui_gyp \
 	base_base_i18n_gyp \
@@ -529,6 +532,8 @@
 	webkit_webkit_storage_browser_gyp \
 	sql_sql_gyp \
 	third_party_sqlite_sqlite_gyp \
+	third_party_leveldatabase_leveldatabase_gyp \
+	webkit_webkit_storage_common_gyp \
 	third_party_WebKit_Source_WebKit_chromium_webkit_gyp \
 	third_party_WebKit_Source_core_webcore_dom_gyp \
 	third_party_WebKit_Source_weborigin_weborigin_gyp \
@@ -555,11 +560,8 @@
 	third_party_WebKit_Source_core_webcore_svg_gyp \
 	third_party_WebKit_Source_core_webcore_derived_gyp \
 	third_party_WebKit_Source_modules_modules_gyp \
-	third_party_leveldatabase_leveldatabase_gyp \
-	webkit_webkit_storage_common_gyp \
 	webkit_support_glue_gyp \
 	printing_printing_gyp \
-	webkit_glue_glue_common_gyp \
 	webkit_plugins_plugins_common_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_support_gyp \
 	webkit_renderer_compositor_bindings_webkit_compositor_bindings_gyp \
@@ -569,7 +571,6 @@
 	ui_surface_surface_gyp \
 	webkit_support_glue_child_gyp \
 	ui_native_theme_native_theme_gyp \
-	webkit_support_webkit_media_gyp \
 	components_encryptor_gyp \
 	components_user_prefs_gyp \
 	base_base_prefs_gyp \
@@ -580,8 +581,8 @@
 	third_party_zlib_minizip_gyp \
 	ui_snapshot_snapshot_gyp \
 	content_content_gpu_gyp \
-	content_content_utility_gyp \
 	content_content_child_gyp \
+	content_content_utility_gyp \
 	net_http_server_gyp \
 	sandbox_sandbox_services_gyp \
 	sandbox_seccomp_bpf_gyp \
diff --git a/android_webview/native/android_jar_jni_headers.target.darwin-arm.mk b/android_webview/native/android_jar_jni_headers.target.darwin-arm.mk
index db6feb7..63cf551 100644
--- a/android_webview/native/android_jar_jni_headers.target.darwin-arm.mk
+++ b/android_webview/native/android_jar_jni_headers.target.darwin-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_jar_jni_headers.target.darwin-mips.mk b/android_webview/native/android_jar_jni_headers.target.darwin-mips.mk
index 2191e05..69e7217 100644
--- a/android_webview/native/android_jar_jni_headers.target.darwin-mips.mk
+++ b/android_webview/native/android_jar_jni_headers.target.darwin-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_jar_jni_headers.target.darwin-x86.mk b/android_webview/native/android_jar_jni_headers.target.darwin-x86.mk
index cfb2368..f7c242c 100644
--- a/android_webview/native/android_jar_jni_headers.target.darwin-x86.mk
+++ b/android_webview/native/android_jar_jni_headers.target.darwin-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_jar_jni_headers.target.linux-arm.mk b/android_webview/native/android_jar_jni_headers.target.linux-arm.mk
index db6feb7..63cf551 100644
--- a/android_webview/native/android_jar_jni_headers.target.linux-arm.mk
+++ b/android_webview/native/android_jar_jni_headers.target.linux-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_jar_jni_headers.target.linux-mips.mk b/android_webview/native/android_jar_jni_headers.target.linux-mips.mk
index 2191e05..69e7217 100644
--- a/android_webview/native/android_jar_jni_headers.target.linux-mips.mk
+++ b/android_webview/native/android_jar_jni_headers.target.linux-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_jar_jni_headers.target.linux-x86.mk b/android_webview/native/android_jar_jni_headers.target.linux-x86.mk
index cfb2368..f7c242c 100644
--- a/android_webview/native/android_jar_jni_headers.target.linux-x86.mk
+++ b/android_webview/native/android_jar_jni_headers.target.linux-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.darwin-arm.mk b/android_webview/native/android_webview_native_jni.target.darwin-arm.mk
index 6792708..1669251 100644
--- a/android_webview/native/android_webview_native_jni.target.darwin-arm.mk
+++ b/android_webview/native/android_webview_native_jni.target.darwin-arm.mk
@@ -243,10 +243,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -321,10 +321,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.darwin-mips.mk b/android_webview/native/android_webview_native_jni.target.darwin-mips.mk
index e8dae1d..22ccb8f 100644
--- a/android_webview/native/android_webview_native_jni.target.darwin-mips.mk
+++ b/android_webview/native/android_webview_native_jni.target.darwin-mips.mk
@@ -242,10 +242,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -319,10 +319,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.darwin-x86.mk b/android_webview/native/android_webview_native_jni.target.darwin-x86.mk
index 9853f83..4ae68f7 100644
--- a/android_webview/native/android_webview_native_jni.target.darwin-x86.mk
+++ b/android_webview/native/android_webview_native_jni.target.darwin-x86.mk
@@ -245,10 +245,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -326,10 +326,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.linux-arm.mk b/android_webview/native/android_webview_native_jni.target.linux-arm.mk
index 6792708..1669251 100644
--- a/android_webview/native/android_webview_native_jni.target.linux-arm.mk
+++ b/android_webview/native/android_webview_native_jni.target.linux-arm.mk
@@ -243,10 +243,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -321,10 +321,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.linux-mips.mk b/android_webview/native/android_webview_native_jni.target.linux-mips.mk
index e8dae1d..22ccb8f 100644
--- a/android_webview/native/android_webview_native_jni.target.linux-mips.mk
+++ b/android_webview/native/android_webview_native_jni.target.linux-mips.mk
@@ -242,10 +242,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -319,10 +319,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/android_webview_native_jni.target.linux-x86.mk b/android_webview/native/android_webview_native_jni.target.linux-x86.mk
index 9853f83..4ae68f7 100644
--- a/android_webview/native/android_webview_native_jni.target.linux-x86.mk
+++ b/android_webview/native/android_webview_native_jni.target.linux-x86.mk
@@ -245,10 +245,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -326,10 +326,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 0c128bf..9627eaa 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -676,6 +676,10 @@
   web_contents_->FocusThroughTabTraversal(false);
 }
 
+void AwContents::SetBackgroundColor(JNIEnv* env, jobject obj, jint color) {
+  render_view_host_ext_->SetBackgroundColor(color);
+}
+
 jint AwContents::ReleasePopupAwContents(JNIEnv* env, jobject obj) {
   return reinterpret_cast<jint>(pending_contents_.release());
 }
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index 0cef64e..8515e22 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -99,6 +99,7 @@
       JNIEnv* env, jobject obj);
   jboolean RestoreFromOpaqueState(JNIEnv* env, jobject obj, jbyteArray state);
   void FocusFirstNode(JNIEnv* env, jobject obj);
+  void SetBackgroundColor(JNIEnv* env, jobject obj, jint color);
   bool OnDraw(JNIEnv* env,
               jobject obj,
               jobject canvas,
diff --git a/android_webview/native/webview_native.gyp b/android_webview/native/webview_native.gyp
index 987fe59..bc6d0e5 100644
--- a/android_webview/native/webview_native.gyp
+++ b/android_webview/native/webview_native.gyp
@@ -19,7 +19,7 @@
         '../../skia/skia.gyp:skia',
         '../../ui/ui.gyp:ui',
         '../../webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
-        '../../webkit/glue/webkit_glue_common.gyp:glue_common',
+        '../../webkit/common/webkit_common.gyp:webkit_common',
         '../../webkit/storage_browser.gyp:webkit_storage_browser',
         '../../webkit/storage_common.gyp:webkit_storage_common',
         'android_webview_native_jni',
diff --git a/android_webview/native/webview_native.target.darwin-arm.mk b/android_webview/native/webview_native.target.darwin-arm.mk
index 97e8235..5029fc3 100644
--- a/android_webview/native/webview_native.target.darwin-arm.mk
+++ b/android_webview/native/webview_native.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -92,18 +93,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -202,18 +202,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -312,7 +311,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/native/webview_native.target.darwin-mips.mk b/android_webview/native/webview_native.target.darwin-mips.mk
index 229e9c6..b12867c 100644
--- a/android_webview/native/webview_native.target.darwin-mips.mk
+++ b/android_webview/native/webview_native.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -91,18 +92,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -200,18 +200,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -306,7 +305,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/native/webview_native.target.darwin-x86.mk b/android_webview/native/webview_native.target.darwin-x86.mk
index b39de48..d61cf79 100644
--- a/android_webview/native/webview_native.target.darwin-x86.mk
+++ b/android_webview/native/webview_native.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -94,17 +95,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -206,17 +206,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -310,7 +309,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/native/webview_native.target.linux-arm.mk b/android_webview/native/webview_native.target.linux-arm.mk
index 97e8235..5029fc3 100644
--- a/android_webview/native/webview_native.target.linux-arm.mk
+++ b/android_webview/native/webview_native.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -92,18 +93,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -202,18 +202,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -312,7 +311,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/native/webview_native.target.linux-mips.mk b/android_webview/native/webview_native.target.linux-mips.mk
index 229e9c6..b12867c 100644
--- a/android_webview/native/webview_native.target.linux-mips.mk
+++ b/android_webview/native/webview_native.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -91,18 +92,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -200,18 +200,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -306,7 +305,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/native/webview_native.target.linux-x86.mk b/android_webview/native/webview_native.target.linux-x86.mk
index b39de48..d61cf79 100644
--- a/android_webview/native/webview_native.target.linux-x86.mk
+++ b/android_webview/native/webview_native.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,android_webview_native_android_webview_native_jni_gyp)/android_webview_native_jni.stamp
 
@@ -94,17 +95,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -206,17 +206,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -310,7 +309,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/android_webview/renderer/aw_render_view_ext.cc b/android_webview/renderer/aw_render_view_ext.cc
index ddc6f56..66e5233 100644
--- a/android_webview/renderer/aw_render_view_ext.cc
+++ b/android_webview/renderer/aw_render_view_ext.cc
@@ -155,6 +155,7 @@
     IPC_MESSAGE_HANDLER(AwViewMsg_ResetScrollAndScaleState,
                         OnResetScrollAndScaleState)
     IPC_MESSAGE_HANDLER(AwViewMsg_SetInitialPageScale, OnSetInitialPageScale)
+    IPC_MESSAGE_HANDLER(AwViewMsg_SetBackgroundColor, OnSetBackgroundColor)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   return handled;
@@ -283,4 +284,11 @@
       page_scale_factor);
 }
 
+void AwRenderViewExt::OnSetBackgroundColor(SkColor c) {
+  if (!render_view() || !render_view()->GetWebView())
+    return;
+  // TODO(joth): Uncomment when crrev.com/19883002/ has rolled in.
+  // render_view()->GetWebView()->setBaseBackgroundColor(c);
+}
+
 }  // namespace android_webview
diff --git a/android_webview/renderer/aw_render_view_ext.h b/android_webview/renderer/aw_render_view_ext.h
index d47c1ad..744c045 100644
--- a/android_webview/renderer/aw_render_view_ext.h
+++ b/android_webview/renderer/aw_render_view_ext.h
@@ -9,6 +9,7 @@
 #include "base/compiler_specific.h"
 #include "content/public/renderer/render_view_observer.h"
 #include "third_party/WebKit/public/web/WebPermissionClient.h"
+#include "third_party/skia/include/core/SkColor.h"
 
 namespace WebKit {
 
@@ -47,6 +48,7 @@
   void OnResetScrollAndScaleState();
 
   void OnSetInitialPageScale(double page_scale_factor);
+  void OnSetBackgroundColor(SkColor c);
 
   void UpdatePageScaleFactor();
 
diff --git a/apps/app_host/app_host_main.cc b/apps/app_host/app_host_main.cc
index cf0fd26..5592f06 100644
--- a/apps/app_host/app_host_main.cc
+++ b/apps/app_host/app_host_main.cc
@@ -10,7 +10,7 @@
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "chrome/installer/launcher_support/chrome_launcher_support.h"
 
 int APIENTRY wWinMain(HINSTANCE, HINSTANCE, wchar_t*, int) {
diff --git a/apps/app_host/update.cc b/apps/app_host/update.cc
index 990e5b4..bb4411c 100644
--- a/apps/app_host/update.cc
+++ b/apps/app_host/update.cc
@@ -9,7 +9,7 @@
 #include "base/file_version_info.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_util.h"
 #include "base/version.h"
diff --git a/apps/load_and_launch_browsertest.cc b/apps/load_and_launch_browsertest.cc
index fd0f2dd..620152e 100644
--- a/apps/load_and_launch_browsertest.cc
+++ b/apps/load_and_launch_browsertest.cc
@@ -7,6 +7,7 @@
 // and when chrome is started from scratch.
 
 #include "apps/switches.h"
+#include "base/process/launch.h"
 #include "base/test/test_timeouts.h"
 #include "chrome/browser/extensions/extension_browsertest.h"
 #include "chrome/browser/extensions/extension_test_message_listener.h"
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index b96c201..8b9f9d4 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -759,7 +759,7 @@
       break;
     case PREVIOUS_IME:
       if (ime_control_delegate_)
-        return ime_control_delegate_->HandlePreviousIme();
+        return ime_control_delegate_->HandlePreviousIme(accelerator);
       break;
     case PRINT_UI_HIERARCHIES:
       return HandlePrintUIHierarchies();
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index a1a7f2c..4981cbb 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -214,8 +214,9 @@
     ++handle_next_ime_count_;
     return consume_;
   }
-  virtual bool HandlePreviousIme() OVERRIDE {
+  virtual bool HandlePreviousIme(const ui::Accelerator& accelerator) OVERRIDE {
     ++handle_previous_ime_count_;
+    last_accelerator_ = accelerator;
     return consume_;
   }
   virtual bool HandleSwitchIme(const ui::Accelerator& accelerator) OVERRIDE {
diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc
index 3a6e5c8..982176a 100644
--- a/ash/accelerators/accelerator_table.cc
+++ b/ash/accelerators/accelerator_table.cc
@@ -25,6 +25,7 @@
   { false, ui::VKEY_RSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
 
   { true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
+  { false, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
   // Shortcuts for Japanese IME.
   { true, ui::VKEY_CONVERT, ui::EF_NONE, SWITCH_IME },
   { true, ui::VKEY_NONCONVERT, ui::EF_NONE, SWITCH_IME },
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 6f56e52..77ed3b4 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -810,6 +810,14 @@
             '../chromeos/chromeos.gyp:power_manager_proto',
           ],
         }],
+        ['OS=="linux" and component=="shared_library" and linux_use_tcmalloc==1', {
+          'dependencies': [
+            '<(DEPTH)/base/allocator/allocator.gyp:allocator',
+          ],
+          'link_settings': {
+            'ldflags': ['-rdynamic'],
+          },
+        }],
       ],
     },
     {
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd
index eaa14f3..7da4c8c 100644
--- a/ash/ash_strings.grd
+++ b/ash/ash_strings.grd
@@ -279,8 +279,8 @@
       <message name="IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH" desc="The label used in the tray popup to enable bluetooth.">
         Enable Bluetooth
       </message>
-      <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_ADD_DEVICE" desc="The label used in the tray popup to add a bluetooth device.">
-        Add device...
+      <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_MANAGE_DEVICES" desc="The label used in the tray popup to manage bluetooth devices.">
+        Manage devices...
       </message>
       <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING" desc="The label used in the tray popup to show bluetooth is discovering devices.">
         Scanning for devices...
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc
index 4eb9b57..b46b6e3 100644
--- a/ash/desktop_background/desktop_background_controller_unittest.cc
+++ b/ash/desktop_background/desktop_background_controller_unittest.cc
@@ -100,8 +100,7 @@
 class DesktopBackgroundControllerTest : public test::AshTestBase {
  public:
   DesktopBackgroundControllerTest()
-      : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()),
-        command_line_(CommandLine::NO_PROGRAM),
+      : command_line_(CommandLine::NO_PROGRAM),
         controller_(NULL) {
   }
   virtual ~DesktopBackgroundControllerTest() {}
@@ -247,8 +246,6 @@
     controller_->set_command_line_for_testing(&command_line_);
   }
 
-  content::TestBrowserThread ui_thread_;
-
   // Custom command line passed to DesktopBackgroundController by
   // WriteWallpapersAndSetFlags().
   CommandLine command_line_;
diff --git a/ash/ime_control_delegate.h b/ash/ime_control_delegate.h
index 7f64dc5..6aa5609 100644
--- a/ash/ime_control_delegate.h
+++ b/ash/ime_control_delegate.h
@@ -17,7 +17,7 @@
   virtual ~ImeControlDelegate() {}
 
   virtual bool HandleNextIme() = 0;
-  virtual bool HandlePreviousIme() = 0;
+  virtual bool HandlePreviousIme(const ui::Accelerator& accelerator) = 0;
   // Switches to another IME depending on the |accelerator|.
   virtual bool HandleSwitchIme(const ui::Accelerator& accelerator) = 0;
 
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index d1ced43..2d69b15 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -196,12 +196,25 @@
 
   // Maximized area on primary display has 3px (given as
   // kAutoHideSize in shelf_layout_manager.cc) inset at the bottom.
+
+  // First clear fullscreen status, since both fullscreen and maximized windows
+  // share the same desktop workspace, which cancels the shelf status.
+  fullscreen->SetFullscreen(false);
   EXPECT_EQ(root_windows[0], maximized->GetNativeView()->GetRootWindow());
   EXPECT_EQ("0,0 600x597",
             maximized->GetWindowBoundsInScreen().ToString());
   EXPECT_EQ("0,0 600x597",
             maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
 
+  // Set fullscreen to true. In that case the 3px inset becomes invisible so
+  // the maximized window can also use the area fully.
+  fullscreen->SetFullscreen(true);
+  EXPECT_EQ(root_windows[0], maximized->GetNativeView()->GetRootWindow());
+  EXPECT_EQ("0,0 600x600",
+            maximized->GetWindowBoundsInScreen().ToString());
+  EXPECT_EQ("0,0 600x600",
+            maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
+
   EXPECT_EQ(root_windows[0], minimized->GetNativeView()->GetRootWindow());
   EXPECT_EQ("200,10 100x100",
             minimized->GetWindowBoundsInScreen().ToString());
@@ -377,13 +390,9 @@
   w3->Activate();
   EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
 
-  // Activate the maximized window's workspace. GetFullscreenWindow() should
-  // fail because the fullscreen window's workspace is no longer active.
+  // Since there's only one desktop workspace, it always returns the same
+  // fullscreen window.
   w1->Activate();
-  EXPECT_FALSE(controller->GetFullscreenWindow());
-
-  // If the fullscreen window is active, GetFullscreenWindow() should find it.
-  w2->Activate();
   EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
 }
 
diff --git a/ash/screensaver/screensaver_view_unittest.cc b/ash/screensaver/screensaver_view_unittest.cc
index 6f82dd0..0901ba4 100644
--- a/ash/screensaver/screensaver_view_unittest.cc
+++ b/ash/screensaver/screensaver_view_unittest.cc
@@ -18,8 +18,8 @@
  public:
   ScreensaverViewTest() {
     url_ = GURL("http://www.google.com");
-    views_delegate_.reset(new AshTestViewsDelegate);
-    webview_test_helper_.reset(new views::WebViewTestHelper(message_loop()));
+    views_delegate_.reset(new AshTestViewsDelegate());
+    webview_test_helper_.reset(new views::WebViewTestHelper());
   }
 
   virtual ~ScreensaverViewTest() {}
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index c778f08..0a82ceb 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -571,7 +571,10 @@
   EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior());
   EXPECT_EQ(bounds_fullscreen.ToString(), window->bounds().ToString());
 
+  // Close actually, otherwise further event may be affected since widget
+  // is fullscreen status.
   widget->Close();
+  RunAllPendingInMessageLoop();
 }
 
 // Fails on Mac only.  Need to be implemented.  http://crbug.com/111279.
@@ -1260,13 +1263,22 @@
 
 TEST_F(ShelfLayoutManagerTest, MAYBE_GestureDrag) {
   ShelfLayoutManager* shelf = GetShelfLayoutManager();
-  RunGestureDragTests(gfx::Vector2d(0, 100));
+  {
+    SCOPED_TRACE("BOTTOM");
+    RunGestureDragTests(gfx::Vector2d(0, 100));
+  }
 
-  shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
-  RunGestureDragTests(gfx::Vector2d(-100, 0));
+  {
+    SCOPED_TRACE("LEFT");
+    shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
+    RunGestureDragTests(gfx::Vector2d(-100, 0));
+  }
 
-  shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
-  RunGestureDragTests(gfx::Vector2d(100, 0));
+  {
+    SCOPED_TRACE("RIGHT");
+    shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
+    RunGestureDragTests(gfx::Vector2d(100, 0));
+  }
 }
 
 TEST_F(ShelfLayoutManagerTest, WindowVisibilityDisablesAutoHide) {
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc
index b3a398a..95af770 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -103,7 +103,7 @@
   BluetoothDetailedView(SystemTrayItem* owner, user::LoginStatus login)
       : TrayDetailsView(owner),
         login_(login),
-        add_device_(NULL),
+        manage_devices_(NULL),
         toggle_bluetooth_(NULL),
         enable_bluetooth_(NULL),
         bluetooth_discovering_(false) {
@@ -308,11 +308,11 @@
     ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
     HoverHighlightView* container = new HoverHighlightView(this);
     container->AddLabel(
-        rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BLUETOOTH_ADD_DEVICE),
+        rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BLUETOOTH_MANAGE_DEVICES),
         gfx::Font::NORMAL);
     container->SetEnabled(delegate->GetBluetoothAvailable());
     AddChildView(container);
-    add_device_ = container;
+    manage_devices_ = container;
   }
 
   // Returns true if the device with |device_id| is found in |device_list|,
@@ -354,10 +354,8 @@
         ash::Shell::GetInstance()->system_tray_delegate();
     if (sender == footer()->content()) {
       owner()->system_tray()->ShowDefaultView(BUBBLE_USE_EXISTING);
-    } else if (sender == add_device_) {
-      if (!delegate->GetBluetoothEnabled())
-        delegate->ToggleBluetooth();
-      delegate->AddBluetoothDevice();
+    } else if (sender == manage_devices_) {
+      delegate->ManageBluetoothDevices();
     } else if (sender == enable_bluetooth_) {
       delegate->ToggleBluetooth();
     } else {
@@ -389,7 +387,7 @@
   user::LoginStatus login_;
 
   std::map<views::View*, std::string> device_map_;
-  views::View* add_device_;
+  views::View* manage_devices_;
   ThrobberView* throbber_;
   TrayPopupHeaderButton* toggle_bluetooth_;
   HoverHighlightView* enable_bluetooth_;
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index a37dc77..929ef35 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -539,8 +539,7 @@
   }
   if (system_bubble_) {
     system_bubble_->bubble_view()->UpdateBubble();
-    if (!ash::switches::UseAlternateShelfLayout())
-      UpdateBubbleViewArrow(system_bubble_->bubble_view());
+    UpdateBubbleViewArrow(system_bubble_->bubble_view());
   }
 }
 
diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h
index ee60831..45b0c71 100644
--- a/ash/system/tray/system_tray_delegate.h
+++ b/ash/system/tray/system_tray_delegate.h
@@ -253,8 +253,8 @@
   // Sends a connect request for the network specified by |network_id|.
   virtual void ConnectToNetwork(const std::string& network_id) = 0;
 
-  // Shows UI to add a new bluetooth device.
-  virtual void AddBluetoothDevice() = 0;
+  // Shows UI to manage bluetooth devices.
+  virtual void ManageBluetoothDevices() = 0;
 
   // Toggles bluetooth.
   virtual void ToggleBluetooth() = 0;
diff --git a/ash/system/tray/test_system_tray_delegate.cc b/ash/system/tray/test_system_tray_delegate.cc
index 7038cc3..38a7bcb 100644
--- a/ash/system/tray/test_system_tray_delegate.cc
+++ b/ash/system/tray/test_system_tray_delegate.cc
@@ -227,7 +227,7 @@
 void TestSystemTrayDelegate::ConnectToNetwork(const std::string& network_id) {
 }
 
-void TestSystemTrayDelegate::AddBluetoothDevice() {
+void TestSystemTrayDelegate::ManageBluetoothDevices() {
 }
 
 void TestSystemTrayDelegate::ToggleBluetooth() {
diff --git a/ash/system/tray/test_system_tray_delegate.h b/ash/system/tray/test_system_tray_delegate.h
index 56cb078..26a3dc7 100644
--- a/ash/system/tray/test_system_tray_delegate.h
+++ b/ash/system/tray/test_system_tray_delegate.h
@@ -70,7 +70,7 @@
       ash::DriveOperationStatusList*) OVERRIDE;
   virtual void ConfigureNetwork(const std::string& network_id) OVERRIDE;
   virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE;
-  virtual void AddBluetoothDevice() OVERRIDE;
+  virtual void ManageBluetoothDevices() OVERRIDE;
   virtual void ToggleBluetooth() OVERRIDE;
   virtual bool IsBluetoothDiscovering() OVERRIDE;
   virtual void ShowMobileSimDialog() OVERRIDE;
diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc
index 61095d7..8f46741 100644
--- a/ash/system/tray/tray_background_view.cc
+++ b/ash/system/tray/tray_background_view.cc
@@ -581,6 +581,9 @@
 
 void TrayBackgroundView::UpdateBubbleViewArrow(
     views::TrayBubbleView* bubble_view) {
+  if (switches::UseAlternateShelfLayout())
+    return;
+
   aura::RootWindow* root_window =
       bubble_view->GetWidget()->GetNativeView()->GetRootWindow();
   ash::internal::ShelfLayoutManager* shelf =
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 6917e0e..72281af 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -87,7 +87,7 @@
       teardown_called_(false) {
   // Must initialize |ash_test_helper_| here because some tests rely on
   // AshTestBase methods before they call AshTestBase::SetUp().
-  ash_test_helper_.reset(new AshTestHelper(&message_loop_));
+  ash_test_helper_.reset(new AshTestHelper(base::MessageLoopForUI::current()));
 }
 
 AshTestBase::~AshTestBase() {
diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h
index 830001c..62afcd8 100644
--- a/ash/test/ash_test_base.h
+++ b/ash/test/ash_test_base.h
@@ -10,6 +10,7 @@
 #include "base/compiler_specific.h"
 #include "base/message_loop/message_loop.h"
 #include "base/threading/thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/aura/client/window_types.h"
@@ -54,8 +55,6 @@
   AshTestBase();
   virtual ~AshTestBase();
 
-  base::MessageLoopForUI* message_loop() { return &message_loop_; }
-
   // testing::Test:
   virtual void SetUp() OVERRIDE;
   virtual void TearDown() OVERRIDE;
@@ -114,7 +113,7 @@
  private:
   bool setup_called_;
   bool teardown_called_;
-  base::MessageLoopForUI message_loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<AshTestHelper> ash_test_helper_;
   scoped_ptr<aura::test::EventGenerator> event_generator_;
 #if defined(OS_WIN)
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc
index 2b1e4e6..facefed 100644
--- a/ash/wm/panels/panel_layout_manager.cc
+++ b/ash/wm/panels/panel_layout_manager.cc
@@ -712,6 +712,10 @@
     active_panel = last_active_panel_;
   }
 
+  ShelfAlignment alignment = launcher_->alignment();
+  bool horizontal = alignment == SHELF_ALIGNMENT_TOP ||
+                    alignment == SHELF_ALIGNMENT_BOTTOM;
+
   // We want to to stack the panels like a deck of cards:
   // ,--,--,--,-------.--.--.
   // |  |  |  |       |  |  |
@@ -725,7 +729,9 @@
   for (PanelList::const_iterator it = panel_windows_.begin();
        it != panel_windows_.end(); ++it) {
     gfx::Rect bounds = it->window->bounds();
-    window_ordering.insert(std::make_pair(bounds.x() + bounds.width() / 2,
+    window_ordering.insert(std::make_pair(horizontal ?
+                                              bounds.x() + bounds.width() / 2 :
+                                              bounds.y() + bounds.height() / 2,
                                           it->window));
   }
 
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index 26f42cc..ca231ce 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -393,6 +393,37 @@
   EXPECT_TRUE(WindowIsAbove(w2.get(), w1.get()));
 }
 
+TEST_F(PanelLayoutManagerTest, MultiplePanelStackingVertical) {
+  // set launcher shelf to be aligned on the right
+  SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT);
+
+  // Size panels in such a way that ordering them by X coordinate would cause
+  // stacking order to be incorrect. Test that stacking order is based on Y.
+  scoped_ptr<aura::Window> w1(CreatePanelWindow(gfx::Rect(0, 0, 210, 201)));
+  scoped_ptr<aura::Window> w2(CreatePanelWindow(gfx::Rect(0, 0, 220, 201)));
+  scoped_ptr<aura::Window> w3(CreatePanelWindow(gfx::Rect(0, 0, 200, 201)));
+
+  // Default stacking order.
+  EXPECT_TRUE(WindowIsAbove(w3.get(), w2.get()));
+  EXPECT_TRUE(WindowIsAbove(w2.get(), w1.get()));
+
+  // Changing the active window should update the stacking order.
+  wm::ActivateWindow(w1.get());
+  launcher_view_test()->RunMessageLoopUntilAnimationsDone();
+  EXPECT_TRUE(WindowIsAbove(w1.get(), w2.get()));
+  EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get()));
+
+  wm::ActivateWindow(w2.get());
+  launcher_view_test()->RunMessageLoopUntilAnimationsDone();
+  EXPECT_TRUE(WindowIsAbove(w1.get(), w3.get()));
+  EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get()));
+  EXPECT_TRUE(WindowIsAbove(w2.get(), w1.get()));
+
+  wm::ActivateWindow(w3.get());
+  EXPECT_TRUE(WindowIsAbove(w3.get(), w2.get()));
+  EXPECT_TRUE(WindowIsAbove(w2.get(), w1.get()));
+}
+
 TEST_F(PanelLayoutManagerTest, MultiplePanelCallout) {
   gfx::Rect bounds(0, 0, 200, 200);
   scoped_ptr<aura::Window> w1(CreatePanelWindow(bounds));
diff --git a/ash/wm/workspace/workspace.cc b/ash/wm/workspace/workspace.cc
index cd790a1..862c5d0 100644
--- a/ash/wm/workspace/workspace.cc
+++ b/ash/wm/workspace/workspace.cc
@@ -19,10 +19,8 @@
 namespace internal {
 
 Workspace::Workspace(WorkspaceManager* manager,
-                     aura::Window* parent,
-                     bool is_fullscreen)
-    : is_fullscreen_(is_fullscreen),
-      workspace_manager_(manager),
+                     aura::Window* parent)
+    : workspace_manager_(manager),
       window_(new aura::Window(NULL)),
       event_handler_(new WorkspaceEventHandler(window_)),
       workspace_layout_manager_(NULL) {
@@ -71,38 +69,5 @@
   return window;
 }
 
-bool Workspace::ShouldMoveToPending() const {
-  if (!is_fullscreen_)
-    return false;
-
-  for (size_t i = 0; i < window_->children().size(); ++i) {
-    aura::Window* child(window_->children()[i]);
-    if (!child->TargetVisibility() || wm::IsWindowMinimized(child))
-      continue;
-
-    // If we have a fullscreen window don't move to pending.
-    if (wm::IsWindowFullscreen(child))
-      return false;
-
-    if (GetTrackedByWorkspace(child) && !GetPersistsAcrossAllWorkspaces(child))
-      return false;
-  }
-  return true;
-}
-
-int Workspace::GetNumFullscreenWindows() const {
-  int count = 0;
-  for (size_t i = 0; i < window_->children().size(); ++i) {
-    aura::Window* child = window_->children()[i];
-    if (GetTrackedByWorkspace(child) &&
-        (wm::IsWindowFullscreen(child) ||
-         WorkspaceManager::WillRestoreToWorkspace(child))) {
-      if (++count == 2)
-        return count;
-    }
-  }
-  return count;
-}
-
 }  // namespace internal
 }  // namespace ash
diff --git a/ash/wm/workspace/workspace.h b/ash/wm/workspace/workspace.h
index 4b8423b..c348be1 100644
--- a/ash/wm/workspace/workspace.h
+++ b/ash/wm/workspace/workspace.h
@@ -26,14 +26,12 @@
 class WorkspaceLayoutManager;
 class WorkspaceManager;
 
-// Workspace is used to maintain either a single fullscreen windows (including
-// transients and other windows) or any number of windows (for the
-// desktop). Workspace is used by WorkspaceManager to manage a set of windows.
+// Workspace is used to maintain any number of windows (for the desktop).
+// Workspace is used by WorkspaceManager to manage a set of windows.
 class ASH_EXPORT Workspace {
  public:
   Workspace(WorkspaceManager* manager,
-            aura::Window* parent,
-            bool is_fullscreen);
+            aura::Window* parent);
   ~Workspace();
 
   // Returns the topmost activatable window. This corresponds to the most
@@ -43,8 +41,6 @@
   // Resets state. This should be used before destroying the Workspace.
   aura::Window* ReleaseWindow();
 
-  bool is_fullscreen() const { return is_fullscreen_; }
-
   aura::Window* window() { return window_; }
 
   const WorkspaceLayoutManager* workspace_layout_manager() const {
@@ -59,18 +55,7 @@
   }
   WorkspaceManager* workspace_manager() { return workspace_manager_; }
 
-  // Returns true if the Workspace should be moved to pending. This is true
-  // if there are no visible fullscreen windows.
-  bool ShouldMoveToPending() const;
-
-  // Returns the number of fullscreen windows (including minimized windows that
-  // would be fullscreen on restore). This does not consider visibility.
-  int GetNumFullscreenWindows() const;
-
  private:
-  // Is this a workspace for fullscreen windows?
-  const bool is_fullscreen_;
-
   WorkspaceManager* workspace_manager_;
 
   // Our Window, owned by |parent| passed to the constructor.
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 834a332..33a07f7 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -191,36 +191,8 @@
       SetRestoreBoundsInScreen(window, window->GetBoundsInScreen());
     }
 
-    // If the new state requires |window| to be in a workspace, clone the layer.
-    // WorkspaceManager will use it (and take ownership of it) when animating.
-    // Ideally we could use that of BaseLayoutManager, but that proves
-    // problematic. In particular when restoring we need to animate on top of
-    // the workspace animating in.
-    ui::Layer* cloned_layer = NULL;
-    BoundsMap bounds_map;
-    if (wm::IsActiveWindow(window) &&
-        ((new_state == ui::SHOW_STATE_FULLSCREEN &&
-          wm::IsWindowStateNormal(old_state)) ||
-         (new_state != ui::SHOW_STATE_FULLSCREEN &&
-          old_state == ui::SHOW_STATE_FULLSCREEN &&
-          new_state != ui::SHOW_STATE_MINIMIZED))) {
-      BuildWindowBoundsMap(window, &bounds_map);
-      cloned_layer = views::corewm::RecreateWindowLayers(window, false);
-      // Constrained windows don't get their bounds reset when we update the
-      // window bounds. Leaving them empty is unexpected, so we reset them now.
-      ResetConstrainedWindowBoundsIfNecessary(bounds_map, window);
-    }
     UpdateBoundsFromShowState(window);
-
-    if (cloned_layer) {
-      // Even though we just set the bounds not all descendants may have valid
-      // bounds. For example, constrained windows don't resize with the parent.
-      // Ensure that all windows that had a bounds before we cloned the layer
-      // have a bounds now.
-      ResetBoundsIfNecessary(bounds_map, window);
-    }
-
-    ShowStateChanged(window, old_state, cloned_layer);
+    ShowStateChanged(window, old_state);
 
     // Set the restore rectangle to the previously set restore rectangle.
     if (!restore.IsEmpty())
@@ -230,8 +202,7 @@
   if (key == internal::kWindowTrackedByWorkspaceKey &&
       GetTrackedByWorkspace(window)) {
     workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window);
-    if (wm::IsWindowMaximized(window))
-      SetMaximizedOrFullscreenBounds(window);
+    SetMaximizedOrFullscreenBounds(window);
   }
 
   if (key == aura::client::kAlwaysOnTopKey &&
@@ -260,16 +231,14 @@
 
 void WorkspaceLayoutManager::ShowStateChanged(
     Window* window,
-    ui::WindowShowState last_show_state,
-    ui::Layer* cloned_layer) {
+    ui::WindowShowState last_show_state) {
   if (wm::IsWindowMinimized(window)) {
-    DCHECK(!cloned_layer);
     // Save the previous show state so that we can correctly restore it.
     window->SetProperty(aura::client::kRestoreShowStateKey, last_show_state);
     views::corewm::SetWindowVisibilityAnimationType(
         window, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
     workspace_manager()->OnWorkspaceWindowShowStateChanged(
-        workspace_, window, last_show_state, NULL);
+        workspace_, window, last_show_state);
     window->Hide();
     if (wm::IsActiveWindow(window))
       wm::DeactivateWindow(window);
@@ -287,7 +256,7 @@
       window->ClearProperty(internal::kWindowRestoresToRestoreBounds);
     }
     workspace_manager()->OnWorkspaceWindowShowStateChanged(
-        workspace_, window, last_show_state, cloned_layer);
+        workspace_, window, last_show_state);
   }
 }
 
@@ -379,7 +348,8 @@
           window->parent()->parent()));
       break;
     case ui::SHOW_STATE_FULLSCREEN:
-      SetMaximizedOrFullscreenBounds(window);
+      CrossFadeToBounds(window, ScreenAsh::GetDisplayBoundsInParent(
+          window->parent()->parent()));
       break;
 
     default:
diff --git a/ash/wm/workspace/workspace_layout_manager.h b/ash/wm/workspace/workspace_layout_manager.h
index 65246d2..c955259 100644
--- a/ash/wm/workspace/workspace_layout_manager.h
+++ b/ash/wm/workspace/workspace_layout_manager.h
@@ -70,13 +70,9 @@
  private:
   typedef std::set<aura::Window*> WindowSet;
 
-  // Invoked when the show state of a window changes. |cloned_layer| is a clone
-  // of the windows layer tree. |cloned_layer| is only non-NULL if a cross fade
-  // should happen between the states. This method takes ownership of
-  // |cloned_layer|.
+  // Invoked when the show state of a window changes.
   void ShowStateChanged(aura::Window* window,
-                        ui::WindowShowState last_show_state,
-                        ui::Layer* cloned_layer);
+                        ui::WindowShowState last_show_state);
 
   enum AdjustWindowReason {
     ADJUST_WINDOW_SCREEN_SIZE_CHANGED,
diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc
index ffed0dc..cef9fb6 100644
--- a/ash/wm/workspace/workspace_manager.cc
+++ b/ash/wm/workspace/workspace_manager.cc
@@ -113,15 +113,13 @@
       active_workspace_(NULL),
       shelf_(NULL),
       in_move_(false),
-      clear_unminimizing_workspace_factory_(this),
-      unminimizing_workspace_(NULL),
       app_terminating_(false),
       creating_fade_(false) {
   // Clobber any existing event filter.
   contents_window->SetEventFilter(NULL);
   // |contents_window| takes ownership of LayoutManagerImpl.
   contents_window->SetLayoutManager(new LayoutManagerImpl(this));
-  active_workspace_ = CreateWorkspace(false);
+  active_workspace_ = new Workspace(this, contents_window_);
   workspaces_.push_back(active_workspace_);
   active_workspace_->window()->Show();
   Shell::GetInstance()->AddShellObserver(this);
@@ -145,18 +143,10 @@
   STLDeleteElements(&to_delete_);
 }
 
-// static
-bool WorkspaceManager::WillRestoreToWorkspace(Window* window) {
-  return wm::IsWindowMinimized(window) &&
-      window->GetProperty(aura::client::kRestoreShowStateKey) ==
-      ui::SHOW_STATE_FULLSCREEN;
-}
-
 WorkspaceWindowState WorkspaceManager::GetWindowState() const {
   if (!shelf_)
     return WORKSPACE_WINDOW_STATE_DEFAULT;
 
-  const bool is_active_fullscreen = active_workspace_->is_fullscreen();
   const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
   const Window::Windows& windows(active_workspace_->window()->children());
   bool window_overlaps_launcher = false;
@@ -172,11 +162,7 @@
       // An untracked window may still be fullscreen so we keep iterating when
       // we hit a maximized window.
       has_maximized_window = true;
-    } else if (is_active_fullscreen && wm::IsWindowFullscreen(*i)) {
-      // Ignore fullscreen windows if we're in the desktop. Such a state
-      // is transitory and means we haven't yet switched. If we did consider
-      // such windows we'll return the wrong thing, which can lead to
-      // prematurely anging the launcher state and clobbering restore bounds.
+    } else if (wm::IsWindowFullscreen(*i)) {
       return WORKSPACE_WINDOW_STATE_FULL_SCREEN;
     }
     if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds))
@@ -218,18 +204,12 @@
     //   own workspace.
     if (!GetTrackedByWorkspace(window) ||
         (GetPersistsAcrossAllWorkspaces(window) &&
-         !wm::IsWindowFullscreen(window) && !WillRestoreToWorkspace(window))) {
+         !wm::IsWindowFullscreen(window))) {
       ReparentWindow(window, active_workspace_->window(), NULL);
     } else {
       SetActiveWorkspace(workspace, SWITCH_WINDOW_MADE_ACTIVE);
     }
   }
-
-  if (workspace->is_fullscreen() && wm::IsWindowFullscreen(window)) {
-    // Clicking on the fullscreen window in a fullscreen workspace. Force all
-    // other windows to drop to the desktop.
-    MoveChildrenToDesktop(workspace->window(), NULL);
-  }
 }
 
 Window* WorkspaceManager::GetActiveWorkspaceWindow() {
@@ -239,7 +219,7 @@
 Window* WorkspaceManager::GetParentForNewWindow(Window* window) {
   // Try to put windows with transient parents in the same workspace as their
   // transient parent.
-  if (window->transient_parent() && !wm::IsWindowFullscreen(window)) {
+  if (window->transient_parent()) {
     Workspace* workspace = FindBy(window->transient_parent());
     if (workspace)
       return workspace->window();
@@ -249,16 +229,6 @@
   if (!GetTrackedByWorkspace(window))
     return active_workspace_->window();
 
-  if (wm::IsWindowFullscreen(window)) {
-    // Wait for the window to be made active before showing the workspace.
-    Workspace* workspace = CreateWorkspace(true);
-    pending_workspaces_.insert(workspace);
-    return workspace->window();
-  }
-
-  if (!GetTrackedByWorkspace(window) || GetPersistsAcrossAllWorkspaces(window))
-    return active_workspace_->window();
-
   return desktop_workspace()->window();
 }
 
@@ -339,24 +309,9 @@
   active_workspace_->workspace_layout_manager()->
       OnDisplayWorkAreaInsetsChanged();
 
-  const bool is_unminimizing_fullscreen_window =
-      unminimizing_workspace_ && unminimizing_workspace_ == active_workspace_ &&
-      active_workspace_->is_fullscreen();
-  if (is_unminimizing_fullscreen_window) {
-    // If we're unminimizing a window it needs to be on the top, otherwise you
-    // won't see the animation.
-    contents_window_->StackChildAtTop(active_workspace_->window());
-  } else if (active_workspace_->is_fullscreen() &&
-             last_active->is_fullscreen() &&
-             reason != SWITCH_FULLSCREEN_FROM_FULLSCREEN_WORKSPACE) {
-    // When switching between fullscreen windows we need the last active
-    // workspace on top of the new, otherwise the animations won't look
-    // right. Since only one workspace is visible at a time stacking order of
-    // the workspace windows ultimately doesn't matter.
-    contents_window_->StackChildAtTop(last_active->window());
-  }
+  contents_window_->StackChildAtTop(last_active->window());
 
-  HideWorkspace(last_active, reason, is_unminimizing_fullscreen_window);
+  HideWorkspace(last_active, reason);
   ShowWorkspace(workspace, last_active, reason);
 
   UpdateShelfVisibility();
@@ -371,8 +326,8 @@
   return std::find(workspaces_.begin(), workspaces_.end(), workspace);
 }
 
-Workspace* WorkspaceManager::CreateWorkspace(bool fullscreen) {
-  return new Workspace(this, contents_window_, fullscreen);
+Workspace* WorkspaceManager::CreateWorkspaceForTest() {
+  return new Workspace(this, contents_window_);
 }
 
 void WorkspaceManager::MoveWorkspaceToPendingOrDelete(
@@ -404,8 +359,6 @@
   }
 
   if (workspace->window()->children().empty()) {
-    if (workspace == unminimizing_workspace_)
-      unminimizing_workspace_ = NULL;
     pending_workspaces_.erase(workspace);
     ScheduleDelete(workspace);
   } else {
@@ -420,8 +373,7 @@
   Window::Windows to_move;
   for (size_t i = 0; i < window->children().size(); ++i) {
     Window* child = window->children()[i];
-    if (!child->transient_parent() && !wm::IsWindowFullscreen(child) &&
-        !WillRestoreToWorkspace(child)) {
+    if (!child->transient_parent() && !wm::IsWindowFullscreen(child)) {
       to_move.push_back(child);
     }
   }
@@ -454,24 +406,6 @@
                       &WorkspaceManager::ProcessDeletion);
 }
 
-void WorkspaceManager::SetUnminimizingWorkspace(Workspace* workspace) {
-  // The normal sequence of unminimizing a window is: Show() the window, which
-  // triggers changing the kShowStateKey to NORMAL and lastly the window is made
-  // active. This means at the time the window is unminimized we don't know if
-  // the workspace it is in is going to become active. To track this
-  // |unminimizing_workspace_| is set at the time we unminimize and a task is
-  // schedule to reset it. This way when we get the activate we know we're in
-  // the process unminimizing and can do the right animation.
-  unminimizing_workspace_ = workspace;
-  if (unminimizing_workspace_) {
-    base::MessageLoop::current()->PostTask(
-        FROM_HERE,
-        base::Bind(&WorkspaceManager::SetUnminimizingWorkspace,
-                   clear_unminimizing_workspace_factory_.GetWeakPtr(),
-                   static_cast<Workspace*>(NULL)));
-  }
-}
-
 void WorkspaceManager::FadeDesktop(aura::Window* window,
                                    base::TimeDelta duration) {
   if (views::corewm::WindowAnimationsDisabled(NULL) ||
@@ -512,9 +446,6 @@
   switch (reason) {
     case SWITCH_WINDOW_MADE_ACTIVE:
     case SWITCH_TRACKED_BY_WORKSPACE_CHANGED:
-    case SWITCH_WINDOW_REMOVED:
-    case SWITCH_VISIBILITY_CHANGED:
-    case SWITCH_MINIMIZED:
       details.animate = details.animate_scale = true;
       details.animate_opacity = last_active == desktop_workspace();
       break;
@@ -533,8 +464,7 @@
 
 void WorkspaceManager::HideWorkspace(
     Workspace* workspace,
-    SwitchReason reason,
-    bool is_unminimizing_fullscreen_window) const {
+    SwitchReason reason) const {
   WorkspaceAnimationDetails details;
   details.direction = active_workspace_ == desktop_workspace() ?
       WORKSPACE_ANIMATE_UP : WORKSPACE_ANIMATE_DOWN;
@@ -543,29 +473,11 @@
     case SWITCH_TRACKED_BY_WORKSPACE_CHANGED:
       details.animate_opacity =
           ((active_workspace_ == desktop_workspace() ||
-            workspace != desktop_workspace()) &&
-           !is_unminimizing_fullscreen_window);
+            workspace != desktop_workspace()));
       details.animate_scale = true;
       details.animate = true;
       break;
 
-    case SWITCH_VISIBILITY_CHANGED:
-      // The window is most likely closing. Make the workspace visible for the
-      // duration of the switch so that the close animation is visible.
-      details.animate = true;
-      details.animate_scale = true;
-      break;
-
-    case SWITCH_FULLSCREEN_FROM_FULLSCREEN_WORKSPACE:
-    case SWITCH_MAXIMIZED_OR_RESTORED:
-      if (active_workspace_->is_fullscreen()) {
-        // Delay the hide until the animation is done.
-        details.duration =
-            base::TimeDelta::FromMilliseconds(kCrossFadeSwitchTimeMS);
-        details.animate = true;
-      }
-      break;
-
     // Remaining cases require no animation.
     default:
       break;
@@ -615,25 +527,19 @@
 
 void WorkspaceManager::OnWindowRemovedFromWorkspace(Workspace* workspace,
                                                     Window* child) {
-  if (workspace->ShouldMoveToPending())
-    MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_WINDOW_REMOVED);
   UpdateShelfVisibility();
 }
 
 void WorkspaceManager::OnWorkspaceChildWindowVisibilityChanged(
     Workspace* workspace,
     Window* child) {
-  if (workspace->ShouldMoveToPending()) {
-    MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_VISIBILITY_CHANGED);
-  } else {
-    if (child->TargetVisibility())
-      RearrangeVisibleWindowOnShow(child);
-    else
-      RearrangeVisibleWindowOnHideOrRemove(child);
-    if (workspace == active_workspace_) {
-      UpdateShelfVisibility();
-      FramePainter::UpdateSoloWindowHeader(child->GetRootWindow());
-    }
+  if (child->TargetVisibility())
+    RearrangeVisibleWindowOnShow(child);
+  else
+    RearrangeVisibleWindowOnHideOrRemove(child);
+  if (workspace == active_workspace_) {
+    UpdateShelfVisibility();
+    FramePainter::UpdateSoloWindowHeader(child->GetRootWindow());
   }
 }
 
@@ -647,109 +553,37 @@
 void WorkspaceManager::OnWorkspaceWindowShowStateChanged(
     Workspace* workspace,
     Window* child,
-    ui::WindowShowState last_show_state,
-    ui::Layer* old_layer) {
+    ui::WindowShowState last_show_state) {
   // |child| better still be in |workspace| else things have gone wrong.
   DCHECK_EQ(workspace, child->GetProperty(kWorkspaceKey));
 
-  if (wm::IsWindowMinimized(child)) {
-    if (workspace->ShouldMoveToPending())
-      MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_MINIMIZED);
-    DCHECK(!old_layer);
-  } else {
-    // Set of cases to deal with:
-    // . More than one fullscreen window: move newly fullscreen window into
-    //   own workspace.
-    // . One fullscreen window and not in a fullscreen workspace: move window
-    //   into own workspace.
-    // . No fullscreen window and not in desktop: move to desktop and further
-    //   any existing windows are stacked beneath |child|.
-    const bool is_active = wm::IsActiveWindow(child);
-    Workspace* new_workspace = NULL;
-    const int full_count = workspace->GetNumFullscreenWindows();
-    base::TimeDelta duration = (old_layer && !wm::IsWindowFullscreen(child)) ?
-            GetCrossFadeDuration(old_layer->bounds(), child->bounds()) :
-            base::TimeDelta::FromMilliseconds(kCrossFadeSwitchTimeMS);
-    if (full_count == 0) {
-      if (workspace != desktop_workspace()) {
-        {
-          base::AutoReset<bool> setter(&in_move_, true);
-          ReparentWindow(child, desktop_workspace()->window(), NULL);
-        }
-        DCHECK(!is_active || old_layer);
-        new_workspace = desktop_workspace();
-        SetActiveWorkspace(new_workspace, SWITCH_MAXIMIZED_OR_RESTORED);
-        MoveWorkspaceToPendingOrDelete(workspace, child,
-                                       SWITCH_MAXIMIZED_OR_RESTORED);
-        if (FindWorkspace(workspace) == workspaces_.end())
-          workspace = NULL;
-      }
-    } else if ((full_count == 1 && workspace == desktop_workspace()) ||
-               full_count > 1) {
-      new_workspace = CreateWorkspace(true);
-      pending_workspaces_.insert(new_workspace);
-      ReparentWindow(child, new_workspace->window(), NULL);
+  if (!wm::IsWindowMinimized(child) && workspace != desktop_workspace()) {
+    {
+      base::AutoReset<bool> setter(&in_move_, true);
+      ReparentWindow(child, desktop_workspace()->window(), NULL);
     }
-    if (is_active && new_workspace) {
-      // |old_layer| may be NULL if as part of processing
-      // WorkspaceLayoutManager::OnWindowPropertyChanged() the window is made
-      // active.
-      if (old_layer) {
-        SetActiveWorkspace(new_workspace,
-                           full_count >= 2 ?
-                               SWITCH_FULLSCREEN_FROM_FULLSCREEN_WORKSPACE :
-                               SWITCH_MAXIMIZED_OR_RESTORED);
-        CrossFadeWindowBetweenWorkspaces(new_workspace->window(), child,
-                                         old_layer);
-        if (workspace == desktop_workspace() ||
-            new_workspace == desktop_workspace()) {
-          FadeDesktop(child, duration);
-        }
-      } else {
-        SetActiveWorkspace(new_workspace, SWITCH_OTHER);
-      }
-    } else {
-      if (last_show_state == ui::SHOW_STATE_MINIMIZED)
-        SetUnminimizingWorkspace(new_workspace ? new_workspace : workspace);
-      DCHECK(!old_layer);
-    }
+    SetActiveWorkspace(desktop_workspace(), SWITCH_MAXIMIZED_OR_RESTORED);
+    MoveWorkspaceToPendingOrDelete(workspace,
+                                   child,
+                                   SWITCH_MAXIMIZED_OR_RESTORED);
   }
   UpdateShelfVisibility();
 }
 
 void WorkspaceManager::OnTrackedByWorkspaceChanged(Workspace* workspace,
                                                    aura::Window* window) {
-  Workspace* new_workspace = NULL;
-  if (wm::IsWindowFullscreen(window)) {
-    if (workspace->is_fullscreen() &&
-        workspace->GetNumFullscreenWindows() == 1) {
-      // If |window| is the only window in a fullscreen workspace then leave
-      // it there. Additionally animate it back to the origin.
-      ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
-      // All bounds changes get routed through WorkspaceLayoutManager and since
-      // the window is fullscreen WorkspaceLayoutManager is going to force a
-      // value. In other words, it doesn't matter what we supply to SetBounds()
-      // here.
-      window->SetBounds(gfx::Rect());
-      return;
-    }
-    new_workspace = CreateWorkspace(true);
-    pending_workspaces_.insert(new_workspace);
-  } else if (workspace->is_fullscreen()) {
-    new_workspace = desktop_workspace();
-  } else {
+  if (workspace == active_workspace_)
     return;
-  }
+
   // If the window is active we need to make sure the destination Workspace
   // window is showing. Otherwise the window will be parented to a hidden window
   // and lose activation.
   const bool is_active = wm::IsActiveWindow(window);
   if (is_active)
-    new_workspace->window()->Show();
-  ReparentWindow(window, new_workspace->window(), NULL);
-  if (is_active) {
-    SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED);
-  }
+    workspace->window()->Show();
+  ReparentWindow(window, workspace->window(), NULL);
+  if (is_active)
+    SetActiveWorkspace(workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED);
 }
 
 }  // namespace internal
diff --git a/ash/wm/workspace/workspace_manager.h b/ash/wm/workspace/workspace_manager.h
index 2b53598..55f2065 100644
--- a/ash/wm/workspace/workspace_manager.h
+++ b/ash/wm/workspace/workspace_manager.h
@@ -58,10 +58,6 @@
   explicit WorkspaceManager(aura::Window* viewport);
   virtual ~WorkspaceManager();
 
-  // Returns true if |window| is minimized and will restore to a window which
-  // exists in its own workspace.
-  static bool WillRestoreToWorkspace(aura::Window* window);
-
   // Returns the current window state.
   WorkspaceWindowState GetWindowState() const;
 
@@ -109,14 +105,7 @@
   // the animation.
   enum SwitchReason {
     SWITCH_WINDOW_MADE_ACTIVE,
-    SWITCH_WINDOW_REMOVED,
-    SWITCH_VISIBILITY_CHANGED,
-    SWITCH_MINIMIZED,
     SWITCH_MAXIMIZED_OR_RESTORED,
-    // Switch a normal window in a fullscreen workspace to get fullscreen.
-    // TODO(mukai): this should be removed in the future. Normal windows should
-    // not be in a fullscreen workspace.  See crbug.com/249154
-    SWITCH_FULLSCREEN_FROM_FULLSCREEN_WORKSPACE,
     SWITCH_TRACKED_BY_WORKSPACE_CHANGED,
 
     // Switch as the result of DoInitialAnimation(). This isn't a real switch,
@@ -151,9 +140,9 @@
   Workspace* desktop_workspace() { return workspaces_[0]; }
   const Workspace* desktop_workspace() const { return workspaces_[0]; }
 
-  // Creates a new workspace. The Workspace is not added to anything and is
-  // owned by the caller.
-  Workspace* CreateWorkspace(bool fullscren);
+  // Creates a new workspace to test multiple workspaces. The Workspace is not
+  // added to anything and is owned by the caller.
+  Workspace* CreateWorkspaceForTest();
 
   // Moves all the non-maximized child windows of |workspace| to the desktop
   // stacked beneath |stack_beneath| (if non-NULL). After moving child windows
@@ -178,9 +167,6 @@
   // any layers.
   void ProcessDeletion();
 
-  // Sets |unminimizing_workspace_| to |workspace|.
-  void SetUnminimizingWorkspace(Workspace* workspace);
-
   // Fades the desktop. This is only used when maximizing or restoring a
   // window. The actual fade is handled by
   // DesktopBackgroundFadeController. |window| is used when restoring and
@@ -192,9 +178,7 @@
   void ShowWorkspace(Workspace* workspace,
                      Workspace* last_active,
                      SwitchReason reason) const;
-  void HideWorkspace(Workspace* workspace,
-                     SwitchReason reason,
-                     bool is_unminimizing_maximized_window) const;
+  void HideWorkspace(Workspace* workspace, SwitchReason reason) const;
 
   // These methods are forwarded from the LayoutManager installed on the
   // Workspace's window.
@@ -208,8 +192,7 @@
                                            aura::Window* child);
   void OnWorkspaceWindowShowStateChanged(Workspace* workspace,
                                          aura::Window* child,
-                                         ui::WindowShowState last_show_state,
-                                         ui::Layer* old_layer);
+                                         ui::WindowShowState last_show_state);
   void OnTrackedByWorkspaceChanged(Workspace* workspace,
                                    aura::Window* window);
 
@@ -246,12 +229,6 @@
   std::set<Workspace*> to_delete_;
   base::OneShotTimer<WorkspaceManager> delete_timer_;
 
-  // See comments in SetUnminimizingWorkspace() for details.
-  base::WeakPtrFactory<WorkspaceManager> clear_unminimizing_workspace_factory_;
-
-  // See comments in SetUnminimizingWorkspace() for details.
-  Workspace* unminimizing_workspace_;
-
   // Set to true if the app is terminating. If true we don't animate the
   // background, otherwise it can get stuck in the fading position when chrome
   // exits (as the last frame we draw before exiting is a frame from the
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index 9b1a6fa..5c1e13f 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -128,10 +128,6 @@
     return Shell::GetScreen()->GetDisplayNearestWindow(window).bounds();
   }
 
-  Workspace* active_workspace() {
-    return manager_->active_workspace_;
-  }
-
   ShelfWidget* shelf_widget() {
     return Shell::GetPrimaryRootWindowController()->shelf();
   }
@@ -148,53 +144,8 @@
     return manager_->FindBy(window);
   }
 
-  std::string WorkspaceStateString(Workspace* workspace) {
-    return (workspace->is_fullscreen() ? "F" : "") +
-        base::IntToString(static_cast<int>(
-                              workspace->window()->children().size()));
-  }
-
-  int active_index() {
-    return static_cast<int>(
-        manager_->FindWorkspace(manager_->active_workspace_) -
-        manager_->workspaces_.begin());
-  }
-
-  // Returns a string description of the current state. The string has the
-  // following format:
-  // W* P=W* active=N
-  // Each W corresponds to a workspace. Each workspace is prefixed with an 'F'
-  // if the workspace is fullscreen and is followed by the number of windows in
-  // the workspace.
-  // 'P=' is used for the pending workspaces (see
-  // WorkspaceManager::pending_workspaces_ for details on pending workspaces).
-  // N is the index of the active workspace (index into
-  // WorkspaceManager::workspaces_).
-  // For example, '2 F1 P=F1 active=1' means the first workspace (the desktop)
-  // has 2 windows, the second workspace is a maximized workspace with 1 window,
-  // there is a pending maximized workspace with 1 window and the second
-  // workspace is active.
-  std::string StateString() {
-    std::string result;
-    for (size_t i = 0; i < manager_->workspaces_.size(); ++i) {
-      if (i > 0)
-        result += " ";
-      result += WorkspaceStateString(manager_->workspaces_[i]);
-    }
-
-    if (!manager_->pending_workspaces_.empty()) {
-      result += " P=";
-      for (std::set<Workspace*>::const_iterator i =
-               manager_->pending_workspaces_.begin();
-           i != manager_->pending_workspaces_.end(); ++i) {
-        if (i != manager_->pending_workspaces_.begin())
-          result += " ";
-        result += WorkspaceStateString(*i);
-      }
-    }
-
-    result += " active=" + base::IntToString(active_index());
-    return result;
+  Workspace* CreateWorkspace() {
+    return manager_->CreateWorkspaceForTest();
   }
 
   // Overridden from AshTestBase:
@@ -235,8 +186,6 @@
 
   EXPECT_EQ("0,0 250x251", w1->bounds().ToString());
 
-  // Should be 1 workspace for the desktop, not maximized.
-  ASSERT_EQ("1 active=0", StateString());
   EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
 }
 
@@ -260,8 +209,6 @@
 
   EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
 
-  // Should be 1 workspace, maximized window doesn't create its own workspace.
-  ASSERT_EQ("1 active=0", StateString());
   EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
   EXPECT_EQ(ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get()).width(),
             w1->bounds().width());
@@ -275,50 +222,6 @@
   EXPECT_EQ("0,0 250x251", w1->bounds().ToString());
 }
 
-// Assertions around closing the last window in a workspace.
-TEST_F(WorkspaceManagerTest, CloseLastWindowInWorkspace) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w1->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w1->Show();
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  w2->Show();
-  wm::ActivateWindow(w1.get());
-
-  // Should be 1 workspace and 1 pending, !fullscreen and fullsceen. The second
-  // workspace is pending since the window wasn't active.
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
-
-  // Close w2.
-  w2.reset();
-
-  // Should have one workspace.
-  ASSERT_EQ("1 active=0", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
-  EXPECT_TRUE(w1->IsVisible());
-}
-
-// Assertions around adding a fullscreen window when empty.
-TEST_F(WorkspaceManagerTest, AddFullscreenWindowWhenEmpty) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-
-  ASSERT_TRUE(w1->layer() != NULL);
-  EXPECT_TRUE(w1->layer()->visible());
-  gfx::Rect work_area(
-      ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get()));
-  EXPECT_EQ(work_area.width(), w1->bounds().width());
-  EXPECT_EQ(work_area.height(), w1->bounds().height());
-
-  // Should be 2 workspaces (since we always keep the desktop).
-  ASSERT_EQ("0 F1 active=1", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
-}
-
 // Assertions around two windows and toggling one to be fullscreen.
 TEST_F(WorkspaceManagerTest, FullscreenWithNormalWindow) {
   scoped_ptr<Window> w1(CreateTestWindow());
@@ -334,10 +237,9 @@
   w2->Show();
   wm::ActivateWindow(w2.get());
 
-  // Should now be two workspaces.
-  ASSERT_EQ("1 F1 active=1", StateString());
+  // Both windows should be in the same workspace.
   EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
-  EXPECT_EQ(w2.get(), workspaces()[1]->window()->children()[0]);
+  EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]);
 
   gfx::Rect work_area(
       ScreenAsh::GetMaximizedWindowBoundsInParent(w1.get()));
@@ -346,120 +248,11 @@
 
   // Restore w2, which should then go back to one workspace.
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-  ASSERT_EQ("2 active=0", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
-  EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]);
   EXPECT_EQ(50, w2->bounds().width());
   EXPECT_EQ(51, w2->bounds().height());
   EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
 }
 
-// Assertions around two fullscreen windows.
-TEST_F(WorkspaceManagerTest, TwoFullscreen) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w1->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  ASSERT_EQ("1 F1 active=1", StateString());
-
-  w2->SetBounds(gfx::Rect(0, 0, 50, 51));
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-  ASSERT_EQ("1 F1 active=0", StateString());
-
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
-  ASSERT_EQ("0 F1 F1 active=2", StateString());
-
-  // The last stacked window (|w2|) should be last since it was fullscreen last.
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
-  EXPECT_EQ(w2.get(), workspaces()[2]->window()->children()[0]);
-}
-
-// Get the index of the layer inside its parent. This index can be used to
-// determine the z-order / draw-order of objects in the render tree.
-size_t IndexOfLayerInParent(ui::Layer* layer) {
-  ui::Layer* parent = layer->parent();
-  for (size_t i = 0; i < parent->children().size(); i++) {
-    if (layer == parent->children()[i])
-      return i;
-  }
-  // This should never be reached.
-  NOTREACHED();
-  return 0;
-}
-
-// Make sure that the layer z-order is correct for the time of the animation
-// when in a workspace with a normal and a fullscreen window the normal window
-// gets fullscreen. See crbug.com/232399.
-TEST_F(WorkspaceManagerTest, FullscreenSecondInWorkspace) {
-  // Create a fullscreen window.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  ASSERT_EQ(1U, w1->layer()->parent()->children().size());
-  w1->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  wm::ActivateWindow(w1.get());
-  // There are two workspaces: A normal and a fullscreen one.
-  ASSERT_EQ("0 F1 active=1", StateString());
-
-  // Create a second window and make it part of the fullscreen workspace.
-  scoped_ptr<Window> w2(CreateAppTestWindow(w1->parent()));
-  w2->SetBounds(gfx::Rect(0, 0, 50, 51));
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-  // There are still two workspaces and two windows in the (fullscreen)
-  // workspace.
-  ASSERT_EQ("0 F2 active=1", StateString());
-  ASSERT_EQ(w1->layer()->parent()->children()[0], w1->layer());
-  ASSERT_EQ(w1->layer()->parent()->children()[1], w2->layer());
-
-  // Now we need to enable all animations since the incorrect layer ordering we
-  // want to test against happens only while the animation is going on.
-  scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration(
-      new ui::ScopedAnimationDurationScaleMode(
-          ui::ScopedAnimationDurationScaleMode::FAST_DURATION));
-
-  ui::Layer* old_w2_layer = w2->layer();
-
-  // Maximize the second window and make sure that the workspace changes.
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-
-  // Check the correct window hierarchy - (|w2|) should be last since it got
-  // fullscreen last.
-  ASSERT_EQ("0 F1 F1 active=2", StateString());
-  EXPECT_EQ(3U, workspaces().size());
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
-  EXPECT_EQ(w2.get(), workspaces()[2]->window()->children()[0]);
-
-  // Check the workspace layer visibility.
-  EXPECT_EQ(1, workspaces()[1]->window()->layer()->opacity());
-  EXPECT_EQ(1, workspaces()[2]->window()->layer()->opacity());
-
-  // Check that |w2| got a new layer and that the old layer is still visible,
-  // while the new one is not. Further and foremost the old layer should be a
-  // member of the workspace's window and it should be the second last of the
-  // list to be properly stacked while the animation is going on.
-  EXPECT_NE(w2->layer(), old_w2_layer);
-  EXPECT_EQ(0, w2->layer()->opacity());
-  EXPECT_EQ(1, old_w2_layer->opacity());
-
-  // For the animation to look right we need the following ordering:
-  // workspace_1_layer_index < old_layer_index < workspace_2_layer_index.
-  ASSERT_EQ(workspaces()[1]->window()->parent()->layer(),
-            old_w2_layer->parent());
-  const size_t workspace_1_layer_index = IndexOfLayerInParent(
-      workspaces()[1]->window()->layer());
-  const size_t workspace_2_layer_index = IndexOfLayerInParent(
-      workspaces()[2]->window()->layer());
-  const size_t old_layer_index = IndexOfLayerInParent(old_w2_layer);
-  EXPECT_LT(workspace_1_layer_index, old_layer_index);
-  EXPECT_LT(old_layer_index, workspace_2_layer_index);
-}
-
 // Makes sure requests to change the bounds of a normal window go through.
 TEST_F(WorkspaceManagerTest, ChangeBoundsOfNormalWindow) {
   scoped_ptr<Window> w1(CreateTestWindow());
@@ -493,9 +286,7 @@
   w1->Show();
   wm::ActivateWindow(w1.get());
 
-  // Should be 2 workspaces, normal and fullscreen.
-  ASSERT_EQ("0 F1 active=1", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
+  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
   EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width());
   EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height());
 
@@ -504,87 +295,31 @@
   w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_DEFAULT);
   EXPECT_EQ("0,0 250x251", w1->bounds().ToString());
 
-  // Should be 1 workspace for the desktop.
-  ASSERT_EQ("1 active=0", StateString());
   EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
   EXPECT_EQ(250, w1->bounds().width());
   EXPECT_EQ(251, w1->bounds().height());
 
   // Back to fullscreen.
   w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  ASSERT_EQ("0 F1 active=1", StateString());
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
+  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
   EXPECT_EQ(GetFullscreenBounds(w1.get()).width(), w1->bounds().width());
   EXPECT_EQ(GetFullscreenBounds(w1.get()).height(), w1->bounds().height());
   ASSERT_TRUE(GetRestoreBoundsInScreen(w1.get()));
   EXPECT_EQ("0,0 250x251", GetRestoreBoundsInScreen(w1.get())->ToString());
 }
 
-// Makes sure switching workspaces doesn't show transient windows.
-TEST_F(WorkspaceManagerTest, DontShowTransientsOnSwitch) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  scoped_ptr<Window> w2(CreateTestWindow());
-
-  w1->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w2->SetBounds(gfx::Rect(0, 0, 250, 251));
-  w1->AddTransientChild(w2.get());
-
-  w1->Show();
-
-  scoped_ptr<Window> w3(CreateTestWindow());
-  w3->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  w3->Show();
-  wm::ActivateWindow(w3.get());
-
-  EXPECT_FALSE(w1->layer()->IsDrawn());
-  EXPECT_FALSE(w2->layer()->IsDrawn());
-  EXPECT_TRUE(w3->layer()->IsDrawn());
-
-  wm::ActivateWindow(w1.get());
-  EXPECT_TRUE(w1->layer()->IsDrawn());
-  EXPECT_FALSE(w2->layer()->IsDrawn());
-  EXPECT_FALSE(w3->layer()->IsDrawn());
-}
-
-// Persists-across-all-workspace flag should not cause a transient child
-// to be activated at desktop workspace.
-TEST_F(WorkspaceManagerTest, PersistsTransientChildStayInSameWorkspace) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w1.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-  ASSERT_EQ("0 F1 active=1", StateString());
-
-  scoped_ptr<Window> w2(CreateTestWindowUnparented());
-  w1->AddTransientChild(w2.get());
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  SetDefaultParentByPrimaryRootWindow(w2.get());
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-
-  ASSERT_EQ("0 F2 active=1", StateString());
-}
-
 // Assertions around minimizing a single window.
 TEST_F(WorkspaceManagerTest, MinimizeSingleWindow) {
   scoped_ptr<Window> w1(CreateTestWindow());
 
   w1->Show();
-  ASSERT_EQ("1 active=0", StateString());
 
   w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-  ASSERT_EQ("1 active=0", StateString());
   EXPECT_FALSE(w1->layer()->IsDrawn());
 
   // Show the window.
   w1->Show();
   EXPECT_TRUE(wm::IsWindowNormal(w1.get()));
-  ASSERT_EQ("1 active=0", StateString());
   EXPECT_TRUE(w1->layer()->IsDrawn());
 }
 
@@ -597,26 +332,21 @@
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
   w2->Show();
   wm::ActivateWindow(w2.get());
-  ASSERT_EQ("1 F1 active=1", StateString());
 
   // Minimize w2.
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-  ASSERT_EQ("1 P=F1 active=0", StateString());
   EXPECT_TRUE(w1->layer()->IsDrawn());
   EXPECT_FALSE(w2->layer()->IsDrawn());
 
   // Show the window, which should trigger unminimizing.
   w2->Show();
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-
   wm::ActivateWindow(w2.get());
-  ASSERT_EQ("1 F1 active=1", StateString());
 
   EXPECT_TRUE(wm::IsWindowFullscreen(w2.get()));
-  EXPECT_FALSE(w1->layer()->IsDrawn());
+  EXPECT_TRUE(w1->layer()->IsDrawn());
   EXPECT_TRUE(w2->layer()->IsDrawn());
 
-  // Minimize the window, which should hide the window and activate another.
+  // Minimize the window, which should hide the window.
   EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
   EXPECT_FALSE(wm::IsActiveWindow(w2.get()));
@@ -625,12 +355,49 @@
 
   // Make the window normal.
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-  ASSERT_EQ("2 active=0", StateString());
   EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
   EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[1]);
   EXPECT_TRUE(w2->layer()->IsDrawn());
 }
 
+// Verifies the basic behavior of multiple workspaces.
+TEST_F(WorkspaceManagerTest, MultiWorkspaces) {
+  scoped_ptr<Window> w1(CreateTestWindow());
+  w1->SetBounds(gfx::Rect(10, 11, 250, 251));
+  w1->Show();
+  wm::ActivateWindow(w1.get());
+  EXPECT_TRUE(w1->layer()->IsDrawn());
+  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
+
+  // Creates a secondary workspace and a window in it.
+  Workspace* secondary_workspace = CreateWorkspace();
+  scoped_ptr<Window> w2(CreateTestWindowUnparented());
+  w2->SetBounds(gfx::Rect(8, 9, 150, 151));
+  secondary_workspace->window()->AddChild(w2.get());
+  w2->Show();
+  wm::ActivateWindow(w2.get());
+  EXPECT_FALSE(w1->layer()->IsDrawn());
+  EXPECT_TRUE(w2->layer()->IsDrawn());
+  // As the result of activation, |secondary_workspace| has been added to
+  // the list of workspaces managed by |workspace_manager|.
+  ASSERT_EQ(2u, workspaces().size());
+  EXPECT_EQ(secondary_workspace, workspaces()[1]);
+  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[0]);
+  EXPECT_EQ(w2.get(), workspaces()[1]->window()->children()[0]);
+
+  // Activates w1 again, w2 should be hidden.
+  wm::ActivateWindow(w1.get());
+  EXPECT_TRUE(w1->layer()->IsDrawn());
+  EXPECT_FALSE(w2->layer()->IsDrawn());
+
+  // Activates and then removes the w2. |secondary_workspace| remains and
+  // active.
+  wm::ActivateWindow(w2.get());
+  w2.reset();
+  EXPECT_FALSE(w1->layer()->IsDrawn());
+  EXPECT_EQ(2u, workspaces().size());
+}
+
 // Verifies ShelfLayoutManager's visibility/auto-hide state is correctly
 // updated.
 TEST_F(WorkspaceManagerTest, ShelfStateUpdated) {
@@ -725,14 +492,12 @@
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
   w2->Show();
   wm::ActivateWindow(w2.get());
-  EXPECT_EQ(0, active_index());
   EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
   EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
   EXPECT_EQ("0,1 101x102", w1->bounds().ToString());
 
   // Switch to w1.
   wm::ActivateWindow(w1.get());
-  EXPECT_EQ(0, active_index());
   EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
   EXPECT_EQ("0,1 101x102", w1->bounds().ToString());
   EXPECT_EQ(ScreenAsh::GetMaximizedWindowBoundsInParent(
@@ -741,7 +506,6 @@
 
   // Switch to w2.
   wm::ActivateWindow(w2.get());
-  EXPECT_EQ(0, active_index());
   EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
   EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
   EXPECT_EQ("0,1 101x102", w1->bounds().ToString());
@@ -768,97 +532,6 @@
   EXPECT_TRUE(GetWindowOverlapsShelf());
 }
 
-// Verifies persist across all workspaces.
-TEST_F(WorkspaceManagerTest, PersistAcrossAllWorkspaces) {
-  // Create a fullscreen window.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->Show();
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  wm::ActivateWindow(w1.get());
-  ASSERT_EQ("0 F1 active=1", StateString());
-
-  // Create a window that persists across all workspaces. It should be placed in
-  // the current fullscreen workspace.
-  scoped_ptr<Window> w2(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  ASSERT_EQ("1 F1 active=1", StateString());
-
-  // Activate w2, which should move it to the 2nd workspace.
-  wm::ActivateWindow(w2.get());
-  ASSERT_EQ("0 F2 active=1", StateString());
-
-  // Restoring w2 should drop the persists window back to the desktop, and drop
-  // it to the bottom of the stack.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-  ASSERT_EQ("2 active=0", StateString());
-  EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[0]);
-  EXPECT_EQ(w1.get(), workspaces()[0]->window()->children()[1]);
-
-  // Repeat, but this time minimize. The minimized window should end up in
-  // pending.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  w2.reset(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  wm::ActivateWindow(w2.get());
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  EXPECT_EQ(w2.get(), workspaces()[0]->window()->children()[0]);
-}
-
-// Verifies that when a window persists across all workpaces is activated that
-// it moves to the current workspace.
-TEST_F(WorkspaceManagerTest, ActivatePersistAcrossAllWorkspacesWhenNotActive) {
-  // Create a window that persists across all workspaces.
-  scoped_ptr<Window> w2(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  ASSERT_EQ("1 active=0", StateString());
-
-  // Create a maximized window.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->Show();
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  wm::ActivateWindow(w1.get());
-  ASSERT_EQ("1 F1 active=1", StateString());
-
-  // Activate the persists across all workspace window. It should move to the
-  // current workspace.
-  wm::ActivateWindow(w2.get());
-  ASSERT_EQ("0 F2 active=1", StateString());
-  // The window that persists across all workspaces should be moved to the top
-  // of the stacking order.
-  EXPECT_EQ(w1.get(), workspaces()[1]->window()->children()[0]);
-  EXPECT_EQ(w2.get(), workspaces()[1]->window()->children()[1]);
-  EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
-}
-
-// Verifies Show()ing a minimized window that persists across all workspaces
-// unminimizes the window.
-TEST_F(WorkspaceManagerTest, ShowMinimizedPersistWindow) {
-  // Create a window that persists across all workspaces.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w1.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-  EXPECT_FALSE(w1->IsVisible());
-  w1->Show();
-  EXPECT_TRUE(w1->IsVisible());
-}
-
 // Test that a persistent window across all workspaces which got fullscreen
 // first, then got minimized and finally got restored does not crash the
 // system (see http://crbug.com/151698) and restores its fullscreen workspace
@@ -887,108 +560,6 @@
   EXPECT_TRUE(w2->IsVisible());
 }
 
-// Test that we report we're in the fullscreen state even if the fullscreen
-// window isn't being managed by us (http://crbug.com/123931).
-TEST_F(WorkspaceManagerTest, GetWindowStateWithUnmanagedFullscreenWindow) {
-  ShelfLayoutManager* shelf = shelf_layout_manager();
-
-  // We need to create a regular window first so there's an active workspace.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->Show();
-
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-
-  ASSERT_EQ("1 F1 active=1", StateString());
-
-  EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN, manager_->GetWindowState());
-
-  w2->Hide();
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
-
-  w2->Show();
-  ASSERT_EQ("1 P=F1 active=0", StateString());
-  EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_DEFAULT, manager_->GetWindowState());
-
-  wm::ActivateWindow(w2.get());
-  ASSERT_EQ("1 F1 active=1", StateString());
-  EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN, manager_->GetWindowState());
-
-  w2.reset();
-  ASSERT_EQ("1 active=0", StateString());
-  EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_DEFAULT, manager_->GetWindowState());
-}
-
-// Variant of GetWindowStateWithUnmanagedFullscreenWindow that uses a maximized
-// window rather than a normal window. It should be same as the normal window.
-TEST_F(WorkspaceManagerTest,
-       GetWindowStateWithUnmanagedFullscreenWindowWithMaximized) {
-  ShelfLayoutManager* shelf = shelf_layout_manager();
-  shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
-
-  // Make the first window maximized.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
-  w1->Show();
-
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-
-  // Even though auto-hide behavior is NEVER full-screen windows cause the shelf
-  // to hide.
-  EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN,
-            manager_->GetWindowState());
-
-  w2->Hide();
-  EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
-
-  w2->Show();
-  wm::ActivateWindow(w2.get());
-  EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
-  EXPECT_EQ(WORKSPACE_WINDOW_STATE_FULL_SCREEN,
-            manager_->GetWindowState());
-
-  w2.reset();
-  EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
-}
-
-// Verifies a window marked as persisting across all workspaces ends up in its
-// own workspace when got fullscreen.
-TEST_F(WorkspaceManagerTest, FullscreenDontPersistEndsUpInOwnWorkspace) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-
-  SetPersistsAcrossAllWorkspaces(
-      w1.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w1->Show();
-
-  ASSERT_EQ("1 active=0", StateString());
-
-  // Maximize should trigger containing the window.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  ASSERT_EQ("0 P=F1 active=0", StateString());
-
-  // And resetting to normal should remove it.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-  ASSERT_EQ("1 active=0", StateString());
-}
-
 // Verifies going from maximized to minimized sets the right state for painting
 // the background of the launcher.
 TEST_F(WorkspaceManagerTest, MinimizeResetsVisibility) {
@@ -1004,39 +575,6 @@
   EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, shelf_widget()->GetBackgroundType());
 }
 
-// Verifies transients are moved when fullscreen.
-TEST_F(WorkspaceManagerTest, MoveTransientOnFullscreen) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->Show();
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w1->AddTransientChild(w2.get());
-  w2->Show();
-  wm::ActivateWindow(w1.get());
-  ASSERT_EQ("2 active=0", StateString());
-
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  ASSERT_EQ("0 F2 active=1", StateString());
-  EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
-
-  // Create another transient child of |w1|. We do this unparented, set up the
-  // transient parent then set parent. This is how NativeWidgetAura does things
-  // too.
-  scoped_ptr<Window> w3(CreateTestWindowUnparented());
-  w1->AddTransientChild(w3.get());
-  SetDefaultParentByPrimaryRootWindow(w3.get());
-  w3->Show();
-  ASSERT_EQ("0 F3 active=1", StateString());
-
-  // Minimize the window. All the transients are hidden as a result, so it ends
-  // up in pending.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-  ASSERT_EQ("0 P=F3 active=0", StateString());
-
-  // Restore and everything should go back to the first workspace.
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-  ASSERT_EQ("3 active=0", StateString());
-}
-
 // Verifies window visibility during various workspace changes.
 TEST_F(WorkspaceManagerTest, VisibilityTests) {
   scoped_ptr<Window> w1(CreateTestWindow());
@@ -1051,19 +589,19 @@
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
   EXPECT_TRUE(w2->IsVisible());
   EXPECT_EQ(1.0f, w2->layer()->GetCombinedOpacity());
-  EXPECT_FALSE(w1->IsVisible());
+  EXPECT_TRUE(w1->IsVisible());
 
-  // Switch to w1. |w1| should be visible and |w2| hidden.
+  // Switch to w1. |w1| should be visible on top of |w2|.
   wm::ActivateWindow(w1.get());
   EXPECT_TRUE(w1->IsVisible());
   EXPECT_EQ(1.0f, w1->layer()->GetCombinedOpacity());
-  EXPECT_FALSE(w2->IsVisible());
+  EXPECT_TRUE(w2->IsVisible());
 
   // Switch back to |w2|.
   wm::ActivateWindow(w2.get());
   EXPECT_TRUE(w2->IsVisible());
   EXPECT_EQ(1.0f, w2->layer()->GetCombinedOpacity());
-  EXPECT_FALSE(w1->IsVisible());
+  EXPECT_TRUE(w1->IsVisible());
 
   // Restore |w2|, both windows should be visible.
   w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
@@ -1156,26 +694,6 @@
   EXPECT_NE(w1_bounds.ToString(), w1->bounds().ToString());
 }
 
-// Verifies Focus() works in a window that isn't in the active workspace.
-TEST_F(WorkspaceManagerTest, FocusOnFullscreenInSeparateWorkspace) {
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->SetBounds(gfx::Rect(10, 11, 250, 251));
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-
-  scoped_ptr<Window> w2(CreateTestWindow());
-  w2->SetBounds(gfx::Rect(10, 11, 250, 251));
-  w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  w2->Show();
-  EXPECT_FALSE(w2->IsVisible());
-  EXPECT_FALSE(wm::IsActiveWindow(w2.get()));
-
-  w2->Focus();
-  EXPECT_TRUE(w2->IsVisible());
-  EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
-  EXPECT_FALSE(w1->IsVisible());
-}
-
 namespace {
 
 // WindowDelegate used by DontCrashOnChangeAndActivate.
@@ -1287,40 +805,13 @@
   w2->SetBounds(bounds);
   EXPECT_EQ(bounds.ToString(), w2->bounds().ToString());
 
-  // Transition it to tracked by worskpace. It should end up in its own
+  // Transition it to tracked by worskpace. It should end up in the desktop
   // workspace.
   SetTrackedByWorkspace(w2.get(), true);
   EXPECT_TRUE(wm::IsActiveWindow(w2.get()));
-  EXPECT_FALSE(w1->IsVisible());
-  EXPECT_TRUE(w2->IsVisible());
-  EXPECT_NE(w1->parent(), w2->parent());
-}
-
-// Verifies a window marked as persisting across all workspaces ends up in its
-// own workspace when get fullscreen.
-TEST_F(WorkspaceManagerTest, DeactivateDropsToDesktop) {
-  // Create a fullscreen window.
-  scoped_ptr<Window> w1(CreateTestWindow());
-  w1->Show();
-  wm::ActivateWindow(w1.get());
-  w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
-  EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
   EXPECT_TRUE(w1->IsVisible());
-
-  // Create another window that persists across all workspaces. It should end
-  // up with the same parent as |w1|.
-  scoped_ptr<Window> w2(CreateTestWindow());
-  SetPersistsAcrossAllWorkspaces(
-      w2.get(),
-      WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
-  w2->Show();
-  wm::ActivateWindow(w2.get());
+  EXPECT_TRUE(w2->IsVisible());
   EXPECT_EQ(w1->parent(), w2->parent());
-  ASSERT_EQ("0 F2 active=1", StateString());
-
-  // Activate |w1|, should result in dropping |w2| to the desktop.
-  wm::ActivateWindow(w1.get());
-  ASSERT_EQ("1 F1 active=1", StateString());
 }
 
 // Test the basic auto placement of one and or two windows in a "simulated
@@ -1759,16 +1250,11 @@
   w1->parent()->parent()->AddObserver(&observer);
   const gfx::Rect max_bounds(w1->bounds());
 
-  // There should be two workspace, one for the desktop and one for the
-  // maximized window with the maximized active.
-  EXPECT_EQ("0 F1 active=1", StateString());
-
   generator.PressLeftButton();
   generator.MoveMouseTo(100, 100);
   // The bounds shouldn't change (drag should result in nothing happening
   // now.
   EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString());
-  EXPECT_EQ("0 F1 active=1", StateString());
 
   generator.ReleaseLeftButton();
   EXPECT_EQ(0, observer.change_count());
@@ -1781,12 +1267,10 @@
   EXPECT_EQ(gfx::Rect(max_bounds.x() + 100, max_bounds.y() + 100,
                       max_bounds.width(), max_bounds.height()).ToString(),
             w1->bounds().ToString());
-  EXPECT_EQ("0 F1 active=1", StateString());
 
   generator.ReleaseLeftButton();
   SetTrackedByWorkspace(w1.get(), true);
   // Marking the window tracked again should snap back to origin.
-  EXPECT_EQ("0 F1 active=1", StateString());
   EXPECT_EQ(max_bounds.ToString(), w1->bounds().ToString());
   EXPECT_EQ(0, observer.change_count());
 
diff --git a/base/allocator/allocator_extension_thunks.target.darwin-arm.mk b/base/allocator/allocator_extension_thunks.target.darwin-arm.mk
index 1b6c147..185bd1f 100644
--- a/base/allocator/allocator_extension_thunks.target.darwin-arm.mk
+++ b/base/allocator/allocator_extension_thunks.target.darwin-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/allocator/allocator_extension_thunks.target.darwin-mips.mk b/base/allocator/allocator_extension_thunks.target.darwin-mips.mk
index ec26bbd..6d6b9e3 100644
--- a/base/allocator/allocator_extension_thunks.target.darwin-mips.mk
+++ b/base/allocator/allocator_extension_thunks.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/allocator/allocator_extension_thunks.target.darwin-x86.mk b/base/allocator/allocator_extension_thunks.target.darwin-x86.mk
index 1a20b79..e72b384 100644
--- a/base/allocator/allocator_extension_thunks.target.darwin-x86.mk
+++ b/base/allocator/allocator_extension_thunks.target.darwin-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/allocator/allocator_extension_thunks.target.linux-arm.mk b/base/allocator/allocator_extension_thunks.target.linux-arm.mk
index 1b6c147..185bd1f 100644
--- a/base/allocator/allocator_extension_thunks.target.linux-arm.mk
+++ b/base/allocator/allocator_extension_thunks.target.linux-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/allocator/allocator_extension_thunks.target.linux-mips.mk b/base/allocator/allocator_extension_thunks.target.linux-mips.mk
index ec26bbd..6d6b9e3 100644
--- a/base/allocator/allocator_extension_thunks.target.linux-mips.mk
+++ b/base/allocator/allocator_extension_thunks.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/allocator/allocator_extension_thunks.target.linux-x86.mk b/base/allocator/allocator_extension_thunks.target.linux-x86.mk
index 1a20b79..e72b384 100644
--- a/base/allocator/allocator_extension_thunks.target.linux-x86.mk
+++ b/base/allocator/allocator_extension_thunks.target.linux-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/base.gyp b/base/base.gyp
index 58543eb..56a036a 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -619,7 +619,6 @@
         'tools_sanity_unittest.cc',
         'tracked_objects_unittest.cc',
         'tuple_unittest.cc',
-        'upload_list_unittest.cc',
         'values_unittest.cc',
         'version_unittest.cc',
         'vlog_unittest.cc',
diff --git a/base/base.gypi b/base/base.gypi
index 7381bea..02abd4b 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -586,8 +586,6 @@
           'tracking_info.cc',
           'tracking_info.h',
           'tuple.h',
-          'upload_list.cc',
-          'upload_list.h',
           'values.cc',
           'values.h',
           'value_conversions.cc',
diff --git a/base/base.target.darwin-arm.mk b/base/base.target.darwin-arm.mk
index 5cba75a..b3d14ad 100644
--- a/base/base.target.darwin-arm.mk
+++ b/base/base.target.darwin-arm.mk
@@ -219,7 +219,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -269,10 +268,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -351,10 +350,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base.target.darwin-mips.mk b/base/base.target.darwin-mips.mk
index ad8477e..1d53363 100644
--- a/base/base.target.darwin-mips.mk
+++ b/base/base.target.darwin-mips.mk
@@ -219,7 +219,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -268,10 +267,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -349,10 +348,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base.target.darwin-x86.mk b/base/base.target.darwin-x86.mk
index d274224..1f8c32d 100644
--- a/base/base.target.darwin-x86.mk
+++ b/base/base.target.darwin-x86.mk
@@ -220,7 +220,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -272,10 +271,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -357,10 +356,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base.target.linux-arm.mk b/base/base.target.linux-arm.mk
index 5cba75a..b3d14ad 100644
--- a/base/base.target.linux-arm.mk
+++ b/base/base.target.linux-arm.mk
@@ -219,7 +219,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -269,10 +268,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -351,10 +350,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base.target.linux-mips.mk b/base/base.target.linux-mips.mk
index ad8477e..1d53363 100644
--- a/base/base.target.linux-mips.mk
+++ b/base/base.target.linux-mips.mk
@@ -219,7 +219,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -268,10 +267,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -349,10 +348,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base.target.linux-x86.mk b/base/base.target.linux-x86.mk
index d274224..1f8c32d 100644
--- a/base/base.target.linux-x86.mk
+++ b/base/base.target.linux-x86.mk
@@ -220,7 +220,6 @@
 	base/timer/timer.cc \
 	base/tracked_objects.cc \
 	base/tracking_info.cc \
-	base/upload_list.cc \
 	base/values.cc \
 	base/value_conversions.cc \
 	base/version.cc \
@@ -272,10 +271,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
@@ -357,10 +356,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DBASE_IMPLEMENTATION' \
diff --git a/base/base_i18n.target.darwin-arm.mk b/base/base_i18n.target.darwin-arm.mk
index 6fb6c56..bd575ac 100644
--- a/base/base_i18n.target.darwin-arm.mk
+++ b/base/base_i18n.target.darwin-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_i18n.target.darwin-mips.mk b/base/base_i18n.target.darwin-mips.mk
index 1ee1296..74eaadf 100644
--- a/base/base_i18n.target.darwin-mips.mk
+++ b/base/base_i18n.target.darwin-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_i18n.target.darwin-x86.mk b/base/base_i18n.target.darwin-x86.mk
index 31a7abc..39c3589 100644
--- a/base/base_i18n.target.darwin-x86.mk
+++ b/base/base_i18n.target.darwin-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_i18n.target.linux-arm.mk b/base/base_i18n.target.linux-arm.mk
index 6fb6c56..bd575ac 100644
--- a/base/base_i18n.target.linux-arm.mk
+++ b/base/base_i18n.target.linux-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_i18n.target.linux-mips.mk b/base/base_i18n.target.linux-mips.mk
index 1ee1296..74eaadf 100644
--- a/base/base_i18n.target.linux-mips.mk
+++ b/base/base_i18n.target.linux-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_i18n.target.linux-x86.mk b/base/base_i18n.target.linux-x86.mk
index 31a7abc..39c3589 100644
--- a/base/base_i18n.target.linux-x86.mk
+++ b/base/base_i18n.target.linux-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_I18N_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/base/base_java_activity_state.target.darwin-arm.mk b/base/base_java_activity_state.target.darwin-arm.mk
index bbe12bc..ccbd4f6 100644
--- a/base/base_java_activity_state.target.darwin-arm.mk
+++ b/base/base_java_activity_state.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_activity_state.target.darwin-mips.mk b/base/base_java_activity_state.target.darwin-mips.mk
index 20a6039..1efa920 100644
--- a/base/base_java_activity_state.target.darwin-mips.mk
+++ b/base/base_java_activity_state.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_activity_state.target.darwin-x86.mk b/base/base_java_activity_state.target.darwin-x86.mk
index 0b555bb..d106b33 100644
--- a/base/base_java_activity_state.target.darwin-x86.mk
+++ b/base/base_java_activity_state.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_activity_state.target.linux-arm.mk b/base/base_java_activity_state.target.linux-arm.mk
index bbe12bc..ccbd4f6 100644
--- a/base/base_java_activity_state.target.linux-arm.mk
+++ b/base/base_java_activity_state.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_activity_state.target.linux-mips.mk b/base/base_java_activity_state.target.linux-mips.mk
index 20a6039..1efa920 100644
--- a/base/base_java_activity_state.target.linux-mips.mk
+++ b/base/base_java_activity_state.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_activity_state.target.linux-x86.mk b/base/base_java_activity_state.target.linux-x86.mk
index 0b555bb..d106b33 100644
--- a/base/base_java_activity_state.target.linux-x86.mk
+++ b/base/base_java_activity_state.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.darwin-arm.mk b/base/base_java_memory_pressure_level_list.target.darwin-arm.mk
index 94e81a3..65886d5 100644
--- a/base/base_java_memory_pressure_level_list.target.darwin-arm.mk
+++ b/base/base_java_memory_pressure_level_list.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.darwin-mips.mk b/base/base_java_memory_pressure_level_list.target.darwin-mips.mk
index 708706c..505bea6 100644
--- a/base/base_java_memory_pressure_level_list.target.darwin-mips.mk
+++ b/base/base_java_memory_pressure_level_list.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.darwin-x86.mk b/base/base_java_memory_pressure_level_list.target.darwin-x86.mk
index 7c22387..59bfa99 100644
--- a/base/base_java_memory_pressure_level_list.target.darwin-x86.mk
+++ b/base/base_java_memory_pressure_level_list.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.linux-arm.mk b/base/base_java_memory_pressure_level_list.target.linux-arm.mk
index 94e81a3..65886d5 100644
--- a/base/base_java_memory_pressure_level_list.target.linux-arm.mk
+++ b/base/base_java_memory_pressure_level_list.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.linux-mips.mk b/base/base_java_memory_pressure_level_list.target.linux-mips.mk
index 708706c..505bea6 100644
--- a/base/base_java_memory_pressure_level_list.target.linux-mips.mk
+++ b/base/base_java_memory_pressure_level_list.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_java_memory_pressure_level_list.target.linux-x86.mk b/base/base_java_memory_pressure_level_list.target.linux-x86.mk
index 7c22387..59bfa99 100644
--- a/base/base_java_memory_pressure_level_list.target.linux-x86.mk
+++ b/base/base_java_memory_pressure_level_list.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.darwin-arm.mk b/base/base_jni_headers.target.darwin-arm.mk
index 15b3dd6..84ff247 100644
--- a/base/base_jni_headers.target.darwin-arm.mk
+++ b/base/base_jni_headers.target.darwin-arm.mk
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -284,10 +284,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.darwin-mips.mk b/base/base_jni_headers.target.darwin-mips.mk
index 36abbd0..47fe61d 100644
--- a/base/base_jni_headers.target.darwin-mips.mk
+++ b/base/base_jni_headers.target.darwin-mips.mk
@@ -205,10 +205,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.darwin-x86.mk b/base/base_jni_headers.target.darwin-x86.mk
index 315b440..521691e 100644
--- a/base/base_jni_headers.target.darwin-x86.mk
+++ b/base/base_jni_headers.target.darwin-x86.mk
@@ -208,10 +208,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -289,10 +289,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.linux-arm.mk b/base/base_jni_headers.target.linux-arm.mk
index 15b3dd6..84ff247 100644
--- a/base/base_jni_headers.target.linux-arm.mk
+++ b/base/base_jni_headers.target.linux-arm.mk
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -284,10 +284,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.linux-mips.mk b/base/base_jni_headers.target.linux-mips.mk
index 36abbd0..47fe61d 100644
--- a/base/base_jni_headers.target.linux-mips.mk
+++ b/base/base_jni_headers.target.linux-mips.mk
@@ -205,10 +205,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_jni_headers.target.linux-x86.mk b/base/base_jni_headers.target.linux-x86.mk
index 315b440..521691e 100644
--- a/base/base_jni_headers.target.linux-x86.mk
+++ b/base/base_jni_headers.target.linux-x86.mk
@@ -208,10 +208,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -289,10 +289,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_prefs.target.darwin-arm.mk b/base/base_prefs.target.darwin-arm.mk
index 9cd1ba3..6f43222 100644
--- a/base/base_prefs.target.darwin-arm.mk
+++ b/base/base_prefs.target.darwin-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_prefs.target.darwin-mips.mk b/base/base_prefs.target.darwin-mips.mk
index 542bf21..1750b51 100644
--- a/base/base_prefs.target.darwin-mips.mk
+++ b/base/base_prefs.target.darwin-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_prefs.target.darwin-x86.mk b/base/base_prefs.target.darwin-x86.mk
index 1992fb0..2393b3a 100644
--- a/base/base_prefs.target.darwin-x86.mk
+++ b/base/base_prefs.target.darwin-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_prefs.target.linux-arm.mk b/base/base_prefs.target.linux-arm.mk
index 9cd1ba3..6f43222 100644
--- a/base/base_prefs.target.linux-arm.mk
+++ b/base/base_prefs.target.linux-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_prefs.target.linux-mips.mk b/base/base_prefs.target.linux-mips.mk
index 542bf21..1750b51 100644
--- a/base/base_prefs.target.linux-mips.mk
+++ b/base/base_prefs.target.linux-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_prefs.target.linux-x86.mk b/base/base_prefs.target.linux-x86.mk
index 1992fb0..2393b3a 100644
--- a/base/base_prefs.target.linux-x86.mk
+++ b/base/base_prefs.target.linux-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DBASE_PREFS_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/base/base_static.target.darwin-arm.mk b/base/base_static.target.darwin-arm.mk
index fcf8fee..b1ea511 100644
--- a/base/base_static.target.darwin-arm.mk
+++ b/base/base_static.target.darwin-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -148,10 +148,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_static.target.darwin-mips.mk b/base/base_static.target.darwin-mips.mk
index 093832a..085c5ba 100644
--- a/base/base_static.target.darwin-mips.mk
+++ b/base/base_static.target.darwin-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_static.target.darwin-x86.mk b/base/base_static.target.darwin-x86.mk
index 9e1034f..1955624 100644
--- a/base/base_static.target.darwin-x86.mk
+++ b/base/base_static.target.darwin-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_static.target.linux-arm.mk b/base/base_static.target.linux-arm.mk
index fcf8fee..b1ea511 100644
--- a/base/base_static.target.linux-arm.mk
+++ b/base/base_static.target.linux-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -148,10 +148,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_static.target.linux-mips.mk b/base/base_static.target.linux-mips.mk
index 093832a..085c5ba 100644
--- a/base/base_static.target.linux-mips.mk
+++ b/base/base_static.target.linux-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/base_static.target.linux-x86.mk b/base/base_static.target.linux-x86.mk
index 9e1034f..1955624 100644
--- a/base/base_static.target.linux-x86.mk
+++ b/base/base_static.target.linux-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-arm.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-arm.mk
index 3b6dadf..5d843ec 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-arm.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-mips.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-mips.mk
index df0d401..bb3f0f1 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-mips.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-x86.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-x86.mk
index 3b983e0..66314cb 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-x86.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-arm.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-arm.mk
index 3b6dadf..5d843ec 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-arm.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-mips.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-mips.mk
index df0d401..bb3f0f1 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-mips.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-x86.mk b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-x86.mk
index 3b983e0..66314cb 100644
--- a/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-x86.mk
+++ b/base/third_party/dynamic_annotations/dynamic_annotations.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/base/upload_list.cc b/base/upload_list.cc
deleted file mode 100644
index 50aa817..0000000
--- a/base/upload_list.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/upload_list.h"
-
-#include <algorithm>
-#include <iterator>
-
-#include "base/bind.h"
-#include "base/file_util.h"
-#include "base/location.h"
-#include "base/single_thread_task_runner.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-#include "base/threading/sequenced_worker_pool.h"
-
-namespace base {
-
-UploadList::UploadInfo::UploadInfo(const std::string& c, const Time& t)
-    : id(c), time(t) {}
-
-UploadList::UploadInfo::~UploadInfo() {}
-
-UploadList::UploadList(Delegate* delegate,
-                       const FilePath& upload_log_path,
-                       SingleThreadTaskRunner* task_runner)
-    : delegate_(delegate),
-      upload_log_path_(upload_log_path),
-      task_runner_(task_runner) {}
-
-UploadList::~UploadList() {}
-
-void UploadList::LoadUploadListAsynchronously(
-    base::SequencedWorkerPool* worker_pool) {
-  DCHECK(task_runner_->BelongsToCurrentThread());
-  worker_pool->PostWorkerTask(
-      FROM_HERE,
-      Bind(&UploadList::LoadUploadListAndInformDelegateOfCompletion, this));
-}
-
-void UploadList::ClearDelegate() {
-  DCHECK(task_runner_->BelongsToCurrentThread());
-  delegate_ = NULL;
-}
-
-void UploadList::LoadUploadListAndInformDelegateOfCompletion() {
-  LoadUploadList();
-  task_runner_->PostTask(
-      FROM_HERE, Bind(&UploadList::InformDelegateOfCompletion, this));
-}
-
-void UploadList::LoadUploadList() {
-  if (PathExists(upload_log_path_)) {
-    std::string contents;
-    file_util::ReadFileToString(upload_log_path_, &contents);
-    std::vector<std::string> log_entries;
-    SplitStringAlongWhitespace(contents, &log_entries);
-    ParseLogEntries(log_entries);
-  }
-}
-
-void UploadList::AppendUploadInfo(const UploadInfo& info) {
-  uploads_.push_back(info);
-}
-
-void UploadList::ParseLogEntries(
-    const std::vector<std::string>& log_entries) {
-  std::vector<std::string>::const_reverse_iterator i;
-  for (i = log_entries.rbegin(); i != log_entries.rend(); ++i) {
-    std::vector<std::string> components;
-    SplitString(*i, ',', &components);
-    // Skip any blank (or corrupted) lines.
-    if (components.size() != 2)
-      continue;
-    double seconds_since_epoch;
-    if (!StringToDouble(components[0], &seconds_since_epoch))
-      continue;
-    UploadInfo info(components[1], Time::FromDoubleT(seconds_since_epoch));
-    uploads_.push_back(info);
-  }
-}
-
-void UploadList::InformDelegateOfCompletion() {
-  DCHECK(task_runner_->BelongsToCurrentThread());
-  if (delegate_)
-    delegate_->OnUploadListAvailable();
-}
-
-void UploadList::GetUploads(unsigned int max_count,
-                            std::vector<UploadInfo>* uploads) {
-  DCHECK(task_runner_->BelongsToCurrentThread());
-  std::copy(uploads_.begin(),
-            uploads_.begin() + std::min<size_t>(uploads_.size(), max_count),
-            std::back_inserter(*uploads));
-}
-
-}  // namespace base
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index fbe4849..7e93557 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -17,6 +17,7 @@
 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
 from pylib import android_commands
 from pylib import constants
+from pylib import perf_tests_helper
 from pylib.cmd_helper import GetCmdOutput
 
 
@@ -31,21 +32,16 @@
     boolean indicating whether or not device can be used for testing.
   """
 
-  def AdbShellCmd(cmd):
-    return GetCmdOutput('adb -s %s shell %s' % (serial, cmd),
-                        shell=True).strip()
-
   device_adb = android_commands.AndroidCommands(serial)
 
   # TODO(navabi): Replace AdbShellCmd with device_adb.
-  device_type = AdbShellCmd('getprop ro.build.product')
-  device_build = AdbShellCmd('getprop ro.build.id')
-  device_build_type = AdbShellCmd('getprop ro.build.type')
-  device_product_name = AdbShellCmd('getprop ro.product.name')
+  device_type = device_adb.GetBuildProduct()
+  device_build = device_adb.GetBuildId()
+  device_build_type = device_adb.GetBuildType()
+  device_product_name = device_adb.GetProductName()
 
-  setup_wizard_disabled = AdbShellCmd(
-      'getprop ro.setupwizard.mode') == 'DISABLED'
-  battery = AdbShellCmd('dumpsys battery')
+  setup_wizard_disabled = device_adb.GetSetupWizardStatus() == 'DISABLED'
+  battery = device_adb.GetBatteryInfo()
   install_output = GetCmdOutput(
     ['%s/build/android/adb_install_apk.py' % constants.DIR_SOURCE_ROOT, '--apk',
      '%s/build/android/CheckInstallApk-debug.apk' % constants.DIR_SOURCE_ROOT])
@@ -62,15 +58,15 @@
     ac_power = re.findall('AC powered: (\w+)', battery)[0]
     battery_level = int(re.findall('level: (\d+)', battery)[0])
     battery_temp = float(re.findall('temperature: (\d+)', battery)[0]) / 10
+  sub_info = device_adb.GetSubscriberInfo()
+  imei_slice = re.findall('Device ID = (\d+)', sub_info)[0][-6:]
   report = ['Device %s (%s)' % (serial, device_type),
-            '  Build: %s (%s)' % (device_build,
-                                  AdbShellCmd('getprop ro.build.fingerprint')),
+            '  Build: %s (%s)' %
+              (device_build, device_adb.GetBuildFingerprint()),
             '  Battery: %s%%' % battery_level,
             '  Battery temp: %s' % battery_temp,
-            '  IMEI slice: %s' % AdbShellCmd('dumpsys iphonesubinfo '
-                                             '| grep Device'
-                                             "| awk '{print $4}'")[-6:],
-            '  Wifi IP: %s' % AdbShellCmd('getprop dhcp.wlan0.ipaddress'),
+            '  IMEI slice: %s' % imei_slice,
+            '  Wifi IP: %s' % device_adb.GetWifiIP(),
             '  Install Speed: %s KB/s' % install_speed,
             '']
 
@@ -92,8 +88,9 @@
   # Turn off devices with low battery and the step does not fail.
   if battery_level < 15:
     device_adb.EnableAdbRoot()
-    AdbShellCmd('reboot -p')
-  return device_type, device_build, '\n'.join(report), errors, True
+    device_adb.Shutdown()
+  full_report = '\n'.join(report)
+  return device_type, device_build, battery_level, full_report, errors, True
 
 
 def CheckForMissingDevices(options, adb_online_devs):
@@ -189,15 +186,21 @@
                     default=os.path.join(constants.DIR_SOURCE_ROOT, 'out'))
   parser.add_option('--no-provisioning-check',
                     help='Will not check if devices are provisioned properly.')
-
+  parser.add_option('--device-status-dashboard',
+                    help='Output device status data for dashboard.')
   options, args = parser.parse_args()
   if args:
     parser.error('Unknown options %s' % args)
   devices = android_commands.GetAttachedDevices()
-  types, builds, reports, errors = [], [], [], []
+  # TODO(navabi): Test to make sure this fails and then fix call
+  offline_devices = android_commands.GetAttachedDevices(hardware=False,
+                                                        emulator=False,
+                                                        offline=True)
+
+  types, builds, batteries, reports, errors = [], [], [], [], []
   fail_step_lst = []
   if devices:
-    types, builds, reports, errors, fail_step_lst = (
+    types, builds, batteries, reports, errors, fail_step_lst = (
         zip(*[DeviceInfo(dev, options) for dev in devices]))
 
   err_msg = CheckForMissingDevices(options, devices) or []
@@ -220,6 +223,16 @@
     print msg
     SendDeviceStatusAlert(msg)
 
+  if options.device_status_dashboard:
+    perf_tests_helper.PrintPerfResult('BotDevices', 'OnlineDevices',
+                                      [len(devices)], 'devices')
+    perf_tests_helper.PrintPerfResult('BotDevices', 'OfflineDevices',
+                                      [len(offline_devices)], 'devices',
+                                      'unimportant')
+    for serial, battery in zip(devices, batteries):
+      perf_tests_helper.PrintPerfResult('DeviceBattery', serial, [battery], '%',
+                                        'unimportant')
+
   if False in fail_step_lst:
     # TODO(navabi): Build fails on device status check step if there exists any
     # devices with critically low battery or install speed. Remove those devices
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 2dab2c1..688b663 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1008,7 +1008,7 @@
   def GetWifiIP(self):
     """Returns the wifi IP on the device."""
     wifi_ip = self.RunShellCommand('getprop dhcp.wlan0.ipaddress')[0]
-    assert wifi_ip
+    # Do not assert here. Devices (e.g. emulators) may not have a WifiIP.
     return wifi_ip
 
   def GetSubscriberInfo(self):
diff --git a/build/android/pylib/browsertests/setup.py b/build/android/pylib/browsertests/setup.py
index 6e5bac9..82c6b11 100644
--- a/build/android/pylib/browsertests/setup.py
+++ b/build/android/pylib/browsertests/setup.py
@@ -19,7 +19,7 @@
 
 
 def Setup(test_arguments, timeout, cleanup_test_files, tool, build_type,
-          webkit, push_deps, gtest_filter):
+          push_deps, gtest_filter):
   """Create the test runner factory and tests.
 
   Args:
@@ -28,7 +28,6 @@
     cleanup_test_files: Whether or not to cleanup test files on device.
     tool: Name of the Valgrind tool.
     build_type: 'Release' or 'Debug'.
-    webkit: Whether the suite is being run from a WebKit checkout.
     push_deps: If True, push all dependencies to the device.
     gtest_filter: filter for tests.
 
@@ -55,7 +54,6 @@
         cleanup_test_files,
         tool,
         build_type,
-        webkit,
         push_deps,
         constants.BROWSERTEST_TEST_PACKAGE_NAME,
         constants.BROWSERTEST_TEST_ACTIVITY_NAME,
diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py
index 7e1fe88..a246833 100644
--- a/build/android/pylib/gtest/setup.py
+++ b/build/android/pylib/gtest/setup.py
@@ -37,6 +37,8 @@
     'net_unittests': 'net/net_unittests.isolate',
     'ui_unittests': 'ui/ui_unittests.isolate',
     'unit_tests': 'chrome/unit_tests.isolate',
+    'webkit_unit_tests':
+      'third_party/WebKit/Source/web/WebKitUnitTests.isolate',
 }
 
 # Used for filtering large data deps at a finer grain than what's allowed in
@@ -288,7 +290,7 @@
 
 
 def Setup(use_exe_test_runner, suite_name, test_arguments, timeout,
-          cleanup_test_files, tool, build_type, webkit, push_deps,
+          cleanup_test_files, tool, build_type, push_deps,
           gtest_filter):
   """Create the test runner factory and tests.
 
@@ -300,7 +302,6 @@
     cleanup_test_files: Whether or not to cleanup test files on device.
     tool: Name of the Valgrind tool.
     build_type: 'Release' or 'Debug'.
-    webkit: Whether the suite is being run from a WebKit checkout.
     push_deps: If True, push all dependencies to the device.
     gtest_filter: Filter for tests.
 
@@ -328,7 +329,6 @@
         cleanup_test_files,
         tool,
         build_type,
-        webkit,
         push_deps,
         constants.GTEST_TEST_PACKAGE_NAME,
         constants.GTEST_TEST_ACTIVITY_NAME,
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
index 3a1463c..da422c3 100644
--- a/build/android/pylib/gtest/test_runner.py
+++ b/build/android/pylib/gtest/test_runner.py
@@ -29,7 +29,7 @@
 class TestRunner(base_test_runner.BaseTestRunner):
   def __init__(self, device, suite_name, test_arguments, timeout,
                cleanup_test_files, tool_name, build_type,
-               in_webkit_checkout, push_deps, test_apk_package_name=None,
+               push_deps, test_apk_package_name=None,
                test_activity_name=None, command_line_file=None):
     """Single test suite attached to a single device.
 
@@ -41,7 +41,6 @@
       cleanup_test_files: Whether or not to cleanup test files on device.
       tool_name: Name of the Valgrind tool.
       build_type: 'Release' or 'Debug'.
-      in_webkit_checkout: Whether the suite is being run from a WebKit checkout.
       push_deps: If True, push all dependencies to the device.
       test_apk_package_name: Apk package name for tests running in APKs.
       test_activity_name: Test activity to invoke for APK tests.
@@ -50,7 +49,6 @@
     super(TestRunner, self).__init__(device, tool_name, build_type, push_deps,
                                      cleanup_test_files)
     self._test_arguments = test_arguments
-    self.in_webkit_checkout = in_webkit_checkout
     if timeout == 0:
       timeout = 60
     # On a VM (e.g. chromium buildbots), this timeout is way too small.
@@ -88,10 +86,6 @@
   def PushDataDeps(self):
     self.adb.WaitForSdCardReady(20)
     self.tool.CopyFiles()
-    if self.test_package.suite_basename == 'webkit_unit_tests':
-      self.PushWebKitUnitTestsData()
-      return
-
     if os.path.exists(constants.ISOLATE_DEPS_DIR):
       device_dir = self.adb.GetExternalStorage()
       # TODO(frankf): linux_dumper_unittest_helper needs to be in the same dir
@@ -103,28 +97,6 @@
             os.path.join(constants.ISOLATE_DEPS_DIR, p),
             os.path.join(device_dir, p))
 
-  def PushWebKitUnitTestsData(self):
-    """Pushes the webkit_unit_tests data files to the device.
-
-    The path of this directory is different when the suite is being run as
-    part of a WebKit check-out.
-    """
-    webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
-                              'WebKit')
-    if self.in_webkit_checkout:
-      webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, '..', '..', '..')
-
-    self.adb.PushIfNeeded(
-        os.path.join(webkit_src, 'Source/web/tests/data'),
-        os.path.join(
-            self.adb.GetExternalStorage(),
-            'third_party/WebKit/Source/web/tests/data'))
-    self.adb.PushIfNeeded(
-        os.path.join(constants.DIR_SOURCE_ROOT,
-                     'third_party/hyphen/hyph_en_US.dic'),
-        os.path.join(self.adb.GetExternalStorage(),
-                     'third_party/hyphen/hyph_en_US.dic'))
-
   def _ParseTestOutput(self, p):
     """Process the test output.
 
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index f89fdb9..f50bc7c 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -54,9 +54,6 @@
 
   AddBuildTypeOption(option_parser)
 
-  option_parser.add_option('--out-directory', dest='out_directory',
-                           help=('Path to the out/ directory, irrespective of '
-                                 'the build type. Only for non-Chromium uses.'))
   option_parser.add_option('-c', dest='cleanup_test_files',
                            help='Cleanup test files on the device after run',
                            action='store_true')
@@ -97,8 +94,6 @@
 
 def ProcessCommonOptions(options):
   """Processes and handles all common options."""
-  if options.out_directory:
-    cmd_helper.OutDirectory.set(options.out_directory)
   run_tests_helper.SetLogLevel(options.verbose_count)
 
 
@@ -111,10 +106,6 @@
                            help='googletest-style filter string.')
   option_parser.add_option('-a', '--test_arguments', dest='test_arguments',
                            help='Additional arguments to pass to the test.')
-  # TODO(gkanwar): Possible deprecate this flag. Waiting on word from Peter
-  # Beverloo.
-  option_parser.add_option('--webkit', action='store_true',
-                           help='Run the tests from a WebKit checkout.')
   option_parser.add_option('--exe', action='store_true',
                            help='If set, use the exe test runner instead of '
                            'the APK.')
@@ -360,8 +351,7 @@
     runner_factory, tests = gtest_setup.Setup(
         options.exe, suite_name, options.test_arguments,
         options.timeout, options.cleanup_test_files, options.tool,
-        options.build_type, options.webkit, options.push_deps,
-        options.test_filter)
+        options.build_type, options.push_deps, options.test_filter)
 
     results, test_exit_code = test_dispatcher.RunTests(
         tests, runner_factory, False, options.test_device,
@@ -390,7 +380,7 @@
   """Subcommand of RunTestsCommands which runs content_browsertests."""
   runner_factory, tests = browsertests_setup.Setup(
       options.test_arguments, options.timeout, options.cleanup_test_files,
-      options.tool, options.build_type, options.webkit, options.push_deps,
+      options.tool, options.build_type, options.push_deps,
       options.test_filter)
 
   # TODO(nileshagrawal): remove this abnormally long setup timeout once fewer
diff --git a/build/common.gypi b/build/common.gypi
index 9d670dc..a21d812 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -337,9 +337,6 @@
       # Enable Google Now.
       'enable_google_now%': 1,
 
-      # Enable language detection.
-      'enable_language_detection%': 1,
-
       # Enable printing support and UI.
       'enable_printing%': 1,
 
@@ -513,7 +510,6 @@
           'enable_automation%': 0,
           'enable_extensions%': 0,
           'enable_google_now%': 0,
-          'enable_language_detection%': 1,
           'enable_printing%': 0,
           'enable_themes%': 0,
           'proprietary_codecs%': 1,
@@ -546,7 +542,6 @@
           'enable_automation%': 0,
           'enable_extensions%': 0,
           'enable_google_now%': 0,
-          'enable_language_detection%': 1,
           'enable_printing%': 0,
           'enable_session_service%': 0,
           'enable_themes%': 0,
@@ -823,7 +818,6 @@
     'enable_automation%': '<(enable_automation)',
     'enable_printing%': '<(enable_printing)',
     'enable_google_now%': '<(enable_google_now)',
-    'enable_language_detection%': '<(enable_language_detection)',
     'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
     'disable_ftp_support%': '<(disable_ftp_support)',
     'enable_task_manager%': '<(enable_task_manager)',
@@ -1295,7 +1289,6 @@
         'proprietary_codecs%': '<(proprietary_codecs)',
         'enable_task_manager%': 0,
         'safe_browsing%': 2,
-        'configuration_policy%': 0,
         'input_speech%': 0,
         'enable_automation%': 0,
         'java_bridge%': 1,
@@ -2230,9 +2223,6 @@
       ['enable_google_now==1', {
         'defines': ['ENABLE_GOOGLE_NOW=1'],
       }],
-      ['enable_language_detection==1', {
-        'defines': ['ENABLE_LANGUAGE_DETECTION=1'],
-      }],
       ['enable_printing==1', {
         'defines': ['ENABLE_PRINTING=1'],
       }],
diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE
index fc66aef..4b28ec8 100644
--- a/build/util/LASTCHANGE
+++ b/build/util/LASTCHANGE
@@ -1 +1 @@
-LASTCHANGE=213057
+LASTCHANGE=213371
diff --git a/build/util/LASTCHANGE.blink b/build/util/LASTCHANGE.blink
index 444f588..67dcb3f 100644
--- a/build/util/LASTCHANGE.blink
+++ b/build/util/LASTCHANGE.blink
@@ -1 +1 @@
-LASTCHANGE=154672
+LASTCHANGE=154818
diff --git a/cc/cc.target.darwin-arm.mk b/cc/cc.target.darwin-arm.mk
index 950ead4..d173193 100644
--- a/cc/cc.target.darwin-arm.mk
+++ b/cc/cc.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -234,18 +235,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -269,8 +269,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -348,18 +348,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -384,8 +383,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -461,7 +460,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/cc.target.darwin-mips.mk b/cc/cc.target.darwin-mips.mk
index 8f02a82..b00d6b8 100644
--- a/cc/cc.target.darwin-mips.mk
+++ b/cc/cc.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -233,18 +234,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -268,8 +268,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,18 +346,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -382,8 +381,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -455,7 +454,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/cc.target.darwin-x86.mk b/cc/cc.target.darwin-x86.mk
index 7144b29..586ed00 100644
--- a/cc/cc.target.darwin-x86.mk
+++ b/cc/cc.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -236,18 +237,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -270,8 +270,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -352,18 +352,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -387,8 +386,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -459,7 +458,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/cc.target.linux-arm.mk b/cc/cc.target.linux-arm.mk
index 950ead4..d173193 100644
--- a/cc/cc.target.linux-arm.mk
+++ b/cc/cc.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -234,18 +235,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -269,8 +269,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -348,18 +348,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -384,8 +383,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -461,7 +460,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/cc.target.linux-mips.mk b/cc/cc.target.linux-mips.mk
index 8f02a82..b00d6b8 100644
--- a/cc/cc.target.linux-mips.mk
+++ b/cc/cc.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -233,18 +234,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -268,8 +268,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,18 +346,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -382,8 +381,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -455,7 +454,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/cc.target.linux-x86.mk b/cc/cc.target.linux-x86.mk
index 7144b29..586ed00 100644
--- a/cc/cc.target.linux-x86.mk
+++ b/cc/cc.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp
@@ -236,18 +237,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -270,8 +270,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -352,18 +352,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCC_IMPLEMENTATION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -387,8 +386,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -459,7 +458,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/cc/debug/devtools_instrumentation.h b/cc/debug/devtools_instrumentation.h
index 7b2ea1a..7a77d40 100644
--- a/cc/debug/devtools_instrumentation.h
+++ b/cc/debug/devtools_instrumentation.h
@@ -13,16 +13,18 @@
 namespace internal {
 const char kCategory[] = "cc,devtools";
 const char kLayerId[] = "layerId";
+const char kLayerTreeId[] = "layerTreeId";
 }
 
 const char kPaintLayer[] = "PaintLayer";
 const char kRasterTask[] = "RasterTask";
 const char kImageDecodeTask[] = "ImageDecodeTask";
 const char kPaintSetup[] = "PaintSetup";
+const char kUpdateLayer[] = "UpdateLayer";
 
 class ScopedLayerTask {
  public:
-  explicit ScopedLayerTask(const char* event_name, int layer_id)
+  ScopedLayerTask(const char* event_name, int layer_id)
     : event_name_(event_name) {
     TRACE_EVENT_BEGIN1(internal::kCategory, event_name_,
         internal::kLayerId, layer_id);
@@ -32,6 +34,26 @@
   }
  private:
   const char* event_name_;
+
+  DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask);
+};
+
+class ScopedLayerTreeTask {
+ public:
+  ScopedLayerTreeTask(const char* event_name,
+                      int layer_id,
+                      uint64 tree_id)
+    : event_name_(event_name) {
+    TRACE_EVENT_BEGIN2(internal::kCategory, event_name_,
+        internal::kLayerId, layer_id, internal::kLayerTreeId, tree_id);
+  }
+  ~ScopedLayerTreeTask() {
+    TRACE_EVENT_END0(internal::kCategory, event_name_);
+  }
+ private:
+  const char* event_name_;
+
+  DISALLOW_COPY_AND_ASSIGN(ScopedLayerTreeTask);
 };
 
 struct ScopedLayerObjectTracker
@@ -43,6 +65,7 @@
             layer_id) {
   }
 
+ private:
   DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker);
 };
 
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index eca7723..4865fe2 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -108,8 +108,6 @@
   if (requests->empty())
     return;
 
-  DCHECK(copy_requests_.empty());
-
   copy_requests_.insert_and_take(copy_requests_.end(), *requests);
   requests->clear();
 
diff --git a/cc/output/copy_output_result.cc b/cc/output/copy_output_result.cc
index 412a55d..55213cd 100644
--- a/cc/output/copy_output_result.cc
+++ b/cc/output/copy_output_result.cc
@@ -26,7 +26,10 @@
   DCHECK(texture_mailbox_->IsTexture());
 }
 
-CopyOutputResult::~CopyOutputResult() {}
+CopyOutputResult::~CopyOutputResult() {
+  if (texture_mailbox_)
+    texture_mailbox_->RunReleaseCallback(0, false);
+}
 
 scoped_ptr<SkBitmap> CopyOutputResult::TakeBitmap() {
   return bitmap_.Pass();
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index c801553..60a0b92 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -752,9 +752,15 @@
   SkScalar color_matrix[20];
   bool use_color_matrix = false;
   if (quad->filter) {
-    SkColorFilter* cf;
-    if ((quad->filter->asColorFilter(&cf)) && cf->asColorMatrix(color_matrix) &&
-        !quad->filter->getInput(0)) {
+    skia::RefPtr<SkColorFilter> cf;
+
+    {
+      SkColorFilter* colorfilter_rawptr = NULL;
+      quad->filter->asColorFilter(&colorfilter_rawptr);
+      cf = skia::AdoptRef(colorfilter_rawptr);
+    }
+
+    if (cf && cf->asColorMatrix(color_matrix) && !quad->filter->getInput(0)) {
       // We have a single color matrix as a filter; apply it locally
       // in the compositor.
       use_color_matrix = true;
@@ -2302,6 +2308,14 @@
                                      NULL,
                                      GL_STREAM_READ));
 
+  WebKit::WebGLId query = 0;
+  if (is_async) {
+    query = context_->createQueryEXT();
+    GLC(context_, context_->beginQueryEXT(
+        GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM,
+        query));
+  }
+
   GLC(context_,
       context_->readPixels(window_rect.x(),
                            window_rect.y(),
@@ -2327,6 +2341,7 @@
                  base::Unretained(this),
                  cleanup_callback,
                  buffer,
+                 query,
                  dest_pixels,
                  window_rect.size());
   // Save the finished_callback so it can be cancelled.
@@ -2337,10 +2352,11 @@
   pending_async_read_pixels_.front()->buffer = buffer;
 
   if (is_async) {
-    unsigned sync_point = context_->insertSyncPoint();
-    SyncPointHelper::SignalSyncPoint(
+    GLC(context_, context_->endQueryEXT(
+        GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM));
+    SyncPointHelper::SignalQuery(
         context_,
-        sync_point,
+        query,
         finished_callback);
   } else {
     resource_provider_->Finish();
@@ -2353,10 +2369,15 @@
 void GLRenderer::FinishedReadback(
     const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback,
     unsigned source_buffer,
+    unsigned query,
     uint8* dest_pixels,
     gfx::Size size) {
   DCHECK(!pending_async_read_pixels_.empty());
 
+  if (query != 0) {
+    GLC(context_, context_->deleteQueryEXT(query));
+  }
+
   PendingAsyncReadPixels* current_read = pending_async_read_pixels_.back();
   // Make sure we service the readbacks in order.
   DCHECK_EQ(source_buffer, current_read->buffer);
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
index c6ad8b1..3e06537 100644
--- a/cc/output/gl_renderer.h
+++ b/cc/output/gl_renderer.h
@@ -201,6 +201,7 @@
   void FinishedReadback(
       const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback,
       unsigned source_buffer,
+      unsigned query,
       uint8_t* dest_pixels,
       gfx::Size size);
   void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap,
@@ -262,7 +263,7 @@
                          FragmentShaderTexBackgroundVaryingAlpha>
       TextureBackgroundProgram;
   typedef ProgramBinding<VertexShaderPosTexTransform,
-                         FragmentShaderTexBackgroundVaryingAlpha>
+                         FragmentShaderTexBackgroundPremultiplyAlpha>
       NonPremultipliedTextureBackgroundProgram;
   typedef ProgramBinding<VertexShaderPosTexTransform,
                          FragmentShaderRGBATexRectVaryingAlpha>
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index ff1d065..ed1df7a 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -102,8 +102,12 @@
     bool premultiplied_alpha,
     SharedQuadState* shared_state,
     ResourceProvider* resource_provider) {
-  uint32_t pixel_color = premultiplied_alpha ?
-      SkPreMultiplyColor(texel_color) : texel_color;
+  SkPMColor pixel_color = premultiplied_alpha ?
+      SkPreMultiplyColor(texel_color) :
+      SkPackARGB32NoCheck(SkColorGetA(texel_color),
+                          SkColorGetR(texel_color),
+                          SkColorGetG(texel_color),
+                          SkColorGetB(texel_color));
   std::vector<uint32_t> pixels(rect.size().GetArea(), pixel_color);
 
   ResourceProvider::ResourceId resource = resource_provider->CreateResource(
@@ -294,11 +298,11 @@
 
   scoped_ptr<SharedQuadState> texture_quad_state =
       CreateTestSharedQuadState(gfx::Transform(), rect);
-  texture_quad_state->opacity = 0.5f;
+  texture_quad_state->opacity = 0.8f;
 
   scoped_ptr<TextureDrawQuad> texture_quad = CreateTestTextureDrawQuad(
       gfx::Rect(this->device_viewport_size_),
-      SK_ColorTRANSPARENT,  // Texel color.
+      SkColorSetARGB(204, 120, 255, 120),  // Texel color.
       SK_ColorGREEN,  // Background color.
       true,  // Premultiplied alpha.
       texture_quad_state.get(),
@@ -361,11 +365,11 @@
 
   scoped_ptr<SharedQuadState> texture_quad_state =
       CreateTestSharedQuadState(gfx::Transform(), rect);
-  texture_quad_state->opacity = 0.5f;
+  texture_quad_state->opacity = 0.8f;
 
   scoped_ptr<TextureDrawQuad> texture_quad = CreateTestTextureDrawQuad(
       gfx::Rect(this->device_viewport_size_),
-      SK_ColorTRANSPARENT,  // Texel color.
+      SkColorSetARGB(204, 120, 255, 120),  // Texel color.
       SK_ColorGREEN,  // Background color.
       false,  // Premultiplied alpha.
       texture_quad_state.get(),
diff --git a/cc/output/shader.cc b/cc/output/shader.cc
index df2c5dc..8ab2114 100644
--- a/cc/output/shader.cc
+++ b/cc/output/shader.cc
@@ -840,6 +840,7 @@
     precision mediump float;
     varying TexCoordPrecision vec2 v_texCoord;
     varying float v_alpha;
+    uniform vec4 background_color;
     uniform sampler2D s_texture;
     void main() {
       vec4 texColor = texture2D(s_texture, v_texCoord);
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index 9e5488b..44d43f9 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -415,6 +415,12 @@
   sync_point_callbacks_.push_back(callback);
 }
 
+void TestWebGraphicsContext3D::signalQuery(
+    WebKit::WebGLId query,
+    WebGraphicsSyncPointCallback* callback) {
+  sync_point_callbacks_.push_back(callback);
+}
+
 void TestWebGraphicsContext3D::setSwapBuffersCompleteCallbackCHROMIUM(
     WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback) {
   if (support_swapbuffers_complete_callback_)
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 41296b2..b182fe6 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -114,6 +114,8 @@
   // Takes ownership of the |callback|.
   virtual void signalSyncPoint(unsigned sync_point,
                                WebGraphicsSyncPointCallback* callback);
+  virtual void signalQuery(WebKit::WebGLId query,
+                           WebGraphicsSyncPointCallback* callback);
 
   virtual void setSwapBuffersCompleteCallbackCHROMIUM(
       WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback);
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 12d81f3..0d90c59 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -18,6 +18,7 @@
 #include "cc/animation/layer_animation_controller.h"
 #include "cc/base/math_util.h"
 #include "cc/debug/benchmark_instrumentation.h"
+#include "cc/debug/devtools_instrumentation.h"
 #include "cc/debug/overdraw_metrics.h"
 #include "cc/debug/rendering_stats_instrumentation.h"
 #include "cc/input/top_controls_manager.h"
@@ -73,6 +74,8 @@
   return layer_tree_host.Pass();
 }
 
+static int s_next_tree_id = 1;
+
 LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
                              const LayerTreeSettings& settings)
     : animating_(false),
@@ -97,11 +100,11 @@
       has_transparent_background_(false),
       partial_texture_update_requests_(0),
       in_paint_layer_contents_(false),
-      total_frames_used_for_lcd_text_metrics_(0) {
+      total_frames_used_for_lcd_text_metrics_(0),
+      tree_id_(s_next_tree_id++) {
   if (settings_.accelerated_animation_enabled)
     animation_registrar_ = AnimationRegistrar::Create();
   s_num_layer_tree_instances++;
-
   rendering_stats_instrumentation_->set_record_rendering_stats(
       debug_state_.RecordRenderingStats());
 }
@@ -883,6 +886,10 @@
 
   Layer* mask_layer = render_surface_layer->mask_layer();
   if (mask_layer) {
+    devtools_instrumentation::ScopedLayerTreeTask
+        update_layer(devtools_instrumentation::kUpdateLayer,
+                     mask_layer->id(),
+                     id());
     *did_paint_content |= mask_layer->Update(queue, NULL);
     *need_more_updates |= mask_layer->NeedMoreUpdates();
   }
@@ -891,6 +898,10 @@
       render_surface_layer->replica_layer() ?
       render_surface_layer->replica_layer()->mask_layer() : NULL;
   if (replica_mask_layer) {
+    devtools_instrumentation::ScopedLayerTreeTask
+        update_layer(devtools_instrumentation::kUpdateLayer,
+                     replica_mask_layer->id(),
+                     id());
     *did_paint_content |= replica_mask_layer->Update(queue, NULL);
     *need_more_updates |= replica_mask_layer->NeedMoreUpdates();
   }
@@ -934,6 +945,8 @@
       PaintMasksForRenderSurface(
           *it, queue, did_paint_content, need_more_updates);
     } else if (it.represents_itself()) {
+      devtools_instrumentation::ScopedLayerTreeTask
+          update_layer(devtools_instrumentation::kUpdateLayer, it->id(), id());
       DCHECK(!it->paint_properties().bounds.IsEmpty());
       *did_paint_content |= it->Update(queue, &occlusion_tracker);
       *need_more_updates |= it->NeedMoreUpdates();
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 63e8aec..0fd3abb 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -253,6 +253,7 @@
   bool in_paint_layer_contents() const { return in_paint_layer_contents_; }
 
   bool UsingSharedMemoryResources();
+  int id() const { return tree_id_; }
 
  protected:
   LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings);
@@ -367,6 +368,7 @@
     int64 total_num_cc_layers_will_use_lcd_text;
   };
   LCDTextMetrics lcd_text_metrics_;
+  int tree_id_;
 
   DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
 };
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 50a2d39..dce396f 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -149,7 +149,7 @@
 template <typename LayerType>
 static gfx::Rect CalculateVisibleContentRect(
     LayerType* layer,
-    gfx::Rect ancestor_clip_rect_in_descendant_surface_space,
+    gfx::Rect clip_rect_of_target_surface_in_target_space,
     gfx::Rect layer_rect_in_target_space) {
   DCHECK(layer->render_target());
 
@@ -163,13 +163,17 @@
       layer->drawable_content_rect();
 
   if (!layer->render_target()->render_surface()->clip_rect().IsEmpty()) {
-    // In this case the target surface does clip layers that contribute to
-    // it. So, we have to convert the current surface's clip rect from its
-    // ancestor surface space to the current (descendant) surface
-    // space. This conversion is done outside this function so that it can
-    // be cached instead of computing it redundantly for every layer.
+    // The |layer| L has a target T which owns a surface Ts. The surface Ts
+    // has a target TsT.
+    //
+    // In this case the target surface Ts does clip the layer L that contributes
+    // to it. So, we have to convert the clip rect of Ts from the target space
+    // of Ts (that is the space of TsT), to the current render target's space
+    // (that is the space of T). This conversion is done outside this function
+    // so that it can be cached instead of computing it redundantly for every
+    // layer.
     visible_rect_in_target_surface_space.Intersect(
-        ancestor_clip_rect_in_descendant_surface_space);
+        clip_rect_of_target_surface_in_target_space);
   }
 
   if (visible_rect_in_target_surface_space.IsEmpty())
@@ -862,8 +866,8 @@
     const gfx::Transform& full_hierarchy_matrix,
     const gfx::Transform& current_scroll_compensation_matrix,
     LayerType* current_fixed_container,
-    gfx::Rect clip_rect_from_ancestor,
-    gfx::Rect clip_rect_from_ancestor_in_descendant_space,
+    gfx::Rect clip_rect_from_ancestor_in_ancestor_target_space,
+    gfx::Rect clip_rect_of_target_surface_from_ancestor_in_target_space,
     bool ancestor_clips_subtree,
     RenderSurfaceType* nearest_ancestor_that_moves_pixels,
     LayerListType* render_surface_layer_list,
@@ -1027,15 +1031,15 @@
   DrawProperties<LayerType, RenderSurfaceType>& layer_draw_properties =
       layer->draw_properties();
 
-  gfx::Rect clip_rect_for_subtree;
-  bool subtree_should_be_clipped = false;
+  gfx::Rect clip_rect_in_target_space;
+  bool layer_or_ancestor_clips_descendants = false;
 
   // This value is cached on the stack so that we don't have to inverse-project
   // the surface's clip rect redundantly for every layer. This value is the
-  // same as the surface's clip rect, except that instead of being described
-  // in the target surface space (i.e. the ancestor surface space), it is
-  // described in the current surface space.
-  gfx::Rect clip_rect_for_subtree_in_descendant_space;
+  // same as the target surface's clip rect, except that instead of being
+  // described in the target surface's target's space, it is described in the
+  // current render target's space.
+  gfx::Rect clip_rect_of_target_surface_in_target_space;
 
   float accumulated_draw_opacity = layer->opacity();
   bool animating_opacity_to_target = layer->OpacityIsAnimating();
@@ -1235,7 +1239,7 @@
     // the tree. This way, we can avoid transforming clip rects from ancestor
     // target surface space to current target surface space that could cause
     // more w < 0 headaches.
-    subtree_should_be_clipped = false;
+    layer_or_ancestor_clips_descendants = false;
 
     if (layer->mask_layer()) {
       DrawProperties<LayerType, RenderSurfaceType>& mask_layer_draw_properties =
@@ -1260,10 +1264,12 @@
       nearest_ancestor_that_moves_pixels = render_surface;
 
     // The render surface clip rect is expressed in the space where this surface
-    // draws, i.e. the same space as clip_rect_from_ancestor.
+    // draws, i.e. the same space as
+    // clip_rect_from_ancestor_in_ancestor_target_space.
     render_surface->SetIsClipped(ancestor_clips_subtree);
     if (ancestor_clips_subtree) {
-      render_surface->SetClipRect(clip_rect_from_ancestor);
+      render_surface->SetClipRect(
+          clip_rect_from_ancestor_in_ancestor_target_space);
 
       gfx::Transform inverse_surface_draw_transform(
           gfx::Transform::kSkipInitialization);
@@ -1272,13 +1278,13 @@
         // TODO(shawnsingh): Either we need to handle uninvertible transforms
         // here, or DCHECK that the transform is invertible.
       }
-      clip_rect_for_subtree_in_descendant_space =
+      clip_rect_of_target_surface_in_target_space =
           gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
               inverse_surface_draw_transform, render_surface->clip_rect()));
     } else {
       render_surface->SetClipRect(gfx::Rect());
-      clip_rect_for_subtree_in_descendant_space =
-          clip_rect_from_ancestor_in_descendant_space;
+      clip_rect_of_target_surface_in_target_space =
+          clip_rect_of_target_surface_from_ancestor_in_target_space;
     }
 
     render_surface->SetNearestAncestorThatMovesPixels(
@@ -1309,14 +1315,16 @@
 
     // Layers without render_surfaces directly inherit the ancestor's clip
     // status.
-    subtree_should_be_clipped = ancestor_clips_subtree;
-    if (ancestor_clips_subtree)
-      clip_rect_for_subtree = clip_rect_from_ancestor;
+    layer_or_ancestor_clips_descendants = ancestor_clips_subtree;
+    if (ancestor_clips_subtree) {
+      clip_rect_in_target_space =
+          clip_rect_from_ancestor_in_ancestor_target_space;
+    }
 
     // The surface's cached clip rect value propagates regardless of what
     // clipping goes on between layers here.
-    clip_rect_for_subtree_in_descendant_space =
-        clip_rect_from_ancestor_in_descendant_space;
+    clip_rect_of_target_surface_in_target_space =
+        clip_rect_of_target_surface_from_ancestor_in_target_space;
 
     // Layers that are not their own render_target will render into the target
     // of their nearest ancestor.
@@ -1345,12 +1353,14 @@
       MathUtil::MapClippedRect(layer->draw_transform(), content_rect));
 
   if (LayerClipsSubtree(layer)) {
-    subtree_should_be_clipped = true;
+    layer_or_ancestor_clips_descendants = true;
     if (ancestor_clips_subtree && !layer->render_surface()) {
-      clip_rect_for_subtree = clip_rect_from_ancestor;
-      clip_rect_for_subtree.Intersect(rect_in_target_space);
+      // A layer without render surface shares the same target as its ancestor.
+      clip_rect_in_target_space =
+          clip_rect_from_ancestor_in_ancestor_target_space;
+      clip_rect_in_target_space.Intersect(rect_in_target_space);
     } else {
-      clip_rect_for_subtree = rect_in_target_space;
+      clip_rect_in_target_space = rect_in_target_space;
     }
   }
 
@@ -1406,9 +1416,9 @@
         next_hierarchy_matrix,
         next_scroll_compensation_matrix,
         next_fixed_container,
-        clip_rect_for_subtree,
-        clip_rect_for_subtree_in_descendant_space,
-        subtree_should_be_clipped,
+        clip_rect_in_target_space,
+        clip_rect_of_target_surface_in_target_space,
+        layer_or_ancestor_clips_descendants,
         nearest_ancestor_that_moves_pixels,
         render_surface_layer_list,
         &descendants,
@@ -1442,40 +1452,41 @@
       accumulated_drawable_content_rect_of_children;
   if (layer->DrawsContent())
     local_drawable_content_rect_of_subtree.Union(rect_in_target_space);
-  if (subtree_should_be_clipped)
-    local_drawable_content_rect_of_subtree.Intersect(clip_rect_for_subtree);
+  if (layer_or_ancestor_clips_descendants)
+    local_drawable_content_rect_of_subtree.Intersect(clip_rect_in_target_space);
 
   // Compute the layer's drawable content rect (the rect is in target surface
   // space).
   layer_draw_properties.drawable_content_rect = rect_in_target_space;
-  if (subtree_should_be_clipped) {
+  if (layer_or_ancestor_clips_descendants) {
     layer_draw_properties.drawable_content_rect.
-        Intersect(clip_rect_for_subtree);
+        Intersect(clip_rect_in_target_space);
   }
 
   // Tell the layer the rect that is clipped by. In theory we could use a
   // tighter clip rect here (drawable_content_rect), but that actually does not
   // reduce how much would be drawn, and instead it would create unnecessary
   // changes to scissor state affecting GPU performance.
-  layer_draw_properties.is_clipped = subtree_should_be_clipped;
-  if (subtree_should_be_clipped) {
-    layer_draw_properties.clip_rect = clip_rect_for_subtree;
+  layer_draw_properties.is_clipped = layer_or_ancestor_clips_descendants;
+  if (layer_or_ancestor_clips_descendants) {
+    layer_draw_properties.clip_rect = clip_rect_in_target_space;
   } else {
     // Initialize the clip rect to a safe value that will not clip the
     // layer, just in case clipping is still accidentally used.
     layer_draw_properties.clip_rect = rect_in_target_space;
   }
 
-  // Compute the layer's visible content rect (the rect is in content space)
+  // Compute the layer's visible content rect (the rect is in content space).
   layer_draw_properties.visible_content_rect = CalculateVisibleContentRect(
-      layer, clip_rect_for_subtree_in_descendant_space, rect_in_target_space);
+      layer, clip_rect_of_target_surface_in_target_space, rect_in_target_space);
 
   // Compute the remaining properties for the render surface, if the layer has
   // one.
   if (IsRootLayer(layer)) {
     // The root layer's surface's content_rect is always the entire viewport.
     DCHECK(layer->render_surface());
-    layer->render_surface()->SetContentRect(clip_rect_from_ancestor);
+    layer->render_surface()->SetContentRect(
+        clip_rect_from_ancestor_in_ancestor_target_space);
   } else if (layer->render_surface() && !IsRootLayer(layer)) {
     RenderSurfaceType* render_surface = layer->render_surface();
     gfx::Rect clipped_content_rect = local_drawable_content_rect_of_subtree;
@@ -1604,7 +1615,7 @@
 
   // The root layer's render_surface should receive the device viewport as the
   // initial clip rect.
-  bool subtree_should_be_clipped = true;
+  bool layer_or_ancestor_clips_descendants = true;
   gfx::Rect device_viewport_rect(device_viewport_size);
   bool in_subtree_of_page_scale_application_layer = false;
   bool subtree_is_visible = true;
@@ -1623,7 +1634,7 @@
       root_layer,
       device_viewport_rect,
       device_viewport_rect,
-      subtree_should_be_clipped,
+      layer_or_ancestor_clips_descendants,
       NULL,
       render_surface_layer_list,
       &dummy_layer_list,
@@ -1665,7 +1676,7 @@
 
   // The root layer's render_surface should receive the device viewport as the
   // initial clip rect.
-  bool subtree_should_be_clipped = true;
+  bool layer_or_ancestor_clips_descendants = true;
   gfx::Rect device_viewport_rect(device_viewport_size);
   bool in_subtree_of_page_scale_application_layer = false;
   bool subtree_is_visible = true;
@@ -1686,7 +1697,7 @@
       root_layer,
       device_viewport_rect,
       device_viewport_rect,
-      subtree_should_be_clipped,
+      layer_or_ancestor_clips_descendants,
       NULL,
       render_surface_layer_list,
       &dummy_layer_list,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index a08e661..629877f 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1069,7 +1069,7 @@
     const base::Closure& callback) {
   DCHECK(proxy_->IsImplThread());
   DCHECK(settings_.impl_side_painting || callback.is_null());
-  tree_activiation_callback_ = callback;
+  tree_activation_callback_ = callback;
 }
 
 void LayerTreeHostImpl::SetManagedMemoryPolicy(
@@ -1448,8 +1448,8 @@
   }
 
   client_->DidActivatePendingTree();
-  if (!tree_activiation_callback_.is_null())
-    tree_activiation_callback_.Run();
+  if (!tree_activation_callback_.is_null())
+    tree_activation_callback_.Run();
 }
 
 void LayerTreeHostImpl::SetVisible(bool visible) {
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 4838e74..9a0f72f 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -537,7 +537,7 @@
   bool need_to_update_visible_tiles_before_draw_;
 
   // Optional callback to notify of new tree activations.
-  base::Closure tree_activiation_callback_;
+  base::Closure tree_activation_callback_;
 
   DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
 };
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 1824f2f..7c940bb 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2947,6 +2947,77 @@
 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
     LayerTreeHostTestAsyncReadbackClippedOut);
 
+class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw : public LayerTreeHostTest {
+ protected:
+  virtual void SetupTree() OVERRIDE {
+    root_ = FakeContentLayer::Create(&client_);
+    root_->SetBounds(gfx::Size(20, 20));
+
+    copy_layer_ = FakeContentLayer::Create(&client_);
+    copy_layer_->SetBounds(gfx::Size(10, 10));
+    root_->AddChild(copy_layer_);
+
+    layer_tree_host()->SetRootLayer(root_);
+    LayerTreeHostTest::SetupTree();
+  }
+
+  void AddCopyRequest(Layer* layer) {
+    layer->RequestCopyOfOutput(
+        CopyOutputRequest::CreateBitmapRequest(base::Bind(
+            &LayerTreeHostTestAsyncTwoReadbacksWithoutDraw::CopyOutputCallback,
+            base::Unretained(this))));
+  }
+
+  virtual void BeginTest() OVERRIDE {
+    saw_copy_request_ = false;
+    callback_count_ = 0;
+    PostSetNeedsCommitToMainThread();
+
+    // Prevent drawing.
+    layer_tree_host()->SetViewportSize(gfx::Size(0, 0));
+
+    AddCopyRequest(copy_layer_.get());
+  }
+
+  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+    if (impl->active_tree()->source_frame_number() == 0) {
+      LayerImpl* root = impl->active_tree()->root_layer();
+      EXPECT_TRUE(root->children()[0]->HasCopyRequest());
+      saw_copy_request_ = true;
+    }
+  }
+
+  virtual void DidCommit() OVERRIDE {
+    if (layer_tree_host()->commit_number() == 1) {
+      // Allow drawing.
+      layer_tree_host()->SetViewportSize(gfx::Size(root_->bounds()));
+
+      AddCopyRequest(copy_layer_.get());
+    }
+  }
+
+  void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) {
+    EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
+    EXPECT_EQ(copy_layer_->bounds().ToString(), result->size().ToString());
+    ++callback_count_;
+
+    if (callback_count_ == 2)
+      EndTest();
+  }
+
+  virtual void AfterTest() OVERRIDE { EXPECT_TRUE(saw_copy_request_); }
+
+  bool saw_copy_request_;
+  int callback_count_;
+  FakeContentLayerClient client_;
+  scoped_refptr<FakeContentLayer> root_;
+  scoped_refptr<FakeContentLayer> copy_layer_;
+};
+
+// No output to copy for delegated renderers.
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
+    LayerTreeHostTestAsyncTwoReadbacksWithoutDraw);
+
 class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
  public:
   virtual void BeginTest() OVERRIDE {
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 9da16b4..d69e7ff 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -565,9 +565,10 @@
   // they are aborted if not serviced during draw.
   DCHECK(IsActiveTree());
 
-  DCHECK(std::find(layers_with_copy_output_request_.begin(),
-                   layers_with_copy_output_request_.end(),
-                   layer) == layers_with_copy_output_request_.end());
+  if (std::find(layers_with_copy_output_request_.begin(),
+                layers_with_copy_output_request_.end(),
+                layer) != layers_with_copy_output_request_.end())
+    return;
   layers_with_copy_output_request_.push_back(layer);
 }
 
diff --git a/chrome/VERSION b/chrome/VERSION
index f3e7200..41983f5 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=30
 MINOR=0
-BUILD=1574
+BUILD=1575
 PATCH=0
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index ecab0fd..f4b5caa 100644
--- a/chrome/app/breakpad_linux.cc
+++ b/chrome/app/breakpad_linux.cc
@@ -38,7 +38,6 @@
 #include "breakpad/src/common/linux/linux_libc_support.h"
 #include "breakpad/src/common/memory.h"
 #include "chrome/app/breakpad_linux_impl.h"
-#include "chrome/browser/crash_upload_list.h"
 #include "chrome/common/child_process_logging.h"
 #include "components/breakpad/breakpad_client.h"
 #include "content/public/common/content_descriptors.h"
@@ -651,8 +650,8 @@
 
   base::FilePath dumps_path(tmp_path);
   if (breakpad::GetBreakpadClient()->GetCrashDumpLocation(&dumps_path)) {
-    base::FilePath logfile =
-        dumps_path.AppendASCII(CrashUploadList::kReporterLogFilename);
+    base::FilePath logfile = dumps_path.Append(
+        breakpad::GetBreakpadClient()->GetReporterLogFilename());
     std::string logfile_str = logfile.value();
     const size_t crash_log_path_len = logfile_str.size() + 1;
     g_crash_log_path = new char[crash_log_path_len];
diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm
index 18de7e6..aeebd7f 100644
--- a/chrome/app/breakpad_mac.mm
+++ b/chrome/app/breakpad_mac.mm
@@ -24,7 +24,6 @@
 #include "base/threading/thread_restrictions.h"
 #import "breakpad/src/client/mac/Framework/Breakpad.h"
 #include "chrome/common/child_process_logging.h"
-#include "chrome/installer/util/google_update_settings.h"
 #include "content/public/common/content_switches.h"
 #include "components/breakpad/breakpad_client.h"
 #include "components/nacl/common/nacl_switches.h"
@@ -191,7 +190,8 @@
       // Controlled by the user. The crash reporter may be enabled by
       // preference or through an environment variable, but the kDisableBreakpad
       // switch overrides both.
-      enable_breakpad = GoogleUpdateSettings::GetCollectStatsConsent() ||
+      enable_breakpad =
+          breakpad::GetBreakpadClient()->GetCollectStatsConsent() ||
           breakpad::GetBreakpadClient()->IsRunningUnattended();
       enable_breakpad &= !command_line->HasSwitch(switches::kDisableBreakpad);
     }
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 7c26782..c618085 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -32,9 +32,6 @@
 #include "chrome/app/hard_error_handler_win.h"
 #include "chrome/common/child_process_logging.h"
 #include "chrome/common/chrome_result_codes.h"
-#include "chrome/installer/util/google_chrome_sxs_distribution.h"
-#include "chrome/installer/util/google_update_settings.h"
-#include "chrome/installer/util/install_util.h"
 #include "components/breakpad/breakpad_client.h"
 #include "content/public/common/content_switches.h"
 #include "policy/policy_constants.h"
@@ -92,10 +89,6 @@
 // This is the well known SID for the system principal.
 const wchar_t kSystemPrincipalSid[] =L"S-1-5-18";
 
-// This is the minimum version of google update that is required for deferred
-// crash uploads to work.
-const char kMinUpdateVersion[] = "1.3.21.115";
-
 google_breakpad::ExceptionHandler* g_breakpad = NULL;
 google_breakpad::ExceptionHandler* g_dumphandler_no_crash = NULL;
 
@@ -357,12 +350,16 @@
 // Returns the custom info structure based on the dll in parameter and the
 // process type.
 google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path,
-                                                 const std::wstring& type,
-                                                 const std::wstring& channel) {
+                                                 const std::wstring& type) {
   base::string16 version, product;
   base::string16 special_build;
+  base::string16 channel_name;
   breakpad::GetBreakpadClient()->GetProductNameAndVersion(
-      base::FilePath(exe_path), &product, &version, &special_build);
+      base::FilePath(exe_path),
+      &product,
+      &version,
+      &special_build,
+      &channel_name);
 
   // We only expect this method to be called once per process.
   DCHECK(!g_custom_entries);
@@ -377,11 +374,10 @@
       google_breakpad::CustomInfoEntry(L"plat", L"Win32"));
   g_custom_entries->push_back(
       google_breakpad::CustomInfoEntry(L"ptype", type.c_str()));
-  g_custom_entries->push_back(
-      google_breakpad::CustomInfoEntry(L"channel", channel.c_str()));
-  g_custom_entries->push_back(
-      google_breakpad::CustomInfoEntry(L"profile-type",
-                                       GetProfileType().c_str()));
+  g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
+      L"channel", base::UTF16ToWide(channel_name).c_str()));
+  g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
+      L"profile-type", GetProfileType().c_str()));
 
   if (g_deferred_crash_uploads)
     g_custom_entries->push_back(
@@ -430,8 +426,8 @@
   // Read the id from registry. If reporting has never been enabled
   // the result will be empty string. Its OK since when user enables reporting
   // we will insert the new value at this location.
-  std::wstring guid;
-  GoogleUpdateSettings::GetMetricsId(&guid);
+  std::wstring guid =
+      base::UTF16ToWide(breakpad::GetBreakpadClient()->GetCrashGUID());
   g_client_id_offset = g_custom_entries->size();
   g_custom_entries->push_back(
       google_breakpad::CustomInfoEntry(L"guid", guid.c_str()));
@@ -771,7 +767,7 @@
 
 // Access to namespace protected functions for testing purposes.
 void InitCustomInfoEntries() {
-  GetCustomInfo(L"", L"", L"");
+  GetCustomInfo(L"", L"");
 }
 
 }  // namespace testing
@@ -849,18 +845,6 @@
   return EXCEPTION_CONTINUE_SEARCH;
 }
 
-// Check whether the installed version of google update supports deferred
-// uploads of crash reports.
-static bool DeferredUploadsSupported(bool system_install) {
-  Version update_version =
-      GoogleUpdateSettings::GetGoogleUpdateVersion(system_install);
-  if (!update_version.IsValid() ||
-      update_version.IsOlderThan(std::string(kMinUpdateVersion)))
-    return false;
-
-  return true;
-}
-
 NTSTATUS WINAPI HookNtTerminateProcess(HANDLE ProcessHandle,
                                        NTSTATUS ExitStatus) {
   if (g_breakpad &&
@@ -953,15 +937,19 @@
     // We want to use the Google Update crash reporting. We need to check if the
     // user allows it first (in case the administrator didn't already decide
     // via policy).
-    if (!controlled_by_policy)
-      crash_reporting_enabled = GoogleUpdateSettings::GetCollectStatsConsent();
+    if (!controlled_by_policy) {
+      crash_reporting_enabled =
+          breakpad::GetBreakpadClient()->GetCollectStatsConsent();
+    }
 
     if (!crash_reporting_enabled) {
       if (!controlled_by_policy &&
-          DeferredUploadsSupported(!is_per_user_install))
+          breakpad::GetBreakpadClient()->GetDeferredUploadsSupported(
+              is_per_user_install)) {
         g_deferred_crash_uploads = true;
-      else
+      } else {
         return;
+      }
     }
 
     // Build the pipe name. It can be either:
@@ -999,17 +987,14 @@
   exe_path[0] = 0;
   GetModuleFileNameW(NULL, exe_path, MAX_PATH);
 
-  bool is_per_user_install = InstallUtil::IsPerUserInstall(exe_path);
-
-  std::wstring channel_string;
-  GoogleUpdateSettings::GetChromeChannelAndModifiers(!is_per_user_install,
-                                                     &channel_string);
+  bool is_per_user_install = breakpad::GetBreakpadClient()->GetIsPerUserInstall(
+      base::FilePath(exe_path));
 
   base::debug::SetCrashKeyReportingFunctions(
       &SetCrashKeyValue, &ClearCrashKeyValue);
 
   google_breakpad::CustomClientInfo* custom_info =
-      GetCustomInfo(exe_path, process_type, channel_string);
+      GetCustomInfo(exe_path, process_type);
 
   google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL;
   LPTOP_LEVEL_EXCEPTION_FILTER default_filter = NULL;
@@ -1055,17 +1040,11 @@
 
   MINIDUMP_TYPE dump_type = kSmallDumpType;
   // Capture full memory if explicitly instructed to.
-  if (command.HasSwitch(switches::kFullMemoryCrashReport)) {
+  if (command.HasSwitch(switches::kFullMemoryCrashReport))
     dump_type = kFullDumpType;
-  } else {
-    std::wstring channel_name(
-        GoogleUpdateSettings::GetChromeChannel(!is_per_user_install));
-
-    // Capture more detail in crash dumps for beta and dev channel builds.
-    if (channel_name == L"dev" || channel_name == L"beta" ||
-        channel_name == GoogleChromeSxSDistribution::ChannelName())
-      dump_type = kLargerDumpType;
-  }
+  else if (breakpad::GetBreakpadClient()->GetShouldDumpLargerDumps(
+               is_per_user_install))
+    dump_type = kLargerDumpType;
 
   g_breakpad = new google_breakpad::ExceptionHandler(temp_dir, &FilterCallback,
                    callback, NULL,
diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc
index 00e75cc..4d0a58d 100644
--- a/chrome/app/chrome_breakpad_client.cc
+++ b/chrome/app/chrome_breakpad_client.cc
@@ -18,10 +18,15 @@
 #include "chrome/common/env_vars.h"
 
 #if defined(OS_WIN)
+#include <windows.h>
+
 #include "base/file_version_info.h"
+#include "chrome/installer/util/google_chrome_sxs_distribution.h"
+#include "chrome/installer/util/install_util.h"
 #endif
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
+#include "chrome/browser/crash_upload_list.h"
 #include "chrome/common/chrome_version_info_posix.h"
 #endif
 
@@ -29,8 +34,22 @@
 #include "chrome/common/dump_without_crashing.h"
 #endif
 
+#if defined(OS_WIN) || defined(OS_MACOSX)
+#include "chrome/installer/util/google_update_settings.h"
+#endif
+
 namespace chrome {
 
+namespace {
+
+#if defined(OS_WIN)
+// This is the minimum version of google update that is required for deferred
+// crash uploads to work.
+const char kMinUpdateVersion[] = "1.3.21.115";
+#endif
+
+}  // namespace
+
 ChromeBreakpadClient::ChromeBreakpadClient() {}
 
 ChromeBreakpadClient::~ChromeBreakpadClient() {}
@@ -54,10 +73,12 @@
     const base::FilePath& exe_path,
     base::string16* product_name,
     base::string16* version,
-    base::string16* special_build) {
+    base::string16* special_build,
+    base::string16* channel_name) {
   DCHECK(product_name);
   DCHECK(version);
   DCHECK(special_build);
+  DCHECK(channel_name);
 
   scoped_ptr<FileVersionInfo> version_info(
       FileVersionInfo::CreateFileVersionInfo(exe_path));
@@ -81,6 +102,11 @@
     *product_name = base::ASCIIToUTF16("Chrome");
     *version = base::ASCIIToUTF16("0.0.0.0-devel");
   }
+
+  std::wstring channel_string;
+  GoogleUpdateSettings::GetChromeChannelAndModifiers(
+      !GetIsPerUserInstall(exe_path), &channel_string);
+  *channel_name = base::WideToUTF16(channel_string);
 }
 
 bool ChromeBreakpadClient::ShouldShowRestartDialog(base::string16* title,
@@ -118,6 +144,39 @@
   env->SetVar(env_vars::kShowRestart, "1");
   return true;
 }
+
+base::string16 ChromeBreakpadClient::GetCrashGUID() {
+  std::wstring guid;
+  GoogleUpdateSettings::GetMetricsId(&guid);
+  return base::WideToUTF16(guid);
+}
+
+bool ChromeBreakpadClient::GetDeferredUploadsSupported(
+    bool is_per_user_install) {
+  Version update_version = GoogleUpdateSettings::GetGoogleUpdateVersion(
+      !is_per_user_install);
+  if (!update_version.IsValid() ||
+      update_version.IsOlderThan(std::string(kMinUpdateVersion)))
+    return false;
+
+  return true;
+}
+
+bool ChromeBreakpadClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
+  return InstallUtil::IsPerUserInstall(exe_path.value().c_str());
+}
+
+bool ChromeBreakpadClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
+  base::string16 channel_name(base::WideToUTF16(
+      GoogleUpdateSettings::GetChromeChannel(!is_per_user_install)));
+
+  // Capture more detail in crash dumps for beta and dev channel builds.
+  if (channel_name == base::ASCIIToUTF16("dev") ||
+      channel_name == base::ASCIIToUTF16("beta") ||
+      channel_name == GoogleChromeSxSDistribution::ChannelName())
+    return true;
+  return false;
+}
 #endif
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
@@ -139,6 +198,10 @@
 
   *version = PRODUCT_VERSION;
 }
+
+base::FilePath ChromeBreakpadClient::GetReporterLogFilename() {
+  return base::FilePath(CrashUploadList::kReporterLogFilename);
+}
 #endif
 
 bool ChromeBreakpadClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
@@ -170,4 +233,10 @@
   return env->HasVar(env_vars::kHeadless);
 }
 
+#if defined(OS_WIN) || defined(OS_MACOSX)
+bool ChromeBreakpadClient::GetCollectStatsConsent() {
+  return GoogleUpdateSettings::GetCollectStatsConsent();
+}
+#endif
+
 }  // namespace chrome
diff --git a/chrome/app/chrome_breakpad_client.h b/chrome/app/chrome_breakpad_client.h
index d9cd22e..b5fa854 100644
--- a/chrome/app/chrome_breakpad_client.h
+++ b/chrome/app/chrome_breakpad_client.h
@@ -23,16 +23,22 @@
   virtual void GetProductNameAndVersion(const base::FilePath& exe_path,
                                         base::string16* product_name,
                                         base::string16* version,
-                                        base::string16* special_build) OVERRIDE;
+                                        base::string16* special_build,
+                                        base::string16* channel_name) OVERRIDE;
   virtual bool ShouldShowRestartDialog(base::string16* title,
                                        base::string16* message,
                                        bool* is_rtl_locale) OVERRIDE;
   virtual bool AboutToRestart() OVERRIDE;
+  virtual base::string16 GetCrashGUID() OVERRIDE;
+  virtual bool GetDeferredUploadsSupported(bool is_per_user_install) OVERRIDE;
+  virtual bool GetIsPerUserInstall(const base::FilePath& exe_path) OVERRIDE;
+  virtual bool GetShouldDumpLargerDumps(bool is_per_user_install) OVERRIDE;
 #endif
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
   virtual void GetProductNameAndVersion(std::string* product_name,
                                         std::string* version) OVERRIDE;
+  virtual base::FilePath GetReporterLogFilename() OVERRIDE;
 #endif
 
   virtual bool GetCrashDumpLocation(base::FilePath* crash_dir) OVERRIDE;
@@ -45,6 +51,10 @@
 
   virtual bool IsRunningUnattended() OVERRIDE;
 
+#if defined(OS_WIN) || defined(OS_MACOSX)
+  virtual bool GetCollectStatsConsent() OVERRIDE;
+#endif
+
  private:
   DISALLOW_COPY_AND_ASSIGN(ChromeBreakpadClient);
 };
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 4077d3c..6620288 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -66,7 +66,7 @@
 
 #if !defined(DISABLE_NACL) && defined(OS_LINUX)
 #include "chrome/app/nacl_fork_delegate_linux.h"
-#include "chrome/common/nacl_paths.h"
+#include "components/nacl/common/nacl_paths.h"
 #endif
 
 #if defined(OS_CHROMEOS)
@@ -93,19 +93,19 @@
 #include "chrome/app/breakpad_linux.h"
 #endif
 
-#if !defined(CHROME_MULTIPLE_DLL) || defined(CHROME_MULTIPLE_DLL_BROWSER)
+#if !defined(CHROME_MULTIPLE_DLL_CHILD)
 base::LazyInstance<chrome::ChromeContentBrowserClient>
     g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER;
 #endif
 
-#if !defined(CHROME_MULTIPLE_DLL) || defined(CHROME_MULTIPLE_DLL_CHILD)
+#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
 base::LazyInstance<chrome::ChromeContentRendererClient>
     g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
 base::LazyInstance<chrome::ChromeContentUtilityClient>
     g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER;
 base::LazyInstance<chrome::ChromeContentPluginClient>
     g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
-#endif  // !CHROME_MULTIPLE_DLL || CHROME_MULTIPLE_DLL_CHILD
+#endif
 
 #if defined(OS_POSIX)
 base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index 59b4955..dd1c680 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -936,6 +936,9 @@
   <message name="IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SHOULD_ALWAYS_SHOW_MENU" desc="In the settings tab, the text next to the checkbox to show the accessibility tray menu regardless of the state of a11y features.">
     Show accessibility options in the system menu
   </message>
+  <message name="IDS_OPTIONS_SETTINGS_ACCESSIBILITY_STICKY_KEYS_DESCRIPTION" desc="Inthe settings tab, the text next to the checkbox for the sticky keys.">
+    Enable sticky keys (to perform keyboard shortcuts by typing them sequentially)
+  </message>
   <message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_BUTTON_LABEL" desc="Label for the button opening display settings tab.">
     Display settings
   </message>
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 712744f..4416ca6 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -273,10 +273,10 @@
         </message>
         <message name="IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_OLDER" desc="Text of Chromium Frame turndown prompt for IE 6, 7, and 8">
           This site is using the Chromium Frame plug-in which will soon be unsupported. Please uninstall it and upgrade to a modern browser.
-	</message>
+        </message>
         <message name="IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_NEWER" desc="Text of Chromium Frame turndown prompt for IE 9 and 10">
           This site is using the Chromium Frame plug-in that will soon be unsupported. Please uninstall it and download a compatible browser.
-	</message>
+        </message>
         <message name="IDS_SHORTCUT_NEW_WINDOW" desc="The text label of the New window shortcut context menu entry as of Windows 8">
           New window
         </message>
@@ -872,13 +872,13 @@
         Important information regarding your Chromium data
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_EXPLANATION" desc="The warning message displayed to an enterprise user about to link their profile to their Google account. This message is followed by a 'Learn more' link.">
-	You are signing in with a managed account and giving its administrator control over your Chromium profile. Your Chromium data, such as your apps, bookmarks, history, passwords, and other settings will become permanently tied to <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>. You will be able to delete this data via the Google Accounts Dashboard, but you will not be able to associate this data with another account.
+        You are signing in with a managed account and giving its administrator control over your Chromium profile. Your Chromium data, such as your apps, bookmarks, history, passwords, and other settings will become permanently tied to <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>. You will be able to delete this data via the Google Accounts Dashboard, but you will not be able to associate this data with another account.
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_MESSAGE" desc="The text of the prompt to create a new profile after signing into an enterprise account">
-	If you prefer to keep your existing Chromium data separate, you can create a new Chromium user for <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>.
+        If you prefer to keep your existing Chromium data separate, you can create a new Chromium user for <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>.
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CONTINUE" desc="Text of the button to link the current profile with the signed-in enterprise account">
-	Link my Chromium data to this account
+        Link my Chromium data to this account
       </message>
 
       <!-- Enterprise sign-in dialog (new-style) -->
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 4b3e91d..aadfb94 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -2890,6 +2890,10 @@
          desc="Message shown to the user to validate the download when the download content is classified as uncommon by safebrowsing.">
         <ph name="FILE_NAME">$1<ex>bla.exe</ex></ph> is not commonly downloaded and could be dangerous.
       </message>
+      <message name="IDS_PROMPT_POTENTIALLY_UNWANTED_DOWNLOAD"
+         desc="Message shown on the download shelf when the download is known to modify the browser or system settings.">
+        <ph name="FILE_NAME">$1<ex>bla.exe</ex></ph> might modify your browser or system settings.
+      </message>
       <message name="IDS_CONFIRM_KEEP_DANGEROUS_DOWNLOAD_TITLE"
                desc="Title for the confirmation dialog asking whether the user really meant to keep a dangerous download">
         Confirm Download
@@ -3519,10 +3523,10 @@
 
       <!-- Administrator-provided certificate notifications -->
       <message name="IDS_CERT_POLICY_PROVIDED_CERT_HEADER" desc="Text that is displayed in the header of the Website Settings popup when using an administrator-provided certificate">
-	Using an administrator-provided certificate
+        Using an administrator-provided certificate
       </message>
       <message name="IDS_CERT_POLICY_PROVIDED_CERT_MESSAGE" desc="Text that is displayed in the Website Settings popup when using an administrator-provided certificate">
-	You have accessed content using an administrator-provided certificate. Data you provide to <ph name="DOMAIN">$1<ex>www.google.com</ex></ph> can be intercepted by your administrator.
+        You have accessed content using an administrator-provided certificate. Data you provide to <ph name="DOMAIN">$1<ex>www.google.com</ex></ph> can be intercepted by your administrator.
       </message>
 
       <!-- Win certificate selector dialog strings.  -->
@@ -4165,7 +4169,7 @@
         Untrusted
       </message>
       <message name="IDS_CERT_MANAGER_POLICY_INSTALLED" desc="The text of the popup bubble shown when the user clicks the controlled setting indicator next to a certificate entry.">
-	This certificate has been installed by your system administrator.
+        This certificate has been installed by your system administrator.
       </message>
       <message name="IDS_CERT_MANAGER_PKCS12_IMPORT_ERROR_TITLE" desc="The title in the error dialog for PKCS #12 file import errors.">
         PKCS #12 Import Error
@@ -6954,10 +6958,10 @@
         Enable the new network configuration handlers which handle Shill connection requests without using NetworkLibrary.
       </message>
       <message name="IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_NAME" desc="Title for the flag to enable using the new network connection handler.">
-	Enables new network connection handler
+        Enables new network connection handler
       </message>
       <message name="IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_DESCRIPTION" desc="Description for the flag to enable using the new network connection handler.">
-	Enable the new network connection handler.
+        Enable the new network connection handler.
       </message>
       <message name="IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME" desc="Title for the flag to enable using the new audio handler.">
         Enables new audio handler
@@ -7196,6 +7200,12 @@
         <message name="IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION" desc="Description for the flag to switch lock animations.">
           Disables new lock animations.
         </message>
+        <message name="IDS_FLAGS_ENABLE_STICKY_KEYS_NAME" desc="Name for the flag to enable sticky keys.">
+          Enable sticky keys.
+        </message>
+        <message name="IDS_FLAGS_ENABLE_STICKY_KEYS_DESCRIPTION" desc="Description for the flag to enable sticky keys.">
+          StickyKeys allows the user to press and release a modifier key, such as Shift, Ctrl, or Alt, and have it remain active until any other key is pressed.
+        </message>
       </if>
       <message name="IDS_FLAGS_FULL_HISTORY_SYNC_NAME" desc="Name of the flag to disable full history sync.">
         Disable full history sync
@@ -7329,13 +7339,13 @@
         Specifies quality setting for images captured if scaling down.
       </message>
       <message name="IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST" desc="">
-	fast
+        fast
       </message>
       <message name="IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD" desc="">
-	good
+        good
       </message>
       <message name="IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST" desc="">
-	best
+        best
       </message>
       <message name="IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME" desc="Name of about:flags option for default tile width.">
         Default tile width
@@ -11324,13 +11334,13 @@
 
       <!-- Enterprise sign-in profile linking -->
       <message name="IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE" desc="The link to get more information about profile linking after signing into an enterprise account">
-	Learn more
+        Learn more
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE" desc="Text of the button to create a new profile after enterprise account signin">
-	Create a new user
+        Create a new user
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CANCEL" desc="Text of the button to cancel signin">
-	Cancel
+        Cancel
       </message>
 
       <!-- Enterprise sign-in profile linking -->
@@ -11923,7 +11933,7 @@
         Users
       </message>
       <message name="IDS_PROFILES_GUEST_PROFILE_NAME" desc="Name of the guest profile.">
-	Guest
+        Guest
       </message>
       <message name="IDS_PROFILES_PROFILE_GUEST_BUTTON" desc="Button in the avatar menu bubble view for guest browsing.">
         Guest browsing
@@ -12554,6 +12564,12 @@
       <message name="IDS_FLAGS_FILE_MANAGER_ENABLE_FOLDER_SHORTCUTS_DESCRIPTION" desc="Description of the about:flag option of folder shortcuts feature in Files app.">
         Enables the folder shortcuts feature in Files.app, which allows you to create shortcuts to folders in the left panel.
       </message>
+      <message name="IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION" desc="Name of the about:flag option to enable the webstore integration feature in Files app.">
+        Enable the integration of Webstore and Files.app.
+      </message>
+      <message name="IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION_DESCRIPTION" desc="Description of the about:flag option to enable the webstore integration feature in Files app.">
+        Enables the webstore integration feature in Files.app.
+      </message>
       <message name="IDS_FILE_BROWSER_ROOT_DIRECTORY_LABEL" desc="Root directory label.">
         Files
       </message>
@@ -15726,6 +15742,11 @@
       More Apps
     </message>
 
+    <!-- Synced Notification display strings -->
+    <message name="IDS_FIRST_SYNCED_NOTIFICATION_SERVICE_NAME" desc="The name of the first service source for synced notifications.">
+      Google+
+    </message>
+
     </messages>
 
     <structures fallback_to_english="true">
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index e7222d5..b9db382 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -196,10 +196,10 @@
         </message>
         <message name="IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_OLDER" desc="Text of Chrome Frame turndown prompt for IE 6, 7, and 8">
           This site is using the Chrome Frame plug-in which will soon be unsupported. Please uninstall it and upgrade to a modern browser.
-	</message>
+        </message>
         <message name="IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_NEWER" desc="Text of Chrome Frame turndown prompt for IE 9 and 10">
           This site is using the Chrome Frame plug-in that will soon be unsupported. Please uninstall it and download a compatible browser.
-	</message>
+        </message>
         <message name="IDS_SHORTCUT_NEW_WINDOW" desc="The text label of the New window shortcut context menu entry as of Windows 8">
           New window
         </message>
@@ -796,13 +796,13 @@
         Important information regarding your Chrome data
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_MESSAGE" desc="The warning message displayed to an enterprise user about to link their profile to their Google account. This message is followed by a 'Learn more' link.">
-	You are signing in with a managed account and giving its administrator control over your Google Chrome profile. Your Chrome data, such as your apps, bookmarks, history, passwords, and other settings will become permanently tied to <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>. You will be able to delete this data via the Google Accounts Dashboard, but you will not be able to associate this data with another account.
+        You are signing in with a managed account and giving its administrator control over your Google Chrome profile. Your Chrome data, such as your apps, bookmarks, history, passwords, and other settings will become permanently tied to <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>. You will be able to delete this data via the Google Accounts Dashboard, but you will not be able to associate this data with another account.
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_PROMPT" desc="The text of the prompt to create a new profile after signing into an enterprise account">
-	If you prefer to keep your existing Chrome data separate, you can create a new Chrome user for <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>.
+        If you prefer to keep your existing Chrome data separate, you can create a new Chrome user for <ph name="USER_NAME">$1<ex>pat@example.com</ex></ph>.
       </message>
       <message name="IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_NO" desc="Text of the button to link the current profile with the signed-in enterprise account">
-	Link my Chrome data to this account
+        Link my Chrome data to this account
       </message>
 
       <!-- Enterprise sign-in dialog (new-style) -->
diff --git a/chrome/app/nacl_fork_delegate_linux.cc b/chrome/app/nacl_fork_delegate_linux.cc
index 5964cfd..857c7a3 100644
--- a/chrome/app/nacl_fork_delegate_linux.cc
+++ b/chrome/app/nacl_fork_delegate_linux.cc
@@ -21,8 +21,8 @@
 #include "base/process_util.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
 #include "chrome/common/chrome_paths.h"
-#include "chrome/common/nacl_helper_linux.h"
-#include "chrome/common/nacl_paths.h"
+#include "components/nacl/common/nacl_helper_linux.h"
+#include "components/nacl/common/nacl_paths.h"
 #include "components/nacl/common/nacl_switches.h"
 
 namespace {
diff --git a/chrome/app/theme/default_100_percent/autofill_dialog_menu_button_disabled.png b/chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_disabled.png
similarity index 100%
rename from chrome/app/theme/default_100_percent/autofill_dialog_menu_button_disabled.png
rename to chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_disabled.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/autofill_dialog_menu_button_hover.png b/chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_hover.png
similarity index 100%
rename from chrome/app/theme/default_100_percent/autofill_dialog_menu_button_hover.png
rename to chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_hover.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/autofill_dialog_menu_button_normal.png b/chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_normal.png
similarity index 100%
rename from chrome/app/theme/default_100_percent/autofill_dialog_menu_button_normal.png
rename to chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_normal.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/autofill_dialog_menu_button_pressed.png b/chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_pressed.png
similarity index 100%
rename from chrome/app/theme/default_100_percent/autofill_dialog_menu_button_pressed.png
rename to chrome/app/theme/default_100_percent/common/autofill_dialog_menu_button_pressed.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/autofill_generated_card.png b/chrome/app/theme/default_100_percent/common/autofill_generated_card.png
similarity index 100%
rename from chrome/app/theme/default_100_percent/autofill_generated_card.png
rename to chrome/app/theme/default_100_percent/common/autofill_generated_card.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/autofill_tooltip_icon.png b/chrome/app/theme/default_100_percent/common/autofill_tooltip_icon.png
new file mode 100644
index 0000000..56255c7
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/autofill_tooltip_icon.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/autofill_dialog_menu_button_disabled.png b/chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_disabled.png
similarity index 100%
rename from chrome/app/theme/default_200_percent/autofill_dialog_menu_button_disabled.png
rename to chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_disabled.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/autofill_dialog_menu_button_hover.png b/chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_hover.png
similarity index 100%
rename from chrome/app/theme/default_200_percent/autofill_dialog_menu_button_hover.png
rename to chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_hover.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/autofill_dialog_menu_button_normal.png b/chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_normal.png
similarity index 100%
rename from chrome/app/theme/default_200_percent/autofill_dialog_menu_button_normal.png
rename to chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_normal.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/autofill_dialog_menu_button_pressed.png b/chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_pressed.png
similarity index 100%
rename from chrome/app/theme/default_200_percent/autofill_dialog_menu_button_pressed.png
rename to chrome/app/theme/default_200_percent/common/autofill_dialog_menu_button_pressed.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/autofill_generated_card.png b/chrome/app/theme/default_200_percent/common/autofill_generated_card.png
similarity index 100%
rename from chrome/app/theme/default_200_percent/autofill_generated_card.png
rename to chrome/app/theme/default_200_percent/common/autofill_generated_card.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/autofill_tooltip_icon.png b/chrome/app/theme/default_200_percent/common/autofill_tooltip_icon.png
new file mode 100644
index 0000000..4222858
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/autofill_tooltip_icon.png
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index eae61f9..c86a968 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -69,11 +69,12 @@
         <structure type="chrome_scaled_image" name="IDR_APP_WINDOW_MINIMIZE_P" file="win/app_window_minimize_active.png" />
       </if>
       <structure type="chrome_scaled_image" name="IDR_AUDIO_EQUALIZER_COLUMN" file="common/audio_equalizer_column.png" />
-      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON" file="autofill_dialog_menu_button_normal.png" />
-      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_P" file="autofill_dialog_menu_button_pressed.png" />
-      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_H" file="autofill_dialog_menu_button_hover.png" />
-      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_D" file="autofill_dialog_menu_button_disabled.png" />
-      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_GENERATED_CARD" file="autofill_generated_card.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON" file="common/autofill_dialog_menu_button_normal.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_P" file="common/autofill_dialog_menu_button_pressed.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_H" file="common/autofill_dialog_menu_button_hover.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_DIALOG_MENU_BUTTON_D" file="common/autofill_dialog_menu_button_disabled.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_GENERATED_CARD" file="common/autofill_generated_card.png" />
+      <structure type="chrome_scaled_image" name="IDR_AUTOFILL_TOOLTIP_ICON" file="common/autofill_tooltip_icon.png" />
       <if expr="not pp_ifdef('toolkit_views') and not is_macosx">
         <structure type="chrome_scaled_image" name="IDR_BACK" file="back.png" />
         <structure type="chrome_scaled_image" name="IDR_BACK_D" file="back_disabled.png" />
@@ -839,6 +840,7 @@
       <if expr="pp_ifdef('chromeos')">
         <structure type="chrome_scaled_image" name="IDR_TECHNICAL_ERROR" file="cros/technical_error.png" />
       </if>
+      <structure type="chrome_scaled_image" name="IDR_TEMPORARY_GOOGLE_PLUS_ICON" file="common/ic_gplus_color_16.png" />
       <structure type="chrome_scaled_image" name="IDR_THEME_BUTTON_BACKGROUND" file="notused.png" />
       <if expr="not pp_ifdef('use_ash')">
         <structure type="chrome_scaled_image" name="IDR_THEME_FRAME" file="theme_frame.png" />
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 278632f..b5c1fc7 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -105,6 +105,7 @@
   "+third_party/WebKit/public/web/WebPluginAction.h",
   "+third_party/WebKit/public/web/WebScreenInfo.h",
   "+third_party/WebKit/public/web/WebTextDirection.h",
+  "+third_party/WebKit/public/web/WebWindowFeatures.h",
 
   # These should be burned down. http://crbug.com/237267
   "!third_party/WebKit/public/web/WebView.h",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index fe000fc..ca66678 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1116,6 +1116,13 @@
     SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerEnableFolderShortcuts)
   },
   {
+    "file-manager-enable-webstore-integration",
+    IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION,
+    IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION_DESCRIPTION,
+    kOsCrOS,
+    SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerEnableWebstoreIntegration)
+  },
+  {
     "disable-quickoffice-component-app",
     IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
     IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
@@ -1578,6 +1585,13 @@
     kOsCrOS,
     SINGLE_VALUE_TYPE(switches::kEnableQuickofficeEdit),
   },
+  {
+    "enable-sticky-keys",
+    IDS_FLAGS_ENABLE_STICKY_KEYS_NAME,
+    IDS_FLAGS_ENABLE_STICKY_KEYS_DESCRIPTION,
+    kOsCrOS,
+    SINGLE_VALUE_TYPE(switches::kEnableStickyKeys),
+  },
 #endif
   {
     "enable-translate-settings",
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index b32cadc..4aeb1c1 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -31,7 +31,7 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "net/url_request/url_request_status.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -78,10 +78,7 @@
         term1_(ASCIIToUTF16("term1")),
         keyword_t_url_(NULL),
         keyword_term_(ASCIIToUTF16("keyword")),
-        ui_thread_(content::BrowserThread::UI, &message_loop_),
-        io_thread_(content::BrowserThread::IO),
-        quit_when_done_(false) {
-    io_thread_.Start();
+        run_loop_(NULL) {
   }
 
   static void SetUpTestCase();
@@ -117,9 +114,6 @@
   // If we're waiting for the provider to finish, this exits the message loop.
   virtual void OnProviderUpdate(bool updated_matches) OVERRIDE;
 
-  // Waits until the provider instantiates a URLFetcher and returns it.
-  net::TestURLFetcher* WaitUntilURLFetcherIsReady(int fetcher_id);
-
   // Runs a nested message loop until provider_ is done. The message loop is
   // exited by way of OnProviderUpdate.
   void RunTillProviderDone();
@@ -147,9 +141,7 @@
   const string16 keyword_term_;
   GURL keyword_url_;
 
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   // URLFetcherFactory implementation registered.
   net::TestURLFetcherFactory test_factory_;
@@ -160,8 +152,8 @@
   // The provider.
   scoped_refptr<SearchProvider> provider_;
 
-  // If true, OnProviderUpdate exits out of the current message loop.
-  bool quit_when_done_;
+  // If non-NULL, OnProviderUpdate quits the current |run_loop_|.
+  base::RunLoop* run_loop_;
 
   DISALLOW_COPY_AND_ASSIGN(SearchProviderTest);
 };
@@ -238,7 +230,7 @@
 }
 
 void SearchProviderTest::TearDown() {
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Shutdown the provider before the profile.
   provider_ = NULL;
@@ -273,32 +265,19 @@
 }
 
 void SearchProviderTest::OnProviderUpdate(bool updated_matches) {
-  if (quit_when_done_ && provider_->done()) {
-    quit_when_done_ = false;
-    message_loop_.Quit();
+  if (run_loop_ && provider_->done()) {
+    run_loop_->Quit();
+    run_loop_ = NULL;
   }
 }
 
-net::TestURLFetcher* SearchProviderTest::WaitUntilURLFetcherIsReady(
-    int fetcher_id) {
-  net::TestURLFetcher* url_fetcher = test_factory_.GetFetcherByID(fetcher_id);
-  for (; !url_fetcher; url_fetcher = test_factory_.GetFetcherByID(fetcher_id))
-    message_loop_.RunUntilIdle();
-  return url_fetcher;
-}
-
 void SearchProviderTest::RunTillProviderDone() {
   if (provider_->done())
     return;
 
-  quit_when_done_ = true;
-#if defined(OS_ANDROID)
-  // Android doesn't have Run(), only Start().
-  message_loop_.Start();
-#else
   base::RunLoop run_loop;
+  run_loop_ = &run_loop;
   run_loop.Run();
-#endif
 }
 
 void SearchProviderTest::QueryForInput(const string16& text,
@@ -312,7 +291,7 @@
 
   // RunUntilIdle so that the task scheduled by SearchProvider to create the
   // URLFetchers runs.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 void SearchProviderTest::QueryForInputAndSetWYTMatch(
@@ -372,8 +351,9 @@
 }
 
 void SearchProviderTest::FinishDefaultSuggestQuery() {
-  net::TestURLFetcher* default_fetcher = WaitUntilURLFetcherIsReady(
-      SearchProvider::kDefaultProviderURLFetcherID);
+  net::TestURLFetcher* default_fetcher =
+      test_factory_.GetFetcherByID(
+          SearchProvider::kDefaultProviderURLFetcherID);
   ASSERT_TRUE(default_fetcher);
 
   // Tell the SearchProvider the default suggest query is done.
@@ -1041,8 +1021,9 @@
 
   for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) {
     QueryForInput(ASCIIToUTF16("a"), false, false);
-    net::TestURLFetcher* fetcher = WaitUntilURLFetcherIsReady(
-        SearchProvider::kDefaultProviderURLFetcherID);
+    net::TestURLFetcher* fetcher =
+        test_factory_.GetFetcherByID(
+            SearchProvider::kDefaultProviderURLFetcherID);
     ASSERT_TRUE(fetcher);
     fetcher->set_response_code(200);
     fetcher->SetResponseString(cases[i].json);
@@ -1506,16 +1487,18 @@
     QueryForInput(ASCIIToUTF16("k a"), false, true);
 
     // Set up a default fetcher with no results.
-    net::TestURLFetcher* default_fetcher = WaitUntilURLFetcherIsReady(
-        SearchProvider::kDefaultProviderURLFetcherID);
+    net::TestURLFetcher* default_fetcher =
+        test_factory_.GetFetcherByID(
+            SearchProvider::kDefaultProviderURLFetcherID);
     ASSERT_TRUE(default_fetcher);
     default_fetcher->set_response_code(200);
     default_fetcher->delegate()->OnURLFetchComplete(default_fetcher);
     default_fetcher = NULL;
 
     // Set up a keyword fetcher with provided results.
-    net::TestURLFetcher* keyword_fetcher = WaitUntilURLFetcherIsReady(
-        SearchProvider::kKeywordProviderURLFetcherID);
+    net::TestURLFetcher* keyword_fetcher =
+        test_factory_.GetFetcherByID(
+            SearchProvider::kKeywordProviderURLFetcherID);
     ASSERT_TRUE(keyword_fetcher);
     keyword_fetcher->set_response_code(200);
     keyword_fetcher->SetResponseString(cases[i].json);
@@ -1626,8 +1609,9 @@
 
   for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) {
     QueryForInput(cases[i].input, false, false);
-    net::TestURLFetcher* fetcher = WaitUntilURLFetcherIsReady(
-        SearchProvider::kDefaultProviderURLFetcherID);
+    net::TestURLFetcher* fetcher =
+        test_factory_.GetFetcherByID(
+            SearchProvider::kDefaultProviderURLFetcherID);
     ASSERT_TRUE(fetcher);
     fetcher->set_response_code(200);
     fetcher->SetResponseString(cases[i].json);
@@ -1726,8 +1710,9 @@
 
   for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) {
     QueryForInput(ASCIIToUTF16(cases[i].input), false, false);
-    net::TestURLFetcher* fetcher = WaitUntilURLFetcherIsReady(
-        SearchProvider::kDefaultProviderURLFetcherID);
+    net::TestURLFetcher* fetcher =
+        test_factory_.GetFetcherByID(
+            SearchProvider::kDefaultProviderURLFetcherID);
     ASSERT_TRUE(fetcher);
     fetcher->set_response_code(200);
     fetcher->SetResponseString(cases[i].json);
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 96456e5..316ccc0 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -351,6 +351,9 @@
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
       download_danger_type_string = "DANGEROUS_HOST";
       break;
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
+      download_danger_type_string = "POTENTIALLY_UNWANTED";
+      break;
     case content::DOWNLOAD_DANGER_TYPE_MAX:
       NOTREACHED();
       download_danger_type_string = "UNKNOWN";
diff --git a/chrome/browser/automation/automation_provider_observers_chromeos.cc b/chrome/browser/automation/automation_provider_observers_chromeos.cc
index 3f973ee..ff954a9 100644
--- a/chrome/browser/automation/automation_provider_observers_chromeos.cc
+++ b/chrome/browser/automation/automation_provider_observers_chromeos.cc
@@ -64,7 +64,7 @@
       WizardController::default_controller()->current_screen()) {
     OOBEWebuiReady();
   } else {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
   }
 }
@@ -73,7 +73,7 @@
     int type,
     const content::NotificationSource& source,
     const content::NotificationDetails& details) {
-  DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE);
+  DCHECK(type == chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE);
   OOBEWebuiReady();
 }
 
diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
index b138ac7..b06f9ae 100644
--- a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/bind_helpers.h"
 #include "base/stl_util.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
@@ -29,7 +30,9 @@
 
 }  // namespace
 
-typedef testing::Test CannedBrowsingDataAppCacheHelperTest;
+class CannedBrowsingDataAppCacheHelperTest : public testing::Test {
+  content::TestBrowserThreadBundle thread_bundle_;
+};
 
 TEST_F(CannedBrowsingDataAppCacheHelperTest, SetInfo) {
   TestingProfile profile;
diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
index eb6ab9f..7e02b83 100644
--- a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
@@ -5,45 +5,20 @@
 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h"
 
 #include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "net/cookies/canonical_cookie.h"
 #include "net/cookies/parsed_cookie.h"
 #include "net/url_request/url_request_context_getter.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 namespace {
 
 class BrowsingDataCookieHelperTest : public testing::Test {
  public:
-  void SetUpOnIOThread() {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-    // This is a workaround for a bug in the TestingProfile.
-    // The URLRequestContext will be created by GetCookieMonster on the UI
-    // thread, if it does not already exist. But it must be created on the IO
-    // thread or else it will DCHECK upon destruction.
-    // Force it to be created here.
-    testing_profile_->CreateRequestContext();
-    testing_profile_->GetRequestContext()->GetURLRequestContext();
-  }
-
-  virtual void SetUp() {
-    testing_profile_.reset(new TestingProfile());
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&BrowsingDataCookieHelperTest::SetUpOnIOThread,
-                   base::Unretained(this)));
-    base::MessageLoop::current()->RunUntilIdle();
-  }
-
-  virtual void TearDown() {
-    // This must be reset before the IO thread stops, because the
-    // URLRequestContextGetter forces its own deletion to occur on that thread.
-    testing_profile_->ResetRequestContext();
+  BrowsingDataCookieHelperTest()
+      : testing_profile_(new TestingProfile()) {
   }
 
   void CreateCookiesForTest() {
@@ -83,7 +58,6 @@
     EXPECT_EQ("B", it->Name());
 
     ASSERT_TRUE(++it == cookies.end());
-    base::MessageLoop::current()->Quit();
   }
 
   void DomainCookieCallback(const net::CookieList& cookies) {
@@ -103,7 +77,6 @@
     EXPECT_EQ("2", it->Value());
 
     ASSERT_TRUE(++it == cookies.end());
-    base::MessageLoop::current()->Quit();
   }
 
   void DeleteCallback(const net::CookieList& cookies) {
@@ -115,7 +88,6 @@
     EXPECT_EQ("B", it->Name());
 
     ASSERT_TRUE(++it == cookies.end());
-    base::MessageLoop::current()->Quit();
   }
 
   void CannedUniqueCallback(const net::CookieList& cookies) {
@@ -212,9 +184,7 @@
   cookie_helper->StartFetching(
       base::Bind(&BrowsingDataCookieHelperTest::FetchCallback,
                  base::Unretained(this)));
-
-  // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified.
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(BrowsingDataCookieHelperTest, DomainCookie) {
@@ -225,9 +195,7 @@
   cookie_helper->StartFetching(
       base::Bind(&BrowsingDataCookieHelperTest::DomainCookieCallback,
                  base::Unretained(this)));
-
-  // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified.
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(BrowsingDataCookieHelperTest, DeleteCookie) {
@@ -238,9 +206,7 @@
   cookie_helper->StartFetching(
       base::Bind(&BrowsingDataCookieHelperTest::FetchCallback,
                  base::Unretained(this)));
-
-  // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified.
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   net::CanonicalCookie cookie = cookie_list_[0];
   cookie_helper->DeleteCookie(cookie);
@@ -248,7 +214,7 @@
   cookie_helper->StartFetching(
       base::Bind(&BrowsingDataCookieHelperTest::DeleteCallback,
                  base::Unretained(this)));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(BrowsingDataCookieHelperTest, CannedDomainCookie) {
diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
index 565ef8c..276cb89 100644
--- a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc
@@ -4,24 +4,14 @@
 
 #include "chrome/browser/browsing_data/browsing_data_database_helper.h"
 
-#include "base/message_loop/message_loop.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 namespace {
 
 class CannedBrowsingDataDatabaseHelperTest : public testing::Test {
- public:
-  CannedBrowsingDataDatabaseHelperTest()
-      : ui_thread_(BrowserThread::UI, &message_loop_) {
-  }
-
- protected:
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 };
 
 TEST_F(CannedBrowsingDataDatabaseHelperTest, Empty) {
diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
index 2ad644a..e9739e1 100644
--- a/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc
@@ -5,11 +5,14 @@
 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
 
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
 
-typedef testing::Test CannedBrowsingDataLocalStorageTest;
+class CannedBrowsingDataLocalStorageTest : public testing::Test {
+  content::TestBrowserThreadBundle thread_bundle_;
+};
 
 TEST_F(CannedBrowsingDataLocalStorageTest, Empty) {
   TestingProfile profile;
diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
index 3d659ce..fc758e4 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
@@ -223,7 +223,6 @@
 class RemoveProfileCookieTester : public RemoveCookieTester {
  public:
   explicit RemoveProfileCookieTester(TestingProfile* profile) {
-    profile->CreateRequestContext();
     SetMonster(profile->GetRequestContext()->GetURLRequestContext()->
         cookie_store()->GetCookieMonster());
   }
@@ -265,7 +264,6 @@
  public:
   explicit RemoveServerBoundCertTester(TestingProfile* profile)
       : ssl_config_changed_count_(0) {
-    profile->CreateRequestContext();
     server_bound_cert_service_ = profile->GetRequestContext()->
         GetURLRequestContext()->server_bound_cert_service();
     ssl_config_service_ = profile->GetSSLConfigService();
diff --git a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc
index 68db3dc..4a12c5a 100644
--- a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc
@@ -5,10 +5,10 @@
 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h"
 
 #include "base/bind.h"
-#include "base/message_loop/message_loop.h"
-#include "base/synchronization/waitable_event.h"
+#include "base/run_loop.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/ssl/server_bound_cert_service.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
@@ -24,12 +24,7 @@
   }
 
   virtual void SetUp() OVERRIDE {
-    ui_thread_.reset(new content::TestBrowserThread(BrowserThread::UI,
-                                                    &message_loop_));
-    io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO,
-                                                    &message_loop_));
     testing_profile_.reset(new TestingProfile());
-    testing_profile_->CreateRequestContext();
 
     testing_profile_->GetSSLConfigService()->AddObserver(this);
   }
@@ -57,7 +52,6 @@
       const net::ServerBoundCertStore::ServerBoundCertList& certs) {
     DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
     server_bound_cert_list_ = certs;
-    base::MessageLoop::current()->Quit();
   }
 
   // net::SSLConfigService::Observer implementation:
@@ -66,9 +60,7 @@
   }
 
  protected:
-  base::MessageLoop message_loop_;
-  scoped_ptr<content::TestBrowserThread> ui_thread_;
-  scoped_ptr<content::TestBrowserThread> io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestingProfile> testing_profile_;
 
   net::ServerBoundCertStore::ServerBoundCertList server_bound_cert_list_;
@@ -87,7 +79,7 @@
 
   // Blocks until BrowsingDataServerBoundCertHelperTest::FetchCallback is
   // notified.
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   ASSERT_EQ(2UL, server_bound_cert_list_.size());
   net::ServerBoundCertStore::ServerBoundCertList::const_iterator it =
@@ -116,7 +108,7 @@
   helper->StartFetching(
       base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback,
                  base::Unretained(this)));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(1, ssl_config_changed_count_);
   ASSERT_EQ(1UL, server_bound_cert_list_.size());
@@ -133,7 +125,8 @@
   helper->StartFetching(
       base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback,
                  base::Unretained(this)));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
+
   EXPECT_EQ(2, ssl_config_changed_count_);
   ASSERT_EQ(0UL, server_bound_cert_list_.size());
 }
@@ -155,7 +148,7 @@
   helper->StartFetching(
       base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback,
                  base::Unretained(this)));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   ASSERT_EQ(1UL, server_bound_cert_list_.size());
   net::ServerBoundCertStore::ServerBoundCert& cert =
diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
index af509bc..6b6825d 100644
--- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
+++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
@@ -47,7 +47,6 @@
 
   virtual void SetUp() OVERRIDE {
     profile_.reset(new TestingProfile());
-    profile_->CreateRequestContext();
     mock_browsing_data_cookie_helper_ =
         new MockBrowsingDataCookieHelper(profile_->GetRequestContext());
     mock_browsing_data_database_helper_ =
diff --git a/chrome/browser/captive_portal/captive_portal_detector_unittest.cc b/chrome/browser/captive_portal/captive_portal_detector_unittest.cc
index 00c2489..49bd2b9 100644
--- a/chrome/browser/captive_portal/captive_portal_detector_unittest.cc
+++ b/chrome/browser/captive_portal/captive_portal_detector_unittest.cc
@@ -6,10 +6,11 @@
 
 #include "base/basictypes.h"
 #include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/time/time.h"
 #include "chrome/browser/captive_portal/testing_utils.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/net_errors.h"
 #include "net/url_request/url_fetcher.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -72,7 +73,7 @@
                    base::Unretained(&client)));
 
     ASSERT_TRUE(FetchingURL());
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
     CompleteURLFetch(net_error, status_code, response_headers);
 
@@ -96,7 +97,7 @@
                    base::Unretained(&client)));
 
     ASSERT_TRUE(FetchingURL());
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
     detector()->Cancel();
 
@@ -105,7 +106,7 @@
   }
 
  private:
-  base::MessageLoop message_loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   // Definition order does matter.
   TestingProfile profile_;
diff --git a/chrome/browser/captive_portal/captive_portal_service_unittest.cc b/chrome/browser/captive_portal/captive_portal_service_unittest.cc
index 17cba3a..7357b22 100644
--- a/chrome/browser/captive_portal/captive_portal_service_unittest.cc
+++ b/chrome/browser/captive_portal/captive_portal_service_unittest.cc
@@ -7,8 +7,8 @@
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/message_loop/message_loop.h"
 #include "base/prefs/pref_service.h"
+#include "base/run_loop.h"
 #include "base/test/test_timeouts.h"
 #include "chrome/browser/captive_portal/testing_utils.h"
 #include "chrome/browser/chrome_notification_types.h"
@@ -20,6 +20,7 @@
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/notification_source.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/net_errors.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -167,7 +168,7 @@
     EXPECT_FALSE(FetchingURL());
     ASSERT_TRUE(TimerRunning());
 
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     EXPECT_EQ(CaptivePortalService::STATE_CHECKING_FOR_PORTAL,
               service()->state());
     ASSERT_TRUE(FetchingURL());
@@ -199,7 +200,7 @@
     EXPECT_FALSE(FetchingURL());
     ASSERT_TRUE(TimerRunning());
 
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     EXPECT_FALSE(FetchingURL());
     EXPECT_FALSE(TimerRunning());
     EXPECT_EQ(1, observer.num_results_received());
@@ -274,7 +275,7 @@
   // after the test.
   const CaptivePortalService::TestingState old_captive_portal_testing_state_;
 
-  base::MessageLoop message_loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   // Note that the construction order of these matters.
   scoped_ptr<TestingProfile> profile_;
@@ -372,7 +373,7 @@
   // Needed to create the URLFetcher, even if it never returns any results.
   service()->DetectCaptivePortal();
 
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(FetchingURL());
   EXPECT_FALSE(TimerRunning());
 
@@ -381,7 +382,7 @@
   EXPECT_TRUE(TimerRunning());
   EXPECT_EQ(0, observer.num_results_received());
 
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_FALSE(FetchingURL());
   EXPECT_FALSE(TimerRunning());
@@ -406,7 +407,7 @@
   EXPECT_TRUE(TimerRunning());
   EXPECT_EQ(0, observer.num_results_received());
 
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_FALSE(FetchingURL());
   EXPECT_FALSE(TimerRunning());
@@ -432,7 +433,7 @@
   EXPECT_FALSE(FetchingURL());
   EXPECT_TRUE(TimerRunning());
 
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(FetchingURL());
   EXPECT_FALSE(TimerRunning());
 
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index b8e5204..5d316ee 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -62,6 +62,7 @@
 #include "chrome/browser/gpu/chrome_gpu_util.h"
 #include "chrome/browser/gpu/gl_string_manager.h"
 #include "chrome/browser/jankometer.h"
+#include "chrome/browser/language_usage_metrics.h"
 #include "chrome/browser/metrics/field_trial_synchronizer.h"
 #include "chrome/browser/metrics/metrics_log.h"
 #include "chrome/browser/metrics/metrics_service.h"
@@ -186,10 +187,6 @@
 #include "chrome/browser/mac/keystone_glue.h"
 #endif
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
-#include "chrome/browser/language_usage_metrics.h"
-#endif
-
 #if defined(ENABLE_RLZ)
 #include "chrome/browser/rlz/rlz.h"
 #endif
@@ -1474,12 +1471,10 @@
   browser_process_->metrics_service()->RecordBreakpadHasDebugger(
       base::debug::BeingDebugged());
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
   LanguageUsageMetrics::RecordAcceptLanguages(
       profile_->GetPrefs()->GetString(prefs::kAcceptLanguages));
   LanguageUsageMetrics::RecordApplicationLanguage(
       browser_process_->GetApplicationLocale());
-#endif
 
   // The extension service may be available at this point. If the command line
   // specifies --uninstall-extension, attempt the uninstall extension startup
@@ -1692,11 +1687,10 @@
   for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
     chrome_extra_parts_[i]->PostMainMessageLoopRun();
 
-  // Some tests don't set parameters.ui_task, so they started translate
-  // language fetch that was never completed so we need to cleanup here
+  // TranslateManager's URL fetchers should be destructed in the main thread
   // otherwise it will be done by the destructor in a wrong thread.
-  if (parameters().ui_task == NULL && translate_manager_ != NULL)
-    translate_manager_->CleanupPendingUlrFetcher();
+  if (translate_manager_ != NULL)
+    translate_manager_->CleanupPendingUrlFetcher();
 
   if (notify_result_ == ProcessSingleton::PROCESS_NONE)
     process_singleton_->Cleanup();
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 8aa4767..a166d59 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -935,7 +935,7 @@
   if (!profile)
     return false;
 
-  if (chrome::ShouldAssignURLToInstantRenderer(effective_url, profile))
+  if (chrome::ShouldUseProcessPerSiteForInstantURL(effective_url, profile))
     return true;
 
 #if !defined(OS_CHROMEOS)
diff --git a/chrome/browser/chrome_notification_types.h b/chrome/browser/chrome_notification_types.h
index cdb907e..4967585 100644
--- a/chrome/browser/chrome_notification_types.h
+++ b/chrome/browser/chrome_notification_types.h
@@ -925,8 +925,8 @@
   // Sent when webui lock screen wallpaper is loaded and displayed.
   NOTIFICATION_LOCK_BACKGROUND_DISPLAYED,
 
-  // Sent when GAIA iframe has been loaded.
-  // First paint event after this fires NOTIFICATION_LOGIN_WEBUI_VISIBLE.
+  // Sent when GAIA iframe has been loaded. First paint event after this fires
+  // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
   // Possible scenarios:
   // 1. Boot into device that has user pods display disabled or no users.
   //    Note that booting with network not connected would first generate
@@ -942,26 +942,26 @@
   NOTIFICATION_LOGIN_WEBUI_LOADED,
 
   // Sent when the login screen has loaded in retail mode. The first paint event
-  // after this fires NOTIFICATION_LOGIN_WEBUI_VISIBLE.
+  // after this fires NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
   NOTIFICATION_DEMO_WEBUI_LOADED,
 
   // Sent when the user images on the WebUI login screen have all been loaded.
   // "Normal boot" i.e. for the device with at least one user would generate
-  // this one on boot.
-  // First paint event after this fires NOTIFICATION_LOGIN_WEBUI_VISIBLE.
+  // this one on boot. First paint event after this fires
+  // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
   NOTIFICATION_LOGIN_USER_IMAGES_LOADED,
 
   // Sent when a network error message is displayed on the WebUI login screen.
-  // First paint event of this fires NOTIFICATION_LOGIN_WEBUI_VISIBLE.
+  // First paint event of this fires NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
   NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
 
   // Sent when the first OOBE screen has been displayed. Note that the screen
-  // may not be fully rendered at this point.
-  // First paint event after this fires NOTIFICATION_LOGIN_WEBUI_VISIBLE.
+  // may not be fully rendered at this point. First paint event after this fires
+  // NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE.
   NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN,
 
-  // Sent when the specific part of login WebUI is considered to be visible.
-  // That moment is tracked as the first paint event after one of the:
+  // Sent when the specific part of login/lock WebUI is considered to be
+  // visible. That moment is tracked as the first paint event after one of the:
   // 1. NOTIFICATION_LOGIN_USER_IMAGES_LOADED
   // 2. NOTIFICATION_LOGIN_WEBUI_LOADED
   // 3. NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN
@@ -971,22 +971,22 @@
   // Possible series of notifications:
   // 1. Boot into fresh OOBE
   //    NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN
-  //    NOTIFICATION_LOGIN_WEBUI_VISIBLE
-  // 2. Boot into user pods list (normal boot)
+  //    NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
+  // 2. Boot into user pods list (normal boot). Same for lock screen.
   //    NOTIFICATION_LOGIN_USER_IMAGES_LOADED
-  //    NOTIFICATION_LOGIN_WEBUI_VISIBLE
+  //    NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
   // 3. Boot into GAIA sign in UI (user pods display disabled or no users):
   //    if no network is connected or flaky network
   //    (NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN +
-  //     NOTIFICATION_LOGIN_WEBUI_VISIBLE)
+  //     NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE)
   //    NOTIFICATION_LOGIN_WEBUI_LOADED
-  //    NOTIFICATION_LOGIN_WEBUI_VISIBLE
+  //    NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
   // 4. Boot into retail mode
   //    NOTIFICATION_DEMO_WEBUI_LOADED
-  //    NOTIFICATION_LOGIN_WEBUI_VISIBLE
+  //    NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE
   // 5. Boot into kiosk mode
   //    NOTIFICATION_KIOSK_APP_LAUNCHED
-  NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+  NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
 
   // Sent when proxy dialog is closed.
   NOTIFICATION_LOGIN_PROXY_CHANGED,
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index f6e412e..717112e 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -119,6 +119,63 @@
   std::queue<extensions::ExtensionResource> resources_;
 };
 
+void LoadChromeVoxExtension(Profile* profile, content::WebUI* login_web_ui) {
+  ExtensionService* extension_service =
+      extensions::ExtensionSystem::Get(profile)->extension_service();
+  base::FilePath path = base::FilePath(extension_misc::kChromeVoxExtensionPath);
+  std::string extension_id =
+      extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST,
+                                                 path);
+  if (login_web_ui) {
+    ExtensionService* extension_service =
+        extensions::ExtensionSystem::Get(profile)->extension_service();
+    const extensions::Extension* extension =
+        extension_service->extensions()->GetByID(extension_id);
+
+    RenderViewHost* render_view_host =
+        login_web_ui->GetWebContents()->GetRenderViewHost();
+    // Set a flag to tell ChromeVox that it's just been enabled,
+    // so that it won't interrupt our speech feedback enabled message.
+    ExtensionMsg_ExecuteCode_Params params;
+    params.request_id = 0;
+    params.extension_id = extension->id();
+    params.is_javascript = true;
+    params.code = "window.INJECTED_AFTER_LOAD = true;";
+    params.run_at = extensions::UserScript::DOCUMENT_IDLE;
+    params.all_frames = true;
+    params.in_main_world = false;
+    render_view_host->Send(new ExtensionMsg_ExecuteCode(
+        render_view_host->GetRoutingID(), params));
+
+    // Inject ChromeVox' content scripts.
+    ContentScriptLoader* loader = new ContentScriptLoader(
+        extension->id(), render_view_host->GetProcess()->GetID(),
+        render_view_host->GetRoutingID());
+
+    const extensions::UserScriptList& content_scripts =
+        extensions::ContentScriptsInfo::GetContentScripts(extension);
+    for (size_t i = 0; i < content_scripts.size(); i++) {
+      const extensions::UserScript& script = content_scripts[i];
+      for (size_t j = 0; j < script.js_scripts().size(); ++j) {
+        const extensions::UserScript::File &file = script.js_scripts()[j];
+        extensions::ExtensionResource resource = extension->GetResource(
+            file.relative_path());
+        loader->AppendScript(resource);
+      }
+    }
+    loader->Run();  // It cleans itself up when done.
+  }
+  DLOG(INFO) << "ChromeVox was Loaded.";
+}
+
+void UnloadChromeVoxExtension(Profile* profile) {
+  ExtensionService* extension_service =
+      extensions::ExtensionSystem::Get(profile)->extension_service();
+  base::FilePath path = base::FilePath(extension_misc::kChromeVoxExtensionPath);
+  extension_service->component_loader()->Remove(path);
+  DLOG(INFO) << "ChromeVox was Unloaded.";
+}
+
 }  // namespace
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -202,6 +259,8 @@
 
 AccessibilityManager::AccessibilityManager()
     : profile_(NULL),
+      chrome_vox_loaded_on_lock_screen_(false),
+      chrome_vox_loaded_on_user_screen_(false),
       large_cursor_pref_handler_(prefs::kLargeCursorEnabled),
       spoken_feedback_pref_handler_(prefs::kSpokenFeedbackEnabled),
       high_contrast_pref_handler_(prefs::kHighContrastEnabled),
@@ -210,8 +269,9 @@
       spoken_feedback_enabled_(false),
       high_contrast_enabled_(false),
       spoken_feedback_notification_(ash::A11Y_NOTIFICATION_NONE) {
+
   notification_registrar_.Add(this,
-                              chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                              chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                               content::NotificationService::AllSources());
   notification_registrar_.Add(this,
                               chrome::NOTIFICATION_SESSION_STARTED,
@@ -219,6 +279,9 @@
   notification_registrar_.Add(this,
                               chrome::NOTIFICATION_PROFILE_DESTROYED,
                               content::NotificationService::AllSources());
+  notification_registrar_.Add(this,
+                              chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
+                              content::NotificationService::AllSources());
 }
 
 AccessibilityManager::~AccessibilityManager() {
@@ -333,74 +396,77 @@
       enabled ? IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_ENABLED :
       IDS_CHROMEOS_ACC_SPOKEN_FEEDBACK_DISABLED).c_str());
 
-  // Determine whether an OOBE screen or the screen locker is currently being
-  // shown. If so, ChromeVox will be injected directly into that screen.
+  if (enabled)
+    LoadChromeVox();
+  else
+    UnloadChromeVox();
+}
+
+void AccessibilityManager::LoadChromeVox() {
+  ScreenLocker* screen_locker = ScreenLocker::default_screen_locker();
+  if (screen_locker && screen_locker->locked()) {
+    // If on the lock screen, loads ChromeVox only to the lock screen as for
+    // now. On unlock, it will be loaded to the user screen.
+    // (see. AccessibilityManager::Observe())
+    LoadChromeVoxToLockScreen();
+    return;
+  }
+
+  LoadChromeVoxToUserScreen();
+}
+
+void AccessibilityManager::LoadChromeVoxToUserScreen() {
+  if (chrome_vox_loaded_on_user_screen_)
+    return;
+
+  // Determine whether an OOBE screen is currently being shown. If so,
+  // ChromeVox will be injected directly into that screen.
   content::WebUI* login_web_ui = NULL;
-  LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host();
-  if (login_display_host) {
-    WebUILoginView* web_ui_login_view = login_display_host->GetWebUILoginView();
-    if (web_ui_login_view)
-      login_web_ui = web_ui_login_view->GetWebUI();
-  }
-  if (!login_web_ui) {
-    ScreenLocker* screen_locker = ScreenLocker::default_screen_locker();
-    if (screen_locker && screen_locker->locked())
-      login_web_ui = screen_locker->GetAssociatedWebUI();
-  }
 
-  // Load/Unload ChromeVox
-  Profile* profile = login_web_ui ? Profile::FromWebUI(login_web_ui) :
-                                    ProfileManager::GetDefaultProfile();
-  ExtensionService* extension_service =
-      extensions::ExtensionSystem::Get(profile)->extension_service();
-  base::FilePath path = base::FilePath(extension_misc::kChromeVoxExtensionPath);
-  if (enabled) {  // Load ChromeVox
-    std::string extension_id =
-        extension_service->component_loader()->Add(IDR_CHROMEVOX_MANIFEST,
-                                                   path);
-    const extensions::Extension* extension =
-        extension_service->extensions()->GetByID(extension_id);
-
-    if (login_web_ui) {
-      RenderViewHost* render_view_host =
-          login_web_ui->GetWebContents()->GetRenderViewHost();
-      // Set a flag to tell ChromeVox that it's just been enabled,
-      // so that it won't interrupt our speech feedback enabled message.
-      ExtensionMsg_ExecuteCode_Params params;
-      params.request_id = 0;
-      params.extension_id = extension->id();
-      params.is_javascript = true;
-      params.code = "window.INJECTED_AFTER_LOAD = true;";
-      params.run_at = extensions::UserScript::DOCUMENT_IDLE;
-      params.all_frames = true;
-      params.in_main_world = false;
-      render_view_host->Send(new ExtensionMsg_ExecuteCode(
-          render_view_host->GetRoutingID(), params));
-
-      // Inject ChromeVox' content scripts.
-      ContentScriptLoader* loader = new ContentScriptLoader(
-          extension->id(), render_view_host->GetProcess()->GetID(),
-          render_view_host->GetRoutingID());
-
-      const extensions::UserScriptList& content_scripts =
-          extensions::ContentScriptsInfo::GetContentScripts(extension);
-      for (size_t i = 0; i < content_scripts.size(); i++) {
-        const extensions::UserScript& script = content_scripts[i];
-        for (size_t j = 0; j < script.js_scripts().size(); ++j) {
-          const extensions::UserScript::File &file = script.js_scripts()[j];
-          extensions::ExtensionResource resource = extension->GetResource(
-              file.relative_path());
-          loader->AppendScript(resource);
-        }
-      }
-      loader->Run();  // It cleans itself up when done.
+  if (ProfileHelper::IsSigninProfile(profile_)) {
+    LoginDisplayHost* login_display_host = LoginDisplayHostImpl::default_host();
+    if (login_display_host) {
+      WebUILoginView* web_ui_login_view =
+          login_display_host->GetWebUILoginView();
+      if (web_ui_login_view)
+        login_web_ui = web_ui_login_view->GetWebUI();
     }
-
-    DLOG(INFO) << "ChromeVox was Loaded.";
-  } else {  // Unload ChromeVox
-    extension_service->component_loader()->Remove(path);
-    DLOG(INFO) << "ChromeVox was Unloaded.";
   }
+
+  LoadChromeVoxExtension(profile_, login_web_ui);
+  chrome_vox_loaded_on_user_screen_ = true;
+}
+
+void AccessibilityManager::LoadChromeVoxToLockScreen() {
+  if (chrome_vox_loaded_on_lock_screen_)
+    return;
+
+  ScreenLocker* screen_locker = ScreenLocker::default_screen_locker();
+  if (screen_locker && screen_locker->locked()) {
+    content::WebUI* lock_web_ui = screen_locker->GetAssociatedWebUI();
+    if (lock_web_ui) {
+      Profile* profile = Profile::FromWebUI(lock_web_ui);
+      LoadChromeVoxExtension(profile, lock_web_ui);
+      chrome_vox_loaded_on_lock_screen_ = true;
+    }
+  }
+}
+
+void AccessibilityManager::UnloadChromeVox() {
+  if (chrome_vox_loaded_on_lock_screen_)
+    UnloadChromeVoxFromLockScreen();
+
+  if (chrome_vox_loaded_on_user_screen_) {
+    UnloadChromeVoxExtension(profile_);
+    chrome_vox_loaded_on_user_screen_ = false;
+  }
+}
+
+void AccessibilityManager::UnloadChromeVoxFromLockScreen() {
+  // Lock screen uses the signin progile.
+  Profile* signin_profile = ProfileHelper::GetSigninProfile();
+  UnloadChromeVoxExtension(signin_profile);
+  chrome_vox_loaded_on_lock_screen_ = false;
 }
 
 bool AccessibilityManager::IsSpokenFeedbackEnabled() {
@@ -564,7 +630,7 @@
     const content::NotificationSource& source,
     const content::NotificationDetails& details) {
   switch (type) {
-    case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: {
+    case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
       // Update |profile_| when entering the login screen.
       Profile* profile = ProfileManager::GetDefaultProfile();
       if (ProfileHelper::IsSigninProfile(profile))
@@ -582,6 +648,18 @@
         SetProfile(NULL);
       break;
     }
+    case chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED: {
+      bool is_screen_locked = *content::Details<bool>(details).ptr();
+      if (is_screen_locked) {
+        if (spoken_feedback_enabled_)
+          LoadChromeVoxToLockScreen();
+      } else {
+        UnloadChromeVoxFromLockScreen();
+
+        if (spoken_feedback_enabled_)
+          LoadChromeVoxToUserScreen();
+      }
+    }
   }
 }
 
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.h b/chrome/browser/chromeos/accessibility/accessibility_manager.h
index cedfab6..c582130 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.h
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.h
@@ -101,6 +101,12 @@
   virtual ~AccessibilityManager();
 
  private:
+  void LoadChromeVox();
+  void LoadChromeVoxToUserScreen();
+  void LoadChromeVoxToLockScreen();
+  void UnloadChromeVox();
+  void UnloadChromeVoxFromLockScreen();
+
   void UpdateLargeCursorFromPref();
   void UpdateStickyKeysFromPref();
   void UpdateSpokenFeedbackFromPref();
@@ -116,7 +122,14 @@
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE;
 
+  // Profile which has the current a11y context.
   Profile* profile_;
+
+  // Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not
+  // loaded to any profile.
+  bool chrome_vox_loaded_on_lock_screen_;
+  bool chrome_vox_loaded_on_user_screen_;
+
   content::NotificationRegistrar notification_registrar_;
   scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
   scoped_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_;
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager.cc b/chrome/browser/chromeos/accessibility/magnification_manager.cc
index b4b3bcb..3051908 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -46,7 +46,7 @@
         type_(ash::kDefaultMagnifierType),
         enabled_(false) {
     registrar_.Add(this,
-                   chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                   chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
     registrar_.Add(this,
                    chrome::NOTIFICATION_SESSION_STARTED,
@@ -199,7 +199,7 @@
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE {
     switch (type) {
-      case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: {
+      case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
         // Update |profile_| when entering the login screen.
         Profile* profile = ProfileManager::GetDefaultProfile();
         if (ProfileHelper::IsSigninProfile(profile))
diff --git a/chrome/browser/chromeos/drive/async_file_util.cc b/chrome/browser/chromeos/drive/async_file_util.cc
index e385033..a2b0e88 100644
--- a/chrome/browser/chromeos/drive/async_file_util.cc
+++ b/chrome/browser/chromeos/drive/async_file_util.cc
@@ -50,7 +50,8 @@
     const base::FilePath& file_path,
     const AsyncFileUtil::CreateOrOpenCallback& callback,
     base::PlatformFileError error,
-    base::PlatformFile file) {
+    base::PlatformFile file,
+    const base::Closure& close_callback_on_ui_thread) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
 
   // It is necessary to make a closure, which runs on file closing here.
@@ -58,10 +59,9 @@
   // (crbug.com/259184).
   callback.Run(
       error, base::PassPlatformFile(&file),
-      base::Bind(&PostFileSystemCallback,
-                 file_system_getter,
-                 base::Bind(&fileapi_internal::CloseFile, file_path),
-                 base::Closure()));
+      base::Bind(&google_apis::RunTaskOnThread,
+                 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
+                 close_callback_on_ui_thread));
 }
 
 // Runs CreateOrOpenFile when the error happens.
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc
index 6ae980a..1af4edc 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.cc
+++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -252,6 +252,9 @@
 }
 
 void DriveIntegrationService::OnPushNotificationEnabled(bool enabled) {
+  if (enabled)
+    drive_app_registry_->Update();
+
   const char* status = (enabled ? "enabled" : "disabled");
   util::Log("Push notification is %s", status);
 }
@@ -368,9 +371,11 @@
         drive_notification_manager->push_notification_registered();
     const char* status = (registered ? "registered" : "not registered");
     util::Log("Push notification is %s", status);
+
+    if (drive_notification_manager->push_notification_enabled())
+      drive_app_registry_->Update();
   }
 
-  drive_app_registry_->Update();
   AddDriveMountPoint();
 }
 
diff --git a/chrome/browser/chromeos/drive/dummy_file_system.h b/chrome/browser/chromeos/drive/dummy_file_system.h
index e9b95b5..92e546f 100644
--- a/chrome/browser/chromeos/drive/dummy_file_system.h
+++ b/chrome/browser/chromeos/drive/dummy_file_system.h
@@ -28,8 +28,6 @@
   virtual void OpenFile(const base::FilePath& file_path,
                         OpenMode open_mode,
                         const OpenFileCallback& callback) OVERRIDE {}
-  virtual void CloseFile(const base::FilePath& file_path,
-                         const FileOperationCallback& callback) OVERRIDE {}
   virtual void Copy(const base::FilePath& src_file_path,
                     const base::FilePath& dest_file_path,
                     const FileOperationCallback& callback) OVERRIDE {}
@@ -85,7 +83,7 @@
       const GetFilesystemMetadataCallback& callback) OVERRIDE {}
   virtual void MarkCacheFileAsMounted(
       const base::FilePath& drive_file_path,
-      const OpenFileCallback& callback) OVERRIDE {}
+      const MarkMountedCallback& callback) OVERRIDE {}
   virtual void MarkCacheFileAsUnmounted(
       const base::FilePath& cache_file_path,
       const FileOperationCallback& callback) OVERRIDE {}
diff --git a/chrome/browser/chromeos/drive/fake_file_system.cc b/chrome/browser/chromeos/drive/fake_file_system.cc
index 7f49b9c..234aadb 100644
--- a/chrome/browser/chromeos/drive/fake_file_system.cc
+++ b/chrome/browser/chromeos/drive/fake_file_system.cc
@@ -74,11 +74,6 @@
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 }
 
-void FakeFileSystem::CloseFile(const base::FilePath& file_path,
-                               const FileOperationCallback& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-}
-
 void FakeFileSystem::Copy(const base::FilePath& src_file_path,
                           const base::FilePath& dest_file_path,
                           const FileOperationCallback& callback) {
@@ -210,7 +205,7 @@
 
 void FakeFileSystem::MarkCacheFileAsMounted(
     const base::FilePath& drive_file_path,
-    const OpenFileCallback& callback) {
+    const MarkMountedCallback& callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 }
 
diff --git a/chrome/browser/chromeos/drive/fake_file_system.h b/chrome/browser/chromeos/drive/fake_file_system.h
index 501cf14..c1320ad 100644
--- a/chrome/browser/chromeos/drive/fake_file_system.h
+++ b/chrome/browser/chromeos/drive/fake_file_system.h
@@ -62,8 +62,6 @@
   virtual void OpenFile(const base::FilePath& file_path,
                         OpenMode open_mode,
                         const OpenFileCallback& callback) OVERRIDE;
-  virtual void CloseFile(const base::FilePath& file_path,
-                         const FileOperationCallback& callback) OVERRIDE;
   virtual void Copy(const base::FilePath& src_file_path,
                     const base::FilePath& dest_file_path,
                     const FileOperationCallback& callback) OVERRIDE;
@@ -117,7 +115,7 @@
       const GetFilesystemMetadataCallback& callback) OVERRIDE;
   virtual void MarkCacheFileAsMounted(
       const base::FilePath& drive_file_path,
-      const OpenFileCallback& callback) OVERRIDE;
+      const MarkMountedCallback& callback) OVERRIDE;
   virtual void MarkCacheFileAsUnmounted(
       const base::FilePath& cache_file_path,
       const FileOperationCallback& callback) OVERRIDE;
diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc
index 4909ccd..b3b22b5 100644
--- a/chrome/browser/chromeos/drive/file_system.cc
+++ b/chrome/browser/chromeos/drive/file_system.cc
@@ -16,7 +16,6 @@
 #include "chrome/browser/chromeos/drive/change_list_processor.h"
 #include "chrome/browser/chromeos/drive/drive.pb.h"
 #include "chrome/browser/chromeos/drive/file_cache.h"
-#include "chrome/browser/chromeos/drive/file_system/close_file_operation.h"
 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h"
 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
@@ -105,11 +104,6 @@
   SetupChangeListLoader();
 
   file_system::OperationObserver* observer = this;
-  close_file_operation_.reset(
-      new file_system::CloseFileOperation(blocking_task_runner_.get(),
-                                          observer,
-                                          resource_metadata_,
-                                          &open_files_));
   copy_operation_.reset(
       new file_system::CopyOperation(blocking_task_runner_.get(),
                                      observer,
@@ -134,8 +128,7 @@
                                          scheduler_,
                                          resource_metadata_,
                                          cache_,
-                                         temporary_file_directory_,
-                                         &open_files_));
+                                         temporary_file_directory_));
   remove_operation_.reset(
       new file_system::RemoveOperation(blocking_task_runner_.get(),
                                        observer,
@@ -755,7 +748,7 @@
 
 void FileSystem::MarkCacheFileAsMounted(
     const base::FilePath& drive_file_path,
-    const OpenFileCallback& callback) {
+    const MarkMountedCallback& callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(!callback.is_null());
 
@@ -766,7 +759,7 @@
 }
 
 void FileSystem::MarkCacheFileAsMountedAfterGetResourceEntry(
-    const OpenFileCallback& callback,
+    const MarkMountedCallback& callback,
     FileError error,
     scoped_ptr<ResourceEntry> entry) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -846,14 +839,6 @@
   open_file_operation_->OpenFile(file_path, open_mode, callback);
 }
 
-void FileSystem::CloseFile(const base::FilePath& file_path,
-                           const FileOperationCallback& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  DCHECK(!callback.is_null());
-
-  close_file_operation_->CloseFile(file_path, callback);
-}
-
 void FileSystem::CheckLocalModificationAndRun(
     scoped_ptr<ResourceEntry> entry,
     const GetResourceEntryCallback& callback) {
diff --git a/chrome/browser/chromeos/drive/file_system.h b/chrome/browser/chromeos/drive/file_system.h
index 2b469cc..351f637 100644
--- a/chrome/browser/chromeos/drive/file_system.h
+++ b/chrome/browser/chromeos/drive/file_system.h
@@ -43,7 +43,6 @@
 }  // namespace internal
 
 namespace file_system {
-class CloseFileOperation;
 class CopyOperation;
 class CreateDirectoryOperation;
 class CreateFileOperation;
@@ -95,8 +94,6 @@
   virtual void OpenFile(const base::FilePath& file_path,
                         OpenMode open_mode,
                         const OpenFileCallback& callback) OVERRIDE;
-  virtual void CloseFile(const base::FilePath& file_path,
-                         const FileOperationCallback& callback) OVERRIDE;
   virtual void Copy(const base::FilePath& src_file_path,
                     const base::FilePath& dest_file_path,
                     const FileOperationCallback& callback) OVERRIDE;
@@ -143,7 +140,7 @@
       const GetFilesystemMetadataCallback& callback) OVERRIDE;
   virtual void MarkCacheFileAsMounted(
       const base::FilePath& drive_file_path,
-      const OpenFileCallback& callback) OVERRIDE;
+      const MarkMountedCallback& callback) OVERRIDE;
   virtual void MarkCacheFileAsUnmounted(
       const base::FilePath& cache_file_path,
       const FileOperationCallback& callback) OVERRIDE;
@@ -291,7 +288,7 @@
   // Part of MarkCacheFileAsMounted. Called after GetResourceEntryByPath is
   // completed. |callback| must not be null.
   void MarkCacheFileAsMountedAfterGetResourceEntry(
-      const OpenFileCallback& callback,
+      const MarkMountedCallback& callback,
       FileError error,
       scoped_ptr<ResourceEntry> entry);
 
@@ -313,10 +310,6 @@
   // True if hosted documents should be hidden.
   bool hide_hosted_docs_;
 
-  // Map from opened file paths to the number how many the file is opened.
-  // The value should be incremented by OpenFile, and decremented by CloseFile.
-  std::map<base::FilePath, int> open_files_;
-
   scoped_ptr<PrefChangeRegistrar> pref_registrar_;
 
   scoped_ptr<internal::SyncClient> sync_client_;
@@ -331,7 +324,6 @@
   base::FilePath temporary_file_directory_;
 
   // Implementation of each file system operation.
-  scoped_ptr<file_system::CloseFileOperation> close_file_operation_;
   scoped_ptr<file_system::CopyOperation> copy_operation_;
   scoped_ptr<file_system::CreateDirectoryOperation> create_directory_operation_;
   scoped_ptr<file_system::CreateFileOperation> create_file_operation_;
diff --git a/chrome/browser/chromeos/drive/file_system/close_file_operation.cc b/chrome/browser/chromeos/drive/file_system/close_file_operation.cc
deleted file mode 100644
index dfd2a55..0000000
--- a/chrome/browser/chromeos/drive/file_system/close_file_operation.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/drive/file_system/close_file_operation.h"
-
-#include "base/logging.h"
-#include "base/message_loop/message_loop_proxy.h"
-#include "base/sequenced_task_runner.h"
-#include "chrome/browser/chromeos/drive/drive.pb.h"
-#include "chrome/browser/chromeos/drive/file_errors.h"
-#include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
-#include "chrome/browser/chromeos/drive/resource_metadata.h"
-#include "content/public/browser/browser_thread.h"
-
-using content::BrowserThread;
-
-namespace drive {
-namespace file_system {
-
-CloseFileOperation::CloseFileOperation(
-    base::SequencedTaskRunner* blocking_task_runner,
-    OperationObserver* observer,
-    internal::ResourceMetadata* metadata,
-    std::map<base::FilePath, int>* open_files)
-    : blocking_task_runner_(blocking_task_runner),
-      observer_(observer),
-      metadata_(metadata),
-      open_files_(open_files),
-      weak_ptr_factory_(this) {
-}
-
-CloseFileOperation::~CloseFileOperation() {
-}
-
-void CloseFileOperation::CloseFile(const base::FilePath& file_path,
-                                   const FileOperationCallback& callback) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  DCHECK(!callback.is_null());
-
-  if (open_files_->find(file_path) == open_files_->end()) {
-    // The file is not being opened.
-    base::MessageLoopProxy::current()->PostTask(
-        FROM_HERE, base::Bind(callback, FILE_ERROR_NOT_FOUND));
-    return;
-  }
-
-  ResourceEntry* entry = new ResourceEntry;
-  base::PostTaskAndReplyWithResult(
-      blocking_task_runner_.get(),
-      FROM_HERE,
-      base::Bind(&internal::ResourceMetadata::GetResourceEntryByPath,
-                 base::Unretained(metadata_), file_path, entry),
-      base::Bind(&CloseFileOperation::CloseFileAfterGetResourceEntry,
-                 weak_ptr_factory_.GetWeakPtr(),
-                 file_path, callback, base::Owned(entry)));
-}
-
-void CloseFileOperation::CloseFileAfterGetResourceEntry(
-    const base::FilePath& file_path,
-    const FileOperationCallback& callback,
-    const ResourceEntry* entry,
-    FileError error) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  DCHECK(!callback.is_null());
-  DCHECK(entry);
-
-  if (error == FILE_ERROR_OK && entry->file_info().is_directory())
-    error = FILE_ERROR_NOT_FOUND;
-
-  DCHECK_GT((*open_files_)[file_path], 0);
-  if (--(*open_files_)[file_path] == 0) {
-    // All clients closes this file, so notify to upload the file.
-    open_files_->erase(file_path);
-    observer_->OnCacheFileUploadNeededByOperation(entry->resource_id());
-  }
-
-  // Then invokes the user-supplied callback function.
-  callback.Run(error);
-}
-
-}  // namespace file_system
-}  // namespace drive
diff --git a/chrome/browser/chromeos/drive/file_system/close_file_operation.h b/chrome/browser/chromeos/drive/file_system/close_file_operation.h
deleted file mode 100644
index 005c9cf..0000000
--- a/chrome/browser/chromeos/drive/file_system/close_file_operation.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_CLOSE_FILE_OPERATION_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_CLOSE_FILE_OPERATION_H_
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "chrome/browser/chromeos/drive/file_errors.h"
-
-namespace base {
-class FilePath;
-class SequencedTaskRunner;
-}  // namespace base
-
-namespace drive {
-
-class ResourceEntry;
-
-namespace internal {
-class ResourceMetadata;
-}  // namespace internal
-
-namespace file_system {
-
-class OperationObserver;
-
-class CloseFileOperation {
- public:
-  CloseFileOperation(base::SequencedTaskRunner* blocking_task_runner,
-                     OperationObserver* observer,
-                     internal::ResourceMetadata* metadata,
-                     std::map<base::FilePath, int>* open_files);
-  ~CloseFileOperation();
-
-  // Closes the currently opened file |file_path|.
-  // |callback| must not be null.
-  void CloseFile(const base::FilePath& file_path,
-                 const FileOperationCallback& callback);
-
- private:
-  // Part of CloseFile(). Called after ResourceMetadata::GetResourceEntry().
-  void CloseFileAfterGetResourceEntry(const base::FilePath& file_path,
-                                      const FileOperationCallback& callback,
-                                      const ResourceEntry* entry,
-                                      FileError error);
-
-  scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
-  OperationObserver* observer_;
-  internal::ResourceMetadata* metadata_;
-
-  // The map from paths for opened file to the number how many the file is
-  // opened. The instance is owned by FileSystem and shared with
-  // OpenFileOperation.
-  std::map<base::FilePath, int>* open_files_;
-
-  // Note: This should remain the last member so it'll be destroyed and
-  // invalidate its weak pointers before any other members are destroyed.
-  base::WeakPtrFactory<CloseFileOperation> weak_ptr_factory_;
-  DISALLOW_COPY_AND_ASSIGN(CloseFileOperation);
-};
-
-}  // namespace file_system
-}  // namespace drive
-
-#endif  // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_CLOSE_FILE_OPERATION_H_
diff --git a/chrome/browser/chromeos/drive/file_system/close_file_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/close_file_operation_unittest.cc
deleted file mode 100644
index 2fe4d88..0000000
--- a/chrome/browser/chromeos/drive/file_system/close_file_operation_unittest.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/drive/file_system/close_file_operation.h"
-
-#include <set>
-
-#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/chromeos/drive/drive.pb.h"
-#include "chrome/browser/chromeos/drive/file_errors.h"
-#include "chrome/browser/chromeos/drive/file_system/operation_test_base.h"
-#include "chrome/browser/google_apis/test_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace drive {
-namespace file_system {
-
-class CloseFileOperationTest : public OperationTestBase {
- protected:
-  virtual void SetUp() {
-    OperationTestBase::SetUp();
-
-    operation_.reset(new CloseFileOperation(
-        blocking_task_runner(), observer(), metadata(), &open_files_));
-  }
-
-  std::map<base::FilePath, int> open_files_;
-  scoped_ptr<CloseFileOperation> operation_;
-};
-
-TEST_F(CloseFileOperationTest, CloseFile) {
-  base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt"));
-  ResourceEntry src_entry;
-  ASSERT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(file_in_root, &src_entry));
-
-  open_files_[file_in_root] = 1;
-  FileError error = FILE_ERROR_FAILED;
-  operation_->CloseFile(
-      file_in_root,
-      google_apis::test_util::CreateCopyResultCallback(&error));
-  test_util::RunBlockingPoolTask();
-
-  EXPECT_EQ(FILE_ERROR_OK, error);
-  EXPECT_TRUE(open_files_.empty());
-  EXPECT_EQ(
-      1U,
-      observer()->upload_needed_resource_ids().count(src_entry.resource_id()));
-}
-
-TEST_F(CloseFileOperationTest, NotOpenedFile) {
-  base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt"));
-  ResourceEntry src_entry;
-  ASSERT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(file_in_root, &src_entry));
-
-  FileError error = FILE_ERROR_FAILED;
-  operation_->CloseFile(
-      file_in_root,
-      google_apis::test_util::CreateCopyResultCallback(&error));
-  test_util::RunBlockingPoolTask();
-
-  // Even if the file is actually exists, NOT_FOUND should be returned if the
-  // file is not opened.
-  EXPECT_EQ(FILE_ERROR_NOT_FOUND, error);
-}
-
-TEST_F(CloseFileOperationTest, CloseFileTwice) {
-  base::FilePath file_in_root(FILE_PATH_LITERAL("drive/root/File 1.txt"));
-  ResourceEntry src_entry;
-  ASSERT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(file_in_root, &src_entry));
-
-  // Set the number of opening clients is two.
-  open_files_[file_in_root] = 2;
-
-  // The first CloseFile.
-  FileError error = FILE_ERROR_FAILED;
-  operation_->CloseFile(
-      file_in_root,
-      google_apis::test_util::CreateCopyResultCallback(&error));
-  test_util::RunBlockingPoolTask();
-
-  EXPECT_EQ(FILE_ERROR_OK, error);
-  EXPECT_EQ(1, open_files_[file_in_root]);
-
-  // There still remains a client opening the file, so it shouldn't be
-  // uploaded yet.
-  EXPECT_TRUE(observer()->upload_needed_resource_ids().empty());
-
-  // The second CloseFile.
-  operation_->CloseFile(
-      file_in_root,
-      google_apis::test_util::CreateCopyResultCallback(&error));
-  test_util::RunBlockingPoolTask();
-
-  EXPECT_EQ(FILE_ERROR_OK, error);
-  EXPECT_TRUE(open_files_.empty());
-  // Here, all the clients close the file, so it should be uploaded then.
-  EXPECT_EQ(
-      1U,
-      observer()->upload_needed_resource_ids().count(src_entry.resource_id()));
-}
-
-}  // namespace file_system
-}  // namespace drive
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation.cc b/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
index e5a1bfa..4a49830 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
@@ -14,6 +14,7 @@
 #include "chrome/browser/chromeos/drive/file_errors.h"
 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
 #include "chrome/browser/chromeos/drive/file_system/download_operation.h"
+#include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
 #include "chrome/browser/chromeos/drive/file_system_interface.h"
 #include "content/public/browser/browser_thread.h"
 
@@ -42,18 +43,16 @@
     JobScheduler* scheduler,
     internal::ResourceMetadata* metadata,
     internal::FileCache* cache,
-    const base::FilePath& temporary_file_directory,
-    std::map<base::FilePath, int>* open_files)
+    const base::FilePath& temporary_file_directory)
     : blocking_task_runner_(blocking_task_runner),
+      observer_(observer),
       cache_(cache),
       create_file_operation_(new CreateFileOperation(
           blocking_task_runner, observer, scheduler, metadata, cache)),
       download_operation_(new DownloadOperation(
           blocking_task_runner, observer, scheduler,
           metadata, cache, temporary_file_directory)),
-      open_files_(open_files),
       weak_ptr_factory_(this) {
-  DCHECK(open_files);
 }
 
 OpenFileOperation::~OpenFileOperation() {
@@ -97,7 +96,7 @@
   DCHECK(!callback.is_null());
 
   if (error != FILE_ERROR_OK) {
-    callback.Run(error, base::FilePath());
+    callback.Run(error, base::FilePath(), base::Closure());
     return;
   }
 
@@ -108,11 +107,10 @@
       google_apis::GetContentCallback(),
       base::Bind(
           &OpenFileOperation::OpenFileAfterFileDownloaded,
-          weak_ptr_factory_.GetWeakPtr(), file_path, callback));
+          weak_ptr_factory_.GetWeakPtr(), callback));
 }
 
 void OpenFileOperation::OpenFileAfterFileDownloaded(
-    const base::FilePath& file_path,
     const OpenFileCallback& callback,
     FileError error,
     const base::FilePath& local_file_path,
@@ -129,7 +127,7 @@
   }
 
   if (error != FILE_ERROR_OK) {
-    callback.Run(error, base::FilePath());
+    callback.Run(error, base::FilePath(), base::Closure());
     return;
   }
 
@@ -146,22 +144,39 @@
                  new_local_file_path),
       base::Bind(&OpenFileOperation::OpenFileAfterUpdateLocalState,
                  weak_ptr_factory_.GetWeakPtr(),
-                 file_path,
+                 entry->resource_id(),
                  callback,
                  base::Owned(new_local_file_path)));
 }
 
 void OpenFileOperation::OpenFileAfterUpdateLocalState(
-    const base::FilePath& file_path,
+    const std::string& resource_id,
     const OpenFileCallback& callback,
     const base::FilePath* local_file_path,
     FileError error) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(!callback.is_null());
 
-  if (error == FILE_ERROR_OK)
-    ++(*open_files_)[file_path];
-  callback.Run(error, *local_file_path);
+  if (error != FILE_ERROR_OK) {
+    callback.Run(error, base::FilePath(), base::Closure());
+    return;
+  }
+
+  ++open_files_[resource_id];
+  callback.Run(error, *local_file_path,
+               base::Bind(&OpenFileOperation::CloseFile,
+                          weak_ptr_factory_.GetWeakPtr(), resource_id));
+}
+
+void OpenFileOperation::CloseFile(const std::string& resource_id) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  DCHECK_GT(open_files_[resource_id], 0);
+
+  if (--open_files_[resource_id] == 0) {
+    // All clients closes this file, so notify to upload the file.
+    open_files_.erase(resource_id);
+    observer_->OnCacheFileUploadNeededByOperation(resource_id);
+  }
 }
 
 }  // namespace file_system
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation.h b/chrome/browser/chromeos/drive/file_system/open_file_operation.h
index 8aea8ad..f656d2f 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation.h
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation.h
@@ -42,8 +42,7 @@
                     JobScheduler* scheduler,
                     internal::ResourceMetadata* metadata,
                     internal::FileCache* cache,
-                    const base::FilePath& temporary_file_directory,
-                    std::map<base::FilePath, int>* open_files);
+                    const base::FilePath& temporary_file_directory);
   ~OpenFileOperation();
 
   // Opens the file at |file_path|.
@@ -63,28 +62,30 @@
                                FileError error);
 
   // Part of OpenFile(). Called after file downloading is completed.
-  void OpenFileAfterFileDownloaded(const base::FilePath& file_path,
-                                   const OpenFileCallback& callback,
+  void OpenFileAfterFileDownloaded(const OpenFileCallback& callback,
                                    FileError error,
                                    const base::FilePath& local_file_path,
                                    scoped_ptr<ResourceEntry> entry);
 
   // Part of OpenFile(). Called after the updating of the local state.
-  void OpenFileAfterUpdateLocalState(const base::FilePath& file_path,
+  void OpenFileAfterUpdateLocalState(const std::string& resource_id,
                                      const OpenFileCallback& callback,
                                      const base::FilePath* local_file_path,
                                      FileError error);
 
+  // Closes the file with |resource_id|.
+  void CloseFile(const std::string& resource_id);
+
   scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
+  OperationObserver* observer_;
   internal::FileCache* cache_;
 
   scoped_ptr<CreateFileOperation> create_file_operation_;
   scoped_ptr<DownloadOperation> download_operation_;
 
-  // The map from paths for opened file to the number how many the file is
-  // opened. The instance is owned by FileSystem and shared with
-  // CloseFileOperation.
-  std::map<base::FilePath, int>* open_files_;
+  // The map from resource id for an opened file to the number how many times
+  // the file is opened.
+  std::map<std::string, int> open_files_;
 
   // Note: This should remain the last member so it'll be destroyed and
   // invalidate its weak pointers before any other members are destroyed.
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
index 4e22efe..3628166 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation_unittest.cc
@@ -25,10 +25,9 @@
 
     operation_.reset(new OpenFileOperation(
         blocking_task_runner(), observer(), scheduler(), metadata(), cache(),
-        temp_dir(), &open_files_));
+        temp_dir()));
   }
 
-  std::map<base::FilePath, int> open_files_;
   scoped_ptr<OpenFileOperation> operation_;
 };
 
@@ -41,10 +40,12 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       OPEN_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -53,8 +54,11 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(file_size, local_file_size);
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(1, open_files_[file_in_root]);
+  ASSERT_FALSE(close_callback.is_null());
+  close_callback.Run();
+  EXPECT_EQ(
+      1U,
+      observer()->upload_needed_resource_ids().count(src_entry.resource_id()));
 }
 
 TEST_F(OpenFileOperationTest, OpenNonExistingFile) {
@@ -63,15 +67,15 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       OPEN_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
   EXPECT_EQ(FILE_ERROR_NOT_FOUND, error);
-
-  // The file shouldn't be in the set of opened files.
-  EXPECT_EQ(0U, open_files_.count(file_in_root));
+  EXPECT_TRUE(close_callback.is_null());
 }
 
 TEST_F(OpenFileOperationTest, CreateExistingFile) {
@@ -82,16 +86,16 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       CREATE_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_EXISTS, error);
-
-  // The file shouldn't be in the set of opened files.
-  EXPECT_EQ(0U, open_files_.count(file_in_root));
+  EXPECT_TRUE(close_callback.is_null());
 }
 
 TEST_F(OpenFileOperationTest, CreateNonExistingFile) {
@@ -100,10 +104,12 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       CREATE_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -112,8 +118,11 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(0, local_file_size);  // Should be an empty file.
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(1, open_files_[file_in_root]);
+  ASSERT_FALSE(close_callback.is_null());
+  close_callback.Run();
+  // Here we don't know about the resource id, so just make sure
+  // OnCacheFileUploadNeededByOperation is called actually.
+  EXPECT_EQ(1U, observer()->upload_needed_resource_ids().size());
 }
 
 TEST_F(OpenFileOperationTest, OpenOrCreateExistingFile) {
@@ -125,10 +134,12 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       OPEN_OR_CREATE_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -137,8 +148,11 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(file_size, local_file_size);
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(1, open_files_[file_in_root]);
+  ASSERT_FALSE(close_callback.is_null());
+  close_callback.Run();
+  EXPECT_EQ(
+      1U,
+      observer()->upload_needed_resource_ids().count(src_entry.resource_id()));
 }
 
 TEST_F(OpenFileOperationTest, OpenOrCreateNonExistingFile) {
@@ -147,10 +161,12 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       OPEN_OR_CREATE_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -159,8 +175,11 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(0, local_file_size);  // Should be an empty file.
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(1, open_files_[file_in_root]);
+  ASSERT_FALSE(close_callback.is_null());
+  close_callback.Run();
+  // Here we don't know about the resource id, so just make sure
+  // OnCacheFileUploadNeededByOperation is called actually.
+  EXPECT_EQ(1U, observer()->upload_needed_resource_ids().size());
 }
 
 TEST_F(OpenFileOperationTest, OpenFileTwice) {
@@ -172,10 +191,12 @@
 
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   operation_->OpenFile(
       file_in_root,
       OPEN_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -184,15 +205,14 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(file_size, local_file_size);
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(1, open_files_[file_in_root]);
-
   // Open again.
   error = FILE_ERROR_FAILED;
+  base::Closure close_callback2;
   operation_->OpenFile(
       file_in_root,
       OPEN_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback2));
   test_util::RunBlockingPoolTask();
 
   EXPECT_EQ(FILE_ERROR_OK, error);
@@ -200,8 +220,21 @@
   ASSERT_TRUE(file_util::GetFileSize(file_path, &local_file_size));
   EXPECT_EQ(file_size, local_file_size);
 
-  // The file_path should be added into the set.
-  EXPECT_EQ(2, open_files_[file_in_root]);
+  ASSERT_FALSE(close_callback.is_null());
+  ASSERT_FALSE(close_callback2.is_null());
+
+  close_callback.Run();
+
+  // There still remains a client opening the file, so it shouldn't be
+  // uploaded yet.
+  EXPECT_TRUE(observer()->upload_needed_resource_ids().empty());
+
+  close_callback2.Run();
+
+  // Here, all the clients close the file, so it should be uploaded then.
+  EXPECT_EQ(
+      1U,
+      observer()->upload_needed_resource_ids().count(src_entry.resource_id()));
 }
 
 }  // namespace file_system
diff --git a/chrome/browser/chromeos/drive/file_system_interface.h b/chrome/browser/chromeos/drive/file_system_interface.h
index 0c2b40b..98ccf11 100644
--- a/chrome/browser/chromeos/drive/file_system_interface.h
+++ b/chrome/browser/chromeos/drive/file_system_interface.h
@@ -98,8 +98,14 @@
 
 // Used to open files from the file system. |file_path| is the path on the local
 // file system for the opened file.
+// If |close_callback| is not null, it must be called when the
+// modification to the cache is done. Otherwise, Drive file system does not
+// pick up the file for uploading.
+// |close_callback| must not be called more than once.
 typedef base::Callback<void(FileError error,
-                            const base::FilePath& file_path)> OpenFileCallback;
+                            const base::FilePath& file_path,
+                            const base::Closure& close_callback)>
+    OpenFileCallback;
 
 // Used to get available space for the account from Drive.
 typedef base::Callback<void(FileError error,
@@ -110,6 +116,11 @@
 typedef base::Callback<void(const FileSystemMetadata&)>
     GetFilesystemMetadataCallback;
 
+// Used to mark cached files mounted.
+typedef base::Callback<void(FileError error,
+                            const base::FilePath& file_path)>
+    MarkMountedCallback;
+
 // The mode of opening a file.
 enum OpenMode {
   // Open the file if exists. If not, failed.
@@ -193,21 +204,11 @@
   // returned to |callback|. After opening the file, both read and write
   // on the file can be done with normal local file operations.
   //
-  // |CloseFile| must be called when the modification to the cache is done.
-  // Otherwise, Drive file system does not pick up the file for uploading.
-  //
   // |callback| must not be null.
   virtual void OpenFile(const base::FilePath& file_path,
                         OpenMode open_mode,
                         const OpenFileCallback& callback) = 0;
 
-  // Closes a file at the virtual path |file_path| on the Drive file system,
-  // which is opened via OpenFile(). It commits the dirty flag on the cache.
-  //
-  // |callback| must not be null.
-  virtual void CloseFile(const base::FilePath& file_path,
-                         const FileOperationCallback& callback) = 0;
-
   // Copies |src_file_path| to |dest_file_path| on the file system.
   // |src_file_path| can be a hosted document (see limitations below).
   // |dest_file_path| is expected to be of the same type of |src_file_path|
@@ -390,7 +391,7 @@
   // If succeeded, the cached file path will be passed to the |callback|.
   // |callback| must not be null.
   virtual void MarkCacheFileAsMounted(const base::FilePath& drive_file_path,
-                                    const OpenFileCallback& callback) = 0;
+                                      const MarkMountedCallback& callback) = 0;
 
   // Marks the cached file as unmounted, and runs |callback| upon completion.
   // Note that this method expects that the |cached_file_path| is the path
diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc
index 9a043c7..a5a7922 100644
--- a/chrome/browser/chromeos/drive/file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system_unittest.cc
@@ -741,10 +741,12 @@
   // Open kFileInRoot ("drive/root/File 1.txt").
   FileError error = FILE_ERROR_FAILED;
   base::FilePath file_path;
+  base::Closure close_callback;
   file_system_->OpenFile(
       kFileInRoot,
       OPEN_FILE,
-      google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+      google_apis::test_util::CreateCopyResultCallback(
+          &error, &file_path, &close_callback));
   test_util::RunBlockingPoolTask();
   const base::FilePath opened_file_path = file_path;
 
@@ -780,9 +782,8 @@
                                                         kNewContent));
 
   // Close kFileInRoot ("drive/root/File 1.txt").
-  file_system_->CloseFile(
-      kFileInRoot,
-      google_apis::test_util::CreateCopyResultCallback(&error));
+  ASSERT_FALSE(close_callback.is_null());
+  close_callback.Run();
   test_util::RunBlockingPoolTask();
 
   // Verify that the file was properly closed.
@@ -805,17 +806,6 @@
   ASSERT_EQ(2u, mock_directory_observer_->changed_directories().size());
   EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive/root")),
             mock_directory_observer_->changed_directories()[1]);
-
-  // Try to close the same file twice.
-  file_system_->CloseFile(
-      kFileInRoot,
-      google_apis::test_util::CreateCopyResultCallback(&error));
-  test_util::RunBlockingPoolTask();
-
-  // It must fail.
-  EXPECT_EQ(FILE_ERROR_NOT_FOUND, error);
-  // There should be no new directory change.
-  ASSERT_EQ(2u, mock_directory_observer_->changed_directories().size());
 }
 
 TEST_F(FileSystemTest, MarkCacheFileAsMountedAndUnmounted) {
diff --git a/chrome/browser/chromeos/drive/file_write_helper.cc b/chrome/browser/chromeos/drive/file_write_helper.cc
index c48262c..b5623ed 100644
--- a/chrome/browser/chromeos/drive/file_write_helper.cc
+++ b/chrome/browser/chromeos/drive/file_write_helper.cc
@@ -4,26 +4,16 @@
 
 #include "chrome/browser/chromeos/drive/file_write_helper.h"
 
+#include "base/bind.h"
+#include "base/callback.h"
 #include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/chromeos/drive/file_system_interface.h"
 #include "content/public/browser/browser_thread.h"
 
 using content::BrowserThread;
 
 namespace drive {
 
-namespace {
-
-// Emits debug log when FileSystem::CloseFile() is complete.
-void EmitDebugLogForCloseFile(const base::FilePath& file_path,
-                              FileError file_error) {
-  if (file_error != FILE_ERROR_OK) {
-    LOG(WARNING) << "CloseFile failed: " << file_path.AsUTF8Unsafe() << ": "
-                 << file_error;
-  }
-}
-
-}  // namespace
-
 FileWriteHelper::FileWriteHelper(FileSystemInterface* file_system)
     : file_system_(file_system),
       weak_ptr_factory_(this) {
@@ -52,7 +42,8 @@
     const base::FilePath& file_path,
     const OpenFileCallback& callback,
     FileError error,
-    const base::FilePath& local_cache_path) {
+    const base::FilePath& local_cache_path,
+    const base::Closure& close_callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(!callback.is_null());
 
@@ -66,16 +57,7 @@
   content::BrowserThread::GetBlockingPool()->PostTaskAndReply(
       FROM_HERE,
       base::Bind(callback, FILE_ERROR_OK, local_cache_path),
-      base::Bind(&FileWriteHelper::PrepareWritableFileAndRunAfterCallback,
-                 weak_ptr_factory_.GetWeakPtr(),
-                 file_path));
-}
-
-void FileWriteHelper::PrepareWritableFileAndRunAfterCallback(
-    const base::FilePath& file_path) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  file_system_->CloseFile(file_path,
-                          base::Bind(&EmitDebugLogForCloseFile, file_path));
+      close_callback);
 }
 
 }  // namespace drive
diff --git a/chrome/browser/chromeos/drive/file_write_helper.h b/chrome/browser/chromeos/drive/file_write_helper.h
index 6b60a69..8a440ef 100644
--- a/chrome/browser/chromeos/drive/file_write_helper.h
+++ b/chrome/browser/chromeos/drive/file_write_helper.h
@@ -5,9 +5,9 @@
 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_HELPER_H_
 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_WRITE_HELPER_H_
 
+#include "base/callback_forward.h"
 #include "base/memory/weak_ptr.h"
 #include "chrome/browser/chromeos/drive/file_errors.h"
-#include "chrome/browser/chromeos/drive/file_system_interface.h"
 
 namespace base {
 class FilePath;
@@ -15,10 +15,17 @@
 
 namespace drive {
 
+class FileSystemInterface;
+
 // This class provides higher level operations for writing to Drive files over
 // FileSystemInterface.
 class FileWriteHelper {
  public:
+  // Callback for PrepareWritableFileAndRun.
+  typedef base::Callback<void(FileError error,
+                              const base::FilePath& file_path)>
+      OpenFileCallback;
+
   explicit FileWriteHelper(FileSystemInterface* file_system);
   ~FileWriteHelper();
 
@@ -34,13 +41,13 @@
  private:
   // Part of PrepareWritableFilePathAndRun(). It tries CreateFile for the case
   // file does not exist yet, does OpenFile to download and mark the file as
-  // dirty, runs |callback|, and finally calls CloseFile.
+  // dirty, runs |callback|, and finally closes the file.
   void PrepareWritableFileAndRunAfterOpenFile(
       const base::FilePath& file_path,
       const OpenFileCallback& callback,
       FileError result,
-      const base::FilePath& local_cache_path);
-  void PrepareWritableFileAndRunAfterCallback(const base::FilePath& file_path);
+      const base::FilePath& local_cache_path,
+      const base::Closure& close_callback);
 
   FileSystemInterface* file_system_;  // Owned by DriveIntegrationService.
 
diff --git a/chrome/browser/chromeos/drive/file_write_helper_unittest.cc b/chrome/browser/chromeos/drive/file_write_helper_unittest.cc
index af7bf9d..4270349 100644
--- a/chrome/browser/chromeos/drive/file_write_helper_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_write_helper_unittest.cc
@@ -23,6 +23,11 @@
 
 class TestFileSystem : public DummyFileSystem {
  public:
+  TestFileSystem() : num_closed_(0) {
+  }
+
+  int num_closed() const { return num_closed_; }
+
   // Mimics OpenFile. It fails if the |file_path| points to a hosted document.
   virtual void OpenFile(const base::FilePath& file_path,
                         OpenMode open_mode,
@@ -31,17 +36,23 @@
 
     // Emulate a case of opening a hosted document.
     if (file_path == base::FilePath(kInvalidPath)) {
-      callback.Run(FILE_ERROR_INVALID_OPERATION, base::FilePath());
+      callback.Run(FILE_ERROR_INVALID_OPERATION, base::FilePath(),
+                   base::Closure());
       return;
     }
 
-    callback.Run(FILE_ERROR_OK, base::FilePath(kLocalPath));
+    callback.Run(FILE_ERROR_OK, base::FilePath(kLocalPath),
+                 base::Bind(&TestFileSystem::CloseFile,
+                            base::Unretained(this)));
   }
 
-  virtual void CloseFile(const base::FilePath& file_path,
-                         const FileOperationCallback& callback) OVERRIDE {
-    callback.Run(FILE_ERROR_OK);
+ private:
+
+  void CloseFile() {
+    ++num_closed_;
   }
+
+  int num_closed_;
 };
 
 }  // namespace
@@ -69,6 +80,9 @@
 
   EXPECT_EQ(FILE_ERROR_OK, error);
   EXPECT_EQ(kLocalPath, path.value());
+
+  // Make sure that the file is actually closed.
+  EXPECT_EQ(1, test_file_system_->num_closed());
 }
 
 TEST_F(FileWriteHelperTest, PrepareFileForWritingCreateFail) {
diff --git a/chrome/browser/chromeos/drive/fileapi_worker.cc b/chrome/browser/chromeos/drive/fileapi_worker.cc
index 9f59917..3b952e9 100644
--- a/chrome/browser/chromeos/drive/fileapi_worker.cc
+++ b/chrome/browser/chromeos/drive/fileapi_worker.cc
@@ -136,28 +136,32 @@
 void RunCreateWritableSnapshotFileCallback(
     const CreateWritableSnapshotFileCallback& callback,
     FileError error,
-    const base::FilePath& local_path) {
+    const base::FilePath& local_path,
+    const base::Closure& close_callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  callback.Run(FileErrorToPlatformError(error), local_path);
+  callback.Run(FileErrorToPlatformError(error), local_path, close_callback);
 }
 
 // Runs |callback| with |error| and |platform_file|.
 void RunOpenFileCallback(const OpenFileCallback& callback,
+                         const base::Closure& close_callback,
                          base::PlatformFileError* error,
                          base::PlatformFile platform_file) {
-  callback.Run(*error, platform_file);
+  callback.Run(*error, platform_file, close_callback);
 }
 
 // Part of OpenFile(). Called after FileSystem::OpenFile().
 void OpenFileAfterFileSystemOpenFile(int file_flags,
                                      const OpenFileCallback& callback,
                                      FileError error,
-                                     const base::FilePath& local_path) {
+                                     const base::FilePath& local_path,
+                                     const base::Closure& close_callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 
   if (error != FILE_ERROR_OK) {
     callback.Run(FileErrorToPlatformError(error),
-                 base::kInvalidPlatformFileValue);
+                 base::kInvalidPlatformFileValue,
+                 base::Closure());
     return;
   }
 
@@ -183,16 +187,11 @@
       BrowserThread::GetBlockingPool(), FROM_HERE,
       base::Bind(&base::CreatePlatformFile,
                  local_path, file_flags, static_cast<bool*>(NULL), result),
-      base::Bind(&RunOpenFileCallback, callback, base::Owned(result)));
+      base::Bind(&RunOpenFileCallback,
+                 callback, close_callback, base::Owned(result)));
   DCHECK(posted);
 }
 
-// Emits debug log when FileSystem::CloseFile() is complete.
-void EmitDebugLogForCloseFile(const base::FilePath& local_path,
-                              FileError file_error) {
-  DVLOG(1) << "Closed: " << local_path.AsUTF8Unsafe() << ": " << file_error;
-}
-
 }  // namespace
 
 void RunFileSystemCallback(
@@ -336,7 +335,8 @@
         FROM_HERE,
         base::Bind(callback,
                    base::PLATFORM_FILE_ERROR_FAILED,
-                   base::kInvalidPlatformFileValue));
+                   base::kInvalidPlatformFileValue,
+                   base::Closure()));
     return;
   }
 
@@ -345,13 +345,6 @@
       base::Bind(&OpenFileAfterFileSystemOpenFile, file_flags, callback));
 }
 
-void CloseFile(const base::FilePath& file_path,
-               FileSystemInterface* file_system) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  file_system->CloseFile(file_path,
-                         base::Bind(&EmitDebugLogForCloseFile, file_path));
-}
-
 void TouchFile(const base::FilePath& file_path,
                const base::Time& last_access_time,
                const base::Time& last_modified_time,
diff --git a/chrome/browser/chromeos/drive/fileapi_worker.h b/chrome/browser/chromeos/drive/fileapi_worker.h
index d26c65e..bef86f9 100644
--- a/chrome/browser/chromeos/drive/fileapi_worker.h
+++ b/chrome/browser/chromeos/drive/fileapi_worker.h
@@ -61,23 +61,25 @@
     CreateSnapshotFileCallback;
 typedef base::Callback<
     void(base::PlatformFileError result,
-         const base::FilePath& snapshot_file_path)>
+         const base::FilePath& snapshot_file_path,
+         const base::Closure& close_callback)>
     CreateWritableSnapshotFileCallback;
 typedef base::Callback<
     void(base::PlatformFileError result,
-         base::PlatformFile platform_file)> OpenFileCallback;
+         base::PlatformFile platform_file,
+         const base::Closure& close_callback)> OpenFileCallback;
 
 // Runs |file_system_getter| to obtain the instance of FileSystemInstance,
 // and then runs |callback| with it.
-// If |file_system_getter| returns NULL, runs |on_error_callback| instead.
+// If |file_system_getter| returns NULL, runs |error_callback| instead.
 // This function must be called on UI thread.
 // |file_system_getter| and |callback| must not be null, but
-// |on_error_callback| can be null (if no operation is necessary for error
+// |error_callback| can be null (if no operation is necessary for error
 // case).
 void RunFileSystemCallback(
     const FileSystemGetter& file_system_getter,
     const base::Callback<void(FileSystemInterface*)>& callback,
-    const base::Closure& on_error_callback);
+    const base::Closure& error_callback);
 
 // Returns the metadata info of the file at |file_path|.
 // Called from FileSystemProxy::GetFileInfo().
@@ -148,7 +150,7 @@
                         FileSystemInterface* file_system);
 
 // Creates a writable snapshot for the file at |file_path|.
-// After writing operation is done, CloseFile is needed to be called.
+// After writing operation is done, |close_callback| must be called.
 void CreateWritableSnapshotFile(
     const base::FilePath& file_path,
     const CreateWritableSnapshotFileCallback& callback,
@@ -161,12 +163,6 @@
               const OpenFileCallback& callback,
               FileSystemInterface* file_system);
 
-// Closes the file at |file_path|.
-// Called from FileSystemProxy::NotifyCloseFile and
-// FileSystemProxy::CloseWRitableSnapshotFile.
-void CloseFile(const base::FilePath& file_path,
-               FileSystemInterface* file_system);
-
 // Changes timestamp of the file at |file_path| to |last_access_time| and
 // |last_modified_time|. Called from FileSystemProxy::TouchFile().
 void TouchFile(const base::FilePath& file_path,
diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc
index b49f47f..9e5b30c 100644
--- a/chrome/browser/chromeos/drive/search_metadata.cc
+++ b/chrome/browser/chromeos/drive/search_metadata.cc
@@ -152,12 +152,12 @@
 }
 
 // Implements SearchMetadata().
-scoped_ptr<MetadataSearchResultVector> SearchMetadataOnBlockingPool(
-    ResourceMetadata* resource_metadata,
-    FileCache* cache,
-    const std::string& query_text,
-    int options,
-    int at_most_num_matches) {
+FileError SearchMetadataOnBlockingPool(ResourceMetadata* resource_metadata,
+                                       FileCache* cache,
+                                       const std::string& query_text,
+                                       int options,
+                                       int at_most_num_matches,
+                                       MetadataSearchResultVector* results) {
   ScopedPriorityQueue<MetadataSearchResult,
                       MetadataSearchResultComparator> result_candidates;
 
@@ -175,8 +175,6 @@
   }
 
   // Prepare the result.
-  scoped_ptr<MetadataSearchResultVector> results(
-      new MetadataSearchResultVector);
   for (; !result_candidates.empty(); result_candidates.pop()) {
     // The path field of entries in result_candidates are empty at this point,
     // because we don't want to run the expensive metadata DB look up except for
@@ -184,7 +182,7 @@
     base::FilePath path = resource_metadata->GetFilePath(
         result_candidates.top()->entry.resource_id());
     if (path.empty())
-      continue;
+      return FILE_ERROR_FAILED;
     results->push_back(*result_candidates.top());
     results->back().path = path;
   }
@@ -193,8 +191,17 @@
   // uninteresting candidate at the top.
   std::reverse(results->begin(), results->end());
 
-  return results.Pass();
+  return FILE_ERROR_OK;
 }
+
+void RunSearchMetadataCallback(const SearchMetadataCallback& callback,
+                               scoped_ptr<MetadataSearchResultVector> results,
+                               FileError error) {
+  if (error != FILE_ERROR_OK)
+    results.reset();
+  callback.Run(error, results.Pass());
+}
+
 }  // namespace
 
 void SearchMetadata(
@@ -209,8 +216,9 @@
   DCHECK_LE(0, at_most_num_matches);
   DCHECK(!callback.is_null());
 
-  // TODO(hashimoto): Report error code from ResourceMetadata::IterateEntries
-  // and stop binding FILE_ERROR_OK to |callback|.
+  scoped_ptr<MetadataSearchResultVector> results(
+      new MetadataSearchResultVector);
+  MetadataSearchResultVector* results_ptr = results.get();
   base::PostTaskAndReplyWithResult(blocking_task_runner.get(),
                                    FROM_HERE,
                                    base::Bind(&SearchMetadataOnBlockingPool,
@@ -218,8 +226,11 @@
                                               cache,
                                               query,
                                               options,
-                                              at_most_num_matches),
-                                   base::Bind(callback, FILE_ERROR_OK));
+                                              at_most_num_matches,
+                                              results_ptr),
+                                   base::Bind(&RunSearchMetadataCallback,
+                                              callback,
+                                              base::Passed(&results)));
 }
 
 bool FindAndHighlight(
diff --git a/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.cc b/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.cc
index 94e8e80..3363340 100644
--- a/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.cc
+++ b/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.cc
@@ -37,23 +37,8 @@
           base::Bind(&fileapi_internal::CreateWritableSnapshotFile,
                      drive_path, google_apis::CreateRelayCallback(callback)),
           google_apis::CreateRelayCallback(base::Bind(
-              callback, base::PLATFORM_FILE_ERROR_FAILED, base::FilePath()))));
-}
-
-// Closes the writable snapshot file opened by CreateWritableSnapshotFile.
-// TODO(hidehiko): Get rid of this function. crbug.com/259184.
-void CloseFile(
-    const WebkitFileStreamWriterImpl::FileSystemGetter& file_system_getter,
-    const base::FilePath& drive_path) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
-  BrowserThread::PostTask(
-      BrowserThread::UI,
-      FROM_HERE,
-      base::Bind(&fileapi_internal::RunFileSystemCallback,
-                 file_system_getter,
-                 base::Bind(&fileapi_internal::CloseFile, drive_path),
-                 base::Closure()));
+              callback, base::PLATFORM_FILE_ERROR_FAILED, base::FilePath(),
+              base::Closure()))));
 }
 
 }  // namespace
@@ -75,7 +60,10 @@
     // If the file is opened, close it at destructor.
     // It is necessary to close the local file in advance.
     local_file_writer_.reset();
-    CloseFile(file_system_getter_, file_path_);
+    DCHECK(!close_callback_on_ui_thread_.is_null());
+    BrowserThread::PostTask(BrowserThread::UI,
+                            FROM_HERE,
+                            close_callback_on_ui_thread_);
   }
 }
 
@@ -146,7 +134,8 @@
     net::IOBuffer* buf,
     int buf_len,
     base::PlatformFileError open_result,
-    const base::FilePath& local_path) {
+    const base::FilePath& local_path,
+    const base::Closure& close_callback_on_ui_thread) {
   DCHECK(!local_file_writer_);
 
   if (!pending_cancel_callback_.is_null()) {
@@ -156,8 +145,10 @@
     if (open_result == base::PLATFORM_FILE_OK) {
       // Here the file is internally created. To revert the operation, close
       // the file.
-      DCHECK(!local_path.empty());
-      CloseFile(file_system_getter_, file_path_);
+      DCHECK(!close_callback_on_ui_thread.is_null());
+      BrowserThread::PostTask(BrowserThread::UI,
+                              FROM_HERE,
+                              close_callback_on_ui_thread);
     }
 
     base::ResetAndReturn(&pending_cancel_callback_).Run(net::OK);
@@ -169,10 +160,14 @@
   const net::CompletionCallback callback =
       base::ResetAndReturn(&pending_write_callback_);
   if (open_result != base::PLATFORM_FILE_OK) {
+    DCHECK(close_callback_on_ui_thread.is_null());
     callback.Run(net::PlatformFileErrorToNetError(open_result));
     return;
   }
 
+  // Keep |close_callback| to close the file when the stream is destructed.
+  DCHECK(!close_callback_on_ui_thread.is_null());
+  close_callback_on_ui_thread_ = close_callback_on_ui_thread;
   local_file_writer_.reset(new fileapi::LocalFileStreamWriter(
       file_task_runner_.get(), local_path, offset_));
   int result = local_file_writer_->Write(buf, buf_len, callback);
diff --git a/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h b/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h
index 1ddadba..e72a692 100644
--- a/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h
+++ b/chrome/browser/chromeos/drive/webkit_file_stream_writer_impl.h
@@ -58,7 +58,8 @@
       net::IOBuffer* buf,
       int buf_len,
       base::PlatformFileError open_result,
-      const base::FilePath& local_path);
+      const base::FilePath& local_path,
+      const base::Closure& close_callback_on_ui_thread);
 
   FileSystemGetter file_system_getter_;
   scoped_refptr<base::TaskRunner> file_task_runner_;
@@ -66,6 +67,7 @@
   const int64 offset_;
 
   scoped_ptr<fileapi::FileStreamWriter> local_file_writer_;
+  base::Closure close_callback_on_ui_thread_;
   net::CompletionCallback pending_write_callback_;
   net::CompletionCallback pending_cancel_callback_;
 
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
index e98365c..f72c165 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
@@ -8,7 +8,6 @@
 #include "ash/wm/window_util.h"
 #include "base/memory/scoped_ptr.h"
 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h"
-#include "content/public/test/test_browser_thread.h"
 #include "ui/aura/root_window.h"
 #include "ui/aura/test/test_windows.h"
 #include "ui/aura/window.h"
@@ -16,14 +15,6 @@
 namespace {
 
 class WallpaperPrivateApiUnittest : public ash::test::AshTestBase {
- public:
-  WallpaperPrivateApiUnittest()
-      : ui_thread_(content::BrowserThread::UI, message_loop()) {}
-
- private:
-  content::TestBrowserThread ui_thread_;
-
-  DISALLOW_COPY_AND_ASSIGN(WallpaperPrivateApiUnittest);
 };
 
 class TestMinimizeFunction
diff --git a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
index 12c633f..2ef9454 100644
--- a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc
@@ -190,8 +190,26 @@
     return false;
   if (!dict.GetString(extension_manifest_keys::kName, &out->display_name))
     return false;
-  if (!dict.GetString(extension_manifest_keys::kLanguage, &out->language_code))
-    return false;
+
+  std::set<std::string> languages;
+  const base::Value* language_value = NULL;
+  if (dict.Get(extension_manifest_keys::kLanguage, &language_value)) {
+    if (language_value->GetType() == base::Value::TYPE_STRING) {
+      std::string language_str;
+      language_value->GetAsString(&language_str);
+      languages.insert(language_str);
+    } else if (language_value->GetType() == base::Value::TYPE_LIST) {
+      const base::ListValue* language_list = NULL;
+      language_value->GetAsList(&language_list);
+      for (size_t j = 0; j < language_list->GetSize(); ++j) {
+        std::string language_str;
+        if (language_list->GetString(j, &language_str))
+          languages.insert(language_str);
+      }
+    }
+  }
+  DCHECK(!languages.empty());
+  out->language_codes.assign(languages.begin(), languages.end());
 
   const ListValue* layouts = NULL;
   if (!dict.GetList(extension_manifest_keys::kLayouts, &layouts))
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index fcb8919..7f2fa95 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -110,6 +110,12 @@
 
 }  // namespace
 
+bool InputMethodManagerImpl::IsFullLatinKeyboard(
+    const std::string& layout) const {
+  const std::string& lang = util_.GetLanguageCodeFromInputMethodId(layout);
+  return full_latin_keyboard_checker.IsFullLatinKeyboard(layout, lang);
+}
+
 InputMethodManagerImpl::InputMethodManagerImpl(
     scoped_ptr<InputMethodDelegate> delegate)
     : delegate_(delegate.Pass()),
@@ -207,6 +213,11 @@
   return result.Pass();
 }
 
+const std::vector<std::string>&
+InputMethodManagerImpl::GetActiveInputMethodIds() const {
+  return active_input_method_ids_;
+}
+
 size_t InputMethodManagerImpl::GetNumActiveInputMethods() const {
   return active_input_method_ids_.size();
 }
@@ -250,6 +261,46 @@
   ChangeInputMethod(initial_layout);  // you can pass empty |initial_layout|.
 }
 
+// Adds new input method to given list.
+bool InputMethodManagerImpl::EnableInputMethodImpl(
+    const std::string& input_method_id,
+    std::vector<std::string>& new_active_input_method_ids) const {
+  if (!util_.IsValidInputMethodId(input_method_id)) {
+    DVLOG(1) << "EnableInputMethod: Invalid ID: " << input_method_id;
+    return false;
+  }
+
+  if (!Contains(new_active_input_method_ids, input_method_id))
+    new_active_input_method_ids.push_back(input_method_id);
+
+  return true;
+}
+
+// Starts or stops the system input method framework as needed.
+void InputMethodManagerImpl::ReconfigureIMFramework() {
+  if (component_extension_ime_manager_->IsInitialized())
+    LoadNecessaryComponentExtensions();
+
+  if (ContainsOnlyKeyboardLayout(active_input_method_ids_)) {
+    // Do NOT call ibus_controller_->Stop(); here to work around a crash issue
+    // at crbug.com/27051.
+    // TODO(yusukes): We can safely call Stop(); here once crbug.com/26443
+    // is implemented.
+  } else {
+    MaybeInitializeCandidateWindowController();
+    IBusDaemonController::GetInstance()->Start();
+  }
+}
+
+bool InputMethodManagerImpl::EnableInputMethod(
+    const std::string& input_method_id) {
+  if (!EnableInputMethodImpl(input_method_id, active_input_method_ids_))
+    return false;
+
+  ReconfigureIMFramework();
+  return true;
+}
+
 bool InputMethodManagerImpl::EnableInputMethods(
     const std::vector<std::string>& new_active_input_method_ids) {
   if (state_ == STATE_TERMINATING)
@@ -258,13 +309,9 @@
   // Filter unknown or obsolete IDs.
   std::vector<std::string> new_active_input_method_ids_filtered;
 
-  for (size_t i = 0; i < new_active_input_method_ids.size(); ++i) {
-    const std::string& input_method_id = new_active_input_method_ids[i];
-    if (util_.IsValidInputMethodId(input_method_id))
-      new_active_input_method_ids_filtered.push_back(input_method_id);
-    else
-      DVLOG(1) << "EnableInputMethods: Invalid ID: " << input_method_id;
-  }
+  for (size_t i = 0; i < new_active_input_method_ids.size(); ++i)
+    EnableInputMethodImpl(new_active_input_method_ids[i],
+                          new_active_input_method_ids_filtered);
 
   if (new_active_input_method_ids_filtered.empty()) {
     DVLOG(1) << "EnableInputMethods: No valid input method ID";
@@ -280,18 +327,7 @@
   }
   active_input_method_ids_.swap(new_active_input_method_ids_filtered);
 
-  if (component_extension_ime_manager_->IsInitialized())
-    LoadNecessaryComponentExtensions();
-
-  if (ContainOnlyKeyboardLayout(active_input_method_ids_)) {
-    // Do NOT call ibus_controller_->Stop(); here to work around a crash issue
-    // at crosbug.com/27051.
-    // TODO(yusukes): We can safely call Stop(); here once crosbug.com/26443
-    // is implemented.
-  } else {
-    MaybeInitializeCandidateWindowController();
-    IBusDaemonController::GetInstance()->Start();
-  }
+  ReconfigureIMFramework();
 
   // If |current_input_method| is no longer in |active_input_method_ids_|,
   // ChangeInputMethod() picks the first one in |active_input_method_ids_|.
@@ -564,7 +600,7 @@
     active_input_method_ids_.erase(i);
   extra_input_methods_.erase(id);
 
-  if (ContainOnlyKeyboardLayout(active_input_method_ids_)) {
+  if (ContainsOnlyKeyboardLayout(active_input_method_ids_)) {
     // Do NOT call ibus_controller_->Stop(); here to work around a crash issue
     // at crosbug.com/27051.
     // TODO(yusukes): We can safely call Stop(); here once crosbug.com/26443
@@ -662,7 +698,8 @@
   return true;
 }
 
-bool InputMethodManagerImpl::SwitchToPreviousInputMethod() {
+bool InputMethodManagerImpl::SwitchToPreviousInputMethod(
+    const ui::Accelerator& accelerator) {
   // Sanity check.
   if (active_input_method_ids_.empty()) {
     DVLOG(1) << "active input method is empty";
@@ -674,6 +711,9 @@
   if (active_input_method_ids_.size() == 1)
     return false;
 
+  if (accelerator.type() == ui::ET_KEY_RELEASED)
+    return true;
+
   if (previous_input_method_.id().empty() ||
       previous_input_method_.id() == current_input_method_.id()) {
     return SwitchToNextInputMethod();
@@ -918,7 +958,7 @@
   return Contains(active_input_method_ids_, input_method_id);
 }
 
-bool InputMethodManagerImpl::ContainOnlyKeyboardLayout(
+bool InputMethodManagerImpl::ContainsOnlyKeyboardLayout(
     const std::vector<std::string>& value) {
   for (size_t i = 0; i < value.size(); ++i) {
     if (!InputMethodUtil::IsKeyboardLayout(value[i]))
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.h b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
index 521e04a..1d0d417 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.h
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
@@ -14,6 +14,7 @@
 #include "base/threading/thread_checker.h"
 #include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
 #include "chrome/browser/chromeos/input_method/ibus_controller.h"
+#include "chrome/browser/chromeos/input_method/input_method_manager_impl_ll.h"
 #include "chrome/browser/chromeos/input_method/input_method_util.h"
 #include "chromeos/ime/ibus_daemon_controller.h"
 #include "chromeos/ime/input_method_manager.h"
@@ -58,11 +59,15 @@
       GetSupportedInputMethods() const OVERRIDE;
   virtual scoped_ptr<InputMethodDescriptors>
       GetActiveInputMethods() const OVERRIDE;
+  virtual const std::vector<std::string>& GetActiveInputMethodIds() const
+      OVERRIDE;
   virtual size_t GetNumActiveInputMethods() const OVERRIDE;
   virtual void EnableLayouts(const std::string& language_code,
                              const std::string& initial_layout) OVERRIDE;
   virtual bool EnableInputMethods(
       const std::vector<std::string>& new_active_input_method_ids) OVERRIDE;
+  virtual bool EnableInputMethod(const std::string& new_active_input_method_id)
+      OVERRIDE;
   virtual bool MigrateOldInputMethods(
       std::vector<std::string>* input_method_ids) OVERRIDE;
   virtual bool MigrateKoreanKeyboard(
@@ -86,7 +91,8 @@
       InputMethodDescriptors* result) OVERRIDE;
   virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE;
   virtual bool SwitchToNextInputMethod() OVERRIDE;
-  virtual bool SwitchToPreviousInputMethod() OVERRIDE;
+  virtual bool SwitchToPreviousInputMethod(
+      const ui::Accelerator& accelerator) OVERRIDE;
   virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE;
   virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE;
   virtual InputMethodPropertyList
@@ -95,6 +101,7 @@
   virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
   virtual ComponentExtensionIMEManager*
       GetComponentExtensionIMEManager() OVERRIDE;
+  virtual bool IsFullLatinKeyboard(const std::string& layout) const OVERRIDE;
 
   // Sets |ibus_controller_|.
   void SetIBusControllerForTesting(IBusController* ibus_controller);
@@ -135,7 +142,7 @@
 
   // Returns true if the given input method config value is a string list
   // that only contains an input method ID of a keyboard layout.
-  bool ContainOnlyKeyboardLayout(const std::vector<std::string>& value);
+  bool ContainsOnlyKeyboardLayout(const std::vector<std::string>& value);
 
   // Returns true if the connection to ibus-daemon is established.
   bool IsIBusConnectionAlive();
@@ -165,6 +172,15 @@
   // TODO(nona): Support dynamical unloading.
   void LoadNecessaryComponentExtensions();
 
+  // Adds new input method to given list if possible
+  bool EnableInputMethodImpl(
+      const std::string& input_method_id,
+      std::vector<std::string>& new_active_input_method_ids) const;
+
+  // Starts or stops the system input method framework as needed.
+  // (after list of enabled input methods has been updated)
+  void ReconfigureIMFramework();
+
   scoped_ptr<InputMethodDelegate> delegate_;
 
   // The current browser status.
@@ -223,6 +239,10 @@
 
   base::WeakPtrFactory<InputMethodManagerImpl> weak_ptr_factory_;
 
+  // Check if input method id allows full latin input (for entering passwords on
+  // login screen)
+  FullLatinKeyboardLayoutChecker full_latin_keyboard_checker;
+
   DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImpl);
 };
 
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.cc
new file mode 100644
index 0000000..7bf850c
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.cc
@@ -0,0 +1,124 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/input_method/input_method_manager_impl_ll.h"
+
+#include <string.h>
+
+#include <limits>
+
+namespace chromeos {
+namespace input_method {
+
+struct KBDList {
+  const char* const* layouts;
+  size_t size;
+};
+
+namespace {
+
+// A language may have some special layout that allows full latin input.
+static const char* const kJPFullLatinKeyboardLayouts[] = {
+  "xkb:jp::jpn"
+};
+
+static const KBDList kJPFullLatinKeyboards = {
+  kJPFullLatinKeyboardLayouts, arraysize(kJPFullLatinKeyboardLayouts)
+};
+
+// A list of languages and their layouts having full 26 latin letter set on
+// keyboard.
+
+// If permitted_layouts is NULL, then all keyboard layouts for the
+// language are "Full Latin Input" and can be used to input passwords on
+// login screen.
+
+// If permitted_layouts is not NULL, it must contain all layouts for the
+// language, that can be used at login screen.
+//
+static const struct SomeLatinKeyboardLanguageList {
+  const char* lang;
+  const KBDList* permitted_layouts;
+} kHasLatinKeyboardLanguageList[] = {
+  {"ca" /* Catalan            */, NULL},
+  {"cs" /* Czech              */, NULL},
+  {"da" /* Danish             */, NULL},
+  {"de" /* German             */, NULL},
+  {"en" /* English            */, NULL},
+  {"es" /* Spanish            */, NULL},
+  {"et" /* Estonian           */, NULL},
+  {"fi" /* Finnish            */, NULL},
+  {"fr" /* French             */, NULL},
+  {"ja" /* Japanese           */, &kJPFullLatinKeyboards},
+  {"hr" /* Croatian           */, NULL},
+  {"hu" /* Hungarian          */, NULL},
+  {"is" /* Icelandic          */, NULL},
+  {"it" /* Italian            */, NULL},
+  {"lt" /* Lithuanian         */, NULL},
+  {"lv" /* Latvian            */, NULL},
+  {"nb" /* Norwegian (Bokmal) */, NULL},
+  {"nl" /* Dutch              */, NULL},
+  {"pl" /* Polish             */, NULL},
+  {"pt" /* Portuguese         */, NULL},
+  {"ro" /* Romanian           */, NULL},
+  {"sk" /* Slovak             */, NULL},
+  {"sl" /* Slovenian          */, NULL},
+  {"sv" /* Swedish            */, NULL},
+  {"tr" /* Turkish            */, NULL},
+};
+
+}  // namespace
+
+bool FullLatinKeyboardLayoutChecker::IsFullLatinKeyboard(
+    const std::string& layout,
+    const std::string& lang) const {
+  if (lang.size() < 2) {
+    return false;
+  }
+
+  const TwoLetterLanguageCode ll(lang.c_str());
+  const std::vector<TwoLetterLanguageCode2KBDList>::const_iterator pos =
+      std::lower_bound(full_latin_keyboard_languages_.begin(),
+                       full_latin_keyboard_languages_.end(),
+                       ll);
+
+  if (pos == full_latin_keyboard_languages_.end())
+    return false;
+
+  if (pos->lang != ll)
+    return false;
+
+  const KBDList* kbdlist =
+      kHasLatinKeyboardLanguageList[pos->index].permitted_layouts;
+
+  if (kbdlist == NULL)
+    return true;
+
+  for (size_t i = 0; i < kbdlist->size; ++i)
+    if (strcmp(layout.c_str(), kbdlist->layouts[i]) == 0)
+      return true;
+
+  return false;
+}
+
+FullLatinKeyboardLayoutChecker::FullLatinKeyboardLayoutChecker() {
+  DCHECK(arraysize(kHasLatinKeyboardLanguageList) <
+         std::numeric_limits<uint16_t>::max());
+
+  full_latin_keyboard_languages_.reserve(
+      arraysize(kHasLatinKeyboardLanguageList));
+
+  for (size_t i = 0; i < arraysize(kHasLatinKeyboardLanguageList); ++i)
+    full_latin_keyboard_languages_.push_back(TwoLetterLanguageCode2KBDList(
+        kHasLatinKeyboardLanguageList[i].lang, i));
+
+  std::sort(full_latin_keyboard_languages_.begin(),
+            full_latin_keyboard_languages_.end());
+}
+
+FullLatinKeyboardLayoutChecker::~FullLatinKeyboardLayoutChecker() {
+}
+
+}  // namespace input_method
+}  // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.h b/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.h
new file mode 100644
index 0000000..f670abc
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_ll.h
@@ -0,0 +1,67 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_LL_H_
+#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_LL_H_
+
+// "Latin Layout" checker: checks if given keyboard layout is "Full Latin Input"
+
+#include <string>
+#include <vector>
+
+#include "base/strings/string_util.h"
+
+namespace chromeos {
+namespace input_method {
+
+class TwoLetterLanguageCode {
+ public:
+  TwoLetterLanguageCode() : val(0) {}
+  explicit TwoLetterLanguageCode(const char* lang)
+      : val(base::ToLowerASCII(lang[0]) * 256 + base::ToLowerASCII(lang[1])) {}
+
+  bool operator<(const TwoLetterLanguageCode& r) const { return val < r.val; }
+  bool operator!=(const TwoLetterLanguageCode& r) const { return val != r.val; }
+
+ private:
+  uint16_t val;
+};
+
+// To keep index small, sizeof(TwoLetterLanguageCode2KBDList) = 4.
+class TwoLetterLanguageCode2KBDList {
+ public:
+  TwoLetterLanguageCode2KBDList() : index(0) {}
+  TwoLetterLanguageCode2KBDList(const char* l, const uint16_t i)
+      : lang(l), index(i) {}
+
+  bool operator<(const TwoLetterLanguageCode2KBDList& r) const {
+    return lang < r.lang;
+  }
+  bool operator<(const TwoLetterLanguageCode& r) const { return lang < r; }
+
+  TwoLetterLanguageCode lang;
+
+  // index in kHasLatinKeyboardLanguageList[]
+  uint16_t index;
+};
+
+// For fast lookup "whether this language and layout are among listed in
+// kHasLatinKeyboardLanguageList[] or not".
+class FullLatinKeyboardLayoutChecker {
+ public:
+  FullLatinKeyboardLayoutChecker();
+  ~FullLatinKeyboardLayoutChecker();
+
+  bool IsFullLatinKeyboard(const std::string& layout,
+                           const std::string& lang) const;
+
+ private:
+  // Sorted vector for fast lookup.
+  std::vector<TwoLetterLanguageCode2KBDList> full_latin_keyboard_languages_;
+};
+
+}  // namespace input_method
+}  // namespace chromeos
+
+#endif  // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_IMPL_LL_H_
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
index d6d610f..978007e 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -84,14 +84,14 @@
     ComponentExtensionEngine ext1_engine1;
     ext1_engine1.engine_id = "nacl_mozc_us";
     ext1_engine1.display_name = "ext1_engine_1_display_name";
-    ext1_engine1.language_code = "ja";
+    ext1_engine1.language_codes.push_back("ja");
     ext1_engine1.layouts.push_back("us");
     ext1.engines.push_back(ext1_engine1);
 
     ComponentExtensionEngine ext1_engine2;
     ext1_engine2.engine_id = "nacl_mozc_jp";
     ext1_engine2.display_name = "ext1_engine_1_display_name";
-    ext1_engine2.language_code = "ja";
+    ext1_engine2.language_codes.push_back("ja");
     ext1_engine2.layouts.push_back("jp");
     ext1.engines.push_back(ext1_engine2);
 
@@ -105,14 +105,14 @@
     ComponentExtensionEngine ext2_engine1;
     ext2_engine1.engine_id = "ext2_engine1_engine_id";
     ext2_engine1.display_name = "ext2_engine_1_display_name";
-    ext2_engine1.language_code = "en";
+    ext2_engine1.language_codes.push_back("en");
     ext2_engine1.layouts.push_back("us");
     ext2.engines.push_back(ext2_engine1);
 
     ComponentExtensionEngine ext2_engine2;
     ext2_engine2.engine_id = "ext2_engine2_engine_id";
     ext2_engine2.display_name = "ext2_engine_2_display_name";
-    ext2_engine2.language_code = "en";
+    ext2_engine2.language_codes.push_back("en");
     ext2_engine2.layouts.push_back("us(dvorak)");
     ext2.engines.push_back(ext2_engine2);
 
@@ -778,39 +778,50 @@
   manager_->AddObserver(&observer);
   InitComponentExtension();
   InitIBusBus();
+
+  ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
+  ui::Accelerator keyup_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keyup_accelerator.set_type(ui::ET_KEY_RELEASED);
+
   manager_->EnableLayouts("en-US", "xkb:us::eng");
   EXPECT_EQ(5U, manager_->GetNumActiveInputMethods());
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us", xkeyboard_->last_layout_);
-  manager_->SwitchToNextInputMethod();
+  EXPECT_TRUE(manager_->SwitchToNextInputMethod());
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(intl)", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(intl)", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us", xkeyboard_->last_layout_);
-  manager_->SwitchToNextInputMethod();
+  EXPECT_TRUE(manager_->SwitchToNextInputMethod());
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(intl)", xkeyboard_->last_layout_);
-  manager_->SwitchToNextInputMethod();
+  EXPECT_TRUE(manager_->SwitchToNextInputMethod());
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:altgr-intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(altgr-intl)", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(intl)", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_TRUE(observer.last_show_message_);
   EXPECT_EQ("xkb:us:altgr-intl:eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us(altgr-intl)", xkeyboard_->last_layout_);
@@ -818,6 +829,31 @@
   manager_->RemoveObserver(&observer);
 }
 
+TEST_F(InputMethodManagerImplTest,
+       TestSwitchToPreviousInputMethodForOneActiveInputMethod) {
+  TestObserver observer;
+  manager_->AddObserver(&observer);
+  InitComponentExtension();
+  InitIBusBus();
+
+  ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
+  ui::Accelerator keyup_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keyup_accelerator.set_type(ui::ET_KEY_RELEASED);
+
+  std::vector<std::string> ids;
+  ids.push_back("xkb:us:dvorak:eng");
+  EXPECT_TRUE(manager_->EnableInputMethods(ids));
+  EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
+
+  // Ctrl+Space accelerator should not be consumed if there is only one active
+  // input method.
+  EXPECT_FALSE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_FALSE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
+
+  manager_->RemoveObserver(&observer);
+}
+
 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithUsLayouts) {
   TestObserver observer;
   manager_->AddObserver(&observer);
@@ -855,6 +891,12 @@
   // Enable "xkb:jp::jpn" and press Muhenkan/ZenkakuHankaku.
   InitComponentExtension();
   InitIBusBus();
+
+  ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
+  ui::Accelerator keyup_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
+  keyup_accelerator.set_type(ui::ET_KEY_RELEASED);
+
   manager_->EnableLayouts("ja", "xkb:us::eng");
   EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
@@ -863,14 +905,16 @@
       ui::Accelerator(ui::VKEY_NONCONVERT, ui::EF_NONE)));
   EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("jp", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us", xkeyboard_->last_layout_);
   EXPECT_TRUE(manager_->SwitchInputMethod(
       ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE)));
   EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("jp", xkeyboard_->last_layout_);
-  manager_->SwitchToPreviousInputMethod();
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keydown_accelerator));
+  EXPECT_TRUE(manager_->SwitchToPreviousInputMethod(keyup_accelerator));
   EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
   EXPECT_EQ("us", xkeyboard_->last_layout_);
   EXPECT_TRUE(manager_->SwitchInputMethod(
diff --git a/chrome/browser/chromeos/input_method/input_method_persistence.cc b/chrome/browser/chromeos/input_method/input_method_persistence.cc
index 9562b23..49809fe 100644
--- a/chrome/browser/chromeos/input_method/input_method_persistence.cc
+++ b/chrome/browser/chromeos/input_method/input_method_persistence.cc
@@ -4,11 +4,13 @@
 
 #include "chrome/browser/chromeos/input_method/input_method_persistence.h"
 
+#include "base/chromeos/chromeos_version.h"
 #include "base/logging.h"
 #include "base/prefs/pref_service.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chromeos/input_method/input_method_util.h"
 #include "chrome/browser/chromeos/language_preferences.h"
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/common/pref_names.h"
@@ -25,7 +27,62 @@
         language_prefs::kPreferredKeyboardLayout, input_method);
 }
 
-void PersistUserInputMethod(const std::string& input_method) {
+// Update user LRU keyboard layout for login screen
+static void SetUserLRUInputMethod(
+    const std::string& input_method,
+    const chromeos::input_method::InputMethodManager* const manager) {
+  // Skip if it's not a keyboard layout. Drop input methods including
+  // extension ones.
+  if (!InputMethodUtil::IsKeyboardLayout(input_method))
+    return;
+
+  PrefService* const local_state = g_browser_process->local_state();
+
+  Profile* const profile = ProfileManager::GetDefaultProfile();
+
+  if (profile == NULL)
+    return;
+
+  if (!manager->IsFullLatinKeyboard(input_method))
+    return;
+
+  const std::string username = profile->GetProfileName();
+  if (base::chromeos::IsRunningOnChromeOS() && !username.empty() &&
+      !local_state->ReadOnly()) {
+    bool update_succeed = false;
+    {
+      // Updater may have side-effects, therefore we do not replace
+      // entry while updater exists.
+      DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod);
+      base::DictionaryValue* const users_lru_input_methods = updater.Get();
+      if (users_lru_input_methods) {
+        users_lru_input_methods->SetStringWithoutPathExpansion(username,
+                                                               input_method);
+        update_succeed = true;
+      }
+    }
+    if (!update_succeed) {
+      // Somehow key kUsersLRUInputMethod has value of invalid type.
+      // Replace and retry.
+      local_state->Set(prefs::kUsersLRUInputMethod, base::DictionaryValue());
+
+      DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod);
+      base::DictionaryValue* const users_lru_input_methods = updater.Get();
+      if (users_lru_input_methods) {
+        users_lru_input_methods->SetStringWithoutPathExpansion(username,
+                                                               input_method);
+        update_succeed = true;
+      }
+    }
+    if (!update_succeed) {
+      DVLOG(1) << "Failed to replace local_state.kUsersLRUInputMethod: '"
+               << prefs::kUsersLRUInputMethod << "' for '" << username << "'";
+    }
+  }
+}
+
+void PersistUserInputMethod(const std::string& input_method,
+                            InputMethodManager* const manager) {
   PrefService* user_prefs = NULL;
   Profile* profile = ProfileManager::GetDefaultProfile();
   if (profile)
@@ -33,6 +90,8 @@
   if (!user_prefs)
     return;
 
+  SetUserLRUInputMethod(input_method, manager);
+
   const std::string current_input_method_on_pref =
       user_prefs->GetString(prefs::kLanguageCurrentInputMethod);
   if (current_input_method_on_pref == input_method)
@@ -73,7 +132,7 @@
       PersistSystemInputMethod(current_input_method);
       return;
     case InputMethodManager::STATE_BROWSER_SCREEN:
-      PersistUserInputMethod(current_input_method);
+      PersistUserInputMethod(current_input_method, manager);
       return;
     case InputMethodManager::STATE_LOCK_SCREEN:
       // We use a special set of input methods on the screen. Do not update.
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 3258cda..da9a85e 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -70,6 +70,14 @@
   { "m17n:zh:quick", "\xe9\x80\x9f" },  // U+901F
   // For Hangul input method.
   { "mozc-hangul", "\xed\x95\x9c" },  // U+D55C
+  { "_comp_ime_bdgdidmhaijohebebipajioienkglgfohangul_2set", "\xed\x95\x9c" },
+  { "_comp_ime_bdgdidmhaijohebebipajioienkglgfohangul_3set390",
+    "\xed\x95\x9c" },
+  { "_comp_ime_bdgdidmhaijohebebipajioienkglgfohangul_3setfinal",
+    "\xed\x95\x9c" },
+  { "_comp_ime_bdgdidmhaijohebebipajioienkglgfohangul_3setnoshift",
+    "\xed\x95\x9c" },
+  { "_comp_ime_bdgdidmhaijohebebipajioienkglgfohangul_romaja", "\xed\x95\x9c" },
 };
 
 const size_t kMappingFromIdToIndicatorTextLen =
diff --git a/chrome/browser/chromeos/input_method/mock_input_method_manager.cc b/chrome/browser/chromeos/input_method/mock_input_method_manager.cc
index ad18c70..4aeef61 100644
--- a/chrome/browser/chromeos/input_method/mock_input_method_manager.cc
+++ b/chrome/browser/chromeos/input_method/mock_input_method_manager.cc
@@ -11,6 +11,7 @@
     : add_observer_count_(0),
       remove_observer_count_(0),
       util_(&delegate_, whitelist_.GetSupportedInputMethods()) {
+  active_input_method_ids_.push_back("xkb:us::eng");
 }
 
 MockInputMethodManager::~MockInputMethodManager() {
@@ -50,6 +51,11 @@
   return result.Pass();
 }
 
+const std::vector<std::string>&
+MockInputMethodManager::GetActiveInputMethodIds() const {
+  return active_input_method_ids_;
+}
+
 size_t MockInputMethodManager::GetNumActiveInputMethods() const {
   return 1;
 }
@@ -63,6 +69,11 @@
   return true;
 }
 
+bool MockInputMethodManager::EnableInputMethod(
+    const std::string& new_active_input_method_id) {
+  return true;
+}
+
 bool MockInputMethodManager::MigrateOldInputMethods(
     std::vector<std::string>* input_method_ids) {
   return false;
@@ -113,7 +124,8 @@
   return true;
 }
 
-bool MockInputMethodManager::SwitchToPreviousInputMethod() {
+bool MockInputMethodManager::SwitchToPreviousInputMethod(
+    const ui::Accelerator& accelerator) {
   return true;
 }
 
@@ -162,5 +174,9 @@
   delegate_.set_hardware_keyboard_layout(value);
 }
 
+bool MockInputMethodManager::IsFullLatinKeyboard(
+    const std::string& layout) const {
+  return true;
+}
 }  // namespace input_method
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/mock_input_method_manager.h b/chrome/browser/chromeos/input_method/mock_input_method_manager.h
index e373707..5db4950 100644
--- a/chrome/browser/chromeos/input_method/mock_input_method_manager.h
+++ b/chrome/browser/chromeos/input_method/mock_input_method_manager.h
@@ -31,11 +31,15 @@
       GetSupportedInputMethods() const OVERRIDE;
   virtual scoped_ptr<InputMethodDescriptors>
       GetActiveInputMethods() const OVERRIDE;
+  virtual const std::vector<std::string>& GetActiveInputMethodIds() const
+      OVERRIDE;
   virtual size_t GetNumActiveInputMethods() const OVERRIDE;
   virtual void EnableLayouts(const std::string& language_code,
                              const std::string& initial_layout) OVERRIDE;
   virtual bool EnableInputMethods(
       const std::vector<std::string>& new_active_input_method_ids) OVERRIDE;
+  virtual bool EnableInputMethod(
+      const std::string& new_active_input_method_id) OVERRIDE;
   virtual bool MigrateOldInputMethods(
       std::vector<std::string>* input_method_ids) OVERRIDE;
   virtual bool MigrateKoreanKeyboard(
@@ -59,7 +63,8 @@
       InputMethodDescriptors* result) OVERRIDE;
   virtual void SetEnabledExtensionImes(std::vector<std::string>* ids) OVERRIDE;
   virtual bool SwitchToNextInputMethod() OVERRIDE;
-  virtual bool SwitchToPreviousInputMethod() OVERRIDE;
+  virtual bool SwitchToPreviousInputMethod(
+      const ui::Accelerator& accelerator) OVERRIDE;
   virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) OVERRIDE;
   virtual InputMethodDescriptor GetCurrentInputMethod() const OVERRIDE;
   virtual InputMethodPropertyList
@@ -68,6 +73,7 @@
   virtual InputMethodUtil* GetInputMethodUtil() OVERRIDE;
   virtual ComponentExtensionIMEManager*
       GetComponentExtensionIMEManager() OVERRIDE;
+  virtual bool IsFullLatinKeyboard(const std::string& layout) const OVERRIDE;
 
   // Sets an input method ID which will be returned by GetCurrentInputMethod().
   void SetCurrentInputMethodId(const std::string& input_method_id) {
@@ -91,6 +97,9 @@
   InputMethodUtil util_;
   MockXKeyboard xkeyboard_;
 
+  // The active input method ids cache (actually default only)
+  std::vector<std::string> active_input_method_ids_;
+
   DISALLOW_COPY_AND_ASSIGN(MockInputMethodManager);
 };
 
diff --git a/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc b/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
index 7c451d2..7e254ab 100644
--- a/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
+++ b/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
@@ -14,9 +14,7 @@
 
 namespace {
 
-const int kModifierMask = (ui::EF_CONTROL_DOWN |
-                           ui::EF_ALT_DOWN |
-                           ui::EF_SHIFT_DOWN);
+const int kModifierMask = ui::EF_SHIFT_DOWN;
 
 // Returns true if and only if it is on login screen (i.e. user is not logged
 // in) and the keyboard driven flag in the OEM manifest is on.
diff --git a/chrome/browser/chromeos/keyboard_driven_event_rewriter_unittest.cc b/chrome/browser/chromeos/keyboard_driven_event_rewriter_unittest.cc
index fb32552..c197400 100644
--- a/chrome/browser/chromeos/keyboard_driven_event_rewriter_unittest.cc
+++ b/chrome/browser/chromeos/keyboard_driven_event_rewriter_unittest.cc
@@ -133,10 +133,8 @@
 }
 
 TEST_F(KeyboardDrivenEventRewriterTest, Rewrite) {
-  const int kModifierMask = (ui::EF_CONTROL_DOWN |
-                             ui::EF_ALT_DOWN |
-                             ui::EF_SHIFT_DOWN);
-  const unsigned int kXState = (ControlMask | Mod1Mask | ShiftMask);
+  const int kModifierMask = ui::EF_SHIFT_DOWN;
+  const unsigned int kXState = ShiftMask;
 
   struct {
     ui::KeyboardCode ui_keycode;
diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout_unittest.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout_unittest.cc
index 6699856..e722eff 100644
--- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout_unittest.cc
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout_unittest.cc
@@ -17,18 +17,14 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 namespace chromeos {
 
 class KioskModeIdleLogoutTest : public ash::test::AshTestBase {
  public:
   KioskModeIdleLogoutTest()
-      : ui_thread_(BrowserThread::UI, message_loop()),
-        idle_logout_(NULL) {
+      : idle_logout_(NULL) {
   }
 
   virtual void SetUp() OVERRIDE {
@@ -53,8 +49,6 @@
         idle_logout_);
   }
 
-  content::TestBrowserThread ui_thread_;
-
   ScopedDeviceSettingsTestHelper device_settings_test_helper_;
 
   KioskModeIdleLogout* idle_logout_;
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc
index c8f27b9..5604c22 100644
--- a/chrome/browser/chromeos/login/kiosk_browsertest.cc
+++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -115,7 +115,7 @@
  private:
   // ChromeBrowserMainExtraParts implementation.
   virtual void PreEarlyInitialization() OVERRIDE {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
     registrar_.Add(this, chrome::NOTIFICATION_KIOSK_APPS_LOADED,
                    content::NotificationService::AllSources());
@@ -127,8 +127,8 @@
   virtual void Observe(int type,
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE {
-    if (type == chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE) {
-      LOG(INFO) << "NOTIFICATION_LOGIN_WEBUI_VISIBLE";
+    if (type == chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE) {
+      LOG(INFO) << "NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE";
       SetupSigninScreen();
     } else if (type == chrome::NOTIFICATION_KIOSK_APPS_LOADED) {
       LOG(INFO) << "chrome::NOTIFICATION_KIOSK_APPS_LOADED";
@@ -282,7 +282,7 @@
  private:
   // ChromeBrowserMainExtraParts implementation.
   virtual void PreEarlyInitialization() OVERRIDE {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
     registrar_.Add(this, chrome::NOTIFICATION_KIOSK_ENABLE_WARNING_VISIBLE,
                    content::NotificationService::AllSources());
@@ -298,8 +298,8 @@
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE {
     switch (type) {
-      case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: {
-        LOG(INFO) << "NOTIFICATION_LOGIN_WEBUI_VISIBLE";
+      case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
+        LOG(INFO) << "NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE";
         SetupSigninScreen();
         content::WebUI* web_ui = static_cast<chromeos::LoginDisplayHostImpl*>(
             chromeos::LoginDisplayHostImpl::default_host())->
diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc
index 7a228aa..c1aa932 100644
--- a/chrome/browser/chromeos/login/login_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_browsertest.cc
@@ -96,7 +96,7 @@
 
   // ChromeBrowserMainExtraParts implementation.
   virtual void PreEarlyInitialization() OVERRIDE {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
   }
 
diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc
index 96d92a4..dea6f11 100644
--- a/chrome/browser/chromeos/login/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/login_display_host_impl.cc
@@ -246,7 +246,7 @@
   // these notifications.
   if ((waiting_for_user_pods_ || waiting_for_wallpaper_load_)
       && initialize_webui_hidden_) {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
     registrar_.Add(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
                    content::NotificationService::AllSources());
@@ -558,7 +558,7 @@
     registrar_.Remove(this,
                       chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
                       content::NotificationService::AllSources());
-  } else if (chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE == type ||
+  } else if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type ||
              chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) {
     LOG(WARNING) << "Login WebUI >> WEBUI_VISIBLE";
     if (waiting_for_user_pods_ && initialize_webui_hidden_) {
@@ -570,7 +570,7 @@
       ShowWebUI();
     }
     registrar_.Remove(this,
-                      chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                      chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                       content::NotificationService::AllSources());
     registrar_.Remove(this,
                       chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
diff --git a/chrome/browser/chromeos/login/online_attempt_unittest.cc b/chrome/browser/chromeos/login/online_attempt_unittest.cc
index 5692686..24f6f17 100644
--- a/chrome/browser/chromeos/login/online_attempt_unittest.cc
+++ b/chrome/browser/chromeos/login/online_attempt_unittest.cc
@@ -6,7 +6,7 @@
 
 #include "base/bind.h"
 #include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "chrome/browser/chromeos/cros/network_library.h"
 #include "chrome/browser/chromeos/login/auth_attempt_state.h"
 #include "chrome/browser/chromeos/login/mock_auth_attempt_state_resolver.h"
@@ -15,7 +15,8 @@
 #include "chrome/browser/chromeos/login/test_attempt_state.h"
 #include "chrome/browser/chromeos/login/user.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
 #include "google_apis/gaia/mock_url_fetcher_factory.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -33,23 +34,12 @@
 class OnlineAttemptTest : public testing::Test {
  public:
   OnlineAttemptTest()
-      : message_loop_(base::MessageLoop::TYPE_UI),
-        ui_thread_(BrowserThread::UI, &message_loop_),
-        state_(UserContext(), "", "", "", User::USER_TYPE_REGULAR, false),
-        resolver_(new MockAuthAttemptStateResolver) {
-  }
-
-  virtual ~OnlineAttemptTest() {}
-
-  virtual void SetUp() {
-    attempt_.reset(new OnlineAttempt(&state_, resolver_.get()));
-  }
-
-  virtual void TearDown() {
+      : state_(UserContext(), "", "", "", User::USER_TYPE_REGULAR, false),
+        attempt_(new OnlineAttempt(&state_, &resolver_)) {
   }
 
   void RunFailureTest(const GoogleServiceAuthError& error) {
-    EXPECT_CALL(*(resolver_.get()), Resolve())
+    EXPECT_CALL(resolver_, Resolve())
         .Times(1)
         .RetiresOnSaturation();
 
@@ -59,7 +49,7 @@
                    attempt_->weak_factory_.GetWeakPtr(),
                    error));
     // Force UI thread to finish tasks so I can verify |state_|.
-    message_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     EXPECT_TRUE(error == state_.online_outcome().error());
   }
 
@@ -70,19 +60,9 @@
                    auth->weak_factory_.GetWeakPtr()));
   }
 
-  static void Quit() {
-    BrowserThread::PostTask(
-        BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure());
-  }
-
-  static void RunThreadTest() {
-    base::MessageLoop::current()->RunUntilIdle();
-  }
-
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   TestAttemptState state_;
-  scoped_ptr<MockAuthAttemptStateResolver> resolver_;
+  MockAuthAttemptStateResolver resolver_;
   scoped_ptr<OnlineAttempt> attempt_;
 
   // Initializes / shuts down a stub NetworkLibrary.
@@ -90,7 +70,7 @@
 };
 
 TEST_F(OnlineAttemptTest, LoginSuccess) {
-  EXPECT_CALL(*(resolver_.get()), Resolve())
+  EXPECT_CALL(resolver_, Resolve())
       .Times(1)
       .RetiresOnSaturation();
 
@@ -100,15 +80,16 @@
                  attempt_->weak_factory_.GetWeakPtr(),
                  GaiaAuthConsumer::ClientLoginResult()));
   // Force UI thread to finish tasks so I can verify |state_|.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(OnlineAttemptTest, LoginCancelRetry) {
   GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
   TestingProfile profile;
 
-  EXPECT_CALL(*(resolver_.get()), Resolve())
-      .WillOnce(Invoke(OnlineAttemptTest::Quit))
+  base::RunLoop run_loop;
+  EXPECT_CALL(resolver_, Resolve())
+      .WillOnce(Invoke(&run_loop, &base::RunLoop::Quit))
       .RetiresOnSaturation();
 
   // This is how we inject fake URLFetcher objects, with a factory.
@@ -117,11 +98,8 @@
   MockURLFetcherFactory<GotCanceledFetcher> factory;
 
   attempt_->Initiate(&profile);
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&OnlineAttemptTest::RunThreadTest));
 
-  base::MessageLoop::current()->Run();
+  run_loop.Run();
 
   EXPECT_TRUE(error == state_.online_outcome().error());
   EXPECT_EQ(LoginFailure::NETWORK_AUTH_FAILED,
@@ -132,8 +110,9 @@
   LoginFailure error(LoginFailure::LOGIN_TIMED_OUT);
   TestingProfile profile;
 
-  EXPECT_CALL(*(resolver_.get()), Resolve())
-      .WillOnce(Invoke(OnlineAttemptTest::Quit))
+  base::RunLoop run_loop;
+  EXPECT_CALL(resolver_, Resolve())
+      .WillOnce(Invoke(&run_loop, &base::RunLoop::Quit))
       .RetiresOnSaturation();
 
   // This is how we inject fake URLFetcher objects, with a factory.
@@ -142,14 +121,11 @@
   MockURLFetcherFactory<ExpectCanceledFetcher> factory;
 
   attempt_->Initiate(&profile);
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&OnlineAttemptTest::RunThreadTest));
 
   // Post a task to cancel the login attempt.
   CancelLogin(attempt_.get());
 
-  base::MessageLoop::current()->Run();
+  run_loop.Run();
 
   EXPECT_EQ(LoginFailure::LOGIN_TIMED_OUT, state_.online_outcome().reason());
 }
@@ -161,8 +137,9 @@
               GoogleServiceAuthError::HOSTED_NOT_ALLOWED)));
   TestingProfile profile;
 
-  EXPECT_CALL(*(resolver_.get()), Resolve())
-      .WillOnce(Invoke(OnlineAttemptTest::Quit))
+  base::RunLoop run_loop;
+  EXPECT_CALL(resolver_, Resolve())
+      .WillOnce(Invoke(&run_loop, &base::RunLoop::Quit))
       .RetiresOnSaturation();
 
   // This is how we inject fake URLFetcher objects, with a factory.
@@ -170,13 +147,10 @@
 
   TestAttemptState local_state(UserContext(), "", "", "",
                                User::USER_TYPE_REGULAR, true);
-  attempt_.reset(new OnlineAttempt(&local_state, resolver_.get()));
+  attempt_.reset(new OnlineAttempt(&local_state, &resolver_));
   attempt_->Initiate(&profile);
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&OnlineAttemptTest::RunThreadTest));
 
-  base::MessageLoop::current()->Run();
+  run_loop.Run();
 
   EXPECT_EQ(error, local_state.online_outcome());
   EXPECT_EQ(LoginFailure::NETWORK_AUTH_FAILED,
@@ -186,8 +160,9 @@
 TEST_F(OnlineAttemptTest, FullLogin) {
   TestingProfile profile;
 
-  EXPECT_CALL(*(resolver_.get()), Resolve())
-      .WillOnce(Invoke(OnlineAttemptTest::Quit))
+  base::RunLoop run_loop;
+  EXPECT_CALL(resolver_, Resolve())
+      .WillOnce(Invoke(&run_loop, &base::RunLoop::Quit))
       .RetiresOnSaturation();
 
   // This is how we inject fake URLFetcher objects, with a factory.
@@ -195,13 +170,10 @@
 
   TestAttemptState local_state(UserContext(), "", "", "",
                                User::USER_TYPE_REGULAR, true);
-  attempt_.reset(new OnlineAttempt(&local_state, resolver_.get()));
+  attempt_.reset(new OnlineAttempt(&local_state, &resolver_));
   attempt_->Initiate(&profile);
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&OnlineAttemptTest::RunThreadTest));
 
-  base::MessageLoop::current()->Run();
+  run_loop.Run();
 
   EXPECT_EQ(LoginFailure::LoginFailureNone(), local_state.online_outcome());
 }
@@ -241,7 +213,7 @@
 }
 
 TEST_F(OnlineAttemptTest, TwoFactorSuccess) {
-  EXPECT_CALL(*(resolver_.get()), Resolve())
+  EXPECT_CALL(resolver_, Resolve())
       .Times(1)
       .RetiresOnSaturation();
   GoogleServiceAuthError error(GoogleServiceAuthError::TWO_FACTOR);
@@ -252,7 +224,7 @@
                  error));
 
   // Force UI thread to finish tasks so I can verify |state_|.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(GoogleServiceAuthError::AuthErrorNone() ==
               state_.online_outcome().error());
 }
diff --git a/chrome/browser/chromeos/login/oobe_browsertest.cc b/chrome/browser/chromeos/login/oobe_browsertest.cc
index 3ee0c8d..b07497d 100644
--- a/chrome/browser/chromeos/login/oobe_browsertest.cc
+++ b/chrome/browser/chromeos/login/oobe_browsertest.cc
@@ -47,7 +47,7 @@
 
   // ChromeBrowserMainExtraParts implementation.
   virtual void PreEarlyInitialization() OVERRIDE {
-    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+    registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                    content::NotificationService::AllSources());
     registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED,
                    content::NotificationService::AllSources());
@@ -62,8 +62,8 @@
   virtual void Observe(int type,
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE {
-    if (type == chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE) {
-      LOG(INFO) << "NOTIFICATION_LOGIN_WEBUI_VISIBLE";
+    if (type == chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE) {
+      LOG(INFO) << "NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE";
       webui_visible_ = true;
       if (browsing_data_removed_ && !signin_screen_shown_) {
         signin_screen_shown_ = true;
diff --git a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
index f0fd212..9875995 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
@@ -27,7 +27,7 @@
 #include "chromeos/cryptohome/mock_cryptohome_library.h"
 #include "chromeos/dbus/fake_cryptohome_client.h"
 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/mock_url_fetcher_factory.h"
 #include "net/base/net_errors.h"
 #include "net/url_request/url_request_status.h"
@@ -36,13 +36,9 @@
 #include "third_party/cros_system_api/dbus/service_constants.h"
 #include "url/gurl.h"
 
-using ::testing::AnyNumber;
-using ::testing::DoAll;
 using ::testing::Invoke;
 using ::testing::Return;
-using ::testing::SetArgPointee;
 using ::testing::_;
-using content::BrowserThread;
 
 namespace chromeos {
 
@@ -57,15 +53,10 @@
 class ParallelAuthenticatorTest : public testing::Test {
  public:
   ParallelAuthenticatorTest()
-      : message_loop_(base::MessageLoop::TYPE_UI),
-        ui_thread_(BrowserThread::UI, &message_loop_),
-        file_thread_(BrowserThread::FILE, &message_loop_),
-        io_thread_(BrowserThread::IO),
-        username_("me@nowhere.org"),
+      : username_("me@nowhere.org"),
         password_("fakepass"),
+        hash_ascii_("0a010000000000a0" + std::string(16, '0')),
         user_manager_enabler_(new MockUserManager) {
-    hash_ascii_.assign("0a010000000000a0");
-    hash_ascii_.append(std::string(16, '0'));
   }
 
   virtual ~ParallelAuthenticatorTest() {
@@ -79,8 +70,6 @@
     mock_cryptohome_library_ .reset(new MockCryptohomeLibrary());
     CryptohomeLibrary::SetForTest(mock_cryptohome_library_.get());
 
-    io_thread_.Start();
-
     auth_ = new ParallelAuthenticator(&consumer_);
     state_.reset(new TestAttemptState(UserContext(username_,
                                                   password_,
@@ -177,7 +166,7 @@
 
   void RunResolve(ParallelAuthenticator* auth) {
     auth->Resolve();
-    message_loop_.RunUntilIdle();
+    base::MessageLoop::current()->RunUntilIdle();
   }
 
   void SetAttemptState(ParallelAuthenticator* auth, TestAttemptState* state) {
@@ -198,10 +187,7 @@
     auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get()));
   }
 
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   std::string username_;
   std::string password_;
@@ -390,7 +376,7 @@
       .RetiresOnSaturation();
 
   auth_->LoginOffTheRecord();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveGuestLoginButFail) {
@@ -405,7 +391,7 @@
       .RetiresOnSaturation();
 
   auth_->LoginOffTheRecord();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveRetailModeUserLogin) {
@@ -420,7 +406,7 @@
       .RetiresOnSaturation();
 
   auth_->LoginRetailMode();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveRetailModeLoginButFail) {
@@ -435,7 +421,7 @@
       .RetiresOnSaturation();
 
   auth_->LoginRetailMode();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveDataResync) {
@@ -464,7 +450,7 @@
   SetAttemptState(auth_.get(), state_.release());
 
   auth_->ResyncEncryptedData();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveResyncFail) {
@@ -480,7 +466,7 @@
   SetAttemptState(auth_.get(), state_.release());
 
   auth_->ResyncEncryptedData();
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveRequestOldPassword) {
@@ -521,7 +507,7 @@
   SetAttemptState(auth_.get(), state_.release());
 
   auth_->RecoverEncryptedData(std::string());
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, DriveDataRecoverButFail) {
@@ -541,7 +527,7 @@
   SetAttemptState(auth_.get(), state_.release());
 
   auth_->RecoverEncryptedData(std::string());
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 TEST_F(ParallelAuthenticatorTest, ResolveNoMount) {
@@ -652,7 +638,7 @@
   auth_->AuthenticateToUnlock(UserContext(username_,
                                           std::string(),
                                           std::string()));
-  message_loop_.Run();
+  base::MessageLoop::current()->Run();
 }
 
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index 5dea61c..874e865 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -1126,13 +1126,14 @@
 
 void UserManagerImpl::GuestUserLoggedIn() {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  WallpaperManager::Get()->SetInitialUserWallpaper(UserManager::kGuestUserName,
-                                                   false);
   active_user_ = User::CreateGuestUser();
   // TODO(nkostylev): Add support for passing guest session cryptohome
   // mount point. Legacy (--login-profile) value will be used for now.
   // http://crosbug.com/230859
   active_user_->SetStubImage(User::kInvalidImageIndex, false);
+  // Initializes wallpaper after active_user_ is set.
+  WallpaperManager::Get()->SetInitialUserWallpaper(UserManager::kGuestUserName,
+                                                   false);
 }
 
 void UserManagerImpl::RegularUserLoggedIn(const std::string& email,
@@ -1234,9 +1235,9 @@
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(policy::IsKioskAppUser(username));
 
-  WallpaperManager::Get()->SetInitialUserWallpaper(username, false);
   active_user_ = User::CreateKioskAppUser(username);
   active_user_->SetStubImage(User::kInvalidImageIndex, false);
+  WallpaperManager::Get()->SetInitialUserWallpaper(username, false);
 
   // TODO(bartfab): Add KioskAppUsers to the users_ list and keep metadata like
   // the kiosk_app_id in these objects, removing the need to re-parse the
diff --git a/chrome/browser/chromeos/login/user_manager_unittest.cc b/chrome/browser/chromeos/login/user_manager_unittest.cc
index 5ae5ae6..c26a764 100644
--- a/chrome/browser/chromeos/login/user_manager_unittest.cc
+++ b/chrome/browser/chromeos/login/user_manager_unittest.cc
@@ -6,7 +6,6 @@
 #include <cstring>
 
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
 #include "base/prefs/pref_service.h"
 #include "base/prefs/testing_pref_service.h"
 #include "base/run_loop.h"
@@ -22,19 +21,13 @@
 #include "chrome/browser/chromeos/settings/device_settings_service.h"
 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
 #include "chrome/test/base/testing_browser_process.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace chromeos {
 
 class UserManagerTest : public testing::Test {
- public:
-  UserManagerTest()
-      : message_loop_(base::MessageLoop::TYPE_UI),
-        ui_thread_(content::BrowserThread::UI, &message_loop_),
-        file_thread_(content::BrowserThread::FILE, &message_loop_) {
-  }
-
+ protected:
   virtual void SetUp() OVERRIDE {
     cros_settings_ = CrosSettings::Get();
 
@@ -126,9 +119,7 @@
   }
 
  protected:
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   CrosSettings* cros_settings_;
   CrosSettingsProvider* device_settings_provider_;
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
index 8957ecc..854a529 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -129,7 +129,7 @@
                  chrome::NOTIFICATION_LOGIN_USER_CHANGED,
                  content::NotificationService::AllSources());
   registrar_.Add(this,
-                 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                  content::NotificationService::AllSources());
   registrar_.Add(this,
                  chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
@@ -267,6 +267,14 @@
     return;
   }
 
+  if (CommandLine::ForCurrentProcess()->
+          HasSwitch(chromeos::switches::kGuestSession)) {
+    // Guest wallpaper should be initialized when guest login.
+    // Note: This maybe called before login. So IsLoggedInAsGuest can not be
+    // used here to determine if current user is guest.
+    return;
+  }
+
   if (!user_manager->IsUserLoggedIn()) {
     if (!StartupUtils::IsDeviceRegistered())
       SetDefaultWallpaper();
@@ -286,7 +294,7 @@
       ClearWallpaperCache();
       break;
     }
-    case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: {
+    case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
       if (!CommandLine::ForCurrentProcess()->
           HasSwitch(switches::kDisableBootAnimation)) {
         BrowserThread::PostDelayedTask(
diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc
index 1c3b509..590a943 100644
--- a/chrome/browser/chromeos/login/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/webui_login_view.cc
@@ -150,7 +150,7 @@
       should_emit_login_prompt_visible_(true),
       forward_keyboard_event_(true) {
   registrar_.Add(this,
-                 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                  content::NotificationService::AllSources());
   registrar_.Add(this,
                  chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
@@ -372,7 +372,7 @@
                              const content::NotificationSource& source,
                              const content::NotificationDetails& details) {
   switch (type) {
-    case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE:
+    case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE:
     case chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN: {
       OnLoginPromptVisible();
       registrar_.RemoveAll();
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
index 2b6b410..320ee4a 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
@@ -5,7 +5,7 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "chrome/browser/captive_portal/captive_portal_detector.h"
 #include "chrome/browser/captive_portal/testing_utils.h"
 #include "chrome/browser/chromeos/net/network_portal_detector_impl.h"
@@ -15,6 +15,7 @@
 #include "chromeos/dbus/shill_service_client.h"
 #include "chromeos/network/network_state.h"
 #include "chromeos/network/network_state_handler.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "dbus/object_path.h"
 #include "net/base/net_errors.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -40,10 +41,7 @@
 class NetworkPortalDetectorImplTest
     : public testing::Test,
       public captive_portal::CaptivePortalDetectorTestBase {
- public:
-  NetworkPortalDetectorImplTest() {}
-  virtual ~NetworkPortalDetectorImplTest() {}
-
+ protected:
   virtual void SetUp() {
     DBusThreadManager::InitializeWithStub();
     SetupNetworkHandler();
@@ -170,13 +168,13 @@
         dbus::ObjectPath(service_path),
         flimflam::kStateProperty, base::StringValue(flimflam::kStatePortal),
         base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void SetNetworkDeviceEnabled(const std::string& type, bool enabled) {
     NetworkHandler::Get()->network_state_handler()->SetTechnologyEnabled(
         type, enabled, network_handler::ErrorCallback());
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void SetConnected(const std::string& service_path) {
@@ -184,12 +182,12 @@
         dbus::ObjectPath(service_path),
         flimflam::kStateProperty, base::StringValue(flimflam::kStateOnline),
         base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction));
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
  private:
   void SetupDefaultShillState() {
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     ShillServiceClient::TestInterface* service_test =
         DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface();
     service_test->ClearServices();
@@ -218,7 +216,7 @@
     NetworkHandler::Initialize();
   }
 
-  base::MessageLoop message_loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestingProfile> profile_;
   scoped_ptr<NetworkPortalDetectorImpl> network_portal_detector_;
 };
@@ -381,7 +379,7 @@
   ASSERT_EQ(0, attempt_count());
 
   SetConnected(kStubWireless1);
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // First portal detection timeouts, next portal detection is
   // scheduled.
@@ -444,7 +442,7 @@
   ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay());
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 204, NULL);
   ASSERT_TRUE(is_state_idle());
@@ -470,7 +468,7 @@
   ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay());
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 503, retry_after);
   ASSERT_TRUE(is_state_portal_detection_pending());
@@ -478,7 +476,7 @@
   ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay());
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 503, retry_after);
   ASSERT_TRUE(is_state_idle());
@@ -499,7 +497,7 @@
                    kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 407, NULL);
   ASSERT_EQ(2, attempt_count());
@@ -508,7 +506,7 @@
                    kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 407, NULL);
   ASSERT_EQ(3, attempt_count());
@@ -532,7 +530,7 @@
   ASSERT_TRUE(is_state_portal_detection_pending());
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
                    net::URLFetcher::RESPONSE_CODE_INVALID,
@@ -541,7 +539,7 @@
   ASSERT_TRUE(is_state_portal_detection_pending());
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
                    net::URLFetcher::RESPONSE_CODE_INVALID,
@@ -581,7 +579,7 @@
       kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 204, NULL);
 
@@ -592,7 +590,7 @@
       kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   disable_lazy_detection();
 
@@ -623,7 +621,7 @@
                    kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
                    net::URLFetcher::RESPONSE_CODE_INVALID,
@@ -634,7 +632,7 @@
                    kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   CompleteURLFetch(net::OK, 200, NULL);
   ASSERT_EQ(3, attempt_count());
@@ -643,7 +641,7 @@
                    kStubWireless1);
 
   // To run CaptivePortalDetector::DetectCaptivePortal().
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   disable_lazy_detection();
 
@@ -693,7 +691,7 @@
   ASSERT_TRUE(is_state_portal_detection_pending());
   ASSERT_FALSE(start_detection_if_idle());
 
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(is_state_checking_for_portal());
   CompleteURLFetch(net::OK, 200, NULL);
 
@@ -716,13 +714,13 @@
 
   // Second portal detection attempt for cellular1 uses 10sec timeout.
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   CheckRequestTimeoutAndCompleteAttempt(2, 10, net::ERR_CONNECTION_CLOSED,
                                         net::URLFetcher::RESPONSE_CODE_INVALID);
 
   // Third portal detection attempt for cellular1 uses 15sec timeout.
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED,
                                         net::URLFetcher::RESPONSE_CODE_INVALID);
 
@@ -731,7 +729,7 @@
   // Check that in lazy detection for cellular1 15sec timeout is used.
   enable_lazy_detection();
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   disable_lazy_detection();
   CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED,
                                         net::URLFetcher::RESPONSE_CODE_INVALID);
@@ -746,14 +744,14 @@
 
   // Second portal detection attempt for wifi1 also uses 5sec timeout.
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   CheckRequestTimeoutAndCompleteAttempt(2, 10, net::OK, 204);
   ASSERT_TRUE(is_state_idle());
 
   // Check that in lazy detection for wifi1 5sec timeout is used.
   enable_lazy_detection();
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   disable_lazy_detection();
   CheckRequestTimeoutAndCompleteAttempt(3, 15, net::OK, 204);
   ASSERT_TRUE(is_state_idle());
@@ -768,13 +766,13 @@
   CheckRequestTimeoutAndCompleteAttempt(1, 5, net::ERR_CONNECTION_CLOSED,
                                         net::URLFetcher::RESPONSE_CODE_INVALID);
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Second portal detection attempt for wifi1 uses 10sec timeout.
   CheckRequestTimeoutAndCompleteAttempt(2, 10, net::ERR_CONNECTION_CLOSED,
                                         net::URLFetcher::RESPONSE_CODE_INVALID);
   ASSERT_TRUE(is_state_portal_detection_pending());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Second portal detection attempt for wifi1 uses 15sec timeout.
   CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED,
@@ -785,7 +783,7 @@
   ASSERT_TRUE(is_state_portal_detection_pending());
 
   // First portal detection attempt for wifi1 uses 5sec timeout.
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   CheckRequestTimeoutAndCompleteAttempt(1, 5, net::OK, 204);
   ASSERT_TRUE(is_state_idle());
 }
diff --git a/chrome/browser/chromeos/net/onc_utils.cc b/chrome/browser/chromeos/net/onc_utils.cc
index f897272..80ec98c 100644
--- a/chrome/browser/chromeos/net/onc_utils.cc
+++ b/chrome/browser/chromeos/net/onc_utils.cc
@@ -170,7 +170,11 @@
     const std::string& hashed_username,
     base::ListValue* network_configs) {
   const chromeos::User* user = GetLoggedInUserByHash(hashed_username);
-  DCHECK(user);
+  if (!user) {
+    // In tests no user may be logged in. It's not harmful if we just don't
+    // expand the strings.
+    return;
+  }
   UserStringSubstitution substitution(user);
   chromeos::onc::ExpandStringsInNetworks(substitution, network_configs);
 }
diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc
index 8de2ba7..b52eccb 100644
--- a/chrome/browser/chromeos/options/network_config_view.cc
+++ b/chrome/browser/chromeos/options/network_config_view.cc
@@ -11,6 +11,8 @@
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/chromeos/cros/network_property_ui_data.h"
 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
+#include "chrome/browser/chromeos/login/user.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
 #include "chrome/browser/chromeos/options/vpn_config_view.h"
 #include "chrome/browser/chromeos/options/wifi_config_view.h"
 #include "chrome/browser/chromeos/options/wimax_config_view.h"
@@ -19,6 +21,7 @@
 #include "chrome/browser/ui/browser_finder.h"
 #include "chrome/browser/ui/browser_window.h"
 #include "chrome/browser/ui/host_desktop.h"
+#include "chromeos/network/managed_network_configuration_handler.h"
 #include "grit/chromium_strings.h"
 #include "grit/generated_resources.h"
 #include "grit/locale_settings.h"
@@ -290,8 +293,11 @@
 const base::DictionaryValue* NetworkConfigView::FindPolicyForActiveUser(
     const Network* network,
     onc::ONCSource* onc_source) {
-  *onc_source = network->ui_data().onc_source();
-  return NetworkLibrary::Get()->FindOncForNetwork(network->unique_id());
+  const User* user = UserManager::Get()->GetActiveUser();
+  std::string username_hash = user ? user->username_hash() : std::string();
+  std::string guid = network->unique_id();
+  return NetworkHandler::Get()->managed_network_configuration_handler()
+      ->FindPolicyByGUID(username_hash, guid, onc_source);
 }
 
 void ControlledSettingIndicatorView::Layout() {
diff --git a/chrome/browser/chromeos/policy/power_policy_browsertest.cc b/chrome/browser/chromeos/policy/power_policy_browsertest.cc
index 37a0ca1..842321f 100644
--- a/chrome/browser/chromeos/policy/power_policy_browsertest.cc
+++ b/chrome/browser/chromeos/policy/power_policy_browsertest.cc
@@ -261,7 +261,7 @@
 
   // Wait for the login screen to be shown.
   content::WindowedNotificationObserver(
-      chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+      chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
       content::NotificationService::AllSources()).Wait();
 }
 
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
index 53c3c82..7c3d9df 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc
@@ -33,7 +33,7 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chrome/test/base/testing_profile_manager.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "net/url_request/test_url_fetcher_factory.h"
@@ -75,9 +75,7 @@
 class UserCloudPolicyManagerChromeOSTest : public testing::Test {
  protected:
   UserCloudPolicyManagerChromeOSTest()
-      : ui_thread_(content::BrowserThread::UI, &loop_),
-        io_thread_(content::BrowserThread::IO, &loop_),
-        store_(NULL),
+      : store_(NULL),
         profile_(NULL),
         signin_profile_(NULL) {}
 
@@ -90,14 +88,13 @@
     profile_ = profile_manager_->CreateTestingProfile(
         chrome::kInitialProfile, scoped_ptr<PrefServiceSyncable>(),
         UTF8ToUTF16("testing_profile"), 0);
-    signin_profile_ = profile_manager_->CreateTestingProfile("signin_profile");
+    signin_profile_ = profile_manager_->CreateTestingProfile(kSigninProfile);
     signin_profile_->set_incognito(true);
     // Usually the signin Profile and the main Profile are separate, but since
     // the signin Profile is an OTR Profile then for this test it suffices to
     // attach it to the main Profile.
     profile_->SetOffTheRecordProfile(signin_profile_);
     signin_profile_->SetOriginalProfile(profile_);
-    signin_profile_->CreateRequestContext();
     ASSERT_EQ(signin_profile_, chromeos::ProfileHelper::GetSigninProfile());
 
     chrome::RegisterLocalState(prefs_.registry());
@@ -136,7 +133,10 @@
       manager_->RemoveObserver(&observer_);
       manager_->Shutdown();
     }
-    signin_profile_->ResetRequestContext();
+    signin_profile_ = NULL;
+    profile_ = NULL;
+    profile_manager_->DeleteTestingProfile(kSigninProfile);
+    profile_manager_->DeleteTestingProfile(chrome::kInitialProfile);
   }
 
   void CreateManager(bool wait_for_fetch) {
@@ -265,11 +265,9 @@
     EXPECT_TRUE(manager_->policies().Equals(expected_bundle_));
   }
 
-  // Required by the refresh scheduler that's created by the manager.
-  base::MessageLoop loop_;
-  content::TestBrowserThread ui_thread_;
-  // Required to cleanup the URLRequestContextGetter of the |signin_profile_|.
-  content::TestBrowserThread io_thread_;
+  // Required by the refresh scheduler that's created by the manager and
+  // for the cleanup of URLRequestContextGetter in the |signin_profile_|.
+  content::TestBrowserThreadBundle thread_bundle_;
 
   // Convenience policy objects.
   em::PolicyData policy_data_;
@@ -292,10 +290,15 @@
   TestingProfile* profile_;
   TestingProfile* signin_profile_;
 
+  static const char kSigninProfile[];
+
  private:
   DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerChromeOSTest);
 };
 
+const char UserCloudPolicyManagerChromeOSTest::kSigninProfile[] =
+    "signin_profile";
+
 TEST_F(UserCloudPolicyManagerChromeOSTest, BlockingFirstFetch) {
   // Tests the initialization of a manager whose Profile is waiting for the
   // initial fetch, when the policy cache is empty.
diff --git a/chrome/browser/chromeos/power/power_prefs.cc b/chrome/browser/chromeos/power/power_prefs.cc
index c2081bb..c05f074 100644
--- a/chrome/browser/chromeos/power/power_prefs.cc
+++ b/chrome/browser/chromeos/power/power_prefs.cc
@@ -28,7 +28,7 @@
     : power_policy_controller_(power_policy_controller),
       profile_(NULL) {
   notification_registrar_.Add(this,
-                              chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+                              chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                               content::NotificationService::AllSources());
   notification_registrar_.Add(this,
                               chrome::NOTIFICATION_SESSION_STARTED,
@@ -75,7 +75,7 @@
                          const content::NotificationSource& source,
                          const content::NotificationDetails& details) {
   switch (type) {
-    case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: {
+    case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
       // Update |profile_| when entering the login screen.
       ProfileManager* profile_manager = g_browser_process->profile_manager();
       if (!profile_manager || !profile_manager->IsLoggedIn())
diff --git a/chrome/browser/chromeos/power/power_prefs_unittest.cc b/chrome/browser/chromeos/power/power_prefs_unittest.cc
index e5cd2d3..6b3cd2d 100644
--- a/chrome/browser/chromeos/power/power_prefs_unittest.cc
+++ b/chrome/browser/chromeos/power/power_prefs_unittest.cc
@@ -165,7 +165,7 @@
   login_profile->set_incognito(true);
 
   // Inform power_prefs_ that the login screen is being shown.
-  power_prefs_->Observe(chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+  power_prefs_->Observe(chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                         content::Source<PowerPrefsTest>(this),
                         content::NotificationService::NoDetails());
 
@@ -236,7 +236,7 @@
             GetCurrentAllowScreenWakeLocks());
 
   // Simulate the login screen coming up as part of screen locking.
-  power_prefs_->Observe(chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+  power_prefs_->Observe(chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                         content::Source<PowerPrefsTest>(this),
                         content::NotificationService::NoDetails());
 
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index 8c2fdb4..a7f7ed9 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -785,13 +785,12 @@
       ShowNetworkSettings(network_id);
   }
 
-  virtual void AddBluetoothDevice() OVERRIDE {
-    // Open the Bluetooth device dialog, which automatically starts the
-    // discovery process.
+  virtual void ManageBluetoothDevices() OVERRIDE {
     content::RecordAction(
-        content::UserMetricsAction("OpenAddBluetoothDeviceDialog"));
-    chrome::ShowSettingsSubPage(GetAppropriateBrowser(),
-                                chrome::kBluetoothAddDeviceSubPage);
+        content::UserMetricsAction("ShowBluetoothSettingsPage"));
+    std::string sub_page = std::string(chrome::kSearchSubPage) + "#" +
+        l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH);
+    chrome::ShowSettingsSubPage(GetAppropriateBrowser(), sub_page);
   }
 
   virtual void ToggleBluetooth() OVERRIDE {
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc b/chrome/browser/content_settings/permission_queue_controller.cc
similarity index 78%
rename from chrome/browser/geolocation/geolocation_infobar_queue_controller.cc
rename to chrome/browser/content_settings/permission_queue_controller.cc
index 69eb13e..84a5592 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc
+++ b/chrome/browser/content_settings/permission_queue_controller.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
 
 #include "base/prefs/pref_service.h"
 #include "chrome/browser/chrome_notification_types.h"
@@ -21,11 +21,9 @@
 #include "content/public/browser/web_contents.h"
 
 
-// Utilities ------------------------------------------------------------------
-
 namespace {
 
-InfoBarService* GetInfoBarService(const GeolocationPermissionRequestID& id) {
+InfoBarService* GetInfoBarService(const PermissionRequestID& id) {
   content::WebContents* web_contents =
       tab_util::GetWebContentsByID(id.render_process_id(), id.render_view_id());
   return web_contents ? InfoBarService::FromWebContents(web_contents) : NULL;
@@ -34,11 +32,9 @@
 }
 
 
-// GeolocationInfoBarQueueController::PendingInfoBarRequest -------------------
-
-class GeolocationInfoBarQueueController::PendingInfoBarRequest {
+class PermissionQueueController::PendingInfoBarRequest {
  public:
-  PendingInfoBarRequest(const GeolocationPermissionRequestID& id,
+  PendingInfoBarRequest(const PermissionRequestID& id,
                         const GURL& requesting_frame,
                         const GURL& embedder,
                         PermissionDecidedCallback callback);
@@ -47,17 +43,17 @@
   bool IsForPair(const GURL& requesting_frame,
                  const GURL& embedder) const;
 
-  const GeolocationPermissionRequestID& id() const { return id_; }
+  const PermissionRequestID& id() const { return id_; }
   const GURL& requesting_frame() const { return requesting_frame_; }
   bool has_infobar() const { return !!infobar_; }
   InfoBarDelegate* infobar() { return infobar_; }
 
   void RunCallback(bool allowed);
-  void CreateInfoBar(GeolocationInfoBarQueueController* controller,
+  void CreateInfoBar(PermissionQueueController* controller,
                      const std::string& display_languages);
 
  private:
-  GeolocationPermissionRequestID id_;
+  PermissionRequestID id_;
   GURL requesting_frame_;
   GURL embedder_;
   PermissionDecidedCallback callback_;
@@ -66,8 +62,8 @@
   // Purposefully do not disable copying, as this is stored in STL containers.
 };
 
-GeolocationInfoBarQueueController::PendingInfoBarRequest::PendingInfoBarRequest(
-    const GeolocationPermissionRequestID& id,
+PermissionQueueController::PendingInfoBarRequest::PendingInfoBarRequest(
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     PermissionDecidedCallback callback)
@@ -78,42 +74,41 @@
       infobar_(NULL) {
 }
 
-GeolocationInfoBarQueueController::PendingInfoBarRequest::
-    ~PendingInfoBarRequest() {
+PermissionQueueController::PendingInfoBarRequest::~PendingInfoBarRequest() {
 }
 
-bool GeolocationInfoBarQueueController::PendingInfoBarRequest::IsForPair(
+bool PermissionQueueController::PendingInfoBarRequest::IsForPair(
     const GURL& requesting_frame,
     const GURL& embedder) const {
   return (requesting_frame_ == requesting_frame) && (embedder_ == embedder);
 }
 
-void GeolocationInfoBarQueueController::PendingInfoBarRequest::RunCallback(
+void PermissionQueueController::PendingInfoBarRequest::RunCallback(
     bool allowed) {
   callback_.Run(allowed);
 }
 
-void GeolocationInfoBarQueueController::PendingInfoBarRequest::
-    CreateInfoBar(GeolocationInfoBarQueueController* controller,
-                  const std::string& display_languages) {
+void PermissionQueueController::PendingInfoBarRequest::CreateInfoBar(
+    PermissionQueueController* controller,
+    const std::string& display_languages) {
+  // TODO(toyoshim): Remove following dependency on geolocation.
   infobar_ = GeolocationInfoBarDelegate::Create(
       GetInfoBarService(id_), controller, id_, requesting_frame_,
       display_languages);
 }
 
 
-// GeolocationInfoBarQueueController ------------------------------------------
-
-GeolocationInfoBarQueueController::GeolocationInfoBarQueueController(
-    Profile* profile)
-    : profile_(profile) {
+PermissionQueueController::PermissionQueueController(
+    Profile* profile, ContentSettingsType type)
+    : profile_(profile),
+      type_(type) {
 }
 
-GeolocationInfoBarQueueController::~GeolocationInfoBarQueueController() {
+PermissionQueueController::~PermissionQueueController() {
 }
 
-void GeolocationInfoBarQueueController::CreateInfoBarRequest(
-    const GeolocationPermissionRequestID& id,
+void PermissionQueueController::CreateInfoBarRequest(
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     PermissionDecidedCallback callback) {
@@ -131,8 +126,8 @@
     ShowQueuedInfoBarForTab(id);
 }
 
-void GeolocationInfoBarQueueController::CancelInfoBarRequest(
-    const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::CancelInfoBarRequest(
+    const PermissionRequestID& id) {
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
 
   for (PendingInfoBarRequests::iterator i(pending_infobar_requests_.begin());
@@ -147,8 +142,8 @@
   }
 }
 
-void GeolocationInfoBarQueueController::OnPermissionSet(
-    const GeolocationPermissionRequestID& id,
+void PermissionQueueController::OnPermissionSet(
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     bool update_content_setting,
@@ -197,7 +192,7 @@
     i->RunCallback(allowed);
 }
 
-void GeolocationInfoBarQueueController::Observe(
+void PermissionQueueController::Observe(
     int type,
     const content::NotificationSource& source,
     const content::NotificationDetails& details) {
@@ -216,7 +211,7 @@
   for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin();
        i != pending_infobar_requests_.end(); ++i) {
     if (i->infobar() == infobar) {
-      GeolocationPermissionRequestID id(i->id());
+      PermissionRequestID id(i->id());
       pending_infobar_requests_.erase(i);
       ShowQueuedInfoBarForTab(id);
       return;
@@ -224,8 +219,8 @@
   }
 }
 
-bool GeolocationInfoBarQueueController::AlreadyShowingInfoBarForTab(
-    const GeolocationPermissionRequestID& id) const {
+bool PermissionQueueController::AlreadyShowingInfoBarForTab(
+    const PermissionRequestID& id) const {
   for (PendingInfoBarRequests::const_iterator i(
            pending_infobar_requests_.begin());
        i != pending_infobar_requests_.end(); ++i) {
@@ -235,8 +230,8 @@
   return false;
 }
 
-void GeolocationInfoBarQueueController::ShowQueuedInfoBarForTab(
-    const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::ShowQueuedInfoBarForTab(
+    const PermissionRequestID& id) {
   DCHECK(!AlreadyShowingInfoBarForTab(id));
 
   InfoBarService* infobar_service = GetInfoBarService(id);
@@ -264,8 +259,8 @@
   UnregisterForInfoBarNotifications(infobar_service);
 }
 
-void GeolocationInfoBarQueueController::ClearPendingInfoBarRequestsForTab(
-    const GeolocationPermissionRequestID& id) {
+void PermissionQueueController::ClearPendingInfoBarRequestsForTab(
+    const PermissionRequestID& id) {
   for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin();
        i != pending_infobar_requests_.end(); ) {
     if (i->id().IsForSameTabAs(id)) {
@@ -277,7 +272,7 @@
   }
 }
 
-void GeolocationInfoBarQueueController::RegisterForInfoBarNotifications(
+void PermissionQueueController::RegisterForInfoBarNotifications(
     InfoBarService* infobar_service) {
   if (!registrar_.IsRegistered(
       this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
@@ -288,7 +283,7 @@
   }
 }
 
-void GeolocationInfoBarQueueController::UnregisterForInfoBarNotifications(
+void PermissionQueueController::UnregisterForInfoBarNotifications(
     InfoBarService* infobar_service) {
   if (registrar_.IsRegistered(
       this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
@@ -299,7 +294,7 @@
   }
 }
 
-void GeolocationInfoBarQueueController::UpdateContentSetting(
+void PermissionQueueController::UpdateContentSetting(
     const GURL& requesting_frame,
     const GURL& embedder,
     bool allowed) {
@@ -315,7 +310,7 @@
   profile_->GetHostContentSettingsMap()->SetContentSetting(
       ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()),
       ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()),
-      CONTENT_SETTINGS_TYPE_GEOLOCATION,
+      type_,
       std::string(),
       content_setting);
 }
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h b/chrome/browser/content_settings/permission_queue_controller.h
similarity index 69%
rename from chrome/browser/geolocation/geolocation_infobar_queue_controller.h
rename to chrome/browser/content_settings/permission_queue_controller.h
index cc87cba..3da215b 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h
+++ b/chrome/browser/content_settings/permission_queue_controller.h
@@ -1,48 +1,49 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
-#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
+#ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
+#define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
 
 #include "base/bind.h"
+#include "chrome/common/content_settings_types.h"
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
 
 class GURL;
-class GeolocationPermissionRequestID;
+class PermissionRequestID;
 class InfoBarService;
 class Profile;
 
-// This class controls the geolocation infobar queue per profile, and it's
-// used by GeolocationPermissionContext.
+// This class controls an infobar queue per profile, and it's used by
+// GeolocationPermissionContext, and so on.
 // An alternate approach would be to have this queue per tab, and use
 // notifications to broadcast when permission is set / listen to notification to
 // cancel pending requests. This may be specially useful if there are other
 // things listening for such notifications.
 // For the time being this class is self-contained and it doesn't seem pulling
 // the notification infrastructure would simplify.
-class GeolocationInfoBarQueueController : content::NotificationObserver {
+class PermissionQueueController : content::NotificationObserver {
  public:
   typedef base::Callback<void(bool /* allowed */)> PermissionDecidedCallback;
 
-  explicit GeolocationInfoBarQueueController(Profile* profile);
-  virtual ~GeolocationInfoBarQueueController();
+  PermissionQueueController(Profile* profile, ContentSettingsType type);
+  virtual ~PermissionQueueController();
 
   // The InfoBar will be displayed immediately if the tab is not already
   // displaying one, otherwise it'll be queued.
-  void CreateInfoBarRequest(const GeolocationPermissionRequestID& id,
+  void CreateInfoBarRequest(const PermissionRequestID& id,
                             const GURL& requesting_frame,
                             const GURL& embedder,
                             PermissionDecidedCallback callback);
 
   // Cancels a specific infobar request.
-  void CancelInfoBarRequest(const GeolocationPermissionRequestID& id);
+  void CancelInfoBarRequest(const PermissionRequestID& id);
 
   // Called by the InfoBarDelegate to notify permission has been set.
   // It'll notify and dismiss any other pending InfoBar request for the same
   // |requesting_frame| and embedder.
-  void OnPermissionSet(const GeolocationPermissionRequestID& id,
+  void OnPermissionSet(const PermissionRequestID& id,
                        const GURL& requesting_frame,
                        const GURL& embedder,
                        bool update_content_setting,
@@ -62,18 +63,16 @@
 
   // Returns true if a geolocation infobar is already visible for the tab
   // corresponding to |id|.
-  bool AlreadyShowingInfoBarForTab(
-      const GeolocationPermissionRequestID& id) const;
+  bool AlreadyShowingInfoBarForTab(const PermissionRequestID& id) const;
 
   // Shows the next pending infobar for the tab corresponding to |id|, if any.
   // Note that this may not be the pending request whose ID is |id| if other
   // requests are higher in the queue.  If we can't show infobars because there
   // is no InfoBarService for this tab, removes all queued requests for this
   // tab.
-  void ShowQueuedInfoBarForTab(const GeolocationPermissionRequestID& id);
+  void ShowQueuedInfoBarForTab(const PermissionRequestID& id);
 
-  void ClearPendingInfoBarRequestsForTab(
-      const GeolocationPermissionRequestID& id);
+  void ClearPendingInfoBarRequestsForTab(const PermissionRequestID& id);
 
   void RegisterForInfoBarNotifications(InfoBarService* infobar_service);
   void UnregisterForInfoBarNotifications(InfoBarService* infobar_service);
@@ -84,9 +83,10 @@
   content::NotificationRegistrar registrar_;
 
   Profile* const profile_;
+  ContentSettingsType type_;
   PendingInfoBarRequests pending_infobar_requests_;
 
-  DISALLOW_COPY_AND_ASSIGN(GeolocationInfoBarQueueController);
+  DISALLOW_COPY_AND_ASSIGN(PermissionQueueController);
 };
 
-#endif  // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_QUEUE_CONTROLLER_H_
+#endif  // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_QUEUE_CONTROLLER_H_
diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc b/chrome/browser/content_settings/permission_queue_controller_unittest.cc
similarity index 77%
rename from chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc
rename to chrome/browser/content_settings/permission_queue_controller_unittest.cc
index 10f563c..8ff0a21 100644
--- a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc
+++ b/chrome/browser/content_settings/permission_queue_controller_unittest.cc
@@ -1,12 +1,13 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
 
 #include "base/synchronization/waitable_event.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
 #include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/common/content_settings_types.h"
 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/web_contents.h"
@@ -14,24 +15,22 @@
 #include "content/public/test/test_browser_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-class GeolocationInfoBarQueueControllerTests
-    : public ChromeRenderViewHostTestHarness {
+class PermissionQueueControllerTests : public ChromeRenderViewHostTestHarness {
  protected:
   virtual void SetUp() OVERRIDE {
     ChromeRenderViewHostTestHarness::SetUp();
     InfoBarService::CreateForWebContents(web_contents());
   }
 
-  GeolocationPermissionRequestID RequestID(int bridge_id) {
-    return GeolocationPermissionRequestID(
+  PermissionRequestID RequestID(int bridge_id) {
+    return PermissionRequestID(
         web_contents()->GetRenderProcessHost()->GetID(),
         web_contents()->GetRenderViewHost()->GetRoutingID(),
         bridge_id);
   }
 };
 
-class ObservationCountingQueueController :
-    public GeolocationInfoBarQueueController {
+class ObservationCountingQueueController : public PermissionQueueController {
  public:
   explicit ObservationCountingQueueController(Profile* profile);
 
@@ -40,12 +39,12 @@
  private:
   int call_count_;
 
-  // GeolocationInfoBarQueueController
+  // PermissionQueueController
   virtual void Observe(int type,
                        const content::NotificationSource& source,
                        const content::NotificationDetails& details) OVERRIDE;
 
-  static void NotifyPermissionSet(const GeolocationPermissionRequestID& id,
+  static void NotifyPermissionSet(const PermissionRequestID& id,
                                   const GURL& requesting_frame,
                                   base::Callback<void(bool)> callback,
                                   bool allowed);
@@ -53,8 +52,7 @@
 
 ObservationCountingQueueController::ObservationCountingQueueController(
     Profile* profile)
-    : GeolocationInfoBarQueueController(
-          profile),
+    : PermissionQueueController(profile, CONTENT_SETTINGS_TYPE_GEOLOCATION),
       call_count_(0) {
 }
 
@@ -63,18 +61,18 @@
     const content::NotificationSource& source,
     const content::NotificationDetails& details) {
   ++call_count_;
-  GeolocationInfoBarQueueController::Observe(type, source, details);
+  PermissionQueueController::Observe(type, source, details);
 }
 
 void ObservationCountingQueueController::NotifyPermissionSet(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     base::Callback<void(bool)> callback,
     bool allowed) {
 }
 
 
-TEST_F(GeolocationInfoBarQueueControllerTests,
+TEST_F(PermissionQueueControllerTests,
        OneObservationPerInfoBarCancelled) {
   // When an infobar is cancelled, the infobar helper sends a notification to
   // the controller. If the controller has another infobar queued, it should
diff --git a/chrome/browser/content_settings/permission_request_id.cc b/chrome/browser/content_settings/permission_request_id.cc
new file mode 100644
index 0000000..ec47459
--- /dev/null
+++ b/chrome/browser/content_settings/permission_request_id.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/content_settings/permission_request_id.h"
+
+#include "base/strings/stringprintf.h"
+
+
+PermissionRequestID::PermissionRequestID(int render_process_id,
+                                         int render_view_id,
+                                         int bridge_id)
+    : render_process_id_(render_process_id),
+      render_view_id_(render_view_id),
+      bridge_id_(bridge_id) {
+}
+
+PermissionRequestID::~PermissionRequestID() {
+}
+
+bool PermissionRequestID::Equals(const PermissionRequestID& other) const {
+  return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_);
+}
+
+bool PermissionRequestID::IsForSameTabAs(
+    const PermissionRequestID& other) const {
+  return (render_process_id_ == other.render_process_id_) &&
+      (render_view_id_ == other.render_view_id_);
+}
+
+std::string PermissionRequestID::ToString() const {
+  return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_,
+                            bridge_id_);
+}
diff --git a/chrome/browser/content_settings/permission_request_id.h b/chrome/browser/content_settings/permission_request_id.h
new file mode 100644
index 0000000..14bc274
--- /dev/null
+++ b/chrome/browser/content_settings/permission_request_id.h
@@ -0,0 +1,32 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
+#define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
+
+#include <string>
+
+// Uniquely identifies a particular permission request.
+class PermissionRequestID {
+ public:
+  PermissionRequestID(int render_process_id, int render_view_id, int bridge_id);
+  ~PermissionRequestID();
+
+  int render_process_id() const { return render_process_id_; }
+  int render_view_id() const { return render_view_id_; }
+  int bridge_id() const { return bridge_id_; }
+
+  bool Equals(const PermissionRequestID& other) const;
+  bool IsForSameTabAs(const PermissionRequestID& other) const;
+  std::string ToString() const;
+
+ private:
+  int render_process_id_;
+  int render_view_id_;
+  int bridge_id_;
+
+  // Purposefully do not disable copying, as this is stored in STL containers.
+};
+
+#endif  // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_REQUEST_ID_H_
diff --git a/chrome/browser/crash_upload_list.cc b/chrome/browser/crash_upload_list.cc
index 12a069c..911fec4 100644
--- a/chrome/browser/crash_upload_list.cc
+++ b/chrome/browser/crash_upload_list.cc
@@ -5,7 +5,6 @@
 #include "chrome/browser/crash_upload_list.h"
 
 #include "base/files/file_path.h"
-#include "base/message_loop/message_loop_proxy.h"
 #include "base/path_service.h"
 #include "chrome/common/chrome_paths.h"
 #if defined(OS_WIN)
@@ -30,8 +29,6 @@
 
 CrashUploadList::CrashUploadList(Delegate* delegate,
                                  const base::FilePath& upload_log_path)
-    : base::UploadList(delegate,
-                       upload_log_path,
-                       base::MessageLoopProxy::current()) {}
+    : UploadList(delegate, upload_log_path) {}
 
 CrashUploadList::~CrashUploadList() {}
diff --git a/chrome/browser/crash_upload_list.h b/chrome/browser/crash_upload_list.h
index b7ff6cf..f0b201c 100644
--- a/chrome/browser/crash_upload_list.h
+++ b/chrome/browser/crash_upload_list.h
@@ -5,10 +5,10 @@
 #ifndef CHROME_BROWSER_CRASH_UPLOAD_LIST_H_
 #define CHROME_BROWSER_CRASH_UPLOAD_LIST_H_
 
-#include "base/upload_list.h"
+#include "chrome/browser/upload_list.h"
 
 // An upload list manager for crash reports from breakpad.
-class CrashUploadList : public base::UploadList {
+class CrashUploadList : public UploadList {
  public:
   // Static factory method that creates the platform-specific implementation
   // of the crash upload list with the given callback delegate.
diff --git a/chrome/browser/devtools/adb/android_usb_device.cc b/chrome/browser/devtools/adb/android_usb_device.cc
index 0f662d5..9408328 100644
--- a/chrome/browser/devtools/adb/android_usb_device.cc
+++ b/chrome/browser/devtools/adb/android_usb_device.cc
@@ -22,9 +22,6 @@
 
 namespace {
 
-void Noop() {}
-void BoolNoop(bool success) {}
-
 const size_t kHeaderSize = 24;
 
 const int kAdbClass = 0xff;
@@ -38,7 +35,7 @@
 
 static const char kHostConnectMessage[] = "host::";
 
-typedef std::vector<scoped_refptr<UsbDevice> > UsbDevices;
+typedef std::vector<scoped_refptr<UsbDeviceHandle> > UsbDevices;
 
 base::LazyInstance<AndroidUsbDevices>::Leaky g_devices =
     LAZY_INSTANCE_INITIALIZER;
@@ -93,26 +90,9 @@
   return std::string();
 }
 
-static void InterfaceClaimed(crypto::RSAPrivateKey* rsa_key,
-                             scoped_refptr<UsbDevice> usb_device,
-                             int inbound_address,
-                             int outbound_address,
-                             int zero_mask,
-                             AndroidUsbDevices* devices,
-                             bool success) {
-  if (!success)
-    return;
-
-  std::string serial = ReadSerialNumSync(usb_device->handle());
-  scoped_refptr<AndroidUsbDevice> device =
-      new AndroidUsbDevice(rsa_key, usb_device, serial, inbound_address,
-                           outbound_address, zero_mask);
-  devices->push_back(device);
-}
-
 static void ClaimInterface(
     crypto::RSAPrivateKey* rsa_key,
-    scoped_refptr<UsbDevice> usb_device,
+    scoped_refptr<UsbDeviceHandle> usb_device,
     const UsbInterface* interface,
     AndroidUsbDevices* devices) {
   if (interface->GetNumAltSettings() == 0)
@@ -147,24 +127,14 @@
   if (inbound_address == 0 || outbound_address == 0)
     return;
 
-  usb_device->ClaimInterface(1, base::Bind(&InterfaceClaimed,
-                                           rsa_key, usb_device,
-                                           inbound_address, outbound_address,
-                                           zero_mask, devices));
-}
-
-static void InterfacesListed(
-    crypto::RSAPrivateKey* rsa_key,
-    scoped_refptr<UsbDevice> usb_device,
-    scoped_refptr<UsbConfigDescriptor> config,
-    AndroidUsbDevices* devices,
-    bool success) {
-  if (!success)
+  if (!usb_device->ClaimInterface(1))
     return;
-  for (size_t j = 0; j < config->GetNumInterfaces(); ++j) {
-    ClaimInterface(rsa_key, usb_device, config->GetInterface(j),
-                   devices);
-  }
+
+  std::string serial = ReadSerialNumSync(usb_device->handle());
+  scoped_refptr<AndroidUsbDevice> device =
+      new AndroidUsbDevice(rsa_key, usb_device, serial, inbound_address,
+                           outbound_address, zero_mask);
+  devices->push_back(device);
 }
 
 static uint32 Checksum(const std::string& data) {
@@ -231,12 +201,12 @@
 
   // GC Android devices with no actual usb device.
   AndroidUsbDevices::iterator it = g_devices.Get().begin();
-  std::set<UsbDevice*> claimed_devices;
+  std::set<UsbDeviceHandle*> claimed_devices;
   while (it != g_devices.Get().end()) {
     bool found_device = false;
     for (UsbDevices::iterator it2 = usb_devices.begin();
          it2 != usb_devices.end() && !found_device; ++it2) {
-      UsbDevice* usb_device = it2->get();
+      UsbDeviceHandle* usb_device = it2->get();
       AndroidUsbDevice* device = it->get();
       if (usb_device == device->usb_device_) {
         found_device = true;
@@ -253,20 +223,23 @@
   // Add new devices.
   for (UsbDevices::iterator it = usb_devices.begin(); it != usb_devices.end();
        ++it) {
-    scoped_refptr<UsbDevice> usb_device = *it;
+    scoped_refptr<UsbDeviceHandle> usb_device = *it;
     if (claimed_devices.find(usb_device.get()) != claimed_devices.end())
       continue;
     scoped_refptr<UsbConfigDescriptor> config = new UsbConfigDescriptor();
-    usb_device->ListInterfaces(config.get(),
-                               base::Bind(&InterfacesListed, rsa_key,
-                                          usb_device, config,
-                                          &g_devices.Get()));
+    bool success = usb_device->ListInterfaces(config.get());
+    if (!success)
+      continue;
+    for (size_t j = 0; j < config->GetNumInterfaces(); ++j) {
+      ClaimInterface(rsa_key, usb_device, config->GetInterface(j),
+                     &g_devices.Get());
+    }
   }
   callback.Run(g_devices.Get());
 }
 
 AndroidUsbDevice::AndroidUsbDevice(crypto::RSAPrivateKey* rsa_key,
-                                   scoped_refptr<UsbDevice> usb_device,
+                                   scoped_refptr<UsbDeviceHandle> usb_device,
                                    const std::string& serial,
                                    int inbound_address,
                                    int outbound_address,
@@ -533,8 +506,8 @@
     it->second->Terminated();
   }
 
-  usb_device_->ReleaseInterface(1, base::Bind(&BoolNoop));
-  usb_device_->Close(base::Bind(&Noop));
+  usb_device_->ReleaseInterface(1);
+  usb_device_->Close();
 }
 
 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) {
diff --git a/chrome/browser/devtools/adb/android_usb_device.h b/chrome/browser/devtools/adb/android_usb_device.h
index 6a8292d..5578ea1 100644
--- a/chrome/browser/devtools/adb/android_usb_device.h
+++ b/chrome/browser/devtools/adb/android_usb_device.h
@@ -9,7 +9,7 @@
 #include <queue>
 #include <vector>
 #include "base/memory/ref_counted.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 
 namespace base {
 class MessageLoop;
@@ -72,7 +72,7 @@
                         const AndroidUsbDevicesCallback& callback);
 
   AndroidUsbDevice(crypto::RSAPrivateKey* rsa_key,
-                   scoped_refptr<UsbDevice> device,
+                   scoped_refptr<UsbDeviceHandle> device,
                    const std::string& serial,
                    int inbound_address,
                    int outbound_address,
@@ -127,7 +127,7 @@
   scoped_ptr<crypto::RSAPrivateKey> rsa_key_;
 
   // Device info
-  scoped_refptr<UsbDevice> usb_device_;
+  scoped_refptr<UsbDeviceHandle> usb_device_;
   std::string serial_;
   int inbound_address_;
   int outbound_address_;
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 7331349..e1e1f42 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -34,12 +34,12 @@
 #include "chrome/browser/platform_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
-#include "chrome/common/extensions/extension.h"
 #include "chrome/common/pref_names.h"
 #include "components/user_prefs/pref_registry_syncable.h"
 #include "content/public/browser/download_item.h"
 #include "content/public/browser/download_manager.h"
 #include "content/public/browser/notification_source.h"
+#include "extensions/common/constants.h"
 
 #if defined(OS_CHROMEOS)
 #include "chrome/browser/chromeos/drive/download_handler.h"
@@ -231,7 +231,7 @@
   // TODO(asanka): This determination is done based on |path|, while
   // ShouldOpenDownload() detects extension downloads based on the
   // characteristics of the download. Reconcile this. http://crbug.com/167702
-  if (extensions::Extension::IsExtension(path))
+  if (path.MatchesExtension(extensions::kExtensionFileExtension))
     return false;
   return download_prefs_->IsAutoOpenEnabledBasedOnExtension(path);
 }
@@ -525,23 +525,28 @@
   if (item->GetDangerType() == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS ||
       item->GetDangerType() ==
       content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT) {
+    content::DownloadDangerType danger_type =
+        content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
     switch (result) {
       case DownloadProtectionService::SAFE:
         // Do nothing.
         break;
       case DownloadProtectionService::DANGEROUS:
-        item->OnContentCheckCompleted(
-            content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT);
+        danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT;
         break;
       case DownloadProtectionService::UNCOMMON:
-        item->OnContentCheckCompleted(
-            content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT);
+        danger_type = content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT;
         break;
       case DownloadProtectionService::DANGEROUS_HOST:
-        item->OnContentCheckCompleted(
-            content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST);
+        danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST;
+        break;
+      case DownloadProtectionService::POTENTIALLY_UNWANTED:
+        danger_type = content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED;
         break;
     }
+
+    if (danger_type != content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
+      item->OnContentCheckCompleted(danger_type);
   }
 
   SafeBrowsingState* state = static_cast<SafeBrowsingState*>(
diff --git a/chrome/browser/download/download_danger_prompt.cc b/chrome/browser/download/download_danger_prompt.cc
index d75c6cc..95ec322 100644
--- a/chrome/browser/download/download_danger_prompt.cc
+++ b/chrome/browser/download/download_danger_prompt.cc
@@ -124,10 +124,18 @@
       return l10n_util::GetStringFUTF16(
           IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
           download_->GetFileNameToReportUser().LossyDisplayName());
-    default:
-      NOTREACHED();
-      return string16();
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
+      return l10n_util::GetStringFUTF16(
+          IDS_PROMPT_POTENTIALLY_UNWANTED_DOWNLOAD,
+          download_->GetFileNameToReportUser().LossyDisplayName());
+    case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
+    case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
+    case content::DOWNLOAD_DANGER_TYPE_MAX:
+      break;
   }
+  NOTREACHED();
+  return string16();
 }
 
 string16 DownloadDangerPromptImpl::GetAcceptButtonTitle() {
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index f8dc3db..22c14ff 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -301,6 +301,8 @@
                                            int base_width) const {
   // Should only be called if IsDangerous().
   DCHECK(IsDangerous());
+  string16 elided_filename =
+      ui::ElideFilename(download_->GetFileNameToReportUser(), font, base_width);
   switch (download_->GetDangerType()) {
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
       return l10n_util::GetStringUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_URL);
@@ -310,31 +312,30 @@
         return l10n_util::GetStringUTF16(
             IDS_PROMPT_DANGEROUS_DOWNLOAD_EXTENSION);
       } else {
-        return l10n_util::GetStringFUTF16(
-            IDS_PROMPT_DANGEROUS_DOWNLOAD,
-            ui::ElideFilename(download_->GetFileNameToReportUser(),
-                              font, base_width));
+        return l10n_util::GetStringFUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD,
+                                          elided_filename);
       }
 
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
-      return l10n_util::GetStringFUTF16(
-          IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
-          ui::ElideFilename(download_->GetFileNameToReportUser(),
-                            font, base_width));
+      return l10n_util::GetStringFUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
+                                        elided_filename);
 
     case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
+      return l10n_util::GetStringFUTF16(IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
+                                        elided_filename);
+
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
       return l10n_util::GetStringFUTF16(
-          IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
-          ui::ElideFilename(download_->GetFileNameToReportUser(),
-                            font, base_width));
+          IDS_PROMPT_POTENTIALLY_UNWANTED_DOWNLOAD, elided_filename);
 
     case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
     case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
     case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
     case content::DOWNLOAD_DANGER_TYPE_MAX:
-      NOTREACHED();
+      break;
   }
+  NOTREACHED();
   return string16();
 }
 
@@ -378,6 +379,7 @@
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
     case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
       return true;
 
     case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index 794886f..02429b4 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -17,12 +17,12 @@
 #include "chrome/browser/history/history_service.h"
 #include "chrome/browser/history/history_service_factory.h"
 #include "chrome/browser/profiles/profile.h"
-#include "chrome/common/extensions/extension.h"
 #include "chrome/common/extensions/feature_switch.h"
 #include "chrome/common/pref_names.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/download_interrupt_reasons.h"
+#include "extensions/common/constants.h"
 #include "grit/generated_resources.h"
 #include "net/base/net_util.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -551,7 +551,7 @@
   //    don't bother asking where to keep it.
   if (download_prefs_->PromptForDownload() &&
       !download_crx_util::IsExtensionDownload(*download_) &&
-      !extensions::Extension::IsExtension(filename) &&
+      !filename.MatchesExtension(extensions::kExtensionFileExtension) &&
       !download_prefs_->IsAutoOpenEnabledBasedOnExtension(filename))
     return true;
 
diff --git a/chrome/browser/extensions/activity_log/api_name_constants.h b/chrome/browser/extensions/activity_log/api_name_constants.h
index 0fe950d..77367a3 100644
--- a/chrome/browser/extensions/activity_log/api_name_constants.h
+++ b/chrome/browser/extensions/activity_log/api_name_constants.h
@@ -196,7 +196,8 @@
     "system.cpu.getInfo",
     "system.display.getInfo",
     "system.display.onDisplayChanged",
-    "system.display.setDisplayProperties"
+    "system.display.setDisplayProperties",
+    "system.memory.getInfo"
 };
 
 }  // namespace activity_log_api_name_constants
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
index 8d24989..aa526ed 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -920,15 +920,9 @@
 
 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
     ClearPrexistingDirectoryContent(const base::FilePath& project_path) {
-  if (!base::DeleteFile(project_path, true/*recursive*/)) {
-    SetError("Error in copying files from sync filesystem.");
-    content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
-        base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction::
-                       SendResponse,
-                   this,
-                   false));
-    return;
-  }
+
+  // Clear the project directory before copying new files.
+  base::DeleteFile(project_path, true/*recursive*/);
 
   pendingCopyOperationsCount_ = 1;
 
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 0ebe8c5..03d6613 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -106,6 +106,7 @@
 const char kDangerKey[] = "danger";
 const char kDangerSafe[] = "safe";
 const char kDangerUncommon[] = "uncommon";
+const char kDangerUnwanted[] = "unwanted";
 const char kDangerAccepted[] = "accepted";
 const char kDangerHost[] = "host";
 const char kDangerUrl[] = "url";
@@ -146,6 +147,7 @@
   kDangerUncommon,
   kDangerAccepted,
   kDangerHost,
+  kDangerUnwanted
 };
 COMPILE_ASSERT(arraysize(kDangerStrings) == content::DOWNLOAD_DANGER_TYPE_MAX,
                download_danger_type_enum_changed);
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index d0a5800..8dd4197 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -34,6 +34,10 @@
 namespace {
 
 const char kResultKey[] = "result";
+const char kUnexpectedProgressValueForNonProgressType[] =
+    "The progress value should not be specified for non-progress notification";
+const char kInvalidProgressValue[] =
+    "The progress value should range from 0 to 100";
 
 // Converts an object with width, height, and data in RGBA format into an
 // gfx::Image (in ARGB format).
@@ -276,6 +280,20 @@
     if (has_list_items != (type == message_center::NOTIFICATION_TYPE_MULTIPLE))
       return false;
 
+    if (options->progress.get() != NULL) {
+      // We should have progress if and only if the type is a progress type.
+      if (type != message_center::NOTIFICATION_TYPE_PROGRESS) {
+        SetError(kUnexpectedProgressValueForNonProgressType);
+        return false;
+      }
+      optional_fields.progress = *options->progress;
+      // Progress value should range from 0 to 100.
+      if (optional_fields.progress < 0 || optional_fields.progress > 100) {
+        SetError(kInvalidProgressValue);
+        return false;
+      }
+    }
+
     if (has_list_items) {
       using api::notifications::NotificationItem;
       std::vector<linked_ptr<NotificationItem> >::iterator i;
@@ -333,6 +351,8 @@
       return message_center::NOTIFICATION_TYPE_IMAGE;
     case api::notifications::TEMPLATE_TYPE_LIST:
       return message_center::NOTIFICATION_TYPE_MULTIPLE;
+    case api::notifications::TEMPLATE_TYPE_PROGRESS:
+      return message_center::NOTIFICATION_TYPE_PROGRESS;
     default:
       // Gracefully handle newer application code that is running on an older
       // runtime that doesn't recognize the requested template.
diff --git a/chrome/browser/extensions/api/notifications/notifications_apitest.cc b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
index 3a6e2b2..5ea2a9f 100644
--- a/chrome/browser/extensions/api/notifications/notifications_apitest.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_apitest.cc
@@ -388,3 +388,117 @@
     EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
   }
 }
+
+
+#if defined(OS_LINUX)
+#define MAYBE_TestProgressNotification DISABLED_TestProgressNotification
+#else
+#define MAYBE_TestProgressNotification TestProgressNotification
+#endif
+
+IN_PROC_BROWSER_TEST_F(NotificationsApiTest, MAYBE_TestProgressNotification) {
+  scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
+
+  {
+    scoped_refptr<extensions::NotificationsCreateFunction>
+        notification_create_function(
+            new extensions::NotificationsCreateFunction());
+    notification_create_function->set_extension(empty_extension.get());
+    notification_create_function->set_has_callback(true);
+
+    scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
+        notification_create_function.get(),
+        "[\"\", "
+        "{"
+        "\"type\": \"progress\","
+        "\"iconUrl\": \"an/image/that/does/not/exist.png\","
+        "\"title\": \"Test!\","
+        "\"message\": \"This is a progress notification.\","
+        "\"priority\": 1,"
+        "\"eventTime\": 1234567890.12345678,"
+        "\"progress\": 30"
+        "}]",
+        browser(),
+        utils::NONE));
+
+    std::string notification_id;
+    EXPECT_EQ(base::Value::TYPE_STRING, result->GetType());
+    EXPECT_TRUE(result->GetAsString(&notification_id));
+    EXPECT_TRUE(notification_id.length() > 0);
+  }
+
+  // Error case: progress value provided for non-progress type.
+  {
+    scoped_refptr<extensions::NotificationsCreateFunction>
+        notification_create_function(
+            new extensions::NotificationsCreateFunction());
+    notification_create_function->set_extension(empty_extension.get());
+    notification_create_function->set_has_callback(true);
+
+    utils::RunFunction(
+        notification_create_function.get(),
+        "[\"\", "
+        "{"
+        "\"type\": \"basic\","
+        "\"iconUrl\": \"an/image/that/does/not/exist.png\","
+        "\"title\": \"Test!\","
+        "\"message\": \"This is a progress notification.\","
+        "\"priority\": 1,"
+        "\"eventTime\": 1234567890.12345678,"
+        "\"progress\": 10"
+        "}]",
+        browser(),
+        utils::NONE);
+    EXPECT_FALSE(notification_create_function->GetError().empty());
+  }
+
+  // Error case: progress value less than lower bound.
+  {
+    scoped_refptr<extensions::NotificationsCreateFunction>
+        notification_create_function(
+            new extensions::NotificationsCreateFunction());
+    notification_create_function->set_extension(empty_extension.get());
+    notification_create_function->set_has_callback(true);
+
+    utils::RunFunction(
+        notification_create_function.get(),
+        "[\"\", "
+        "{"
+        "\"type\": \"progress\","
+        "\"iconUrl\": \"an/image/that/does/not/exist.png\","
+        "\"title\": \"Test!\","
+        "\"message\": \"This is a progress notification.\","
+        "\"priority\": 1,"
+        "\"eventTime\": 1234567890.12345678,"
+        "\"progress\": -10"
+        "}]",
+        browser(),
+        utils::NONE);
+    EXPECT_FALSE(notification_create_function->GetError().empty());
+  }
+
+  // Error case: progress value greater than upper bound.
+  {
+    scoped_refptr<extensions::NotificationsCreateFunction>
+        notification_create_function(
+            new extensions::NotificationsCreateFunction());
+    notification_create_function->set_extension(empty_extension.get());
+    notification_create_function->set_has_callback(true);
+
+    utils::RunFunction(
+        notification_create_function.get(),
+        "[\"\", "
+        "{"
+        "\"type\": \"progress\","
+        "\"iconUrl\": \"an/image/that/does/not/exist.png\","
+        "\"title\": \"Test!\","
+        "\"message\": \"This is a progress notification.\","
+        "\"priority\": 1,"
+        "\"eventTime\": 1234567890.12345678,"
+        "\"progress\": 101"
+        "}]",
+        browser(),
+        utils::NONE);
+    EXPECT_FALSE(notification_create_function->GetError().empty());
+  }
+}
diff --git a/chrome/browser/extensions/api/system_info/system_info_api.cc b/chrome/browser/extensions/api/system_info/system_info_api.cc
index d203948..cb7822c 100644
--- a/chrome/browser/extensions/api/system_info/system_info_api.cc
+++ b/chrome/browser/extensions/api/system_info/system_info_api.cc
@@ -85,9 +85,6 @@
   virtual void OnRemovableStorageDetached(
       const chrome::StorageInfo& info) OVERRIDE;
 
-  void DispatchStorageAttachedEvent(const chrome::StorageInfo& info,
-                                    int64 avail_bytes);
-
   // Called from any thread to dispatch the systemInfo event to all extension
   // processes cross multiple profiles.
   void DispatchEvent(const std::string& event_name,
@@ -217,29 +214,8 @@
 
 void SystemInfoEventRouter::OnRemovableStorageAttached(
     const chrome::StorageInfo& info) {
-  base::PostTaskAndReplyWithResult(
-      BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
-          base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN),
-      FROM_HERE,
-      base::Bind(&StorageInfoProvider::GetStorageFreeSpaceFromTransientId,
-                 StorageInfoProvider::Get(),
-                 StorageInfoProvider::Get()->GetTransientIdForDeviceId(
-                     info.device_id())),
-      base::Bind(&SystemInfoEventRouter::DispatchStorageAttachedEvent,
-                 // Since SystemInfoEventRouter is a global lazy instance, this
-                 // pointer will be alive when the reply comes back.
-                 base::Unretained(this),
-                 info));
-}
-
-void SystemInfoEventRouter::DispatchStorageAttachedEvent(
-    const chrome::StorageInfo& info, int64 avail_bytes) {
   StorageUnitInfo unit;
   systeminfo::BuildStorageUnitInfo(info, &unit);
-
-  unit.available_capacity =
-      avail_bytes > 0 ? static_cast<double>(avail_bytes) : 0;
-
   scoped_ptr<base::ListValue> args(new base::ListValue);
   args->Append(unit.ToValue().release());
   DispatchEvent(event_names::kOnStorageAttached, args.Pass());
diff --git a/chrome/browser/extensions/api/system_info_memory/memory_info_provider.h b/chrome/browser/extensions/api/system_info_memory/memory_info_provider.h
deleted file mode 100644
index 1948c7a..0000000
--- a/chrome/browser/extensions/api/system_info_memory/memory_info_provider.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_MEMORY_INFO_PROVIDER_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_MEMORY_INFO_PROVIDER_H_
-
-#include "chrome/browser/extensions/api/system_info/system_info_provider.h"
-#include "chrome/common/extensions/api/system_info_memory.h"
-
-namespace extensions {
-
-class MemoryInfoProvider
-    : public SystemInfoProvider<
-          api::system_info_memory::MemoryInfo> {
- public:
-  static MemoryInfoProvider* Get();
-
-  // Overriden from SystemInfoProvider<MemoryInfo>.
-  virtual bool QueryInfo() OVERRIDE;
-
-  const api::system_info_memory::MemoryInfo& memory_info() const;
-
- private:
-  friend class SystemInfoProvider<
-      api::system_info_memory::MemoryInfo>;
-  friend class MockMemoryInfoProviderImpl;
-
-  MemoryInfoProvider();
-  virtual ~MemoryInfoProvider();
-
-  DISALLOW_COPY_AND_ASSIGN(MemoryInfoProvider);
-};
-
-}  // namespace extensions
-
-#endif  // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_MEMORY_INFO_PROVIDER_H_
-
diff --git a/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.cc b/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.cc
deleted file mode 100644
index 7439294..0000000
--- a/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/api/system_info_memory/system_info_memory_api.h"
-
-#include "chrome/browser/extensions/api/system_info_memory/memory_info_provider.h"
-
-namespace extensions {
-
-using api::system_info_memory::MemoryInfo;
-
-SystemInfoMemoryGetFunction::SystemInfoMemoryGetFunction() {}
-
-SystemInfoMemoryGetFunction::~SystemInfoMemoryGetFunction() {}
-
-bool SystemInfoMemoryGetFunction::RunImpl() {
-  MemoryInfoProvider::Get()->StartQueryInfo(
-      base::Bind(&SystemInfoMemoryGetFunction::OnGetMemoryInfoCompleted, this));
-  return true;
-}
-
-void SystemInfoMemoryGetFunction::OnGetMemoryInfoCompleted(bool success) {
-  if (success)
-    SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release());
-  else
-    SetError("Error occurred when querying memory information.");
-  SendResponse(success);
-}
-
-}  // namespace extensions
diff --git a/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.h b/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.h
deleted file mode 100644
index 410fbf6..0000000
--- a/chrome/browser/extensions/api/system_info_memory/system_info_memory_api.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_SYSTEM_INFO_MEMORY_API_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_SYSTEM_INFO_MEMORY_API_H_
-
-#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/common/extensions/api/system_info_memory.h"
-
-namespace extensions {
-
-class SystemInfoMemoryGetFunction : public AsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("systemInfo.memory.get", SYSTEMINFO_MEMORY_GET)
-  SystemInfoMemoryGetFunction();
-
- private:
-  virtual ~SystemInfoMemoryGetFunction();
-  virtual bool RunImpl() OVERRIDE;
-  void OnGetMemoryInfoCompleted(bool success);
-};
-
-}  // namespace extensions
-
-#endif  // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_MEMORY_SYSTEM_INFO_MEMORY_API_H__
diff --git a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
index c43fe8f..c868769 100644
--- a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
+++ b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
@@ -34,7 +34,6 @@
   unit->type = chrome::StorageInfo::IsRemovableDevice(info.device_id()) ?
       STORAGE_UNIT_TYPE_REMOVABLE : STORAGE_UNIT_TYPE_FIXED;
   unit->capacity = static_cast<double>(info.total_size_in_bytes());
-  unit->available_capacity = 0;
 }
 
 }  // namespace systeminfo
@@ -61,8 +60,7 @@
 }
 
 void StorageInfoProvider::PrepareQueryOnUIThread() {
-  // Get all available storage devices before invoking |QueryInfo()| to get
-  // available capacity.
+  // Get all available storage devices before invoking |QueryInfo()|.
   GetAllStoragesIntoInfoList();
 }
 
@@ -77,13 +75,8 @@
 
 bool StorageInfoProvider::QueryInfo() {
   DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
-  for (StorageUnitInfoList::iterator it = info_.begin();
-       it != info_.end(); ++it) {
-    int64 amount = GetStorageFreeSpaceFromTransientId((*it)->id);
-    if (amount > 0)
-      (*it)->available_capacity = static_cast<double>(amount);
-  }
-
+  // No info to query since we get all available storage devices' info in
+  // |PrepareQueryOnUIThread()|.
   return true;
 }
 
diff --git a/chrome/browser/extensions/api/system_info_memory/memory_info_provider.cc b/chrome/browser/extensions/api/system_memory/memory_info_provider.cc
similarity index 82%
rename from chrome/browser/extensions/api/system_info_memory/memory_info_provider.cc
rename to chrome/browser/extensions/api/system_memory/memory_info_provider.cc
index 4bef0ed..0858183 100644
--- a/chrome/browser/extensions/api/system_info_memory/memory_info_provider.cc
+++ b/chrome/browser/extensions/api/system_memory/memory_info_provider.cc
@@ -1,14 +1,14 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/extensions/api/system_info_memory/memory_info_provider.h"
+#include "chrome/browser/extensions/api/system_memory/memory_info_provider.h"
 
 #include "base/sys_info.h"
 
 namespace extensions {
 
-using api::system_info_memory::MemoryInfo;
+using api::system_memory::MemoryInfo;
 
 // Static member intialization.
 template<>
diff --git a/chrome/browser/extensions/api/system_memory/memory_info_provider.h b/chrome/browser/extensions/api/system_memory/memory_info_provider.h
new file mode 100644
index 0000000..54d0449
--- /dev/null
+++ b/chrome/browser/extensions/api/system_memory/memory_info_provider.h
@@ -0,0 +1,36 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_MEMORY_INFO_PROVIDER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_MEMORY_INFO_PROVIDER_H_
+
+#include "chrome/browser/extensions/api/system_info/system_info_provider.h"
+#include "chrome/common/extensions/api/system_memory.h"
+
+namespace extensions {
+
+class MemoryInfoProvider
+    : public SystemInfoProvider<api::system_memory::MemoryInfo> {
+ public:
+  static MemoryInfoProvider* Get();
+
+  // Overriden from SystemInfoProvider<MemoryInfo>.
+  virtual bool QueryInfo() OVERRIDE;
+
+  const api::system_memory::MemoryInfo& memory_info() const;
+
+ private:
+  friend class SystemInfoProvider<api::system_memory::MemoryInfo>;
+  friend class MockMemoryInfoProviderImpl;
+
+  MemoryInfoProvider();
+  virtual ~MemoryInfoProvider();
+
+  DISALLOW_COPY_AND_ASSIGN(MemoryInfoProvider);
+};
+
+}  // namespace extensions
+
+#endif  // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_MEMORY_INFO_PROVIDER_H_
+
diff --git a/chrome/browser/extensions/api/system_memory/system_memory_api.cc b/chrome/browser/extensions/api/system_memory/system_memory_api.cc
new file mode 100644
index 0000000..7556410
--- /dev/null
+++ b/chrome/browser/extensions/api/system_memory/system_memory_api.cc
@@ -0,0 +1,31 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/system_memory/system_memory_api.h"
+
+#include "chrome/browser/extensions/api/system_memory/memory_info_provider.h"
+
+namespace extensions {
+
+using api::system_memory::MemoryInfo;
+
+SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() {}
+
+SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() {}
+
+bool SystemMemoryGetInfoFunction::RunImpl() {
+  MemoryInfoProvider::Get()->StartQueryInfo(
+      base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this));
+  return true;
+}
+
+void SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted(bool success) {
+  if (success)
+    SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release());
+  else
+    SetError("Error occurred when querying memory information.");
+  SendResponse(success);
+}
+
+}  // namespace extensions
diff --git a/chrome/browser/extensions/api/system_memory/system_memory_api.h b/chrome/browser/extensions/api/system_memory/system_memory_api.h
new file mode 100644
index 0000000..b6ef065
--- /dev/null
+++ b/chrome/browser/extensions/api/system_memory/system_memory_api.h
@@ -0,0 +1,26 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_SYSTEM_MEMORY_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_SYSTEM_MEMORY_API_H_
+
+#include "chrome/browser/extensions/extension_function.h"
+#include "chrome/common/extensions/api/system_memory.h"
+
+namespace extensions {
+
+class SystemMemoryGetInfoFunction : public AsyncExtensionFunction {
+ public:
+  DECLARE_EXTENSION_FUNCTION("system.memory.getInfo", SYSTEM_MEMORY_GETINFO)
+  SystemMemoryGetInfoFunction();
+
+ private:
+  virtual ~SystemMemoryGetInfoFunction();
+  virtual bool RunImpl() OVERRIDE;
+  void OnGetMemoryInfoCompleted(bool success);
+};
+
+}  // namespace extensions
+
+#endif  // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_MEMORY_SYSTEM_MEMORY_API_H_
diff --git a/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc b/chrome/browser/extensions/api/system_memory/system_memory_apitest.cc
similarity index 77%
rename from chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc
rename to chrome/browser/extensions/api/system_memory/system_memory_apitest.cc
index 0f070ec..9440074 100644
--- a/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc
+++ b/chrome/browser/extensions/api/system_memory/system_memory_apitest.cc
@@ -1,10 +1,10 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
-#include "chrome/browser/extensions/api/system_info_memory/memory_info_provider.h"
+#include "chrome/browser/extensions/api/system_memory/memory_info_provider.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/extensions/extension_test_message_listener.h"
 #include "chrome/common/chrome_switches.h"
@@ -12,7 +12,7 @@
 
 namespace extensions {
 
-using api::system_info_memory::MemoryInfo;
+using api::system_memory::MemoryInfo;
 
 const char kExtensionId[] = "lfmcnjhchhgejbpbonjobnlbcgcnmjif";
 
@@ -29,10 +29,10 @@
   virtual ~MockMemoryInfoProviderImpl() {}
 };
 
-class SystemInfoMemoryApiTest: public ExtensionApiTest {
+class SystemMemoryApiTest: public ExtensionApiTest {
  public:
-  SystemInfoMemoryApiTest() {}
-  virtual ~SystemInfoMemoryApiTest() {}
+  SystemMemoryApiTest() {}
+  virtual ~SystemMemoryApiTest() {}
 
   virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
     ExtensionApiTest::SetUpCommandLine(command_line);
@@ -49,11 +49,11 @@
   scoped_ptr<base::MessageLoop> message_loop_;
 };
 
-IN_PROC_BROWSER_TEST_F(SystemInfoMemoryApiTest, Memory) {
+IN_PROC_BROWSER_TEST_F(SystemMemoryApiTest, Memory) {
   scoped_refptr<MemoryInfoProvider> provider = new MockMemoryInfoProviderImpl();
   // The provider is owned by the single MemoryInfoProvider instance.
   MemoryInfoProvider::InitializeForTesting(provider);
-  ASSERT_TRUE(RunExtensionTest("systeminfo/memory")) << message_;
+  ASSERT_TRUE(RunExtensionTest("system/memory")) << message_;
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/usb/usb_api.cc b/chrome/browser/extensions/api/usb/usb_api.cc
index c4bb050..5b123ad 100644
--- a/chrome/browser/extensions/api/usb/usb_api.cc
+++ b/chrome/browser/extensions/api/usb/usb_api.cc
@@ -11,6 +11,7 @@
 #include "chrome/browser/extensions/api/usb/usb_device_resource.h"
 #include "chrome/browser/extensions/extension_system.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 #include "chrome/browser/usb/usb_service.h"
 #include "chrome/browser/usb/usb_service_factory.h"
 #include "chrome/common/extensions/api/usb.h"
@@ -89,7 +90,7 @@
 static const int kMaxPackets = 4 * 1024 * 1024;
 static const int kMaxPacketLength = 64 * 1024;
 
-static UsbDevice* device_for_test_ = NULL;
+static UsbDeviceHandle* device_for_test_ = NULL;
 
 static bool ConvertDirectionToApi(const UsbEndpointDirection& input,
                                   Direction* output) {
@@ -184,19 +185,19 @@
 }
 
 static bool ConvertRequestType(const RequestType& input,
-                               UsbDevice::TransferRequestType* output) {
+                               UsbDeviceHandle::TransferRequestType* output) {
   switch (input) {
     case usb::REQUEST_TYPE_STANDARD:
-      *output = UsbDevice::STANDARD;
+      *output = UsbDeviceHandle::STANDARD;
       return true;
     case usb::REQUEST_TYPE_CLASS:
-      *output = UsbDevice::CLASS;
+      *output = UsbDeviceHandle::CLASS;
       return true;
     case usb::REQUEST_TYPE_VENDOR:
-      *output = UsbDevice::VENDOR;
+      *output = UsbDeviceHandle::VENDOR;
       return true;
     case usb::REQUEST_TYPE_RESERVED:
-      *output = UsbDevice::RESERVED;
+      *output = UsbDeviceHandle::RESERVED;
       return true;
     default:
       NOTREACHED();
@@ -205,19 +206,19 @@
 }
 
 static bool ConvertRecipient(const Recipient& input,
-                             UsbDevice::TransferRecipient* output) {
+                             UsbDeviceHandle::TransferRecipient* output) {
   switch (input) {
     case usb::RECIPIENT_DEVICE:
-      *output = UsbDevice::DEVICE;
+      *output = UsbDeviceHandle::DEVICE;
       return true;
     case usb::RECIPIENT_INTERFACE:
-      *output = UsbDevice::INTERFACE;
+      *output = UsbDeviceHandle::INTERFACE;
       return true;
     case usb::RECIPIENT_ENDPOINT:
-      *output = UsbDevice::ENDPOINT;
+      *output = UsbDeviceHandle::ENDPOINT;
       return true;
     case usb::RECIPIENT_OTHER:
-      *output = UsbDevice::OTHER;
+      *output = UsbDeviceHandle::OTHER;
       return true;
     default:
       NOTREACHED();
@@ -383,7 +384,7 @@
 }
 
 bool UsbAsyncApiTransferFunction::ConvertRequestTypeSafely(
-    const RequestType& input, UsbDevice::TransferRequestType* output) {
+    const RequestType& input, UsbDeviceHandle::TransferRequestType* output) {
   const bool converted = ConvertRequestType(input, output);
   if (!converted)
     SetError(kErrorConvertRequestType);
@@ -391,7 +392,7 @@
 }
 
 bool UsbAsyncApiTransferFunction::ConvertRecipientSafely(
-    const Recipient& input, UsbDevice::TransferRecipient* output) {
+    const Recipient& input, UsbDeviceHandle::TransferRecipient* output) {
   const bool converted = ConvertRecipient(input, output);
   if (!converted)
     SetError(kErrorConvertRecipient);
@@ -402,7 +403,7 @@
 
 UsbFindDevicesFunction::~UsbFindDevicesFunction() {}
 
-void UsbFindDevicesFunction::SetDeviceForTest(UsbDevice* device) {
+void UsbFindDevicesFunction::SetDeviceForTest(UsbDeviceHandle* device) {
   device_for_test_ = device;
 }
 
@@ -454,7 +455,7 @@
 
 void UsbFindDevicesFunction::OnCompleted() {
   for (size_t i = 0; i < devices_.size(); ++i) {
-    UsbDevice* const device = devices_[i].get();
+    UsbDeviceHandle* const device = devices_[i].get();
     UsbDeviceResource* const resource =
         new UsbDeviceResource(extension_->id(), device);
 
@@ -487,8 +488,13 @@
   }
 
   config_ = new UsbConfigDescriptor();
-  resource->device()->ListInterfaces(
-      config_.get(), base::Bind(&UsbListInterfacesFunction::OnCompleted, this));
+  BrowserThread::PostTaskAndReplyWithResult(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::ListInterfaces,
+                 resource->device(),
+                 config_),
+      base::Bind(&UsbListInterfacesFunction::OnCompleted, this));
 }
 
 void UsbListInterfacesFunction::OnCompleted(bool success) {
@@ -611,8 +617,11 @@
     return;
   }
 
-  resource->device()->Close(base::Bind(&UsbCloseDeviceFunction::OnCompleted,
-                                     this));
+  BrowserThread::PostTaskAndReply(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::Close, resource->device()),
+      base::Bind(&UsbCloseDeviceFunction::OnCompleted, this));
   RemoveUsbDeviceResource(parameters_->device.handle);
 }
 
@@ -638,7 +647,12 @@
     return;
   }
 
-  resource->device()->ClaimInterface(parameters_->interface_number,
+  BrowserThread::PostTaskAndReplyWithResult(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::ClaimInterface,
+                 resource->device(),
+                 parameters_->interface_number),
       base::Bind(&UsbClaimInterfaceFunction::OnCompleted, this));
 }
 
@@ -666,7 +680,12 @@
     return;
   }
 
-  resource->device()->ReleaseInterface(parameters_->interface_number,
+  BrowserThread::PostTaskAndReplyWithResult(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::ReleaseInterface,
+                 resource->device(),
+                 parameters_->interface_number),
       base::Bind(&UsbReleaseInterfaceFunction::OnCompleted, this));
 }
 
@@ -696,9 +715,13 @@
     return;
   }
 
-  resource->device()->SetInterfaceAlternateSetting(
-      parameters_->interface_number,
-      parameters_->alternate_setting,
+  BrowserThread::PostTaskAndReplyWithResult(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::SetInterfaceAlternateSetting,
+                 resource->device(),
+                 parameters_->interface_number,
+                 parameters_->alternate_setting),
       base::Bind(&UsbSetInterfaceAlternateSettingFunction::OnCompleted, this));
 }
 
@@ -729,8 +752,8 @@
   const ControlTransferInfo& transfer = parameters_->transfer_info;
 
   UsbEndpointDirection direction;
-  UsbDevice::TransferRequestType request_type;
-  UsbDevice::TransferRecipient recipient;
+  UsbDeviceHandle::TransferRequestType request_type;
+  UsbDeviceHandle::TransferRecipient recipient;
   size_t size = 0;
 
   if (!ConvertDirectionSafely(transfer.direction, &direction) ||
@@ -955,8 +978,7 @@
 
 void UsbResetDeviceFunction::OnStartResest(UsbDeviceResource* resource) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
-  resource->device()->ResetDevice(
-      base::Bind(&UsbResetDeviceFunction::OnCompletedFileThread, this));
+  OnCompletedFileThread(resource->device()->ResetDevice());
 }
 
 void UsbResetDeviceFunction::OnCompletedFileThread(bool success) {
@@ -978,8 +1000,12 @@
     }
     // Close the device now because the handle is invalid after an
     // unsuccessful reset.
-    resource->device()->Close(
-        base::Bind(&UsbResetDeviceFunction::OnError, this));
+    BrowserThread::PostTaskAndReply(
+      BrowserThread::FILE,
+      FROM_HERE,
+      base::Bind(&UsbDeviceHandle::Close,
+                 resource->device()),
+      base::Bind(&UsbResetDeviceFunction::OnError, this));
     return;
   }
   SetResult(Value::CreateBooleanValue(true));
diff --git a/chrome/browser/extensions/api/usb/usb_api.h b/chrome/browser/extensions/api/usb/usb_api.h
index f223016..80941fc 100644
--- a/chrome/browser/extensions/api/usb/usb_api.h
+++ b/chrome/browser/extensions/api/usb/usb_api.h
@@ -6,15 +6,16 @@
 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_
 
 #include <string>
+#include <vector>
 
 #include "base/memory/ref_counted.h"
 #include "chrome/browser/extensions/api/api_function.h"
 #include "chrome/browser/extensions/api/api_resource_manager.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 #include "chrome/common/extensions/api/usb.h"
 #include "net/base/io_buffer.h"
 
-class UsbDevice;
+class UsbDeviceHandle;
 
 namespace extensions {
 
@@ -46,9 +47,9 @@
   bool ConvertDirectionSafely(const extensions::api::usb::Direction& input,
                               UsbEndpointDirection* output);
   bool ConvertRequestTypeSafely(const extensions::api::usb::RequestType& input,
-                              UsbDevice::TransferRequestType* output);
+                              UsbDeviceHandle::TransferRequestType* output);
   bool ConvertRecipientSafely(const extensions::api::usb::Recipient& input,
-                              UsbDevice::TransferRecipient* output);
+                              UsbDeviceHandle::TransferRecipient* output);
 
   void OnCompleted(UsbTransferStatus status,
                    scoped_refptr<net::IOBuffer> data,
@@ -61,7 +62,7 @@
 
   UsbFindDevicesFunction();
 
-  static void SetDeviceForTest(UsbDevice* device);
+  static void SetDeviceForTest(UsbDeviceHandle* device);
 
  protected:
   virtual ~UsbFindDevicesFunction();
@@ -73,7 +74,7 @@
   void OnCompleted();
 
   scoped_ptr<base::ListValue> result_;
-  std::vector<scoped_refptr<UsbDevice> > devices_;
+  std::vector<scoped_refptr<UsbDeviceHandle> > devices_;
   scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_;
 };
 
diff --git a/chrome/browser/extensions/api/usb/usb_apitest.cc b/chrome/browser/extensions/api/usb/usb_apitest.cc
index 20f37d9..bb64f14 100644
--- a/chrome/browser/extensions/api/usb/usb_apitest.cc
+++ b/chrome/browser/extensions/api/usb/usb_apitest.cc
@@ -13,25 +13,16 @@
 
 using testing::AnyNumber;
 using testing::_;
+using testing::Return;
 
 namespace {
 
-ACTION(InvokeUsbCallback) {
-  ::std::tr1::get<0>(args).Run();
-}
-
 ACTION_TEMPLATE(InvokeUsbTransferCallback,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_1_VALUE_PARAMS(p1)) {
   ::std::tr1::get<k>(args).Run(p1, new net::IOBuffer(1), 1);
 }
 
-ACTION_TEMPLATE(InvokeUsbResultCallback,
-                HAS_1_TEMPLATE_PARAMS(int, k),
-                AND_1_VALUE_PARAMS(p1)) {
-  ::std::tr1::get<k>(args).Run(p1);
-}
-
 // MSVC erroneously thinks that at least one of the arguments for the transfer
 // methods differ by const or volatility and emits a warning about the old
 // standards-noncompliant behaviour of their compiler.
@@ -39,11 +30,11 @@
 #pragma warning(push)
 #pragma warning(disable:4373)
 #endif
-class MockUsbDevice : public UsbDevice {
+class MockUsbDeviceHandle : public UsbDeviceHandle {
  public:
-  MockUsbDevice() : UsbDevice() {}
+  MockUsbDeviceHandle() : UsbDeviceHandle() {}
 
-  MOCK_METHOD1(Close, void(const base::Callback<void()>& callback));
+  MOCK_METHOD0(Close, void());
 
   MOCK_METHOD10(ControlTransfer, void(const UsbEndpointDirection direction,
       const TransferRequestType request_type, const TransferRecipient recipient,
@@ -64,13 +55,12 @@
       const unsigned int packets, const unsigned int packet_length,
       const unsigned int timeout, const UsbTransferCallback& callback));
 
-  MOCK_METHOD1(ResetDevice, void(const base::Callback<void(bool)>& callback));
+  MOCK_METHOD0(ResetDevice, bool());
 
-  MOCK_METHOD2(ListInterfaces, void(UsbConfigDescriptor* config,
-      const UsbInterfaceCallback& callback));
+  MOCK_METHOD1(ListInterfaces, bool(UsbConfigDescriptor* config));
 
  protected:
-  virtual ~MockUsbDevice() {}
+  virtual ~MockUsbDeviceHandle() {}
 };
 #if defined(OS_WIN)
 #pragma warning(pop)
@@ -84,22 +74,21 @@
   }
 
   virtual void SetUpOnMainThread() OVERRIDE {
-    mock_device_ = new MockUsbDevice();
+    mock_device_ = new MockUsbDeviceHandle();
     extensions::UsbFindDevicesFunction::SetDeviceForTest(mock_device_.get());
   }
 
  protected:
-  scoped_refptr<MockUsbDevice> mock_device_;
+  scoped_refptr<MockUsbDeviceHandle> mock_device_;
 };
 
 }  // namespace
 
 IN_PROC_BROWSER_TEST_F(UsbApiTest, DeviceHandling) {
-  EXPECT_CALL(*mock_device_.get(), Close(_))
-      .WillRepeatedly(InvokeUsbCallback());
-  EXPECT_CALL(*mock_device_.get(), ResetDevice(_))
-      .WillOnce(InvokeUsbResultCallback<0>(true))
-      .WillOnce(InvokeUsbResultCallback<0>(false));
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), ResetDevice())
+      .WillOnce(Return(true))
+      .WillOnce(Return(false));
   EXPECT_CALL(*mock_device_.get(),
               InterruptTransfer(USB_DIRECTION_OUTBOUND, 2, _, 1, _, _))
       .WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_COMPLETED));
@@ -107,17 +96,17 @@
 }
 
 IN_PROC_BROWSER_TEST_F(UsbApiTest, ListInterfaces) {
-  EXPECT_CALL(*mock_device_.get(), ListInterfaces(_, _))
-      .WillOnce(InvokeUsbResultCallback<1>(false));
-  EXPECT_CALL(*mock_device_.get(), Close(_)).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), ListInterfaces(_))
+      .WillOnce(Return(false));
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
   ASSERT_TRUE(RunExtensionTest("usb/list_interfaces"));
 }
 
 IN_PROC_BROWSER_TEST_F(UsbApiTest, TransferEvent) {
   EXPECT_CALL(*mock_device_.get(),
               ControlTransfer(USB_DIRECTION_OUTBOUND,
-                              UsbDevice::STANDARD,
-                              UsbDevice::DEVICE,
+                              UsbDeviceHandle::STANDARD,
+                              UsbDeviceHandle::DEVICE,
                               1,
                               2,
                               3,
@@ -135,14 +124,14 @@
   EXPECT_CALL(*mock_device_.get(),
               IsochronousTransfer(USB_DIRECTION_OUTBOUND, 3, _, 1, 1, 1, _, _))
       .WillOnce(InvokeUsbTransferCallback<7>(USB_TRANSFER_COMPLETED));
-  EXPECT_CALL(*mock_device_.get(), Close(_)).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
   ASSERT_TRUE(RunExtensionTest("usb/transfer_event"));
 }
 
 IN_PROC_BROWSER_TEST_F(UsbApiTest, ZeroLengthTransfer) {
   EXPECT_CALL(*mock_device_.get(), BulkTransfer(_, _, _, 0, _, _))
       .WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_COMPLETED));
-  EXPECT_CALL(*mock_device_.get(), Close(_)).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
   ASSERT_TRUE(RunExtensionTest("usb/zero_length_transfer"));
 }
 
@@ -151,12 +140,12 @@
       .WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_COMPLETED))
       .WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_ERROR))
       .WillOnce(InvokeUsbTransferCallback<5>(USB_TRANSFER_TIMEOUT));
-  EXPECT_CALL(*mock_device_.get(), Close(_)).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
   ASSERT_TRUE(RunExtensionTest("usb/transfer_failure"));
 }
 
 IN_PROC_BROWSER_TEST_F(UsbApiTest, InvalidLengthTransfer) {
-  EXPECT_CALL(*mock_device_.get(), Close(_)).Times(AnyNumber());
+  EXPECT_CALL(*mock_device_.get(), Close()).Times(AnyNumber());
   ASSERT_TRUE(RunExtensionTest("usb/invalid_length_transfer"));
 }
 
diff --git a/chrome/browser/extensions/api/usb/usb_device_resource.cc b/chrome/browser/extensions/api/usb/usb_device_resource.cc
index 4d8aa95..685d24d 100644
--- a/chrome/browser/extensions/api/usb/usb_device_resource.cc
+++ b/chrome/browser/extensions/api/usb/usb_device_resource.cc
@@ -11,7 +11,7 @@
 #include "base/bind_helpers.h"
 #include "base/synchronization/lock.h"
 #include "chrome/browser/extensions/api/api_resource.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 #include "chrome/common/extensions/api/usb.h"
 
 namespace extensions {
@@ -28,7 +28,7 @@
 }
 
 UsbDeviceResource::UsbDeviceResource(const std::string& owner_extension_id,
-                                     scoped_refptr<UsbDevice> device)
+                                     scoped_refptr<UsbDeviceHandle> device)
     : ApiResource(owner_extension_id), device_(device) {}
 
 UsbDeviceResource::~UsbDeviceResource() {}
diff --git a/chrome/browser/extensions/api/usb/usb_device_resource.h b/chrome/browser/extensions/api/usb/usb_device_resource.h
index 15fcca0..6592548 100644
--- a/chrome/browser/extensions/api/usb/usb_device_resource.h
+++ b/chrome/browser/extensions/api/usb/usb_device_resource.h
@@ -6,6 +6,7 @@
 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
 
 #include <set>
+#include <string>
 
 #include "base/basictypes.h"
 #include "base/memory/linked_ptr.h"
@@ -13,10 +14,10 @@
 #include "base/synchronization/lock.h"
 #include "chrome/browser/extensions/api/api_resource.h"
 #include "chrome/browser/extensions/api/api_resource_manager.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 #include "chrome/common/extensions/api/usb.h"
 
-class UsbDevice;
+class UsbDeviceHandle;
 
 namespace net {
 class IOBuffer;
@@ -28,10 +29,10 @@
 class UsbDeviceResource : public ApiResource {
  public:
   UsbDeviceResource(const std::string& owner_extension_id,
-                    scoped_refptr<UsbDevice> device);
+                    scoped_refptr<UsbDeviceHandle> device);
   virtual ~UsbDeviceResource();
 
-  scoped_refptr<UsbDevice> device() {
+  scoped_refptr<UsbDeviceHandle> device() {
     return device_;
   }
 
@@ -41,7 +42,7 @@
     return "UsbDeviceResourceManager";
   }
 
-  scoped_refptr<UsbDevice> device_;
+  scoped_refptr<UsbDeviceHandle> device_;
 
   DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource);
 };
diff --git a/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc b/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc
index b3088d0..db5b0e2 100644
--- a/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc
+++ b/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc
@@ -11,7 +11,7 @@
 #include "chrome/test/base/testing_profile.h"
 #include "chrome/test/base/testing_profile_manager.h"
 #include "content/public/test/mock_render_process_host.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace extensions {
@@ -19,10 +19,7 @@
 namespace {
 
 class BrowserPermissionsPolicyDelegateTest : public testing::Test {
-public:
- BrowserPermissionsPolicyDelegateTest()
-     : loop_(base::MessageLoop::TYPE_UI),
-       ui_thread_(content::BrowserThread::UI, &loop_) {}
+ protected:
   virtual void SetUp() {
     profile_manager_.reset(
         new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
@@ -35,8 +32,7 @@
     profile_manager_.reset();
   }
  protected:
-  base::MessageLoop loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestingProfileManager> profile_manager_;
   TestingProfile* profile_;
 };
diff --git a/chrome/browser/extensions/extension_function_histogram_value.h b/chrome/browser/extensions/extension_function_histogram_value.h
index 2bc33fc..f9123fd 100644
--- a/chrome/browser/extensions/extension_function_histogram_value.h
+++ b/chrome/browser/extensions/extension_function_histogram_value.h
@@ -153,7 +153,7 @@
   APP_CURRENTWINDOWINTERNAL_MINIMIZE,
   DEVELOPERPRIVATE_AUTOUPDATE,
   EXPERIMENTAL_DNS_RESOLVE,
-  EXPERIMENTAL_SYSTEMINFO_MEMORY_GET,
+  DELETED_EXPERIMENTAL_SYSTEMINFO_MEMORY_GET,
   HISTORY_ADDURL,
   TABS_GET,
   BROWSERACTION_SETBADGETEXT,
@@ -545,7 +545,7 @@
   EXPERIMENTAL_SYSTEMINFO_STORAGE_REMOVEWATCH,
   EXPERIMENTAL_SYSTEMINFO_STORAGE_GETALLWATCH,
   EXPERIMENTAL_SYSTEMINFO_STORAGE_REMOVEALLWATCH,
-  SYSTEMINFO_MEMORY_GET,
+  DELETED_SYSTEMINFO_MEMORY_GET,
   ACTIVITYLOGPRIVATE_GETEXTENSIONACTIVITIES,
   RUNTIME_GETPACKAGEDIRECTORYENTRY,
   DELETED_SYSTEMINFO_DISPLAY_SETDISPLAYPROPERTIES,
@@ -570,6 +570,7 @@
   BOOKMARKMANAGERPRIVATE_REMOVETREES,
   SYSTEM_DISPLAY_GETINFO,
   SYSTEM_DISPLAY_SETDISPLAYPROPERTIES,
+  SYSTEM_MEMORY_GETINFO,
   ENUM_BOUNDARY // Last entry: Add new entries above.
 };
 
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 2ec1145..2385d0e 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -482,7 +482,7 @@
 
   std::string path = request->url().path();
   if (path.size() > 1 &&
-      path.substr(1) == extension_filenames::kGeneratedBackgroundPageFilename) {
+      path.substr(1) == extensions::kGeneratedBackgroundPageFilename) {
     return new GeneratedBackgroundPageJob(
         request, network_delegate, extension, content_security_policy);
   }
diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc
index 0e41a0d..2a2ae7c 100644
--- a/chrome/browser/extensions/extension_protocols_unittest.cc
+++ b/chrome/browser/extensions/extension_protocols_unittest.cc
@@ -86,7 +86,8 @@
 class ExtensionProtocolTest : public testing::Test {
  public:
   ExtensionProtocolTest()
-      : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
+    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+      resource_context_(&test_url_request_context_) {}
 
   virtual void SetUp() OVERRIDE {
     testing::Test::SetUp();
@@ -128,6 +129,7 @@
   net::URLRequestJobFactoryImpl job_factory_;
   const net::URLRequestJobFactory* old_factory_;
   net::TestDelegate test_delegate_;
+  net::TestURLRequestContext test_url_request_context_;
   content::MockResourceContext resource_context_;
 };
 
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e3ae629..5439e10 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2896,19 +2896,11 @@
 }
 
 void ExtensionService::SetBeingReloaded(const std::string& extension_id,
-                                         bool isBeingReloaded) {
-  LOG(INFO) << "****** " << __FUNCTION__;
-  LOG(INFO) << "****** " << __FUNCTION__ << " extension_id is: "
-            << extension_id << " and isBeingReloaded is " << isBeingReloaded;
-  LOG(INFO) << "****** " << __FUNCTION__ << " Set size is "
-            << extensions_being_reloaded_.size();
-  if (isBeingReloaded) {
+                                        bool isBeingReloaded) {
+  if (isBeingReloaded)
     extensions_being_reloaded_.insert(extension_id);
-    LOG(INFO) << "****** " << __FUNCTION__ << " insert succeeded.";
-  } else {
+  else
     extensions_being_reloaded_.erase(extension_id);
-    LOG(INFO) << "****** " << __FUNCTION__ << " erase succeeded.";
-  }
 }
 
 bool ExtensionService::HasUsedWebRequest(const Extension* extension) const {
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 580e728..e8f452b 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -578,13 +578,6 @@
   InitializeExtensionService(params);
 }
 
-void ExtensionServiceTestBase::InitializeRequestContext() {
-  ASSERT_TRUE(profile_.get());
-  TestingProfile* profile =
-      static_cast<TestingProfile*>(profile_.get());
-  profile->CreateRequestContext();
-}
-
 // static
 void ExtensionServiceTestBase::SetUpTestCase() {
   ExtensionErrorReporter::Init(false);  // no noisy errors
@@ -1974,7 +1967,6 @@
 // default apps.
 TEST_F(ExtensionServiceTest, DefaultAppsGrantedPermissions) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
   base::FilePath path = data_dir_
       .AppendASCII("permissions");
 
@@ -2607,7 +2599,6 @@
 
 TEST_F(ExtensionServiceTest, InstallAppsWithUnlimitedStorage) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
   EXPECT_TRUE(service_->extensions()->is_empty());
 
   int pref_count = 0;
@@ -2659,7 +2650,6 @@
 
 TEST_F(ExtensionServiceTest, InstallAppsAndCheckStorageProtection) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
   EXPECT_TRUE(service_->extensions()->is_empty());
 
   int pref_count = 0;
@@ -3744,7 +3734,6 @@
 // This tests if default apps are installed correctly.
 TEST_F(ExtensionServiceTest, DefaultAppsInstall) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
   set_extensions_enabled(true);
 
   {
@@ -3853,7 +3842,6 @@
 // Tests reloading extensions.
 TEST_F(ExtensionServiceTest, ReloadExtensions) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
 
   // Simple extension that should install without error.
   base::FilePath path = data_dir_.AppendASCII("good.crx");
@@ -4184,7 +4172,6 @@
 // Verifies app state is removed upon uninstall.
 TEST_F(ExtensionServiceTest, ClearAppData) {
   InitializeEmptyExtensionService();
-  InitializeRequestContext();
   ExtensionCookieCallback callback;
 
   int pref_count = 0;
@@ -5641,7 +5628,6 @@
 
 TEST_F(ExtensionServiceTest, ProcessSyncDataVersionCheck) {
   InitializeExtensionServiceWithUpdater();
-  InitializeRequestContext();
   TestSyncProcessorStub processor;
   service_->MergeDataAndStartSyncing(
       syncer::EXTENSIONS, syncer::SyncDataList(),
@@ -5709,7 +5695,6 @@
 
 TEST_F(ExtensionServiceTest, ProcessSyncDataNotInstalled) {
   InitializeExtensionServiceWithUpdater();
-  InitializeRequestContext();
   TestSyncProcessorStub processor;
   service_->MergeDataAndStartSyncing(
       syncer::EXTENSIONS, syncer::SyncDataList(),
diff --git a/chrome/browser/extensions/extension_service_unittest.h b/chrome/browser/extensions/extension_service_unittest.h
index 24be033..884681e 100644
--- a/chrome/browser/extensions/extension_service_unittest.h
+++ b/chrome/browser/extensions/extension_service_unittest.h
@@ -55,8 +55,6 @@
 
   void InitializeExtensionServiceWithUpdater();
 
-  void InitializeRequestContext();
-
   static void SetUpTestCase();
 
   virtual void SetUp() OVERRIDE;
diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc
index 744eb62..da182b1 100644
--- a/chrome/browser/extensions/pack_extension_job.cc
+++ b/chrome/browser/extensions/pack_extension_job.cc
@@ -9,7 +9,7 @@
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/extensions/extension_creator.h"
-#include "chrome/common/chrome_constants.h"
+#include "extensions/common/constants.h"
 #include "grit/generated_resources.h"
 #include "ui/base/l10n/l10n_util.h"
 
@@ -45,11 +45,11 @@
 
 void PackExtensionJob::Run() {
   crx_file_out_ = base::FilePath(root_directory_.value() +
-                           chrome::kExtensionFileExtension);
+                                 kExtensionFileExtension);
 
   if (key_file_.empty())
     key_file_out_ = base::FilePath(root_directory_.value() +
-                             chrome::kExtensionKeyFileExtension);
+                                   kExtensionKeyFileExtension);
 
   // TODO(aa): Need to internationalize the errors that ExtensionCreator
   // returns. See bug 20734.
diff --git a/chrome/browser/extensions/plugin_manager.cc b/chrome/browser/extensions/plugin_manager.cc
index ff77620..47df4cf 100644
--- a/chrome/browser/extensions/plugin_manager.cc
+++ b/chrome/browser/extensions/plugin_manager.cc
@@ -87,6 +87,8 @@
       PluginService::GetInstance()->PurgePluginListCache(profile_, false);
 
   } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) {
+    if (content::Details<UnloadedExtensionInfo>(details)->already_disabled)
+      return;
     const Extension* extension =
         content::Details<UnloadedExtensionInfo>(details)->extension;
 
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index e2b317f..30d6c94 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -24,7 +24,6 @@
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/chrome_utility_messages.h"
 #include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/extensions/extension_file_util.h"
 #include "chrome/common/extensions/extension_l10n_util.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
@@ -182,7 +181,7 @@
 bool ReadImagesFromFile(const base::FilePath& extension_path,
                         DecodedImages* images) {
   base::FilePath path =
-      extension_path.AppendASCII(extension_filenames::kDecodedImagesFilename);
+      extension_path.AppendASCII(kDecodedImagesFilename);
   std::string file_str;
   if (!file_util::ReadFileToString(path, &file_str))
     return false;
@@ -198,7 +197,7 @@
 bool ReadMessageCatalogsFromFile(const base::FilePath& extension_path,
                                  base::DictionaryValue* catalogs) {
   base::FilePath path = extension_path.AppendASCII(
-      extension_filenames::kDecodedMessageCatalogsFilename);
+      kDecodedMessageCatalogsFilename);
   std::string file_str;
   if (!file_util::ReadFileToString(path, &file_str))
     return false;
@@ -264,8 +263,7 @@
     return;  // ReportFailure() already called.
 
   // Initialize the path that will eventually contain the unpacked extension.
-  extension_root_ = temp_dir_.path().AppendASCII(
-      extension_filenames::kTempExtensionName);
+  extension_root_ = temp_dir_.path().AppendASCII(kTempExtensionName);
   PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackUnpackedCrxPathLength",
                         extension_root_);
 
diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
index 1bf0018..39f634e 100644
--- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
@@ -97,8 +97,7 @@
   }
 
   base::FilePath GetInstallPath() {
-    return client_->temp_dir().AppendASCII(
-        extension_filenames::kTempExtensionName);
+    return client_->temp_dir().AppendASCII(kTempExtensionName);
   }
 
  protected:
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index 8fdd4bf..3c78899 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -239,7 +239,6 @@
       : prefs_(prefs),
         pending_extension_manager_(*this),
         blacklist_(prefs_->prefs()) {
-    profile_.CreateRequestContext();
   }
 
   virtual ~MockService() {}
@@ -498,13 +497,10 @@
 class ExtensionUpdaterTest : public testing::Test {
  public:
   ExtensionUpdaterTest()
-      : test_browser_thread_bundle_(
+      : thread_bundle_(
             content::TestBrowserThreadBundle::IO_MAINLOOP) {
   }
 
-  virtual ~ExtensionUpdaterTest() {
-  }
-
   virtual void SetUp() OVERRIDE {
     prefs_.reset(new TestExtensionPrefs(base::MessageLoopProxy::current()));
     content::RenderProcessHost::SetRunRendererInProcess(true);
@@ -751,7 +747,6 @@
 
   void TestDetermineUpdates() {
     TestingProfile profile;
-    profile.CreateRequestContext();
     MockExtensionDownloaderDelegate delegate;
     ExtensionDownloader downloader(&delegate, profile.GetRequestContext());
 
@@ -795,7 +790,6 @@
     SetupPendingExtensionManagerForTest(3, GURL(), pending_extension_manager);
 
     TestingProfile profile;
-    profile.CreateRequestContext();
     MockExtensionDownloaderDelegate delegate;
     ExtensionDownloader downloader(&delegate, profile.GetRequestContext());
 
@@ -1502,7 +1496,7 @@
   scoped_ptr<TestExtensionPrefs> prefs_;
 
  private:
-  content::TestBrowserThreadBundle test_browser_thread_bundle_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
 #if defined OS_CHROMEOS
   chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
diff --git a/chrome/browser/extensions/web_view_browsertest.cc b/chrome/browser/extensions/web_view_browsertest.cc
index 3f56d70..08b2f7d 100644
--- a/chrome/browser/extensions/web_view_browsertest.cc
+++ b/chrome/browser/extensions/web_view_browsertest.cc
@@ -1382,3 +1382,45 @@
   ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/document_interactive"))
                   << message_;
 }
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestAlertDialog) {
+  TestHelper("testAlertDialog",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestConfirmDialog) {
+  TestHelper("testConfirmDialog",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestConfirmDialogCancel) {
+  TestHelper("testConfirmDialogCancel",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestConfirmDialogDefaultCancel) {
+  TestHelper("testConfirmDialogDefaultCancel",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestConfirmDialogDefaultGCCancel) {
+  TestHelper("testConfirmDialogDefaultGCCancel",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
+
+IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) {
+  TestHelper("testPromptDialog",
+             "DoneDialogTest.PASSED",
+             "DoneDialogTest.FAILED",
+             "web_view/dialog");
+}
diff --git a/chrome/browser/extensions/window_open_apitest.cc b/chrome/browser/extensions/window_open_apitest.cc
index 1563afb..7ebb814 100644
--- a/chrome/browser/extensions/window_open_apitest.cc
+++ b/chrome/browser/extensions/window_open_apitest.cc
@@ -328,15 +328,10 @@
   EXPECT_TRUE(WaitForTabsAndPopups(browser(), 1, num_popups, 0));
 }
 
-#if defined(OS_CHROMEOS)
-// TODO(derat): See if there's some way to get this to work on Chrome OS.  It
-// crashes there, apparently because we automatically reload crashed pages:
-// http:/crbug.com/161073
-#define MAYBE_ClosePanelsOnExtensionCrash DISABLED_ClosePanelsOnExtensionCrash
-#else
-#define MAYBE_ClosePanelsOnExtensionCrash ClosePanelsOnExtensionCrash
-#endif
-IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_ClosePanelsOnExtensionCrash) {
+// This test isn't applicable on Chrome OS, which automatically reloads
+// crashed pages.
+#if !defined(OS_CHROMEOS)
+IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, ClosePanelsOnExtensionCrash) {
 #if defined(USE_ASH_PANELS)
   // On Ash, new panel windows open as popup windows instead.
   int num_popups = 4;
@@ -386,6 +381,7 @@
   // Only expect panels to close. The rest stay open to show a sad-tab.
   EXPECT_TRUE(WaitForTabsAndPopups(browser(), 2, num_popups, 0));
 }
+#endif  // !defined(OS_CHROMEOS)
 
 #if defined(USE_ASH_PANELS)
 // This test is not applicable on Ash. The modified window.open behavior only
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index cdf6bc4..e3bfc92 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -11,12 +11,11 @@
 #include "base/bind.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_system.h"
 #include "chrome/browser/extensions/suggest_permission_util.h"
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/tab_contents/tab_util.h"
 #include "chrome/common/extensions/extension.h"
@@ -35,9 +34,9 @@
 
 ChromeGeolocationPermissionContext::~ChromeGeolocationPermissionContext() {
   // ChromeGeolocationPermissionContext may be destroyed on either the UI thread
-  // or the IO thread, but the GeolocationInfobarQueueController must have been
+  // or the IO thread, but the PermissionQueueController must have been
   // destroyed on the UI thread.
-  DCHECK(!geolocation_infobar_queue_controller_.get());
+  DCHECK(!permission_queue_controller_.get());
 }
 
 void ChromeGeolocationPermissionContext::RequestGeolocationPermission(
@@ -62,7 +61,7 @@
 
   content::WebContents* web_contents =
       tab_util::GetWebContentsByID(render_process_id, render_view_id);
-  const GeolocationPermissionRequestID id(render_process_id, render_view_id,
+  const PermissionRequestID id(render_process_id, render_view_id,
                                           bridge_id);
   ExtensionService* extension_service =
       extensions::ExtensionSystem::Get(profile_)->extension_service();
@@ -112,12 +111,12 @@
     int render_view_id,
     int bridge_id,
     const GURL& requesting_frame) {
-  CancelPendingInfoBarRequest(GeolocationPermissionRequestID(
+  CancelPendingInfoBarRequest(PermissionRequestID(
       render_process_id, render_view_id, bridge_id));
 }
 
 void ChromeGeolocationPermissionContext::DecidePermission(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     base::Callback<void(bool)> callback) {
@@ -145,12 +144,12 @@
 
 void ChromeGeolocationPermissionContext::ShutdownOnUIThread() {
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-  geolocation_infobar_queue_controller_.reset();
+  permission_queue_controller_.reset();
   shutting_down_ = true;
 }
 
 void ChromeGeolocationPermissionContext::PermissionDecided(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     base::Callback<void(bool)> callback,
@@ -159,7 +158,7 @@
 }
 
 void ChromeGeolocationPermissionContext::NotifyPermissionSet(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     base::Callback<void(bool)> callback,
     bool allowed) {
@@ -177,23 +176,24 @@
   callback.Run(allowed);
 }
 
-GeolocationInfoBarQueueController*
+PermissionQueueController*
     ChromeGeolocationPermissionContext::QueueController() {
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
   DCHECK(!shutting_down_);
-  if (!geolocation_infobar_queue_controller_)
-    geolocation_infobar_queue_controller_.reset(CreateQueueController());
-  return geolocation_infobar_queue_controller_.get();
+  if (!permission_queue_controller_)
+    permission_queue_controller_.reset(CreateQueueController());
+  return permission_queue_controller_.get();
 }
 
-GeolocationInfoBarQueueController*
+PermissionQueueController*
     ChromeGeolocationPermissionContext::CreateQueueController() {
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-  return new GeolocationInfoBarQueueController(profile());
+  return new PermissionQueueController(profile(),
+                                       CONTENT_SETTINGS_TYPE_GEOLOCATION);
 }
 
 void ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest(
-    const GeolocationPermissionRequestID& id) {
+    const PermissionRequestID& id) {
   if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
     content::BrowserThread::PostTask(
         content::BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.h b/chrome/browser/geolocation/chrome_geolocation_permission_context.h
index fde8d5a..06b324d 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.h
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.h
@@ -8,15 +8,15 @@
 #include <string>
 
 #include "base/memory/scoped_ptr.h"
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
 #include "content/public/browser/geolocation_permission_context.h"
 
-class GeolocationPermissionRequestID;
+class PermissionRequestID;
 class Profile;
 
 // Chrome specific implementation of GeolocationPermissionContext; manages
 // Geolocation permissions flow, and delegates UI handling via
-// GeolocationInfoBarQueueController.
+// PermissionQueueController.
 class ChromeGeolocationPermissionContext
     : public content::GeolocationPermissionContext {
  public:
@@ -45,13 +45,13 @@
 
   // Return an instance of the infobar queue controller, creating it
   // if necessary.
-  GeolocationInfoBarQueueController* QueueController();
+  PermissionQueueController* QueueController();
 
   // Notifies whether or not the corresponding bridge is allowed to use
   // geolocation via
   // GeolocationPermissionContext::SetGeolocationPermissionResponse().
   // Called on the UI thread.
-  void NotifyPermissionSet(const GeolocationPermissionRequestID& id,
+  void NotifyPermissionSet(const PermissionRequestID& id,
                            const GURL& requesting_frame,
                            base::Callback<void(bool)> callback,
                            bool allowed);
@@ -61,7 +61,7 @@
   // Calls PermissionDecided if permission can be decided non-interactively,
   // or NotifyPermissionSet if permission decided by presenting an
   // infobar to the user. Called on the UI thread.
-  virtual void DecidePermission(const GeolocationPermissionRequestID& id,
+  virtual void DecidePermission(const PermissionRequestID& id,
                                 const GURL& requesting_frame,
                                 const GURL& embedder,
                                 base::Callback<void(bool)> callback);
@@ -70,25 +70,24 @@
   // the user. Can be overridden to introduce additional UI flow.
   // Should ultimately ensure that NotifyPermissionSet is called.
   // Called on the UI thread.
-  virtual void PermissionDecided(const GeolocationPermissionRequestID& id,
+  virtual void PermissionDecided(const PermissionRequestID& id,
                                  const GURL& requesting_frame,
                                  const GURL& embedder,
                                  base::Callback<void(bool)> callback,
                                  bool allowed);
 
-  // Create an InfoBarQueueController. overriden in derived classes to provide
-  // additional UI flow.  Called on the UI thread.
-  virtual GeolocationInfoBarQueueController* CreateQueueController();
+  // Create an PermissionQueueController. overriden in derived classes to
+  // provide additional UI flow.  Called on the UI thread.
+  virtual PermissionQueueController* CreateQueueController();
 
  private:
   // Removes any pending InfoBar request.
-  void CancelPendingInfoBarRequest(const GeolocationPermissionRequestID& id);
+  void CancelPendingInfoBarRequest(const PermissionRequestID& id);
 
   // These must only be accessed from the UI thread.
   Profile* const profile_;
   bool shutting_down_;
-  scoped_ptr<GeolocationInfoBarQueueController>
-      geolocation_infobar_queue_controller_;
+  scoped_ptr<PermissionQueueController> permission_queue_controller_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext);
 };
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
index 3a8a978..afb213c 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
@@ -22,7 +22,7 @@
 }
 
 void ChromeGeolocationPermissionContextAndroid::DecidePermission(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     base::Callback<void(bool)> callback) {
@@ -41,7 +41,7 @@
 }
 
 void ChromeGeolocationPermissionContextAndroid::PermissionDecided(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const GURL& embedder,
     base::Callback<void(bool)> callback,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
index 0dbed89..c14f224 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
@@ -22,12 +22,12 @@
   virtual ~ChromeGeolocationPermissionContextAndroid();
 
   // ChromeGeolocationPermissionContext implementation:
-  virtual void DecidePermission(const GeolocationPermissionRequestID& id,
+  virtual void DecidePermission(const PermissionRequestID& id,
                                 const GURL& requesting_frame,
                                 const GURL& embedder,
                                 base::Callback<void(bool)> callback) OVERRIDE;
 
-  virtual void PermissionDecided(const GeolocationPermissionRequestID& id,
+  virtual void PermissionDecided(const PermissionRequestID& id,
                                  const GURL& requesting_frame,
                                  const GURL& embedder,
                                  base::Callback<void(bool)> callback,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index 10eae81..7a1c0e5 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -14,9 +14,9 @@
 #include "base/synchronization/waitable_event.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h"
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
 #include "chrome/browser/infobars/infobar.h"
 #include "chrome/browser/infobars/infobar_service.h"
@@ -101,8 +101,8 @@
   virtual void SetUp() OVERRIDE;
   virtual void TearDown() OVERRIDE;
 
-  GeolocationPermissionRequestID RequestID(int bridge_id);
-  GeolocationPermissionRequestID RequestIDForTab(int tab, int bridge_id);
+  PermissionRequestID RequestID(int bridge_id);
+  PermissionRequestID RequestIDForTab(int tab, int bridge_id);
   InfoBarService* infobar_service() {
     return InfoBarService::FromWebContents(web_contents());
   }
@@ -110,12 +110,11 @@
     return InfoBarService::FromWebContents(extra_tabs_[tab]);
   }
 
-  void RequestGeolocationPermission(const GeolocationPermissionRequestID& id,
+  void RequestGeolocationPermission(const PermissionRequestID& id,
                                     const GURL& requesting_frame);
-  void CancelGeolocationPermissionRequest(
-      const GeolocationPermissionRequestID& id,
-      const GURL& requesting_frame);
-  void PermissionResponse(const GeolocationPermissionRequestID& id,
+  void CancelGeolocationPermissionRequest(const PermissionRequestID& id,
+                                          const GURL& requesting_frame);
+  void PermissionResponse(const PermissionRequestID& id,
                           bool allowed);
   void CheckPermissionMessageSent(int bridge_id, bool allowed);
   void CheckPermissionMessageSentForTab(int tab, int bridge_id, bool allowed);
@@ -136,24 +135,25 @@
   base::hash_map<int, std::pair<int, bool> > responses_;
 };
 
-GeolocationPermissionRequestID GeolocationPermissionContextTests::RequestID(
+PermissionRequestID GeolocationPermissionContextTests::RequestID(
     int bridge_id) {
-  return GeolocationPermissionRequestID(
+  return PermissionRequestID(
       web_contents()->GetRenderProcessHost()->GetID(),
       web_contents()->GetRenderViewHost()->GetRoutingID(),
       bridge_id);
 }
 
-GeolocationPermissionRequestID
-    GeolocationPermissionContextTests::RequestIDForTab(int tab, int bridge_id) {
-  return GeolocationPermissionRequestID(
+PermissionRequestID GeolocationPermissionContextTests::RequestIDForTab(
+    int tab,
+    int bridge_id) {
+  return PermissionRequestID(
       extra_tabs_[tab]->GetRenderProcessHost()->GetID(),
       extra_tabs_[tab]->GetRenderViewHost()->GetRoutingID(),
       bridge_id);
 }
 
 void GeolocationPermissionContextTests::RequestGeolocationPermission(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame) {
   geolocation_permission_context_->RequestGeolocationPermission(
       id.render_process_id(), id.render_view_id(), id.bridge_id(),
@@ -163,7 +163,7 @@
 }
 
 void GeolocationPermissionContextTests::CancelGeolocationPermissionRequest(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     const GURL& requesting_frame) {
   geolocation_permission_context_->CancelGeolocationPermissionRequest(
       id.render_process_id(), id.render_view_id(), id.bridge_id(),
@@ -171,7 +171,7 @@
 }
 
 void GeolocationPermissionContextTests::PermissionResponse(
-    const GeolocationPermissionRequestID& id,
+    const PermissionRequestID& id,
     bool allowed) {
   responses_[id.render_process_id()] = std::make_pair(id.bridge_id(), allowed);
 }
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index 017c570..4e9c37d 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -4,7 +4,7 @@
 
 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
 
-#include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h"
+#include "chrome/browser/content_settings/permission_queue_controller.h"
 #include "chrome/browser/google/google_util.h"
 #include "chrome/browser/infobars/infobar_service.h"
 #include "content/public/browser/navigation_details.h"
@@ -27,8 +27,8 @@
 // static
 InfoBarDelegate* GeolocationInfoBarDelegate::Create(
     InfoBarService* infobar_service,
-    GeolocationInfoBarQueueController* controller,
-    const GeolocationPermissionRequestID& id,
+    PermissionQueueController* controller,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     const std::string& display_languages) {
   const content::NavigationEntry* committed_entry =
@@ -41,8 +41,8 @@
 
 GeolocationInfoBarDelegate::GeolocationInfoBarDelegate(
     InfoBarService* infobar_service,
-    GeolocationInfoBarQueueController* controller,
-    const GeolocationPermissionRequestID& id,
+    PermissionQueueController* controller,
+    const PermissionRequestID& id,
     const GURL& requesting_frame,
     int contents_unique_id,
     const std::string& display_languages)
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/geolocation/geolocation_infobar_delegate.h
index 4e63f64..93a6ab7 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.h
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.h
@@ -7,11 +7,11 @@
 
 #include <string>
 
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
+#include "chrome/browser/content_settings/permission_request_id.h"
 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
 #include "url/gurl.h"
 
-class GeolocationInfoBarQueueController;
+class PermissionQueueController;
 class InfoBarService;
 
 // GeolocationInfoBarDelegates are created by the
@@ -22,15 +22,15 @@
   // Creates a geolocation infobar delegate and adds it to |infobar_service|.
   // Returns the delegate if it was successfully added.
   static InfoBarDelegate* Create(InfoBarService* infobar_service,
-                                 GeolocationInfoBarQueueController* controller,
-                                 const GeolocationPermissionRequestID& id,
+                                 PermissionQueueController* controller,
+                                 const PermissionRequestID& id,
                                  const GURL& requesting_frame,
                                  const std::string& display_languages);
 
  protected:
   GeolocationInfoBarDelegate(InfoBarService* infobar_service,
-                             GeolocationInfoBarQueueController* controller,
-                             const GeolocationPermissionRequestID& id,
+                             PermissionQueueController* controller,
+                             const PermissionRequestID& id,
                              const GURL& requesting_frame,
                              int contents_unique_id,
                              const std::string& display_languages);
@@ -54,8 +54,8 @@
   virtual string16 GetLinkText() const OVERRIDE;
   virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
 
-  GeolocationInfoBarQueueController* controller_;
-  const GeolocationPermissionRequestID id_;
+  PermissionQueueController* controller_;
+  const PermissionRequestID id_;
   GURL requesting_frame_;
   int contents_unique_id_;
   std::string display_languages_;
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
index 032b7f4..52c2b5b 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc
@@ -13,8 +13,8 @@
 
 GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid(
     InfoBarService* infobar_service,
-    GeolocationInfoBarQueueController* controller,
-    const GeolocationPermissionRequestID& id,
+    PermissionQueueController* controller,
+    const PermissionRequestID& id,
     const GURL& requesting_frame_url,
     int contents_unique_id,
     const std::string& display_languages)
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
index f5059e3..e247f7f 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h
@@ -14,8 +14,8 @@
  public:
   GeolocationInfoBarDelegateAndroid(
       InfoBarService* infobar_service,
-      GeolocationInfoBarQueueController* controller,
-      const GeolocationPermissionRequestID& id,
+      PermissionQueueController* controller,
+      const PermissionRequestID& id,
       const GURL& requesting_frame_url,
       int contents_unique_id,
       const std::string& display_languages);
diff --git a/chrome/browser/geolocation/geolocation_permission_request_id.cc b/chrome/browser/geolocation/geolocation_permission_request_id.cc
deleted file mode 100644
index 89df8c4..0000000
--- a/chrome/browser/geolocation/geolocation_permission_request_id.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/geolocation/geolocation_permission_request_id.h"
-
-#include "base/strings/stringprintf.h"
-
-
-GeolocationPermissionRequestID::GeolocationPermissionRequestID(
-    int render_process_id,
-    int render_view_id,
-    int bridge_id)
-    : render_process_id_(render_process_id),
-      render_view_id_(render_view_id),
-      bridge_id_(bridge_id) {
-}
-
-GeolocationPermissionRequestID::~GeolocationPermissionRequestID() {
-}
-
-bool GeolocationPermissionRequestID::Equals(
-    const GeolocationPermissionRequestID& other) const {
-  return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_);
-}
-
-bool GeolocationPermissionRequestID::IsForSameTabAs(
-    const GeolocationPermissionRequestID& other) const {
-  return (render_process_id_ == other.render_process_id_) &&
-      (render_view_id_ == other.render_view_id_);
-}
-
-std::string GeolocationPermissionRequestID::ToString() const {
-  return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_,
-                            bridge_id_);
-}
diff --git a/chrome/browser/geolocation/geolocation_permission_request_id.h b/chrome/browser/geolocation/geolocation_permission_request_id.h
deleted file mode 100644
index eb29de9..0000000
--- a/chrome/browser/geolocation/geolocation_permission_request_id.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
-#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
-
-#include <string>
-
-// Uniquely identifies a particular geolocation permission request.
-class GeolocationPermissionRequestID {
- public:
-  GeolocationPermissionRequestID(int render_process_id,
-                                 int render_view_id,
-                                 int bridge_id);
-  ~GeolocationPermissionRequestID();
-
-  int render_process_id() const { return render_process_id_; }
-  int render_view_id() const { return render_view_id_; }
-  int bridge_id() const { return bridge_id_; }
-
-  bool Equals(const GeolocationPermissionRequestID& other) const;
-  bool IsForSameTabAs(const GeolocationPermissionRequestID& other) const;
-  std::string ToString() const;
-
- private:
-  int render_process_id_;
-  int render_view_id_;
-  int bridge_id_;
-
-  // Purposefully do not disable copying, as this is stored in STL containers.
-};
-
-#endif  // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_REQUEST_ID_H_
diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc
index 88bdc5a..1ddda26 100644
--- a/chrome/browser/google/google_url_tracker_unittest.cc
+++ b/chrome/browser/google/google_url_tracker_unittest.cc
@@ -18,14 +18,13 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "net/url_request/url_fetcher.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 class GoogleURLTrackerTest;
 
-
 namespace {
 
 // TestInfoBarDelegate --------------------------------------------------------
@@ -249,8 +248,7 @@
 
   // These are required by the TestURLFetchers GoogleURLTracker will create (see
   // test_url_fetcher_factory.h).
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   // Creating this allows us to call
   // net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests().
   scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
@@ -283,8 +281,7 @@
 }
 
 GoogleURLTrackerTest::GoogleURLTrackerTest()
-    : message_loop_(base::MessageLoop::TYPE_IO),
-      io_thread_(content::BrowserThread::IO, &message_loop_) {
+    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
   GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnBrowserContext(
       &profile_);
 }
diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc
index 5a0dc26..6f7865c 100644
--- a/chrome/browser/history/download_database.cc
+++ b/chrome/browser/history/download_database.cc
@@ -111,6 +111,7 @@
 const int DownloadDatabase::kDangerTypeUncommonContent = 5;
 const int DownloadDatabase::kDangerTypeUserValidated = 6;
 const int DownloadDatabase::kDangerTypeDangerousHost = 7;
+const int DownloadDatabase::kDangerTypePotentiallyUnwanted = 8;
 
 int DownloadDatabase::StateToInt(DownloadItem::DownloadState state) {
   switch (state) {
@@ -156,6 +157,8 @@
       return DownloadDatabase::kDangerTypeUserValidated;
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
       return DownloadDatabase::kDangerTypeDangerousHost;
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
+      return DownloadDatabase::kDangerTypePotentiallyUnwanted;
     case content::DOWNLOAD_DANGER_TYPE_MAX:
       NOTREACHED();
       return DownloadDatabase::kDangerTypeInvalid;
@@ -182,6 +185,8 @@
       return content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED;
     case DownloadDatabase::kDangerTypeDangerousHost:
       return content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST;
+    case DownloadDatabase::kDangerTypePotentiallyUnwanted:
+      return content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED;
     default:
       return content::DOWNLOAD_DANGER_TYPE_MAX;
   }
diff --git a/chrome/browser/history/download_database.h b/chrome/browser/history/download_database.h
index 1550a0a..12e5a1e 100644
--- a/chrome/browser/history/download_database.h
+++ b/chrome/browser/history/download_database.h
@@ -94,6 +94,7 @@
   static const int kDangerTypeUncommonContent;
   static const int kDangerTypeUserValidated;
   static const int kDangerTypeDangerousHost;
+  static const int kDangerTypePotentiallyUnwanted;
 
   // Fixes state of the download entries. Sometimes entries with IN_PROGRESS
   // state are not updated during browser shutdown (particularly when crashing).
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 3688996..44cd6cd 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -439,6 +439,12 @@
   return globals_;
 }
 
+void IOThread::SetGlobalsForTesting(Globals* globals) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  DCHECK(!globals || !globals_);
+  globals_ = globals;
+}
+
 ChromeNetLog* IOThread::net_log() {
   return net_log_;
 }
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 4b1b9ef..4408a50 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -187,6 +187,11 @@
   // Can only be called on the IO thread.
   Globals* globals();
 
+  // Allows overriding Globals in tests where IOThread::Init() and
+  // IOThread::CleanUp() are not called.  This allows for injecting mocks into
+  // IOThread global objects.
+  void SetGlobalsForTesting(Globals* globals);
+
   ChromeNetLog* net_log();
 
   // Handles changing to On The Record mode, discarding confidential data.
diff --git a/chrome/browser/local_discovery/privet_confirm_api_flow.cc b/chrome/browser/local_discovery/privet_confirm_api_flow.cc
new file mode 100644
index 0000000..8f9f6ce
--- /dev/null
+++ b/chrome/browser/local_discovery/privet_confirm_api_flow.cc
@@ -0,0 +1,103 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/json/json_reader.h"
+#include "base/strings/stringprintf.h"
+#include "base/values.h"
+#include "chrome/browser/local_discovery/privet_confirm_api_flow.h"
+#include "chrome/common/cloud_print/cloud_print_constants.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+#include "net/base/load_flags.h"
+#include "net/http/http_status_code.h"
+#include "net/url_request/url_request_status.h"
+
+namespace local_discovery {
+
+namespace {
+const char kCloudPrintOAuthHeaderFormat[] = "Authorization: Bearer %s";
+}
+
+PrivetConfirmApiCallFlow::PrivetConfirmApiCallFlow(
+    net::URLRequestContextGetter* request_context,
+    OAuth2TokenService* token_service,
+    const GURL& automated_claim_url,
+    const ResponseCallback& callback)
+    : request_context_(request_context),
+      token_service_(token_service),
+      automated_claim_url_(automated_claim_url),
+      callback_(callback) {
+}
+
+PrivetConfirmApiCallFlow::~PrivetConfirmApiCallFlow() {
+}
+
+void PrivetConfirmApiCallFlow::Start() {
+  OAuth2TokenService::ScopeSet oauth_scopes;
+  oauth_scopes.insert(cloud_print::kCloudPrintAuth);
+  oauth_request_ = token_service_->StartRequest(oauth_scopes, this);
+}
+
+void PrivetConfirmApiCallFlow::OnGetTokenSuccess(
+    const OAuth2TokenService::Request* request,
+    const std::string& access_token,
+    const base::Time& expiration_time) {
+  url_fetcher_.reset(net::URLFetcher::Create(automated_claim_url_,
+                                             net::URLFetcher::GET,
+                                             this));
+  url_fetcher_->SetRequestContext(request_context_.get());
+  std::string authorization_header =
+      base::StringPrintf(kCloudPrintOAuthHeaderFormat, access_token.c_str());
+
+  url_fetcher_->AddExtraRequestHeader(
+      cloud_print::kChromeCloudPrintProxyHeader);
+  url_fetcher_->AddExtraRequestHeader(authorization_header);
+  url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
+                             net::LOAD_DO_NOT_SEND_COOKIES);
+  url_fetcher_->Start();
+}
+
+void PrivetConfirmApiCallFlow::OnGetTokenFailure(
+    const OAuth2TokenService::Request* request,
+    const GoogleServiceAuthError& error) {
+  callback_.Run(ERROR_TOKEN);
+}
+
+void PrivetConfirmApiCallFlow::OnURLFetchComplete(
+    const net::URLFetcher* source) {
+  // TODO(noamsml): Error logging.
+
+  // TODO(noamsml): Extract this and PrivetURLFetcher::OnURLFetchComplete into
+  // one helper method.
+  std::string response_str;
+
+  if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS ||
+      !source->GetResponseAsString(&response_str)) {
+    callback_.Run(ERROR_NETWORK);
+    return;
+  }
+
+  if (source->GetResponseCode() != net::HTTP_OK) {
+    callback_.Run(ERROR_HTTP_CODE);
+    return;
+  }
+
+  base::JSONReader reader;
+  scoped_ptr<const base::Value> value(reader.Read(response_str));
+  const base::DictionaryValue* dictionary_value;
+  bool success = false;
+
+  if (!value.get() || !value->GetAsDictionary(&dictionary_value)
+      || !dictionary_value->GetBoolean(cloud_print::kSuccessValue, &success)) {
+    callback_.Run(ERROR_MALFORMED_RESPONSE);
+    return;
+  }
+
+  if (success) {
+    callback_.Run(SUCCESS);
+  } else {
+    callback_.Run(ERROR_FROM_SERVER);
+  }
+}
+
+}  // namespace local_discovery
diff --git a/chrome/browser/local_discovery/privet_confirm_api_flow.h b/chrome/browser/local_discovery/privet_confirm_api_flow.h
new file mode 100644
index 0000000..dadcf83
--- /dev/null
+++ b/chrome/browser/local_discovery/privet_confirm_api_flow.h
@@ -0,0 +1,62 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_
+#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_
+
+#include <string>
+
+#include "chrome/browser/local_discovery/privet_http.h"
+#include "chrome/browser/signin/oauth2_token_service.h"
+#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_fetcher_delegate.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace local_discovery {
+
+// API call flow for server-side communication with cloudprint for registration.
+class PrivetConfirmApiCallFlow : public net::URLFetcherDelegate,
+                                 public OAuth2TokenService::Consumer {
+ public:
+  // TODO(noamsml): Better error model for this class.
+  enum Status {
+    SUCCESS,
+    ERROR_TOKEN,
+    ERROR_NETWORK,
+    ERROR_HTTP_CODE,
+    ERROR_FROM_SERVER,
+    ERROR_MALFORMED_RESPONSE
+  };
+  typedef base::Callback<void(Status /*success*/)> ResponseCallback;
+
+  PrivetConfirmApiCallFlow(net::URLRequestContextGetter* request_context,
+                           OAuth2TokenService* token_service_,
+                           const GURL& automated_claim_url,
+                           const ResponseCallback& callback);
+  virtual ~PrivetConfirmApiCallFlow();
+
+  void Start();
+
+  // net::URLFetcherDelegate implementation:
+  virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
+  // OAuth2TokenService::Consumer implementation:
+  virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
+                                 const std::string& access_token,
+                                 const base::Time& expiration_time) OVERRIDE;
+  virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
+                                 const GoogleServiceAuthError& error) OVERRIDE;
+
+ private:
+  scoped_ptr<net::URLFetcher> url_fetcher_;
+  scoped_ptr<OAuth2TokenService::Request> oauth_request_;
+  scoped_refptr<net::URLRequestContextGetter> request_context_;
+  OAuth2TokenService* token_service_;
+  GURL automated_claim_url_;
+  ResponseCallback callback_;
+};
+
+}  // namespace local_discovery
+
+#endif  // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_
diff --git a/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc b/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc
new file mode 100644
index 0000000..0ec365e
--- /dev/null
+++ b/chrome/browser/local_discovery/privet_confirm_api_flow_unittest.cc
@@ -0,0 +1,177 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "chrome/browser/local_discovery/privet_confirm_api_flow.h"
+#include "content/public/test/test_browser_thread.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+#include "net/base/host_port_pair.h"
+#include "net/base/net_errors.h"
+#include "net/http/http_request_headers.h"
+#include "net/url_request/test_url_fetcher_factory.h"
+#include "net/url_request/url_request_test_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using testing::NiceMock;
+
+namespace local_discovery {
+
+namespace {
+
+const char kSampleConfirmResponse[] = "{"
+    "   \"success\": true"
+    "}";
+
+const char kFailedConfirmResponse[] = "{"
+    "   \"success\": false"
+    "}";
+
+
+const char kFailedConfirmResponseBadJson[] = "["
+    "   \"success\""
+    "]";
+
+class TestOAuth2TokenService : public OAuth2TokenService {
+ public:
+  explicit TestOAuth2TokenService(net::URLRequestContextGetter* request_context)
+      : request_context_(request_context) {
+  }
+ protected:
+  virtual std::string GetRefreshToken() OVERRIDE {
+    return "SampleToken";
+  }
+
+  virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE {
+    return request_context_.get();
+  }
+
+ private:
+  scoped_refptr<net::URLRequestContextGetter> request_context_;
+};
+
+class MockableConfirmCallback {
+ public:
+  MOCK_METHOD1(ConfirmCallback, void(PrivetConfirmApiCallFlow::Status));
+
+  PrivetConfirmApiCallFlow::ResponseCallback callback() {
+    return base::Bind(&MockableConfirmCallback::ConfirmCallback,
+                      base::Unretained(this));
+  }
+};
+
+class PrivetConfirmApiFlowTest : public testing::Test {
+ public:
+  PrivetConfirmApiFlowTest()
+      : ui_thread_(content::BrowserThread::UI,
+                   &loop_),
+        request_context_(new net::TestURLRequestContextGetter(
+            base::MessageLoopProxy::current())),
+        token_service_(request_context_.get()) {
+    ui_thread_.Stop();  // HACK: Fake being on the UI thread
+  }
+
+  virtual ~PrivetConfirmApiFlowTest() {
+  }
+
+ protected:
+  base::MessageLoopForUI loop_;
+  content::TestBrowserThread ui_thread_;
+  scoped_refptr<net::TestURLRequestContextGetter> request_context_;
+  net::TestURLFetcherFactory fetcher_factory_;
+  TestOAuth2TokenService token_service_;
+  MockableConfirmCallback callback_;
+};
+
+TEST_F(PrivetConfirmApiFlowTest, Success) {
+  PrivetConfirmApiCallFlow confirm_flow(request_context_.get(),
+                                        &token_service_,
+                                        GURL("http://SoMeUrL.com"),
+                                        callback_.callback());
+
+  confirm_flow.OnGetTokenSuccess(NULL, "SomeToken", base::Time());
+  net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
+
+  EXPECT_EQ(GURL("http://SoMeUrL.com"), fetcher->GetOriginalURL());
+
+  net::HttpRequestHeaders headers;
+  fetcher->GetExtraRequestHeaders(&headers);
+  std::string oauth_header;
+  std::string proxy;
+  EXPECT_TRUE(headers.GetHeader("Authorization", &oauth_header));
+  EXPECT_EQ("Bearer SomeToken", oauth_header);
+  EXPECT_TRUE(headers.GetHeader("X-Cloudprint-Proxy", &proxy));
+  EXPECT_EQ("Chrome", proxy);
+
+  fetcher->SetResponseString(kSampleConfirmResponse);
+  fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
+                                            net::OK));
+  fetcher->set_response_code(200);
+
+  EXPECT_CALL(callback_, ConfirmCallback(PrivetConfirmApiCallFlow::SUCCESS));
+
+  fetcher->delegate()->OnURLFetchComplete(fetcher);
+}
+
+TEST_F(PrivetConfirmApiFlowTest, BadToken) {
+  PrivetConfirmApiCallFlow confirm_flow(request_context_.get(),
+                                        &token_service_,
+                                        GURL("http://SoMeUrL.com"),
+                                        callback_.callback());
+
+  EXPECT_CALL(callback_,
+              ConfirmCallback(PrivetConfirmApiCallFlow::ERROR_TOKEN));
+  confirm_flow.OnGetTokenFailure(NULL, GoogleServiceAuthError(
+      GoogleServiceAuthError::USER_NOT_SIGNED_UP));
+}
+
+TEST_F(PrivetConfirmApiFlowTest, ServerFailure) {
+  PrivetConfirmApiCallFlow confirm_flow(request_context_.get(),
+                                        &token_service_,
+                                        GURL("http://SoMeUrL.com"),
+                                        callback_.callback());
+
+  confirm_flow.OnGetTokenSuccess(NULL, "SomeToken", base::Time());
+  net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
+
+  EXPECT_EQ(GURL("http://SoMeUrL.com"), fetcher->GetOriginalURL());
+
+  fetcher->SetResponseString(kFailedConfirmResponse);
+  fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
+                                            net::OK));
+  fetcher->set_response_code(200);
+
+  EXPECT_CALL(callback_,
+              ConfirmCallback(PrivetConfirmApiCallFlow::ERROR_FROM_SERVER));
+
+  fetcher->delegate()->OnURLFetchComplete(fetcher);
+}
+
+TEST_F(PrivetConfirmApiFlowTest, BadJson) {
+  PrivetConfirmApiCallFlow confirm_flow(request_context_.get(),
+                                        &token_service_,
+                                        GURL("http://SoMeUrL.com"),
+                                        callback_.callback());
+
+  confirm_flow.OnGetTokenSuccess(NULL, "SomeToken", base::Time());
+  net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
+
+  EXPECT_EQ(GURL("http://SoMeUrL.com"), fetcher->GetOriginalURL());
+
+  fetcher->SetResponseString(kFailedConfirmResponseBadJson);
+  fetcher->set_status(net::URLRequestStatus(
+      net::URLRequestStatus::SUCCESS,
+      net::OK));
+  fetcher->set_response_code(200);
+
+  EXPECT_CALL(callback_, ConfirmCallback
+              (PrivetConfirmApiCallFlow::ERROR_MALFORMED_RESPONSE));
+
+  fetcher->delegate()->OnURLFetchComplete(fetcher);
+}
+
+}  // namespace
+
+}  // namespace local_discovery
diff --git a/chrome/browser/local_discovery/privet_device_lister_unittest.cc b/chrome/browser/local_discovery/privet_device_lister_unittest.cc
index 48e18f4..98dc714 100644
--- a/chrome/browser/local_discovery/privet_device_lister_unittest.cc
+++ b/chrome/browser/local_discovery/privet_device_lister_unittest.cc
@@ -129,6 +129,15 @@
     return mock_service_resolver.PassAs<ServiceResolver>();
   }
 
+  // Not used in this test.
+  virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver(
+    const std::string& domain,
+    net::AddressFamily address_family,
+    const LocalDomainResolver::IPAddressCallback& callback) OVERRIDE {
+    NOTREACHED();
+    return scoped_ptr<LocalDomainResolver>();
+  }
+
  private:
   ServiceDiscoveryMockDelegate* mock_delegate_;
 };
diff --git a/chrome/browser/local_discovery/service_discovery_host_client.cc b/chrome/browser/local_discovery/service_discovery_host_client.cc
index 42b5a22..3a2c172 100644
--- a/chrome/browser/local_discovery/service_discovery_host_client.cc
+++ b/chrome/browser/local_discovery/service_discovery_host_client.cc
@@ -113,6 +113,15 @@
       new ServiceResolverProxy(this, service_name, callback));
 }
 
+scoped_ptr<LocalDomainResolver>
+ServiceDiscoveryHostClient::CreateLocalDomainResolver(
+    const std::string& domain,
+    net::AddressFamily address_family,
+    const LocalDomainResolver::IPAddressCallback& callback) {
+  NOTIMPLEMENTED();  // TODO(noamsml): Multiprocess domain resolver
+  return scoped_ptr<LocalDomainResolver>();
+}
+
 uint64 ServiceDiscoveryHostClient::RegisterWatcherCallback(
     const ServiceWatcher::UpdatedCallback& callback) {
   DCHECK(CalledOnValidThread());
@@ -179,8 +188,13 @@
   BrowserThread::PostTask(
       BrowserThread::IO,
       FROM_HERE,
-      base::Bind(base::IgnoreResult(&content::UtilityProcessHost::Send),
-                 utility_host_, msg));
+      base::Bind(&ServiceDiscoveryHostClient::SendOnIOThread, this, msg));
+}
+
+void ServiceDiscoveryHostClient::SendOnIOThread(IPC::Message* msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  if (utility_host_)
+    utility_host_->Send(msg);
 }
 
 bool ServiceDiscoveryHostClient::OnMessageReceived(
diff --git a/chrome/browser/local_discovery/service_discovery_host_client.h b/chrome/browser/local_discovery/service_discovery_host_client.h
index 4bdf08b..28cdcce 100644
--- a/chrome/browser/local_discovery/service_discovery_host_client.h
+++ b/chrome/browser/local_discovery/service_discovery_host_client.h
@@ -6,6 +6,7 @@
 #define CHROME_BROWSER_LOCAL_DISCOVERY_SERVICE_DISCOVERY_HOST_CLIENT_H_
 
 #include <map>
+#include <string>
 
 #include "base/threading/non_thread_safe.h"
 #include "chrome/common/local_discovery/service_discovery_client.h"
@@ -42,6 +43,10 @@
   virtual scoped_ptr<ServiceResolver> CreateServiceResolver(
       const std::string& service_name,
       const ServiceResolver::ResolveCompleteCallback& callback) OVERRIDE;
+  virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver(
+      const std::string& domain,
+      net::AddressFamily address_family,
+      const LocalDomainResolver::IPAddressCallback& callback) OVERRIDE;
 
   // UtilityProcessHostClient implementation.
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -61,6 +66,7 @@
   void ShutdownOnIOThread();
 
   void Send(IPC::Message* msg);
+  void SendOnIOThread(IPC::Message* msg);
 
   uint64 RegisterWatcherCallback(
       const ServiceWatcher::UpdatedCallback& callback);
diff --git a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc
index 7b7bebf..c547599 100644
--- a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc
+++ b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc
@@ -4,13 +4,12 @@
 
 #include "base/bind.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/managed_mode/managed_user_refresh_token_fetcher.h"
 #include "chrome/browser/signin/oauth2_token_service.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_oauth_client.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "google_apis/gaia/google_service_auth_error.h"
@@ -195,9 +194,7 @@
   void OnTokenFetched(const GoogleServiceAuthError& error,
                       const std::string& token);
 
-  base::WeakPtrFactory<ManagedUserRefreshTokenFetcherTest> weak_ptr_factory_;
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   TestingProfile profile_;
   MockOAuth2TokenService oauth2_token_service_;
   net::TestURLFetcherFactory url_fetcher_factory_;
@@ -205,15 +202,15 @@
 
   GoogleServiceAuthError error_;
   std::string token_;
+  base::WeakPtrFactory<ManagedUserRefreshTokenFetcherTest> weak_ptr_factory_;
 };
 
 ManagedUserRefreshTokenFetcherTest::ManagedUserRefreshTokenFetcherTest()
-    : weak_ptr_factory_(this),
-      ui_thread_(content::BrowserThread::UI, &message_loop_),
-      token_fetcher_(
+    : token_fetcher_(
           ManagedUserRefreshTokenFetcher::Create(&oauth2_token_service_,
                                           profile_.GetRequestContext())),
-      error_(GoogleServiceAuthError::NONE) {}
+      error_(GoogleServiceAuthError::NONE),
+      weak_ptr_factory_(this) {}
 
 void ManagedUserRefreshTokenFetcherTest::StartFetching() {
   token_fetcher_->Start(kManagedUserId, UTF8ToUTF16(kName), kDeviceName,
diff --git a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
index 5396b11..a0aada7 100644
--- a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
+++ b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
@@ -13,6 +13,7 @@
 #include "chrome/browser/infobars/infobar.h"
 #include "chrome/browser/infobars/infobar_service.h"
 #include "chrome/browser/media/media_stream_infobar_delegate.h"
+#include "chrome/browser/media/webrtc_browsertest_common.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_tabstrip.h"
@@ -115,7 +116,7 @@
     CloseInfobarInTab(tab_contents, media_infobar);
 
     // Wait for WebRTC to call the success callback.
-    EXPECT_TRUE(UglyPollingWaitUntil(
+    EXPECT_TRUE(PollingWaitUntil(
         "obtainGetUserMediaResult()", kOkGotStream, tab_contents));
   }
 
@@ -134,9 +135,9 @@
     CloseInfobarInTab(tab_contents, media_infobar);
 
     // Wait for WebRTC to call the fail callback.
-    EXPECT_TRUE(UglyPollingWaitUntil("obtainGetUserMediaResult()",
-                                     kFailedWithErrorPermissionDenied,
-                                     tab_contents));
+    EXPECT_TRUE(PollingWaitUntil("obtainGetUserMediaResult()",
+                                 kFailedWithErrorPermissionDenied,
+                                 tab_contents));
   }
 
   void TestDismissOnInfobar(content::WebContents* tab_contents) {
@@ -148,35 +149,9 @@
     CloseInfobarInTab(tab_contents, media_infobar);
 
     // A dismiss should be treated like a deny.
-    EXPECT_TRUE(UglyPollingWaitUntil("obtainGetUserMediaResult()",
-                                     kFailedWithErrorPermissionDenied,
-                                     tab_contents));
-  }
-
-  // TODO(phoglund): de-dupe
-  // TODO(phoglund): This ugly poll method is only here while we transition
-  // the test javascript to just post events when things happen. Right now they
-  // don't because the webrtc_call.py and other tests use this polling way of
-  // communicating when we are waiting from an asynchronous event in the
-  // javascript. This method is meant to emulate WaitUntil in the PyAuto
-  // framework.
-  bool UglyPollingWaitUntil(const std::string& javascript,
-                            const std::string& evaluates_to,
-                            content::WebContents* tab_contents) {
-    const base::Time start_time = base::Time::Now();
-    const base::TimeDelta timeout = TestTimeouts::action_max_timeout();
-    std::string result;
-
-    while (base::Time::Now() - start_time < timeout) {
-      result = ExecuteJavascript(javascript, tab_contents);
-      LOG(INFO) << result;
-      if (evaluates_to == result)
-        return true;
-    }
-    LOG(ERROR) << "Timed out while waiting for " << javascript
-               << " to evaluate to " << evaluates_to << "; last result was '"
-               << result << "'";
-    return false;
+    EXPECT_TRUE(PollingWaitUntil("obtainGetUserMediaResult()",
+                                 kFailedWithErrorPermissionDenied,
+                                 tab_contents));
   }
 
   void GetUserMedia(const std::string& constraints,
@@ -219,9 +194,9 @@
 
   // Should fail with permission denied right away with no infobar popping up.
   GetUserMedia(kAudioVideoCallConstraints, tab_contents);
-  EXPECT_TRUE(UglyPollingWaitUntil("obtainGetUserMediaResult()",
-                                   kFailedWithErrorPermissionDenied,
-                                   tab_contents));
+  EXPECT_TRUE(PollingWaitUntil("obtainGetUserMediaResult()",
+                               kFailedWithErrorPermissionDenied,
+                               tab_contents));
   InfoBarService* infobar_service =
       InfoBarService::FromWebContents(tab_contents);
   EXPECT_EQ(0u, infobar_service->infobar_count());
diff --git a/chrome/browser/media/chrome_webrtc_browsertest.cc b/chrome/browser/media/chrome_webrtc_browsertest.cc
index 2b6eb8e..b9c6b51 100644
--- a/chrome/browser/media/chrome_webrtc_browsertest.cc
+++ b/chrome/browser/media/chrome_webrtc_browsertest.cc
@@ -16,6 +16,7 @@
 #include "chrome/browser/infobars/infobar.h"
 #include "chrome/browser/infobars/infobar_service.h"
 #include "chrome/browser/media/media_stream_infobar_delegate.h"
+#include "chrome/browser/media/webrtc_browsertest_common.h"
 #include "chrome/browser/media/webrtc_log_uploader.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
@@ -98,30 +99,6 @@
         switches::kUseFakeUIForMediaStream));
   }
 
-  // TODO(phoglund): This ugly poll method is only here while we transition
-  // the test javascript to just post events when things happen. Right now they
-  // don't because the webrtc_call.py and other tests use this polling way of
-  // communicating when we are waiting from an asynchronous event in the
-  // javascript. This method is meant to emulate WaitUntil in the PyAuto
-  // framework.
-  bool UglyPollingWaitUntil(const std::string& javascript,
-                            const std::string& evaluates_to,
-                            content::WebContents* tab_contents) {
-    base::Time start_time = base::Time::Now();
-    base::TimeDelta timeout = base::TimeDelta::FromSeconds(20);
-    std::string result;
-
-    while (base::Time::Now() - start_time < timeout) {
-      result = ExecuteJavascript(javascript, tab_contents);
-      if (evaluates_to == result)
-        return true;
-    }
-    LOG(ERROR) << "Timed out while waiting for " << javascript <<
-        " to evaluate to " << evaluates_to << "; last result was '" << result <<
-        "'";
-    return false;
-  }
-
   // Convenience method which executes the provided javascript in the context
   // of the provided web contents and returns what it evaluated to.
   std::string ExecuteJavascript(const std::string& javascript,
@@ -149,9 +126,9 @@
     media_infobar->Accept();
 
     // Wait for WebRTC to call the success callback.
-    EXPECT_TRUE(UglyPollingWaitUntil("obtainGetUserMediaResult();",
-                                     "ok-got-stream",
-                                     tab_contents));
+    EXPECT_TRUE(PollingWaitUntil("obtainGetUserMediaResult();",
+                                 "ok-got-stream",
+                                 tab_contents));
   }
 
   // Ensures we didn't get any errors asynchronously (e.g. while no javascript
@@ -187,10 +164,10 @@
               ExecuteJavascript("negotiateCall()", from_tab));
 
     // Ensure the call gets up on both sides.
-    EXPECT_TRUE(UglyPollingWaitUntil("getPeerConnectionReadyState()",
-                                     "active", from_tab));
-    EXPECT_TRUE(UglyPollingWaitUntil("getPeerConnectionReadyState()",
-                                     "active", to_tab));
+    EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
+                                 "active", from_tab));
+    EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
+                                 "active", to_tab));
   }
 
   void StartDetectingVideo(content::WebContents* tab_contents,
@@ -202,13 +179,13 @@
   }
 
   void WaitForVideoToPlay(content::WebContents* tab_contents) {
-    EXPECT_TRUE(UglyPollingWaitUntil("isVideoPlaying()", "video-playing",
-                                     tab_contents));
+    EXPECT_TRUE(PollingWaitUntil("isVideoPlaying()", "video-playing",
+                                 tab_contents));
   }
 
   void WaitForVideoToStopPlaying(content::WebContents* tab_contents) {
-    EXPECT_TRUE(UglyPollingWaitUntil("isVideoPlaying()", "video-not-playing",
-                                     tab_contents));
+    EXPECT_TRUE(PollingWaitUntil("isVideoPlaying()", "video-not-playing",
+                                 tab_contents));
   }
 
   void HangUp(content::WebContents* from_tab) {
@@ -216,8 +193,8 @@
   }
 
   void WaitUntilHangupVerified(content::WebContents* tab_contents) {
-    EXPECT_TRUE(UglyPollingWaitUntil("getPeerConnectionReadyState()",
-                                     "no-peer-connection", tab_contents));
+    EXPECT_TRUE(PollingWaitUntil("getPeerConnectionReadyState()",
+                                 "no-peer-connection", tab_contents));
   }
 
   std::string ToggleLocalVideoTrack(content::WebContents* tab_contents) {
diff --git a/chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc b/chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc
index 8e5b3e4..f6c5a97 100644
--- a/chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc
+++ b/chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc
@@ -14,6 +14,7 @@
 #include "chrome/browser/infobars/infobar.h"
 #include "chrome/browser/infobars/infobar_service.h"
 #include "chrome/browser/media/media_stream_infobar_delegate.h"
+#include "chrome/browser/media/webrtc_browsertest_common.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_tabstrip.h"
@@ -169,30 +170,6 @@
         << "Failed to shut down pywebsocket server!";
   }
 
-  // TODO(phoglund): This ugly poll method is only here while we transition
-  // the test javascript to just post events when things happen. Right now they
-  // don't because the webrtc_call.py and other tests use this polling way of
-  // communicating when we are waiting from an asynchronous event in the
-  // javascript. This method is meant to emulate WaitUntil in the PyAuto
-  // framework.
-  bool UglyPollingWaitUntil(const std::string& javascript,
-                            const std::string& evaluates_to,
-                            content::WebContents* tab_contents) {
-    base::Time start_time = base::Time::Now();
-    base::TimeDelta timeout = TestTimeouts::action_max_timeout();
-    std::string result;
-
-    while (base::Time::Now() - start_time < timeout) {
-      result = ExecuteJavascript(javascript, tab_contents);
-      if (evaluates_to == result)
-        return true;
-    }
-    LOG(ERROR) << "Timed out while waiting for " << javascript
-               << " to evaluate to " << evaluates_to << "; last result was '"
-               << result << "'";
-    return false;
-  }
-
   // Convenience method which executes the provided javascript in the context
   // of the provided web contents and returns what it evaluated to.
   std::string ExecuteJavascript(const std::string& javascript,
@@ -221,7 +198,7 @@
     media_infobar->Accept();
 
     // Wait for WebRTC to call the success callback.
-    EXPECT_TRUE(UglyPollingWaitUntil(
+    EXPECT_TRUE(PollingWaitUntil(
         "obtainGetUserMediaResult();", "ok-got-stream", tab_contents));
   }
 
@@ -251,9 +228,9 @@
     EXPECT_EQ("ok-negotiating", ExecuteJavascript("negotiateCall()", from_tab));
 
     // Ensure the call gets up on both sides.
-    EXPECT_TRUE(UglyPollingWaitUntil(
+    EXPECT_TRUE(PollingWaitUntil(
         "getPeerConnectionReadyState()", "active", from_tab));
-    EXPECT_TRUE(UglyPollingWaitUntil(
+    EXPECT_TRUE(PollingWaitUntil(
         "getPeerConnectionReadyState()", "active", to_tab));
   }
 
@@ -262,7 +239,7 @@
   }
 
   void WaitUntilHangupVerified(content::WebContents* tab_contents) {
-    EXPECT_TRUE(UglyPollingWaitUntil(
+    EXPECT_TRUE(PollingWaitUntil(
         "getPeerConnectionReadyState()", "no-peer-connection", tab_contents));
   }
 
@@ -498,9 +475,14 @@
   AssertNoAsynchronousErrors(left_tab);
   AssertNoAsynchronousErrors(right_tab);
 
+  // Poll slower here to avoid flooding the log with messages: capturing and
+  // sending frames take quite a bit of time.
+  int polling_interval_msec = 1000;
+
   // TODO(phoglund): (de-dupe later) different from original flow.
-  EXPECT_TRUE(UglyPollingWaitUntil(
-      "doneFrameCapturing()", "done-capturing", right_tab));
+  EXPECT_TRUE(PollingWaitUntil(
+      "doneFrameCapturing()", "done-capturing", right_tab,
+      polling_interval_msec));
 
   HangUp(left_tab);
   WaitUntilHangupVerified(left_tab);
@@ -510,8 +492,9 @@
   AssertNoAsynchronousErrors(right_tab);
 
   // TODO(phoglund): (de-dupe later) different from original flow.
-  EXPECT_TRUE(UglyPollingWaitUntil(
-      "haveMoreFramesToSend()", "no-more-frames", right_tab));
+  EXPECT_TRUE(PollingWaitUntil(
+      "haveMoreFramesToSend()", "no-more-frames", right_tab,
+      polling_interval_msec));
 
   RunARGBtoI420Converter(
       kVgaWidth, kVgaHeight, GetWorkingDir().Append(kCapturedYuvFileName));
diff --git a/chrome/browser/media/webrtc_browsertest_common.cc b/chrome/browser/media/webrtc_browsertest_common.cc
new file mode 100644
index 0000000..83c24fc
--- /dev/null
+++ b/chrome/browser/media/webrtc_browsertest_common.cc
@@ -0,0 +1,80 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/media/webrtc_browsertest_common.h"
+
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "base/process_util.h"
+#include "base/strings/stringprintf.h"
+#include "base/test/test_timeouts.h"
+#include "base/time/time.h"
+#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/infobars/infobar.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/media/media_stream_infobar_delegate.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "chrome/test/ui/ui_test.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/test/browser_test_utils.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
+
+const int kDefaultPollIntervalMsec = 250;
+
+bool SleepInJavascript(content::WebContents* tab_contents, int timeout_msec) {
+  const std::string javascript = base::StringPrintf(
+      "setTimeout(function() {"
+      "  window.domAutomationController.send('sleep-ok');"
+      "}, %d)", timeout_msec);
+
+  std::string result;
+  bool ok = content::ExecuteScriptAndExtractString(
+      tab_contents, javascript, &result);
+  return ok && result == "sleep-ok";
+}
+
+bool PollingWaitUntil(const std::string& javascript,
+                      const std::string& evaluates_to,
+                      content::WebContents* tab_contents) {
+  return PollingWaitUntil(javascript, evaluates_to, tab_contents,
+                          kDefaultPollIntervalMsec);
+}
+
+bool PollingWaitUntil(const std::string& javascript,
+                      const std::string& evaluates_to,
+                      content::WebContents* tab_contents,
+                      int poll_interval_msec) {
+  base::Time start_time = base::Time::Now();
+  base::TimeDelta timeout = TestTimeouts::action_max_timeout();
+  std::string result;
+
+  while (base::Time::Now() - start_time < timeout) {
+    std::string result;
+    if (!content::ExecuteScriptAndExtractString(tab_contents, javascript,
+                                                &result)) {
+      LOG(ERROR) << "Failed to execute javascript " << javascript;
+      return false;
+    }
+
+    if (evaluates_to == result)
+      return true;
+
+    // Sleep a bit here to keep this loop from spinlocking too badly.
+    if (!SleepInJavascript(tab_contents, poll_interval_msec)) {
+      // TODO(phoglund): Figure out why this fails every now and then.
+      // It's not a huge deal if it does though.
+      LOG(ERROR) << "Failed to sleep.";
+    }
+  }
+  LOG(ERROR) << "Timed out while waiting for " << javascript <<
+      " to evaluate to " << evaluates_to << "; last result was '" << result <<
+      "'";
+  return false;
+}
diff --git a/chrome/browser/media/webrtc_browsertest_common.h b/chrome/browser/media/webrtc_browsertest_common.h
new file mode 100644
index 0000000..19d7ae9
--- /dev/null
+++ b/chrome/browser/media/webrtc_browsertest_common.h
@@ -0,0 +1,28 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
+#define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
+
+#include <string>
+
+namespace content {
+class WebContents;
+}
+
+// This function will execute the provided |javascript| until it causes a call
+// to window.domAutomationController.send() with |evaluates_to| as the message.
+// That is, we are NOT checking what the javascript evaluates to. Returns false
+// if we exceed the TestTimeouts::action_max_timeout().
+// TODO(phoglund): Consider a better interaction method with the javascript
+// than polling javascript methods.
+bool PollingWaitUntil(const std::string& javascript,
+                      const std::string& evaluates_to,
+                      content::WebContents* tab_contents);
+bool PollingWaitUntil(const std::string& javascript,
+                      const std::string& evaluates_to,
+                      content::WebContents* tab_contents,
+                      int poll_interval_msec);
+
+#endif  // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_COMMON_H_
diff --git a/chrome/browser/media/webrtc_log_upload_list.cc b/chrome/browser/media/webrtc_log_upload_list.cc
index 9f9922e..fdaaad0 100644
--- a/chrome/browser/media/webrtc_log_upload_list.cc
+++ b/chrome/browser/media/webrtc_log_upload_list.cc
@@ -5,7 +5,6 @@
 #include "chrome/browser/media/webrtc_log_upload_list.h"
 
 #include "base/files/file_path.h"
-#include "base/message_loop/message_loop_proxy.h"
 #include "base/path_service.h"
 #include "chrome/common/chrome_paths.h"
 
@@ -24,8 +23,6 @@
 
 WebRtcLogUploadList::WebRtcLogUploadList(Delegate* delegate,
                                          const base::FilePath& upload_log_path)
-    : base::UploadList(delegate,
-                       upload_log_path,
-                       base::MessageLoopProxy::current()) {}
+    : UploadList(delegate, upload_log_path) {}
 
 WebRtcLogUploadList::~WebRtcLogUploadList() {}
diff --git a/chrome/browser/media/webrtc_log_upload_list.h b/chrome/browser/media/webrtc_log_upload_list.h
index 366a41d..b829d8e 100644
--- a/chrome/browser/media/webrtc_log_upload_list.h
+++ b/chrome/browser/media/webrtc_log_upload_list.h
@@ -5,10 +5,10 @@
 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOAD_LIST_H_
 #define CHROME_BROWSER_MEDIA_WEBRTC_LOG_UPLOAD_LIST_H_
 
-#include "base/upload_list.h"
+#include "chrome/browser/upload_list.h"
 
 // Loads and parses a text file list of uploaded WebRTC logs.
-class WebRtcLogUploadList : public base::UploadList {
+class WebRtcLogUploadList : public UploadList {
  public:
   // Creates the WebRTC log upload list with the given callback delegate.
   static WebRtcLogUploadList* Create(Delegate* delegate);
diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc
index 7afab9f..8625186 100644
--- a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc
+++ b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc
@@ -9,6 +9,7 @@
 #include "chrome/browser/media_galleries/fileapi/supported_image_type_validator.h"
 #include "webkit/browser/fileapi/copy_or_move_file_validator.h"
 #include "webkit/browser/fileapi/file_system_url.h"
+#include "webkit/common/blob/shareable_file_reference.h"
 
 namespace chrome {
 
@@ -17,7 +18,14 @@
 class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator {
  public:
   virtual ~InvalidFileValidator() {}
-  virtual void StartValidation(
+  virtual void StartPreWriteValidation(
+      const fileapi::CopyOrMoveFileValidator::ResultCallback&
+          result_callback) OVERRIDE {
+    result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
+  }
+
+  virtual void StartPostWriteValidation(
+      const base::FilePath& dest_platform_path,
       const fileapi::CopyOrMoveFileValidator::ResultCallback&
           result_callback) OVERRIDE {
     result_callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
index 00c601d..466b5f9 100644
--- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
+++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
@@ -111,8 +111,8 @@
          extension == FILE_PATH_LITERAL(".webp");
 }
 
-void SupportedImageTypeValidator::StartValidation(
-    const fileapi::CopyOrMoveFileValidator::ResultCallback& result_callback) {
+void SupportedImageTypeValidator::StartPreWriteValidation(
+    const ResultCallback& result_callback) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   DCHECK(callback_.is_null());
   callback_ = result_callback;
@@ -125,6 +125,19 @@
                  weak_factory_.GetWeakPtr()));
 }
 
+void SupportedImageTypeValidator::StartPostWriteValidation(
+    const base::FilePath& dest_platform_path,
+    const ResultCallback& result_callback) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  post_write_callback_ = result_callback;
+
+  // TODO(gbillock): Insert AV call here in the right validator.
+  BrowserThread::PostTask(
+      BrowserThread::IO,
+      FROM_HERE,
+      base::Bind(post_write_callback_, base::PLATFORM_FILE_OK));
+}
+
 SupportedImageTypeValidator::SupportedImageTypeValidator(
     const base::FilePath& path)
     : path_(path),
diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h
index 8c655b5..c74d762 100644
--- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h
+++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h
@@ -25,9 +25,12 @@
 
   static bool SupportsFileType(const base::FilePath& path);
 
-  virtual void StartValidation(
-      const fileapi::CopyOrMoveFileValidator::ResultCallback&
-          result_callback) OVERRIDE;
+  virtual void StartPreWriteValidation(
+      const ResultCallback& result_callback) OVERRIDE;
+
+  virtual void StartPostWriteValidation(
+      const base::FilePath& dest_platform_path,
+      const ResultCallback& result_callback) OVERRIDE;
 
  private:
   friend class MediaFileValidatorFactory;
@@ -39,6 +42,7 @@
   base::FilePath path_;
   scoped_refptr<ImageDecoder> decoder_;
   fileapi::CopyOrMoveFileValidator::ResultCallback callback_;
+  fileapi::CopyOrMoveFileValidator::ResultCallback post_write_callback_;
   base::WeakPtrFactory<SupportedImageTypeValidator> weak_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(SupportedImageTypeValidator);
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index c8ee4cf..54e26c7 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -411,7 +411,7 @@
 // static
 const int ThreadWatcherList::kUnresponsiveSeconds = 2;
 // static
-const int ThreadWatcherList::kUnresponsiveCount = 9;
+const int ThreadWatcherList::kUnresponsiveCount = 7;
 // static
 const int ThreadWatcherList::kLiveThreadsThreshold = 2;
 
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.cc b/chrome/browser/nacl_host/nacl_broker_host_win.cc
index bcb250b..2ab2aca 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.cc
@@ -10,8 +10,8 @@
 #include "ipc/ipc_switches.h"
 #include "chrome/browser/nacl_host/nacl_broker_service_win.h"
 #include "chrome/browser/nacl_host/nacl_browser.h"
-#include "chrome/common/nacl_messages.h"
 #include "components/nacl/common/nacl_cmd_line.h"
+#include "components/nacl/common/nacl_messages.h"
 #include "components/nacl/common/nacl_process_type.h"
 #include "components/nacl/common/nacl_switches.h"
 #include "content/public/browser/browser_child_process_host.h"
diff --git a/chrome/browser/nacl_host/nacl_file_host.cc b/chrome/browser/nacl_host/nacl_file_host.cc
index ca1feb9..8b40b8a 100644
--- a/chrome/browser/nacl_host/nacl_file_host.cc
+++ b/chrome/browser/nacl_host/nacl_file_host.cc
@@ -17,8 +17,8 @@
 #include "chrome/browser/nacl_host/nacl_browser.h"
 #include "chrome/browser/nacl_host/nacl_host_message_filter.h"
 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h"
-#include "chrome/common/nacl_host_messages.h"
 #include "components/nacl/common/nacl_browser_delegate.h"
+#include "components/nacl/common/nacl_host_messages.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/site_instance.h"
diff --git a/chrome/browser/nacl_host/nacl_host_message_filter.cc b/chrome/browser/nacl_host/nacl_host_message_filter.cc
index ceecc2a..b408a17 100644
--- a/chrome/browser/nacl_host/nacl_host_message_filter.cc
+++ b/chrome/browser/nacl_host/nacl_host_message_filter.cc
@@ -9,7 +9,7 @@
 #include "chrome/browser/nacl_host/nacl_file_host.h"
 #include "chrome/browser/nacl_host/nacl_process_host.h"
 #include "chrome/browser/nacl_host/pnacl_host.h"
-#include "chrome/common/nacl_host_messages.h"
+#include "components/nacl/common/nacl_host_messages.h"
 #include "extensions/common/constants.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index ee67c58..59879e4 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -25,10 +25,10 @@
 #include "build/build_config.h"
 #include "chrome/browser/nacl_host/nacl_browser.h"
 #include "chrome/browser/nacl_host/nacl_host_message_filter.h"
-#include "chrome/common/nacl_host_messages.h"
-#include "chrome/common/nacl_messages.h"
 #include "components/nacl/common/nacl_browser_delegate.h"
 #include "components/nacl/common/nacl_cmd_line.h"
+#include "components/nacl/common/nacl_host_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 #include "components/nacl/common/nacl_process_type.h"
 #include "components/nacl/common/nacl_switches.h"
 #include "content/public/browser/browser_child_process_host.h"
@@ -57,7 +57,7 @@
 #include "base/threading/thread.h"
 #include "base/win/scoped_handle.h"
 #include "chrome/browser/nacl_host/nacl_broker_service_win.h"
-#include "chrome/common/nacl_debug_exception_handler_win.h"
+#include "components/nacl/common/nacl_debug_exception_handler_win.h"
 #include "content/public/common/sandbox_init.h"
 #include "content/public/common/sandboxed_process_launcher_delegate.h"
 #endif
diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h
index 1250b3c..808a274 100644
--- a/chrome/browser/nacl_host/nacl_process_host.h
+++ b/chrome/browser/nacl_host/nacl_process_host.h
@@ -13,7 +13,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/process.h"
-#include "chrome/common/nacl_types.h"
+#include "components/nacl/common/nacl_types.h"
 #include "content/public/browser/browser_child_process_host_delegate.h"
 #include "content/public/browser/browser_child_process_host_iterator.h"
 #include "ipc/ipc_channel_handle.h"
diff --git a/chrome/browser/nacl_host/pnacl_host.h b/chrome/browser/nacl_host/pnacl_host.h
index b55c9a6..e449ce2 100644
--- a/chrome/browser/nacl_host/pnacl_host.h
+++ b/chrome/browser/nacl_host/pnacl_host.h
@@ -12,7 +12,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/threading/thread_checker.h"
 #include "chrome/browser/nacl_host/nacl_file_host.h"
-#include "chrome/common/pnacl_types.h"
+#include "components/nacl/common/pnacl_types.h"
 #include "ipc/ipc_platform_file.h"
 
 namespace pnacl {
diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc
index 5127d55..7a06aae 100644
--- a/chrome/browser/net/connection_tester.cc
+++ b/chrome/browser/net/connection_tester.cc
@@ -37,7 +37,7 @@
 #include "net/url_request/url_request_context_storage.h"
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
-#include "chrome/browser/importer/firefox_proxy_settings.h"
+#include "chrome/browser/net/firefox_proxy_settings.h"
 #endif
 
 namespace {
diff --git a/chrome/browser/importer/firefox_proxy_settings.cc b/chrome/browser/net/firefox_proxy_settings.cc
similarity index 70%
rename from chrome/browser/importer/firefox_proxy_settings.cc
rename to chrome/browser/net/firefox_proxy_settings.cc
index 58aa4f3..aece777 100644
--- a/chrome/browser/importer/firefox_proxy_settings.cc
+++ b/chrome/browser/net/firefox_proxy_settings.cc
@@ -1,10 +1,12 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/importer/firefox_proxy_settings.h"
+#include "chrome/browser/net/firefox_proxy_settings.h"
 
+#include "base/file_util.h"
 #include "base/files/file_path.h"
+#include "base/strings/string_number_conversions.h"
 #include "base/strings/string_tokenizer.h"
 #include "base/strings/string_util.h"
 #include "base/values.h"
@@ -57,6 +59,84 @@
   }
 }
 
+// Parses the prefs found in the file |pref_file| and puts the key/value pairs
+// in |prefs|. Keys are strings, and values can be strings, booleans or
+// integers.  Returns true if it succeeded, false otherwise (in which case
+// |prefs| is not filled).
+// Note: for strings, only valid UTF-8 string values are supported. If a
+// key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|.
+bool ParsePrefFile(const base::FilePath& pref_file, DictionaryValue* prefs) {
+  // The string that is before a pref key.
+  const std::string kUserPrefString = "user_pref(\"";
+  std::string contents;
+  if (!file_util::ReadFileToString(pref_file, &contents))
+    return false;
+
+  std::vector<std::string> lines;
+  Tokenize(contents, "\n", &lines);
+
+  for (std::vector<std::string>::const_iterator iter = lines.begin();
+       iter != lines.end(); ++iter) {
+    const std::string& line = *iter;
+    size_t start_key = line.find(kUserPrefString);
+    if (start_key == std::string::npos)
+      continue;  // Could be a comment or a blank line.
+    start_key += kUserPrefString.length();
+    size_t stop_key = line.find('"', start_key);
+    if (stop_key == std::string::npos) {
+      LOG(ERROR) << "Invalid key found in Firefox pref file '" <<
+          pref_file.value() << "' line is '" << line << "'.";
+      continue;
+    }
+    std::string key = line.substr(start_key, stop_key - start_key);
+    size_t start_value = line.find(',', stop_key + 1);
+    if (start_value == std::string::npos) {
+      LOG(ERROR) << "Invalid value found in Firefox pref file '" <<
+          pref_file.value() << "' line is '" << line << "'.";
+      continue;
+    }
+    size_t stop_value = line.find(");", start_value + 1);
+    if (stop_value == std::string::npos) {
+      LOG(ERROR) << "Invalid value found in Firefox pref file '" <<
+          pref_file.value() << "' line is '" << line << "'.";
+      continue;
+    }
+    std::string value = line.substr(start_value + 1,
+                                    stop_value - start_value - 1);
+    TrimWhitespace(value, TRIM_ALL, &value);
+    // Value could be a boolean.
+    bool is_value_true = LowerCaseEqualsASCII(value, "true");
+    if (is_value_true || LowerCaseEqualsASCII(value, "false")) {
+      prefs->SetBoolean(key, is_value_true);
+      continue;
+    }
+
+    // Value could be a string.
+    if (value.size() >= 2U &&
+        value[0] == '"' && value[value.size() - 1] == '"') {
+      value = value.substr(1, value.size() - 2);
+      // ValueString only accept valid UTF-8.  Simply ignore that entry if it is
+      // not UTF-8.
+      if (IsStringUTF8(value))
+        prefs->SetString(key, value);
+      else
+        VLOG(1) << "Non UTF8 value for key " << key << ", ignored.";
+      continue;
+    }
+
+    // Or value could be an integer.
+    int int_value = 0;
+    if (base::StringToInt(value, &int_value)) {
+      prefs->SetInteger(key, int_value);
+      continue;
+    }
+
+    LOG(ERROR) << "Invalid value found in Firefox pref file '"
+               << pref_file.value() << "' value is '" << value << "'.";
+  }
+  return true;
+}
+
 }  // namespace
 
 FirefoxProxySettings::FirefoxProxySettings() {
diff --git a/chrome/browser/importer/firefox_proxy_settings.h b/chrome/browser/net/firefox_proxy_settings.h
similarity index 91%
rename from chrome/browser/importer/firefox_proxy_settings.h
rename to chrome/browser/net/firefox_proxy_settings.h
index 41657a2..34ea9ff 100644
--- a/chrome/browser/importer/firefox_proxy_settings.h
+++ b/chrome/browser/net/firefox_proxy_settings.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_
-#define CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_
+#ifndef CHROME_BROWSER_NET_FIREFOX_PROXY_SETTINGS_H_
+#define CHROME_BROWSER_NET_FIREFOX_PROXY_SETTINGS_H_
 
 #include <string>
 #include <vector>
@@ -109,4 +109,4 @@
   DISALLOW_COPY_AND_ASSIGN(FirefoxProxySettings);
 };
 
-#endif  // CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_
+#endif  // CHROME_BROWSER_NET_FIREFOX_PROXY_SETTINGS_H_
diff --git a/chrome/browser/importer/firefox_proxy_settings_unittest.cc b/chrome/browser/net/firefox_proxy_settings_unittest.cc
similarity index 96%
rename from chrome/browser/importer/firefox_proxy_settings_unittest.cc
rename to chrome/browser/net/firefox_proxy_settings_unittest.cc
index 7699e13..f1740e9 100644
--- a/chrome/browser/importer/firefox_proxy_settings_unittest.cc
+++ b/chrome/browser/net/firefox_proxy_settings_unittest.cc
@@ -1,14 +1,14 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "testing/gtest/include/gtest/gtest.h"
+#include "chrome/browser/net/firefox_proxy_settings.h"
 
 #include "base/files/file_path.h"
 #include "base/path_service.h"
-#include "chrome/browser/importer/firefox_proxy_settings.h"
 #include "chrome/common/chrome_paths.h"
 #include "net/proxy/proxy_config.h"
+#include "testing/gtest/include/gtest/gtest.h"
 
 class FirefoxProxySettingsTest : public testing::Test {
 };
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
index 3b64e1d..d8ab2c7 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
@@ -8,10 +8,10 @@
 #include <string>
 
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
 #include "chrome/browser/net/gaia/gaia_oauth_consumer.h"
 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "google_apis/gaia/google_service_auth_error.h"
@@ -23,8 +23,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-using ::testing::_;
-
 class MockGaiaOAuthConsumer : public GaiaOAuthConsumer {
  public:
   MockGaiaOAuthConsumer() {}
@@ -123,7 +121,10 @@
 }
 #endif  // 0  // Suppressing for now
 
-typedef testing::Test GaiaOAuthFetcherTest;
+class GaiaOAuthFetcherTest : public testing::Test {
+ private:
+  content::TestBrowserThreadBundle thread_bundle_;
+};
 
 TEST_F(GaiaOAuthFetcherTest, OAuthGetAccessToken) {
   const std::string oauth_token =
diff --git a/chrome/browser/notifications/message_center_settings_controller.cc b/chrome/browser/notifications/message_center_settings_controller.cc
index 2a0666a..5e9a588 100644
--- a/chrome/browser/notifications/message_center_settings_controller.cc
+++ b/chrome/browser/notifications/message_center_settings_controller.cc
@@ -9,6 +9,7 @@
 #include "base/command_line.h"
 #include "base/i18n/string_compare.h"
 #include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/extensions/app_icon_loader_impl.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/favicon/favicon_service.h"
@@ -18,11 +19,12 @@
 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h"
-#include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/common/cancelable_task_tracker.h"
 #include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/favicon/favicon_types.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
 #include "grit/theme_resources.h"
 #include "grit/ui_strings.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -59,7 +61,13 @@
 
 }  // namespace
 
-MessageCenterSettingsController::MessageCenterSettingsController() {
+MessageCenterSettingsController::MessageCenterSettingsController()
+  : profile_(NULL) {
+  // We set the profile associated with the settings at the beginning and fail
+  // silently if this profile is destroyed later. This is a temporary fix for
+  // http://crbug.com/263193
+  registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
+                 content::NotificationService::AllSources());
 }
 
 MessageCenterSettingsController::~MessageCenterSettingsController() {
@@ -81,9 +89,9 @@
   // TODO(mukai): Fix this for multi-profile.
   // Temporarily use the last used profile to prevent chrome from crashing when
   // the default profile is not loaded.
-  Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
+  profile_ = ProfileManager::GetLastUsedProfileAllowedByPolicy();
   DesktopNotificationService* notification_service =
-      DesktopNotificationServiceFactory::GetForProfile(profile);
+      DesktopNotificationServiceFactory::GetForProfile(profile_);
 
   UErrorCode error;
   scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(error));
@@ -91,7 +99,7 @@
   if (!U_FAILURE(error))
     comparator.reset(new NotifierComparator(collator.get()));
 
-  ExtensionService* extension_service = profile->GetExtensionService();
+  ExtensionService* extension_service = profile_->GetExtensionService();
   const ExtensionSet* extension_set = extension_service->extensions();
   // The extension icon size has to be 32x32 at least to load bigger icons if
   // the icon doesn't exist for the specified size, and in that case it falls
@@ -99,7 +107,7 @@
   // dialog. See chrome/browser/extensions/extension_icon_image.cc and
   // crbug.com/222931
   app_icon_loader_.reset(new extensions::AppIconLoaderImpl(
-      profile, extension_misc::EXTENSION_ICON_SMALL, this));
+      profile_, extension_misc::EXTENSION_ICON_SMALL, this));
   for (ExtensionSet::const_iterator iter = extension_set->begin();
        iter != extension_set->end(); ++iter) {
     const extensions::Extension* extension = iter->get();
@@ -120,7 +128,7 @@
           CommandLine::ForCurrentProcess())) {
     notifier::ChromeNotifierService* sync_notifier_service =
         notifier::ChromeNotifierServiceFactory::GetInstance()->GetForProfile(
-            profile, Profile::EXPLICIT_ACCESS);
+            profile_, Profile::EXPLICIT_ACCESS);
     sync_notifier_service->GetSyncedNotificationServices(notifiers);
 
     if (comparator)
@@ -134,7 +142,7 @@
   ContentSettingsForOneType settings;
   notification_service->GetNotificationsSettings(&settings);
   FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
-      profile, Profile::EXPLICIT_ACCESS);
+      profile_, Profile::EXPLICIT_ACCESS);
   favicon_tracker_.reset(new CancelableTaskTracker());
   patterns_.clear();
   for (ContentSettingsForOneType::const_iterator iter = settings.begin();
@@ -155,7 +163,7 @@
         notification_service->IsNotifierEnabled(notifier_id)));
     patterns_[name] = iter->primary_pattern;
     FaviconService::FaviconForURLParams favicon_params(
-        profile, url, chrome::FAVICON | chrome::TOUCH_ICON,
+        profile_, url, chrome::FAVICON | chrome::TOUCH_ICON,
         message_center::kSettingsIconSize);
     // Note that favicon service obtains the favicon from history. This means
     // that it will fail to obtain the image if there are no history data for
@@ -194,9 +202,11 @@
     const Notifier& notifier,
     bool enabled) {
   // TODO(mukai): Fix this for multi-profile.
-  Profile* profile = ProfileManager::GetDefaultProfile();
+  // If the profile has been destroyed, fail silently.
+  if (!profile_)
+    return;
   DesktopNotificationService* notification_service =
-      DesktopNotificationServiceFactory::GetForProfile(profile);
+      DesktopNotificationServiceFactory::GetForProfile(profile_);
 
   if (notifier.notifier_id.type == NotifierId::WEB_PAGE) {
     // WEB_PAGE notifier cannot handle in DesktopNotificationService
@@ -233,7 +243,7 @@
     if (notifier.notifier_id.type == NotifierId::SYNCED_NOTIFICATION_SERVICE) {
       notifier::ChromeNotifierService* notifier_service =
           notifier::ChromeNotifierServiceFactory::GetInstance()->GetForProfile(
-              profile, Profile::EXPLICIT_ACCESS);
+              profile_, Profile::EXPLICIT_ACCESS);
       notifier_service->OnSyncedNotificationServiceEnabled(
           notifier.notifier_id.id, enabled);
     }
@@ -246,6 +256,17 @@
   patterns_.clear();
 }
 
+void MessageCenterSettingsController::Observe(
+    int type,
+    const content::NotificationSource& source,
+    const content::NotificationDetails& details) {
+  if (type == chrome::NOTIFICATION_PROFILE_DESTROYED &&
+      content::Source<Profile>(source).ptr() == profile_) {
+    // Our profile just got destroyed, so we delete our pointer to it.
+    profile_ = NULL;
+  }
+}
+
 void MessageCenterSettingsController::OnFaviconLoaded(
     const GURL& url,
     const chrome::FaviconImageResult& favicon_result) {
diff --git a/chrome/browser/notifications/message_center_settings_controller.h b/chrome/browser/notifications/message_center_settings_controller.h
index 71487c5..1a66099 100644
--- a/chrome/browser/notifications/message_center_settings_controller.h
+++ b/chrome/browser/notifications/message_center_settings_controller.h
@@ -12,7 +12,10 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/observer_list.h"
 #include "chrome/browser/extensions/app_icon_loader.h"
+#include "chrome/browser/profiles/profile.h"
 #include "chrome/common/content_settings.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
 #include "ui/message_center/notifier_settings.h"
 
 class CancelableTaskTracker;
@@ -25,7 +28,8 @@
 // storage.
 class MessageCenterSettingsController
     : public message_center::NotifierSettingsProvider,
-      public extensions::AppIconLoader::Delegate {
+      public extensions::AppIconLoader::Delegate,
+      public content::NotificationObserver {
  public:
   MessageCenterSettingsController();
   virtual ~MessageCenterSettingsController();
@@ -48,6 +52,11 @@
                            const gfx::ImageSkia& image) OVERRIDE;
 
  private:
+  // Overridden from content::NotificationObserver.
+  virtual void Observe(int type,
+                       const content::NotificationSource& source,
+                       const content::NotificationDetails& details) OVERRIDE;
+
   void OnFaviconLoaded(const GURL& url,
                        const chrome::FaviconImageResult& favicon_result);
 
@@ -61,6 +70,13 @@
 
   std::map<string16, ContentSettingsPattern> patterns_;
 
+  // The Registrar used to register for notifications.
+  content::NotificationRegistrar registrar_;
+
+  // TODO(sidharthms): Fix this for multi-profile.
+  // The profile associated with message center settings.
+  Profile* profile_;
+
   DISALLOW_COPY_AND_ASSIGN(MessageCenterSettingsController);
 };
 
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc
index 84643d3..d19153b 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc
@@ -8,12 +8,16 @@
 
 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
 
+#include <string>
+#include <vector>
+
 #include "chrome/browser/notifications/desktop_notification_service.h"
 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
 #include "chrome/browser/notifications/notification.h"
 #include "chrome/browser/notifications/notification_ui_manager.h"
 #include "chrome/browser/profiles/profile.h"
-#include "grit/ui_strings.h"
+#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
 #include "sync/api/sync_change.h"
 #include "sync/api/sync_change_processor.h"
 #include "sync/api/sync_error_factory.h"
@@ -21,13 +25,14 @@
 #include "sync/protocol/synced_notification_specifics.pb.h"
 #include "third_party/WebKit/public/web/WebTextDirection.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
 #include "ui/message_center/notifier_settings.h"
 #include "url/gurl.h"
 
 namespace notifier {
 namespace {
 
-const char kSampleSyncedNotificationServiceId[] = "sample-synced-service";
+const char kFirstSyncedNotificationServiceId[] = "Google+";
 
 }
 
@@ -35,7 +40,8 @@
 
 ChromeNotifierService::ChromeNotifierService(Profile* profile,
                                              NotificationUIManager* manager)
-    : profile_(profile), notification_manager_(manager) {}
+    : profile_(profile), notification_manager_(manager) {
+}
 ChromeNotifierService::~ChromeNotifierService() {}
 
 // Methods from BrowserContextKeyedService.
@@ -270,20 +276,31 @@
   // TODO(mukai|petewil): Check the profile's eligibility before adding the
   // sample app.
 
-  // Currently we just use kSampleSyncedNotificationServiceId as a place holder.
-  // TODO(petewil): Really obtain the list of apps from the server and create
-  // the list of ids here.
+  // TODO(petewil): Really obtain the list of synced notification sending
+  // services from the server and create the list of ids here.  Until then, we
+  // are hardcoding the service names.  Once that is done, remove this
+  // hardcoding.
+  // crbug.com/248337
   DesktopNotificationService* desktop_notification_service =
       DesktopNotificationServiceFactory::GetForProfile(profile_);
   message_center::NotifierId notifier_id(
       message_center::NotifierId::SYNCED_NOTIFICATION_SERVICE,
-      kSampleSyncedNotificationServiceId);
-  notifiers->push_back(new message_center::Notifier(
+      kFirstSyncedNotificationServiceId);
+  message_center::Notifier* notifier_service = new message_center::Notifier(
       notifier_id,
       l10n_util::GetStringUTF16(
-          IDS_MESSAGE_CENTER_SAMPLE_SYNCED_NOTIFICATION_SERVICE_NAME),
-      desktop_notification_service->IsNotifierEnabled(notifier_id)));
-  // TODO(mukai): Add icon for the sample app.
+          IDS_FIRST_SYNCED_NOTIFICATION_SERVICE_NAME),
+      desktop_notification_service->IsNotifierEnabled(notifier_id));
+
+  // Add icons for our sending services.
+  // TODO(petewil): Replace this temporary hardcoding with a new sync datatype
+  // to dynamically get the name and icon for each synced notification sending
+  // service.  Until then, we use hardcoded service icons for all services.
+  // crbug.com/248337
+  notifier_service->icon = ui::ResourceBundle::GetSharedInstance().
+      GetImageNamed(IDR_TEMPORARY_GOOGLE_PLUS_ICON);
+
+  notifiers->push_back(notifier_service);
 }
 
 void ChromeNotifierService::MarkNotificationAsDismissed(
@@ -311,6 +328,15 @@
   // Take ownership of the object and put it into our local storage.
   notification_data_.push_back(notification.release());
 
+  // If the user is not interested in this type of notification, ignore it.
+  std::vector<std::string>::iterator iter =
+      find(enabled_sending_services_.begin(),
+           enabled_sending_services_.end(),
+           notification_copy->GetSendingServiceId());
+  if (iter == enabled_sending_services_.end()) {
+    return;
+  }
+
   Display(notification_copy);
 }
 
@@ -320,6 +346,7 @@
   }
 
 void ChromeNotifierService::Display(SyncedNotification* notification) {
+
   // Set up to fetch the bitmaps.
   notification->QueueBitmapFetchJobs(notification_manager_,
                                           this,
@@ -337,7 +364,23 @@
 
 void ChromeNotifierService::OnSyncedNotificationServiceEnabled(
     const std::string& notifier_id, bool enabled) {
-  // TODO(petewil): start/stop syncing
+  std::vector<std::string>::iterator iter;
+
+  iter = find(enabled_sending_services_.begin(),
+              enabled_sending_services_.end(),
+              notifier_id);
+
+  // Add the notifier_id if it is enabled and not already there.
+  if (iter == enabled_sending_services_.end() && enabled) {
+    enabled_sending_services_.push_back(notifier_id);
+    // TODO(petewil) Check now for any outstanding notifications.
+  // Remove the notifier_id if it is disabled and present.
+  } else if (iter != enabled_sending_services_.end() && !enabled) {
+    enabled_sending_services_.erase(iter);
+  }
+
+  // Otherwise, nothing to do, we can exit.
+  return;
 }
 
 }  // namespace notifier
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
index b423703..13a21f0 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
@@ -98,6 +98,7 @@
   Profile* const profile_;
   NotificationUIManager* const notification_manager_;
   scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
+  std::vector<std::string> enabled_sending_services_;
   static bool avoid_bitmap_fetching_for_test_;
 
   // TODO(petewil): Consider whether a map would better suit our data.
diff --git a/chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.cc b/chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.cc
index e560baf..11b0345 100644
--- a/chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.cc
+++ b/chrome/browser/notifications/sync_notifier/sync_notifier_test_utils.cc
@@ -109,24 +109,24 @@
 
   // Set the title.
   simple_expanded_layout->set_title(title);
+  simple_collapsed_layout->set_heading(title);
 
   // Set the text.
   simple_expanded_layout->set_text(text);
+  simple_collapsed_layout->set_description(text);
+  simple_collapsed_layout->set_annotation(text);
 
   // Set the heading.
   simple_collapsed_layout->set_heading(title);
 
   // Add the collapsed info and set the app_icon_url on it.
-  expanded_info->add_collapsed_info();
-  expanded_info->
-      mutable_collapsed_info(0)->
-      mutable_simple_collapsed_layout()->
+  simple_collapsed_layout->
       mutable_app_icon()->
       set_url(app_icon_url);
 
   // Add the media object and set the image url on it.
-  simple_expanded_layout->add_media();
-  simple_expanded_layout->
+  simple_collapsed_layout->add_media();
+  simple_collapsed_layout->
       mutable_media(0)->
       mutable_image()->
       set_url(image_url);
@@ -136,8 +136,7 @@
   coalesced_notification->set_read_state(read_state);
 
   // Contained notification one.
-  // We re-use the collapsed info we added for the app_icon_url,
-  // so no need to create another one here.
+  expanded_info->add_collapsed_info();
   sync_pb::SimpleCollapsedLayout* notification_layout1 =
       expanded_info->
       mutable_collapsed_info(0)->
diff --git a/chrome/browser/notifications/sync_notifier/synced_notification.cc b/chrome/browser/notifications/sync_notifier/synced_notification.cc
index 851c5d6..7dd6c5e 100644
--- a/chrome/browser/notifications/sync_notifier/synced_notification.cc
+++ b/chrome/browser/notifications/sync_notifier/synced_notification.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/notifications/sync_notifier/synced_notification.h"
 
 #include "base/basictypes.h"
+#include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
 #include "base/values.h"
@@ -21,6 +22,14 @@
 
 namespace {
 const char kExtensionScheme[] = "chrome-extension://";
+const char kDefaultSyncedNotificationScheme[] = "https:";
+
+// The name of our first synced notification service.
+// TODO(petewil): remove this hardcoding once we have the synced notification
+// signalling sync data type set up to provide this.
+// crbug.com/248337
+const char kFirstSyncedNotificationServiceId[] = "Google+";
+
 
 // Today rich notifications only supports two buttons, make sure we don't
 // try to supply them with more than this number of buttons.
@@ -30,6 +39,16 @@
   return message_center::IsRichNotificationEnabled();
 }
 
+// Schema-less specs default badly in windows.  If we find one, add the schema
+// we expect instead of allowing windows specific GURL code to make it default
+// to "file:".
+GURL AddDefaultSchemaIfNeeded(std::string& url_spec) {
+  if (StartsWithASCII(url_spec, std::string("//"), false))
+    return GURL(std::string(kDefaultSyncedNotificationScheme) + url_spec);
+
+  return GURL(url_spec);
+}
+
 }  // namespace
 
 namespace notifier {
@@ -76,13 +95,16 @@
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
 
   // Match the incoming bitmaps to URLs.  In case this is a dup, make sure to
-  // Try all potentially matching urls.
+  // try all potentially matching urls.
   if (GetAppIconUrl() == url && bitmap != NULL) {
     app_icon_bitmap_ = gfx::Image::CreateFrom1xBitmap(*bitmap);
   }
   if (GetImageUrl() == url && bitmap != NULL) {
     image_bitmap_ = gfx::Image::CreateFrom1xBitmap(*bitmap);
   }
+  if (GetProfilePictureUrl(0) == url && bitmap != NULL) {
+    sender_bitmap_ = gfx::Image::CreateFrom1xBitmap(*bitmap);
+  }
 
   // If this URL matches one or more button bitmaps, save them off.
   for (unsigned int i = 0; i < GetButtonCount(); ++i) {
@@ -123,6 +145,13 @@
     AddBitmapToFetchQueue(GetButtonIconUrl(i));
   }
 
+  // If there is a profile image bitmap, fetch it
+  if (GetProfilePictureCount() > 0) {
+    // TODO(petewil): When we have the capacity to display more than one bitmap,
+    // modify this code to fetch as many as we can display
+    AddBitmapToFetchQueue(GetProfilePictureUrl(0));
+  }
+
   // If the URL is non-empty, add it to our queue of URLs to fetch.
   AddBitmapToFetchQueue(GetAppIconUrl());
   AddBitmapToFetchQueue(GetImageUrl());
@@ -171,9 +200,13 @@
   GURL image_url = GetImageUrl();
   string16 text = UTF8ToUTF16(GetText());
   string16 heading = UTF8ToUTF16(GetHeading());
+  string16 description = UTF8ToUTF16(GetDescription());
+  string16 annotation = UTF8ToUTF16(GetAnnotation());
   // TODO(petewil): Eventually put the display name of the sending service here.
   string16 display_source = UTF8ToUTF16(GetOriginUrl().spec());
   string16 replace_key = UTF8ToUTF16(GetKey());
+  string16 notification_heading = heading;
+  string16 notification_text = text;
 
   // The delegate will eventually catch calls that the notification
   // was read or deleted, and send the changes back to the server.
@@ -209,7 +242,7 @@
     // Fill in the button data.
     // TODO(petewil): Today Rich notifiations are limited to two buttons.
     // When rich notifications supports more, remove the
-    // "&& i < kMaxNotificationButtonIndex" below.
+    // "&& i < kMaxNotificationButtonIndex" clause below.
     for (unsigned int i = 0;
          i < button_count
          && i < button_bitmaps_.size()
@@ -239,11 +272,33 @@
       }
     }
 
+    // Set the heading and text appropriately for the message type.
+    notification_text = annotation;
+    if (notification_type == message_center::NOTIFICATION_TYPE_IMAGE) {
+      // For an image, fill in the description field.
+      notification_text = description;
+    } else if (notification_count == 1) {
+      // For a single collapsed info entry, use the contained message if any.
+      std::string comment_body = GetContainedNotificationMessage(0);
+      std::string comment_header = GetContainedNotificationTitle(0);
+      if (!comment_header.empty() && !comment_body.empty())
+        notification_text = UTF8ToUTF16(comment_header) + UTF8ToUTF16(" ") +
+            UTF8ToUTF16(comment_body);
+    }
+
+    // If there is a single person sending, use their picture instead of the app
+    // icon.
+    // TODO(petewil): Someday combine multiple profile photos here.
+    gfx::Image icon_bitmap = app_icon_bitmap_;
+    if (GetProfilePictureCount() == 1)  {
+      icon_bitmap = sender_bitmap_;
+    }
+
     Notification ui_notification(notification_type,
                                  GetOriginUrl(),
-                                 heading,
-                                 text,
-                                 app_icon_bitmap_,
+                                 notification_heading,
+                                 notification_text,
+                                 icon_bitmap,
                                  WebKit::WebTextDirectionDefault,
                                  display_source,
                                  replace_key,
@@ -251,11 +306,11 @@
                                  delegate.get());
     notification_manager->Add(ui_notification, profile);
   } else {
-
+    // In this case we have a Webkit Notification, not a Rich Notification.
     Notification ui_notification(GetOriginUrl(),
                                  GetAppIconUrl(),
-                                 heading,
-                                 text,
+                                 notification_heading,
+                                 notification_text,
                                  WebKit::WebTextDirectionDefault,
                                  display_source,
                                  replace_key,
@@ -272,13 +327,13 @@
 }
 
 // This should detect even small changes in case the server updated the
-// notification.
-// TODO(petewil): Should I also ignore the timestamp if other fields match?
+// notification.  We ignore the timestamp if other fields match.
 bool SyncedNotification::EqualsIgnoringReadState(
     const SyncedNotification& other) const {
   if (GetTitle() == other.GetTitle() &&
       GetHeading() == other.GetHeading() &&
       GetDescription() == other.GetDescription() &&
+      GetAnnotation() == other.GetAnnotation() &&
       GetAppId() == other.GetAppId() &&
       GetKey() == other.GetKey() &&
       GetOriginUrl() == other.GetOriginUrl() &&
@@ -291,7 +346,8 @@
       GetDefaultDestinationTitle() == other.GetDefaultDestinationTitle() &&
       GetDefaultDestinationIconUrl() == other.GetDefaultDestinationIconUrl() &&
       GetNotificationCount() == other.GetNotificationCount() &&
-      GetButtonCount() == other.GetButtonCount()) {
+      GetButtonCount() == other.GetButtonCount() &&
+      GetProfilePictureCount() == other.GetProfilePictureCount()) {
 
     // If all the surface data matched, check, to see if contained data also
     // matches, titles and messages.
@@ -314,6 +370,13 @@
         return false;
     }
 
+    // Make sure profile icons match
+    count = GetButtonCount();
+    for (size_t kk = 0; kk < count; ++kk) {
+      if (GetProfilePictureUrl(kk) != other.GetProfilePictureUrl(kk))
+        return false;
+    }
+
     // If buttons and notifications matched, they are equivalent.
     return true;
   }
@@ -369,6 +432,15 @@
       simple_collapsed_layout().description();
 }
 
+std::string SyncedNotification::GetAnnotation() const {
+  if (!specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().has_annotation())
+    return std::string();
+
+  return specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().annotation();
+}
+
 std::string SyncedNotification::GetAppId() const {
   if (!specifics_.coalesced_notification().has_app_id())
     return std::string();
@@ -387,35 +459,32 @@
   return GURL(origin_url);
 }
 
-// TODO(petewil): This only returns the first icon. Make all the icons
-// available.
 GURL SyncedNotification::GetAppIconUrl() const {
-  if (specifics_.coalesced_notification().render_info().expanded_info().
-      collapsed_info_size() == 0)
+  if (!specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().has_app_icon())
     return GURL();
 
-  if (!specifics_.coalesced_notification().render_info().expanded_info().
-      collapsed_info(0).simple_collapsed_layout().has_app_icon())
-    return GURL();
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().simple_collapsed_layout().app_icon().url();
 
-  return GURL(specifics_.coalesced_notification().render_info().
-              expanded_info().collapsed_info(0).simple_collapsed_layout().
-              app_icon().url());
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
-// TODO(petewil): This currenly only handles the first image from the first
-// collapsed item, someday return all images.
+// TODO(petewil): This ignores all but the first image.  If Rich Notifications
+// supports more images someday, then fetch all images.
 GURL SyncedNotification::GetImageUrl() const {
-  if (specifics_.coalesced_notification().render_info().expanded_info().
-      simple_expanded_layout().media_size() == 0)
+  if (specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().media_size() == 0)
     return GURL();
 
-  if (!specifics_.coalesced_notification().render_info().expanded_info().
-      simple_expanded_layout().media(0).image().has_url())
+  if (!specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().media(0).image().has_url())
     return GURL();
 
-  return GURL(specifics_.coalesced_notification().render_info().
-              expanded_info().simple_expanded_layout().media(0).image().url());
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().simple_collapsed_layout().media(0).image().url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
 std::string SyncedNotification::GetText() const {
@@ -470,7 +539,9 @@
     return message_center::DEFAULT_PRIORITY;
   } else if (protobuf_priority ==
              sync_pb::CoalescedSyncedNotification_Priority_HIGH) {
-    return message_center::HIGH_PRIORITY;
+    // High priority synced notifications are considered default priority in
+    // Chrome.
+    return message_center::DEFAULT_PRIORITY;
   } else {
     // Complain if this is a new priority we have not seen before.
     DCHECK(protobuf_priority <
@@ -491,6 +562,23 @@
       target_size();
 }
 
+size_t SyncedNotification::GetProfilePictureCount() const {
+  return specifics_.coalesced_notification().render_info().collapsed_info().
+      simple_collapsed_layout().profile_image_size();
+}
+
+GURL SyncedNotification::GetProfilePictureUrl(unsigned int which_url) const {
+  if (GetProfilePictureCount() <= which_url)
+    return GURL();
+
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+      collapsed_info().simple_collapsed_layout().profile_image(which_url).
+      image_url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
+}
+
+
 std::string SyncedNotification::GetDefaultDestinationTitle() const {
   if (!specifics_.coalesced_notification().render_info().collapsed_info().
       default_destination().icon().has_alt_text()) {
@@ -505,8 +593,10 @@
       default_destination().icon().has_url()) {
     return GURL();
   }
-  return GURL(specifics_.coalesced_notification().render_info().
-              collapsed_info().default_destination().icon().url());
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().default_destination().icon().url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
 GURL SyncedNotification::GetDefaultDestinationUrl() const {
@@ -514,8 +604,10 @@
       default_destination().has_url()) {
     return GURL();
   }
-  return GURL(specifics_.coalesced_notification().render_info().
-              collapsed_info().default_destination().url());
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().default_destination().url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
 std::string SyncedNotification::GetButtonTitle(
@@ -539,8 +631,10 @@
       target(which_button).action().icon().has_url()) {
     return GURL();
   }
-  return GURL(specifics_.coalesced_notification().render_info().
-              collapsed_info().target(which_button).action().icon().url());
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().target(which_button).action().icon().url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
 GURL SyncedNotification::GetButtonUrl(unsigned int which_button) const {
@@ -551,8 +645,10 @@
       target(which_button).action().has_url()) {
     return GURL();
   }
-  return GURL(specifics_.coalesced_notification().render_info().
-              collapsed_info().target(which_button).action().url());
+  std::string url_spec = specifics_.coalesced_notification().render_info().
+              collapsed_info().target(which_button).action().url();
+
+  return AddDefaultSchemaIfNeeded(url_spec);
 }
 
 std::string SyncedNotification::GetContainedNotificationTitle(
@@ -575,4 +671,12 @@
       collapsed_info(index).simple_collapsed_layout().description();
 }
 
+std::string SyncedNotification::GetSendingServiceId() const {
+  // TODO(petewil): We are building a new protocol (a new sync datatype) to send
+  // the service name and icon from the server.  For now this method is
+  // hardcoded to the name of our first service using synced notifications.
+  // Once the new protocol is built, remove this hardcoding.
+  return kFirstSyncedNotificationServiceId;
+}
+
 }  // namespace notifier
diff --git a/chrome/browser/notifications/sync_notifier/synced_notification.h b/chrome/browser/notifications/sync_notifier/synced_notification.h
index fd3ee55..cba6863 100644
--- a/chrome/browser/notifications/sync_notifier/synced_notification.h
+++ b/chrome/browser/notifications/sync_notifier/synced_notification.h
@@ -52,6 +52,7 @@
   std::string GetTitle() const;
   std::string GetHeading() const;
   std::string GetDescription() const;
+  std::string GetAnnotation() const;
   std::string GetAppId() const;
   std::string GetKey() const;
   GURL GetOriginUrl() const;
@@ -67,10 +68,13 @@
   std::string GetButtonTitle(unsigned int which_button) const;
   GURL GetButtonIconUrl(unsigned int which_button) const;
   GURL GetButtonUrl(unsigned int which_button) const;
+  GURL GetProfilePictureUrl(unsigned int which_url) const;
+  size_t GetProfilePictureCount() const;
   size_t GetNotificationCount() const;
   size_t GetButtonCount() const;
   std::string GetContainedNotificationTitle(int index) const;
   std::string GetContainedNotificationMessage(int index) const;
+  std::string GetSendingServiceId() const;
 
 
   bool EqualsIgnoringReadState(const SyncedNotification& other) const;
@@ -112,6 +116,7 @@
   ScopedVector<NotificationBitmapFetcher> fetchers_;
   int active_fetcher_count_;
   gfx::Image app_icon_bitmap_;
+  gfx::Image sender_bitmap_;
   gfx::Image image_bitmap_;
   std::vector<gfx::Image> button_bitmaps_;
 
diff --git a/chrome/browser/page_cycler/page_cycler_unittest.cc b/chrome/browser/page_cycler/page_cycler_unittest.cc
index cbfc07e..2ef95fe 100644
--- a/chrome/browser/page_cycler/page_cycler_unittest.cc
+++ b/chrome/browser/page_cycler/page_cycler_unittest.cc
@@ -5,6 +5,7 @@
 #include "base/file_util.h"
 #include "base/path_service.h"
 #include "base/prefs/testing_pref_service.h"
+#include "base/run_loop.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -150,7 +151,7 @@
 
   void PumpLoop() {
     content::BrowserThread::GetBlockingPool()->FlushForTesting();
-    message_loop()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void CloseBrowser() {
@@ -310,7 +311,7 @@
       DidFinishLoad(kFrameID, kAboutURL, kIsMainFrame, _))
       .WillOnce(Invoke(page_cycler(),
                        &MockPageCycler::PageCyclerDidFinishLoad));
-  message_loop()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   FinishLoad();
 
diff --git a/chrome/browser/password_manager/password_generation_manager_unittest.cc b/chrome/browser/password_manager/password_generation_manager_unittest.cc
index ac691d9..22f2050 100644
--- a/chrome/browser/password_manager/password_generation_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_generation_manager_unittest.cc
@@ -44,7 +44,6 @@
 class PasswordGenerationManagerTest : public ChromeRenderViewHostTestHarness {
  protected:
   virtual void SetUp() OVERRIDE {
-
     SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
     ChromeRenderViewHostTestHarness::SetUp();
 
@@ -56,12 +55,6 @@
     ChromeRenderViewHostTestHarness::TearDown();
   }
 
-  virtual content::BrowserContext* CreateBrowserContext() OVERRIDE {
-    TestingProfile* profile = new TestingProfile();
-    profile->CreateRequestContext();
-    return profile;
-  }
-
   void UpdateState(bool new_renderer) {
     password_generation_manager_->UpdateState(NULL, new_renderer);
   }
@@ -77,7 +70,6 @@
     TestingProfile::Builder builder;
     scoped_ptr<TestingProfile> profile = builder.Build();
     profile->set_incognito(true);
-    profile->CreateRequestContext();
     return profile.release();
   }
 };
diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc
index ed6e8fe..a8d718d 100644
--- a/chrome/browser/password_manager/password_store_x_unittest.cc
+++ b/chrome/browser/password_manager/password_store_x_unittest.cc
@@ -9,11 +9,11 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/platform_file.h"
 #include "base/prefs/pref_service.h"
+#include "base/run_loop.h"
 #include "base/stl_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
-#include "base/synchronization/waitable_event.h"
 #include "base/time/time.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/password_manager/password_form_data.h"
@@ -23,15 +23,15 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_thread.h"
 #include "content/public/browser/notification_details.h"
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/notification_source.h"
 #include "content/public/test/mock_notification_observer.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using base::WaitableEvent;
 using content::BrowserThread;
 using testing::_;
 using testing::DoAll;
@@ -56,44 +56,25 @@
 
 // This class will add and remove a mock notification observer from
 // the DB thread.
-class DBThreadObserverHelper
-    : public base::RefCountedThreadSafe<DBThreadObserverHelper,
-                                        BrowserThread::DeleteOnDBThread> {
+class DBThreadObserverHelper {
  public:
-  DBThreadObserverHelper() : done_event_(true, false) {}
+  DBThreadObserverHelper() {}
+
+  ~DBThreadObserverHelper() {
+    registrar_.RemoveAll();
+  }
 
   void Init(PasswordStore* password_store) {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-    BrowserThread::PostTask(
-        BrowserThread::DB,
-        FROM_HERE,
-        base::Bind(&DBThreadObserverHelper::AddObserverTask,
-                   this, make_scoped_refptr(password_store)));
-    done_event_.Wait();
+    registrar_.Add(&observer_,
+                   chrome::NOTIFICATION_LOGINS_CHANGED,
+                   content::Source<PasswordStore>(password_store));
   }
 
   content::MockNotificationObserver& observer() {
     return observer_;
   }
 
- protected:
-  friend struct BrowserThread::DeleteOnThread<BrowserThread::DB>;
-  friend class base::DeleteHelper<DBThreadObserverHelper>;
-
-  virtual ~DBThreadObserverHelper() {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
-    registrar_.RemoveAll();
-  }
-
-  void AddObserverTask(PasswordStore* password_store) {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
-    registrar_.Add(&observer_,
-                   chrome::NOTIFICATION_LOGINS_CHANGED,
-                   content::Source<PasswordStore>(password_store));
-    done_event_.Signal();
-  }
-
-  WaitableEvent done_event_;
+ private:
   content::NotificationRegistrar registrar_;
   content::MockNotificationObserver observer_;
 };
@@ -269,13 +250,7 @@
 
 class PasswordStoreXTest : public testing::TestWithParam<BackendType> {
  protected:
-  PasswordStoreXTest()
-      : ui_thread_(BrowserThread::UI, &message_loop_),
-        db_thread_(BrowserThread::DB) {
-  }
-
   virtual void SetUp() {
-    ASSERT_TRUE(db_thread_.Start());
     ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
 
     profile_.reset(new TestingProfile());
@@ -285,10 +260,7 @@
   }
 
   virtual void TearDown() {
-    base::MessageLoop::current()->PostTask(FROM_HERE,
-                                           base::MessageLoop::QuitClosure());
-    base::MessageLoop::current()->Run();
-    db_thread_.Stop();
+    base::RunLoop().RunUntilIdle();
   }
 
   PasswordStoreX::NativeBackend* GetBackend() {
@@ -302,10 +274,7 @@
     }
   }
 
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  // PasswordStore, WDS schedule work on this thread.
-  content::TestBrowserThread db_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   scoped_ptr<LoginDatabase> login_db_;
   scoped_ptr<TestingProfile> profile_;
@@ -316,11 +285,6 @@
   STLDeleteContainerPointers(arg0.begin(), arg0.end());
 }
 
-ACTION(QuitUIMessageLoop) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  base::MessageLoop::current()->Quit();
-}
-
 TEST_P(PasswordStoreXTest, Notifications) {
   scoped_refptr<PasswordStoreX> store(
       new PasswordStoreX(login_db_.release(),
@@ -341,15 +305,15 @@
     true, false, 1 };
   scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data));
 
-  scoped_refptr<DBThreadObserverHelper> helper = new DBThreadObserverHelper;
-  helper->Init(store.get());
+  DBThreadObserverHelper helper;
+  helper.Init(store.get());
 
   const PasswordStoreChange expected_add_changes[] = {
     PasswordStoreChange(PasswordStoreChange::ADD, *form),
   };
 
   EXPECT_CALL(
-      helper->observer(),
+      helper.observer(),
       Observe(int(chrome::NOTIFICATION_LOGINS_CHANGED),
               content::Source<PasswordStore>(store.get()),
               Property(&content::Details<const PasswordStoreChangeList>::ptr,
@@ -358,12 +322,9 @@
   // Adding a login should trigger a notification.
   store->AddLogin(*form);
 
-  // The PasswordStore schedules tasks to run on the DB thread so we schedule
-  // yet another task to notify us that it's safe to carry on with the test.
-  WaitableEvent done(false, false);
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  // The PasswordStore schedules tasks to run on the DB thread. Wait for them
+  // to complete.
+  base::RunLoop().RunUntilIdle();
 
   // Change the password.
   form->password_value = WideToUTF16(L"a different password");
@@ -373,7 +334,7 @@
   };
 
   EXPECT_CALL(
-      helper->observer(),
+      helper.observer(),
       Observe(int(chrome::NOTIFICATION_LOGINS_CHANGED),
               content::Source<PasswordStore>(store.get()),
               Property(&content::Details<const PasswordStoreChangeList>::ptr,
@@ -382,17 +343,15 @@
   // Updating the login with the new password should trigger a notification.
   store->UpdateLogin(*form);
 
-  // Wait for PasswordStore to send the notification.
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  // Wait for PasswordStore to send execute.
+  base::RunLoop().RunUntilIdle();
 
   const PasswordStoreChange expected_delete_changes[] = {
     PasswordStoreChange(PasswordStoreChange::REMOVE, *form),
   };
 
   EXPECT_CALL(
-      helper->observer(),
+      helper.observer(),
       Observe(int(chrome::NOTIFICATION_LOGINS_CHANGED),
               content::Source<PasswordStore>(store.get()),
               Property(&content::Details<const PasswordStoreChangeList>::ptr,
@@ -401,10 +360,8 @@
   // Deleting the login should trigger a notification.
   store->RemoveLogin(*form);
 
-  // Wait for PasswordStore to send the notification.
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  // Wait for PasswordStore to execute.
+  base::RunLoop().RunUntilIdle();
 
   // Public in PasswordStore, protected in PasswordStoreX.
   static_cast<PasswordStore*>(store.get())->ShutdownOnUIThread();
@@ -428,26 +385,13 @@
   // Populate the login DB with logins that should be migrated.
   for (VectorOfForms::iterator it = expected_autofillable.begin();
        it != expected_autofillable.end(); ++it) {
-    BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-                            base::Bind(
-                                base::IgnoreResult(&LoginDatabase::AddLogin),
-                                base::Unretained(login_db), **it));
+    login_db->AddLogin(**it);
   }
   for (VectorOfForms::iterator it = expected_blacklisted.begin();
        it != expected_blacklisted.end(); ++it) {
-    BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-                            base::Bind(
-                                base::IgnoreResult(&LoginDatabase::AddLogin),
-                                base::Unretained(login_db), **it));
+    login_db->AddLogin(**it);
   }
 
-  // Schedule another task on the DB thread to notify us that it's safe to
-  // carry on with the test.
-  WaitableEvent done(false, false);
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
-
   // Get the new size of the login DB file. We expect it to be larger.
   base::PlatformFileInfo db_file_full_info;
   ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_full_info));
@@ -462,27 +406,23 @@
 
   MockPasswordStoreConsumer consumer;
 
-  // Make sure we quit the MessageLoop even if the test fails.
-  ON_CALL(consumer, OnPasswordStoreRequestDone(_, _))
-      .WillByDefault(QuitUIMessageLoop());
-
   // The autofillable forms should have been migrated to the native backend.
   EXPECT_CALL(consumer,
       OnPasswordStoreRequestDone(_,
           ContainsAllPasswordForms(expected_autofillable)))
-      .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop()));
+      .WillOnce(WithArg<1>(STLDeleteElements0()));
 
   store->GetAutofillableLogins(&consumer);
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   // The blacklisted forms should have been migrated to the native backend.
   EXPECT_CALL(consumer,
       OnPasswordStoreRequestDone(_,
           ContainsAllPasswordForms(expected_blacklisted)))
-      .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop()));
+      .WillOnce(WithArg<1>(STLDeleteElements0()));
 
   store->GetBlacklistLogins(&consumer);
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
 
   VectorOfForms empty;
   MockLoginDatabaseReturn ld_return;
@@ -499,14 +439,10 @@
         .WillOnce(WithArg<0>(STLDeleteElements0()));
   }
 
-  BrowserThread::PostTask(
-      BrowserThread::DB, FROM_HERE,
-      base::Bind(&LoginDatabaseQueryCallback, login_db, true, &ld_return));
+  LoginDatabaseQueryCallback(login_db, true, &ld_return);
 
-  // Wait for the login DB methods to execute on the DB thread.
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  // Wait for the login DB methods to execute.
+  base::RunLoop().RunUntilIdle();
 
   if (GetParam() == WORKING_BACKEND) {
     // Likewise, no blacklisted logins should be left in the login DB.
@@ -520,14 +456,10 @@
         .WillOnce(WithArg<0>(STLDeleteElements0()));
   }
 
-  BrowserThread::PostTask(
-      BrowserThread::DB, FROM_HERE,
-      base::Bind(&LoginDatabaseQueryCallback, login_db, false, &ld_return));
+  LoginDatabaseQueryCallback(login_db, false, &ld_return);
 
-  // Wait for the login DB methods to execute on the DB thread.
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  // Wait for the login DB methods to execute.
+  base::RunLoop().RunUntilIdle();
 
   if (GetParam() == WORKING_BACKEND) {
     // If the migration succeeded, then not only should there be no logins left
diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc
index 2a1d1cf..fa84816 100644
--- a/chrome/browser/policy/browser_policy_connector.cc
+++ b/chrome/browser/policy/browser_policy_connector.cc
@@ -60,7 +60,6 @@
 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
 #include "chrome/browser/chromeos/policy/network_configuration_updater.h"
 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h"
-#include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.h"
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #include "chrome/browser/chromeos/settings/cros_settings_provider.h"
 #include "chrome/browser/chromeos/settings/device_settings_service.h"
@@ -208,19 +207,10 @@
   policy_statistics_collector_->Initialize();
 
 #if defined(OS_CHROMEOS)
-  if (command_line->HasSwitch(
-          chromeos::switches::kUseNewNetworkConfigurationHandlers)) {
-    network_configuration_updater_.reset(
-        new NetworkConfigurationUpdaterImpl(
-            GetPolicyService(),
-            make_scoped_ptr(new chromeos::CertificateHandler)));
-  } else {
-    network_configuration_updater_.reset(
-        new NetworkConfigurationUpdaterImplCros(
-            GetPolicyService(),
-            chromeos::NetworkLibrary::Get(),
-            make_scoped_ptr(new chromeos::CertificateHandler)));
-  }
+  network_configuration_updater_.reset(
+      new NetworkConfigurationUpdaterImpl(
+          GetPolicyService(),
+          make_scoped_ptr(new chromeos::CertificateHandler)));
 #endif
 
   is_initialized_ = true;
diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/chrome/browser/policy/cloud/device_management_service_unittest.cc
index e1b1f2f..2838bfc 100644
--- a/chrome/browser/policy/cloud/device_management_service_unittest.cc
+++ b/chrome/browser/policy/cloud/device_management_service_unittest.cc
@@ -6,12 +6,12 @@
 #include <vector>
 
 #include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/strings/string_split.h"
 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
 #include "chrome/browser/policy/cloud/device_management_service.h"
 #include "chrome/test/base/testing_browser_process.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/escape.h"
 #include "net/base/load_flags.h"
 #include "net/base/net_errors.h"
@@ -22,7 +22,6 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
 using testing::Mock;
 using testing::_;
 
@@ -49,16 +48,14 @@
 // without calling into the actual network stack.
 class DeviceManagementServiceTestBase : public testing::Test {
  protected:
-  DeviceManagementServiceTestBase()
-      : ui_thread_(BrowserThread::UI, &loop_),
-        io_thread_(BrowserThread::IO, &loop_) {
+  DeviceManagementServiceTestBase() {
     ResetService();
     InitializeService();
   }
 
-  virtual void TearDown() {
+  ~DeviceManagementServiceTestBase() {
     service_.reset();
-    loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void ResetService() {
@@ -67,7 +64,7 @@
 
   void InitializeService() {
     service_->ScheduleInitialization(0);
-    loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   net::TestURLFetcher* GetFetcher() {
@@ -166,9 +163,7 @@
   scoped_ptr<DeviceManagementService> service_;
 
  private:
-  base::MessageLoopForUI loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 };
 
 struct FailedRequestParams {
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
index 82539a3..70b0c46 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc
@@ -28,7 +28,7 @@
 #include "content/public/browser/notification_details.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "net/http/http_status_code.h"
@@ -140,10 +140,7 @@
 class UserPolicySigninServiceTest : public testing::Test {
  public:
   UserPolicySigninServiceTest()
-      : loop_(base::MessageLoop::TYPE_IO),
-        ui_thread_(content::BrowserThread::UI, &loop_),
-        file_thread_(content::BrowserThread::FILE, &loop_),
-        io_thread_(content::BrowserThread::IO, &loop_),
+      : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
         register_completed_(false) {}
 
   MOCK_METHOD1(OnPolicyRefresh, void(bool));
@@ -186,7 +183,6 @@
     TestingProfile::Builder builder;
     builder.SetPrefService(scoped_ptr<PrefServiceSyncable>(prefs.Pass()));
     profile_ = builder.Build().Pass();
-    profile_->CreateRequestContext();
 
     mock_store_ = new MockUserCloudPolicyStore();
     EXPECT_CALL(*mock_store_, Load()).Times(AnyNumber());
@@ -340,10 +336,7 @@
 
   // BrowserPolicyConnector and UrlFetcherFactory want to initialize and free
   // various components asynchronously via tasks, so create fake threads here.
-  base::MessageLoop loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   net::TestURLFetcherFactory url_factory_;
 
diff --git a/chrome/browser/policy/policy_service_impl_unittest.cc b/chrome/browser/policy/policy_service_impl_unittest.cc
index f185abc..508ae44 100644
--- a/chrome/browser/policy/policy_service_impl_unittest.cc
+++ b/chrome/browser/policy/policy_service_impl_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/callback.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/values.h"
 #include "chrome/browser/policy/external_data_fetcher.h"
@@ -18,7 +17,7 @@
 #include "chrome/browser/policy/policy_domain_descriptor.h"
 #include "chrome/common/policy/policy_schema.h"
 #include "content/public/browser/browser_thread.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -155,7 +154,7 @@
   PolicyMap policy1_;
   PolicyMap policy2_;
   scoped_ptr<PolicyServiceImpl> policy_service_;
-  base::MessageLoop loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(PolicyServiceTest);
@@ -436,10 +435,6 @@
 }
 
 TEST_F(PolicyServiceTest, RefreshPolicies) {
-  content::TestBrowserThread ui_thread(content::BrowserThread::UI, &loop_);
-  content::TestBrowserThread file_thread(content::BrowserThread::FILE, &loop_);
-  content::TestBrowserThread io_thread(content::BrowserThread::IO, &loop_);
-
   EXPECT_CALL(provider0_, RefreshPolicies()).Times(AnyNumber());
   EXPECT_CALL(provider1_, RefreshPolicies()).Times(AnyNumber());
   EXPECT_CALL(provider2_, RefreshPolicies()).Times(AnyNumber());
diff --git a/chrome/browser/policy/policy_statistics_collector_unittest.cc b/chrome/browser/policy/policy_statistics_collector_unittest.cc
index aafea13..caee502 100644
--- a/chrome/browser/policy/policy_statistics_collector_unittest.cc
+++ b/chrome/browser/policy/policy_statistics_collector_unittest.cc
@@ -34,7 +34,7 @@
 using testing::ReturnRef;
 
 // Arbitrary policy names used for testing.
-const char* const kTestPolicy1 = key::kHomepageIsNewTabPage;
+const char* const kTestPolicy1 = key::kAlternateErrorPagesEnabled;
 const char* const kTestPolicy2 = key::kSearchSuggestEnabled;
 
 class TestPolicyStatisticsCollector : public PolicyStatisticsCollector {
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 14cc6a7..5e90827 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -145,6 +145,7 @@
 #include "chrome/browser/chromeos/status/data_promo_notification.h"
 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
 #include "chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h"
+#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
 #else
 #include "chrome/browser/extensions/default_apps.h"
 #endif
@@ -262,6 +263,7 @@
   chromeos::proxy_config::RegisterPrefs(registry);
   chromeos::RegisterDisplayLocalStatePrefs(registry);
   chromeos::ServicesCustomizationDocument::RegisterPrefs(registry);
+  chromeos::SigninScreenHandler::RegisterPrefs(registry);
   chromeos::system::AutomaticRebootManager::RegisterPrefs(registry);
   chromeos::UserImageManager::RegisterPrefs(registry);
   chromeos::UserManager::RegisterPrefs(registry);
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 957809f..12ba041 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -95,8 +95,11 @@
       WindowContainerType window_container_type,
       const string16& frame_name,
       const GURL& target_url,
+      const content::Referrer& referrer,
       WindowOpenDisposition disposition,
-      bool user_gesture) OVERRIDE {
+      const WebKit::WebWindowFeatures& features,
+      bool user_gesture,
+      bool opener_suppressed) OVERRIDE {
     // Since we don't want to permit child windows that would have a
     // window.opener property, terminate prerendering.
     prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW);
diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
index 79e0280..7064156 100644
--- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
+++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc
@@ -11,9 +11,12 @@
 #include "base/message_loop/message_loop.h"
 #include "base/process_util.h"
 #include "base/rand_util.h"
+#include "base/synchronization/waitable_event.h"
 #include "base/test/multiprocess_test.h"
 #include "base/test/test_timeouts.h"
+#include "base/time/default_tick_clock.h"
 #include "base/time/time.h"
+#include "chrome/browser/prefs/browser_prefs.h"
 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
 #include "chrome/browser/service/service_process_control.h"
@@ -26,13 +29,14 @@
 #include "chrome/service/service_process.h"
 #include "chrome/test/base/test_launcher_utils.h"
 #include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_io_thread_state.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chrome/test/base/testing_profile_manager.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "ipc/ipc_descriptors.h"
 #include "ipc/ipc_multiprocess_test.h"
 #include "ipc/ipc_switches.h"
@@ -57,6 +61,7 @@
 using ::testing::Return;
 using ::testing::WithoutArgs;
 using ::testing::_;
+using content::BrowserThread;
 
 namespace {
 
@@ -205,17 +210,23 @@
 int CloudPrintMockService_Main(SetExpectationsCallback set_expectations) {
   base::MessageLoopForUI main_message_loop;
   main_message_loop.set_thread_name("Main Thread");
+  CommandLine* command_line = CommandLine::ForCurrentProcess();
 
 #if defined(OS_MACOSX)
-  CommandLine* cl = CommandLine::ForCurrentProcess();
-  if (!cl->HasSwitch(kTestExecutablePath))
+  if (!command_line->HasSwitch(kTestExecutablePath))
     return kMissingSwitch;
-  base::FilePath executable_path = cl->GetSwitchValuePath(kTestExecutablePath);
+  base::FilePath executable_path =
+      command_line->GetSwitchValuePath(kTestExecutablePath);
   EXPECT_FALSE(executable_path.empty());
   MockLaunchd mock_launchd(executable_path, &main_message_loop, true, true);
   Launchd::ScopedInstance use_mock(&mock_launchd);
 #endif
 
+  base::FilePath user_data_dir =
+      command_line->GetSwitchValuePath(switches::kUserDataDir);
+  CHECK(!user_data_dir.empty());
+  CHECK(test_launcher_utils::OverrideUserDataDir(user_data_dir));
+
   ServiceProcessState* state(new ServiceProcessState);
   bool service_process_state_initialized = state->Initialize();
   EXPECT_TRUE(service_process_state_initialized);
@@ -289,8 +300,8 @@
   virtual ~CloudPrintProxyPolicyStartupTest();
 
   virtual void SetUp();
-  base::MessageLoopProxy* IOMessageLoopProxy() {
-    return io_thread_.message_loop_proxy().get();
+  scoped_refptr<base::MessageLoopProxy> IOMessageLoopProxy() {
+    return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
   }
   base::ProcessHandle Launch(const std::string& name);
   void WaitForConnect();
@@ -316,9 +327,8 @@
   }
 
  protected:
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  base::Thread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
+  base::ScopedTempDir temp_user_data_dir_;
 
   std::string startup_channel_id_;
   scoped_ptr<IPC::ChannelProxy> startup_channel_;
@@ -359,28 +369,43 @@
 };
 
 CloudPrintProxyPolicyStartupTest::CloudPrintProxyPolicyStartupTest()
-    : ui_thread_(content::BrowserThread::UI, &message_loop_),
-      io_thread_("CloudPrintProxyPolicyTestThread") {
+    : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) {
 }
 
 CloudPrintProxyPolicyStartupTest::~CloudPrintProxyPolicyStartupTest() {
 }
 
 void CloudPrintProxyPolicyStartupTest::SetUp() {
-  base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
-  ASSERT_TRUE(io_thread_.StartWithOptions(options));
-
 #if defined(OS_MACOSX)
   EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
   EXPECT_TRUE(MockLaunchd::MakeABundle(temp_dir_.path(),
                                        "CloudPrintProxyTest",
                                        &bundle_path_,
                                        &executable_path_));
-  mock_launchd_.reset(new MockLaunchd(executable_path_, &message_loop_,
+  mock_launchd_.reset(new MockLaunchd(executable_path_,
+                                      base::MessageLoopForUI::current(),
                                       true, false));
   scoped_launchd_instance_.reset(
       new Launchd::ScopedInstance(mock_launchd_.get()));
 #endif
+
+  // Ensure test does not use the standard profile directory. This is copied
+  // from InProcessBrowserTest::SetUp(). These tests require a more complex
+  // process startup so they are unable to just inherit from
+  // InProcessBrowserTest.
+  CommandLine* command_line = CommandLine::ForCurrentProcess();
+  base::FilePath user_data_dir =
+      command_line->GetSwitchValuePath(switches::kUserDataDir);
+  if (user_data_dir.empty()) {
+    ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir() &&
+                temp_user_data_dir_.IsValid())
+        << "Could not create temporary user data directory \""
+        << temp_user_data_dir_.path().value() << "\".";
+
+    user_data_dir = temp_user_data_dir_.path();
+    command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
+  }
+  ASSERT_TRUE(test_launcher_utils::OverrideUserDataDir(user_data_dir));
 }
 
 base::ProcessHandle CloudPrintProxyPolicyStartupTest::Launch(
@@ -452,10 +477,21 @@
 }
 
 TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) {
+  TestingBrowserProcess* browser_process =
+      TestingBrowserProcess::GetGlobal();
+  TestingProfileManager profile_manager(browser_process);
+  ASSERT_TRUE(profile_manager.SetUp());
+
+  // Must be created after the TestingProfileManager since that creates the
+  // LocalState for the BrowserProcess.  Must be created before profiles are
+  // constructed.
+  chrome::TestingIOThreadState testing_io_thread_state;
+
   base::ProcessHandle handle =
       Launch("CloudPrintMockService_StartEnabledWaitForQuit");
   WaitForConnect();
   ShutdownAndWaitForExitWithTimeout(handle);
+  content::RunAllPendingInMessageLoop();
 }
 
 BrowserContextKeyedService* CloudPrintProxyServiceFactoryForPolicyTest(
@@ -470,11 +506,18 @@
   base::ProcessHandle handle =
       Launch("CloudPrintMockService_StartEnabledWaitForQuit");
 
+  // Setup the Browser Process with a full IOThread::Globals.
   TestingBrowserProcess* browser_process =
       TestingBrowserProcess::GetGlobal();
+
   TestingProfileManager profile_manager(browser_process);
   ASSERT_TRUE(profile_manager.SetUp());
 
+  // Must be created after the TestingProfileManager since that creates the
+  // LocalState for the BrowserProcess.  Must be created before profiles are
+  // constructed.
+  chrome::TestingIOThreadState testing_io_thread_state;
+
   TestingProfile* profile =
       profile_manager.CreateTestingProfile("StartBrowserWithoutPolicy");
   CloudPrintProxyServiceFactory::GetInstance()->
@@ -490,20 +533,22 @@
   test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line);
 
   WaitForConnect();
+  base::RunLoop run_loop;
   base::MessageLoop::current()->PostDelayedTask(
       FROM_HERE,
-      base::MessageLoop::QuitClosure(),
+      run_loop.QuitClosure(),
       TestTimeouts::action_timeout());
 
-  bool run_loop = LaunchBrowser(command_line, profile);
-  EXPECT_FALSE(run_loop);
-  if (run_loop)
-    base::MessageLoop::current()->Run();
+  bool should_run_loop = LaunchBrowser(command_line, profile);
+  EXPECT_FALSE(should_run_loop);
+  if (should_run_loop)
+    run_loop.Run();
 
   EXPECT_EQ(MockServiceIPCServer::EnabledUserId(),
             prefs->GetString(prefs::kCloudPrintEmail));
 
   ShutdownAndWaitForExitWithTimeout(handle);
+  content::RunAllPendingInMessageLoop();
   profile_manager.DeleteTestingProfile("StartBrowserWithoutPolicy");
 }
 
@@ -516,6 +561,11 @@
   TestingProfileManager profile_manager(browser_process);
   ASSERT_TRUE(profile_manager.SetUp());
 
+  // Must be created after the TestingProfileManager since that creates the
+  // LocalState for the BrowserProcess.  Must be created before profiles are
+  // constructed.
+  chrome::TestingIOThreadState testing_io_thread_state;
+
   TestingProfile* profile =
       profile_manager.CreateTestingProfile("StartBrowserWithPolicy");
   CloudPrintProxyServiceFactory::GetInstance()->
@@ -533,20 +583,22 @@
   test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line);
 
   WaitForConnect();
+  base::RunLoop run_loop;
   base::MessageLoop::current()->PostDelayedTask(
       FROM_HERE,
-      base::MessageLoop::QuitClosure(),
+      run_loop.QuitClosure(),
       TestTimeouts::action_timeout());
 
-  bool run_loop = LaunchBrowser(command_line, profile);
+  bool should_run_loop = LaunchBrowser(command_line, profile);
 
   // No expectations on run_loop being true here; that would be a race
   // condition.
-  if (run_loop)
-    base::MessageLoop::current()->Run();
+  if (should_run_loop)
+    run_loop.Run();
 
   EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail));
 
   ShutdownAndWaitForExitWithTimeout(handle);
+  content::RunAllPendingInMessageLoop();
   profile_manager.DeleteTestingProfile("StartBrowserWithPolicy");
 }
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 0ffcaf2..a3298f5 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -40,13 +40,12 @@
                           JobEventDetails::Type detail_type,
                           PrintedDocument* document,
                           PrintedPage* page) {
-  scoped_refptr<JobEventDetails> details(new JobEventDetails(detail_type,
-                                                             document, page));
+  JobEventDetails* details = new JobEventDetails(detail_type, document, page);
   content::NotificationService::current()->Notify(
       chrome::NOTIFICATION_PRINT_JOB_EVENT,
       // We know that is is a PrintJob object in this circumstance.
       content::Source<PrintJob>(static_cast<PrintJob*>(print_job)),
-      content::Details<JobEventDetails>(details.get()));
+      content::Details<JobEventDetails>(details));
 }
 
 PrintJobWorker::PrintJobWorker(PrintJobWorkerOwner* owner)
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index 3228c41..a14d3ab 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -286,7 +286,7 @@
       int render_view_id,
       const GURL& requesting_frame,
       const MIDISysExPermissionCallback& callback) {
-  // TODO(toyoshim): Implement.
+  // TODO(toyoshim): Implement. http://crbug.com/257618 .
   callback.Run(false);
 }
 
diff --git a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
index 0b9a9b9..630fc6e 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
@@ -6,16 +6,19 @@
 
 #include "base/prefs/pref_registry_simple.h"
 #include "base/prefs/pref_service.h"
+#include "base/run_loop.h"
 #include "chrome/browser/net/ssl_config_service_manager.h"
 #include "chrome/browser/prefs/browser_prefs.h"
 #include "chrome/browser/prefs/scoped_user_pref_update.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/browser_with_test_window_test.h"
 #include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_io_thread_state.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
 #include "content/public/browser/host_zoom_map.h"
+#include "net/dns/mock_host_resolver.h"
 
 using content::HostZoomMap;
 
@@ -68,7 +71,7 @@
   scoped_ptr<Profile> off_the_record_profile_;
   scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_;
 
-  content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_;
+  HostZoomMap::ZoomLevelChangedCallback zoom_callback_;
 
   DISALLOW_COPY_AND_ASSIGN(TestingProfileWithHostZoomMap);
 };
@@ -85,19 +88,21 @@
   virtual ~OffTheRecordProfileImplTest() {}
 
   virtual void SetUp() OVERRIDE {
-    prefs_.reset(new TestingPrefServiceSimple);
+    prefs_.reset(new TestingPrefServiceSimple());
     chrome::RegisterLocalState(prefs_->registry());
 
     browser_process()->SetLocalState(prefs_.get());
-
+    testing_io_thread_state_.reset(new chrome::TestingIOThreadState());
+    testing_io_thread_state_->io_thread_state()->globals()->host_resolver.reset(
+        new net::MockHostResolver());
     BrowserWithTestWindowTest::SetUp();
   }
 
   virtual void TearDown() OVERRIDE {
     BrowserWithTestWindowTest::TearDown();
+    testing_io_thread_state_.reset();
     browser_process()->SetLocalState(NULL);
     DestroyBrowserAndProfile();
-    prefs_.reset();
   }
 
  private:
@@ -106,6 +111,7 @@
   }
 
   scoped_ptr<TestingPrefServiceSimple> prefs_;
+  scoped_ptr<chrome::TestingIOThreadState> testing_io_thread_state_;
 
   DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImplTest);
 };
@@ -178,4 +184,5 @@
   EXPECT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host),
             child_zoom_map->GetZoomLevelForHostAndScheme("http", host)) <<
                 "Parent change should propagate to child.";
+  base::RunLoop().RunUntilIdle();
 }
diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc
index 6d128a7..0386d22 100644
--- a/chrome/browser/profiles/profile_browsertest.cc
+++ b/chrome/browser/profiles/profile_browsertest.cc
@@ -186,6 +186,7 @@
   // for README creation).
   profile.reset();
   content::RunAllPendingInMessageLoop();
+  content::RunAllPendingInMessageLoop(content::BrowserThread::DB);
   content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
 }
 
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 57ffb8f..731f032 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -867,7 +867,7 @@
       int render_view_id,
       const GURL& requesting_frame,
       const MIDISysExPermissionCallback& callback) {
-  // TODO(toyoshim): Implement.
+  // TODO(toyoshim): Implement. http://crbug.com/257618 .
   callback.Run(false);
 }
 
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc
index 57ad936..ca66dba 100644
--- a/chrome/browser/profiles/profile_manager_unittest.cc
+++ b/chrome/browser/profiles/profile_manager_unittest.cc
@@ -7,8 +7,8 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
+#include "base/run_loop.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "build/build_config.h"
@@ -34,7 +34,7 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -95,10 +95,7 @@
   };
 
   ProfileManagerTest()
-      : local_state_(TestingBrowserProcess::GetGlobal()),
-        ui_thread_(BrowserThread::UI, &message_loop_),
-        db_thread_(BrowserThread::DB, &message_loop_),
-        file_thread_(BrowserThread::FILE, &message_loop_) {
+      : local_state_(TestingBrowserProcess::GetGlobal()) {
   }
 
   virtual void SetUp() {
@@ -115,7 +112,7 @@
 
   virtual void TearDown() {
     TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
-    message_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   // Helper function to create a profile with |name| for a profile |manager|.
@@ -139,10 +136,8 @@
   // The path to temporary directory used to contain the test operations.
   base::ScopedTempDir temp_dir_;
   ScopedTestingLocalState local_state_;
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  content::TestBrowserThread file_thread_;
+
+  content::TestBrowserThreadBundle thread_bundle_;
 
 #if defined(OS_CHROMEOS)
   chromeos::ScopedTestUserManager test_user_manager_;
@@ -232,12 +227,12 @@
                                                    Profile::EXPLICIT_ACCESS));
 
   // Make sure any pending tasks run before we destroy the profiles.
-  message_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
   TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
 
   // Make sure history cleans up correctly.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 MATCHER(NotFail, "Profile creation failure status is not reported.") {
@@ -255,7 +250,7 @@
   CreateProfileAsync(g_browser_process->profile_manager(),
                      "New Profile", &mock_observer);
 
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 MATCHER(SameNotNull, "The same non-NULL value for all calls.") {
@@ -283,7 +278,7 @@
   CreateProfileAsync(profile_manager, profile_name, &mock_observer2);
   CreateProfileAsync(profile_manager, profile_name, &mock_observer3);
 
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(ProfileManagerTest, CreateProfilesAsync) {
@@ -299,7 +294,7 @@
   CreateProfileAsync(profile_manager, profile_name1, &mock_observer);
   CreateProfileAsync(profile_manager, profile_name2, &mock_observer);
 
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(ProfileManagerTest, GetGuestProfilePath) {
@@ -645,7 +640,7 @@
 
   CreateProfileAsync(profile_manager, profile_name1, &mock_observer);
   CreateProfileAsync(profile_manager, profile_name2, &mock_observer);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(2u, profile_manager->GetLoadedProfiles().size());
   EXPECT_EQ(2u, profile_manager->GetProfileInfoCache().GetNumberOfProfiles());
@@ -658,7 +653,7 @@
   profile_manager->ScheduleProfileForDeletion(dest_path1,
                                               ProfileManager::CreateCallback());
   // Spin the message loop so that all the callbacks can finish running.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(dest_path2, profile_manager->GetLastUsedProfile()->GetPath());
   EXPECT_EQ(profile_name2, local_state->GetString(prefs::kProfileLastUsed));
@@ -684,13 +679,13 @@
   EXPECT_CALL(mock_observer, OnProfileCreated(
       testing::NotNull(), NotFail())).Times(testing::AtLeast(2));
   CreateProfileAsync(profile_manager, profile_name1, &mock_observer);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Track the profile, but don't load it.
   ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
   cache.AddProfileToCache(dest_path2, ASCIIToUTF16(profile_name2),
                           string16(), 0, false);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(1u, profile_manager->GetLoadedProfiles().size());
   EXPECT_EQ(2u, cache.GetNumberOfProfiles());
@@ -706,7 +701,7 @@
                                               ProfileManager::CreateCallback());
 
   // Spin the message loop so that all the callbacks can finish running.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(dest_path2, profile_manager->GetLastUsedProfile()->GetPath());
   EXPECT_EQ(profile_name2, local_state->GetString(prefs::kProfileLastUsed));
@@ -735,7 +730,7 @@
   EXPECT_CALL(mock_observer, OnProfileCreated(
       testing::NotNull(), NotFail())).Times(testing::AtLeast(2));
   CreateProfileAsync(profile_manager, profile_name1, &mock_observer);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Create the other profiles, but don't load them. Assign a fake avatar icon
   // to ensure that profiles in the info cache are sorted by the profile name,
@@ -746,7 +741,7 @@
   cache.AddProfileToCache(dest_path3, ASCIIToUTF16(profile_name3),
                           ASCIIToUTF16(profile_name3), 2, false);
 
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(1u, profile_manager->GetLoadedProfiles().size());
   EXPECT_EQ(3u, cache.GetNumberOfProfiles());
@@ -770,7 +765,7 @@
   profile_manager->ScheduleProfileForDeletion(dest_path2,
                                               ProfileManager::CreateCallback());
   // Spin the message loop so that all the callbacks can finish running.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath());
   EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed));
diff --git a/chrome/browser/resources/chromeos/echo/manifest.json b/chrome/browser/resources/chromeos/echo/manifest.json
index 1cd7fbc..1f69e5a 100644
--- a/chrome/browser/resources/chromeos/echo/manifest.json
+++ b/chrome/browser/resources/chromeos/echo/manifest.json
@@ -20,7 +20,8 @@
   "default_locale": "en",
   "web_accessible_resources": [
     "broker.html",
-    "broker.js"
+    "broker.js",
+    "error.html"
   ],
   "background": {
     "scripts": ["main.js"],
diff --git a/chrome/browser/resources/downloads/downloads.css b/chrome/browser/resources/downloads/downloads.css
index 5cc5578..b032792 100644
--- a/chrome/browser/resources/downloads/downloads.css
+++ b/chrome/browser/resources/downloads/downloads.css
@@ -60,6 +60,10 @@
   -webkit-margin-start: 0;
 }
 
+#open-downloads-folder {
+  -webkit-margin-end: 16px;
+}
+
 #downloads-display {
   max-width: 740px;
 }
diff --git a/chrome/browser/resources/downloads/downloads.js b/chrome/browser/resources/downloads/downloads.js
index 6d5f311..dd9b457 100644
--- a/chrome/browser/resources/downloads/downloads.js
+++ b/chrome/browser/resources/downloads/downloads.js
@@ -386,7 +386,8 @@
   DANGEROUS_URL: 'DANGEROUS_URL',
   DANGEROUS_CONTENT: 'DANGEROUS_CONTENT',
   UNCOMMON_CONTENT: 'UNCOMMON_CONTENT',
-  DANGEROUS_HOST: 'DANGEROUS_HOST'
+  DANGEROUS_HOST: 'DANGEROUS_HOST',
+  POTENTIALLY_UNWANTED: 'POTENTIALLY_UNWANTED',
 };
 
 /**
@@ -442,6 +443,9 @@
     } else if (this.dangerType_ == Download.DangerType.UNCOMMON_CONTENT) {
       this.dangerDesc_.textContent = loadTimeData.getStringF(
           'danger_uncommon_desc', this.fileName_);
+    } else if (this.dangerType_ == Download.DangerType.POTENTIALLY_UNWANTED) {
+      this.dangerDesc_.textContent = loadTimeData.getStringF(
+          'danger_potentially_unwanted_desc', this.fileName_);
     }
     this.danger_.style.display = 'block';
     this.safe_.style.display = 'none';
diff --git a/chrome/browser/resources/extensions/extension_focus_manager.js b/chrome/browser/resources/extensions/extension_focus_manager.js
index e578eba..b220024 100644
--- a/chrome/browser/resources/extensions/extension_focus_manager.js
+++ b/chrome/browser/resources/extensions/extension_focus_manager.js
@@ -6,6 +6,7 @@
   var FocusManager = cr.ui.FocusManager;
 
   function ExtensionFocusManager() {
+    FocusManager.disableMouseFocusOnButtons();
   }
 
   cr.addSingletonGetter(ExtensionFocusManager);
diff --git a/chrome/browser/resources/file_manager/js/butter_bar.js b/chrome/browser/resources/file_manager/js/butter_bar.js
index 69d8187..a280aee 100644
--- a/chrome/browser/resources/file_manager/js/butter_bar.js
+++ b/chrome/browser/resources/file_manager/js/butter_bar.js
@@ -237,10 +237,13 @@
 
 /**
  * Set up butter bar for showing copy progress.
+ *
+ * @param {Object} progress Copy status object created by
+ *     FileCopyManager.getStatus().
  * @private
  */
-ButterBar.prototype.showProgress_ = function() {
-  this.progress_ = this.copyManager_.getStatus();
+ButterBar.prototype.showProgress_ = function(progress) {
+  this.progress_ = progress;
   var options = {
     progress: this.progress_.percentage,
     actions: {},
@@ -278,12 +281,12 @@
     case 'BEGIN':
       this.showTimeout_ = setTimeout(function() {
         this.showTimeout_ = null;
-        this.showProgress_();
+        this.showProgress_(event.status);
       }.bind(this), 500);
       break;
 
     case 'PROGRESS':
-      this.showProgress_();
+      this.showProgress_(event.status);
       break;
 
     case 'SUCCESS':
@@ -296,7 +299,7 @@
       break;
 
     case 'ERROR':
-      this.progress_ = this.copyManager_.getStatus();
+      this.progress_ = event.status;
       if (event.error.reason === 'TARGET_EXISTS') {
         var name = event.error.data.name;
         if (event.error.data.isDirectory)
diff --git a/chrome/browser/resources/file_manager/js/file_copy_manager.js b/chrome/browser/resources/file_manager/js/file_copy_manager.js
index 5e55a13..fccce39 100644
--- a/chrome/browser/resources/file_manager/js/file_copy_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_copy_manager.js
@@ -14,26 +14,24 @@
   this.cancelRequested_ = false;
   this.cancelCallback_ = null;
   this.unloadTimeout_ = null;
+  this.listeners_ = [];
 
   window.addEventListener('error', function(e) {
     this.log_('Unhandled error: ', e.message, e.filename + ':' + e.lineno);
   }.bind(this));
 }
 
-var fileCopyManagerInstance = null;
-
 /**
  * Get FileCopyManager instance. In case is hasn't been initialized, a new
  * instance is created.
  *
- * @param {DirectoryEntry} root Root entry.
  * @return {FileCopyManager} A FileCopyManager instance.
  */
-FileCopyManager.getInstance = function(root) {
-  if (fileCopyManagerInstance === null) {
-    fileCopyManagerInstance = new FileCopyManager(root);
-  }
-  return fileCopyManagerInstance;
+FileCopyManager.getInstance = function() {
+  if (!FileCopyManager.instance_)
+    FileCopyManager.instance_ = new FileCopyManager();
+
+  return FileCopyManager.instance_;
 };
 
 /**
@@ -347,16 +345,31 @@
     return;  // Swallow events until cancellation complete.
 
   eventArgs.status = this.getStatus();
-
-  var windows = getContentWindows();
-  for (var i = 0; i < windows.length; i++) {
-    var w = windows[i];
-    if (w.FileCopyManagerWrapper)
-      w.FileCopyManagerWrapper.getInstance().onEvent(eventName, eventArgs);
+  for (var i = 0; i < this.listeners_.length; ++i) {
+    this.listeners_[i](eventName, eventArgs);
   }
 };
 
 /**
+ * Adds a listener for running task events.
+ * @param {function(string, Object)} listener A listener to be added.
+ */
+FileCopyManager.prototype.addListener = function(listener) {
+  this.listeners_.push(listener);
+};
+
+/**
+ * Removes the listener for running task events. If the listener is not added
+ * by addListener(), it is simply ignored.
+ * @param {function(string, Object)} listener A listener to be removed.
+ */
+FileCopyManager.prototype.removeListener = function(listener) {
+  var index = this.listeners_.indexOf(listener);
+  if (index >= 0)
+    this.listeners_.splice(index, 1);
+};
+
+/**
  * Says if there are any tasks in the queue.
  * @return {boolean} True, if there are any tasks.
  */
@@ -633,9 +646,14 @@
     self.resetQueue_();
   };
 
-  var onTaskSuccess = function(task) {
+  var onTaskSuccess = function() {
     if (self.maybeCancel_())
       return;
+
+    // The task at the front of the queue is completed. Pop it from the queue.
+    self.copyTasks_.shift();
+    self.maybeScheduleCloseBackgroundPage_();
+
     if (!self.copyTasks_.length) {
       // All tasks have been serviced, clean up and exit.
       self.sendProgressEvent_('SUCCESS');
@@ -649,38 +667,55 @@
     // these continuous tasks.
     self.sendProgressEvent_('PROGRESS');
 
-    self.serviceNextTask_(onTaskSuccess, onTaskError);
+    self.serviceTask_(self.copyTasks_[0], onTaskSuccess, onTaskError);
   };
 
   // If the queue size is 1 after pushing our task, it was empty before,
   // so we need to kick off queue processing and dispatch BEGIN event.
 
   this.sendProgressEvent_('BEGIN');
-  this.serviceNextTask_(onTaskSuccess, onTaskError);
+  this.serviceTask_(this.copyTasks_[0], onTaskSuccess, onTaskError);
 };
 
 /**
- * Service all entries in the next copy task.
+ * Runs a given task.
+ * Note that the responsibility of this method is just dispatching to the
+ * appropriate serviceXxxTask_() method.
+ * TODO(hidehiko): Remove this method by introducing FileCopyManager.Task.run()
+ *     (crbug.com/246976).
  *
- * @param {function} successCallback On success.
- * @param {function} errorCallback On error.
+ * @param {FileCopyManager.Task} task A task to be run.
+ * @param {function()} successCallback Callback run on success.
+ * @param {function(FileCopyManager.Error)} errorCallback Callback run on error.
  * @private
  */
-FileCopyManager.prototype.serviceNextTask_ = function(
-    successCallback, errorCallback) {
+FileCopyManager.prototype.serviceTask_ = function(
+    task, successCallback, errorCallback) {
+  if (task.zip)
+    this.serviceZipTask_(task, successCallback, errorCallback);
+  else
+    this.serviceCopyTask_(task, successCallback, errorCallback);
+};
+
+/**
+ * Service all entries in the copy (and move) task.
+ * Note: this method contains also the operation of "Move" due to historical
+ * reason.
+ * TODO(hidehiko): extract "move" related code into another method.
+ *
+ * @param {FileCopyManager.Task} task A copy task to be run.
+ * @param {function()} successCallback On success.
+ * @param {function(FileCopyManager.Error)} errorCallback On error.
+ * @private
+ */
+FileCopyManager.prototype.serviceCopyTask_ = function(
+    task, successCallback, errorCallback) {
   var self = this;
-  var task = this.copyTasks_[0];
 
   var onFilesystemError = function(err) {
     errorCallback(new FileCopyManager.Error('FILESYSTEM_ERROR', err));
   };
 
-  var onTaskComplete = function() {
-    self.copyTasks_.shift();
-    self.maybeScheduleCloseBackgroundPage_();
-    successCallback(task);
-  };
-
   var deleteOriginals = function() {
     var count = task.originalEntries.length;
 
@@ -688,7 +723,7 @@
       self.sendOperationEvent_('deleted', [entry]);
       count--;
       if (!count)
-        onTaskComplete();
+        successCallback();
     };
 
     for (var i = 0; i < task.originalEntries.length; i++) {
@@ -698,14 +733,14 @@
     }
   };
 
-  var onEntryServiced = function(targetEntry, size) {
+  var onEntryServiced = function() {
     // We should not dispatch a PROGRESS event when there is no pending items
     // in the task.
     if (task.pendingDirectories.length + task.pendingFiles.length == 0) {
       if (task.deleteAfterCopy) {
         deleteOriginals();
       } else {
-        onTaskComplete();
+        successCallback();
       }
       return;
     }
@@ -715,14 +750,11 @@
     // We yield a few ms between copies to give the browser a chance to service
     // events (like perhaps the user clicking to cancel the copy, for example).
     setTimeout(function() {
-      self.serviceNextTaskEntry_(task, onEntryServiced, errorCallback);
+      self.serviceNextCopyTaskEntry_(task, onEntryServiced, errorCallback);
     }, 10);
   };
 
-  if (!task.zip)
-    this.serviceNextTaskEntry_(task, onEntryServiced, errorCallback);
-  else
-    this.serviceZipTask_(task, onTaskComplete, errorCallback);
+  this.serviceNextCopyTaskEntry_(task, onEntryServiced, errorCallback);
 };
 
 /**
@@ -730,11 +762,11 @@
  * TODO(olege): Refactor this method into a separate class.
  *
  * @param {FileManager.Task} task A task.
- * @param {function} successCallback On success.
- * @param {function} errorCallback On error.
+ * @param {function()} successCallback On success.
+ * @param {function(FileCopyManager.Error)} errorCallback On error.
  * @private
  */
-FileCopyManager.prototype.serviceNextTaskEntry_ = function(
+FileCopyManager.prototype.serviceNextCopyTaskEntry_ = function(
     task, successCallback, errorCallback) {
   if (this.maybeCancel_())
     return;
@@ -744,10 +776,15 @@
 
   if (!sourceEntry) {
     // All entries in this task have been copied.
-    successCallback(null);
+    successCallback();
     return;
   }
 
+  var onError = function(reason, data) {
+    self.log_('serviceNextCopyTaskEntry error: ' + reason + ':', data);
+    errorCallback(new FileCopyManager.Error(reason, data));
+  };
+
   // |sourceEntry.originalSourcePath| is set in util.recurseAndResolveEntries.
   var sourcePath = sourceEntry.originalSourcePath;
   if (sourceEntry.fullPath.substr(0, sourcePath.length) != sourcePath) {
@@ -763,7 +800,7 @@
 
   var onCopyCompleteBase = function(entry, size) {
     task.markEntryComplete(entry, size);
-    successCallback(entry, size);
+    successCallback();
   };
 
   var onCopyComplete = function(entry, size) {
@@ -776,11 +813,6 @@
     self.sendProgressEvent_('PROGRESS');
   };
 
-  var onError = function(reason, data) {
-    self.log_('serviceNextTaskEntry error: ' + reason + ':', data);
-    errorCallback(new FileCopyManager.Error(reason, data));
-  };
-
   var onFilesystemCopyComplete = function(sourceEntry, targetEntry) {
     // TODO(benchan): We currently do not know the size of data being
     // copied by FileEntry.copyTo(), so task.completedBytes will not be
@@ -1006,13 +1038,13 @@
 /**
  * Service a zip file creation task.
  *
- * @param {FileManager.Task} task A task.
- * @param {function} completeCallback On complete.
- * @param {function} errorCallback On error.
+ * @param {FileCopyManager.Task} task A zip task to be run.
+ * @param {function()} successCallback On complete.
+ * @param {function(FileCopyManager.Error)} errorCallback On error.
  * @private
  */
-FileCopyManager.prototype.serviceZipTask_ = function(task, completeCallback,
-                                                     errorCallback) {
+FileCopyManager.prototype.serviceZipTask_ = function(
+    task, successCallback, errorCallback) {
   var self = this;
   var dirURL = task.zipBaseDirEntry.toURL();
   var selectionURLs = [];
@@ -1043,7 +1075,7 @@
         self.sendProgressEvent_('ERROR',
             new FileCopyManager.Error('FILESYSTEM_ERROR', ''));
       }
-      completeCallback(task);
+      successCallback();
     };
 
     self.sendProgressEvent_('PROGRESS');
diff --git a/chrome/browser/resources/file_manager/js/file_copy_manager_wrapper.js b/chrome/browser/resources/file_manager/js/file_copy_manager_wrapper.js
index f955ff4..6f902b9 100644
--- a/chrome/browser/resources/file_manager/js/file_copy_manager_wrapper.js
+++ b/chrome/browser/resources/file_manager/js/file_copy_manager_wrapper.js
@@ -10,27 +10,18 @@
  * @constructor
  */
 function FileCopyManagerWrapper() {
-  this.status_ = {
-    pendingItems: 0,
-    pendingFiles: 0,
-    pendingDirectories: 0,
-    pendingBytes: 0,
+  this.running_ = false;
 
-    completedItems: 0,
-    completedFiles: 0,
-    completedDirectories: 0,
-    completedBytes: 0,
+  var onEventBound = this.onEvent_.bind(this);
+  chrome.runtime.getBackgroundPage(function(backgroundPage) {
+    var fileCopyManager = backgroundPage.FileCopyManager.getInstance();
+    fileCopyManager.addListener(onEventBound);
 
-    totalItems: 0,
-    totalFiles: 0,
-    totalDirectories: 0,
-    totalBytes: 0,
-
-    percentage: NaN,
-    pendingCopies: 0,
-    pendingMoves: 0,
-    filename: ''  // In case pendingItems == 1
-  };
+    // Register removing the listener when the window is closed.
+    chrome.app.window.current().onClosed.addListener(function() {
+      fileCopyManager.removeListener(onEventBound);
+    });
+  });
 }
 
 /**
@@ -50,24 +41,13 @@
 };
 
 /**
- * Load background page and call callback with copy manager as an argument.
- * @param {function} callback Function with FileCopyManager as a parameter.
- * @private
- */
-FileCopyManagerWrapper.prototype.getCopyManagerAsync_ = function(callback) {
-  chrome.runtime.getBackgroundPage(function(backgroundPage) {
-    var fileCopyManager = backgroundPage.FileCopyManager.getInstance();
-    fileCopyManager.initialize(callback.bind(this, fileCopyManager));
-  });
-};
-
-/**
  * Called be FileCopyManager to raise an event in this instance of FileManager.
  * @param {string} eventName Event name.
  * @param {Object} eventArgs Arbitratry field written to event object.
+ * @private
  */
-FileCopyManagerWrapper.prototype.onEvent = function(eventName, eventArgs) {
-  this.status_ = eventArgs.status;
+FileCopyManagerWrapper.prototype.onEvent_ = function(eventName, eventArgs) {
+  this.running_ = eventArgs.status.totalFiles > 0;
 
   var event = new cr.Event(eventName);
   for (var arg in eventArgs)
@@ -78,10 +58,22 @@
 };
 
 /**
- * @return {Object} Status object.
+ * @return {boolean} True if there is a running task.
  */
-FileCopyManagerWrapper.prototype.getStatus = function() {
-  return this.status_;
+FileCopyManagerWrapper.prototype.isRunning = function() {
+  return this.running_;
+};
+
+/**
+ * Load background page and call callback with copy manager as an argument.
+ * @param {function} callback Function with FileCopyManager as a parameter.
+ * @private
+ */
+FileCopyManagerWrapper.prototype.getCopyManagerAsync_ = function(callback) {
+  chrome.runtime.getBackgroundPage(function(backgroundPage) {
+    var fileCopyManager = backgroundPage.FileCopyManager.getInstance();
+    fileCopyManager.initialize(callback.bind(this, fileCopyManager));
+  });
 };
 
 /**
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 823d2a7..029af9c 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -2956,8 +2956,7 @@
         return;
 
       case '27':  // Escape => Cancel dialog.
-        if (this.copyManager_ &&
-            this.copyManager_.getStatus().totalFiles != 0) {
+        if (this.copyManager_ && this.copyManager_.isRunning()) {
           // If there is a copy in progress, ESC will cancel it.
           event.preventDefault();
           this.copyManager_.requestCancel();
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index d5a8ef8..b6eb19a 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -1772,6 +1772,9 @@
  * @param {!MouseEvent} event A click event.
  */
 function entryBoxClick(event) {
+  // Do nothing if a bookmark star is clicked.
+  if (event.defaultPrevented)
+    return;
   var tagName = event.target.tagName;
   if (tagName == 'BUTTON' || tagName == 'INPUT' || tagName == 'A')
     return;
diff --git a/chrome/browser/resources/inspect/inspect.html b/chrome/browser/resources/inspect/inspect.html
index 389a7a3..f9e9d33 100644
--- a/chrome/browser/resources/inspect/inspect.html
+++ b/chrome/browser/resources/inspect/inspect.html
@@ -33,6 +33,10 @@
       <div class="content-header">Extensions</div>
       <div id="extensions" class="list"></div>
     </div>
+    <div id="apps-tab">
+      <div class="content-header">Apps</div>
+      <div id="apps" class="list"></div>
+    </div>
     <div id="workers-tab">
       <div class="content-header">Shared workers</div>
       <div id="workers" class="list"></div>
diff --git a/chrome/browser/resources/inspect/inspect.js b/chrome/browser/resources/inspect/inspect.js
index 819272b..6920b3f 100644
--- a/chrome/browser/resources/inspect/inspect.js
+++ b/chrome/browser/resources/inspect/inspect.js
@@ -63,6 +63,7 @@
 
   removeChildren('pages');
   removeChildren('extensions');
+  removeChildren('apps');
   removeChildren('workers');
   removeChildren('others');
 
@@ -73,6 +74,8 @@
       addToWorkersList(data[i]);
     else if (data[i].type === 'extension')
       addToExtensionsList(data[i]);
+    else if (data[i].type === 'app')
+      addToAppsList(data[i]);
     else
       addToOthersList(data[i]);
   }
@@ -135,6 +138,10 @@
   addTargetToList(data, 'extensions', ['name', 'url']);
 }
 
+function addToAppsList(data) {
+  addTargetToList(data, 'apps', ['name', 'url']);
+}
+
 function addToWorkersList(data) {
   addTargetToList(data,
                   'workers',
diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js
index 088ea6d..5352128 100644
--- a/chrome/browser/resources/local_ntp/most_visited_util.js
+++ b/chrome/browser/resources/local_ntp/most_visited_util.js
@@ -107,13 +107,23 @@
 function fillMostVisited(location, fill) {
   var params = parseQueryParams(document.location);
   params.rid = parseInt(params.rid, 10);
-  if (!isFinite(params.rid))
+  if (!isFinite(params.rid) && !params.url)
     return;
-  var apiHandle = chrome.embeddedSearch.searchBox;
-  var data = apiHandle.getMostVisitedItemData(params.rid);
-  if (!data)
-    return;
-  if (/^javascript:/i.test(data.url))
+  var data = {};
+  if (params.url) {
+    // Means that we get suggestion data from the server. Create data object.
+    data.url = params.url;
+    data.thumbnailUrl = params.tu || '';
+    data.title = params.ti || '';
+    data.direction = params.di || '';
+  } else {
+    var apiHandle = chrome.embeddedSearch.searchBox;
+    data = apiHandle.getMostVisitedItemData(params.rid);
+    if (!data)
+      return;
+  }
+  if (/^javascript:/i.test(data.url) ||
+      /^javascript:/i.test(data.thumbnailUrl))
     return;
   if (data.direction)
     document.body.dir = data.direction;
diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html
index ef02f53..97dacf6 100644
--- a/chrome/browser/resources/options/browser_options.html
+++ b/chrome/browser/resources/options/browser_options.html
@@ -642,6 +642,22 @@
           </span>
         </div>
       </div>
+      <div id="accessibility-sticky-keys" class="option-name" hidden>
+        <div class="checkbox">
+          <span class="controlled-setting-with-label">
+            <input id="accessibility-sticky-keys-check"
+                pref="settings.a11y.sticky_keys_enabled" type="checkbox">
+            <span>
+              <label for="accessibility-sticky-keys-check"
+                  i18n-content="accessibilityStickyKeys">
+              </label>
+              <span class="controlled-setting-indicator"
+                  pref="settings.a11y.sticky_keys_enabled">
+              </span>
+            </span>
+          </span>
+        </div>
+      </div>
       <div class="option-name">
         <div class="checkbox">
           <span class="controlled-setting-with-label">
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index f221e88..f14ae61 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -430,6 +430,8 @@
           chrome.send('highContrastChange',
                       [$('accessibility-high-contrast-check').checked]);
         };
+        $('accessibility-sticky-keys').hidden =
+            !loadTimeData.getBoolean('enableStickyKeys');
       }
 
       // Display management section (CrOS only).
diff --git a/chrome/browser/resources/options/managed_user_create_confirm.css b/chrome/browser/resources/options/managed_user_create_confirm.css
index 718d346..37b3770 100644
--- a/chrome/browser/resources/options/managed_user_create_confirm.css
+++ b/chrome/browser/resources/options/managed_user_create_confirm.css
@@ -6,6 +6,10 @@
   width: 722px;
 }
 
+#managed-user-created-title {
+  word-wrap: break-word;
+}
+
 #managed-user-created-image {
   background-image: -webkit-image-set(
       url('../../../../ui/resources/default_100_percent/supervised_illustration_done.png') 1x,
@@ -18,3 +22,8 @@
   white-space: pre-wrap;
   word-wrap: break-word;
 }
+
+#managed-user-created-switch {
+  max-width: 600px;
+  word-wrap: break-word;
+}
diff --git a/chrome/browser/resources/options/managed_user_create_confirm.js b/chrome/browser/resources/options/managed_user_create_confirm.js
index d1538ac..64922b7 100644
--- a/chrome/browser/resources/options/managed_user_create_confirm.js
+++ b/chrome/browser/resources/options/managed_user_create_confirm.js
@@ -67,19 +67,27 @@
                        .replace(/'/g, '&#39;');
       }
 
+      var MAX_LENGTH = 50;
+      function elide(original) {
+        if (original.length <= MAX_LENGTH)
+          return original;
+        return original.substring(0, MAX_LENGTH - 3) + '...';
+      }
+
       this.profileInfo_ = info;
+      var elidedName = elide(info.name);
       $('managed-user-created-title').textContent =
-          loadTimeData.getStringF('managedUserCreatedTitle', info.name);
+          loadTimeData.getStringF('managedUserCreatedTitle', elidedName);
       $('managed-user-created-switch').textContent =
-          loadTimeData.getStringF('managedUserCreatedSwitch', info.name);
+          loadTimeData.getStringF('managedUserCreatedSwitch', elidedName);
 
       // HTML-escape the user-supplied strings before putting them into
       // innerHTML. This is probably excessive for the email address, but
       // belt-and-suspenders is cheap here.
       $('managed-user-created-text').innerHTML =
           loadTimeData.getStringF('managedUserCreatedText',
-                                  HTMLEscape(info.name),
-                                  HTMLEscape(info.custodianEmail));
+                                  HTMLEscape(elidedName),
+                                  HTMLEscape(elide(info.custodianEmail)));
     },
 
     /** @override */
diff --git a/chrome/browser/resources/sync_setup_overlay.html b/chrome/browser/resources/sync_setup_overlay.html
index 246ff77..7a37299 100644
--- a/chrome/browser/resources/sync_setup_overlay.html
+++ b/chrome/browser/resources/sync_setup_overlay.html
@@ -34,11 +34,10 @@
             <select id="sync-select-datatypes">
               <option i18n-content="syncAllDataTypes" selected></option>
               <option i18n-content="chooseDataTypes"></option>
-              <!-- The syncNothing element is to be hidden for M29.
+              <!-- The syncNothing element is to be removed for M29.
                    TODO(rsimha): Revisit this for M30.
                    See http://crbug.com/252049.
               -->
-              <option i18n-content="syncNothing" hidden></option>
             </select>
             <div id="choose-data-types-body">
               <div id="apps-item" class="sync-type-checkbox checkbox">
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 2c5f590..62c12fa 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -417,6 +417,10 @@
       } else if (response.verdict() == ClientDownloadResponse::DANGEROUS_HOST) {
         reason = REASON_DOWNLOAD_DANGEROUS_HOST;
         result = DANGEROUS_HOST;
+      } else if (
+          response.verdict() == ClientDownloadResponse::POTENTIALLY_UNWANTED) {
+        reason = REASON_DOWNLOAD_POTENTIALLY_UNWANTED;
+        result = POTENTIALLY_UNWANTED;
       } else {
         LOG(DFATAL) << "Unknown download response verdict: "
                     << response.verdict();
@@ -864,8 +868,12 @@
 void DownloadProtectionService::ShowDetailsForDownload(
     const content::DownloadItem& item,
     content::PageNavigator* navigator) {
+  GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL);
+  if (item.GetDangerType() ==
+      content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED)
+    learn_more_url = GURL(chrome::kDownloadPotentiallyUnwantedLearnMoreURL);
   navigator->OpenURL(
-      content::OpenURLParams(GURL(chrome::kDownloadScanningLearnMoreURL),
+      content::OpenURLParams(learn_more_url,
                              content::Referrer(),
                              NEW_FOREGROUND_TAB,
                              content::PAGE_TRANSITION_LINK,
diff --git a/chrome/browser/safe_browsing/download_protection_service.h b/chrome/browser/safe_browsing/download_protection_service.h
index 48ab04a..0b61b6d 100644
--- a/chrome/browser/safe_browsing/download_protection_service.h
+++ b/chrome/browser/safe_browsing/download_protection_service.h
@@ -45,6 +45,7 @@
     DANGEROUS,
     UNCOMMON,
     DANGEROUS_HOST,
+    POTENTIALLY_UNWANTED
   };
 
   // Callback type which is invoked once the download request is done.
@@ -130,6 +131,7 @@
     REASON_INVALID_RESPONSE_VERDICT,
     REASON_ARCHIVE_WITHOUT_BINARIES,
     REASON_DOWNLOAD_DANGEROUS_HOST,
+    REASON_DOWNLOAD_POTENTIALLY_UNWANTED,
     REASON_MAX  // Always add new values before this one.
   };
 
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index 6d5bfee..91cf222 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -455,8 +455,8 @@
   std::string hash = "hash";
 
   content::MockDownloadItem item;
-  EXPECT_CALL(item, AddObserver(_)).Times(5);
-  EXPECT_CALL(item, RemoveObserver(_)).Times(5);
+  EXPECT_CALL(item, AddObserver(_)).Times(6);
+  EXPECT_CALL(item, RemoveObserver(_)).Times(6);
   EXPECT_CALL(item, GetFullPath()).WillRepeatedly(ReturnRef(a_tmp));
   EXPECT_CALL(item, GetTargetFilePath()).WillRepeatedly(ReturnRef(a_exe));
   EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain));
@@ -469,7 +469,7 @@
   EXPECT_CALL(*sb_service_->mock_database_manager(),
               MatchDownloadWhitelistUrl(_))
       .WillRepeatedly(Return(false));
-  EXPECT_CALL(*signature_util_.get(), CheckSignature(a_tmp, _)).Times(5);
+  EXPECT_CALL(*signature_util_.get(), CheckSignature(a_tmp, _)).Times(6);
 
   download_service_->CheckClientDownload(
       &item,
@@ -561,6 +561,25 @@
 #else
   EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
 #endif
+
+  // If the response is POTENTIALLY_UNWANTED the result should also be marked as
+  // POTENTIALLY_UNWANTED.
+  response.set_verdict(ClientDownloadResponse::POTENTIALLY_UNWANTED);
+  factory.SetFakeResponse(
+      DownloadProtectionService::GetDownloadRequestUrl(),
+      response.SerializeAsString(),
+      true);
+
+  download_service_->CheckClientDownload(
+      &item,
+      base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+                 base::Unretained(this)));
+  MessageLoop::current()->Run();
+#if defined(OS_WIN)
+  EXPECT_TRUE(IsResult(DownloadProtectionService::POTENTIALLY_UNWANTED));
+#else
+  EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
+#endif
 }
 
 TEST_F(DownloadProtectionServiceTest, CheckClientDownloadHTTPS) {
diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc
index 37ada0c..3e8ee59 100644
--- a/chrome/browser/safe_browsing/malware_details_unittest.cc
+++ b/chrome/browser/safe_browsing/malware_details_unittest.cc
@@ -531,7 +531,6 @@
   UnsafeResource resource;
   InitResource(&resource, true, GURL(kMalwareURL));
 
-  profile()->CreateRequestContext();
   scoped_refptr<MalwareDetailsWrap> report = new MalwareDetailsWrap(
       ui_manager_.get(), web_contents(), resource,
       profile()->GetRequestContext());
@@ -594,7 +593,6 @@
   expected.set_complete(true);
 
   VerifyResults(actual, expected);
-  profile()->ResetRequestContext();
 }
 
 // Tests the interaction with the HTTP cache (where the cache is empty).
@@ -605,7 +603,6 @@
   UnsafeResource resource;
   InitResource(&resource, true, GURL(kMalwareURL));
 
-  profile()->CreateRequestContext();
   scoped_refptr<MalwareDetailsWrap> report = new MalwareDetailsWrap(
       ui_manager_.get(), web_contents(), resource,
       profile()->GetRequestContext());
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 720836f..7ad5e86 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -482,8 +482,8 @@
   if (navigation_entry_index_to_remove_ != -1 &&
       navigation_entry_index_to_remove_ != last_committed_index &&
       !web_contents_->IsBeingDestroyed()) {
-    web_contents_->GetController().RemoveEntryAtIndex(
-        navigation_entry_index_to_remove_);
+    CHECK(web_contents_->GetController().RemoveEntryAtIndex(
+        navigation_entry_index_to_remove_));
     navigation_entry_index_to_remove_ = -1;
   }
 }
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 483a464..ec50a66 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -12,7 +12,7 @@
 #include "chrome/browser/safe_browsing/safe_browsing_database.h"
 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h"
 #include "chrome/browser/safe_browsing/safe_browsing_store_unittest_helper.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "crypto/sha2.h"
 #include "sql/connection.h"
 #include "sql/statement.h"
@@ -21,7 +21,6 @@
 #include "url/gurl.h"
 
 using base::Time;
-using content::BrowserThread;
 
 namespace {
 
@@ -1252,10 +1251,9 @@
 // Checks that the whitelists are handled properly.
 TEST_F(SafeBrowsingDatabaseTest, Whitelists) {
   database_.reset();
-  base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT);
   // We expect all calls to ContainsCsdWhitelistedUrl in particular to be made
   // from the IO thread.  In general the whitelist lookups are thread-safe.
-  content::TestBrowserThread io_thread(BrowserThread::IO, &loop);
+  content::TestBrowserThreadBundle thread_bundle_;
 
   // If the whitelist is disabled everything should match the whitelist.
   database_.reset(new SafeBrowsingDatabaseNew(new SafeBrowsingStoreFile(),
diff --git a/chrome/browser/safe_browsing/two_phase_testserver.py b/chrome/browser/safe_browsing/two_phase_testserver.py
index c054047..b385e15 100755
--- a/chrome/browser/safe_browsing/two_phase_testserver.py
+++ b/chrome/browser/safe_browsing/two_phase_testserver.py
@@ -99,12 +99,6 @@
 
     return server
 
-  def add_options(self):
-    testserver_base.TestServerRunner.add_options(self)
-    self.option_parser.add_option('--data-file', dest='data_file',
-                                  help='File containing safebrowsing test '
-                                  'data and expectations')
-
 
 if __name__ == '__main__':
   sys.exit(ServerRunner().main())
diff --git a/chrome/browser/search/iframe_source_unittest.cc b/chrome/browser/search/iframe_source_unittest.cc
index 0dfee16..38cbba9 100644
--- a/chrome/browser/search/iframe_source_unittest.cc
+++ b/chrome/browser/search/iframe_source_unittest.cc
@@ -12,10 +12,11 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/test/mock_resource_context.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "grit/browser_resources.h"
 #include "net/url_request/url_request.h"
 #include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_test_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
@@ -73,11 +74,10 @@
   // else happen on the IO thread. This setup is a hacky way to satisfy all
   // those constraints.
   IframeSourceTest()
-    : message_loop_(base::MessageLoop::TYPE_IO),
-      ui_thread_(content::BrowserThread::UI, &message_loop_),
-      io_thread_(content::BrowserThread::IO, &message_loop_),
-      instant_io_context_(NULL),
-      response_(NULL) {
+      : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+        resource_context_(&test_url_request_context_),
+        instant_io_context_(NULL),
+        response_(NULL) {
   }
 
   TestIframeSource* source() { return source_.get(); }
@@ -121,7 +121,7 @@
   }
 
  private:
-  virtual void SetUp() {
+  virtual void SetUp() OVERRIDE {
     source_.reset(new TestIframeSource());
     callback_ = base::Bind(&IframeSourceTest::SaveResponse,
                            base::Unretained(this));
@@ -140,10 +140,9 @@
     response_ = data;
   }
 
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
+  net::TestURLRequestContext test_url_request_context_;
   content::MockResourceContext resource_context_;
   scoped_ptr<TestIframeSource> source_;
   content::URLDataSource::GotDataCallback callback_;
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h
index 789d5c7..f8c88e5 100644
--- a/chrome/browser/search/instant_service.h
+++ b/chrome/browser/search/instant_service.h
@@ -112,6 +112,7 @@
                            MANUAL_ShowsGoogleNTP);
   FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest,
                            MANUAL_SearchesFromFakebox);
+  FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation);
 
   // Overridden from BrowserContextKeyedService:
   virtual void Shutdown() OVERRIDE;
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index ec6b193..883c43e 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -296,6 +296,12 @@
           IsInstantURL(url, profile));
 }
 
+bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
+  return ShouldAssignURLToInstantRenderer(url, profile) &&
+      (url.host() == chrome::kChromeSearchLocalNtpHost ||
+       url.host() == chrome::kChromeSearchOnlineNtpHost);
+}
+
 bool IsInstantNTP(const content::WebContents* contents) {
   if (!contents)
     return false;
diff --git a/chrome/browser/search/search.h b/chrome/browser/search/search.h
index f7630a5..7f1bf78 100644
--- a/chrome/browser/search/search.h
+++ b/chrome/browser/search/search.h
@@ -75,6 +75,9 @@
 // Returns true if |url| should be rendered in the Instant renderer process.
 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile);
 
+// Returns true if the Instant |url| should use process per site.
+bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile);
+
 // Returns true if the visible entry of |contents| is a New Tab Page rendered
 // by Instant. A page that matches the search or Instant URL of the default
 // search provider but does not have any search terms is considered an Instant
diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc
index b718e06..c986500 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -290,6 +290,35 @@
   }
 }
 
+TEST_F(SearchTest, ShouldUseProcessPerSiteForInstantURL) {
+  EnableInstantExtendedAPIForTesting();
+
+  const SearchTestCase kTestCases[] = {
+    {"chrome-search://local-ntp",      true,  "Local NTP"},
+    {"chrome-search://online-ntp",     true,  "Online NTP"},
+    {"invalid-scheme://local-ntp",     false, "Invalid Local NTP URL"},
+    {"invalid-scheme://online-ntp",    false, "Invalid Online NTP URL"},
+    {"chrome-search://foo.com",        false, "Search result page"},
+    {"https://foo.com/instant?strk",   false,  ""},
+    {"https://foo.com/instant#strk",   false,  ""},
+    {"https://foo.com/instant?strk=0", false,  ""},
+    {"https://foo.com/url?strk",       false,  ""},
+    {"https://foo.com/alt?strk",       false,  ""},
+    {"http://foo.com/instant",         false,  "Non-HTTPS"},
+    {"http://foo.com/instant?strk",    false,  "Non-HTTPS"},
+    {"http://foo.com/instant?strk=1",  false,  "Non-HTTPS"},
+    {"https://foo.com/instant",        false,  "No search terms replacement"},
+    {"https://foo.com/?strk",          false,  "Non-exact path"},
+  };
+
+  for (size_t i = 0; i < arraysize(kTestCases); ++i) {
+    const SearchTestCase& test = kTestCases[i];
+    EXPECT_EQ(test.expected_result,
+              ShouldUseProcessPerSiteForInstantURL(GURL(test.url), profile()))
+        << test.url << " " << test.comment;
+  }
+}
+
 struct PrivilegedURLTestCase {
   bool add_as_alternate_url;
   const char* input_url;
diff --git a/chrome/browser/search_engines/search_provider_install_data_unittest.cc b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
index 019c2c1..15aa4df 100644
--- a/chrome/browser/search_engines/search_provider_install_data_unittest.cc
+++ b/chrome/browser/search_engines/search_provider_install_data_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/bind.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/search_engines/search_provider_install_data.h"
@@ -30,113 +31,72 @@
 // TestGetInstallState --------------------------------------------------------
 
 // Test the SearchProviderInstallData::GetInstallState.
-class TestGetInstallState :
-    public base::RefCountedThreadSafe<TestGetInstallState> {
+class TestGetInstallState {
  public:
   explicit TestGetInstallState(SearchProviderInstallData* install_data);
 
-  void set_search_provider_host(
-      const std::string& search_provider_host) {
-    search_provider_host_ = search_provider_host;
-  }
-
-  void set_default_search_provider_host(
-      const std::string& default_search_provider_host) {
-    default_search_provider_host_ = default_search_provider_host;
-  }
-
-  // Runs the test. Returns true if all passed. False if any failed.
-  bool RunTests();
+  // Runs all of the test cases.
+  void RunTests(const std::string& search_provider_host,
+                const std::string& default_search_provider_host);
 
  private:
-  friend class base::RefCountedThreadSafe<TestGetInstallState>;
-  ~TestGetInstallState();
-
-  // Starts the test run on the IO thread.
-  void StartTestOnIOThread();
-
   // Callback for when SearchProviderInstallData is ready to have
   // GetInstallState called. Runs all of the test cases.
-  void DoInstallStateTests();
+  void DoInstallStateTests(const std::string& search_provider_host,
+                           const std::string& default_search_provider_host);
 
   // Does a verification for one url and its expected state.
   void VerifyInstallState(SearchProviderInstallData::State expected_state,
                           const std::string& url);
 
   SearchProviderInstallData* install_data_;
-  base::MessageLoop* main_loop_;
-
-  // A host which should be a search provider but not the default.
-  std::string search_provider_host_;
-
-  // A host which should be a search provider but not the default.
-  std::string default_search_provider_host_;
-
-  // Used to indicate if DoInstallStateTests passed all test.
-  bool passed_;
 
   DISALLOW_COPY_AND_ASSIGN(TestGetInstallState);
 };
 
 TestGetInstallState::TestGetInstallState(
     SearchProviderInstallData* install_data)
-    : install_data_(install_data),
-      main_loop_(NULL),
-      passed_(false) {
+    : install_data_(install_data) {
 }
 
-bool TestGetInstallState::RunTests() {
-  passed_ = true;
-
-  main_loop_ = base::MessageLoop::current();
-
-  BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)->PostTask(
-      FROM_HERE,
-      base::Bind(&TestGetInstallState::StartTestOnIOThread, this));
-  // Run the current message loop. When the test is finished on the I/O thread,
-  // it invokes Quit, which unblocks this.
-  base::MessageLoop::current()->Run();
-  main_loop_ = NULL;
-
-  // Let the testing code know what the result is.
-  return passed_;
-}
-
-TestGetInstallState::~TestGetInstallState() {
-}
-
-void TestGetInstallState::StartTestOnIOThread() {
+void TestGetInstallState::RunTests(
+    const std::string& search_provider_host,
+    const std::string& default_search_provider_host) {
   install_data_->CallWhenLoaded(
-      base::Bind(&TestGetInstallState::DoInstallStateTests, this));
+      base::Bind(&TestGetInstallState::DoInstallStateTests,
+                 base::Unretained(this),
+                 search_provider_host, default_search_provider_host));
+  base::RunLoop().RunUntilIdle();
 }
 
-void TestGetInstallState::DoInstallStateTests() {
+void TestGetInstallState::DoInstallStateTests(
+    const std::string& search_provider_host,
+    const std::string& default_search_provider_host) {
+  SCOPED_TRACE("search provider: " + search_provider_host +
+               ", default search provider: " + default_search_provider_host);
   // Installed but not default.
   VerifyInstallState(SearchProviderInstallData::INSTALLED_BUT_NOT_DEFAULT,
-                     "http://" + search_provider_host_ + "/");
+                     "http://" + search_provider_host + "/");
   VerifyInstallState(SearchProviderInstallData::INSTALLED_BUT_NOT_DEFAULT,
-                     "http://" + search_provider_host_ + ":80/");
+                     "http://" + search_provider_host + ":80/");
 
   // Not installed.
   VerifyInstallState(SearchProviderInstallData::NOT_INSTALLED,
-                     "http://" + search_provider_host_ + ":96/");
+                     "http://" + search_provider_host + ":96/");
 
   // Not installed due to different scheme.
   VerifyInstallState(SearchProviderInstallData::NOT_INSTALLED,
-                     "https://" + search_provider_host_ + "/");
+                     "https://" + search_provider_host + "/");
 
   // Not installed.
   VerifyInstallState(SearchProviderInstallData::NOT_INSTALLED,
-                     "http://a" + search_provider_host_ + "/");
+                     "http://a" + search_provider_host + "/");
 
   // Installed as default.
-  if (!default_search_provider_host_.empty()) {
+  if (!default_search_provider_host.empty()) {
     VerifyInstallState(SearchProviderInstallData::INSTALLED_AS_DEFAULT,
-                       "http://" + default_search_provider_host_ + "/");
+                       "http://" + default_search_provider_host + "/");
   }
-
-  // All done.
-  main_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
 }
 
 void TestGetInstallState::VerifyInstallState(
@@ -145,16 +105,12 @@
 
   SearchProviderInstallData::State actual_state =
       install_data_->GetInstallState(GURL(url));
-  if (expected_state == actual_state)
-    return;
-
-  passed_ = false;
-  LOG(ERROR) << "GetInstallState for " << url << " failed. Expected " <<
-      expected_state << ".  Actual " << actual_state << ".";
+  EXPECT_EQ(expected_state, actual_state)
+      << "GetInstallState for " << url << " failed. Expected "
+      << expected_state << ".  Actual " << actual_state << ".";
 }
 
-};  // namespace
-
+}  // namespace
 
 // SearchProviderInstallDataTest ----------------------------------------------
 
@@ -193,7 +149,6 @@
       std::string() /* unknown country code */);
 #endif
   util_.SetUp();
-  util_.StartIOThread();
   install_data_ = new SearchProviderInstallData(util_.profile(),
       content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
       content::Source<SearchProviderInstallDataTest>(this));
@@ -247,7 +202,6 @@
   return t_url;
 }
 
-
 // Actual tests ---------------------------------------------------------------
 
 TEST_F(SearchProviderInstallDataTest, GetInstallState) {
@@ -257,24 +211,20 @@
   AddNewTemplateURL("http://" + host + "/path", ASCIIToUTF16("unittest"));
 
   // Wait for the changes to be saved.
-  TemplateURLServiceTestUtil::BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Verify the search providers install state (with no default set).
-  scoped_refptr<TestGetInstallState> test_get_install_state(
-      new TestGetInstallState(install_data_));
-  test_get_install_state->set_search_provider_host(host);
-  EXPECT_TRUE(test_get_install_state->RunTests());
+  TestGetInstallState test_get_install_state(install_data_);
+  test_get_install_state.RunTests(host, std::string());
 
   // Set-up a default and try it all one more time.
   std::string default_host = "www.mmm.com";
   TemplateURL* default_url =
       AddNewTemplateURL("http://" + default_host + "/", ASCIIToUTF16("mmm"));
   util_.model()->SetDefaultSearchProvider(default_url);
-  test_get_install_state->set_default_search_provider_host(default_host);
-  EXPECT_TRUE(test_get_install_state->RunTests());
+  test_get_install_state.RunTests(host, default_host);
 }
 
-
 TEST_F(SearchProviderInstallDataTest, ManagedDefaultSearch) {
   // Set up the database.
   util_.ChangeModelToLoadState();
@@ -288,28 +238,23 @@
   EXPECT_TRUE(util_.model()->is_default_search_managed());
 
   // Wait for the changes to be saved.
-  util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Verify the search providers install state.  The default search should be
   // the managed one we previously set.
-  scoped_refptr<TestGetInstallState> test_get_install_state(
-      new TestGetInstallState(install_data_));
-  test_get_install_state->set_search_provider_host(host);
-  test_get_install_state->set_default_search_provider_host(host2);
-  EXPECT_TRUE(test_get_install_state->RunTests());
+  TestGetInstallState test_get_install_state(install_data_);
+  test_get_install_state.RunTests(host, host2);
 }
 
-
 TEST_F(SearchProviderInstallDataTest, GoogleBaseUrlChange) {
-  scoped_refptr<TestGetInstallState> test_get_install_state(
-      new TestGetInstallState(install_data_));
+  TestGetInstallState test_get_install_state(install_data_);
 
   // Set up the database.
   util_.ChangeModelToLoadState();
   std::string google_host = "w.com";
   util_.SetGoogleBaseURL(GURL("http://" + google_host + "/"));
   // Wait for the I/O thread to process the update notification.
-  TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   AddNewTemplateURL("{google:baseURL}?q={searchTerms}", ASCIIToUTF16("t"));
   TemplateURL* default_url =
@@ -317,19 +262,17 @@
   util_.model()->SetDefaultSearchProvider(default_url);
 
   // Wait for the changes to be saved.
-  TemplateURLServiceTestUtil::BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Verify the search providers install state (with no default set).
-  test_get_install_state->set_search_provider_host(google_host);
-  EXPECT_TRUE(test_get_install_state->RunTests());
+  test_get_install_state.RunTests(google_host, std::string());
 
   // Change the Google base url.
   google_host = "foo.com";
   util_.SetGoogleBaseURL(GURL("http://" + google_host + "/"));
   // Wait for the I/O thread to process the update notification.
-  TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Verify that the change got picked up.
-  test_get_install_state->set_search_provider_host(google_host);
-  EXPECT_TRUE(test_get_install_state->RunTests());
+  test_get_install_state.RunTests(google_host, std::string());
 }
diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
index e2eaec1..f55aca1 100644
--- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc
+++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
@@ -15,6 +15,7 @@
 #include "chrome/browser/search_engines/template_url_service_test_util.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_thread.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
@@ -46,12 +47,10 @@
 
   virtual void SetUp() OVERRIDE {
     test_util_.SetUp();
-    test_util_.StartIOThread();
     TestingProfile* profile = test_util_.profile();
     ASSERT_TRUE(profile);
     ASSERT_TRUE(TemplateURLFetcherFactory::GetForProfile(profile));
 
-    profile->CreateRequestContext();
     ASSERT_TRUE(profile->GetRequestContext());
     ASSERT_TRUE(test_server_.InitializeAndWaitUntilReady());
   }
diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
index 9b8461b..643e7d3 100644
--- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/scoped_vector.h"
+#include "base/run_loop.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
@@ -1895,7 +1896,7 @@
 
   // Merge the prepopulate search engines.
   base::Time pre_merge_time = base::Time::Now();
-  test_util_a_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   test_util_a_.ResetModel(true);
 
   // The newly added search engine should have been safely merged, with an
diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc
index 850b5e3..5c5e43c 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.cc
+++ b/chrome/browser/search_engines/template_url_service_test_util.cc
@@ -5,9 +5,7 @@
 #include "chrome/browser/search_engines/template_url_service_test_util.h"
 
 #include "base/bind.h"
-#include "base/message_loop/message_loop.h"
-#include "base/path_service.h"
-#include "base/synchronization/waitable_event.h"
+#include "base/run_loop.h"
 #include "base/threading/thread.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/google/google_url_tracker.h"
@@ -20,43 +18,12 @@
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-
 #if defined(OS_CHROMEOS)
 #include "chrome/browser/google/google_util_chromeos.h"
 #endif
 
-using content::BrowserThread;
-
-namespace {
-
-// A callback used to coordinate when the database has finished processing
-// requests. See note in BlockTillServiceProcessesRequests for details.
-//
-// Schedules a QuitClosure on the message loop it was created with.
-void QuitCallback(base::MessageLoop* message_loop) {
-  message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
-}
-
-// Blocks the caller until thread has finished servicing all pending
-// requests.
-static void WaitForThreadToProcessRequests(BrowserThread::ID identifier) {
-  // Schedule a task on the thread that is processed after all
-  // pending requests on the thread.
-  BrowserThread::PostTask(
-      identifier,
-      FROM_HERE,
-      base::Bind(&QuitCallback, base::MessageLoop::current()));
-  base::MessageLoop::current()->Run();
-}
-
-}  // namespace
-
-
-// TestingTemplateURLService --------------------------------------------------
-
 // Trivial subclass of TemplateURLService that records the last invocation of
 // SetKeywordSearchTermsForURL.
 class TestingTemplateURLService : public TemplateURLService {
@@ -88,14 +55,14 @@
   DISALLOW_COPY_AND_ASSIGN(TestingTemplateURLService);
 };
 
-
 // TemplateURLServiceTestUtilBase ---------------------------------------------
 
 TemplateURLServiceTestUtilBase::TemplateURLServiceTestUtilBase()
     : changed_count_(0) {
 }
 
-TemplateURLServiceTestUtilBase::~TemplateURLServiceTestUtilBase() {}
+TemplateURLServiceTestUtilBase::~TemplateURLServiceTestUtilBase() {
+}
 
 void TemplateURLServiceTestUtilBase::CreateTemplateUrlService() {
   profile()->CreateWebDataService();
@@ -118,18 +85,10 @@
   changed_count_ = 0;
 }
 
-void TemplateURLServiceTestUtilBase::BlockTillServiceProcessesRequests() {
-  WaitForThreadToProcessRequests(BrowserThread::DB);
-}
-
-void TemplateURLServiceTestUtilBase::BlockTillIOThreadProcessesRequests() {
-  WaitForThreadToProcessRequests(BrowserThread::IO);
-}
-
 void TemplateURLServiceTestUtilBase::VerifyLoad() {
   ASSERT_FALSE(model()->loaded());
   model()->Load();
-  BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(1, GetObserverCount());
   ResetObserverCount();
 }
@@ -140,7 +99,7 @@
   // any changes made.
 
   model()->service_ = WebDataService::FromBrowserContext(profile());
-  BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 }
 
 void TemplateURLServiceTestUtilBase::ClearModel() {
@@ -238,9 +197,7 @@
 // TemplateURLServiceTestUtil -------------------------------------------------
 
 TemplateURLServiceTestUtil::TemplateURLServiceTestUtil()
-    : ui_thread_(BrowserThread::UI, &message_loop_),
-      db_thread_(BrowserThread::DB),
-      io_thread_(BrowserThread::IO) {
+    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
 }
 
 TemplateURLServiceTestUtil::~TemplateURLServiceTestUtil() {
@@ -250,7 +207,6 @@
   // Make unique temp directory.
   ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
   profile_.reset(new TestingProfile(temp_dir_.path()));
-  db_thread_.Start();
 
   TemplateURLServiceTestUtilBase::CreateTemplateUrlService();
 
@@ -260,49 +216,14 @@
 }
 
 void TemplateURLServiceTestUtil::TearDown() {
-  if (profile_.get()) {
-    // Clear the request context so it will get deleted. This should be done
-    // before shutting down the I/O thread to avoid memory leaks.
-    profile_->ResetRequestContext();
-    profile_.reset();
-  }
-
-  // Wait for the delete of the request context to happen.
-  if (io_thread_.IsRunning())
-    TemplateURLServiceTestUtilBase::BlockTillIOThreadProcessesRequests();
-
-  // The I/O thread must be shutdown before the DB thread.
-  io_thread_.Stop();
-
-  // Note that we must ensure the DB thread is stopped after WDS
-  // shutdown (so it can commit pending transactions) but before
-  // deleting the test profile directory, otherwise we may not be
-  // able to delete it due to an open transaction.
-  // Schedule another task on the DB thread to notify us that it's safe to
-  // carry on with the test.
-  base::WaitableEvent done(false, false);
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
-  base::MessageLoop::current()->PostTask(FROM_HERE,
-                                         base::MessageLoop::QuitClosure());
-  base::MessageLoop::current()->Run();
-  db_thread_.Stop();
+  profile_.reset();
 
   UIThreadSearchTermsData::SetGoogleBaseURL(std::string());
 
   // Flush the message loop to make application verifiers happy.
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 }
 
 TestingProfile* TemplateURLServiceTestUtil::profile() const {
   return profile_.get();
 }
-
-void TemplateURLServiceTestUtil::StartIOThread() {
-  io_thread_.StartIOThread();
-}
-
-void TemplateURLServiceTestUtil::PumpLoop() {
-  message_loop_.RunUntilIdle();
-}
diff --git a/chrome/browser/search_engines/template_url_service_test_util.h b/chrome/browser/search_engines/template_url_service_test_util.h
index 7ddd4fd..6c7c379 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.h
+++ b/chrome/browser/search_engines/template_url_service_test_util.h
@@ -15,7 +15,7 @@
 #include "base/strings/string16.h"
 #include "chrome/browser/search_engines/template_url_service_observer.h"
 #include "chrome/test/base/testing_browser_process.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 
 class GURL;
 class TemplateURLService;
@@ -42,14 +42,6 @@
   // Sets the observer count to 0.
   void ResetObserverCount();
 
-  // Blocks the caller until the service has finished servicing all pending
-  // requests.
-  static void BlockTillServiceProcessesRequests();
-
-  // Blocks the caller until the I/O thread has finished servicing all pending
-  // requests.
-  static void BlockTillIOThreadProcessesRequests();
-
   // Makes sure the load was successful and sent the correct notification.
   void VerifyLoad();
 
@@ -119,19 +111,10 @@
   // Returns the TestingProfile.
   virtual TestingProfile* profile() const OVERRIDE;
 
-  // Starts an I/O thread.
-  void StartIOThread();
-
-  // Runs all pending tasks on the UI loop.
-  void PumpLoop();
-
  private:
-  base::MessageLoopForUI message_loop_;
   // Needed to make the DeleteOnUIThread trait of WebDataService work
   // properly.
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestingProfile> profile_;
   base::ScopedTempDir temp_dir_;
 
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc
index b1e95de..a230386 100644
--- a/chrome/browser/search_engines/template_url_service_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -7,6 +7,7 @@
 #include "base/callback.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_vector.h"
+#include "base/run_loop.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -41,72 +42,6 @@
 
 namespace {
 
-// TestGenerateSearchURL ------------------------------------------------------
-
-// Test the GenerateSearchURL on a thread or the main thread.
-class TestGenerateSearchURL
-    : public base::RefCountedThreadSafe<TestGenerateSearchURL> {
- public:
-  explicit TestGenerateSearchURL(SearchTermsData* search_terms_data);
-
-  // Run the test cases for GenerateSearchURL.
-  void RunTest();
-
-  // Did the test pass?
-  bool passed() const { return passed_; }
-
- private:
-  friend class base::RefCountedThreadSafe<TestGenerateSearchURL>;
-  ~TestGenerateSearchURL();
-
-  SearchTermsData* search_terms_data_;
-  bool passed_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestGenerateSearchURL);
-};
-
-TestGenerateSearchURL::TestGenerateSearchURL(SearchTermsData* search_terms_data)
-    : search_terms_data_(search_terms_data),
-      passed_(false) {
-}
-
-void TestGenerateSearchURL::RunTest() {
-  struct GenerateSearchURLCase {
-    const char* test_name;
-    const char* url;
-    const char* expected;
-  } generate_url_cases[] = {
-    { "invalid URL", "foo{searchTerms}", "" },
-    { "URL with no replacements", "http://foo/", "http://foo/" },
-    { "basic functionality", "http://foo/{searchTerms}",
-      "http://foo/blah.blah.blah.blah.blah" }
-  };
-
-  // Don't use ASSERT/EXPECT since this is run on a thread in one test
-  // and those macros aren't meant for threads at this time according to
-  // gtest documentation.
-  bool everything_passed = true;
-  for (size_t i = 0; i < ARRAYSIZE_UNSAFE(generate_url_cases); ++i) {
-    TemplateURLData data;
-    data.SetURL(generate_url_cases[i].url);
-    TemplateURL t_url(NULL, data);
-    std::string result = (search_terms_data_ ?
-        TemplateURLService::GenerateSearchURLUsingTermsData(&t_url,
-            *search_terms_data_) :
-        TemplateURLService::GenerateSearchURL(&t_url)).spec();
-    if (result != generate_url_cases[i].expected) {
-      LOG(ERROR) << generate_url_cases[i].test_name << " failed. Expected " <<
-          generate_url_cases[i].expected << " Actual " << result;
-      everything_passed = false;
-    }
-  }
-  passed_ = everything_passed;
-}
-
-TestGenerateSearchURL::~TestGenerateSearchURL() {
-}
-
-
 // TestSearchTermsData --------------------------------------------------------
 
 // Simple implementation of SearchTermsData.
@@ -303,6 +238,36 @@
  protected:
   TemplateURLServiceTestUtil test_util_;
 
+  void TestGenerateSearchURL(SearchTermsData* search_terms_data) {
+    struct GenerateSearchURLCase {
+      const char* test_name;
+      const char* url;
+      const char* expected;
+    } generate_url_cases[] = {
+      { "invalid URL", "foo{searchTerms}", "" },
+      { "URL with no replacements", "http://foo/", "http://foo/" },
+      { "basic functionality", "http://foo/{searchTerms}",
+        "http://foo/blah.blah.blah.blah.blah" }
+    };
+
+    for (size_t i = 0; i < ARRAYSIZE_UNSAFE(generate_url_cases); ++i) {
+      TemplateURLData data;
+      data.SetURL(generate_url_cases[i].url);
+      TemplateURL t_url(NULL, data);
+      std::string result;
+      if (search_terms_data) {
+          result = TemplateURLService::GenerateSearchURLUsingTermsData(
+              &t_url, *search_terms_data).spec();
+      } else {
+          result = TemplateURLService::GenerateSearchURL(&t_url).spec();
+      }
+      EXPECT_EQ(result,  generate_url_cases[i].expected)
+          << generate_url_cases[i].test_name << " failed. Expected "
+          << generate_url_cases[i].expected << " Actual " << result;
+    }
+  }
+
+
   DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceTest);
 };
 
@@ -405,7 +370,7 @@
   ASSERT_TRUE(keyword_url != NULL);
   EXPECT_EQ(t_url, keyword_url);
   EXPECT_EQ(original_url, keyword_url->url_ref().DisplayURL());
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Now reload the model and verify that the merge updates the url, and
   // preserves the sync GUID.
@@ -416,7 +381,7 @@
   EXPECT_EQ(original_guid, keyword_url->sync_guid());
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reload the model to verify that change was saved correctly.
   test_util_.ResetModel(true);
@@ -462,7 +427,7 @@
   ASSERT_TRUE(model()->CanReplaceKeyword(ASCIIToUTF16("keyword"), GURL(),
                                          NULL));
   VerifyObserverCount(1);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   ASSERT_EQ(initial_count + 1, model()->GetTemplateURLs().size());
   ASSERT_EQ(t_url, model()->GetTemplateURLForKeyword(t_url->keyword()));
   // We need to make a second copy as the model takes ownership of |t_url| and
@@ -499,7 +464,7 @@
                                          NULL));
   ASSERT_FALSE(model()->CanReplaceKeyword(ASCIIToUTF16("b"), GURL(), NULL));
   cloned_url.reset(new TemplateURL(loaded_url->profile(), loaded_url->data()));
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   test_util_.ResetModel(true);
   ASSERT_EQ(initial_count + 1, model()->GetTemplateURLs().size());
   loaded_url = model()->GetTemplateURLForKeyword(ASCIIToUTF16("b"));
@@ -676,25 +641,14 @@
 }
 
 TEST_F(TemplateURLServiceTest, GenerateSearchURL) {
-  scoped_refptr<TestGenerateSearchURL> test_generate_search_url(
-      new TestGenerateSearchURL(NULL));
-  test_generate_search_url->RunTest();
-  EXPECT_TRUE(test_generate_search_url->passed());
+  TestGenerateSearchURL(NULL);
 }
 
 TEST_F(TemplateURLServiceTest, GenerateSearchURLUsingTermsData) {
   // Run the test for GenerateSearchURLUsingTermsData on the "IO" thread and
   // wait for it to finish.
   TestSearchTermsData search_terms_data("http://google.com/");
-  scoped_refptr<TestGenerateSearchURL> test_generate_search_url(
-      new TestGenerateSearchURL(&search_terms_data));
-
-  test_util_.StartIOThread();
-  BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)->PostTask(
-          FROM_HERE, base::Bind(&TestGenerateSearchURL::RunTest,
-                                test_generate_search_url.get()));
-  TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests();
-  EXPECT_TRUE(test_generate_search_url->passed());
+  TestGenerateSearchURL(&search_terms_data);
 }
 
 TEST_F(TemplateURLServiceTest, ClearBrowsingData_Keywords) {
@@ -826,7 +780,7 @@
   model()->Add(t_url);
 
   VerifyObserverCount(1);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   StrictMock<base::MockTimeProvider> mock_time;
   model()->set_time_provider(&base::MockTimeProvider::StaticNow);
@@ -874,7 +828,7 @@
 
   // Setting the default search provider should have caused notification.
   VerifyObserverCount(1);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   scoped_ptr<TemplateURL> cloned_url(new TemplateURL(t_url->profile(),
                                                      t_url->data()));
@@ -953,7 +907,7 @@
   const TemplateURLID id = t_url->id();
 
   model()->SetDefaultSearchProvider(t_url);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   scoped_ptr<TemplateURL> cloned_url(new TemplateURL(t_url->profile(),
                                                      t_url->data()));
 
@@ -1243,7 +1197,7 @@
   model()->Add(t_url);
   ASSERT_TRUE(
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest")) != NULL);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Ensure that merging clears this engine.
   test_util_.ResetModel(true);
@@ -1251,7 +1205,7 @@
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest")) == NULL);
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reload the model to verify that the database was updated as a result of the
   // merge.
@@ -1274,7 +1228,7 @@
   ASSERT_EQ(t_url, model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest")));
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Ensure that merging won't clear it if the user has edited it.
   test_util_.ResetModel(true);
@@ -1284,7 +1238,7 @@
   AssertEquals(*cloned_url, *url_for_unittest);
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reload the model to verify that save/reload retains the item.
   test_util_.ResetModel(true);
@@ -1304,7 +1258,7 @@
                                                      default_search->data()));
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reload the model and check that the default search provider
   // was properly saved.
@@ -1368,7 +1322,7 @@
 
   ASSERT_EQ(t_url, model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest")));
   ASSERT_EQ(t_url, model()->GetDefaultSearchProvider());
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Ensure that merging won't clear the prepopulated template url
   // which is no longer present if it's the default engine.
@@ -1382,7 +1336,7 @@
   }
 
   // Wait for any saves to finish.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reload the model to verify that the update was saved.
   test_util_.ResetModel(true);
@@ -1418,7 +1372,7 @@
   // Now remove it.
   model()->SetDefaultSearchProvider(NULL);
   model()->Remove(old_default);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_FALSE(model()->GetDefaultSearchProvider());
 
@@ -1432,7 +1386,7 @@
   model()->ResetTemplateURL(model()->GetDefaultSearchProvider(),
                             ASCIIToUTF16("test"), ASCIIToUTF16("test"),
                             "http://example.com/");
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   // Reset the model and load it. There should be a usable default search
   // provider.
@@ -1454,7 +1408,7 @@
 
   test_util_.ResetModel(false);
   model()->Load();
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 
   ASSERT_TRUE(model()->GetDefaultSearchProvider());
 }
@@ -1610,7 +1564,7 @@
   model()->Add(t_url);
 
   VerifyObserverCount(1);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   ASSERT_EQ(initial_count + 1, model()->GetTemplateURLs().size());
 
   // Reload the model to verify it was actually saved to the database and
@@ -1647,7 +1601,7 @@
   model()->Add(t_url);
 
   VerifyObserverCount(1);
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
   ASSERT_EQ(initial_count + 1, model()->GetTemplateURLs().size());
   const TemplateURL* loaded_url =
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword"));
diff --git a/chrome/browser/signin/oauth2_token_service_unittest.cc b/chrome/browser/signin/oauth2_token_service_unittest.cc
index 6859f37..ba68353 100644
--- a/chrome/browser/signin/oauth2_token_service_unittest.cc
+++ b/chrome/browser/signin/oauth2_token_service_unittest.cc
@@ -4,6 +4,7 @@
 
 #include <string>
 
+#include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/signin/oauth2_token_service.h"
@@ -11,6 +12,7 @@
 #include "chrome/browser/signin/token_service_factory.h"
 #include "chrome/browser/signin/token_service_unittest.h"
 #include "chrome/test/base/testing_browser_process.h"
+#include "content/public/browser/browser_thread.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "google_apis/gaia/oauth2_access_token_consumer.h"
@@ -70,19 +72,13 @@
  public:
   virtual void SetUp() OVERRIDE {
     TokenServiceTestHarness::SetUp();
-    io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO,
-                                                    &message_loop_));
     oauth2_service_.reset(
         new TestOAuth2TokenService(new net::TestURLRequestContextGetter(
-            message_loop_.message_loop_proxy())));
-  }
-
-  virtual void TearDown() OVERRIDE {
-    TokenServiceTestHarness::TearDown();
+            BrowserThread::GetMessageLoopProxyForThread(
+                BrowserThread::IO))));
   }
 
  protected:
-  scoped_ptr<content::TestBrowserThread> io_thread_;
   net::TestURLFetcherFactory factory_;
   scoped_ptr<TestOAuth2TokenService> oauth2_service_;
   TestingOAuth2TokenServiceConsumer consumer_;
@@ -91,7 +87,7 @@
 TEST_F(OAuth2TokenServiceTest, NoOAuth2RefreshToken) {
   scoped_ptr<OAuth2TokenService::Request> request(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(1, consumer_.number_of_errors_);
@@ -101,7 +97,7 @@
   oauth2_service_->set_refresh_token("refreshToken");
   scoped_ptr<OAuth2TokenService::Request> request(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
@@ -119,7 +115,7 @@
   oauth2_service_->set_refresh_token("refreshToken");
   scoped_ptr<OAuth2TokenService::Request> request(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
@@ -148,7 +144,7 @@
   // First request.
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       scopes1, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
@@ -165,7 +161,7 @@
   // without needing a network request.
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(scopes1_same, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // No new network fetcher.
   EXPECT_EQ(fetcher, factory_.GetFetcherByID(0));
@@ -176,7 +172,7 @@
   // Third request to a new set of scopes, should return another token.
   scoped_ptr<OAuth2TokenService::Request> request3(
       oauth2_service_->StartRequest(scopes2, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(2, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
   fetcher = factory_.GetFetcherByID(0);
@@ -195,7 +191,7 @@
   // First request.
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
@@ -210,7 +206,7 @@
   // Second request must try to access the network as the token has expired.
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(1, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
 
@@ -230,7 +226,7 @@
   // First request.
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
@@ -245,7 +241,7 @@
   // Second request must try to access the network as the token has expired.
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(1, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
 
@@ -264,7 +260,7 @@
 
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
@@ -284,7 +280,7 @@
 
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
   fetcher->set_response_code(net::HTTP_OK);
   fetcher->SetResponseString(GetValidTokenResponse("token", 3600));
@@ -305,10 +301,10 @@
 
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   request.reset();
 
@@ -325,7 +321,7 @@
   oauth2_service_->set_refresh_token("refreshToken");
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
   fetcher->set_response_code(net::HTTP_OK);
   fetcher->SetResponseString(GetValidTokenResponse("token", 3600));
@@ -337,7 +333,7 @@
   // The refresh token is no longer available; subsequent requests fail.
   oauth2_service_->set_refresh_token("");
   request = oauth2_service_->StartRequest(std::set<std::string>(), &consumer_);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(fetcher, factory_.GetFetcherByID(0));
   EXPECT_EQ(1, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(1, consumer_.number_of_errors_);
@@ -352,7 +348,7 @@
 
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       scopes, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   net::TestURLFetcher* fetcher1 = factory_.GetFetcherByID(0);
 
   // Note |request| is still pending when the refresh token changes.
@@ -363,7 +359,7 @@
   TestingOAuth2TokenServiceConsumer consumer2;
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(scopes, &consumer2));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   net::TestURLFetcher* fetcher2 = factory_.GetFetcherByID(0);
   fetcher2->set_response_code(net::HTTP_OK);
@@ -385,7 +381,7 @@
   oauth2_service_->set_refresh_token("refreshToken");
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
 
@@ -401,7 +397,7 @@
   RetryingTestingOAuth2TokenServiceConsumer consumer(oauth2_service_.get());
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       std::set<std::string>(), &consumer));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(0, consumer.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer.number_of_errors_);
 
@@ -429,7 +425,7 @@
   // First request.
   scoped_ptr<OAuth2TokenService::Request> request(
       oauth2_service_->StartRequest(scopes, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   EXPECT_EQ(0, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
@@ -446,7 +442,7 @@
   // request.
   scoped_ptr<OAuth2TokenService::Request> request2(
       oauth2_service_->StartRequest(scopes, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // No new network fetcher.
   EXPECT_EQ(fetcher, factory_.GetFetcherByID(0));
@@ -458,7 +454,7 @@
   oauth2_service_->InvalidateToken(scopes, consumer_.last_token_);
   scoped_ptr<OAuth2TokenService::Request> request3(
       oauth2_service_->StartRequest(scopes, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(2, consumer_.number_of_successful_tokens_);
   EXPECT_EQ(0, consumer_.number_of_errors_);
   fetcher = factory_.GetFetcherByID(0);
diff --git a/chrome/browser/signin/profile_oauth2_token_service_unittest.cc b/chrome/browser/signin/profile_oauth2_token_service_unittest.cc
index 8170bfe..0cbb571 100644
--- a/chrome/browser/signin/profile_oauth2_token_service_unittest.cc
+++ b/chrome/browser/signin/profile_oauth2_token_service_unittest.cc
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/run_loop.h"
 #include "chrome/browser/signin/oauth2_token_service.h"
 #include "chrome/browser/signin/oauth2_token_service_test_util.h"
 #include "chrome/browser/signin/profile_oauth2_token_service.h"
@@ -27,12 +28,9 @@
 
   virtual void SetUp() OVERRIDE {
     TokenServiceTestHarness::SetUp();
-    io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO,
-                                                    &message_loop_));
-    service_->UpdateCredentials(credentials_);
-    profile_->CreateRequestContext();
+    UpdateCredentialsOnService();
     oauth2_service_ = ProfileOAuth2TokenServiceFactory::GetForProfile(
-        profile_.get());
+        profile());
 
     oauth2_service_->AddObserver(this);
   }
@@ -106,7 +104,6 @@
   }
 
  protected:
-  scoped_ptr<content::TestBrowserThread> io_thread_;
   net::TestURLFetcherFactory factory_;
   ProfileOAuth2TokenService* oauth2_service_;
   TestingOAuth2TokenServiceConsumer consumer_;
@@ -118,12 +115,12 @@
 
 TEST_F(ProfileOAuth2TokenServiceTest, Notifications) {
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                  "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   ExpectOneTokenAvailableNotification();
 
-  service_->EraseTokensFromDB();
-  service_->ResetCredentialsInMemory();
+  service()->EraseTokensFromDB();
+  service()->ResetCredentialsInMemory();
   ExpectOneTokensClearedNotification();
 }
 
@@ -133,11 +130,11 @@
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
 
   // Get a valid token.
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                  "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   ExpectOneTokenAvailableNotification();
 
-  service_->OnIssueAuthTokenFailure(
+  service()->OnIssueAuthTokenFailure(
       GaiaConstants::kLSOService,
       GoogleServiceAuthError(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
   ExpectOneTokenRevokedNotification();
@@ -147,22 +144,22 @@
 // should translate to finish token loading in ProfileOAuth2TokenService.
 TEST_F(ProfileOAuth2TokenServiceTest, TokensLoaded) {
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
-  service_->LoadTokensFromDB();
-  WaitForDBLoadCompletion();
+  service()->LoadTokensFromDB();
+  base::RunLoop().RunUntilIdle();
   ExpectOneTokensLoadedNotification();
 }
 
 TEST_F(ProfileOAuth2TokenServiceTest, UnknownNotificationsAreNoops) {
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
-  service_->IssueAuthTokenForTest("foo", "toto");
+  service()->IssueAuthTokenForTest("foo", "toto");
   ExpectNoNotifications();
 
   // Get a valid token.
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                  "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   ExpectOneTokenAvailableNotification();
 
-  service_->IssueAuthTokenForTest("bar", "baz");
+  service()->IssueAuthTokenForTest("bar", "baz");
   ExpectNoNotifications();
 }
 
@@ -170,12 +167,12 @@
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
   std::set<std::string> scope_list;
   scope_list.insert("scope");
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                  "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   ExpectOneTokenAvailableNotification();
   scoped_ptr<OAuth2TokenService::Request> request(oauth2_service_->StartRequest(
       scope_list, &consumer_));
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
   fetcher->set_response_code(net::HTTP_OK);
   fetcher->SetResponseString(GetValidTokenResponse("token", 3600));
@@ -186,19 +183,19 @@
   EXPECT_EQ(1, oauth2_service_->cache_size_for_testing());
 
   // Signs out and signs in
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
                                   "");
   ExpectOneTokenAvailableNotification();
-  service_->EraseTokensFromDB();
+  service()->EraseTokensFromDB();
   ExpectOneTokensClearedNotification();
 
   EXPECT_EQ(0, oauth2_service_->cache_size_for_testing());
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
                                   "refreshToken");
   ExpectOneTokenAvailableNotification();
 
   request = oauth2_service_->StartRequest(scope_list, &consumer_);
-  message_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   fetcher = factory_.GetFetcherByID(0);
   fetcher->set_response_code(net::HTTP_OK);
   fetcher->SetResponseString(GetValidTokenResponse("another token", 3600));
@@ -212,19 +209,19 @@
 // Android doesn't use the current profile's TokenService login refresh token.
 #if !defined(OS_ANDROID)
 TEST_F(ProfileOAuth2TokenServiceTest, StaleRefreshTokensNotCached) {
-  EXPECT_FALSE(service_->HasOAuthLoginToken());
-  EXPECT_FALSE(oauth2_service_->ShouldCacheForRefreshToken(service_, "T1"));
+  EXPECT_FALSE(service()->HasOAuthLoginToken());
+  EXPECT_FALSE(oauth2_service_->ShouldCacheForRefreshToken(service(), "T1"));
 
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
                                   "T1");
   ExpectOneTokenAvailableNotification();
-  EXPECT_TRUE(oauth2_service_->ShouldCacheForRefreshToken(service_, "T1"));
-  EXPECT_FALSE(oauth2_service_->ShouldCacheForRefreshToken(service_, "T2"));
+  EXPECT_TRUE(oauth2_service_->ShouldCacheForRefreshToken(service(), "T1"));
+  EXPECT_FALSE(oauth2_service_->ShouldCacheForRefreshToken(service(), "T2"));
 
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
                                   "T2");
   ExpectOneTokenAvailableNotification();
-  EXPECT_TRUE(oauth2_service_->ShouldCacheForRefreshToken(service_, "T2"));
+  EXPECT_TRUE(oauth2_service_->ShouldCacheForRefreshToken(service(), "T2"));
   EXPECT_FALSE(oauth2_service_->ShouldCacheForRefreshToken(NULL, "T2"));
 }
 #endif
diff --git a/chrome/browser/signin/signin_browsertest.cc b/chrome/browser/signin/signin_browsertest.cc
index 14ee972..4cfde8d 100644
--- a/chrome/browser/signin/signin_browsertest.cc
+++ b/chrome/browser/signin/signin_browsertest.cc
@@ -17,9 +17,12 @@
 #include "chrome/common/url_constants.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_types.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_observer.h"
 #include "content/public/common/content_switches.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "net/url_request/test_url_fetcher_factory.h"
@@ -161,4 +164,72 @@
   EXPECT_FALSE(signin->HasSigninProcess());
 }
 
+class BackOnNTPCommitObserver : public content::WebContentsObserver {
+ public:
+  explicit BackOnNTPCommitObserver(content::WebContents* web_contents)
+      : content::WebContentsObserver(web_contents) {
+  }
+
+  virtual void DidCommitProvisionalLoadForFrame(
+      int64 frame_id,
+      bool is_main_frame,
+      const GURL& url,
+      content::PageTransition transition_type,
+      content::RenderViewHost* render_view_host) OVERRIDE {
+    if (url == GURL(chrome::kChromeUINewTabURL)) {
+      content::WindowedNotificationObserver observer(
+          content::NOTIFICATION_NAV_ENTRY_COMMITTED,
+          content::NotificationService::AllSources());
+      web_contents()->GetController().GoBack();
+      observer.Wait();
+    }
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(BackOnNTPCommitObserver);
+};
+
+// This is a test for http://crbug.com/257277. It simulates the navigations
+// that occur if the user clicks on the "Skip for now" link at the signin page
+// and initiates a back navigation between the point of Commit and
+// DidStopLoading of the NTP.
+IN_PROC_BROWSER_TEST_F(SigninBrowserTest, SigninSkipForNowAndGoBack) {
+  GURL ntp_url(chrome::kChromeUINewTabURL);
+  GURL start_url =
+      SyncPromoUI::GetSyncPromoURL(SyncPromoUI::SOURCE_START_PAGE, true);
+  GURL skip_url(SyncPromoUI::GetSyncLandingURL("ntp", 1));
+
+  SigninManager* signin = SigninManagerFactory::GetForProfile(
+      browser()->profile());
+  EXPECT_FALSE(signin->HasSigninProcess());
+
+  ui_test_utils::NavigateToURL(browser(), start_url);
+  EXPECT_EQ(kOneClickSigninEnabled, signin->HasSigninProcess());
+
+  content::WebContents* web_contents =
+      browser()->tab_strip_model()->GetActiveWebContents();
+
+  // Simulate clicking on the Skip for now link by navigating to the URL.
+  ui_test_utils::NavigateToURL(browser(), skip_url);
+
+  // Register an observer that will navigate back immediately on the commit of
+  // the NTP. This will allow us to hit the race condition of navigating back
+  // before the DidStopLoading message of NTP gets delivered. This must be
+  // created after the navigation to the skip_url has finished loading,
+  // otherwise this observer will navigate back, before the history cleaner
+  // has had a chance to remove the navigation entry.
+  BackOnNTPCommitObserver commit_observer(web_contents);
+
+  // Since the navigation to the blank URL is monitored for, the
+  // OneClickSigninHelper initiates immediately a navigation to the NTP.
+  // Thus, we expect the visible URL to be the NTP.
+  EXPECT_EQ(skip_url, web_contents->GetLastCommittedURL());
+  EXPECT_EQ(ntp_url, web_contents->GetVisibleURL());
+
+  content::WindowedNotificationObserver observer(
+      content::NOTIFICATION_LOAD_STOP,
+      content::NotificationService::AllSources());
+  observer.Wait();
+  EXPECT_EQ(start_url, web_contents->GetLastCommittedURL());
+}
 #endif  // CHROME_BROWSER_SIGNIN_SIGNIN_BROWSERTEST_H_
diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc
index 232d9c5..f008430 100644
--- a/chrome/browser/signin/signin_manager_unittest.cc
+++ b/chrome/browser/signin/signin_manager_unittest.cc
@@ -9,6 +9,7 @@
 #include "base/compiler_specific.h"
 #include "base/prefs/pref_service.h"
 #include "base/prefs/testing_pref_service.h"
+#include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
@@ -22,7 +23,7 @@
 #include "chrome/test/base/testing_profile.h"
 #include "components/webdata/encryptor/encryptor.h"
 #include "content/public/browser/child_process_security_policy.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "net/cookies/cookie_monster.h"
@@ -34,8 +35,6 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 namespace {
 
 const char kGetTokenPairValidResponse[] =
@@ -53,18 +52,6 @@
 
 class SigninManagerTest : public TokenServiceTestHarness {
  public:
-  void SetUpOnIOThread(base::WaitableEvent* io_setup_complete) {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-    // This is a workaround for a bug in the TestingProfile.
-    // The URLRequestContext will be created by GetCookieMonster on the UI
-    // thread, if it does not already exist. But it must be created on the IO
-    // thread or else it will DCHECK upon destruction.
-    // Force it to be created here.
-    profile_->CreateRequestContext();
-    profile_->GetRequestContext()->GetURLRequestContext();
-    io_setup_complete->Signal();
-  }
-
   virtual void SetUp() OVERRIDE {
     prefs_.reset(new TestingPrefServiceSimple);
     chrome::RegisterLocalState(prefs_->registry());
@@ -73,32 +60,22 @@
     TokenServiceTestHarness::SetUp();
     manager_.reset(new SigninManager(
         scoped_ptr<SigninManagerDelegate>(
-            new ChromeSigninManagerDelegate(profile_.get()))));
+            new ChromeSigninManagerDelegate(profile()))));
     google_login_success_.ListenFor(
         chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
-        content::Source<Profile>(profile_.get()));
+        content::Source<Profile>(profile()));
     google_login_failure_.ListenFor(chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
-                                    content::Source<Profile>(profile_.get()));
-
-    io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO));
-    ASSERT_TRUE(io_thread_->Start());
-    base::WaitableEvent io_setup_complete(true, false);
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&SigninManagerTest::SetUpOnIOThread,
-                   base::Unretained(this), &io_setup_complete));
-    io_setup_complete.Wait();
+                                    content::Source<Profile>(profile()));
   }
 
   virtual void TearDown() OVERRIDE {
-    // Destroy the SigninManager here, because it relies on profile_ which is
+    // Destroy the SigninManager here, because it relies on profile() which is
     // freed in the base class.
     manager_->Shutdown();
     manager_.reset(NULL);
     TestingBrowserProcess::GetGlobal()->SetLocalState(NULL);
     prefs_.reset(NULL);
     TokenServiceTestHarness::TearDown();
-    io_thread_->Stop();
   }
 
   void SetupFetcherAndComplete(const std::string& url,
@@ -170,26 +147,6 @@
                             cookies, "<html></html>");
   }
 
-  void WaitUntilUIDone() {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-    BrowserThread::PostTask(
-        BrowserThread::IO, FROM_HERE,
-        base::Bind(&SigninManagerTest::NotifyUIOnComplete,
-                   base::Unretained(this)));
-    base::MessageLoop::current()->Run();
-  }
-
-  void NotifyUIOnComplete () {
-    if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
-      // Redo on UI thread.
-      BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
-          base::Bind(&SigninManagerTest::NotifyUIOnComplete,
-                     base::Unretained(this)));
-      return;
-    }
-    base::MessageLoop::current()->Quit();
-  }
-
   void ExpectSignInWithCredentialsSuccess() {
     EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
@@ -199,7 +156,7 @@
 
     // This is flow, the oauth2 credentials should already be available in
     // the token service.
-    EXPECT_TRUE(service_->HasOAuthLoginToken());
+    EXPECT_TRUE(service()->HasOAuthLoginToken());
 
     // Should go into token service and stop.
     EXPECT_EQ(1U, google_login_success_.size());
@@ -209,8 +166,8 @@
     manager_->Shutdown();
     manager_.reset(new SigninManager(
         scoped_ptr<SigninManagerDelegate>(
-            new ChromeSigninManagerDelegate(profile_.get()))));
-    manager_->Initialize(profile_.get(), NULL);
+            new ChromeSigninManagerDelegate(profile()))));
+    manager_->Initialize(profile(), NULL);
     EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername());
   }
 
@@ -226,7 +183,7 @@
 
     // The oauth2 credentials should not be available in the token service
     // because the email was incorrect.
-    EXPECT_FALSE(service_->HasOAuthLoginToken());
+    EXPECT_FALSE(service()->HasOAuthLoginToken());
 
     // Should go into token service and stop.
     EXPECT_EQ(0U, google_login_success_.size());
@@ -249,14 +206,13 @@
   content::TestNotificationTracker google_login_failure_;
   std::vector<std::string> oauth_tokens_fetched_;
   scoped_ptr<TestingPrefServiceSimple> prefs_;
-  scoped_ptr<content::TestBrowserThread> io_thread_;
   std::vector<std::string> cookies_;
 };
 
 // NOTE: ClientLogin's "StartSignin" is called after collecting credentials
 //       from the user.
 TEST_F(SigninManagerTest, SignInClientLogin) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->StartSignIn(
@@ -270,8 +226,9 @@
   EXPECT_EQ(1U, google_login_success_.size());
   EXPECT_EQ(0U, google_login_failure_.size());
 
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                    "oauth2Token");
+  service()->OnIssueAuthTokenSuccess(
+      GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+      "oauth2Token");
   SimulateValidUberToken();
   // Check that the login cookie has been sent.
   ASSERT_NE(std::find(cookies_.begin(), cookies_.end(), "checkCookie = true"),
@@ -281,13 +238,13 @@
   manager_->Shutdown();
   manager_.reset(new SigninManager(
       scoped_ptr<SigninManagerDelegate>(
-          new ChromeSigninManagerDelegate(profile_.get()))));
-  manager_->Initialize(profile_.get(), NULL);
+          new ChromeSigninManagerDelegate(profile()))));
+  manager_->Initialize(profile(), NULL);
   EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername());
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentials) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->StartSignInWithCredentials(
@@ -300,7 +257,7 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsNonCanonicalEmail) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->StartSignInWithCredentials(
@@ -313,7 +270,7 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsWrongEmail) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // If the email address used to start the sign in does not match the
@@ -328,12 +285,12 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordValidCookie) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // Set a valid LSID cookie in the test cookie store.
   scoped_refptr<net::CookieMonster> cookie_monster =
-      profile_->GetCookieMonster();
+      profile()->GetCookieMonster();
   net::CookieOptions options;
   options.set_include_httponly();
   cookie_monster->SetCookieWithOptionsAsync(
@@ -348,14 +305,14 @@
       std::string(),
       SigninManager::OAuthTokenFetchedCallback());
 
-  WaitUntilUIDone();
+  base::RunLoop().RunUntilIdle();
 
   // Verification should succeed and continue with auto signin.
   ExpectSignInWithCredentialsSuccess();
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordNoValidCookie) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // Since the password is empty, will verify the gaia cookies first.
@@ -365,7 +322,7 @@
       std::string(),
       SigninManager::OAuthTokenFetchedCallback());
 
-  WaitUntilUIDone();
+  base::RunLoop().RunUntilIdle();
 
   // Since the test cookie store is empty, verification should fail and throws
   // a login error.
@@ -373,12 +330,12 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordInValidCookie) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // Set an invalid LSID cookie in the test cookie store.
   scoped_refptr<net::CookieMonster> cookie_monster =
-      profile_->GetCookieMonster();
+      profile()->GetCookieMonster();
   net::CookieOptions options;
   options.set_include_httponly();
   cookie_monster->SetCookieWithOptionsAsync(
@@ -393,7 +350,7 @@
       std::string(),
       SigninManager::OAuthTokenFetchedCallback());
 
-  WaitUntilUIDone();
+  base::RunLoop().RunUntilIdle();
 
   // Since the LSID cookie is invalid, verification should fail and throws
   // a login error.
@@ -401,7 +358,7 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsCallbackComplete) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // Since the password is empty, must verify the gaia cookies first.
@@ -420,7 +377,7 @@
 }
 
 TEST_F(SigninManagerTest, SignInWithCredentialsCallbackCancel) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   // Since the password is empty, must verify the gaia cookies first.
@@ -440,7 +397,7 @@
 }
 
 TEST_F(SigninManagerTest, SignInClientLoginNoGPlus) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->StartSignIn("username", "password", std::string(), std::string());
@@ -451,7 +408,7 @@
 }
 
 TEST_F(SigninManagerTest, ClearTransientSigninData) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->StartSignIn("username", "password", std::string(), std::string());
@@ -472,24 +429,24 @@
 
   // Ensure preferences are not modified.
   EXPECT_FALSE(
-     profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername).empty());
+     profile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername).empty());
 
   // On reset it should be regenerated.
   manager_->Shutdown();
   manager_.reset(new SigninManager(
       scoped_ptr<SigninManagerDelegate>(
-          new ChromeSigninManagerDelegate(profile_.get()))));
-  manager_->Initialize(profile_.get(), NULL);
+          new ChromeSigninManagerDelegate(profile()))));
+  manager_->Initialize(profile(), NULL);
 
   // Now make sure we have the right user name.
   EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername());
 }
 
 TEST_F(SigninManagerTest, SignOutClientLogin) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   manager_->StartSignIn("username", "password", std::string(), std::string());
   SimulateValidResponseClientLogin(false);
-  manager_->OnClientLoginSuccess(credentials_);
+  manager_->OnClientLoginSuccess(credentials());
 
   EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername());
   manager_->SignOut();
@@ -498,13 +455,13 @@
   manager_->Shutdown();
   manager_.reset(new SigninManager(
       scoped_ptr<SigninManagerDelegate>(
-          new ChromeSigninManagerDelegate(profile_.get()))));
-  manager_->Initialize(profile_.get(), NULL);
+          new ChromeSigninManagerDelegate(profile()))));
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 }
 
 TEST_F(SigninManagerTest, SignInFailureClientLogin) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   manager_->StartSignIn("username", "password", std::string(), std::string());
   GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
   manager_->OnClientLoginFailure(error);
@@ -518,13 +475,13 @@
   manager_->Shutdown();
   manager_.reset(new SigninManager(
       scoped_ptr<SigninManagerDelegate>(
-          new ChromeSigninManagerDelegate(profile_.get()))));
-  manager_->Initialize(profile_.get(), NULL);
+          new ChromeSigninManagerDelegate(profile()))));
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 }
 
 TEST_F(SigninManagerTest, ProvideSecondFactorSuccess) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   manager_->StartSignIn("username", "password", std::string(), std::string());
   GoogleServiceAuthError error(GoogleServiceAuthError::TWO_FACTOR);
   manager_->OnClientLoginFailure(error);
@@ -543,7 +500,7 @@
 }
 
 TEST_F(SigninManagerTest, ProvideSecondFactorFailure) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   manager_->StartSignIn("username", "password", std::string(), std::string());
   GoogleServiceAuthError error1(GoogleServiceAuthError::TWO_FACTOR);
   manager_->OnClientLoginFailure(error1);
@@ -573,7 +530,7 @@
 }
 
 TEST_F(SigninManagerTest, SignOutMidConnect) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   manager_->StartSignIn("username", "password", std::string(), std::string());
   EXPECT_EQ("username", manager_->GetUsernameForAuthInProgress());
   manager_->SignOut();
@@ -585,7 +542,7 @@
 }
 
 TEST_F(SigninManagerTest, SignOutWhileProhibited) {
-  manager_->Initialize(profile_.get(), NULL);
+  manager_->Initialize(profile(), NULL);
   EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
 
   manager_->SetAuthenticatedUsername("user@gmail.com");
@@ -617,7 +574,7 @@
 TEST_F(SigninManagerTest, Prohibited) {
   g_browser_process->local_state()->SetString(
       prefs::kGoogleServicesUsernamePattern, ".*@google.com");
-  manager_->Initialize(profile_.get(), g_browser_process->local_state());
+  manager_->Initialize(profile(), g_browser_process->local_state());
   EXPECT_TRUE(manager_->IsAllowedUsername("test@google.com"));
   EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com"));
   EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com"));
@@ -630,7 +587,7 @@
   // the admin entered ".*@google.com").
   g_browser_process->local_state()->SetString(
       prefs::kGoogleServicesUsernamePattern, "*@google.com");
-  manager_->Initialize(profile_.get(), g_browser_process->local_state());
+  manager_->Initialize(profile(), g_browser_process->local_state());
   EXPECT_TRUE(manager_->IsAllowedUsername("test@google.com"));
   EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com"));
   EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com"));
@@ -639,19 +596,19 @@
 }
 
 TEST_F(SigninManagerTest, ProhibitedAtStartup) {
-  profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
-                                  "monkey@invalid.com");
+  profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
+                                   "monkey@invalid.com");
   g_browser_process->local_state()->SetString(
       prefs::kGoogleServicesUsernamePattern, ".*@google.com");
-  manager_->Initialize(profile_.get(), g_browser_process->local_state());
+  manager_->Initialize(profile(), g_browser_process->local_state());
   // Currently signed in user is prohibited by policy, so should be signed out.
   EXPECT_EQ("", manager_->GetAuthenticatedUsername());
 }
 
 TEST_F(SigninManagerTest, ProhibitedAfterStartup) {
   std::string user("monkey@invalid.com");
-  profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, user);
-  manager_->Initialize(profile_.get(), g_browser_process->local_state());
+  profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, user);
+  manager_->Initialize(profile(), g_browser_process->local_state());
   EXPECT_EQ(user, manager_->GetAuthenticatedUsername());
   // Update the profile - user should be signed out.
   g_browser_process->local_state()->SetString(
@@ -660,9 +617,9 @@
 }
 
 TEST_F(SigninManagerTest, ExternalSignIn) {
-  manager_->Initialize(profile_.get(), g_browser_process->local_state());
+  manager_->Initialize(profile(), g_browser_process->local_state());
   EXPECT_EQ("",
-            profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
+            profile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
   EXPECT_EQ("", manager_->GetAuthenticatedUsername());
   EXPECT_EQ(0u, google_login_success_.size());
 
@@ -670,6 +627,6 @@
   EXPECT_EQ(1u, google_login_success_.size());
   EXPECT_EQ(0u, google_login_failure_.size());
   EXPECT_EQ("external@example.com",
-            profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
+            profile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
   EXPECT_EQ("external@example.com", manager_->GetAuthenticatedUsername());
 }
diff --git a/chrome/browser/signin/token_service_unittest.cc b/chrome/browser/signin/token_service_unittest.cc
index 50dc429..0617ae5 100644
--- a/chrome/browser/signin/token_service_unittest.cc
+++ b/chrome/browser/signin/token_service_unittest.cc
@@ -9,8 +9,7 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/command_line.h"
-#include "base/message_loop/message_loop.h"
-#include "base/synchronization/waitable_event.h"
+#include "base/run_loop.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/signin/token_service_factory.h"
 #include "chrome/browser/webdata/token_web_data.h"
@@ -20,8 +19,6 @@
 #include "google_apis/gaia/mock_url_fetcher_factory.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 
-using content::BrowserThread;
-
 TokenAvailableTracker::TokenAvailableTracker() {}
 
 TokenAvailableTracker::~TokenAvailableTracker() {}
@@ -52,10 +49,7 @@
   }
 }
 
-TokenServiceTestHarness::TokenServiceTestHarness()
-    : ui_thread_(BrowserThread::UI, &message_loop_),
-      db_thread_(BrowserThread::DB) {
-}
+TokenServiceTestHarness::TokenServiceTestHarness() {}
 
 TokenServiceTestHarness::~TokenServiceTestHarness() {}
 
@@ -70,12 +64,13 @@
   oauth_token_ = "oauth";
   oauth_secret_ = "secret";
 
-  ASSERT_TRUE(db_thread_.Start());
-
   profile_.reset(new TestingProfile());
   profile_->CreateWebDataService();
 
-  WaitForDBLoadCompletion();
+  // Force the loading of the WebDataService.
+  TokenWebData::FromBrowserContext(profile_.get());
+  base::RunLoop().RunUntilIdle();
+
   service_ = TokenServiceFactory::GetForProfile(profile_.get());
 
   success_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_AVAILABLE,
@@ -83,103 +78,78 @@
   failure_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
                              content::Source<TokenService>(service_));
 
-  service_->Initialize("test", profile_.get());
+  service()->Initialize("test", profile_.get());
 }
 
 void TokenServiceTestHarness::TearDown() {
-  // You have to destroy the profile before the db_thread_ stops.
-  if (profile_.get()) {
-    profile_.reset(NULL);
-  }
-  // Schedule another task on the DB thread to notify us that it's safe to
-  // carry on with the test.
-  base::WaitableEvent done(false, false);
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
-  base::MessageLoop::current()->PostTask(FROM_HERE,
-                                         base::MessageLoop::QuitClosure());
-  base::MessageLoop::current()->Run();
-  db_thread_.Stop();
+  // You have to destroy the profile before the threads are shut down.
+  profile_.reset();
 }
 
-void TokenServiceTestHarness::WaitForDBLoadCompletion() {
-  // Force the loading of the WebDataService.
-  TokenWebData::FromBrowserContext(profile_.get());
-
-  // The WebDB does all work on the DB thread. This will add an event
-  // to the end of the DB thread, so when we reach this task, all DB
-  // operations should be complete.
-  base::WaitableEvent done(false, false);
-  BrowserThread::PostTask(
-      BrowserThread::DB,
-      FROM_HERE,
-      base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
-
-  // Notifications should be returned from the DB thread onto the UI thread.
-  message_loop_.RunUntilIdle();
+void TokenServiceTestHarness::UpdateCredentialsOnService() {
+  service()->UpdateCredentials(credentials_);
 }
 
 class TokenServiceTest : public TokenServiceTestHarness {
  public:
   virtual void SetUp() {
     TokenServiceTestHarness::SetUp();
-    service_->UpdateCredentials(credentials_);
+    UpdateCredentialsOnService();
   }
  protected:
   void TestLoadSingleToken(
       std::map<std::string, std::string>* db_tokens,
       std::map<std::string, std::string>* memory_tokens,
-      const std::string& service) {
-    std::string token = service + "_token";
-    (*db_tokens)[service] = token;
-    size_t prev_success_size = success_tracker_.size();
-    service_->LoadTokensIntoMemory(*db_tokens, memory_tokens);
+      const std::string& service_name) {
+    std::string token = service_name + "_token";
+    (*db_tokens)[service_name] = token;
+    size_t prev_success_size = success_tracker()->size();
+    service()->LoadTokensIntoMemory(*db_tokens, memory_tokens);
 
     // Check notification.
-    EXPECT_EQ(prev_success_size + 1, success_tracker_.size());
-    TokenService::TokenAvailableDetails details = success_tracker_.details();
-    EXPECT_EQ(details.service(), service);
+    EXPECT_EQ(prev_success_size + 1, success_tracker()->size());
+    TokenService::TokenAvailableDetails details = success_tracker()->details();
+    EXPECT_EQ(details.service(), service_name);
     EXPECT_EQ(details.token(), token);
     // Check memory tokens.
-    EXPECT_EQ(1U, memory_tokens->count(service));
-    EXPECT_EQ((*memory_tokens)[service], token);
+    EXPECT_EQ(1U, memory_tokens->count(service_name));
+    EXPECT_EQ((*memory_tokens)[service_name], token);
   }
 };
 
 TEST_F(TokenServiceTest, SanityCheck) {
-  EXPECT_FALSE(service_->HasTokenForService("nonexistent service"));
-  EXPECT_FALSE(service_->TokensLoadedFromDB());
+  EXPECT_FALSE(service()->HasTokenForService("nonexistent service"));
+  EXPECT_FALSE(service()->TokensLoadedFromDB());
 }
 
 TEST_F(TokenServiceTest, NoToken) {
-  EXPECT_FALSE(service_->HasTokenForService("nonexistent service"));
-  EXPECT_EQ(service_->GetTokenForService("nonexistent service"), std::string());
+  EXPECT_FALSE(service()->HasTokenForService("nonexistent service"));
+  EXPECT_EQ(service()->GetTokenForService("nonexistent service"),
+            std::string());
 }
 
 TEST_F(TokenServiceTest, NotificationSuccess) {
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
-  EXPECT_EQ(1U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  EXPECT_EQ(1U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
 
-  TokenService::TokenAvailableDetails details = success_tracker_.details();
+  TokenService::TokenAvailableDetails details = success_tracker()->details();
   // MSVC doesn't like this comparison as EQ.
   EXPECT_TRUE(details.service() == GaiaConstants::kSyncService);
   EXPECT_EQ(details.token(), "token");
 }
 
 TEST_F(TokenServiceTest, NotificationOAuthLoginTokenSuccess) {
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
-  service_->OnClientOAuthSuccess(
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
+  service()->OnClientOAuthSuccess(
       GaiaAuthConsumer::ClientOAuthResult("rt1", "at1", 3600));
-  EXPECT_EQ(1U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
+  EXPECT_EQ(1U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
 
-  TokenService::TokenAvailableDetails details = success_tracker_.details();
+  TokenService::TokenAvailableDetails details = success_tracker()->details();
   // MSVC doesn't like this comparison as EQ.
   EXPECT_TRUE(details.service() ==
       GaiaConstants::kGaiaOAuth2LoginRefreshToken);
@@ -187,28 +157,30 @@
 }
 
 TEST_F(TokenServiceTest, NotificationFailed) {
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
   GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
-  service_->OnIssueAuthTokenFailure(GaiaConstants::kSyncService, error);
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(1U, failure_tracker_.size());
+  service()->OnIssueAuthTokenFailure(GaiaConstants::kSyncService, error);
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(1U, failure_tracker()->size());
 
-  TokenService::TokenRequestFailedDetails details = failure_tracker_.details();
+  TokenService::TokenRequestFailedDetails details =
+      failure_tracker()->details();
   // MSVC doesn't like this comparison as EQ.
   EXPECT_TRUE(details.service() == GaiaConstants::kSyncService);
   EXPECT_TRUE(details.error() == error);  // Struct has no print function.
 }
 
 TEST_F(TokenServiceTest, NotificationOAuthLoginTokenFailed) {
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(0U, failure_tracker_.size());
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(0U, failure_tracker()->size());
   GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
-  service_->OnClientOAuthFailure(error);
-  EXPECT_EQ(0U, success_tracker_.size());
-  EXPECT_EQ(1U, failure_tracker_.size());
+  service()->OnClientOAuthFailure(error);
+  EXPECT_EQ(0U, success_tracker()->size());
+  EXPECT_EQ(1U, failure_tracker()->size());
 
-  TokenService::TokenRequestFailedDetails details = failure_tracker_.details();
+  TokenService::TokenRequestFailedDetails details =
+      failure_tracker()->details();
 
   // MSVC doesn't like this comparison as EQ.
   EXPECT_TRUE(details.service() ==
@@ -217,69 +189,73 @@
 }
 
 TEST_F(TokenServiceTest, OnTokenSuccessUpdate) {
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "token");
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService),
+            "token");
 
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token2");
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService),
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token2");
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService),
             "token2");
 
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, std::string());
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "");
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService,
+                                     std::string());
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService), "");
 }
 
 TEST_F(TokenServiceTest, OnOAuth2LoginTokenSuccessUpdate) {
-  EXPECT_FALSE(service_->HasOAuthLoginToken());
+  EXPECT_FALSE(service()->HasOAuthLoginToken());
 
-  service_->OnClientOAuthSuccess(
+  service()->OnClientOAuthSuccess(
       GaiaAuthConsumer::ClientOAuthResult("rt1", "at1", 3600));
-  EXPECT_TRUE(service_->HasOAuthLoginToken());
-  EXPECT_EQ(service_->GetOAuth2LoginRefreshToken(), "rt1");
+  EXPECT_TRUE(service()->HasOAuthLoginToken());
+  EXPECT_EQ(service()->GetOAuth2LoginRefreshToken(), "rt1");
 
-  service_->OnClientOAuthSuccess(
+  service()->OnClientOAuthSuccess(
       GaiaAuthConsumer::ClientOAuthResult("rt2", "at2", 3600));
-  EXPECT_TRUE(service_->HasOAuthLoginToken());
-  EXPECT_EQ(service_->GetOAuth2LoginRefreshToken(), "rt2");
+  EXPECT_TRUE(service()->HasOAuthLoginToken());
+  EXPECT_EQ(service()->GetOAuth2LoginRefreshToken(), "rt2");
 
-  service_->OnClientOAuthSuccess(
+  service()->OnClientOAuthSuccess(
       GaiaAuthConsumer::ClientOAuthResult("rt3", "at3", 3600));
-  EXPECT_TRUE(service_->HasOAuthLoginToken());
-  EXPECT_EQ(service_->GetOAuth2LoginRefreshToken(), "rt3");
+  EXPECT_TRUE(service()->HasOAuthLoginToken());
+  EXPECT_EQ(service()->GetOAuth2LoginRefreshToken(), "rt3");
 }
 
 TEST_F(TokenServiceTest, OnTokenSuccess) {
   // Don't "start fetching", just go ahead and issue the callback.
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
   // Gaia returns the entire result as the token so while this is a shared
   // result with ClientLogin, it doesn't matter, we should still get it back.
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "token");
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService),
+            "token");
 }
 
 TEST_F(TokenServiceTest, Reset) {
   net::TestURLFetcherFactory factory;
-  service_->StartFetchingTokens();
+  service()->StartFetchingTokens();
   // You have to call delegates by hand with the test fetcher,
   // Let's pretend only one returned.
 
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "eraseme");
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService),
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "eraseme");
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService),
             "eraseme");
 
-  service_->ResetCredentialsInMemory();
-  EXPECT_FALSE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  service()->ResetCredentialsInMemory();
+  EXPECT_FALSE(service()->HasTokenForService(GaiaConstants::kSyncService));
 
   // Now start using it again.
-  service_->UpdateCredentials(credentials_);
-  service_->StartFetchingTokens();
+  UpdateCredentialsOnService();
+  service()->StartFetchingTokens();
 
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
 
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "token");
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService),
+            "token");
 }
 
 TEST_F(TokenServiceTest, FullIntegration) {
@@ -288,17 +264,17 @@
   {
     MockURLFetcherFactory<MockFetcher> factory;
     factory.set_results(result);
-    EXPECT_FALSE(service_->HasTokenForService(GaiaConstants::kSyncService));
-    service_->StartFetchingTokens();
+    EXPECT_FALSE(service()->HasTokenForService(GaiaConstants::kSyncService));
+    service()->StartFetchingTokens();
   }
 
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
   // Gaia returns the entire result as the token so while this is a shared
   // result with ClientLogin, it doesn't matter, we should still get it back.
-  EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), result);
+  EXPECT_EQ(service()->GetTokenForService(GaiaConstants::kSyncService), result);
 
-  service_->ResetCredentialsInMemory();
-  EXPECT_FALSE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  service()->ResetCredentialsInMemory();
+  EXPECT_FALSE(service()->HasTokenForService(GaiaConstants::kSyncService));
 }
 
 TEST_F(TokenServiceTest, LoadTokensIntoMemoryBasic) {
@@ -306,11 +282,11 @@
   std::map<std::string, std::string> db_tokens;
   std::map<std::string, std::string> memory_tokens;
 
-  EXPECT_FALSE(service_->TokensLoadedFromDB());
-  service_->LoadTokensIntoMemory(db_tokens, &memory_tokens);
+  EXPECT_FALSE(service()->TokensLoadedFromDB());
+  service()->LoadTokensIntoMemory(db_tokens, &memory_tokens);
   EXPECT_TRUE(db_tokens.empty());
   EXPECT_TRUE(memory_tokens.empty());
-  EXPECT_EQ(0U, success_tracker_.size());
+  EXPECT_EQ(0U, success_tracker()->size());
 
   std::vector<std::string> services;
   TokenService::GetServiceNames(&services);
@@ -331,80 +307,80 @@
 
   db_tokens["ignore"] = "token";
 
-  service_->LoadTokensIntoMemory(db_tokens, &memory_tokens);
+  service()->LoadTokensIntoMemory(db_tokens, &memory_tokens);
   EXPECT_TRUE(memory_tokens.empty());
   db_tokens[GaiaConstants::kSyncService] = "pepper";
 
-  service_->LoadTokensIntoMemory(db_tokens, &memory_tokens);
+  service()->LoadTokensIntoMemory(db_tokens, &memory_tokens);
   EXPECT_EQ(1U, memory_tokens.count(GaiaConstants::kSyncService));
   EXPECT_EQ(memory_tokens[GaiaConstants::kSyncService], "pepper");
-  EXPECT_EQ(1U, success_tracker_.size());
-  success_tracker_.Reset();
+  EXPECT_EQ(1U, success_tracker()->size());
+  success_tracker()->Reset();
 
   // SyncService token is already in memory. Pretend we got it off
   // the disk as well, but an older token.
   db_tokens[GaiaConstants::kSyncService] = "ignoreme";
-  service_->LoadTokensIntoMemory(db_tokens, &memory_tokens);
+  service()->LoadTokensIntoMemory(db_tokens, &memory_tokens);
 
   EXPECT_EQ(1U, memory_tokens.size());
-  EXPECT_EQ(0U, success_tracker_.size());
+  EXPECT_EQ(0U, success_tracker()->size());
   EXPECT_EQ(1U, memory_tokens.count(GaiaConstants::kSyncService));
   EXPECT_EQ(memory_tokens[GaiaConstants::kSyncService], "pepper");
 }
 
 TEST_F(TokenServiceTest, WebDBLoadIntegration) {
-  service_->LoadTokensFromDB();
-  WaitForDBLoadCompletion();
-  EXPECT_TRUE(service_->TokensLoadedFromDB());
-  EXPECT_EQ(0U, success_tracker_.size());
+  service()->LoadTokensFromDB();
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(service()->TokensLoadedFromDB());
+  EXPECT_EQ(0U, success_tracker()->size());
 
   // Should result in DB write.
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
-  EXPECT_EQ(1U, success_tracker_.size());
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  EXPECT_EQ(1U, success_tracker()->size());
 
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
   // Clean slate.
-  service_->ResetCredentialsInMemory();
-  success_tracker_.Reset();
-  EXPECT_FALSE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  service()->ResetCredentialsInMemory();
+  success_tracker()->Reset();
+  EXPECT_FALSE(service()->HasTokenForService(GaiaConstants::kSyncService));
 
-  service_->LoadTokensFromDB();
-  WaitForDBLoadCompletion();
+  service()->LoadTokensFromDB();
+  base::RunLoop().RunUntilIdle();
 
-  EXPECT_EQ(1U, success_tracker_.size());
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(1U, success_tracker()->size());
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
 }
 
 TEST_F(TokenServiceTest, MultipleLoadResetIntegration) {
   // Should result in DB write.
-  service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
-  service_->ResetCredentialsInMemory();
-  success_tracker_.Reset();
-  EXPECT_FALSE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  service()->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, "token");
+  service()->ResetCredentialsInMemory();
+  success_tracker()->Reset();
+  EXPECT_FALSE(service()->HasTokenForService(GaiaConstants::kSyncService));
 
-  EXPECT_FALSE(service_->TokensLoadedFromDB());
-  service_->LoadTokensFromDB();
-  WaitForDBLoadCompletion();
-  EXPECT_TRUE(service_->TokensLoadedFromDB());
+  EXPECT_FALSE(service()->TokensLoadedFromDB());
+  service()->LoadTokensFromDB();
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(service()->TokensLoadedFromDB());
 
-  service_->LoadTokensFromDB();  // Should do nothing.
-  WaitForDBLoadCompletion();
-  EXPECT_TRUE(service_->TokensLoadedFromDB());
+  service()->LoadTokensFromDB();  // Should do nothing.
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(service()->TokensLoadedFromDB());
 
-  EXPECT_EQ(1U, success_tracker_.size());
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(1U, success_tracker()->size());
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
 
   // Reset it one more time so there's no surprises.
-  service_->ResetCredentialsInMemory();
-  EXPECT_FALSE(service_->TokensLoadedFromDB());
-  success_tracker_.Reset();
+  service()->ResetCredentialsInMemory();
+  EXPECT_FALSE(service()->TokensLoadedFromDB());
+  success_tracker()->Reset();
 
-  service_->LoadTokensFromDB();
-  WaitForDBLoadCompletion();
-  EXPECT_TRUE(service_->TokensLoadedFromDB());
+  service()->LoadTokensFromDB();
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(service()->TokensLoadedFromDB());
 
-  EXPECT_EQ(1U, success_tracker_.size());
-  EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService));
+  EXPECT_EQ(1U, success_tracker()->size());
+  EXPECT_TRUE(service()->HasTokenForService(GaiaConstants::kSyncService));
 }
 
 #ifndef NDEBUG
@@ -415,14 +391,14 @@
     CommandLine::ForCurrentProcess()->AppendSwitchASCII(
         switches::kSetToken, "my_service:my_value");
     TokenServiceTestHarness::SetUp();
-    service_->UpdateCredentials(credentials_);
+    UpdateCredentialsOnService();
 
     *CommandLine::ForCurrentProcess() = original_cl;
   }
 };
 
 TEST_F(TokenServiceCommandLineTest, TestValueOverride) {
-  EXPECT_TRUE(service_->HasTokenForService("my_service"));
-  EXPECT_EQ("my_value", service_->GetTokenForService("my_service"));
+  EXPECT_TRUE(service()->HasTokenForService("my_service"));
+  EXPECT_EQ("my_value", service()->GetTokenForService("my_service"));
 }
 #endif   // ifndef NDEBUG
diff --git a/chrome/browser/signin/token_service_unittest.h b/chrome/browser/signin/token_service_unittest.h
index a333d7c..34aa043 100644
--- a/chrome/browser/signin/token_service_unittest.h
+++ b/chrome/browser/signin/token_service_unittest.h
@@ -13,7 +13,7 @@
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/notification_details.h"
 #include "content/public/browser/notification_source.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "content/public/test/test_notification_tracker.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -56,19 +56,24 @@
 };
 
 class TokenServiceTestHarness : public testing::Test {
- public:
+ protected:
   TokenServiceTestHarness();
   virtual ~TokenServiceTestHarness();
 
   virtual void SetUp() OVERRIDE;
-
   virtual void TearDown() OVERRIDE;
 
-  void WaitForDBLoadCompletion();
+  void UpdateCredentialsOnService();
+  TestingProfile* profile() const { return profile_.get(); }
+  TokenService* service() const { return service_; }
+  const GaiaAuthConsumer::ClientLoginResult& credentials() const {
+    return credentials_;
+  }
+  TokenAvailableTracker* success_tracker() { return &success_tracker_; }
+  TokenFailedTracker* failure_tracker() { return &failure_tracker_; }
 
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;  // Mostly so DCHECKS pass.
-  content::TestBrowserThread db_thread_;  // WDS on here
+ private:
+  content::TestBrowserThreadBundle thread_bundle_;
 
   TokenService* service_;
   TokenAvailableTracker success_tracker_;
diff --git a/chrome/browser/signin/ubertoken_fetcher_unittest.cc b/chrome/browser/signin/ubertoken_fetcher_unittest.cc
index eddb39a..ec752c7 100644
--- a/chrome/browser/signin/ubertoken_fetcher_unittest.cc
+++ b/chrome/browser/signin/ubertoken_fetcher_unittest.cc
@@ -11,8 +11,6 @@
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 class MockUbertokenConsumer : public UbertokenConsumer {
  public:
   MockUbertokenConsumer()
@@ -43,8 +41,8 @@
  public:
   virtual void SetUp() OVERRIDE {
     TokenServiceTestHarness::SetUp();
-    service_->UpdateCredentials(credentials_);
-    fetcher_.reset(new UbertokenFetcher(profile_.get(), &consumer_));
+    UpdateCredentialsOnService();
+    fetcher_.reset(new UbertokenFetcher(profile(), &consumer_));
   }
 
   virtual void TearDown() OVERRIDE {
@@ -61,10 +59,10 @@
   fetcher_->StartFetchingToken();
   TokenService::TokenAvailableDetails
       details(GaiaConstants::kGaiaOAuth2LoginRefreshToken, "refreshToken");
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                 "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   fetcher_->Observe(chrome::NOTIFICATION_TOKEN_AVAILABLE,
-                    content::Source<TokenService>(service_),
+                    content::Source<TokenService>(service()),
                     content::Details<const TokenService::TokenAvailableDetails>(
                         &details));
   fetcher_->OnRefreshTokenResponse("accessToken", 3600);
@@ -75,8 +73,8 @@
 }
 
 TEST_F(UbertokenFetcherTest, TestSuccessWithRefreshToken) {
-  service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
-                                 "refreshToken");
+  service()->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken,
+                                   "refreshToken");
   fetcher_->StartFetchingToken();
   fetcher_->OnRefreshTokenResponse("accessToken", 3600);
   fetcher_->OnUberAuthTokenSuccess("uberToken");
@@ -93,7 +91,7 @@
       details(GaiaConstants::kGaiaOAuth2LoginRefreshToken, error);
   fetcher_->Observe(
       chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
-      content::Source<TokenService>(service_),
+      content::Source<TokenService>(service()),
       content::Details<const TokenService::TokenRequestFailedDetails>(
           &details));
   EXPECT_EQ(1, consumer_.nb_error_);
diff --git a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
index c428e1d..f1380c9 100644
--- a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
+++ b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/bind.h"
+#include "base/run_loop.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/speech/speech_recognition_bubble_controller.h"
 #include "chrome/browser/ui/browser.h"
@@ -79,7 +80,6 @@
  public:
   SpeechRecognitionBubbleControllerTest()
       : BrowserWithTestWindowTest(),
-        io_thread_(BrowserThread::IO),  // constructs a new thread and loop
         cancel_clicked_(false),
         try_again_clicked_(false),
         focus_changed_(false),
@@ -103,14 +103,12 @@
     } else if (button == SpeechRecognitionBubble::BUTTON_TRY_AGAIN) {
       try_again_clicked_ = true;
     }
-    message_loop()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
   }
 
   virtual void InfoBubbleFocusChanged(int session_id) OVERRIDE {
     VLOG(1) << "Received InfoBubbleFocusChanged";
     EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
     focus_changed_ = true;
-    message_loop()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
   }
 
   // testing::Test methods.
@@ -118,12 +116,10 @@
     BrowserWithTestWindowTest::SetUp();
     SpeechRecognitionBubble::set_factory(
         &SpeechRecognitionBubbleControllerTest::CreateBubble);
-    io_thread_.Start();
   }
 
   virtual void TearDown() {
     SpeechRecognitionBubble::set_factory(NULL);
-    io_thread_.Stop();
     BrowserWithTestWindowTest::TearDown();
   }
 
@@ -157,9 +153,6 @@
   }
 
  protected:
-  // The main thread of the test is marked as the IO thread and we create a new
-  // one for the UI thread.
-  content::TestBrowserThread io_thread_;
   bool cancel_clicked_;
   bool try_again_clicked_;
   bool focus_changed_;
@@ -184,7 +177,7 @@
       MockSpeechRecognitionBubble::BUBBLE_TEST_FOCUS_CHANGED);
 
   controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(focus_changed_);
   EXPECT_FALSE(cancel_clicked_);
   EXPECT_FALSE(try_again_clicked_);
@@ -198,7 +191,7 @@
       MockSpeechRecognitionBubble::BUBBLE_TEST_CLICK_CANCEL);
 
   controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(cancel_clicked_);
   EXPECT_FALSE(try_again_clicked_);
   EXPECT_FALSE(focus_changed_);
@@ -212,7 +205,7 @@
       MockSpeechRecognitionBubble::BUBBLE_TEST_CLICK_TRY_AGAIN);
 
   controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1));
-  base::MessageLoop::current()->Run();
+  base::RunLoop().RunUntilIdle();
   EXPECT_FALSE(cancel_clicked_);
   EXPECT_TRUE(try_again_clicked_);
   EXPECT_FALSE(focus_changed_);
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
index c18ce33..e20932d 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
@@ -5,8 +5,6 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/message_loop/message_loop.h"
-#include "base/metrics/histogram.h"
 #include "base/metrics/histogram_samples.h"
 #include "base/metrics/statistics_recorder.h"
 #include "base/strings/string_number_conversions.h"
@@ -17,7 +15,8 @@
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/spellcheck_common.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "net/url_request/test_url_fetcher_factory.h"
 #include "sync/api/sync_change.h"
 #include "sync/api/sync_data.h"
 #include "sync/api/sync_error_factory.h"
@@ -29,7 +28,6 @@
 using base::HistogramBase;
 using base::HistogramSamples;
 using base::StatisticsRecorder;
-using content::BrowserThread;
 using chrome::spellcheck_common::WordList;
 using chrome::spellcheck_common::WordSet;
 
@@ -60,24 +58,14 @@
 
 class SpellcheckCustomDictionaryTest : public testing::Test {
  protected:
-  SpellcheckCustomDictionaryTest()
-      : ui_thread_(BrowserThread::UI, &message_loop_),
-        file_thread_(BrowserThread::FILE, &message_loop_),
-        profile_(new TestingProfile) {
-  }
-
   virtual void SetUp() OVERRIDE {
     // Use SetTestingFactoryAndUse to force creation and initialization.
     SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse(
-        profile_.get(), &BuildSpellcheckService);
+        &profile_, &BuildSpellcheckService);
 
     StatisticsRecorder::Initialize();
   }
 
-  virtual void TearDown() OVERRIDE {
-    base::MessageLoop::current()->RunUntilIdle();
-  }
-
   // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private
   // function to avoid a large number of FRIEND_TEST declarations in
   // SpellcheckCustomDictionary.
@@ -112,11 +100,10 @@
     return dictionary.Apply(change);
   }
 
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
-  scoped_ptr<TestingProfile> profile_;
+  TestingProfile profile_;
+  net::TestURLFetcherFactory fetcher_factory_;
 };
 
 // A wrapper around SpellcheckCustomDictionary that does not own the wrapped
@@ -187,7 +174,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, SaveAndLoad) {
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
   WordList loaded_custom_words = LoadDictionaryFile(path);
 
   // The custom word list should be empty now.
@@ -217,7 +204,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, MultiProfile) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -251,7 +238,7 @@
 // Legacy empty dictionary should be converted to new format empty dictionary.
 TEST_F(SpellcheckCustomDictionaryTest, LegacyEmptyDictionaryShouldBeConverted) {
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
 
   std::string content;
   file_util::WriteFile(path, content.c_str(), content.length());
@@ -264,7 +251,7 @@
 TEST_F(SpellcheckCustomDictionaryTest,
        LegacyDictionaryWithTwoWordsShouldBeConverted) {
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
 
   std::string content = "foo\nbar\nfoo\n";
   file_util::WriteFile(path, content.c_str(), content.length());
@@ -280,7 +267,7 @@
 TEST_F(SpellcheckCustomDictionaryTest,
        IllegalWordsShouldBeRemovedFromDictionary) {
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
 
   std::string content = "foo\n foo bar \n\n \nbar\n"
       "01234567890123456789012345678901234567890123456789"
@@ -299,7 +286,7 @@
 // previous version should be reloaded.
 TEST_F(SpellcheckCustomDictionaryTest, CorruptedWriteShouldBeRecovered) {
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
 
   std::string content = "foo\nbar";
   file_util::WriteFile(path, content.c_str(), content.length());
@@ -324,7 +311,7 @@
        GetAllSyncDataAccuratelyReflectsDictionaryState) {
   SpellcheckCustomDictionary* dictionary =
       SpellcheckServiceFactory::GetForProfile(
-          profile_.get())->GetCustomDictionary();
+          &profile_)->GetCustomDictionary();
 
   syncer::SyncDataList data = dictionary->GetAllSyncData(syncer::DICTIONARY);
   EXPECT_TRUE(data.empty());
@@ -354,7 +341,7 @@
 TEST_F(SpellcheckCustomDictionaryTest, GetAllSyncDataHasLimit) {
   SpellcheckCustomDictionary* dictionary =
       SpellcheckServiceFactory::GetForProfile(
-          profile_.get())->GetCustomDictionary();
+          &profile_)->GetCustomDictionary();
 
   SpellcheckCustomDictionary::Change change;
   for (size_t i = 0;
@@ -389,7 +376,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, ProcessSyncChanges) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* dictionary =
       spellcheck_service->GetCustomDictionary();
 
@@ -460,7 +447,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, MergeDataAndStartSyncing) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -506,7 +493,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryTooBigBeforeSyncing) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -549,7 +536,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryTooBigAndServerFull) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -601,7 +588,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, ServerTooBig) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -652,7 +639,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryTooBigToStartSyncing) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -698,7 +685,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryTooBigToContiueSyncing) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -749,7 +736,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, LoadAfterSyncStart) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -787,7 +774,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, LoadAfterSyncStartTooBigToSync) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -834,7 +821,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, LoadDuplicatesAfterSync) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -881,7 +868,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryLoadNotification) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
 
@@ -902,7 +889,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryAddWordNotification) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
 
@@ -922,7 +909,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionaryRemoveWordNotification) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
 
@@ -945,7 +932,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, DictionarySyncNotification) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   TestingProfile profile2;
@@ -1006,7 +993,7 @@
   // Upload the maximum number of words to the sync server.
   {
     SpellcheckService* spellcheck_service =
-        SpellcheckServiceFactory::GetForProfile(profile_.get());
+        SpellcheckServiceFactory::GetForProfile(&profile_);
     SpellcheckCustomDictionary* custom_dictionary =
         spellcheck_service->GetCustomDictionary();
 
@@ -1092,7 +1079,7 @@
 
   // Load the dictionary which should be empty.
   base::FilePath path =
-      profile_->GetPath().Append(chrome::kCustomDictionaryFileName);
+      profile_.GetPath().Append(chrome::kCustomDictionaryFileName);
   WordList loaded_custom_words = LoadDictionaryFile(path);
   EXPECT_EQ(0u, loaded_custom_words.size());
 
@@ -1125,7 +1112,7 @@
 
 TEST_F(SpellcheckCustomDictionaryTest, HasWord) {
   SpellcheckService* spellcheck_service =
-      SpellcheckServiceFactory::GetForProfile(profile_.get());
+      SpellcheckServiceFactory::GetForProfile(&profile_);
   SpellcheckCustomDictionary* custom_dictionary =
       spellcheck_service->GetCustomDictionary();
   OnLoaded(*custom_dictionary, WordList());
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc
index d0fb26f..8504256 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc
@@ -9,7 +9,7 @@
 #include "chrome/common/spellcheck_marker.h"
 #include "chrome/common/spellcheck_messages.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "ipc/ipc_message.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -17,7 +17,6 @@
  public:
   TestingSpellCheckMessageFilter()
       : SpellCheckMessageFilter(0),
-        ui_thread_(content::BrowserThread::UI, &message_loop_),
         spellcheck_(new SpellcheckService(&profile_)) {}
 
   virtual bool Send(IPC::Message* message) OVERRIDE {
@@ -46,8 +45,7 @@
  private:
   virtual ~TestingSpellCheckMessageFilter() {}
 
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   TestingProfile profile_;
   scoped_ptr<SpellcheckService> spellcheck_;
 
diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc
index 1f68810..c481af2 100644
--- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc
+++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc
@@ -11,11 +11,10 @@
 #include "chrome/browser/spellchecker/spellcheck_service.h"
 #include "chrome/common/spellcheck_common.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
 using chrome::spellcheck_common::WordList;
 
 static BrowserContextKeyedService* BuildSpellcheckService(
@@ -25,27 +24,15 @@
 
 class SpellcheckServiceTest : public testing::Test {
  protected:
-  SpellcheckServiceTest()
-      : ui_thread_(BrowserThread::UI, &message_loop_),
-        file_thread_(BrowserThread::FILE, &message_loop_),
-        profile_(new TestingProfile()) {
-  }
-
   virtual void SetUp() OVERRIDE {
     // Use SetTestingFactoryAndUse to force creation and initialization.
     SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse(
-        profile_.get(), &BuildSpellcheckService);
+        &profile_, &BuildSpellcheckService);
   }
 
-  virtual void TearDown() OVERRIDE {
-    base::MessageLoop::current()->RunUntilIdle();
-  }
-
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
-
-  scoped_ptr<TestingProfile> profile_;
+ private:
+  content::TestBrowserThreadBundle thread_bundle_;
+  TestingProfile profile_;
 };
 
 TEST_F(SpellcheckServiceTest, GetSpellCheckLanguages1) {
diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
index c40bc55..b3ac8d2 100644
--- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc
+++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc
@@ -16,6 +16,7 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/common/spellcheck_result.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/load_flags.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -191,12 +192,6 @@
 // monitor the class calls the callback with expected results.
 class SpellingServiceClientTest : public testing::Test {
  public:
-  SpellingServiceClientTest() {}
-  virtual ~SpellingServiceClientTest() {}
-
-  virtual void SetUp() OVERRIDE {
-  }
-
   void OnTextCheckComplete(int tag,
                            bool success,
                            const string16& text,
@@ -205,6 +200,7 @@
   }
 
  protected:
+  content::TestBrowserThreadBundle thread_bundle_;
   TestingSpellingServiceClient client_;
   TestingProfile profile_;
 };
diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc
index 1a19918..7a74069 100644
--- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc
+++ b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc
@@ -204,6 +204,7 @@
 
     // Linux storage monitor must be destroyed on the UI thread, so do it here.
     test::TestStorageMonitor::RemoveSingleton();
+    base::RunLoop().RunUntilIdle();
   }
 
   // Append mtab entries from the |data| array of size |data_size| to the mtab
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc
index 1c4a995..8de5c6b 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.cc
+++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc
@@ -7,13 +7,14 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/location.h"
+#include "base/run_loop.h"
 #include "chrome/browser/sync/test_profile_sync_service.h"
+#include "content/public/test/test_utils.h"
 #include "sync/internal_api/public/test/test_user_share.h"
 #include "sync/internal_api/public/write_transaction.h"
 #include "sync/protocol/sync.pb.h"
 #include "sync/util/cryptographer.h"
 
-using content::BrowserThread;
 using syncer::ModelType;
 using syncer::UserShare;
 
@@ -41,10 +42,9 @@
 }
 
 AbstractProfileSyncServiceTest::AbstractProfileSyncServiceTest()
-    : ui_thread_(BrowserThread::UI, &ui_loop_),
-      db_thread_(BrowserThread::DB),
-      file_thread_(BrowserThread::FILE),
-      io_thread_(BrowserThread::IO),
+    : thread_bundle_(content::TestBrowserThreadBundle::REAL_DB_THREAD |
+                     content::TestBrowserThreadBundle::REAL_FILE_THREAD |
+                     content::TestBrowserThreadBundle::REAL_IO_THREAD),
       token_service_(NULL),
       sync_service_(NULL) {
 }
@@ -52,19 +52,14 @@
 AbstractProfileSyncServiceTest::~AbstractProfileSyncServiceTest() {}
 
 void AbstractProfileSyncServiceTest::SetUp() {
-  db_thread_.Start();
-  file_thread_.Start();
-  io_thread_.StartIOThread();
 }
 
 void AbstractProfileSyncServiceTest::TearDown() {
   // Pump messages posted by the sync core thread (which may end up
   // posting on the IO thread).
-  ui_loop_.RunUntilIdle();
-  io_thread_.Stop();
-  file_thread_.Stop();
-  db_thread_.Stop();
-  ui_loop_.RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
+  content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
+  base::RunLoop().RunUntilIdle();
 }
 
 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) {
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h
index c3538a2..1ccc810 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.h
+++ b/chrome/browser/sync/abstract_profile_sync_service_test.h
@@ -13,7 +13,7 @@
 #include "base/message_loop/message_loop.h"
 #include "chrome/browser/signin/token_service.h"
 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "sync/internal_api/public/base/model_type.h"
 #include "sync/internal_api/public/change_record.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -52,11 +52,7 @@
       content::BrowserContext* profile);
 
  protected:
-  base::MessageLoopForUI ui_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  content::TestBrowserThread file_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   TokenService* token_service_;
   TestProfileSyncService* sync_service_;
 };
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
index 2660d57..696f5f1 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -7,7 +7,6 @@
 #include "base/compiler_specific.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
@@ -24,7 +23,7 @@
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
 #include "content/public/browser/notification_types.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "sync/api/sync_error.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -153,10 +152,9 @@
 class SyncAutofillDataTypeControllerTest : public testing::Test {
  public:
   SyncAutofillDataTypeControllerTest()
-      : weak_ptr_factory_(this),
-        ui_thread_(BrowserThread::UI, &message_loop_),
-        db_thread_(BrowserThread::DB),
-        last_start_result_(DataTypeController::OK) {}
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_DB_THREAD),
+        last_start_result_(DataTypeController::OK),
+        weak_ptr_factory_(this) {}
 
   virtual ~SyncAutofillDataTypeControllerTest() {}
 
@@ -174,8 +172,6 @@
         new AutofillDataTypeController(&profile_sync_factory_,
                                        &profile_,
                                        &service_);
-
-    db_thread_.Start();
   }
 
   // Passed to AutofillDTC::Start().
@@ -204,10 +200,7 @@
   }
 
  protected:
-  base::WeakPtrFactory<SyncAutofillDataTypeControllerTest> weak_ptr_factory_;
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   scoped_refptr<NiceMock<SharedChangeProcessorMock> > change_processor_;
   ProfileSyncComponentsFactoryMock profile_sync_factory_;
@@ -218,6 +211,7 @@
   // Stores arguments of most recent call of OnStartFinished().
   DataTypeController::StartResult last_start_result_;
   syncer::SyncError last_start_error_;
+  base::WeakPtrFactory<SyncAutofillDataTypeControllerTest> weak_ptr_factory_;
 };
 
 // Load the WDS's database, then start the Autofill DTC.  It should
diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
index ec8ba1f..3f95b14 100644
--- a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
@@ -6,6 +6,7 @@
 #include "base/bind_helpers.h"
 #include "base/callback.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/run_loop.h"
 #include "base/tracked_objects.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -143,7 +144,7 @@
   EXPECT_EQ(DataTypeController::MODEL_LOADED, search_engine_dtc_->state());
 
   // Wait until WebDB is loaded before we shut it down.
-  test_util_.BlockTillServiceProcessesRequests();
+  base::RunLoop().RunUntilIdle();
 }
 
 TEST_F(SyncSearchEngineDataTypeControllerTest, StartFirstRun) {
@@ -222,7 +223,7 @@
   Start();
   // This should cause search_engine_dtc_->Stop() to be called.
   search_engine_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test");
-  test_util_.PumpLoop();
+  base::RunLoop().RunUntilIdle();
   EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
   EXPECT_FALSE(syncable_service_.syncing());
 }
diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
index 5c2f62e..90eadee 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -20,7 +20,8 @@
 #include "chrome/test/base/testing_profile.h"
 #include "components/user_prefs/pref_registry_syncable.h"
 #include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_utils.h"
 #include "google/cacheinvalidation/include/types.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "sync/internal_api/public/base/model_type.h"
@@ -135,16 +136,13 @@
 class SyncBackendHostTest : public testing::Test {
  protected:
   SyncBackendHostTest()
-      : ui_thread_(BrowserThread::UI, &ui_loop_),
-        io_thread_(BrowserThread::IO),
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD),
         fake_manager_(NULL) {}
 
   virtual ~SyncBackendHostTest() {}
 
   virtual void SetUp() OVERRIDE {
-    io_thread_.StartIOThread();
     profile_.reset(new TestingProfile());
-    profile_->CreateRequestContext();
     sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs()));
     backend_.reset(new SyncBackendHost(
         profile_->GetDebugName(),
@@ -178,10 +176,10 @@
     profile_.reset();
     // Pump messages posted by the sync thread (which may end up
     // posting on the IO thread).
-    ui_loop_.RunUntilIdle();
-    io_thread_.Stop();
+    base::RunLoop().RunUntilIdle();
+    content::RunAllPendingInMessageLoop(BrowserThread::IO);
     // Pump any messages posted by the IO thread.
-    ui_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   // Synchronously initializes the backend.
@@ -196,9 +194,11 @@
                          &fake_manager_factory_,
                          &handler_,
                          NULL);
-    ui_loop_.PostDelayedTask(FROM_HERE,
-        ui_loop_.QuitClosure(), TestTimeouts::action_timeout());
-    ui_loop_.Run();
+    base::RunLoop run_loop;
+    BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
+                                   run_loop.QuitClosure(),
+                                   TestTimeouts::action_timeout());
+    run_loop.Run();
     // |fake_manager_factory_|'s fake_manager() is set on the sync
     // thread, but we can rely on the message loop barriers to
     // guarantee that we see the updated value.
@@ -226,9 +226,11 @@
                    base::Unretained(this)),
         base::Bind(&SyncBackendHostTest::OnDownloadRetry,
                    base::Unretained(this)));
-    ui_loop_.PostDelayedTask(FROM_HERE,
-        ui_loop_.QuitClosure(), TestTimeouts::action_timeout());
-    ui_loop_.Run();
+    base::RunLoop run_loop;
+    BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
+                                   run_loop.QuitClosure(),
+                                   TestTimeouts::action_timeout());
+    run_loop.Run();
   }
 
   void IssueRefreshRequest(syncer::ModelTypeSet types) {
@@ -250,9 +252,7 @@
     NOTIMPLEMENTED();
   }
 
-  base::MessageLoop ui_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   StrictMock<MockSyncFrontend> mock_frontend_;
   syncer::SyncCredentials credentials_;
   syncer::TestUnrecoverableErrorHandler handler_;
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index 9f18db2..72b6a0e 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -504,7 +504,6 @@
   virtual void SetUp() OVERRIDE {
     AbstractProfileSyncServiceTest::SetUp();
     profile_.reset(new ProfileMock());
-    profile_->CreateRequestContext();
     web_database_.reset(new WebDatabaseFake(&autofill_table_));
     MockWebDataServiceWrapper* wrapper =
         static_cast<MockWebDataServiceWrapper*>(
@@ -542,7 +541,6 @@
     web_data_service_->ShutdownOnUIThread();
     web_data_service_->ShutdownSyncableService();
     web_data_service_ = NULL;
-    profile_->ResetRequestContext();
     // To prevent a leak, fully release TestURLRequestContext to ensure its
     // destruction on the IO message loop.
     profile_.reset();
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc
index b9a3fac..17b9523 100644
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc
@@ -154,8 +154,7 @@
 
   virtual void SetUp() {
     AbstractProfileSyncServiceTest::SetUp();
-    profile_.reset(new ProfileMock);
-    profile_->CreateRequestContext();
+    profile_.reset(new ProfileMock());
     invalidation::InvalidationServiceFactory::GetInstance()->
         SetBuildOnlyFakeInvalidatorsForTest(true);
     password_store_ = static_cast<MockPasswordStore*>(
@@ -168,7 +167,6 @@
       password_store_->ShutdownOnUIThread();
       ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(
           profile_.get(), NULL);
-      profile_->ResetRequestContext();
       profile_.reset();
       AbstractProfileSyncServiceTest::TearDown();
   }
diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
index 076a7fb..4d57c21 100644
--- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
@@ -124,7 +124,6 @@
   virtual void SetUp() {
     AbstractProfileSyncServiceTest::SetUp();
     profile_.reset(new TestingProfile());
-    profile_->CreateRequestContext();
     invalidation::InvalidationServiceFactory::GetInstance()->
         SetBuildOnlyFakeInvalidatorsForTest(true);
     prefs_ = profile_->GetTestingPrefService();
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc
index 6643286..aec8539 100644
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc
@@ -13,7 +13,7 @@
 #include "base/guid.h"
 #include "base/location.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/stl_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
@@ -48,6 +48,7 @@
 #include "content/public/browser/web_contents.h"
 #include "content/public/test/test_browser_thread.h"
 #include "google_apis/gaia/gaia_constants.h"
+#include "net/url_request/test_url_fetcher_factory.h"
 #include "sync/internal_api/public/base/model_type.h"
 #include "sync/internal_api/public/change_record.h"
 #include "sync/internal_api/public/read_node.h"
@@ -202,8 +203,7 @@
       public content::NotificationObserver {
  public:
   ProfileSyncServiceSessionTest()
-      : io_thread_(BrowserThread::IO),
-        window_bounds_(0, 1, 2, 3),
+      : window_bounds_(0, 1, 2, 3),
         notified_of_update_(false),
         notified_of_refresh_(false) {}
   ProfileSyncService* sync_service() { return sync_service_.get(); }
@@ -222,8 +222,6 @@
   virtual void SetUp() {
     // BrowserWithTestWindowTest implementation.
     BrowserWithTestWindowTest::SetUp();
-    io_thread_.StartIOThread();
-    profile()->CreateRequestContext();
     ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
     registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
         content::NotificationService::AllSources());
@@ -250,7 +248,6 @@
   virtual void TearDown() {
     sync_service_->Shutdown();
     sync_service_.reset();
-    profile()->ResetRequestContext();
 
     // We need to destroy the profile before shutting down the threads, because
     // some of the ref counted objects in the profile depend on their
@@ -260,9 +257,7 @@
 
     // Pump messages posted by the sync core thread (which may end up
     // posting on the IO thread).
-    base::MessageLoop::current()->RunUntilIdle();
-    io_thread_.Stop();
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     BrowserWithTestWindowTest::TearDown();
   }
 
@@ -312,7 +307,6 @@
     return true;
   }
 
-  content::TestBrowserThread io_thread_;
   // Path used in testing.
   base::ScopedTempDir temp_dir_;
   SessionModelAssociator* model_associator_;
@@ -323,6 +317,7 @@
   bool notified_of_update_;
   bool notified_of_refresh_;
   content::NotificationRegistrar registrar_;
+  net::TestURLFetcherFactory fetcher_factory_;
 };
 
 class CreateRootHelper {
@@ -1222,7 +1217,7 @@
   // Update associator.
   model_associator_->AssociateForeignSpecifics(meta, base::Time());
   model_associator_->AssociateForeignSpecifics(tab, base::Time());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_FALSE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon));
 
   // Now add a favicon.
@@ -1230,7 +1225,7 @@
   tab.mutable_tab()->set_favicon_type(sync_pb::SessionTab::TYPE_WEB_FAVICON);
   tab.mutable_tab()->set_favicon("data");
   model_associator_->AssociateForeignSpecifics(tab, base::Time());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon));
   ASSERT_TRUE(CompareMemoryToString("data", favicon));
 
@@ -1241,7 +1236,7 @@
   tab.mutable_tab()->clear_favicon_type();
   tab.mutable_tab()->clear_favicon();
   model_associator_->AssociateForeignSpecifics(tab, base::Time());
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon));
 }
 
diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
index 85b5c88..f1bfd96 100644
--- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc
@@ -7,6 +7,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/prefs/pref_service.h"
+#include "base/run_loop.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/signin/fake_signin_manager.h"
 #include "chrome/browser/signin/oauth2_token_service.h"
@@ -27,7 +28,8 @@
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_utils.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -71,10 +73,9 @@
 class ProfileSyncServiceStartupTest : public testing::Test {
  public:
   ProfileSyncServiceStartupTest()
-      : ui_thread_(BrowserThread::UI, &ui_loop_),
-        db_thread_(BrowserThread::DB),
-        file_thread_(BrowserThread::FILE),
-        io_thread_(BrowserThread::IO),
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_DB_THREAD |
+                       content::TestBrowserThreadBundle::REAL_FILE_THREAD |
+                       content::TestBrowserThreadBundle::REAL_IO_THREAD),
         profile_(new TestingProfile),
         sync_(NULL) {}
 
@@ -82,9 +83,6 @@
   }
 
   virtual void SetUp() {
-    file_thread_.Start();
-    io_thread_.StartIOThread();
-    profile_->CreateRequestContext();
 #if defined(OS_CHROMEOS)
     SigninManagerFactory::GetInstance()->SetTestingFactory(
         profile_.get(), FakeSigninManagerBase::Build);
@@ -104,10 +102,9 @@
 
     // Pump messages posted by the sync core thread (which may end up
     // posting on the IO thread).
-    ui_loop_.RunUntilIdle();
-    io_thread_.Stop();
-    file_thread_.Stop();
-    ui_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
+    content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
+    base::RunLoop().RunUntilIdle();
   }
 
   static BrowserContextKeyedService* BuildService(
@@ -139,11 +136,7 @@
     return data_type_manager;
   }
 
-  base::MessageLoop ui_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  content::TestBrowserThread file_thread_;
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestingProfile> profile_;
   TestProfileSyncService* sync_;
   ProfileSyncServiceObserverMock observer_;
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
index e933442..2738c10 100644
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
@@ -174,8 +174,7 @@
 
   virtual void SetUp() {
     AbstractProfileSyncServiceTest::SetUp();
-    profile_.reset(new ProfileMock);
-    profile_->CreateRequestContext();
+    profile_.reset(new ProfileMock());
     invalidation::InvalidationServiceFactory::GetInstance()->
         SetBuildOnlyFakeInvalidatorsForTest(true);
     history_backend_ = new HistoryBackendMock();
@@ -194,7 +193,6 @@
     ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(
         profile_.get(), NULL);
     history_thread_.Stop();
-    profile_->ResetRequestContext();
     profile_.reset();
     AbstractProfileSyncServiceTest::TearDown();
   }
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc
index 6eb7521..9b22da9 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -6,7 +6,7 @@
 #include "base/compiler_specific.h"
 #include "base/file_util.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/values.h"
 #include "chrome/browser/invalidation/invalidation_service_factory.h"
 #include "chrome/browser/signin/signin_manager.h"
@@ -21,7 +21,8 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_utils.h"
 #include "google/cacheinvalidation/include/types.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "sync/js/js_arg_list.h"
@@ -38,7 +39,6 @@
 
 namespace {
 
-using content::BrowserThread;
 using testing::_;
 using testing::AtLeast;
 using testing::AtMost;
@@ -49,18 +49,13 @@
 class ProfileSyncServiceTestHarness {
  public:
   ProfileSyncServiceTestHarness()
-      : ui_thread_(BrowserThread::UI, &ui_loop_),
-        db_thread_(BrowserThread::DB),
-        file_thread_(BrowserThread::FILE),
-        io_thread_(BrowserThread::IO) {}
-
-  ~ProfileSyncServiceTestHarness() {}
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_DB_THREAD |
+                       content::TestBrowserThreadBundle::REAL_FILE_THREAD |
+                       content::TestBrowserThreadBundle::REAL_IO_THREAD) {
+   }
 
   void SetUp() {
-    file_thread_.Start();
-    io_thread_.StartIOThread();
     profile.reset(new TestingProfile());
-    profile->CreateRequestContext();
     invalidation::InvalidationServiceFactory::GetInstance()->
         SetBuildOnlyFakeInvalidatorsForTest(true);
     ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory(
@@ -76,11 +71,9 @@
     profile.reset();
     // Pump messages posted by the sync thread (which may end up
     // posting on the IO thread).
-    ui_loop_.RunUntilIdle();
-    io_thread_.Stop();
-    file_thread_.Stop();
-    // Ensure that the sync objects destruct to avoid memory leaks.
-    ui_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
+    content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
+    base::RunLoop().RunUntilIdle();
   }
 
   // TODO(akalin): Refactor the StartSyncService*() functions below.
@@ -140,14 +133,7 @@
   scoped_ptr<TestingProfile> profile;
 
  private:
-  base::MessageLoop ui_loop_;
-  // Needed by |service|.
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  // Needed by DisableAndEnableSyncTemporarily test case.
-  content::TestBrowserThread file_thread_;
-  // Needed by |service| and |profile|'s request context.
-  content::TestBrowserThread io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 };
 
 class TestProfileSyncServiceObserver : public ProfileSyncServiceObserver {
diff --git a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
index 403abd9..30c27ab 100644
--- a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
@@ -43,13 +43,11 @@
 #define MAYBE_SingleClientEnabledEncryptionAndChanged DISABLED_SingleClientEnabledEncryptionAndChanged
 #define MAYBE_BothChanged DISABLED_BothChanged
 #define MAYBE_DeleteIdleSession DISABLED_DeleteIdleSession
-#define MAYBE_DeleteActiveSession DISABLED_DeleteActiveSession
 #else
 #define MAYBE_SingleClientChanged SingleClientChanged
 #define MAYBE_SingleClientEnabledEncryptionAndChanged SingleClientEnabledEncryptionAndChanged
 #define MAYBE_BothChanged BothChanged
 #define MAYBE_DeleteIdleSession DeleteIdleSession
-#define MAYBE_DeleteActiveSession DeleteActiveSession
 #endif
 
 
@@ -188,7 +186,9 @@
   ASSERT_FALSE(GetSessionData(1, &sessions1));
 }
 
-IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MAYBE_DeleteActiveSession) {
+// Fails all release trybots. crbug.com/263369.
+IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
+                       DISABLED_DeleteActiveSession) {
   ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
 
   ASSERT_TRUE(CheckInitialState(0));
diff --git a/chrome/browser/sync_file_system/drive_backend/api_util.cc b/chrome/browser/sync_file_system/drive_backend/api_util.cc
index 84cb34a..e1ddfb7 100644
--- a/chrome/browser/sync_file_system/drive_backend/api_util.cc
+++ b/chrome/browser/sync_file_system/drive_backend/api_util.cc
@@ -9,6 +9,7 @@
 #include <sstream>
 #include <string>
 
+#include "base/file_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/sequenced_worker_pool.h"
@@ -137,9 +138,24 @@
   return mime_type;
 }
 
+bool CreateTemporaryFile(const base::FilePath& dir_path,
+                         webkit_blob::ScopedFile* temp_file) {
+  base::FilePath temp_file_path;
+  const bool success = file_util::CreateDirectory(dir_path) &&
+      file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path);
+  if (!success)
+    return success;
+  *temp_file =
+      webkit_blob::ScopedFile(temp_file_path,
+                              webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
+                              base::MessageLoopProxy::current().get());
+  return success;
+}
+
 }  // namespace
 
-APIUtil::APIUtil(Profile* profile)
+APIUtil::APIUtil(Profile* profile,
+                 const base::FilePath& temp_dir_path)
     : wapi_url_generator_(
           GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction),
           GURL(google_apis::GDataWapiUrlGenerator::
@@ -148,7 +164,8 @@
           GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction),
           GURL(google_apis::DriveApiUrlGenerator::
                kBaseDownloadUrlForProduction)),
-      upload_next_key_(0) {
+      upload_next_key_(0),
+      temp_dir_path_(temp_dir_path) {
   if (IsDriveAPIDisabled()) {
     drive_service_.reset(new drive::GDataWapiService(
         profile->GetRequestContext(),
@@ -175,10 +192,12 @@
 
 scoped_ptr<APIUtil> APIUtil::CreateForTesting(
     Profile* profile,
+    const base::FilePath& temp_dir_path,
     scoped_ptr<drive::DriveServiceInterface> drive_service,
     scoped_ptr<drive::DriveUploaderInterface> drive_uploader) {
   return make_scoped_ptr(new APIUtil(
       profile,
+      temp_dir_path,
       GURL(kFakeServerBaseUrl),
       GURL(kFakeDownloadServerBaseUrl),
       drive_service.Pass(),
@@ -186,13 +205,15 @@
 }
 
 APIUtil::APIUtil(Profile* profile,
+                 const base::FilePath& temp_dir_path,
                  const GURL& base_url,
                  const GURL& base_download_url,
                  scoped_ptr<drive::DriveServiceInterface> drive_service,
                  scoped_ptr<drive::DriveUploaderInterface> drive_uploader)
     : wapi_url_generator_(base_url, base_download_url),
       drive_api_url_generator_(base_url, base_download_url),
-      upload_next_key_(0) {
+      upload_next_key_(0),
+      temp_dir_path_(temp_dir_path) {
   drive_service_ = drive_service.Pass();
   drive_service_->Initialize(profile);
   drive_service_->AddObserver(this);
@@ -484,20 +505,19 @@
 
 void APIUtil::DownloadFile(const std::string& resource_id,
                            const std::string& local_file_md5,
-                           const base::FilePath& local_file_path,
                            const DownloadFileCallback& callback) {
   DCHECK(CalledOnValidThread());
+  DCHECK(!temp_dir_path_.empty());
   DVLOG(2) << "Downloading file [" << resource_id << "]";
 
-  drive_service_->GetResourceEntry(
-      resource_id,
-      base::Bind(&APIUtil::DidGetResourceEntry,
-                 AsWeakPtr(),
-                 base::Bind(&APIUtil::DownloadFileInternal,
-                            AsWeakPtr(),
-                            local_file_md5,
-                            local_file_path,
-                            callback)));
+  scoped_ptr<webkit_blob::ScopedFile> temp_file(new webkit_blob::ScopedFile);
+  webkit_blob::ScopedFile* temp_file_ptr = temp_file.get();
+  content::BrowserThread::PostTaskAndReplyWithResult(
+      content::BrowserThread::FILE, FROM_HERE,
+      base::Bind(&CreateTemporaryFile, temp_dir_path_, temp_file_ptr),
+      base::Bind(&APIUtil::DidGetTemporaryFileForDownload,
+                 AsWeakPtr(), resource_id, local_file_md5,
+                 base::Passed(&temp_file), callback));
 }
 
 void APIUtil::UploadNewFile(const std::string& directory_resource_id,
@@ -699,9 +719,33 @@
   callback.Run(error, entry.Pass());
 }
 
+void APIUtil::DidGetTemporaryFileForDownload(
+    const std::string& resource_id,
+    const std::string& local_file_md5,
+    scoped_ptr<webkit_blob::ScopedFile> local_file,
+    const DownloadFileCallback& callback,
+    bool success) {
+  if (!success) {
+    DVLOG(2) << "Error in creating a temp file under "
+             << temp_dir_path_.value();
+    callback.Run(google_apis::GDATA_FILE_ERROR, std::string(), 0, base::Time(),
+                 local_file.Pass());
+    return;
+  }
+  drive_service_->GetResourceEntry(
+      resource_id,
+      base::Bind(&APIUtil::DidGetResourceEntry,
+                 AsWeakPtr(),
+                 base::Bind(&APIUtil::DownloadFileInternal,
+                            AsWeakPtr(),
+                            local_file_md5,
+                            base::Passed(&local_file),
+                            callback)));
+}
+
 void APIUtil::DownloadFileInternal(
     const std::string& local_file_md5,
-    const base::FilePath& local_file_path,
+    scoped_ptr<webkit_blob::ScopedFile> local_file,
     const DownloadFileCallback& callback,
     google_apis::GDataErrorCode error,
     scoped_ptr<google_apis::ResourceEntry> entry) {
@@ -709,7 +753,8 @@
 
   if (error != google_apis::HTTP_SUCCESS) {
     DVLOG(2) << "Error on getting resource entry for download";
-    callback.Run(error, std::string(), 0, base::Time());
+    callback.Run(error, std::string(), 0, base::Time(),
+                 local_file.Pass());
     return;
   }
   DCHECK(entry);
@@ -720,23 +765,27 @@
     callback.Run(google_apis::HTTP_NOT_MODIFIED,
                  local_file_md5,
                  entry->file_size(),
-                 entry->updated_time());
+                 entry->updated_time(),
+                 local_file.Pass());
     return;
   }
 
   DVLOG(2) << "Downloading file: " << entry->resource_id();
   const std::string& resource_id = entry->resource_id();
+  const base::FilePath& local_file_path = local_file->path();
   drive_service_->DownloadFile(local_file_path,
                                resource_id,
                                base::Bind(&APIUtil::DidDownloadFile,
                                           AsWeakPtr(),
                                           base::Passed(&entry),
+                                          base::Passed(&local_file),
                                           callback),
                                google_apis::GetContentCallback(),
                                google_apis::ProgressCallback());
 }
 
 void APIUtil::DidDownloadFile(scoped_ptr<google_apis::ResourceEntry> entry,
+                              scoped_ptr<webkit_blob::ScopedFile> local_file,
                               const DownloadFileCallback& callback,
                               google_apis::GDataErrorCode error,
                               const base::FilePath& downloaded_file_path) {
@@ -747,7 +796,8 @@
     DVLOG(2) << "Error on downloading file: " << error;
 
   callback.Run(
-      error, entry->file_md5(), entry->file_size(), entry->updated_time());
+      error, entry->file_md5(), entry->file_size(), entry->updated_time(),
+      local_file.Pass());
 }
 
 void APIUtil::DidUploadNewFile(const std::string& parent_resource_id,
diff --git a/chrome/browser/sync_file_system/drive_backend/api_util.h b/chrome/browser/sync_file_system/drive_backend/api_util.h
index 8c17628..e976a15 100644
--- a/chrome/browser/sync_file_system/drive_backend/api_util.h
+++ b/chrome/browser/sync_file_system/drive_backend/api_util.h
@@ -15,6 +15,7 @@
 #include "chrome/browser/google_apis/gdata_wapi_url_generator.h"
 #include "chrome/browser/sync_file_system/drive_backend/api_util_interface.h"
 #include "net/base/network_change_notifier.h"
+#include "webkit/common/blob/scoped_file.h"
 
 class GURL;
 class Profile;
@@ -44,7 +45,7 @@
                               scoped_ptr<google_apis::ResourceEntry> entry)>
       EnsureUniquenessCallback;
 
-  explicit APIUtil(Profile* profile);
+  APIUtil(Profile* profile, const base::FilePath& temp_dir_path);
   virtual ~APIUtil();
 
   virtual void AddObserver(APIUtilObserver* observer) OVERRIDE;
@@ -52,6 +53,7 @@
 
   static scoped_ptr<APIUtil> CreateForTesting(
       Profile* profile,
+      const base::FilePath& temp_dir_path,
       scoped_ptr<drive::DriveServiceInterface> drive_service,
       scoped_ptr<drive::DriveUploaderInterface> drive_uploader);
 
@@ -74,7 +76,6 @@
                                const ResourceListCallback& callback) OVERRIDE;
   virtual void DownloadFile(const std::string& resource_id,
                             const std::string& local_file_md5,
-                            const base::FilePath& local_file_path,
                             const DownloadFileCallback& callback) OVERRIDE;
   virtual void UploadNewFile(const std::string& directory_resource_id,
                              const base::FilePath& local_file_path,
@@ -115,6 +116,7 @@
 
   // Constructor for test use.
   APIUtil(Profile* profile,
+          const base::FilePath& temp_dir_path,
           const GURL& base_url,
           const GURL& base_download_url,
           scoped_ptr<drive::DriveServiceInterface> drive_service,
@@ -169,13 +171,21 @@
                            google_apis::GDataErrorCode error,
                            scoped_ptr<google_apis::ResourceEntry> entry);
 
+  void DidGetTemporaryFileForDownload(
+      const std::string& resource_id,
+      const std::string& local_file_md5,
+      scoped_ptr<webkit_blob::ScopedFile> local_file,
+      const DownloadFileCallback& callback,
+      bool success);
+
   void DownloadFileInternal(const std::string& local_file_md5,
-                            const base::FilePath& local_file_path,
+                            scoped_ptr<webkit_blob::ScopedFile> local_file,
                             const DownloadFileCallback& callback,
                             google_apis::GDataErrorCode error,
                             scoped_ptr<google_apis::ResourceEntry> entry);
 
   void DidDownloadFile(scoped_ptr<google_apis::ResourceEntry> entry,
+                       scoped_ptr<webkit_blob::ScopedFile> local_file,
                        const DownloadFileCallback& callback,
                        google_apis::GDataErrorCode error,
                        const base::FilePath& downloaded_file_path);
@@ -243,6 +253,8 @@
   UploadCallbackMap upload_callback_map_;
   UploadKey upload_next_key_;
 
+  base::FilePath temp_dir_path_;
+
   std::string root_resource_id_;
 
   ObserverList<APIUtilObserver> observers_;
diff --git a/chrome/browser/sync_file_system/drive_backend/api_util_interface.h b/chrome/browser/sync_file_system/drive_backend/api_util_interface.h
index 46867f2..e4a2ca7 100644
--- a/chrome/browser/sync_file_system/drive_backend/api_util_interface.h
+++ b/chrome/browser/sync_file_system/drive_backend/api_util_interface.h
@@ -22,6 +22,10 @@
 class DriveUploaderInterface;
 }
 
+namespace webkit_blob {
+class ScopedFile;
+}
+
 namespace sync_file_system {
 namespace drive_backend {
 
@@ -46,7 +50,8 @@
   typedef base::Callback<void(google_apis::GDataErrorCode error,
                               const std::string& file_md5,
                               int64 file_size,
-                              const base::Time& last_updated)>
+                              const base::Time& last_updated,
+                              scoped_ptr<webkit_blob::ScopedFile> downloaded)>
       DownloadFileCallback;
   typedef base::Callback<void(google_apis::GDataErrorCode error,
                               const std::string& resource_id,
@@ -130,7 +135,6 @@
   // empty.
   virtual void DownloadFile(const std::string& resource_id,
                             const std::string& local_file_md5,
-                            const base::FilePath& local_file_path,
                             const DownloadFileCallback& callback) = 0;
 
   // Uploads the new file |local_file_path| with specified |title| into the
diff --git a/chrome/browser/sync_file_system/drive_backend/api_util_unittest.cc b/chrome/browser/sync_file_system/drive_backend/api_util_unittest.cc
index 1407ab9..3f03963 100644
--- a/chrome/browser/sync_file_system/drive_backend/api_util_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/api_util_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "chrome/browser/sync_file_system/drive_backend/api_util.h"
 
+#include "base/file_util.h"
 #include "base/location.h"
 #include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
@@ -214,8 +215,10 @@
     fake_drive_helper_.reset(new FakeDriveServiceHelper(
         fake_drive_service_, fake_drive_uploader_));
 
+    ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
     api_util_ = APIUtil::CreateForTesting(
         &profile_,
+        temp_dir_.path(),
         scoped_ptr<DriveServiceInterface>(fake_drive_service_),
         scoped_ptr<DriveUploaderInterface>(fake_drive_uploader_));
 
@@ -324,6 +327,7 @@
  private:
   content::TestBrowserThreadBundle thread_bundle_;
 
+  base::ScopedTempDir temp_dir_;
   TestingProfile profile_;
   scoped_ptr<APIUtil> api_util_;
   FakeDriveServiceWrapper* fake_drive_service_;
@@ -363,8 +367,10 @@
                      GDataErrorCode error,
                      const std::string& file_md5,
                      int64 file_size,
-                     const base::Time& updated_time) {
+                     const base::Time& updated_time,
+                     scoped_ptr<webkit_blob::ScopedFile> file) {
   ASSERT_TRUE(output);
+  ASSERT_TRUE(base::PathExists(file->path()));
   output->error = error;
   output->file_md5 = file_md5;
 }
@@ -585,15 +591,10 @@
   scoped_ptr<ResourceEntry> file;
   SetUpFile(origin_root_id, kFileContent, kFileTitle, &file);
 
-  base::ScopedTempDir temp_dir;
-  ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
-  base::FilePath output_file_path = temp_dir.path().AppendASCII(file->title());
-
   Output output;
   api_util()->DownloadFile(
       file->resource_id(),
       "",  // local_file_md5
-      output_file_path,
       base::Bind(&DidDownloadFile, &output));
   base::MessageLoop::current()->RunUntilIdle();
 
@@ -610,17 +611,12 @@
   scoped_ptr<ResourceEntry> file;
   SetUpFile(origin_root_id, kFileContent, kFileTitle, &file);
 
-  base::ScopedTempDir temp_dir;
-  ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
-  base::FilePath output_file_path = temp_dir.path().AppendASCII(file->title());
-
   // Since local file's hash value is equal to remote file's one, it is expected
   // to cancel download the file and to return NOT_MODIFIED status code.
   Output output;
   api_util()->DownloadFile(
       file->resource_id(),
       file->file_md5(),
-      output_file_path,
       base::Bind(&DidDownloadFile, &output));
   base::MessageLoop::current()->RunUntilIdle();
 
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service.cc
index 4ff04d8..9e07bdd 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service.cc
@@ -58,20 +58,6 @@
       ? kSyncFileSystemDirDev : kSyncFileSystemDir;
 }
 
-bool CreateTemporaryFile(const base::FilePath& dir_path,
-                         webkit_blob::ScopedFile* temp_file) {
-  base::FilePath temp_file_path;
-  const bool success = file_util::CreateDirectory(dir_path) &&
-      file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path);
-  if (!success)
-    return success;
-  *temp_file =
-      webkit_blob::ScopedFile(temp_file_path,
-                              webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
-                              base::MessageLoopProxy::current().get());
-  return success;
-}
-
 void EmptyStatusCallback(SyncStatusCode status) {}
 
 }  // namespace
@@ -325,7 +311,7 @@
   temporary_file_dir_ =
       profile_->GetPath().Append(GetSyncFileSystemDir()).Append(kTempDirName);
 
-  api_util_.reset(new drive_backend::APIUtil(profile_));
+  api_util_.reset(new drive_backend::APIUtil(profile_, temporary_file_dir_));
   api_util_->AddObserver(this);
 
   metadata_store_.reset(new DriveMetadataStore(
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_fake_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_fake_unittest.cc
index 2d1e8a2..a26c2af 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_fake_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_fake_unittest.cc
@@ -7,8 +7,8 @@
 #include <utility>
 
 #include "base/command_line.h"
-#include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
+#include "base/run_loop.h"
 #include "chrome/browser/drive/drive_uploader.h"
 #include "chrome/browser/drive/fake_drive_service.h"
 #include "chrome/browser/extensions/test_extension_service.h"
@@ -28,7 +28,6 @@
 #include "chrome/common/extensions/extension.h"
 #include "chrome/common/extensions/extension_builder.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "extensions/common/id_util.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -207,6 +206,7 @@
 
     api_util_ = APIUtil::CreateForTesting(
         profile_.get(),
+        fake_drive_helper_->base_dir_path().AppendASCII("tmp"),
         scoped_ptr<DriveServiceInterface>(fake_drive_service_),
         scoped_ptr<DriveUploaderInterface>(drive_uploader)).Pass();
     metadata_store_.reset(new DriveMetadataStore(
@@ -215,7 +215,7 @@
 
     bool done = false;
     metadata_store_->Initialize(base::Bind(&DidInitialize, &done));
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     EXPECT_TRUE(done);
 
     fake_drive_service_->LoadResourceListForWapi(
@@ -240,7 +240,7 @@
     sync_service_->AddFileStatusObserver(&mock_file_status_observer_);
     sync_service_->SetRemoteChangeProcessor(mock_remote_processor());
     sync_service_->SetSyncEnabled(enabled);
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   virtual void TearDown() OVERRIDE {
@@ -256,7 +256,7 @@
 
     extension_service_ = NULL;
     profile_.reset();
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void SetSyncEnabled(bool enabled) {
@@ -283,7 +283,7 @@
   void UpdateRegisteredOrigins() {
     sync_service_->UpdateRegisteredOrigins();
     // Wait for completion of uninstalling origin.
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void VerifySizeOfRegisteredOrigins(size_t b_size,
@@ -352,7 +352,7 @@
 
     sync_service_->ProcessRemoteChange(
         base::Bind(&DidProcessRemoteChange, &actual_status, &actual_url));
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
     EXPECT_EQ(expected_status, actual_status);
     EXPECT_EQ(expected_url, actual_url);
@@ -445,7 +445,7 @@
   sync_service()->RegisterOriginForTrackingChanges(
       ExtensionNameToGURL(kExtensionName1),
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   VerifySizeOfRegisteredOrigins(0u, 1u, 0u);
@@ -473,7 +473,7 @@
   sync_service()->RegisterOriginForTrackingChanges(
       ExtensionNameToGURL(kExtensionName1),
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   // The origin should be registered as an incremental sync origin.
@@ -493,7 +493,7 @@
   sync_service()->RegisterOriginForTrackingChanges(
       ExtensionNameToGURL(kExtensionName1),
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   // We must not have started batch sync for the newly registered origin,
@@ -515,7 +515,7 @@
   sync_service()->UnregisterOriginForTrackingChanges(
       ExtensionNameToGURL(kExtensionName1),
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   VerifySizeOfRegisteredOrigins(0u, 1u, 0u);
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_sync_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_sync_unittest.cc
index 8d273d1..41e9037 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_sync_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_sync_unittest.cc
@@ -118,6 +118,7 @@
 
     scoped_ptr<APIUtil> api_util(APIUtil::CreateForTesting(
         &profile_,
+        fake_drive_helper_->base_dir_path().AppendASCII("tmp"),
         scoped_ptr<drive::DriveServiceInterface>(fake_drive_service_),
         scoped_ptr<drive::DriveUploaderInterface>(drive_uploader_)));
 
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_unittest.cc
index 1b53de2..c107bdd 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_file_sync_service_unittest.cc
@@ -4,13 +4,13 @@
 
 #include "chrome/browser/sync_file_system/drive_backend/drive_file_sync_service.h"
 
-#include "base/message_loop/message_loop.h"
+#include "base/bind.h"
 #include "base/message_loop/message_loop_proxy.h"
+#include "base/run_loop.h"
 #include "chrome/browser/sync_file_system/drive_backend/drive_metadata_store.h"
 #include "chrome/browser/sync_file_system/drive_backend/fake_api_util.h"
 #include "chrome/browser/sync_file_system/sync_file_system.pb.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
@@ -60,7 +60,7 @@
         base_dir_, base::MessageLoopProxy::current().get());
     bool done = false;
     metadata_store_->Initialize(base::Bind(&DidInitialize, &done));
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
     metadata_store_->SetSyncRootDirectory(kSyncRootResourceId);
     EXPECT_TRUE(done);
 
@@ -69,14 +69,14 @@
         base_dir_,
         scoped_ptr<APIUtilInterface>(fake_api_util_),
         scoped_ptr<DriveMetadataStore>(metadata_store_)).Pass();
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   virtual void TearDown() OVERRIDE {
     metadata_store_ = NULL;
     fake_api_util_ = NULL;
     sync_service_.reset();
-    base::MessageLoop::current()->RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
     base_dir_ = base::FilePath();
     RevokeSyncableFileSystem();
@@ -172,7 +172,7 @@
   sync_service()->UninstallOrigin(
       origin_gurl,
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   // Assert the App's origin folder was marked as deleted.
@@ -194,7 +194,7 @@
   sync_service()->UninstallOrigin(
       origin_gurl,
       base::Bind(&ExpectEqStatus, &done, SYNC_STATUS_OK));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(done);
 
   // Assert the App's origin folder does not exist.
@@ -215,7 +215,7 @@
   // Pending origins that are disabled are dropped and do not go to disabled.
   sync_service()->DisableOriginForTrackingChanges(origin,
                                                   base::Bind(&ExpectOkStatus));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(VerifyOriginStatusCount(0u, 0u, 0u));
 }
 
@@ -229,7 +229,7 @@
 
   sync_service()->DisableOriginForTrackingChanges(origin,
                                                   base::Bind(&ExpectOkStatus));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(VerifyOriginStatusCount(0u, 0u, 1u));
 }
 
@@ -246,7 +246,7 @@
   // origins > 0.
   sync_service()->EnableOriginForTrackingChanges(origin,
                                                  base::Bind(&ExpectOkStatus));
-  base::MessageLoop::current()->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
   ASSERT_TRUE(VerifyOriginStatusCount(0u, 1u, 0u));
 }
 
diff --git a/chrome/browser/sync_file_system/drive_backend/fake_api_util.cc b/chrome/browser/sync_file_system/drive_backend/fake_api_util.cc
index c8e01a1..88ce414 100644
--- a/chrome/browser/sync_file_system/drive_backend/fake_api_util.cc
+++ b/chrome/browser/sync_file_system/drive_backend/fake_api_util.cc
@@ -10,6 +10,7 @@
 #include "base/location.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "chrome/browser/google_apis/drive_entry_kinds.h"
+#include "webkit/common/blob/scoped_file.h"
 
 namespace sync_file_system {
 namespace drive_backend {
@@ -145,7 +146,6 @@
 
 void FakeAPIUtil::DownloadFile(const std::string& resource_id,
                                const std::string& local_file_md5,
-                               const base::FilePath& local_file_path,
                                const DownloadFileCallback& callback) {
   RemoteResourceByResourceId::iterator found =
       remote_resources_.find(resource_id);
@@ -163,9 +163,12 @@
     error = google_apis::HTTP_SUCCESS;
   }
 
+  scoped_ptr<webkit_blob::ScopedFile> dummy_local_file(
+      new webkit_blob::ScopedFile);
   base::MessageLoopProxy::current()->PostTask(
       FROM_HERE,
-      base::Bind(callback, error, file_md5, file_size, updated_time));
+      base::Bind(callback, error, file_md5, file_size, updated_time,
+                 base::Passed(&dummy_local_file)));
 }
 
 void FakeAPIUtil::UploadNewFile(const std::string& directory_resource_id,
diff --git a/chrome/browser/sync_file_system/drive_backend/fake_api_util.h b/chrome/browser/sync_file_system/drive_backend/fake_api_util.h
index 52c201e..3c5a552 100644
--- a/chrome/browser/sync_file_system/drive_backend/fake_api_util.h
+++ b/chrome/browser/sync_file_system/drive_backend/fake_api_util.h
@@ -79,7 +79,6 @@
                                const ResourceListCallback& callback) OVERRIDE;
   virtual void DownloadFile(const std::string& resource_id,
                             const std::string& local_file_md5,
-                            const base::FilePath& local_file_path,
                             const DownloadFileCallback& callback) OVERRIDE;
   virtual void UploadNewFile(const std::string& directory_resource_id,
                              const base::FilePath& local_file_path,
diff --git a/chrome/browser/sync_file_system/drive_backend/fake_api_util_unittest.cc b/chrome/browser/sync_file_system/drive_backend/fake_api_util_unittest.cc
index 88a7ede..a0239cd 100644
--- a/chrome/browser/sync_file_system/drive_backend/fake_api_util_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/fake_api_util_unittest.cc
@@ -11,6 +11,7 @@
 #include "base/message_loop/message_loop.h"
 #include "chrome/browser/google_apis/gdata_errorcode.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/common/blob/scoped_file.h"
 
 namespace sync_file_system {
 namespace drive_backend {
@@ -22,7 +23,8 @@
                      google_apis::GDataErrorCode error,
                      const std::string& file_md5,
                      int64 file_size,
-                     const base::Time& updated_time) {
+                     const base::Time& updated_time,
+                     scoped_ptr<webkit_blob::ScopedFile> downloaded_file) {
   *error_out = error;
   *file_md5_out = file_md5;
 }
@@ -55,7 +57,6 @@
   std::string kMD5_1("md5 1");
   std::string kMD5_2("md5 2");
   std::string kMD5_3("md5 3");
-  base::FilePath kTempFilePath(FILE_PATH_LITERAL("tmp_file"));
 
   api_util.PushRemoteChange(kParentResourceId,
                             kParentTitle,
@@ -97,7 +98,6 @@
   std::string md5;
   api_util.DownloadFile(kResourceId1,
                         kMD5_1,
-                        kTempFilePath,
                         base::Bind(DidDownloadFile, &error, &md5));
   message_loop.RunUntilIdle();
   EXPECT_EQ(google_apis::HTTP_NOT_FOUND, error);
diff --git a/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.cc b/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.cc
index fa1cbc9..2377974 100644
--- a/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.cc
+++ b/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.cc
@@ -15,20 +15,6 @@
 
 namespace {
 
-bool CreateTemporaryFile(const base::FilePath& dir_path,
-                         webkit_blob::ScopedFile* temp_file) {
-  base::FilePath temp_file_path;
-  const bool success = file_util::CreateDirectory(dir_path) &&
-      file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path);
-  if (!success)
-    return success;
-  *temp_file =
-      webkit_blob::ScopedFile(temp_file_path,
-                              webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
-                              base::MessageLoopProxy::current().get());
-  return success;
-}
-
 void EmptyStatusCallback(sync_file_system::SyncStatusCode status) {}
 
 }  // namespace
@@ -201,25 +187,6 @@
 }
 
 void RemoteSyncDelegate::DownloadFile(const SyncStatusCallback& callback) {
-  content::BrowserThread::PostTaskAndReplyWithResult(
-      content::BrowserThread::FILE, FROM_HERE,
-      base::Bind(&CreateTemporaryFile,
-                 sync_service_->temporary_file_dir_,
-                 &temporary_file_),
-      base::Bind(&RemoteSyncDelegate::DidGetTemporaryFileForDownload,
-                 AsWeakPtr(), callback));
-}
-
-void RemoteSyncDelegate::DidGetTemporaryFileForDownload(
-    const SyncStatusCallback& callback,
-    bool success) {
-  if (!success) {
-    AbortSync(callback, SYNC_FILE_ERROR_FAILED);
-    return;
-  }
-
-  DCHECK(!temporary_file_.path().empty());
-
   // We should not use the md5 in metadata for FETCH type to avoid the download
   // finishes due to NOT_MODIFIED.
   std::string md5_checksum;
@@ -229,7 +196,6 @@
   api_util()->DownloadFile(
       remote_change_.resource_id,
       md5_checksum,
-      temporary_file_.path(),
       base::Bind(&RemoteSyncDelegate::DidDownloadFile,
                  AsWeakPtr(),
                  callback));
@@ -240,7 +206,8 @@
     google_apis::GDataErrorCode error,
     const std::string& md5_checksum,
     int64 file_size,
-    const base::Time& updated_time) {
+    const base::Time& updated_time,
+    scoped_ptr<webkit_blob::ScopedFile> downloaded_file) {
   if (error == google_apis::HTTP_NOT_MODIFIED) {
     sync_action_ = SYNC_ACTION_NONE;
     DidApplyRemoteChange(callback, SYNC_STATUS_OK);
@@ -253,6 +220,7 @@
     return;
   }
 
+  temporary_file_ = downloaded_file->Pass();
   drive_metadata_.set_md5_checksum(md5_checksum);
   remote_change_processor()->ApplyRemoteChange(
       remote_file_change(), temporary_file_.path(), url(),
diff --git a/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.h b/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.h
index 5d8ccda..ff48cea 100644
--- a/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.h
+++ b/chrome/browser/sync_file_system/drive_backend/remote_sync_delegate.h
@@ -56,13 +56,12 @@
                             SyncStatusCode status);
   void DeleteMetadata(const SyncStatusCallback& callback);
   void DownloadFile(const SyncStatusCallback& callback);
-  void DidGetTemporaryFileForDownload(const SyncStatusCallback& callback,
-                                      bool success);
   void DidDownloadFile(const SyncStatusCallback& callback,
                        google_apis::GDataErrorCode error,
                        const std::string& md5_checksum,
                        int64 file_size,
-                       const base::Time& updated_time);
+                       const base::Time& updated_time,
+                       scoped_ptr<webkit_blob::ScopedFile> downloaded_file);
   void HandleConflict(const SyncStatusCallback& callback,
                       SyncFileType remote_file_type);
   void HandleLocalWin(const SyncStatusCallback& callback);
diff --git a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
index 59722dc..9f19923 100644
--- a/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
+++ b/chrome/browser/sync_file_system/local_file_sync_service_unittest.cc
@@ -14,6 +14,9 @@
 #include "chrome/browser/sync_file_system/mock_local_change_processor.h"
 #include "chrome/browser/sync_file_system/sync_file_system_test_util.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_utils.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webkit/browser/fileapi/file_system_context.h"
@@ -27,6 +30,7 @@
 #include "webkit/browser/fileapi/syncable/sync_status_code.h"
 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
 
+using content::BrowserThread;
 using fileapi::FileSystemURL;
 using ::testing::_;
 using ::testing::AtLeast;
@@ -95,19 +99,18 @@
     : public testing::Test,
       public LocalFileSyncService::Observer {
  protected:
-  LocalFileSyncServiceTest() : num_changes_(0) {}
-
-  virtual ~LocalFileSyncServiceTest() {}
+  LocalFileSyncServiceTest()
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD |
+                        content::TestBrowserThreadBundle::REAL_IO_THREAD),
+        num_changes_(0) {}
 
   virtual void SetUp() OVERRIDE {
     ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
 
-    thread_helper_.SetUp();
-
     file_system_.reset(new CannedSyncableFileSystem(
         GURL(kOrigin),
-        thread_helper_.io_task_runner(),
-        thread_helper_.file_task_runner()));
+        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
 
     local_service_.reset(new LocalFileSyncService(&profile_));
 
@@ -132,8 +135,7 @@
     local_service_->Shutdown();
     file_system_->TearDown();
     RevokeSyncableFileSystem();
-
-    thread_helper_.TearDown();
+    content::RunAllPendingInMessageLoop(BrowserThread::FILE);
   }
 
   // LocalChangeObserver overrides.
@@ -173,11 +175,11 @@
     return file_system_->file_system_context()->change_tracker()->num_changes();
   }
 
+  content::TestBrowserThreadBundle thread_bundle_;
+
   ScopedEnableSyncFSDirectoryOperation enable_directory_operation_;
   TestingProfile profile_;
 
-  MultiThreadTestHelper thread_helper_;
-
   base::ScopedTempDir temp_dir_;
 
   scoped_ptr<CannedSyncableFileSystem> file_system_;
@@ -277,9 +279,10 @@
 
 TEST_F(LocalFileSyncServiceTest, MAYBE_LocalChangeObserverMultipleContexts) {
   const char kOrigin2[] = "http://foo";
-  CannedSyncableFileSystem file_system2(GURL(kOrigin2),
-                                        thread_helper_.io_task_runner(),
-                                        thread_helper_.file_task_runner());
+  CannedSyncableFileSystem file_system2(
+      GURL(kOrigin2),
+      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
   file_system2.SetUp();
 
   base::RunLoop run_loop;
diff --git a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc
index 6661bb1..7e3c543 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc
@@ -15,6 +15,9 @@
 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
 #include "chrome/browser/sync_file_system/sync_file_system_test_util.h"
 #include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webkit/browser/fileapi/file_system_context.h"
 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h"
@@ -25,6 +28,7 @@
 #include "webkit/browser/fileapi/syncable/sync_status_code.h"
 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
 
+using content::BrowserThread;
 using fileapi::FileSystemURL;
 using fileapi::FileSystemURLSet;
 using ::testing::AnyNumber;
@@ -63,11 +67,11 @@
 }
 
 // This is called on IO thread.
-void VerifyFileError(base::WaitableEvent* event,
+void VerifyFileError(base::RunLoop* run_loop,
                      base::PlatformFileError error) {
-  DCHECK(event);
+  DCHECK(run_loop);
   EXPECT_EQ(base::PLATFORM_FILE_OK, error);
-  event->Signal();
+  run_loop->Quit();
 }
 
 }  // namespace
@@ -112,16 +116,15 @@
 
 class SyncFileSystemServiceTest : public testing::Test {
  protected:
-  SyncFileSystemServiceTest() {}
-  virtual ~SyncFileSystemServiceTest() {}
+  SyncFileSystemServiceTest()
+      : thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD |
+                       content::TestBrowserThreadBundle::REAL_IO_THREAD) {}
 
   virtual void SetUp() OVERRIDE {
-    thread_helper_.SetUp();
-
     file_system_.reset(new CannedSyncableFileSystem(
         GURL(kOrigin),
-        thread_helper_.io_task_runner(),
-        thread_helper_.file_task_runner()));
+        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
 
     local_service_ = new LocalFileSyncService(&profile_);
     remote_service_ = new StrictMock<MockRemoteFileSyncService>;
@@ -150,10 +153,9 @@
 
   virtual void TearDown() OVERRIDE {
     sync_service_->Shutdown();
-
     file_system_->TearDown();
     RevokeSyncableFileSystem();
-    thread_helper_.TearDown();
+    content::RunAllPendingInMessageLoop(BrowserThread::FILE);
   }
 
   void InitializeApp() {
@@ -237,7 +239,7 @@
 
   ScopedEnableSyncFSDirectoryOperation enable_directory_operation_;
 
-  MultiThreadTestHelper thread_helper_;
+  content::TestBrowserThreadBundle thread_bundle_;
   TestingProfile profile_;
   scoped_ptr<CannedSyncableFileSystem> file_system_;
 
@@ -392,17 +394,20 @@
   mock_remote_service()->NotifyRemoteChangeQueueUpdated(1);
 
   // Start a local operation on the same file (to make it BUSY).
-  base::WaitableEvent event(false, false);
-  thread_helper_.io_task_runner()->PostTask(
-      FROM_HERE, base::Bind(&CannedSyncableFileSystem::DoCreateFile,
-                            base::Unretained(file_system_.get()),
-                            kFile, base::Bind(&VerifyFileError, &event)));
+  base::RunLoop verify_file_error_run_loop;
+  BrowserThread::PostTask(
+      BrowserThread::IO,
+      FROM_HERE,
+      base::Bind(&CannedSyncableFileSystem::DoCreateFile,
+                 base::Unretained(file_system_.get()),
+                 kFile, base::Bind(&VerifyFileError,
+                                   &verify_file_error_run_loop)));
 
   run_loop.Run();
 
   mock_remote_service()->NotifyRemoteChangeQueueUpdated(0);
 
-  event.Wait();
+  verify_file_error_run_loop.Run();
 }
 
 TEST_F(SyncFileSystemServiceTest, GetFileSyncStatus) {
diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.cc b/chrome/browser/sync_file_system/sync_file_system_test_util.cc
index 1f0c214..ccb5684 100644
--- a/chrome/browser/sync_file_system/sync_file_system_test_util.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_test_util.cc
@@ -9,12 +9,11 @@
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread.h"
-#include "content/public/test/test_browser_thread.h"
-#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_utils.h"
 #include "webkit/browser/fileapi/syncable/sync_status_code.h"
 
 using content::BrowserThread;
-using content::TestBrowserThread;
 
 namespace sync_file_system {
 
@@ -35,30 +34,4 @@
 template base::Callback<void(SyncStatusCode)>
 AssignAndQuitCallback(base::RunLoop*, SyncStatusCode*);
 
-MultiThreadTestHelper::MultiThreadTestHelper()
-    : thread_bundle_(new content::TestBrowserThreadBundle(
-          content::TestBrowserThreadBundle::REAL_FILE_THREAD |
-          content::TestBrowserThreadBundle::REAL_IO_THREAD)) {
-}
-
-MultiThreadTestHelper::~MultiThreadTestHelper() {}
-
-void MultiThreadTestHelper::SetUp() {
-  ui_task_runner_ =
-      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI);
-  file_task_runner_ =
-      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE);
-  io_task_runner_ =
-      BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
-}
-
-void MultiThreadTestHelper::TearDown() {
-  // Make sure we give some more time to finish tasks on the FILE thread
-  // before stopping IO/FILE threads.
-  base::RunLoop run_loop;
-  file_task_runner_->PostTaskAndReply(
-      FROM_HERE, base::Bind(&base::DoNothing), run_loop.QuitClosure());
-  run_loop.Run();
-}
-
 }  // namespace sync_file_system
diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.h b/chrome/browser/sync_file_system/sync_file_system_test_util.h
index 85152d3..a7c33fa 100644
--- a/chrome/browser/sync_file_system/sync_file_system_test_util.h
+++ b/chrome/browser/sync_file_system/sync_file_system_test_util.h
@@ -5,19 +5,15 @@
 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_
 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_
 
+#include "base/callback_forward.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
 
 namespace base {
 class RunLoop;
 class SingleThreadTaskRunner;
 }
 
-namespace content {
-class TestBrowserThreadBundle;
-}
-
 namespace sync_file_system {
 
 template <typename R>
@@ -26,36 +22,6 @@
 template <typename R> base::Callback<void(R)>
 AssignAndQuitCallback(base::RunLoop* run_loop, R* result);
 
-// This sets up FILE, IO and UI browser threads for testing.
-// (UI thread is set to the current thread.)
-class MultiThreadTestHelper {
- public:
-  MultiThreadTestHelper();
-  ~MultiThreadTestHelper();
-
-  void SetUp();
-  void TearDown();
-
-  base::SingleThreadTaskRunner* ui_task_runner() {
-    return ui_task_runner_.get();
-  }
-
-  base::SingleThreadTaskRunner* file_task_runner() {
-    return file_task_runner_.get();
-  }
-
-  base::SingleThreadTaskRunner* io_task_runner() {
-    return io_task_runner_.get();
-  }
-
- private:
-  scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_;
-
-  scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
-  scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
-  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
-};
-
 }  // namespace sync_file_system
 
 #endif  // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_
diff --git a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
index 81dbb20..ae5c0a0 100644
--- a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
+++ b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc
@@ -62,11 +62,6 @@
   virtual WebContents* GetWebContents() const OVERRIDE;
   virtual Profile* GetProfile() const OVERRIDE;
 
-  // Create a testing URL request context.
-  void CreateRequestContext() {
-    profile_->CreateRequestContext();
-  }
-
   // Attaches a RenderViewContextMenuObserver to be tested.
   void SetObserver(RenderViewContextMenuObserver* observer);
 
@@ -327,9 +322,6 @@
   CommandLine* command_line = CommandLine::ForCurrentProcess();
   command_line->AppendSwitch(switches::kUseSpellingSuggestions);
 
-  // Make sure we can pretend to handle the JSON request.
-  menu()->CreateRequestContext();
-
   // Force a non-empty locale so SUGGEST is available.
   menu()->GetPrefs()->SetString(prefs::kSpellCheckDictionary, "en");
   EXPECT_TRUE(SpellingServiceClient::IsAvailable(menu()->GetProfile(),
@@ -370,9 +362,6 @@
                        NoMoreSuggestionsNotDisplayed) {
   menu()->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
 
-  // Make sure we can pretend to handle the JSON request.
-  menu()->CreateRequestContext();
-
   // Force a non-empty locale so SPELLCHECK is available.
   menu()->GetPrefs()->SetString(prefs::kSpellCheckDictionary, "en");
   EXPECT_TRUE(SpellingServiceClient::IsAvailable(menu()->GetProfile(),
@@ -478,7 +467,6 @@
   menu()->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
   CommandLine* command_line = CommandLine::ForCurrentProcess();
   command_line->AppendSwitch(switches::kUseSpellingSuggestions);
-  menu()->CreateRequestContext();
   InitMenu("asdfkj", NULL);
 
   // Should have at least 2 entries. Separator, suggestion.
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 8c5bae6..3dbbb7f 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -107,6 +107,7 @@
     case IDS_TASK_MANAGER_CPU_COLUMN:
     case IDS_TASK_MANAGER_PROCESS_ID_COLUMN:
     case IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN:
+    case IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN:
     case IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN:
     case IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN:
     case IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN:
@@ -503,9 +504,7 @@
   if (!GetVideoMemory(index, &video_memory, &has_duplicates) || !video_memory)
     return ASCIIToUTF16("N/A");
   if (has_duplicates) {
-    return ASCIIToUTF16("(") +
-        GetMemCellText(video_memory) +
-        ASCIIToUTF16(")");
+    return GetMemCellText(video_memory) + ASCIIToUTF16("*");
   }
   return GetMemCellText(video_memory);
 }
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index 057084e..70d9210 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -84,6 +84,10 @@
 }  // namespace
 
 TranslateManager::~TranslateManager() {
+  // CleanupPendingUrlFetcher should be called ahead of destructing.
+  DCHECK(language_list_.get() == NULL);
+  DCHECK(script_.get() == NULL);
+
   weak_method_factory_.InvalidateWeakPtrs();
 }
 
@@ -634,7 +638,7 @@
     NOTREACHED();
 }
 
-void TranslateManager::CleanupPendingUlrFetcher() {
+void TranslateManager::CleanupPendingUrlFetcher() {
   language_list_.reset();
   script_.reset();
 }
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h
index 8355ab1..da673f7 100644
--- a/chrome/browser/translate/translate_manager.h
+++ b/chrome/browser/translate/translate_manager.h
@@ -92,7 +92,7 @@
 
   // Allows caller to cleanup pending URLFetcher objects to make sure they
   // get released in the appropriate thread... Mainly for tests.
-  void CleanupPendingUlrFetcher();
+  void CleanupPendingUrlFetcher();
 
   // Translates the page contents from |source_lang| to |target_lang|.
   // The actual translation might be performed asynchronously if the translate
diff --git a/chrome/browser/ui/app_list/search/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore_provider.cc
index 0a0d14f..479ded0 100644
--- a/chrome/browser/ui/app_list/search/webstore_provider.cc
+++ b/chrome/browser/ui/app_list/search/webstore_provider.cc
@@ -7,6 +7,7 @@
 #include <string>
 
 #include "base/bind.h"
+#include "base/metrics/field_trial.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "chrome/browser/browser_process.h"
@@ -26,6 +27,13 @@
 const char kKeyLocalizedName[] = "localized_name";
 const char kKeyIconUrl[] = "icon_url";
 
+// Returns true if the launcher should send queries to the web store server.
+bool UseWebstoreSearch() {
+  const char kFieldTrialName[] = "LauncherUseWebstoreSearch";
+  const char kEnable[] = "Enable";
+  return base::FieldTrialList::FindFullName(kFieldTrialName) == kEnable;
+}
+
 }  // namespace
 
 WebstoreProvider::WebstoreProvider(Profile* profile,
@@ -36,16 +44,18 @@
 WebstoreProvider::~WebstoreProvider() {}
 
 void WebstoreProvider::Start(const base::string16& query) {
-  if (!webstore_search_) {
-    webstore_search_.reset(new WebstoreSearchFetcher(
-        base::Bind(&WebstoreProvider::OnWebstoreSearchFetched,
-                   base::Unretained(this)),
-        profile_->GetRequestContext()));
-  }
-
   const std::string query_utf8 = UTF16ToUTF8(query);
-  webstore_search_->Start(query_utf8,
-                          g_browser_process->GetApplicationLocale());
+
+  if (UseWebstoreSearch()) {
+    if (!webstore_search_) {
+      webstore_search_.reset(new WebstoreSearchFetcher(
+          base::Bind(&WebstoreProvider::OnWebstoreSearchFetched,
+                     base::Unretained(this)),
+          profile_->GetRequestContext()));
+    }
+    webstore_search_->Start(query_utf8,
+                            g_browser_process->GetApplicationLocale());
+  }
 
   // Add a placeholder result which when clicked will run the user's query in a
   // browser. This placeholder is removed when the search results arrive.
diff --git a/chrome/browser/ui/app_list/search/webstore_provider_browsertest.cc b/chrome/browser/ui/app_list/search/webstore_provider_browsertest.cc
index 2399091..b60133a 100644
--- a/chrome/browser/ui/app_list/search/webstore_provider_browsertest.cc
+++ b/chrome/browser/ui/app_list/search/webstore_provider_browsertest.cc
@@ -35,6 +35,11 @@
   virtual ~WebstoreProviderTest() {}
 
   // InProcessBrowserTest overrides:
+  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+    command_line->AppendSwitchASCII(switches::kForceFieldTrials,
+                                    "LauncherUseWebstoreSearch/Enable/");
+  }
+
   virtual void SetUpOnMainThread() OVERRIDE {
     test_server_.reset(new EmbeddedTestServer(
         BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
diff --git a/chrome/browser/ui/ash/ime_controller_chromeos.cc b/chrome/browser/ui/ash/ime_controller_chromeos.cc
index 239b1d0..fca4702 100644
--- a/chrome/browser/ui/ash/ime_controller_chromeos.cc
+++ b/chrome/browser/ui/ash/ime_controller_chromeos.cc
@@ -13,10 +13,10 @@
   return manager->SwitchToNextInputMethod();
 }
 
-bool ImeController::HandlePreviousIme() {
+bool ImeController::HandlePreviousIme(const ui::Accelerator& accelerator) {
   chromeos::input_method::InputMethodManager* manager =
       chromeos::input_method::InputMethodManager::Get();
-  return manager->SwitchToPreviousInputMethod();
+  return manager->SwitchToPreviousInputMethod(accelerator);
 }
 
 bool ImeController::HandleSwitchIme(const ui::Accelerator& accelerator) {
diff --git a/chrome/browser/ui/ash/ime_controller_chromeos.h b/chrome/browser/ui/ash/ime_controller_chromeos.h
index e0f2e64..bdfa28e 100644
--- a/chrome/browser/ui/ash/ime_controller_chromeos.h
+++ b/chrome/browser/ui/ash/ime_controller_chromeos.h
@@ -18,7 +18,7 @@
 
   // Overridden from ash::ImeControlDelegate:
   virtual bool HandleNextIme() OVERRIDE;
-  virtual bool HandlePreviousIme() OVERRIDE;
+  virtual bool HandlePreviousIme(const ui::Accelerator& accelerator) OVERRIDE;
   virtual bool HandleSwitchIme(const ui::Accelerator& accelerator) OVERRIDE;
   virtual ui::Accelerator RemapAccelerator(
       const ui::Accelerator& accelerator) OVERRIDE;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser_unittest.cc
index 5d73e33..f91430b 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser_unittest.cc
@@ -13,7 +13,7 @@
 #include "base/compiler_specific.h"
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/values.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/test_extension_system.h"
@@ -23,7 +23,7 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 #if defined(OS_CHROMEOS)
@@ -38,9 +38,7 @@
 class ChromeLauncherControllerPerBrowserTest : public testing::Test {
  protected:
   ChromeLauncherControllerPerBrowserTest()
-      : ui_thread_(content::BrowserThread::UI, &loop_),
-        file_thread_(content::BrowserThread::FILE, &loop_),
-        profile_(new TestingProfile()),
+      : profile_(new TestingProfile()),
         extension_service_(NULL) {
     DictionaryValue manifest;
     manifest.SetString("name", "launcher controller test extension");
@@ -81,7 +79,7 @@
   virtual void TearDown() OVERRIDE {
     profile_.reset();
     // Execute any pending deletion tasks.
-    loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
   }
 
   void InsertPrefValue(base::ListValue* pref_value,
@@ -145,9 +143,7 @@
   }
 
   // Needed for extension service & friends to work.
-  base::MessageLoop loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
 #if defined OS_CHROMEOS
   chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
index 8066568..dbcf723 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
@@ -15,7 +15,6 @@
 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
 #include "ui/aura/root_window.h"
 
 class TestChromeLauncherControllerPerBrowser :
@@ -39,8 +38,7 @@
   }
 
   LauncherContextMenuTest()
-      : profile_(new TestingProfile()),
-        browser_thread_(content::BrowserThread::UI, message_loop()) {}
+      : profile_(new TestingProfile()) {}
 
   virtual void SetUp() OVERRIDE {
     ash::test::AshTestBase::SetUp();
@@ -66,7 +64,6 @@
 
  private:
   scoped_ptr<TestingProfile> profile_;
-  content::TestBrowserThread browser_thread_;
   ash::LauncherModel launcher_model_;
   scoped_ptr<ChromeLauncherController> controller_;
 
diff --git a/chrome/browser/ui/ash/screenshot_taker_unittest.cc b/chrome/browser/ui/ash/screenshot_taker_unittest.cc
index 6eac784..ed8ffd1 100644
--- a/chrome/browser/ui/ash/screenshot_taker_unittest.cc
+++ b/chrome/browser/ui/ash/screenshot_taker_unittest.cc
@@ -18,7 +18,6 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/browser_thread.h"
-#include "content/public/test/test_browser_thread.h"
 #include "content/public/test/test_utils.h"
 #include "ui/aura/root_window.h"
 #include "ui/message_center/message_center_switches.h"
@@ -30,8 +29,7 @@
                             public ScreenshotTakerObserver {
  public:
   ScreenshotTakerTest()
-      : ui_thread_(content::BrowserThread::UI, message_loop()),
-        running_(false),
+      : running_(false),
         screenshot_complete_(false),
         screenshot_result_(ScreenshotTakerObserver::SCREENSHOT_SUCCESS) {
   }
@@ -90,7 +88,6 @@
   }
 
   scoped_ptr<ScopedTestingLocalState> local_state_;
-  content::TestBrowserThread ui_thread_;
   bool running_;
   bool screenshot_complete_;
   ScreenshotTakerObserver::Result screenshot_result_;
diff --git a/chrome/browser/ui/ash/volume_controller_chromeos.cc b/chrome/browser/ui/ash/volume_controller_chromeos.cc
index db93e82..6779b95 100644
--- a/chrome/browser/ui/ash/volume_controller_chromeos.cc
+++ b/chrome/browser/ui/ash/volume_controller_chromeos.cc
@@ -86,7 +86,8 @@
 
     if (audio_handler->IsOutputMuted())
       audio_handler->SetOutputMute(false);
-    audio_handler->AdjustOutputVolumeByPercent(kStepPercentage);
+    else
+      audio_handler->AdjustOutputVolumeByPercent(kStepPercentage);
     return true;
   }
 
diff --git a/chrome/browser/ui/ash/window_positioner_unittest.cc b/chrome/browser/ui/ash/window_positioner_unittest.cc
index 157678f..3842e2a 100644
--- a/chrome/browser/ui/ash/window_positioner_unittest.cc
+++ b/chrome/browser/ui/ash/window_positioner_unittest.cc
@@ -16,7 +16,6 @@
 #include "chrome/test/base/testing_profile.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/test/render_view_test.h"
-#include "content/public/test/test_browser_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/aura/env.h"
 #include "ui/aura/root_window.h"
@@ -59,7 +58,6 @@
 class WindowPositionerTest : public AshTestBase {
  public:
   WindowPositionerTest();
-  virtual ~WindowPositionerTest();
 
   virtual void SetUp() OVERRIDE;
   virtual void TearDown() OVERRIDE;
@@ -80,8 +78,7 @@
   WindowPositioner* window_positioner_;
 
   // These two need to be deleted after everything else is gone.
-  scoped_ptr<content::TestBrowserThread> ui_thread_;
-  scoped_ptr<TestingProfile> profile_;
+  TestingProfile profile_;
 
   // These get created for each session.
   scoped_ptr<aura::Window> window_;
@@ -99,18 +96,6 @@
 WindowPositionerTest::WindowPositionerTest()
     : grid_size_(WindowPositioner::kMinimumWindowOffset),
       window_positioner_(NULL) {
-  // Create a message loop.
-  base::MessageLoopForUI* ui_loop = message_loop();
-  ui_thread_.reset(
-      new content::TestBrowserThread(content::BrowserThread::UI, ui_loop));
-
-  // Create a browser profile.
-  profile_.reset(new TestingProfile());
-}
-
-WindowPositionerTest::~WindowPositionerTest() {
-  profile_.reset(NULL);
-  ui_thread_.reset(NULL);
 }
 
 void WindowPositionerTest::SetUp() {
@@ -123,14 +108,14 @@
 
   // Create a browser for the window.
   browser_window_.reset(new TestBrowserWindowAura(window_.get()));
-  Browser::CreateParams window_params(profile_.get(),
+  Browser::CreateParams window_params(&profile_,
                                       chrome::HOST_DESKTOP_TYPE_ASH);
   window_params.window = browser_window_.get();
   window_owning_browser_.reset(new Browser(window_params));
 
   // Creating a browser for the popup.
   browser_popup_.reset(new TestBrowserWindowAura(popup_.get()));
-  Browser::CreateParams popup_params(Browser::TYPE_POPUP, profile_.get(),
+  Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_,
                                      chrome::HOST_DESKTOP_TYPE_ASH);
   popup_params.window = browser_popup_.get();
   popup_owning_browser_.reset(new Browser(popup_params));
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
index 142e7d0..a647868 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -320,7 +320,6 @@
   // testing::Test implementation:
   virtual void SetUp() OVERRIDE {
     ChromeRenderViewHostTestHarness::SetUp();
-    profile()->CreateRequestContext();
 
     test_bubble_controller_ =
         new testing::NiceMock<TestAutofillCreditCardBubbleController>(
@@ -342,7 +341,6 @@
   void Reset() {
     if (controller_)
       controller_->ViewClosed();
-    profile()->CreateRequestContext();
 
     test_bubble_controller_ =
         new testing::NiceMock<TestAutofillCreditCardBubbleController>(
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
index ddf8415..c248a37 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -6,6 +6,7 @@
 #include "base/files/file_path.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
+#include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/autocomplete/autocomplete_match.h"
 #include "chrome/browser/autocomplete/autocomplete_result.h"
 #include "chrome/browser/chrome_notification_types.h"
@@ -30,6 +31,7 @@
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
 #include "content/public/common/url_constants.h"
 #include "content/public/test/browser_test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -231,16 +233,41 @@
 
   ui_test_utils::NavigateToURL(browser(), GetTestURL());
 
+  // Wait until the request actually has hit the popup blocker. The
+  // NavigateToURL call above returns as soon as the main tab stopped loading
+  // which can happen before the popup request was processed.
+  WebContents* web_contents =
+      browser()->tab_strip_model()->GetActiveWebContents();
+  PopupBlockerTabHelper* popup_blocker_helper =
+      PopupBlockerTabHelper::FromWebContents(web_contents);
+  if (!popup_blocker_helper->GetBlockedPopupsCount()) {
+    content::WindowedNotificationObserver observer(
+        chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED,
+        content::NotificationService::AllSources());
+    observer.Wait();
+  }
+
   // If the popup blocker blocked the blank post, there should be only one tab.
   EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
                                         browser()->host_desktop_type()));
   EXPECT_EQ(1, browser()->tab_strip_model()->count());
-  WebContents* web_contents =
-      browser()->tab_strip_model()->GetActiveWebContents();
   EXPECT_EQ(GetTestURL(), web_contents->GetURL());
 
   // And no new RVH created.
   EXPECT_EQ(0, counter.GetRenderViewHostCreatedCount());
+
+  content::WindowedNotificationObserver observer(
+      chrome::NOTIFICATION_TAB_ADDED,
+      content::NotificationService::AllSources());
+
+  // Launch the blocked popup.
+  EXPECT_EQ(1u, popup_blocker_helper->GetBlockedPopupsCount());
+  IDMap<chrome::NavigateParams, IDMapOwnPointer>::const_iterator iter(
+      &popup_blocker_helper->GetBlockedPopupRequests());
+  ASSERT_FALSE(iter.IsAtEnd());
+  popup_blocker_helper->ShowBlockedPopup(iter.GetCurrentKey());
+
+  observer.Wait();
 }
 
 IN_PROC_BROWSER_TEST_F(BetterPopupBlockerBrowserTest,
@@ -280,4 +307,92 @@
   observer.Wait();
 }
 
+IN_PROC_BROWSER_TEST_F(BetterPopupBlockerBrowserTest, WindowFeatures) {
+  GURL url(ui_test_utils::GetTestUrl(
+      base::FilePath(kTestDir),
+      base::FilePath(FILE_PATH_LITERAL("popup-window-open.html"))));
+
+  CountRenderViewHosts counter;
+
+  ui_test_utils::NavigateToURL(browser(), url);
+
+  // If the popup blocker blocked the blank post, there should be only one tab.
+  EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
+                                        browser()->host_desktop_type()));
+  EXPECT_EQ(1, browser()->tab_strip_model()->count());
+  WebContents* web_contents =
+      browser()->tab_strip_model()->GetActiveWebContents();
+  EXPECT_EQ(url, web_contents->GetURL());
+
+  // And no new RVH created.
+  EXPECT_EQ(0, counter.GetRenderViewHostCreatedCount());
+
+  content::WindowedNotificationObserver observer(
+      chrome::NOTIFICATION_TAB_ADDED,
+      content::NotificationService::AllSources());
+  ui_test_utils::BrowserAddedObserver browser_observer;
+
+  // Launch the blocked popup.
+  PopupBlockerTabHelper* popup_blocker_helper =
+      PopupBlockerTabHelper::FromWebContents(web_contents);
+  EXPECT_EQ(1u, popup_blocker_helper->GetBlockedPopupsCount());
+  IDMap<chrome::NavigateParams, IDMapOwnPointer>::const_iterator iter(
+      &popup_blocker_helper->GetBlockedPopupRequests());
+  ASSERT_FALSE(iter.IsAtEnd());
+  popup_blocker_helper->ShowBlockedPopup(iter.GetCurrentKey());
+
+  observer.Wait();
+  Browser* new_browser = browser_observer.WaitForSingleNewBrowser();
+
+  // Check that the new popup has (roughly) the requested size.
+  web_contents = new_browser->tab_strip_model()->GetActiveWebContents();
+  gfx::Size window_size = web_contents->GetView()->GetContainerSize();
+  EXPECT_TRUE(349 <= window_size.width() && window_size.width() <= 351);
+  EXPECT_TRUE(249 <= window_size.height() && window_size.height() <= 251);
+}
+
+IN_PROC_BROWSER_TEST_F(BetterPopupBlockerBrowserTest, CorrectReferrer) {
+  GURL url(ui_test_utils::GetTestUrl(
+      base::FilePath(kTestDir),
+      base::FilePath(FILE_PATH_LITERAL("popup-referrer.html"))));
+
+  CountRenderViewHosts counter;
+
+  ui_test_utils::NavigateToURL(browser(), url);
+
+  // If the popup blocker blocked the blank post, there should be only one tab.
+  EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
+                                        browser()->host_desktop_type()));
+  EXPECT_EQ(1, browser()->tab_strip_model()->count());
+  WebContents* web_contents =
+      browser()->tab_strip_model()->GetActiveWebContents();
+  EXPECT_EQ(url, web_contents->GetURL());
+
+  // And no new RVH created.
+  EXPECT_EQ(0, counter.GetRenderViewHostCreatedCount());
+
+  content::WindowedNotificationObserver observer(
+      chrome::NOTIFICATION_TAB_ADDED,
+      content::NotificationService::AllSources());
+  ui_test_utils::BrowserAddedObserver browser_observer;
+
+  // Launch the blocked popup.
+  PopupBlockerTabHelper* popup_blocker_helper =
+      PopupBlockerTabHelper::FromWebContents(web_contents);
+  EXPECT_EQ(1u, popup_blocker_helper->GetBlockedPopupsCount());
+  IDMap<chrome::NavigateParams, IDMapOwnPointer>::const_iterator iter(
+      &popup_blocker_helper->GetBlockedPopupRequests());
+  ASSERT_FALSE(iter.IsAtEnd());
+  popup_blocker_helper->ShowBlockedPopup(iter.GetCurrentKey());
+
+  observer.Wait();
+  Browser* new_browser = browser_observer.WaitForSingleNewBrowser();
+
+  // Check that the referrer was correctly set.
+  web_contents = new_browser->tab_strip_model()->GetActiveWebContents();
+  base::string16 expected_title(base::ASCIIToUTF16("PASS"));
+  content::TitleWatcher title_watcher(web_contents, expected_title);
+  EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
+}
+
 }  // namespace
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index bd0799f..852fd4d 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -179,6 +179,7 @@
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 #include "net/cookies/cookie_monster.h"
 #include "net/url_request/url_request_context.h"
+#include "third_party/WebKit/public/web/WebWindowFeatures.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/window_open_disposition.h"
 #include "ui/gfx/point.h"
@@ -216,6 +217,7 @@
 using extensions::Extension;
 using ui::WebDialogDelegate;
 using web_modal::WebContentsModalDialogManager;
+using WebKit::WebWindowFeatures;
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -1481,8 +1483,11 @@
     WindowContainerType window_container_type,
     const string16& frame_name,
     const GURL& target_url,
+    const content::Referrer& referrer,
     WindowOpenDisposition disposition,
-    bool user_gesture) {
+    const WebWindowFeatures& features,
+    bool user_gesture,
+    bool opener_suppressed) {
   if (window_container_type == WINDOW_CONTAINER_TYPE_BACKGROUND) {
     // If a BackgroundContents is created, suppress the normal WebContents.
     return !MaybeCreateBackgroundContents(
@@ -1505,12 +1510,29 @@
           switches::kDisablePopupBlocking)) {
     chrome::NavigateParams nav_params(
         this, target_url, content::PAGE_TRANSITION_LINK);
-    // TODO(jochen): route missing information to here:
-    //   referrer, extra_headers, override_encoding
-    nav_params.source_contents = web_contents;
-    nav_params.tabstrip_add_types = TabStripModel::ADD_NONE;
+    // TODO(jochen): route window features here.
+    nav_params.referrer = referrer;
+    if (!opener_suppressed)
+      nav_params.source_contents = web_contents;
+    nav_params.is_renderer_initiated = true;
+    nav_params.tabstrip_add_types = TabStripModel::ADD_ACTIVE;
     nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW;
     nav_params.user_gesture = user_gesture;
+    web_contents->GetView()->GetContainerBounds(&nav_params.window_bounds);
+    if (features.xSet)
+      nav_params.window_bounds.set_x(features.x);
+    if (features.ySet)
+      nav_params.window_bounds.set_y(features.y);
+    if (features.widthSet)
+      nav_params.window_bounds.set_width(features.width);
+    if (features.heightSet)
+      nav_params.window_bounds.set_height(features.height);
+
+    // Compare RenderViewImpl::show().
+    if (!user_gesture && disposition != NEW_BACKGROUND_TAB)
+      nav_params.disposition = NEW_POPUP;
+    else
+      nav_params.disposition = disposition;
 
     return !popup_blocker_helper->MaybeBlockPopup(nav_params);
   }
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 61be1dd..a26587d 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -566,8 +566,11 @@
       WindowContainerType window_container_type,
       const string16& frame_name,
       const GURL& target_url,
+      const content::Referrer& referrer,
       WindowOpenDisposition disposition,
-      bool user_action) OVERRIDE;
+      const WebKit::WebWindowFeatures& features,
+      bool user_action,
+      bool opener_suppressed) OVERRIDE;
   virtual void WebContentsCreated(content::WebContents* source_contents,
                                   int64 source_frame_id,
                                   const string16& frame_name,
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
index 8f4f659..58c279f 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_controller_unittest.mm
@@ -58,7 +58,6 @@
   virtual void SetUp() OVERRIDE {
     ChromeRenderViewHostTestHarness::SetUp();
     CocoaTest::BootstrapCocoa();
-    profile()->CreateRequestContext();
     Browser::CreateParams native_params(profile(), chrome::GetActiveDesktop());
     browser_.reset(
         chrome::CreateBrowserWithTestWindowForParams(&native_params));
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_interactive_browsertest.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_interactive_browsertest.cc
index 904c791..33bcea7 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_interactive_browsertest.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_interactive_browsertest.cc
@@ -15,11 +15,19 @@
 #include "content/public/test/test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::kAboutBlankURL;
-using content::PAGE_TRANSITION_TYPED;
 
-// Interactive test fixture testing Fullscreen Controller through its states. --
-// See documentation at the top of fullscreen_controller_state_unittest.cc.
+// FullscreenControllerStateInteractiveTest ------------------------------------
+
+// Interactive test fixture testing Fullscreen Controller through its states.
+//
+// Used to verify that the FullscreenControllerTestWindow models the behavior
+// of actual windows accurately. The interactive tests are too flaky to run
+// on infrastructure, and so those tests are disabled. Run them with:
+//     interactive_ui_tests
+//         --gtest_filter="FullscreenControllerStateInteractiveTest.*"
+//         --gtest_also_run_disabled_tests
+//
+// More context atop fullscreen_controller_state_test.h.
 class FullscreenControllerStateInteractiveTest
     : public InProcessBrowserTest,
       public FullscreenControllerStateTest {
@@ -32,9 +40,8 @@
   return InProcessBrowserTest::browser();
 }
 
-// Tests -----------------------------------------------------------------------
 
-// Soak tests:
+// Soak tests ------------------------------------------------------------------
 
 // Tests all states with all permutations of multiple events to detect lingering
 // state issues that would bleed over to other states.
@@ -47,13 +54,14 @@
 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest,
                        DISABLED_TransitionsForEachState) {
   // A tab is needed for tab fullscreen.
-  AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
+  AddTabAtIndex(0, GURL(content::kAboutBlankURL),
+                content::PAGE_TRANSITION_TYPED);
   TestTransitionsForEachState();
   // Progress of test can be examined via LOG(INFO) << GetAndClearDebugLog();
 }
 
 
-// Individual tests for each pair of state and event:
+// Individual tests for each pair of state and event ---------------------------
 
 // An "empty" test is included as part of each "TEST_EVENT" because it makes
 // running the entire test suite less flaky on MacOS. All of the tests pass
@@ -64,164 +72,25 @@
     } \
     IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, \
                            DISABLED_##state##__##event) { \
-      AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED); \
+      AddTabAtIndex(0, GURL(content::kAboutBlankURL), \
+                    content::PAGE_TRANSITION_TYPED); \
       ASSERT_NO_FATAL_FAILURE(TestStateAndEvent(state, event)) \
           << GetAndClearDebugLog(); \
     }
     // Progress of tests can be examined by inserting the following line:
     // LOG(INFO) << GetAndClearDebugLog(); }
 
-TEST_EVENT(STATE_NORMAL, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_NORMAL, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_NORMAL, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_NORMAL, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_NORMAL, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_NORMAL, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_NORMAL, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_NORMAL, BUBBLE_ALLOW);
-TEST_EVENT(STATE_NORMAL, BUBBLE_DENY);
-TEST_EVENT(STATE_NORMAL, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, WINDOW_CHANGE);
-
-#if defined(OS_WIN)
-TEST_EVENT(STATE_METRO_SNAP, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_METRO_SNAP, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_METRO_SNAP, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_METRO_SNAP, TAB_FULLSCREEN_FALSE);
-TEST_EVENT(STATE_METRO_SNAP, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_METRO_SNAP, METRO_SNAP_FALSE);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_ALLOW);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_DENY);
-TEST_EVENT(STATE_METRO_SNAP, WINDOW_CHANGE);
-#endif
-
-TEST_EVENT(STATE_TAB_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_FULLSCREEN, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_NORMAL, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_NORMAL, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_NORMAL, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_NORMAL, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_NORMAL, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_NORMAL, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_NORMAL, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, WINDOW_CHANGE);
+#include "chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h"
 
 
-// Specific one-off tests for known issues:
+// Specific one-off tests for known issues -------------------------------------
 
 // Used manually to determine what happens on a platform.
 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest,
                        DISABLED_ManualTest) {
   // A tab is needed for tab fullscreen.
-  AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
+  AddTabAtIndex(0, GURL(content::kAboutBlankURL),
+                content::PAGE_TRANSITION_TYPED);
   ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)) << GetAndClearDebugLog();
@@ -229,8 +98,8 @@
   ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog();
 
   // Wait, allowing human operator to observe the result.
-  scoped_refptr<content::MessageLoopRunner> message_loop;
-  message_loop = new content::MessageLoopRunner();
+  scoped_refptr<content::MessageLoopRunner> message_loop
+      = new content::MessageLoopRunner();
   message_loop->Run();
 }
 
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
index bbc4c23..cafbcd5 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc
@@ -198,22 +198,23 @@
       STATE_TAB_FULLSCREEN,                   // Event WINDOW_CHANGE
     },
   };
-  CHECK_EQ(sizeof(transition_table_data), sizeof(transition_table_));
+  COMPILE_ASSERT(sizeof(transition_table_data) == sizeof(transition_table_),
+                 transition_table_incorrect_size);
   memcpy(transition_table_, transition_table_data,
          sizeof(transition_table_data));
 
   // Verify that transition_table_ has been completely defined.
-  for (int source = 0; source < NUM_STATES; source++) {
-    for (int event = 0; event < NUM_EVENTS; event++) {
-      CHECK_NE(STATE_INVALID, transition_table_[source][event]);
-      CHECK_LE(0, transition_table_[source][event]);
-      CHECK_GT(NUM_STATES, transition_table_[source][event]);
+  for (int source = 0; source < NUM_STATES; ++source) {
+    for (int event = 0; event < NUM_EVENTS; ++event) {
+      EXPECT_NE(transition_table_[source][event], STATE_INVALID);
+      EXPECT_GE(transition_table_[source][event], 0);
+      EXPECT_LT(transition_table_[source][event], NUM_STATES);
     }
   }
 
   // Copy transition_table_ data into state_transitions_ table.
-  for (int source = 0; source < NUM_STATES; source++) {
-    for (int event = 0; event < NUM_EVENTS; event++) {
+  for (int source = 0; source < NUM_STATES; ++source) {
+    for (int event = 0; event < NUM_EVENTS; ++event) {
       if (ShouldSkipStateAndEventPair(static_cast<State>(source),
                                       static_cast<Event>(event)))
         continue;
@@ -231,30 +232,18 @@
 // static
 const char* FullscreenControllerStateTest::GetStateString(State state) {
   switch (state) {
-    case STATE_NORMAL:
-      return "STATE_NORMAL";
-    case STATE_BROWSER_FULLSCREEN_NO_CHROME:
-      return "STATE_BROWSER_FULLSCREEN_NO_CHROME";
-    case STATE_BROWSER_FULLSCREEN_WITH_CHROME:
-      return "STATE_BROWSER_FULLSCREEN_WITH_CHROME";
-    case STATE_METRO_SNAP:
-      return "STATE_METRO_SNAP";
-    case STATE_TAB_FULLSCREEN:
-      return "STATE_TAB_FULLSCREEN";
-    case STATE_TAB_BROWSER_FULLSCREEN:
-      return "STATE_TAB_BROWSER_FULLSCREEN";
-    case STATE_TAB_BROWSER_FULLSCREEN_CHROME:
-      return "STATE_TAB_BROWSER_FULLSCREEN_CHROME";
-    case STATE_TO_NORMAL:
-      return "STATE_TO_NORMAL";
-    case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME:
-      return "STATE_TO_BROWSER_FULLSCREEN_NO_CHROME";
-    case STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME:
-      return "STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME";
-    case STATE_TO_TAB_FULLSCREEN:
-      return "STATE_TO_TAB_FULLSCREEN";
-    case STATE_INVALID:
-      return "STATE_INVALID";
+    ENUM_TO_STRING(STATE_NORMAL);
+    ENUM_TO_STRING(STATE_BROWSER_FULLSCREEN_NO_CHROME);
+    ENUM_TO_STRING(STATE_BROWSER_FULLSCREEN_WITH_CHROME);
+    ENUM_TO_STRING(STATE_METRO_SNAP);
+    ENUM_TO_STRING(STATE_TAB_FULLSCREEN);
+    ENUM_TO_STRING(STATE_TAB_BROWSER_FULLSCREEN);
+    ENUM_TO_STRING(STATE_TAB_BROWSER_FULLSCREEN_CHROME);
+    ENUM_TO_STRING(STATE_TO_NORMAL);
+    ENUM_TO_STRING(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME);
+    ENUM_TO_STRING(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME);
+    ENUM_TO_STRING(STATE_TO_TAB_FULLSCREEN);
+    ENUM_TO_STRING(STATE_INVALID);
     default:
       NOTREACHED() << "No string for state " << state;
       return "State-Unknown";
@@ -264,28 +253,17 @@
 // static
 const char* FullscreenControllerStateTest::GetEventString(Event event) {
   switch (event) {
-    case TOGGLE_FULLSCREEN:
-      return "TOGGLE_FULLSCREEN";
-    case TOGGLE_FULLSCREEN_CHROME:
-      return "TOGGLE_FULLSCREEN_CHROME";
-    case TAB_FULLSCREEN_TRUE:
-      return "TAB_FULLSCREEN_TRUE";
-    case TAB_FULLSCREEN_FALSE:
-      return "TAB_FULLSCREEN_FALSE";
-    case METRO_SNAP_TRUE:
-      return "METRO_SNAP_TRUE";
-    case METRO_SNAP_FALSE:
-      return "METRO_SNAP_FALSE";
-    case BUBBLE_EXIT_LINK:
-      return "BUBBLE_EXIT_LINK";
-    case BUBBLE_ALLOW:
-      return "BUBBLE_ALLOW";
-    case BUBBLE_DENY:
-      return "BUBBLE_DENY";
-    case WINDOW_CHANGE:
-      return "WINDOW_CHANGE";
-    case EVENT_INVALID:
-      return "EVENT_INVALID";
+    ENUM_TO_STRING(TOGGLE_FULLSCREEN);
+    ENUM_TO_STRING(TOGGLE_FULLSCREEN_CHROME);
+    ENUM_TO_STRING(TAB_FULLSCREEN_TRUE);
+    ENUM_TO_STRING(TAB_FULLSCREEN_FALSE);
+    ENUM_TO_STRING(METRO_SNAP_TRUE);
+    ENUM_TO_STRING(METRO_SNAP_FALSE);
+    ENUM_TO_STRING(BUBBLE_EXIT_LINK);
+    ENUM_TO_STRING(BUBBLE_ALLOW);
+    ENUM_TO_STRING(BUBBLE_DENY);
+    ENUM_TO_STRING(WINDOW_CHANGE);
+    ENUM_TO_STRING(EVENT_INVALID);
     default:
       NOTREACHED() << "No string for event " << event;
       return "Event-Unknown";
@@ -293,7 +271,7 @@
 }
 
 // static
-bool FullscreenControllerStateTest::IsReentrant() {
+bool FullscreenControllerStateTest::IsWindowFullscreenStateChangedReentrant() {
 #if defined(TOOLKIT_VIEWS)
   return true;
 #else
@@ -312,11 +290,13 @@
     case STATE_TAB_BROWSER_FULLSCREEN:
     case STATE_TAB_BROWSER_FULLSCREEN_CHROME:
       return true;
+
     case STATE_TO_NORMAL:
     case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME:
     case STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME:
     case STATE_TO_TAB_FULLSCREEN:
       return false;
+
     default:
       NOTREACHED();
       return false;
@@ -378,13 +358,13 @@
 
   // When simulating reentrant window change calls, expect the next state
   // automatically.
-  if (IsReentrant())
+  if (IsWindowFullscreenStateChangedReentrant())
     next_state = transition_table_[next_state][WINDOW_CHANGE];
 
   debugging_log_ << "  InvokeEvent(" << std::left
-      << std::setw(MAX_EVENT_NAME_LENGTH) << GetEventString(event)
+      << std::setw(kMaxStateNameLength) << GetEventString(event)
       << ") to "
-      << std::setw(MAX_STATE_NAME_LENGTH) << GetStateString(next_state);
+      << std::setw(kMaxStateNameLength) << GetStateString(next_state);
 
   state_ = next_state;
 
@@ -392,6 +372,7 @@
     case TOGGLE_FULLSCREEN:
       GetFullscreenController()->ToggleFullscreenMode();
       break;
+
     case TOGGLE_FULLSCREEN_CHROME:
 #if defined(OS_MACOSX)
       if (chrome::mac::SupportsSystemFullscreen()) {
@@ -401,14 +382,17 @@
 #endif
       NOTREACHED() << GetAndClearDebugLog();
       break;
+
     case TAB_FULLSCREEN_TRUE:
       GetFullscreenController()->ToggleFullscreenModeForTab(
            GetBrowser()->tab_strip_model()->GetActiveWebContents(), true);
       break;
+
     case TAB_FULLSCREEN_FALSE:
       GetFullscreenController()->ToggleFullscreenModeForTab(
            GetBrowser()->tab_strip_model()->GetActiveWebContents(), false);
       break;
+
     case METRO_SNAP_TRUE:
 #if defined(OS_WIN)
       GetFullscreenController()->SetMetroSnapMode(true);
@@ -416,6 +400,7 @@
       NOTREACHED() << GetAndClearDebugLog();
 #endif
       break;
+
     case METRO_SNAP_FALSE:
 #if defined(OS_WIN)
       GetFullscreenController()->SetMetroSnapMode(false);
@@ -423,18 +408,23 @@
       NOTREACHED() << GetAndClearDebugLog();
 #endif
       break;
+
     case BUBBLE_EXIT_LINK:
       GetFullscreenController()->ExitTabOrBrowserFullscreenToPreviousState();
       break;
+
     case BUBBLE_ALLOW:
       GetFullscreenController()->OnAcceptFullscreenPermission();
       break;
+
     case BUBBLE_DENY:
       GetFullscreenController()->OnDenyFullscreenPermission();
       break;
+
     case WINDOW_CHANGE:
       ChangeWindowFullscreenState();
       break;
+
     default:
       NOTREACHED() << "InvokeEvent needs a handler for event "
           << GetEventString(event) << GetAndClearDebugLog();
@@ -455,152 +445,86 @@
 void FullscreenControllerStateTest::VerifyWindowState() {
   switch (state_) {
     case STATE_NORMAL:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_FALSE,
+                                    FULLSCREEN_FOR_BROWSER_FALSE,
+                                    FULLSCREEN_FOR_TAB_FALSE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_BROWSER_FULLSCREEN_NO_CHROME:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_TRUE,
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
+                                    FULLSCREEN_FOR_TAB_FALSE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_BROWSER_FULLSCREEN_WITH_CHROME:
-#if defined(OS_MACOSX)
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_TRUE,
+                                    FULLSCREEN_WITHOUT_CHROME_FALSE,
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
+                                    FULLSCREEN_FOR_TAB_FALSE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_METRO_SNAP:
-#if defined(OS_WIN)
-      // http://crbug.com/169138
-      // No expectation for IsFullscreenWithChrome() or
-      // IsFullscreenWithoutChrome()
-
-      // TODO(scheib) IsFullscreenForBrowser and IsFullscreenForTabOrPending
-      // are returning true and false in interactive tests with real window.
-      // With only a single Metro Snap state in this test framework it isn't
-      // fair to try to have an expectation anyway.
-      //
-      // No expectation for IsFullscreenForBrowser.
-      // No expectation for IsFullscreenForTabOrPending.
-      EXPECT_TRUE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
-#else
-      NOTREACHED() << GetAndClearDebugLog();
-#endif
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_NO_EXPECTATION,
+                                    FULLSCREEN_WITHOUT_CHROME_NO_EXPECTATION,
+                                    FULLSCREEN_FOR_BROWSER_NO_EXPECTATION,
+                                    FULLSCREEN_FOR_TAB_NO_EXPECTATION,
+                                    IN_METRO_SNAP_TRUE);
       break;
     case STATE_TAB_FULLSCREEN:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_TRUE,
+                                    FULLSCREEN_FOR_BROWSER_FALSE,
+                                    FULLSCREEN_FOR_TAB_TRUE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_TAB_BROWSER_FULLSCREEN:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_TRUE,
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
+                                    FULLSCREEN_FOR_TAB_TRUE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_TAB_BROWSER_FULLSCREEN_CHROME:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_TRUE,
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
+                                    FULLSCREEN_FOR_TAB_TRUE,
+                                    IN_METRO_SNAP_FALSE);
       break;
     case STATE_TO_NORMAL:
-#if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-#endif
-      // No expectation for IsFullscreenForBrowser.
-      // No expectation for IsFullscreenForTabOrPending.
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_FALSE,
+                                    FULLSCREEN_FOR_BROWSER_NO_EXPECTATION,
+                                    FULLSCREEN_FOR_TAB_NO_EXPECTATION,
+                                    IN_METRO_SNAP_FALSE);
       break;
+
     case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME:
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_FALSE,
+                                    FULLSCREEN_WITHOUT_CHROME_TRUE,
 #if defined(OS_MACOSX)
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
 #else
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_BROWSER_FALSE,
 #endif
-      // No expectation for IsFullscreenForTabOrPending.
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_TAB_NO_EXPECTATION,
+                                    IN_METRO_SNAP_FALSE);
       break;
+
     case STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME:
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_TRUE,
+                                    FULLSCREEN_WITHOUT_CHROME_FALSE,
 #if defined(OS_MACOSX)
-      EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithChrome())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_BROWSER_TRUE,
 #else
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_BROWSER_FALSE,
 #endif
-      // No expectation for IsFullscreenForTabOrPending.
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+                                    FULLSCREEN_FOR_TAB_NO_EXPECTATION,
+                                    IN_METRO_SNAP_FALSE);
       break;
+
     case STATE_TO_TAB_FULLSCREEN:
 #if defined(OS_MACOSX)
       // TODO(scheib) InPresentationMode returns false when invoking events:
@@ -612,13 +536,13 @@
       // EXPECT_TRUE(GetBrowser()->window()->InPresentationMode())
       //     << GetAndClearDebugLog();
 #endif
-      EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser())
-          << GetAndClearDebugLog();
-      EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending())
-          << GetAndClearDebugLog();
-      EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode())
-          << GetAndClearDebugLog();
+      VerifyWindowStateExpectations(FULLSCREEN_WITH_CHROME_NO_EXPECTATION,
+                                    FULLSCREEN_WITHOUT_CHROME_NO_EXPECTATION,
+                                    FULLSCREEN_FOR_BROWSER_FALSE,
+                                    FULLSCREEN_FOR_TAB_TRUE,
+                                    IN_METRO_SNAP_FALSE);
       break;
+
     default:
       NOTREACHED() << GetAndClearDebugLog();
   }
@@ -638,8 +562,8 @@
 }
 
 void FullscreenControllerStateTest::TestTransitionsForEachState() {
-  for (int source_int = 0; source_int < NUM_STATES; source_int++) {
-    for (int event1_int = 0; event1_int < NUM_EVENTS; event1_int++) {
+  for (int source_int = 0; source_int < NUM_STATES; ++source_int) {
+    for (int event1_int = 0; event1_int < NUM_EVENTS; ++event1_int) {
       State state = static_cast<State>(source_int);
       Event event1 = static_cast<Event>(event1_int);
 
@@ -647,8 +571,8 @@
       if (ShouldSkipTest(state, event1))
         continue;
 
-      for (int event2_int = 0; event2_int < NUM_EVENTS; event2_int++) {
-        for (int event3_int = 0; event3_int < NUM_EVENTS; event3_int++) {
+      for (int event2_int = 0; event2_int < NUM_EVENTS; ++event2_int) {
+        for (int event3_int = 0; event3_int < NUM_EVENTS; ++event3_int) {
           Event event2 = static_cast<Event>(event2_int);
           Event event3 = static_cast<Event>(event3_int);
 
@@ -673,8 +597,10 @@
 
 FullscreenControllerStateTest::StateTransitionInfo
     FullscreenControllerStateTest::NextTransitionInShortestPath(
-        State source, State destination, int search_limit) {
-  if (search_limit == 0)
+    State source,
+    State destination,
+    int search_limit) {
+  if (search_limit <= 0)
     return StateTransitionInfo();  // Return a default (invalid) state.
 
   if (state_transitions_[source][destination].state == STATE_INVALID) {
@@ -682,7 +608,7 @@
     StateTransitionInfo result;
 
     // Consider all states reachable via each event from the source state.
-    for (int event_int = 0; event_int < NUM_EVENTS; event_int++) {
+    for (int event_int = 0; event_int < NUM_EVENTS; ++event_int) {
       Event event = static_cast<Event>(event_int);
       State next_state_candidate = transition_table_[source][event];
 
@@ -771,7 +697,8 @@
   // will be unable to remain in, as they will progress due to the
   // reentrant window change call. Skip states that will be instantly
   // exited by the reentrant call.
-  if (IsReentrant() && (transition_table_[state][WINDOW_CHANGE] != state)) {
+  if (IsWindowFullscreenStateChangedReentrant() &&
+      (transition_table_[state][WINDOW_CHANGE] != state)) {
     debugging_log_ << "\nSkipping reentrant test for transitory source state "
         << GetStateString(state) << ".\n";
     return true;
@@ -797,9 +724,11 @@
 
   debugging_log_ << "\nTest transition from state "
       << GetStateString(state)
-      << (IsReentrant() ? " with reentrant calls.\n" : ".\n");
+      << (IsWindowFullscreenStateChangedReentrant() ?
+          " with reentrant calls.\n" : ".\n");
 
-  debugging_log_ << "First,                               from"
+  // Spaced out text to line up with columns printed in InvokeEvent().
+  debugging_log_ << "First,                                               from "
       << GetStateString(state_) << "\n";
   ASSERT_NO_FATAL_FAILURE(TransitionToState(state))
       << GetAndClearDebugLog();
@@ -808,6 +737,36 @@
   ASSERT_TRUE(InvokeEvent(event)) << GetAndClearDebugLog();
 }
 
+void FullscreenControllerStateTest::VerifyWindowStateExpectations(
+    FullscreenWithChromeExpectation fullscreen_with_chrome,
+    FullscreenWithoutChromeExpectation fullscreen_without_chrome,
+    FullscreenForBrowserExpectation fullscreen_for_browser,
+    FullscreenForTabExpectation fullscreen_for_tab,
+    InMetroSnapExpectation in_metro_snap) {
+#if defined(OS_MACOSX)
+  if (fullscreen_with_chrome != FULLSCREEN_WITH_CHROME_NO_EXPECTATION) {
+    EXPECT_EQ(GetBrowser()->window()->IsFullscreenWithChrome(),
+              !!fullscreen_with_chrome) << GetAndClearDebugLog();
+  }
+  if (fullscreen_without_chrome != FULLSCREEN_WITHOUT_CHROME_NO_EXPECTATION) {
+    EXPECT_EQ(GetBrowser()->window()->IsFullscreenWithoutChrome(),
+              !!fullscreen_without_chrome) << GetAndClearDebugLog();
+  }
+#endif
+  if (fullscreen_for_browser != FULLSCREEN_FOR_BROWSER_NO_EXPECTATION) {
+    EXPECT_EQ(GetFullscreenController()->IsFullscreenForBrowser(),
+              !!fullscreen_for_browser) << GetAndClearDebugLog();
+  }
+  if (fullscreen_for_tab != FULLSCREEN_FOR_TAB_NO_EXPECTATION) {
+    EXPECT_EQ(GetFullscreenController()->IsFullscreenForTabOrPending(),
+              !!fullscreen_for_tab) << GetAndClearDebugLog();
+  }
+  if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) {
+    EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(),
+              !!in_metro_snap) << GetAndClearDebugLog();
+  }
+}
+
 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() {
     return GetBrowser()->fullscreen_controller();
 }
@@ -817,13 +776,13 @@
   output << "transition_table_[NUM_STATES = " << NUM_STATES
       << "][NUM_EVENTS = " << NUM_EVENTS
       << "] =\n";
-  for (int state_int = 0; state_int < NUM_STATES; state_int++) {
+  for (int state_int = 0; state_int < NUM_STATES; ++state_int) {
     State state = static_cast<State>(state_int);
     output << "    { // " << GetStateString(state) << ":\n";
-    for (int event_int = 0; event_int < NUM_EVENTS; event_int++) {
+    for (int event_int = 0; event_int < NUM_EVENTS; ++event_int) {
       Event event = static_cast<Event>(event_int);
       output << "      "
-          << std::left << std::setw(MAX_STATE_NAME_LENGTH+1)
+          << std::left << std::setw(kMaxStateNameLength+1)
           << std::string(GetStateString(transition_table_[state][event])) + ","
           << "// Event "
           << GetEventString(event) << "\n";
@@ -838,16 +797,16 @@
   std::ostringstream output;
   output << "state_transitions_[NUM_STATES = " << NUM_STATES
       << "][NUM_STATES = " << NUM_STATES << "] =\n";
-  for (int state1_int = 0; state1_int < NUM_STATES; state1_int++) {
+  for (int state1_int = 0; state1_int < NUM_STATES; ++state1_int) {
     State state1 = static_cast<State>(state1_int);
     output << "{ // " << GetStateString(state1) << ":\n";
-    for (int state2_int = 0; state2_int < NUM_STATES; state2_int++) {
+    for (int state2_int = 0; state2_int < NUM_STATES; ++state2_int) {
       State state2 = static_cast<State>(state2_int);
-      const StateTransitionInfo &info = state_transitions_[state1][state2];
+      const StateTransitionInfo& info = state_transitions_[state1][state2];
       output << "  { "
-        << std::left << std::setw(MAX_EVENT_NAME_LENGTH+1)
+        << std::left << std::setw(kMaxStateNameLength+1)
         << std::string(GetEventString(info.event)) + ","
-        << std::left << std::setw(MAX_STATE_NAME_LENGTH+1)
+        << std::left << std::setw(kMaxStateNameLength+1)
         << std::string(GetStateString(info.state)) + ","
         << std::right << std::setw(2)
         << info.distance
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h
index de3e264..1417ed1 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h
@@ -16,9 +16,38 @@
 class FullscreenController;
 class FullscreenNotificationObserver;
 
-// Test fixture testing Fullscreen Controller through its states. --------------
+// Utility definition for mapping enum values to strings in switch statements.
+#define ENUM_TO_STRING(enum) case enum: return #enum
+
+// Test fixture used to test Fullscreen Controller through exhaustive sequences
+// of events in unit and interactive tests.
+//
+// Because operating system window managers are too unreliable (they result in
+// flakiness at around 1 out of 1000 runs) this fixture is designed to be run
+// on testing infrastructure in unit tests mocking out the platforms' behavior.
+// To verify that behavior interactive tests exist but are left disabled and
+// only run manually when verifying the consistency of the
+// FullscreenControllerTestWindow.
 class FullscreenControllerStateTest {
  public:
+  // Events names for FullscreenController methods.
+  enum Event {
+    TOGGLE_FULLSCREEN,         // ToggleFullscreenMode()
+    TOGGLE_FULLSCREEN_CHROME,  // ToggleFullscreenWithChrome()
+    TAB_FULLSCREEN_TRUE,       // ToggleFullscreenModeForTab(, true)
+    TAB_FULLSCREEN_FALSE,      // ToggleFullscreenModeForTab(, false)
+    METRO_SNAP_TRUE,           // SetMetroSnapMode(true)
+    METRO_SNAP_FALSE,          // SetMetroSnapMode(false)
+    BUBBLE_EXIT_LINK,          // ExitTabOrBrowserFullscreenToPreviousState()
+    BUBBLE_ALLOW,              // OnAcceptFullscreenPermission()
+    BUBBLE_DENY,               // OnDenyFullscreenPermission()
+    WINDOW_CHANGE,             // ChangeWindowFullscreenState()
+    NUM_EVENTS,
+    EVENT_INVALID,
+  };
+
+  // Conceptual states of the Fullscreen Controller, these do not correspond
+  // to particular implemenation details.
   enum State {
     // The window is not in fullscreen.
     STATE_NORMAL,
@@ -46,33 +75,8 @@
     STATE_INVALID,
   };
 
-  enum Event {
-    // FullscreenController::ToggleFullscreenMode()
-    TOGGLE_FULLSCREEN,
-    // FullscreenController::ToggleFullscreenWithChrome()
-    TOGGLE_FULLSCREEN_CHROME,
-    // FullscreenController::ToggleFullscreenModeForTab(, true)
-    TAB_FULLSCREEN_TRUE,
-    // FullscreenController::ToggleFullscreenModeForTab(, false)
-    TAB_FULLSCREEN_FALSE,
-    // FullscreenController::SetMetroSnapMode(true)
-    METRO_SNAP_TRUE,
-    // FullscreenController::SetMetroSnapMode(flase)
-    METRO_SNAP_FALSE,
-    // FullscreenController::ExitTabOrBrowserFullscreenToPreviousState
-    BUBBLE_EXIT_LINK,
-    // FullscreenController::OnAcceptFullscreenPermission
-    BUBBLE_ALLOW,
-    // FullscreenController::OnDenyFullscreenPermission
-    BUBBLE_DENY,
-    // FullscreenController::ChangeWindowFullscreenState()
-    WINDOW_CHANGE,
-    NUM_EVENTS,
-    EVENT_INVALID,
-  };
-
-  static const int MAX_STATE_NAME_LENGTH = 39;
-  static const int MAX_EVENT_NAME_LENGTH = 24;
+  static const int kMaxStateNameLength = 39;
+  static const int kMaxEventNameLength = 24;
 
   FullscreenControllerStateTest();
   virtual ~FullscreenControllerStateTest();
@@ -80,9 +84,10 @@
   static const char* GetStateString(State state);
   static const char* GetEventString(Event event);
 
-  // Returns true if WindowFullscreenStateChanged() is called synchronously as a
-  // result of calling BrowserWindow's fullscreen related modifiers.
-  static bool IsReentrant();
+  // Returns true if FullscreenController::WindowFullscreenStateChanged()
+  // will be called and re-enter FullscreenController before
+  // FullscreenController methods complete.
+  static bool IsWindowFullscreenStateChangedReentrant();
 
   // Returns true if |state| can be persistent. This is true for all of the
   // states without "_TO_" in their name.
@@ -90,12 +95,18 @@
 
   // Causes Fullscreen Controller to transition to an arbitrary state.
   void TransitionToState(State state);
+
   // Makes one state change to approach |destination_state| via shortest path.
   // Returns true if a state change is made.
   // Repeated calls are needed to reach the destination.
   bool TransitionAStepTowardState(State destination_state);
 
+  // Calls FullscreenController::ChangeWindowFullscreenState if needed because
+  // a mock BrowserWindow is being used.
   virtual void ChangeWindowFullscreenState() {}
+
+  // Returns a description of the window's state, may return NULL.
+  // FullscreenControllerStateTest owns the returned pointer.
   virtual const char* GetWindowStateString();
 
   // Causes the |event| to occur and return true on success.
@@ -124,6 +135,21 @@
   std::string GetStateTransitionsAsString() const;
 
  protected:
+  // Set of enumerations (created with a helper macro) for _FALSE, _TRUE, and
+  // _NO_EXPECTATION values to be passed to VerifyWindowStateExpectations().
+  #define EXPECTATION_ENUM(enum_name, enum_prefix) \
+      enum enum_name { \
+        enum_prefix##_FALSE, \
+        enum_prefix##_TRUE, \
+        enum_prefix##_NO_EXPECTATION \
+      }
+  EXPECTATION_ENUM(FullscreenWithChromeExpectation, FULLSCREEN_WITH_CHROME);
+  EXPECTATION_ENUM(FullscreenWithoutChromeExpectation,
+                   FULLSCREEN_WITHOUT_CHROME);
+  EXPECTATION_ENUM(FullscreenForBrowserExpectation, FULLSCREEN_FOR_BROWSER);
+  EXPECTATION_ENUM(FullscreenForTabExpectation, FULLSCREEN_FOR_TAB);
+  EXPECTATION_ENUM(InMetroSnapExpectation, IN_METRO_SNAP);
+
   // Generated information about the transitions between states.
   struct StateTransitionInfo {
     StateTransitionInfo()
@@ -140,6 +166,8 @@
                                                    State destination,
                                                    int search_limit);
 
+  // Returns a detailed log of what FullscreenControllerStateTest has done
+  // up to this point, to be reported when tests fail.
   std::string GetAndClearDebugLog();
 
   // Returns true if the |state| & |event| pair should be skipped.
@@ -151,9 +179,23 @@
   // Runs one test of transitioning to a state and invoking an event.
   virtual void TestStateAndEvent(State state, Event event);
 
+  // Checks that window state matches the expected controller state.
+  virtual void VerifyWindowStateExpectations(
+      FullscreenWithChromeExpectation fullscreen_with_chrome,
+      FullscreenWithoutChromeExpectation fullscreen_without_chrome,
+      FullscreenForBrowserExpectation fullscreen_for_browser,
+      FullscreenForTabExpectation fullscreen_for_tab,
+      InMetroSnapExpectation in_metro_snap);
+
+
   virtual Browser* GetBrowser() = 0;
   FullscreenController* GetFullscreenController();
 
+  // The state the FullscreenController is expected to be in.
+  State state() const { return state_; }
+
+ private:
+  // The state the FullscreenController is expected to be in.
   State state_;
 
   // The state when the previous NOTIFICATION_FULLSCREEN_CHANGED notification
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h b/chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h
new file mode 100644
index 0000000..ed8931d
--- /dev/null
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h
@@ -0,0 +1,47 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_STATE_TESTS_H_
+#define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_STATE_TESTS_H_
+
+// Macros used to create individual tests for all state and event pairs.
+// To be included in the middle of a test .cc file just after a definition for
+// TEST_EVENT in order to instantiate all the necessary actual tests.  See
+// fullscreen_controller_state_interactive_browsertest.cc and
+// fullscreen_controller_state_unittest.cc.
+
+#define TEST_ALL_EVENTS_NON_METRO(state) \
+    TEST_EVENT(state, TOGGLE_FULLSCREEN) \
+    TEST_EVENT(state, TOGGLE_FULLSCREEN_CHROME) \
+    TEST_EVENT(state, TAB_FULLSCREEN_TRUE) \
+    TEST_EVENT(state, TAB_FULLSCREEN_FALSE) \
+    TEST_EVENT(state, BUBBLE_EXIT_LINK) \
+    TEST_EVENT(state, BUBBLE_ALLOW) \
+    TEST_EVENT(state, BUBBLE_DENY) \
+    TEST_EVENT(state, WINDOW_CHANGE)
+
+#if defined(OS_WIN)
+#define TEST_ALL_EVENTS(state) \
+    TEST_ALL_EVENTS_NON_METRO(state) \
+    TEST_EVENT(state, METRO_SNAP_TRUE) \
+    TEST_EVENT(state, METRO_SNAP_FALSE)
+#else
+#define TEST_ALL_EVENTS(state) TEST_ALL_EVENTS_NON_METRO(state)
+#endif
+
+TEST_ALL_EVENTS(STATE_NORMAL);
+TEST_ALL_EVENTS(STATE_BROWSER_FULLSCREEN_NO_CHROME);
+TEST_ALL_EVENTS(STATE_BROWSER_FULLSCREEN_WITH_CHROME);
+#if defined(OS_WIN)
+TEST_ALL_EVENTS(STATE_METRO_SNAP);
+#endif
+TEST_ALL_EVENTS(STATE_TAB_FULLSCREEN);
+TEST_ALL_EVENTS(STATE_TAB_BROWSER_FULLSCREEN);
+TEST_ALL_EVENTS(STATE_TAB_BROWSER_FULLSCREEN_CHROME);
+TEST_ALL_EVENTS(STATE_TO_NORMAL);
+TEST_ALL_EVENTS(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME);
+TEST_ALL_EVENTS(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME);
+TEST_ALL_EVENTS(STATE_TO_TAB_FULLSCREEN);
+
+#endif  // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_STATE_TESTS_H_
diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
index 885bb76..0f2d94d 100644
--- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
+++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
@@ -16,16 +16,12 @@
 // The FullscreenControllerStateUnitTest unit test suite exhastively tests
 // the FullscreenController through all permutations of events. The behavior
 // of the BrowserWindow is mocked via FullscreenControllerTestWindow.
-//
-// FullscreenControllerStateInteractiveTest is an interactive test suite
-// used to verify that the FullscreenControllerTestWindow models the behavior
-// of actual windows accurately. The interactive tests are too flaky to run
-// on infrastructure, and so those tests are disabled. Run them with:
-//     interactive_ui_tests
-//         --gtest_filter="FullscreenControllerStateInteractiveTest.*"
-//         --gtest_also_run_disabled_tests
 
-// A BrowserWindow used for testing FullscreenController. ----------------------
+
+// FullscreenControllerTestWindow ----------------------------------------------
+
+// A BrowserWindow used for testing FullscreenController. The behavior of this
+// mock is verfied manually by running FullscreenControllerStateInteractiveTest.
 class FullscreenControllerTestWindow : public TestBrowserWindow {
  public:
   // Simulate the window state with an enumeration.
@@ -113,13 +109,10 @@
 
 #if defined(OS_WIN)
 void FullscreenControllerTestWindow::SetMetroSnapMode(bool enable) {
-  if (enable != IsInMetroSnapMode()) {
-    if (enable)
-      state_ = METRO_SNAP;
-    else
-      state_ = NORMAL;
-  }
-  if (FullscreenControllerStateTest::IsReentrant())
+  if (enable != IsInMetroSnapMode())
+    state_ = enable ? METRO_SNAP : NORMAL;
+
+  if (FullscreenControllerStateTest::IsWindowFullscreenStateChangedReentrant())
     ChangeWindowFullscreenState();
 }
 
@@ -146,16 +139,11 @@
 const char* FullscreenControllerTestWindow::GetWindowStateString(
     WindowState state) {
   switch (state) {
-    case NORMAL:
-      return "NORMAL";
-    case FULLSCREEN:
-      return "FULLSCREEN";
-    case METRO_SNAP:
-      return "METRO_SNAP";
-    case TO_FULLSCREEN:
-      return "TO_FULLSCREEN";
-    case TO_NORMAL:
-      return "TO_NORMAL";
+    ENUM_TO_STRING(NORMAL);
+    ENUM_TO_STRING(FULLSCREEN);
+    ENUM_TO_STRING(METRO_SNAP);
+    ENUM_TO_STRING(TO_FULLSCREEN);
+    ENUM_TO_STRING(TO_NORMAL);
     default:
       NOTREACHED() << "No string for state " << state;
       return "WindowState-Unknown";
@@ -163,25 +151,14 @@
 }
 
 void FullscreenControllerTestWindow::ChangeWindowFullscreenState() {
-  // Several states result in "no operation" intentionally. The tests
+  // Most states result in "no operation" intentionally. The tests
   // assume that all possible states and event pairs can be tested, even
   // though window managers will not generate all of these.
-  switch (state_) {
-    case NORMAL:
-      break;
-    case FULLSCREEN:
-      break;
-    case METRO_SNAP:
-      break;
-    case TO_FULLSCREEN:
+  if (state_ == TO_FULLSCREEN)
       state_ = FULLSCREEN;
-      break;
-    case TO_NORMAL:
+  else if (state_ == TO_NORMAL)
       state_ = NORMAL;
-      break;
-    default:
-      NOTREACHED();
-  }
+
   // Emit a change event from every state to ensure the Fullscreen Controller
   // handles it in all circumstances.
   browser_->WindowFullscreenStateChanged();
@@ -213,7 +190,7 @@
   if (!fullscreen_changed && !mac_with_chrome_mode_changed)
     return false;
 
-  if (FullscreenControllerStateTest::IsReentrant())
+  if (FullscreenControllerStateTest::IsWindowFullscreenStateChangedReentrant())
     return true;
 
   // BrowserWindowCocoa::EnterFullscreen() and
@@ -224,7 +201,11 @@
       mac_with_chrome_mode_changed;
 }
 
-// Unit test fixture testing Fullscreen Controller through its states. ---------
+
+// FullscreenControllerStateUnitTest -------------------------------------------
+
+// Unit test fixture testing Fullscreen Controller through its states. Most of
+// the test logic comes from FullscreenControllerStateTest.
 class FullscreenControllerStateUnitTest : public BrowserWithTestWindowTest,
                                           public FullscreenControllerStateTest {
  public:
@@ -267,53 +248,40 @@
 }
 
 void FullscreenControllerStateUnitTest::VerifyWindowState() {
-  switch (state_) {
+  switch (state()) {
     case STATE_NORMAL:
       EXPECT_EQ(FullscreenControllerTestWindow::NORMAL,
                 window_->state()) << GetAndClearDebugLog();
       break;
+
     case STATE_BROWSER_FULLSCREEN_NO_CHROME:
-      EXPECT_EQ(FullscreenControllerTestWindow::FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
     case STATE_BROWSER_FULLSCREEN_WITH_CHROME:
+    case STATE_TAB_FULLSCREEN:
+    case STATE_TAB_BROWSER_FULLSCREEN:
+    case STATE_TAB_BROWSER_FULLSCREEN_CHROME:
       EXPECT_EQ(FullscreenControllerTestWindow::FULLSCREEN,
                 window_->state()) << GetAndClearDebugLog();
       break;
+
 #if defined(OS_WIN)
     case STATE_METRO_SNAP:
       EXPECT_EQ(FullscreenControllerTestWindow::METRO_SNAP,
                 window_->state()) << GetAndClearDebugLog();
       break;
 #endif
-    case STATE_TAB_FULLSCREEN:
-      EXPECT_EQ(FullscreenControllerTestWindow::FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
-    case STATE_TAB_BROWSER_FULLSCREEN:
-      EXPECT_EQ(FullscreenControllerTestWindow::FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
-    case STATE_TAB_BROWSER_FULLSCREEN_CHROME:
-      EXPECT_EQ(FullscreenControllerTestWindow::FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
+
     case STATE_TO_NORMAL:
       EXPECT_EQ(FullscreenControllerTestWindow::TO_NORMAL,
                 window_->state()) << GetAndClearDebugLog();
       break;
+
     case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME:
-      EXPECT_EQ(FullscreenControllerTestWindow::TO_FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
     case STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME:
-      EXPECT_EQ(FullscreenControllerTestWindow::TO_FULLSCREEN,
-                window_->state()) << GetAndClearDebugLog();
-      break;
     case STATE_TO_TAB_FULLSCREEN:
       EXPECT_EQ(FullscreenControllerTestWindow::TO_FULLSCREEN,
                 window_->state()) << GetAndClearDebugLog();
       break;
+
     default:
       NOTREACHED() << GetAndClearDebugLog();
   }
@@ -344,18 +312,8 @@
   return BrowserWithTestWindowTest::browser();
 }
 
-// Tests -----------------------------------------------------------------------
 
-#define TEST_EVENT(state, event) \
-    TEST_F(FullscreenControllerStateUnitTest, state##__##event) { \
-      AddTab(browser(), GURL(content::kAboutBlankURL)); \
-      ASSERT_NO_FATAL_FAILURE(TestStateAndEvent(state, event)) \
-          << GetAndClearDebugLog(); \
-    }
-    // Progress of tests can be examined by inserting the following line:
-    // LOG(INFO) << GetAndClearDebugLog(); }
-
-// Soak tests:
+// Soak tests ------------------------------------------------------------------
 
 // Tests all states with all permutations of multiple events to detect lingering
 // state issues that would bleed over to other states.
@@ -373,159 +331,29 @@
 }
 
 
-// Individual tests for each pair of state and event:
+// Individual tests for each pair of state and event ---------------------------
 
-TEST_EVENT(STATE_NORMAL, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_NORMAL, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_NORMAL, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_NORMAL, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_NORMAL, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_NORMAL, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_NORMAL, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_NORMAL, BUBBLE_ALLOW);
-TEST_EVENT(STATE_NORMAL, BUBBLE_DENY);
-TEST_EVENT(STATE_NORMAL, WINDOW_CHANGE);
+#define TEST_EVENT(state, event) \
+    TEST_F(FullscreenControllerStateUnitTest, state##__##event) { \
+      AddTab(browser(), GURL(content::kAboutBlankURL)); \
+      ASSERT_NO_FATAL_FAILURE(TestStateAndEvent(state, event)) \
+          << GetAndClearDebugLog(); \
+    }
+    // Progress of tests can be examined by inserting the following line:
+    // LOG(INFO) << GetAndClearDebugLog(); }
 
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_NO_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_BROWSER_FULLSCREEN_WITH_CHROME, WINDOW_CHANGE);
-
-#if defined(OS_WIN)
-TEST_EVENT(STATE_METRO_SNAP, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_METRO_SNAP, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_METRO_SNAP, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_METRO_SNAP, TAB_FULLSCREEN_FALSE);
-TEST_EVENT(STATE_METRO_SNAP, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_METRO_SNAP, METRO_SNAP_FALSE);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_ALLOW);
-TEST_EVENT(STATE_METRO_SNAP, BUBBLE_DENY);
-TEST_EVENT(STATE_METRO_SNAP, WINDOW_CHANGE);
-#endif
-
-TEST_EVENT(STATE_TAB_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_FULLSCREEN, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TAB_BROWSER_FULLSCREEN_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_NORMAL, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_NORMAL, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_NORMAL, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_NORMAL, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_NORMAL, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_NORMAL, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_NORMAL, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_NORMAL, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_BROWSER_FULLSCREEN_WITH_CHROME, WINDOW_CHANGE);
-
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TOGGLE_FULLSCREEN);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TOGGLE_FULLSCREEN_CHROME);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TAB_FULLSCREEN_TRUE);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, TAB_FULLSCREEN_FALSE);
-#if defined(OS_WIN)
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, METRO_SNAP_TRUE);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, METRO_SNAP_FALSE);
-#endif
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_EXIT_LINK);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_ALLOW);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, BUBBLE_DENY);
-TEST_EVENT(STATE_TO_TAB_FULLSCREEN, WINDOW_CHANGE);
+#include "chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h"
 
 
-// Specific one-off tests for known issues:
+// Specific one-off tests for known issues -------------------------------------
 
 // TODO(scheib) Toggling Tab fullscreen while pending Tab or
 // Browser fullscreen is broken currently http://crbug.com/154196
 TEST_F(FullscreenControllerStateUnitTest,
        DISABLED_ToggleTabWhenPendingBrowser) {
-#if !defined(OS_WIN)  // Only possible without reentrancy
+  // Only possible without reentrancy.
+  if (FullscreenControllerStateTest::IsWindowFullscreenStateChangedReentrant())
+    return;
   AddTab(browser(), GURL(content::kAboutBlankURL));
   ASSERT_NO_FATAL_FAILURE(
       TransitionToState(STATE_TO_BROWSER_FULLSCREEN_NO_CHROME))
@@ -534,13 +362,14 @@
   ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_FALSE)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog();
-#endif
 }
 
 // TODO(scheib) Toggling Tab fullscreen while pending Tab or
 // Browser fullscreen is broken currently http://crbug.com/154196
 TEST_F(FullscreenControllerStateUnitTest, DISABLED_ToggleTabWhenPendingTab) {
-#if !defined(OS_WIN)  // Only possible without reentrancy
+  // Only possible without reentrancy.
+  if (FullscreenControllerStateTest::IsWindowFullscreenStateChangedReentrant())
+    return;
   AddTab(browser(), GURL(content::kAboutBlankURL));
   ASSERT_NO_FATAL_FAILURE(
       TransitionToState(STATE_TO_TAB_FULLSCREEN))
@@ -549,7 +378,6 @@
   ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_FALSE)) << GetAndClearDebugLog();
   ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog();
-#endif
 }
 
 // Debugging utility: Display the transition tables. Intentionally disabled
@@ -562,9 +390,9 @@
   output << GetStateTransitionsAsString();
 
   // Calculate all transition pairs.
-  for (int state1_int = 0; state1_int < NUM_STATES; state1_int++) {
+  for (int state1_int = 0; state1_int < NUM_STATES; ++state1_int) {
     State state1 = static_cast<State>(state1_int);
-    for (int state2_int = 0; state2_int < NUM_STATES; state2_int++) {
+    for (int state2_int = 0; state2_int < NUM_STATES; ++state2_int) {
       State state2 = static_cast<State>(state2_int);
       if (ShouldSkipStateAndEventPair(state1, EVENT_INVALID) ||
           ShouldSkipStateAndEventPair(state2, EVENT_INVALID))
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc
index faf842d..c520df9 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc
@@ -5,7 +5,7 @@
 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h"
 
 #include "base/compiler_specific.h"
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/bookmarks/bookmark_model.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
@@ -14,11 +14,9 @@
 #include "chrome/test/base/test_browser_window.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chrome/test/base/ui_test_utils.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using content::BrowserThread;
-
 // Dummy implementation that's good enough for the tests; we don't test
 // rendering here so all we need is a non-NULL object.
 class EmptyTabstripOriginProvider : public TabstripOriginProvider {
@@ -30,11 +28,6 @@
 
 class BookmarkBarGtkUnittest : public testing::Test {
  protected:
-  BookmarkBarGtkUnittest()
-      : ui_thread_(BrowserThread::UI, &message_loop_),
-        file_thread_(BrowserThread::FILE, &message_loop_) {
-  }
-
   virtual void SetUp() OVERRIDE {
     profile_.reset(new TestingProfile());
     profile_->CreateBookmarkModel(true);
@@ -51,7 +44,7 @@
   }
 
   virtual void TearDown() OVERRIDE {
-    message_loop_.RunUntilIdle();
+    base::RunLoop().RunUntilIdle();
 
     bookmark_bar_.reset();
     origin_provider_.reset();
@@ -61,9 +54,7 @@
 
   BookmarkModel* model_;
 
-  base::MessageLoopForUI message_loop_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread file_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
   scoped_ptr<TestingProfile> profile_;
   scoped_ptr<Browser> browser_;
diff --git a/chrome/browser/ui/omnibox/omnibox_current_page_delegate.h b/chrome/browser/ui/omnibox/omnibox_current_page_delegate.h
index e91aa2d..b21495b 100644
--- a/chrome/browser/ui/omnibox/omnibox_current_page_delegate.h
+++ b/chrome/browser/ui/omnibox/omnibox_current_page_delegate.h
@@ -54,9 +54,7 @@
   // Notifies the SearchTabHelper, if one exists, of relevant changes to the
   // omnibox state.
   virtual void NotifySearchTabHelper(bool user_input_in_progress,
-                                     bool cancelling,
-                                     bool popup_is_open,
-                                     bool user_text_is_empty) = 0;
+                                     bool cancelling) = 0;
 
   // Performs prerendering for |match|.
   virtual void DoPrerender(const AutocompleteMatch& match) = 0;
diff --git a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
index 7868c8c..e26f8d5 100644
--- a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
+++ b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
@@ -74,15 +74,12 @@
 
 void OmniboxCurrentPageDelegateImpl::NotifySearchTabHelper(
     bool user_input_in_progress,
-    bool cancelling,
-    bool popup_is_open,
-    bool user_text_is_empty) {
+    bool cancelling) {
   if (!controller_->GetWebContents())
     return;
   SearchTabHelper::FromWebContents(
       controller_->GetWebContents())->OmniboxEditModelChanged(
-          user_input_in_progress, cancelling, popup_is_open,
-          user_text_is_empty);
+          user_input_in_progress, cancelling);
 }
 
 void OmniboxCurrentPageDelegateImpl::DoPrerender(
diff --git a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h
index 9ef4581..5546ad0 100644
--- a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h
+++ b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h
@@ -30,9 +30,7 @@
       const AutocompleteMatch& match,
       WindowOpenDisposition disposition) OVERRIDE;
   virtual void NotifySearchTabHelper(bool user_input_in_progress,
-                                     bool cancelling,
-                                     bool popup_is_open,
-                                     bool user_text_is_empty) OVERRIDE;
+                                     bool cancelling) OVERRIDE;
   virtual void DoPrerender(const AutocompleteMatch& match) OVERRIDE;
 
  private:
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 7ade221..bdc292c 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -116,18 +116,18 @@
   if (search_term_replacement_active) {
     if (transition == content::PAGE_TRANSITION_TYPED) {
       UMA_HISTOGRAM_PERCENTAGE(
-          "InstantExtended.PercentageMatchQuerytoURL", percent);
+          "InstantExtended.PercentageMatchV2_QuerytoURL", percent);
     } else {
       UMA_HISTOGRAM_PERCENTAGE(
-          "InstantExtended.PercentageMatchQuerytoQuery", percent);
+          "InstantExtended.PercentageMatchV2_QuerytoQuery", percent);
     }
   } else {
     if (transition == content::PAGE_TRANSITION_TYPED) {
       UMA_HISTOGRAM_PERCENTAGE(
-          "InstantExtended.PercentageMatchURLtoURL", percent);
+          "InstantExtended.PercentageMatchV2_URLtoURL", percent);
     } else {
       UMA_HISTOGRAM_PERCENTAGE(
-          "InstantExtended.PercentageMatchURLtoQuery", percent);
+          "InstantExtended.PercentageMatchV2_URLtoQuery", percent);
     }
   }
 }
@@ -435,8 +435,7 @@
   }
   controller_->OnInputInProgress(in_progress);
 
-  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_,
-                                   popup_model()->IsOpen(), user_text_.empty());
+  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_);
 }
 
 void OmniboxEditModel::Revert() {
@@ -765,8 +764,7 @@
 void OmniboxEditModel::AcceptTemporaryTextAsUserText() {
   InternalSetUserText(UserTextFromDisplayText(view_->GetText()));
   has_temporary_text_ = false;
-  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_,
-                                   popup_model()->IsOpen(), user_text_.empty());
+  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_);
 }
 
 void OmniboxEditModel::ClearKeyword(const string16& visible_text) {
@@ -814,8 +812,7 @@
                                                 permanent_text_);
   }
 
-  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_,
-                                   popup_model()->IsOpen(), user_text_.empty());
+  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_);
 }
 
 void OmniboxEditModel::SetCaretVisibility(bool visible) {
@@ -836,8 +833,7 @@
 
   // TODO(jered): Rip this out along with StartZeroSuggest.
   autocomplete_controller()->StopZeroSuggest();
-  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_,
-                                   popup_model()->IsOpen(), user_text_.empty());
+  delegate_->NotifySearchTabHelper(user_input_in_progress_, !in_revert_);
 }
 
 void OmniboxEditModel::OnKillFocus() {
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index 7d2f2c8..686d654 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -579,48 +579,6 @@
   EXPECT_TRUE(favicon_tab_helper->ShouldDisplayFavicon());
 }
 
-IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ProcessIsolation) {
-  // Prior to setup, Instant has an ntp with a failed "google.com" load in
-  // it, which is rendered in the dedicated Instant renderer process.
-  //
-  // TODO(sreeram): Fix this up when we stop doing crazy things on init.
-  InstantService* instant_service =
-        InstantServiceFactory::GetForProfile(browser()->profile());
-  ASSERT_NE(static_cast<InstantService*>(NULL), instant_service);
-#if !defined(OS_MACOSX)
-  // The failed "google.com" load is deleted, which sometimes leads to the
-  // process shutting down on Mac.
-  EXPECT_EQ(1, instant_service->GetInstantProcessCount());
-#endif
-
-  // Setup Instant.
-  ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
-  FocusOmniboxAndWaitForInstantNTPSupport();
-
-  // The registered Instant render process should still exist.
-  EXPECT_EQ(1, instant_service->GetInstantProcessCount());
-  // And the Instant ntp should live inside it.
-  content::WebContents* ntp_contents = instant()->ntp_->contents();
-  EXPECT_TRUE(instant_service->IsInstantProcess(
-      ntp_contents->GetRenderProcessHost()->GetID()));
-
-  // Navigating to the NTP should use the Instant render process.
-  ui_test_utils::NavigateToURLWithDisposition(
-      browser(),
-      GURL(chrome::kChromeUINewTabURL),
-      CURRENT_TAB,
-      ui_test_utils::BROWSER_TEST_NONE);
-  content::WebContents* active_tab =
-      browser()->tab_strip_model()->GetActiveWebContents();
-  EXPECT_TRUE(instant_service->IsInstantProcess(
-      active_tab->GetRenderProcessHost()->GetID()));
-
-  // Navigating elsewhere should not use the Instant render process.
-  ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIAboutURL));
-  EXPECT_FALSE(instant_service->IsInstantProcess(
-      active_tab->GetRenderProcessHost()->GetID()));
-}
-
 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_MostVisited) {
   content::WindowedNotificationObserver observer(
       chrome::NOTIFICATION_INSTANT_SENT_MOST_VISITED_ITEMS,
@@ -951,54 +909,6 @@
               old_render_view_id != new_render_view_id);
 }
 
-// Test that renderer initiated navigations to an Instant URL from an
-// Instant process end up in an Instant process.
-IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
-                       RendererInitiatedNavigationInInstantProcess) {
-  InstantService* instant_service =
-      InstantServiceFactory::GetForProfile(browser()->profile());
-  ASSERT_NE(static_cast<InstantService*>(NULL), instant_service);
-
-  // Setup Instant.
-  ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
-  FocusOmniboxAndWaitForInstantNTPSupport();
-
-  EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
-  EXPECT_EQ(1, browser()->tab_strip_model()->count());
-
-  ui_test_utils::NavigateToURLWithDisposition(
-      browser(),
-      instant_url(),
-      CURRENT_TAB,
-      ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
-  content::WebContents* contents =
-      browser()->tab_strip_model()->GetActiveWebContents();
-  EXPECT_TRUE(instant_service->IsInstantProcess(
-      contents->GetRenderProcessHost()->GetID()));
-
-  std::string instant_url_with_query = instant_url().spec() + "q=3";
-  std::string add_link_script = base::StringPrintf(
-      "var a = document.createElement('a');"
-      "a.id = 'toClick';"
-      "a.href = '%s';"
-      "document.body.appendChild(a);",
-      instant_url_with_query.c_str());
-  EXPECT_TRUE(content::ExecuteScript(contents, add_link_script));
-
-  content::WindowedNotificationObserver observer(
-        content::NOTIFICATION_NAV_ENTRY_COMMITTED,
-        content::NotificationService::AllSources());
-  EXPECT_TRUE(content::ExecuteScript(
-      contents, "document.getElementById('toClick').click();"));
-  observer.Wait();
-
-  EXPECT_EQ(1, browser()->tab_strip_model()->count());
-  contents = browser()->tab_strip_model()->GetActiveWebContents();
-  EXPECT_TRUE(instant_service->IsInstantProcess(
-      contents->GetRenderProcessHost()->GetID()));
-  EXPECT_EQ(GURL(instant_url_with_query), contents->GetURL());
-}
-
 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, AcceptingURLSearchDoesNotNavigate) {
   // Get a committed Instant tab, which will be in the Instant process and thus
   // support chrome::GetSearchTerms().
@@ -1805,3 +1715,94 @@
   // Make sure the URL remains the same.
   EXPECT_EQ(ntp_url, ntp_contents->GetURL());
 }
+
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ProcessIsolation) {
+  // Prior to setup, Instant has an ntp with a failed "google.com" load in
+  // it, which is rendered in the dedicated Instant renderer process.
+  //
+  // TODO(sreeram): Fix this up when we stop doing crazy things on init.
+  InstantService* instant_service =
+        InstantServiceFactory::GetForProfile(browser()->profile());
+  ASSERT_NE(static_cast<InstantService*>(NULL), instant_service);
+#if !defined(OS_MACOSX)
+  // The failed "google.com" load is deleted, which sometimes leads to the
+  // process shutting down on Mac.
+  EXPECT_EQ(1, instant_service->GetInstantProcessCount());
+#endif
+
+  // Setup Instant.
+  ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+  FocusOmniboxAndWaitForInstantNTPSupport();
+
+  // The registered Instant render process should still exist.
+  EXPECT_EQ(1, instant_service->GetInstantProcessCount());
+  // And the Instant ntp should live inside it.
+  content::WebContents* ntp_contents =
+      instant_service->ntp_prerenderer()->ntp()->contents();
+  EXPECT_TRUE(instant_service->IsInstantProcess(
+      ntp_contents->GetRenderProcessHost()->GetID()));
+
+  // Navigating to the NTP should use the Instant render process.
+  ui_test_utils::NavigateToURLWithDisposition(
+      browser(),
+      GURL(chrome::kChromeUINewTabURL),
+      CURRENT_TAB,
+      ui_test_utils::BROWSER_TEST_NONE);
+  content::WebContents* active_tab =
+      browser()->tab_strip_model()->GetActiveWebContents();
+  EXPECT_TRUE(instant_service->IsInstantProcess(
+      active_tab->GetRenderProcessHost()->GetID()));
+
+  // Navigating elsewhere should not use the Instant render process.
+  ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIAboutURL));
+  EXPECT_FALSE(instant_service->IsInstantProcess(
+      active_tab->GetRenderProcessHost()->GetID()));
+}
+
+// Test that renderer initiated navigations to an Instant URL from an
+// Instant process end up in an Instant process.
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
+                       RendererInitiatedNavigationInInstantProcess) {
+  InstantService* instant_service =
+      InstantServiceFactory::GetForProfile(browser()->profile());
+  ASSERT_NE(static_cast<InstantService*>(NULL), instant_service);
+
+  // Setup Instant.
+  ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+  FocusOmniboxAndWaitForInstantNTPSupport();
+
+  EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
+  EXPECT_EQ(1, browser()->tab_strip_model()->count());
+
+  ui_test_utils::NavigateToURLWithDisposition(
+      browser(),
+      instant_url(),
+      CURRENT_TAB,
+      ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
+  content::WebContents* contents =
+      browser()->tab_strip_model()->GetActiveWebContents();
+  EXPECT_TRUE(instant_service->IsInstantProcess(
+      contents->GetRenderProcessHost()->GetID()));
+
+  std::string instant_url_with_query = instant_url().spec() + "q=3";
+  std::string add_link_script = base::StringPrintf(
+      "var a = document.createElement('a');"
+      "a.id = 'toClick';"
+      "a.href = '%s';"
+      "document.body.appendChild(a);",
+      instant_url_with_query.c_str());
+  EXPECT_TRUE(content::ExecuteScript(contents, add_link_script));
+
+  content::WindowedNotificationObserver observer(
+        content::NOTIFICATION_NAV_ENTRY_COMMITTED,
+        content::NotificationService::AllSources());
+  EXPECT_TRUE(content::ExecuteScript(
+      contents, "document.getElementById('toClick').click();"));
+  observer.Wait();
+
+  EXPECT_EQ(1, browser()->tab_strip_model()->count());
+  contents = browser()->tab_strip_model()->GetActiveWebContents();
+  EXPECT_TRUE(instant_service->IsInstantProcess(
+      contents->GetRenderProcessHost()->GetID()));
+  EXPECT_EQ(GURL(instant_url_with_query), contents->GetURL());
+}
diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer.h b/chrome/browser/ui/search/instant_ntp_prerenderer.h
index cf0c0d3..19ac200 100644
--- a/chrome/browser/ui/search/instant_ntp_prerenderer.h
+++ b/chrome/browser/ui/search/instant_ntp_prerenderer.h
@@ -108,6 +108,7 @@
   FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest, MANUAL_ShowsGoogleNTP);
   FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest,
                            MANUAL_SearchesFromFakebox);
+  FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation);
 
   // Overridden from net::NetworkChangeNotifier::NetworkChangeObserver:
   // If the network status changes, resets InstantNTP.
diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
index 374c8fd..0535657 100644
--- a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
+++ b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc
@@ -14,7 +14,7 @@
 #include "chrome/common/content_settings.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 using base::HistogramBase;
@@ -136,11 +136,7 @@
 class InstantNTPPrerendererTest : public testing::Test {
  public:
   InstantNTPPrerendererTest()
-      : ui_thread_(content::BrowserThread::UI),
-        instant_ntp_prerenderer_(new TestableInstantNTPPrerenderer(&profile_)) {
-  }
-
-  virtual void SetUp() OVERRIDE {
+      : instant_ntp_prerenderer_(new TestableInstantNTPPrerenderer(&profile_)) {
     base::StatisticsRecorder::Initialize();
   }
 
@@ -153,7 +149,7 @@
   }
 
  private:
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   scoped_ptr<TestableInstantNTPPrerenderer> instant_ntp_prerenderer_;
   mutable TestingProfile profile_;
 };
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index 8b6dee9..1a226db 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -49,8 +49,6 @@
     : WebContentsObserver(web_contents),
       is_search_enabled_(chrome::IsInstantExtendedAPIEnabled()),
       user_input_in_progress_(false),
-      popup_is_open_(false),
-      user_text_is_empty_(true),
       web_contents_(web_contents) {
   if (!is_search_enabled_)
     return;
@@ -73,15 +71,11 @@
 }
 
 void SearchTabHelper::OmniboxEditModelChanged(bool user_input_in_progress,
-                                              bool cancelling,
-                                              bool popup_is_open,
-                                              bool user_text_is_empty) {
+                                              bool cancelling) {
   if (!is_search_enabled_)
     return;
 
   user_input_in_progress_ = user_input_in_progress;
-  popup_is_open_ = popup_is_open;
-  user_text_is_empty_ = user_text_is_empty;
   if (!user_input_in_progress && !cancelling)
     return;
 
@@ -195,21 +189,7 @@
     origin = model_.mode().origin;
   if (user_input_in_progress_)
     type = SearchMode::MODE_SEARCH_SUGGESTIONS;
-
-  if (type == SearchMode::MODE_NTP && origin == SearchMode::ORIGIN_NTP &&
-      !popup_is_open_ && !user_text_is_empty_) {
-    // We're switching back (|popup_is_open_| is false) to an NTP (type and
-    // mode are |NTP|) with suggestions (|user_text_is_empty_| is false), don't
-    // modify visibility of top bars or voice search support.  This specific
-    // omnibox state is set when OmniboxEditModelChanged() is called from
-    // OmniboxEditModel::SetInputInProgress() which is called from
-    // OmniboxEditModel::Revert().
-    model_.SetState(SearchModel::State(SearchMode(type, origin),
-                                       model_.instant_support(),
-                                       model_.state().voice_search_supported));
-  } else {
-    model_.SetMode(SearchMode(type, origin));
-  }
+  model_.SetMode(SearchMode(type, origin));
 }
 
 void SearchTabHelper::DetermineIfPageSupportsInstant() {
diff --git a/chrome/browser/ui/search/search_tab_helper.h b/chrome/browser/ui/search/search_tab_helper.h
index ca05de1..8a3955f 100644
--- a/chrome/browser/ui/search/search_tab_helper.h
+++ b/chrome/browser/ui/search/search_tab_helper.h
@@ -42,10 +42,7 @@
 
   // Invoked when the OmniboxEditModel changes state in some way that might
   // affect the search mode.
-  void OmniboxEditModelChanged(bool user_input_in_progress,
-                               bool cancelling,
-                               bool popup_is_open,
-                               bool user_text_is_empty);
+  void OmniboxEditModelChanged(bool user_input_in_progress, bool cancelling);
 
   // Invoked when the active navigation entry is updated in some way that might
   // affect the search mode. This is used by Instant when it "fixes up" the
@@ -111,8 +108,6 @@
 
   // Tracks the last value passed to OmniboxEditModelChanged().
   bool user_input_in_progress_;
-  bool popup_is_open_;
-  bool user_text_is_empty_;
 
   // Model object for UI that cares about search state.
   SearchModel model_;
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index 0fd124a..4c001ee 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -476,7 +476,11 @@
 
   // content::WebContentsObserver:
   virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE;
-  virtual void DidStopLoading(
+  virtual void DidCommitProvisionalLoadForFrame(
+      int64 frame_id,
+      bool is_main_frame,
+      const GURL& url,
+      content::PageTransition transition_type,
       content::RenderViewHost* render_view_host) OVERRIDE;
 
  private:
@@ -495,13 +499,26 @@
 CurrentHistoryCleaner::~CurrentHistoryCleaner() {
 }
 
-void CurrentHistoryCleaner::DidStopLoading(
+void CurrentHistoryCleaner::DidCommitProvisionalLoadForFrame(
+    int64 frame_id,
+    bool is_main_frame,
+    const GURL& url,
+    content::PageTransition transition_type,
     content::RenderViewHost* render_view_host) {
+  // Return early if this is not top-level navigation.
+  if (!is_main_frame)
+    return;
+
   content::NavigationController* nc = &web_contents()->GetController();
+
   // Have to wait until something else gets added to history before removal.
   if (history_index_to_remove_ < nc->GetLastCommittedEntryIndex()) {
-    nc->RemoveEntryAtIndex(history_index_to_remove_);
-    delete this;  // Success.
+    content::NavigationEntry* entry =
+        nc->GetEntryAtIndex(history_index_to_remove_);
+    if (SyncPromoUI::IsContinueUrlForWebBasedSigninFlow(entry->GetURL()) &&
+        nc->RemoveEntryAtIndex(history_index_to_remove_)) {
+      delete this;  // Success.
+    }
   }
 }
 
@@ -906,8 +923,10 @@
 void OneClickSigninHelper::RemoveSigninRedirectURLHistoryItem(
     content::WebContents* web_contents) {
   // Only actually remove the item if it's the blank.html continue url.
-  if (SyncPromoUI::IsContinueUrlForWebBasedSigninFlow(web_contents->GetURL()))
+  if (SyncPromoUI::IsContinueUrlForWebBasedSigninFlow(
+          web_contents->GetLastCommittedURL())) {
     new CurrentHistoryCleaner(web_contents);  // will self-destruct when done
+  }
 }
 
 void OneClickSigninHelper::ShowSigninErrorBubble(Browser* browser,
@@ -1041,7 +1060,7 @@
   // If the user left the sign in process, clear all members.
   // TODO(rogerta): might need to allow some youtube URLs.
   content::WebContents* contents = web_contents();
-  const GURL url = contents->GetURL();
+  const GURL url = contents->GetLastCommittedURL();
   Profile* profile =
       Profile::FromBrowserContext(contents->GetBrowserContext());
   VLOG(1) << "OneClickSigninHelper::DidStopLoading: url=" << url.spec();
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
index d4c94a8..e0ff981 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
 
 #include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/prefs/browser_prefs.h"
 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/global_error/global_error.h"
@@ -13,6 +14,9 @@
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/test/base/browser_with_test_window_test.h"
 #include "chrome/test/base/menu_model_test.h"
+#include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_io_thread_state.h"
+#include "chrome/test/base/testing_pref_service_syncable.h"
 #include "chrome/test/base/testing_profile.h"
 #include "grit/generated_resources.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -77,6 +81,27 @@
   virtual bool GetAcceleratorForCommandId(
       int command_id,
       ui::Accelerator* accelerator) OVERRIDE { return false; }
+
+ protected:
+  virtual void SetUp() OVERRIDE {
+    prefs_.reset(new TestingPrefServiceSimple());
+    chrome::RegisterLocalState(prefs_->registry());
+
+    TestingBrowserProcess::GetGlobal()->SetLocalState(prefs_.get());
+    testing_io_thread_state_.reset(new chrome::TestingIOThreadState());
+    BrowserWithTestWindowTest::SetUp();
+  }
+
+  virtual void TearDown() OVERRIDE {
+    BrowserWithTestWindowTest::TearDown();
+    testing_io_thread_state_.reset();
+    TestingBrowserProcess::GetGlobal()->SetLocalState(NULL);
+    DestroyBrowserAndProfile();
+  }
+
+ private:
+  scoped_ptr<TestingPrefServiceSimple> prefs_;
+  scoped_ptr<chrome::TestingIOThreadState> testing_io_thread_state_;
 };
 
 // Copies parts of MenuModelTest::Delegate and combines them with the
diff --git a/chrome/browser/ui/views/avatar_menu_button_browsertest.cc b/chrome/browser/ui/views/avatar_menu_button_browsertest.cc
index 05b180e..c6e21b3 100644
--- a/chrome/browser/ui/views/avatar_menu_button_browsertest.cc
+++ b/chrome/browser/ui/views/avatar_menu_button_browsertest.cc
@@ -12,11 +12,13 @@
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/browser/profiles/profiles_state.h"
 #include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
 #include "chrome/browser/ui/views/frame/browser_view.h"
 #include "chrome/browser/ui/views/profile_chooser_view.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #include "chrome/test/base/testing_browser_process.h"
 #include "content/public/test/test_utils.h"
@@ -101,7 +103,6 @@
             ProfileChooserView::IsShowing());
 }
 
-
 IN_PROC_BROWSER_TEST_P(AvatarMenuButtonTest, HideOnSecondClick) {
   if (!profiles::IsMultipleProfilesEnabled() ||
       UsingNewProfileChooser()) {
@@ -123,7 +124,6 @@
   EXPECT_FALSE(ProfileChooserView::IsShowing());
 }
 
-
 IN_PROC_BROWSER_TEST_P(AvatarMenuButtonTest, NewSignOut) {
   if (!profiles::IsMultipleProfilesEnabled() ||
       !UsingNewProfileChooser()) {
@@ -159,6 +159,34 @@
   EXPECT_TRUE(browser_list->empty());
 }
 
+IN_PROC_BROWSER_TEST_P(AvatarMenuButtonTest, LaunchUserManagerScreen) {
+  if (!profiles::IsMultipleProfilesEnabled() ||
+      !UsingNewProfileChooser()) {
+    return;
+  }
+
+  CreateTestingProfile();
+  StartAvatarMenu();
+
+  int starting_tab_count = browser()->tab_strip_model()->count();
+  BrowserList* browser_list =
+      BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE);
+  EXPECT_EQ(1U, browser_list->size());
+
+  ui::MouseEvent mouse_ev(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 0);
+  ProfileChooserView::profile_bubble_->ButtonPressed(
+      static_cast<views::Button*>(
+          ProfileChooserView::profile_bubble_->users_button_view_),
+      mouse_ev);
+
+  // The user manager screen should go into a new, active tab.
+  int final_tab_count = browser()->tab_strip_model()->count();
+  EXPECT_EQ(1U, browser_list->size());
+  EXPECT_EQ(starting_tab_count + 1, final_tab_count);
+
+  GURL tab_url = browser()->tab_strip_model()->GetActiveWebContents()->GetURL();
+  EXPECT_EQ(std::string(chrome::kChromeUIUserChooserURL), tab_url.spec());
+}
 
 INSTANTIATE_TEST_CASE_P(Old, AvatarMenuButtonTest, testing::Values(false));
 INSTANTIATE_TEST_CASE_P(New, AvatarMenuButtonTest, testing::Values(true));
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index c1f7053..bb5f2de 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -113,8 +113,7 @@
  public:
   BookmarkBarViewEventTestBase()
       : ViewEventTestBase(),
-        model_(NULL),
-        file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {}
+        model_(NULL) {}
 
   virtual void SetUp() OVERRIDE {
     views::MenuController::TurnOffContextMenuSelectionHoldForTest();
@@ -243,7 +242,6 @@
   scoped_ptr<TestingProfile> profile_;
   scoped_ptr<Browser> browser_;
   scoped_ptr<ScopedTestingLocalState> local_state_;
-  content::TestBrowserThread file_thread_;
   ChromeViewsDelegate views_delegate_;
 };
 
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 11561a0..1294d04 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -1085,13 +1085,24 @@
   AddChildView(discard_button_);
 
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
-  // The dangerous download label text and icon are different under
-  // different cases.
-  if (mode_ == MALICIOUS_MODE) {
-    warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING);
-  } else {
-    // The download file has dangerous file type (e.g.: an executable).
-    warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING);
+  switch (download()->GetDangerType()) {
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
+      warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING);
+      break;
+
+    case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
+    case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
+    case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
+    case content::DOWNLOAD_DANGER_TYPE_MAX:
+      NOTREACHED();
+      // fallthrough
+
+    case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE:
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
+      warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING);
   }
   string16 dangerous_label = model_.GetWarningText(font_, kTextWidth);
   dangerous_download_label_ = new views::Label(dangerous_label);
diff --git a/chrome/browser/ui/views/frame/browser_view_unittest.cc b/chrome/browser/ui/views/frame/browser_view_unittest.cc
index 8bb3377..d3ad284 100644
--- a/chrome/browser/ui/views/frame/browser_view_unittest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_unittest.cc
@@ -9,6 +9,7 @@
 #include "chrome/app/chrome_command_ids.h"
 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
+#include "chrome/browser/predictors/predictor_database.h"
 #include "chrome/browser/search_engines/template_url_service.h"
 #include "chrome/browser/search_engines/template_url_service_factory.h"
 #include "chrome/browser/ui/browser_commands.h"
@@ -23,6 +24,8 @@
 #include "chrome/test/base/browser_with_test_window_test.h"
 #include "chrome/test/base/scoped_testing_local_state.h"
 #include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_io_thread_state.h"
+#include "content/public/test/test_utils.h"
 #include "grit/theme_resources.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/views/controls/single_split_view.h"
@@ -80,6 +83,8 @@
  private:
   BrowserView* browser_view_;  // Not owned.
   scoped_ptr<ScopedTestingLocalState> local_state_;
+  scoped_ptr<predictors::PredictorDatabase> predictor_db_;
+  scoped_ptr<chrome::TestingIOThreadState> testing_io_thread_state_;
   DISALLOW_COPY_AND_ASSIGN(BrowserViewTest);
 };
 
@@ -101,7 +106,10 @@
   // the Profile.
   browser_view_->GetWidget()->CloseNow();
   browser_view_ = NULL;
+  content::RunAllPendingInMessageLoop(content::BrowserThread::DB);
   BrowserWithTestWindowTest::TearDown();
+  testing_io_thread_state_.reset();
+  predictor_db_.reset();
 #if defined(OS_CHROMEOS)
   chromeos::input_method::Shutdown();
 #endif
@@ -134,7 +142,9 @@
   chromeos::input_method::InitializeForTesting(
       new chromeos::input_method::MockInputMethodManager);
 #endif
+  testing_io_thread_state_.reset(new chrome::TestingIOThreadState());
   BrowserWithTestWindowTest::SetUp();
+  predictor_db_.reset(new predictors::PredictorDatabase(GetProfile()));
   browser_view_ = static_cast<BrowserView*>(browser()->window());
 }
 
@@ -289,7 +299,6 @@
 
   BrowserViewIncognitoSwitcherTest()
       : browser_view_(NULL) {}
-  virtual ~BrowserViewIncognitoSwitcherTest() {}
 
   virtual void SetUp() OVERRIDE {
     Init();
diff --git a/chrome/browser/ui/views/profile_chooser_view.cc b/chrome/browser/ui/views/profile_chooser_view.cc
index 280853f..f432e77 100644
--- a/chrome/browser/ui/views/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profile_chooser_view.cc
@@ -10,6 +10,8 @@
 #include "chrome/browser/profiles/avatar_menu_model.h"
 #include "chrome/browser/profiles/profile_info_util.h"
 #include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/singleton_tabs.h"
+#include "chrome/common/url_constants.h"
 #include "grit/generated_resources.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -67,6 +69,7 @@
       browser_(browser),
       current_profile_view_(NULL),
       guest_button_view_(NULL),
+      users_button_view_(NULL),
       other_profiles_view_(NULL),
       signout_current_profile_view_(NULL) {
   avatar_menu_model_.reset(new AvatarMenuModel(
@@ -113,11 +116,12 @@
 
   if (sender == guest_button_view_) {
     avatar_menu_model_->SwitchToGuestProfileWindow(browser_);
-    return;
+  } else if (sender == users_button_view_) {
+    chrome::ShowSingletonTab(browser_, GURL(chrome::kChromeUIUserChooserURL));
+  } else {
+    DCHECK_EQ(sender, signout_current_profile_view_);
+    avatar_menu_model_->BeginSignOut();
   }
-
-  DCHECK_EQ(sender, signout_current_profile_view_);
-  avatar_menu_model_->BeginSignOut();
 }
 
 void ProfileChooserView::OnAvatarMenuModelChanged(
@@ -126,6 +130,7 @@
   // will actually delete them.
   current_profile_view_ = NULL;
   guest_button_view_ = NULL;
+  users_button_view_ = NULL;
   open_other_profile_indexes_map_.clear();
   other_profiles_view_ = NULL;
   signout_current_profile_view_ = NULL;
@@ -293,22 +298,19 @@
 }
 
 views::View* ProfileChooserView::CreateOptionsView() {
-  views::View* view = new views::View();
-
-  views::LabelButton* users_button = new views::LabelButton(
+  users_button_view_ = new views::LabelButton(
       this,
       l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_USERS_BUTTON));
-  users_button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
-  users_button->set_tag(IDS_PROFILES_PROFILE_USERS_BUTTON);
-  views::LabelButton* guest_button = new views::LabelButton(
+  users_button_view_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+  users_button_view_->set_tag(IDS_PROFILES_PROFILE_USERS_BUTTON);
+
+ guest_button_view_ = new views::LabelButton(
       this,
       l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_GUEST_BUTTON));
-  guest_button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
-  guest_button->set_tag(IDS_PROFILES_PROFILE_GUEST_BUTTON);
+  guest_button_view_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+  guest_button_view_->set_tag(IDS_PROFILES_PROFILE_GUEST_BUTTON);
 
-  DCHECK(!guest_button_view_);
-  guest_button_view_ = guest_button;
-
+  views::View* view = new views::View();
   views::GridLayout* layout = new views::GridLayout(view);
   view->SetLayoutManager(layout);
 
@@ -323,11 +325,11 @@
 
   const int kButtonHeight = 40;
   layout->StartRow(0, 0);
-  layout->AddView(users_button, 1, 1,
+  layout->AddView(users_button_view_, 1, 1,
                   views::GridLayout::FILL, views::GridLayout::FILL,
                   0, kButtonHeight);
   layout->AddView(new views::Separator(views::Separator::VERTICAL));
-  layout->AddView(guest_button, 1, 1,
+  layout->AddView(guest_button_view_, 1, 1,
                   views::GridLayout::FILL, views::GridLayout::FILL,
                   0, kButtonHeight);
 
diff --git a/chrome/browser/ui/views/profile_chooser_view.h b/chrome/browser/ui/views/profile_chooser_view.h
index e2de425..54dcb43 100644
--- a/chrome/browser/ui/views/profile_chooser_view.h
+++ b/chrome/browser/ui/views/profile_chooser_view.h
@@ -16,6 +16,10 @@
 class Image;
 }
 
+namespace views {
+class LabelButton;
+}
+
 class AvatarMenuModel;
 class Browser;
 class ProfileItemView;
@@ -42,6 +46,7 @@
  private:
   friend class AvatarMenuButtonTest;
   FRIEND_TEST_ALL_PREFIXES(AvatarMenuButtonTest, NewSignOut);
+  FRIEND_TEST_ALL_PREFIXES(AvatarMenuButtonTest, LaunchUserManagerScreen);
 
   typedef std::vector<size_t> Indexes;
   typedef std::map<views::View*, int> ViewIndexes;
@@ -77,7 +82,8 @@
   scoped_ptr<AvatarMenuModel> avatar_menu_model_;
   Browser* browser_;
   views::View* current_profile_view_;
-  views::View* guest_button_view_;
+  views::LabelButton* guest_button_view_;
+  views::LabelButton* users_button_view_;
   ViewIndexes open_other_profile_indexes_map_;
   views::View* other_profiles_view_;
   views::View* signout_current_profile_view_;
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 98f7381..9fee7cf 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -626,8 +626,8 @@
 
 bool ToolbarView::AcceleratorPressed(const ui::Accelerator& accelerator) {
   const views::View* focused_view = focus_manager()->GetFocusedView();
-  if (focused_view == location_bar_)
-    return false;  // Let location bar handle all accelerator events.
+  if (focused_view && (focused_view->id() == VIEW_ID_OMNIBOX))
+    return false;  // Let the omnibox handle all accelerator events.
   return AccessiblePaneView::AcceleratorPressed(accelerator);
 }
 
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index adfeb11..83257da 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -5,11 +5,13 @@
 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
 
 #include "base/callback.h"
+#include "base/chromeos/chromeos_version.h"
 #include "base/command_line.h"
 #include "base/debug/trace_event.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/metrics/histogram.h"
+#include "base/prefs/pref_registry_simple.h"
 #include "base/prefs/pref_service.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_util.h"
@@ -20,6 +22,7 @@
 #include "chrome/browser/browser_shutdown.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
+#include "chrome/browser/chromeos/input_method/input_method_util.h"
 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
 #include "chrome/browser/chromeos/login/hwid_checker.h"
 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
@@ -32,6 +35,7 @@
 #include "chrome/browser/chromeos/settings/cros_settings.h"
 #include "chrome/browser/io_thread.h"
 #include "chrome/browser/policy/browser_policy_connector.h"
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h"
 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h"
@@ -103,6 +107,12 @@
   io_thread->ClearHostCache();
 }
 
+static bool Contains(const std::vector<std::string>& container,
+                     const std::string& value) {
+  return std::find(container.begin(), container.end(), value) !=
+         container.end();
+}
+
 }  // namespace
 
 namespace chromeos {
@@ -312,6 +322,59 @@
   }
 }
 
+static bool SetUserInputMethodImpl(
+    const std::string& username,
+    chromeos::input_method::InputMethodManager* manager) {
+  PrefService* const local_state = g_browser_process->local_state();
+
+  const base::DictionaryValue* users_lru_input_methods =
+      local_state->GetDictionary(prefs::kUsersLRUInputMethod);
+
+  if (users_lru_input_methods == NULL) {
+    DLOG(WARNING) << "SetUserInputMethod('" << username
+                  << "'): no kUsersLRUInputMethod";
+    return false;
+  }
+
+  std::string input_method;
+
+  if (!users_lru_input_methods->GetStringWithoutPathExpansion(username,
+                                                              &input_method)) {
+    DLOG(INFO) << "SetUserInputMethod('" << username
+               << "'): no input method for this user";
+    return false;
+  }
+
+  if (input_method.empty())
+    return false;
+
+  if (!manager->IsFullLatinKeyboard(input_method)) {
+    LOG(WARNING) << "SetUserInputMethod('" << username
+                 << "'): stored user LRU input method '" << input_method
+                 << "' is no longer Full Latin Keyboard Language"
+                 << " (entry dropped). Use hardware default instead.";
+
+    DictionaryPrefUpdate updater(local_state, prefs::kUsersLRUInputMethod);
+
+    base::DictionaryValue* const users_lru_input_methods = updater.Get();
+    if (users_lru_input_methods != NULL) {
+      users_lru_input_methods->SetStringWithoutPathExpansion(username, "");
+    }
+    return false;
+  }
+
+  if (!Contains(manager->GetActiveInputMethodIds(), input_method)) {
+    if (!manager->EnableInputMethod(input_method)) {
+      DLOG(ERROR) << "SigninScreenHandler::SetUserInputMethod('" << username
+                  << "'): user input method '" << input_method
+                  << "' is not enabled and enabling failed (ignored!).";
+    }
+  }
+  manager->ChangeInputMethod(input_method);
+
+  return true;
+}
+
 }  // namespace
 
 // SigninScreenHandler implementation ------------------------------------------
@@ -814,6 +877,10 @@
               &SigninScreenHandler::HandleUpdateOfflineLogin);
 }
 
+void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) {
+  registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod);
+}
+
 void SigninScreenHandler::HandleGetUsers() {
   SendUserList(false);
 }
@@ -970,6 +1037,35 @@
   ShowSigninScreenIfReady();
 }
 
+void SigninScreenHandler::SetUserInputMethodHWDefault() {
+  chromeos::input_method::InputMethodManager* manager =
+      chromeos::input_method::InputMethodManager::Get();
+  manager->ChangeInputMethod(
+      manager->GetInputMethodUtil()->GetHardwareInputMethodId());
+}
+
+// Update keyboard layout to least recently used by the user.
+void SigninScreenHandler::SetUserInputMethod(const std::string& username) {
+  chromeos::input_method::InputMethodManager* const manager =
+      chromeos::input_method::InputMethodManager::Get();
+
+  const chromeos::input_method::InputMethodUtil& ime_util =
+      *manager->GetInputMethodUtil();
+
+  const bool succeed = SetUserInputMethodImpl(username, manager);
+
+  // This is also a case when LRU layout is set only for a few local users,
+  // thus others need to be switched to default locale.
+  // Otherwise they will end up using another user's locale to log in.
+  if (!succeed) {
+    DLOG(INFO) << "SetUserInputMethod('" << username
+               << "'): failed to set user layout. Switching to default '"
+               << ime_util.GetHardwareInputMethodId() << "'";
+
+    SetUserInputMethodHWDefault();
+  }
+}
+
 void SigninScreenHandler::ShowSigninScreenIfReady() {
   if (!dns_cleared_ || !cookies_cleared_ || !delegate_)
     return;
@@ -991,6 +1087,10 @@
   else
     delegate_->LoadWallpaper(email_);
 
+  // Set Least Recently Used input method for the user.
+  if (!email_.empty())
+    SetUserInputMethod(email_);
+
   LoadAuthExtension(!gaia_silent_load_, false, false);
   UpdateUIState(UI_STATE_GAIA_SIGNIN, NULL);
 
@@ -1210,6 +1310,7 @@
         &SigninScreenHandler::ShowSigninScreenIfReady,
         weak_factory_.GetWeakPtr()));
   }
+  SetUserInputMethodHWDefault();
 }
 
 void SigninScreenHandler::HandleToggleEnrollmentScreen() {
@@ -1451,7 +1552,7 @@
     // There might be multiple messages from OOBE UI so send notifications after
     // the first one only.
     content::NotificationService::current()->Notify(
-        chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
+        chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
         content::NotificationService::AllSources(),
         content::NotificationService::NoDetails());
     TRACE_EVENT_ASYNC_END0(
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
index aea2d03..5768ab2 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
@@ -193,6 +193,9 @@
   virtual void UpdateState(NetworkStateInformer::State state,
                            ErrorScreenActor::ErrorReason reason) OVERRIDE;
 
+  // Required Local State preferences.
+  static void RegisterPrefs(PrefRegistrySimple* registry);
+
  private:
   enum UIState {
     UI_STATE_UNKNOWN = 0,
@@ -379,6 +382,12 @@
   // Attempts login for test.
   void SubmitLoginFormForTest();
 
+  // Update current input method (namely keyboard layout) to LRU by this user.
+  void SetUserInputMethod(const std::string& username);
+
+  // Update current input method to HW default.
+  void SetUserInputMethodHWDefault();
+
   // Current UI state of the signin screen.
   UIState ui_state_;
 
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index 293cae7..b885b01 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -19,7 +19,6 @@
 #include "chrome/common/chrome_version_info.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/common/url_constants.h"
-#include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_ui.h"
 #include "content/public/browser/web_ui_data_source.h"
@@ -105,8 +104,7 @@
 }
 
 void CrashesDOMHandler::RegisterMessages() {
-  upload_list_->LoadUploadListAsynchronously(
-      content::BrowserThread::GetBlockingPool());
+  upload_list_->LoadUploadListAsynchronously();
 
   web_ui()->RegisterMessageCallback("requestCrashList",
       base::Bind(&CrashesDOMHandler::HandleRequestCrashes,
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 124b278..72245e1 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -99,6 +99,8 @@
       return "UNCOMMON_CONTENT";
     case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
       return "DANGEROUS_HOST";
+    case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
+      return "POTENTIALLY_UNWANTED";
     default:
       // Don't return a danger type string if it is NOT_DANGEROUS or
       // MAYBE_DANGEROUS_CONTENT.
@@ -161,7 +163,9 @@
                download_item->GetDangerType() ==
                    content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT ||
                download_item->GetDangerType() ==
-                   content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST);
+                   content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST ||
+               download_item->GetDangerType() ==
+                   content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED);
         const char* danger_type_value =
             GetDangerTypeString(download_item->GetDangerType());
         file_value->SetString("danger_type", danger_type_value);
diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc
index 2eec32b..b90b28c 100644
--- a/chrome/browser/ui/webui/downloads_ui.cc
+++ b/chrome/browser/ui/webui/downloads_ui.cc
@@ -59,6 +59,8 @@
                              IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT);
   source->AddLocalizedString("danger_uncommon_desc",
                              IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT);
+  source->AddLocalizedString("danger_potentially_unwanted_desc",
+                             IDS_PROMPT_POTENTIALLY_UNWANTED_DOWNLOAD);
   source->AddLocalizedString("danger_save", IDS_CONFIRM_DOWNLOAD);
   source->AddLocalizedString("danger_discard", IDS_DISCARD_DOWNLOAD);
 
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index 3c322bc..eb284e6 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -11,8 +11,6 @@
 #include "chrome/browser/history/top_sites.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/search/instant_io_context.h"
-#include "chrome/browser/search/instant_service.h"
-#include "chrome/browser/search/instant_service_factory.h"
 #include "chrome/common/favicon/favicon_url_parser.h"
 #include "chrome/common/url_constants.h"
 #include "grit/locale_settings.h"
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 050b033..52b70e3 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -25,7 +25,6 @@
 #include "chrome/browser/ui/webui/crashes_ui.h"
 #include "chrome/common/chrome_version_info.h"
 #include "chrome/common/url_constants.h"
-#include "content/public/browser/browser_thread.h"
 #include "content/public/browser/gpu_data_manager.h"
 #include "content/public/browser/gpu_data_manager_observer.h"
 #include "content/public/browser/plugin_service.h"
@@ -143,8 +142,7 @@
       has_plugin_info_(false) {
   // Request Crash data asynchronously.
   upload_list_ = CrashUploadList::Create(this);
-  upload_list_->LoadUploadListAsynchronously(
-      content::BrowserThread::GetBlockingPool());
+  upload_list_->LoadUploadListAsynchronously();
 
   // Watch for changes in GPUInfo.
   GpuDataManager::GetInstance()->AddObserver(this);
diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc
index b98f865..f078123 100644
--- a/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chrome/browser/ui/webui/inspect_ui.cc
@@ -63,6 +63,7 @@
 static const char kDataFile[] = "targets-data.json";
 static const char kAdbPages[] = "adb-pages";
 
+static const char kAppTargetType[] = "app";
 static const char kExtensionTargetType[]  = "extension";
 static const char kPageTargetType[]  = "page";
 static const char kWorkerTargetType[]  = "worker";
@@ -138,7 +139,12 @@
       const extensions::Extension* extension = extension_service->
           extensions()->GetByID(url.host());
       if (extension) {
-        target_type = kExtensionTargetType;
+        if (extension->is_hosted_app()
+            || extension->is_legacy_packaged_app()
+            || extension->is_platform_app())
+          target_type = kAppTargetType;
+        else
+          target_type = kExtensionTargetType;
         title = extension->name();
       }
     }
diff --git a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
index 6d4505a..54de606 100644
--- a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
+++ b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
@@ -19,7 +19,6 @@
 #include "chrome/common/chrome_version_info.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/common/url_constants.h"
-#include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_ui.h"
 #include "content/public/browser/web_ui_data_source.h"
@@ -113,8 +112,7 @@
 }
 
 void WebRtcLogsDOMHandler::RegisterMessages() {
-  upload_list_->LoadUploadListAsynchronously(
-      content::BrowserThread::GetBlockingPool());
+  upload_list_->LoadUploadListAsynchronously();
 
   web_ui()->RegisterMessageCallback("requestWebRtcLogsList",
       base::Bind(&WebRtcLogsDOMHandler::HandleRequestWebRtcLogs,
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index b6e69f3..3fa9351 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -375,7 +375,7 @@
   if (!app_page_names || !app_page_names->GetSize()) {
     ListPrefUpdate update(prefs, prefs::kNtpAppPageNames);
     ListValue* list = update.Get();
-    list->Set(0, Value::CreateStringValue(
+    list->Set(0, new base::StringValue(
         l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME)));
     dictionary->Set("appPageNames",
                     static_cast<ListValue*>(list->DeepCopy()));
@@ -652,7 +652,7 @@
   PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
   ListPrefUpdate update(prefs, prefs::kNtpAppPageNames);
   ListValue* list = update.Get();
-  list->Set(static_cast<size_t>(page_index), Value::CreateStringValue(name));
+  list->Set(static_cast<size_t>(page_index), new base::StringValue(name));
 }
 
 void AppLauncherHandler::HandleGenerateAppForLink(const ListValue* args) {
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 0d4836a..dfe5ed9 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -106,6 +106,7 @@
     web_ui->AddMessageHandler(new MostVisitedHandler());
     web_ui->AddMessageHandler(new RecentlyClosedTabsHandler());
 #if !defined(OS_ANDROID)
+    web_ui->AddMessageHandler(new FaviconWebUIHandler());
     web_ui->AddMessageHandler(new MetricsHandler());
     web_ui->AddMessageHandler(new NewTabPageHandler());
     if (NewTabUI::IsDiscoveryInNTPEnabled())
@@ -121,14 +122,13 @@
         web_ui->AddMessageHandler(new AppLauncherHandler(service));
     }
 #endif
-
-    web_ui->AddMessageHandler(new FaviconWebUIHandler());
   }
 
 #if defined(OS_ANDROID)
   // These handlers are specific to the Android NTP page.
   web_ui->AddMessageHandler(new BookmarksHandler());
   web_ui->AddMessageHandler(new ContextMenuHandler());
+  web_ui->AddMessageHandler(new FaviconWebUIHandler());
   web_ui->AddMessageHandler(new NavigationHandler());
   web_ui->AddMessageHandler(new NewTabPageReadyHandler());
   if (!GetProfile()->IsOffTheRecord())
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
index 5895f9c..324c694 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -9,8 +9,6 @@
 #include "base/message_loop/message_loop.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/search/instant_io_context.h"
-#include "chrome/browser/search/instant_service.h"
-#include "chrome/browser/search/instant_service_factory.h"
 #include "chrome/browser/thumbnails/thumbnail_service.h"
 #include "chrome/browser/thumbnails/thumbnail_service_factory.h"
 #include "chrome/common/url_constants.h"
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 5152da9..800b984 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -360,6 +360,8 @@
       IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_PARTIAL },
     { "accessibilityLargeCursor",
       IDS_OPTIONS_SETTINGS_ACCESSIBILITY_LARGE_CURSOR_DESCRIPTION },
+    { "accessibilityStickyKeys",
+      IDS_OPTIONS_SETTINGS_ACCESSIBILITY_STICKY_KEYS_DESCRIPTION },
     { "accessibilitySpokenFeedback",
       IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SPOKEN_FEEDBACK_DESCRIPTION },
     { "accessibilityTitle",
@@ -500,6 +502,10 @@
   magnifier_list->Append(option_partial.release());
 
   values->Set("magnifierList", magnifier_list.release());
+
+  const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+  values->SetBoolean("enableStickyKeys",
+                     command_line.HasSwitch(switches::kEnableStickyKeys));
 #endif
 
 #if defined(OS_MACOSX)
diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
index 39b6d61..c8b991d 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -33,6 +33,8 @@
 #include "chrome/browser/chromeos/cros/network_library.h"
 #include "chrome/browser/chromeos/cros/network_property_ui_data.h"
 #include "chrome/browser/chromeos/enrollment_dialog_view.h"
+#include "chrome/browser/chromeos/login/user.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
 #include "chrome/browser/chromeos/mobile_config.h"
 #include "chrome/browser/chromeos/options/network_config_view.h"
 #include "chrome/browser/chromeos/options/network_connect.h"
@@ -51,6 +53,7 @@
 #include "chromeos/chromeos_switches.h"
 #include "chromeos/network/device_state.h"
 #include "chromeos/network/favorite_state.h"
+#include "chromeos/network/managed_network_configuration_handler.h"
 #include "chromeos/network/network_configuration_handler.h"
 #include "chromeos/network/network_connection_handler.h"
 #include "chromeos/network/network_device_handler.h"
@@ -282,8 +285,10 @@
 const base::DictionaryValue* FindPolicyForActiveUser(
     const NetworkState* network,
     onc::ONCSource* onc_source) {
-  *onc_source = network->onc_source();
-  return NetworkLibrary::Get()->FindOncForNetwork(network->guid());
+  const User* user = UserManager::Get()->GetActiveUser();
+  std::string username_hash = user ? user->username_hash() : std::string();
+  return NetworkHandler::Get()->managed_network_configuration_handler()
+      ->FindPolicyByGUID(username_hash, network->guid(), onc_source);
 }
 
 std::string ActivationStateString(const std::string& activation_state) {
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index 491b60a..07fb346 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -735,7 +735,15 @@
     return;
   }
 
-  // Bring up the existing wizard, or just display it on this page.
+  // If a setup wizard is already present, but not on this page, close the
+  // blank setup overlay on this page. This can happen if the user navigates to
+  // chrome://settings/syncSetup in more than one tab. See crbug.com/261566.
+  // Note: The following block will transfer focus to the existing wizard.
+  if (IsExistingWizardPresent() && !IsActiveLogin())
+    CloseOverlay();
+
+  // If a setup wizard is present on this page or another, bring it to focus.
+  // Otherwise, display a new one on this page.
   if (!FocusExistingWizardIfPresent())
     OpenSyncSetup();
 }
@@ -880,10 +888,18 @@
   CloseOverlay();
 }
 
-bool SyncSetupHandler::FocusExistingWizardIfPresent() {
+bool SyncSetupHandler::IsExistingWizardPresent() {
   LoginUIService* service = GetLoginUIService();
-  if (!service->current_login_ui())
+  DCHECK(service);
+  return service->current_login_ui() != NULL;
+}
+
+bool SyncSetupHandler::FocusExistingWizardIfPresent() {
+  if (!IsExistingWizardPresent())
     return false;
+
+  LoginUIService* service = GetLoginUIService();
+  DCHECK(service);
   service->current_login_ui()->FocusUI();
   return true;
 }
diff --git a/chrome/browser/ui/webui/sync_setup_handler.h b/chrome/browser/ui/webui/sync_setup_handler.h
index 2f562ac..574bb28 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.h
+++ b/chrome/browser/ui/webui/sync_setup_handler.h
@@ -141,6 +141,9 @@
   // Returns true if this object is the active login object.
   bool IsActiveLogin() const;
 
+  // If a wizard already exists, return true. Otherwise, return false.
+  bool IsExistingWizardPresent();
+
   // If a wizard already exists, focus it and return true.
   bool FocusExistingWizardIfPresent();
 
diff --git a/chrome/browser/ui/webui/uber/uber_ui.cc b/chrome/browser/ui/webui/uber/uber_ui.cc
index 2c68102..a55842d 100644
--- a/chrome/browser/ui/webui/uber/uber_ui.cc
+++ b/chrome/browser/ui/webui/uber/uber_ui.cc
@@ -210,14 +210,12 @@
     case chrome::NOTIFICATION_EXTENSION_LOADED:
     case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
       Profile* profile = Profile::FromWebUI(web_ui());
-      bool overridesHistory = HasExtensionType(profile,
-          chrome::kChromeUIHistoryHost);
-      scoped_ptr<Value> controlsValue(
-          Value::CreateStringValue(chrome::kChromeUIHistoryHost));
-      scoped_ptr<Value> overrideValue(
-          Value::CreateStringValue(overridesHistory ? "yes" : "no"));
+      bool overrides_history =
+          HasExtensionType(profile, chrome::kChromeUIHistoryHost);
       web_ui()->CallJavascriptFunction(
-          "uber_frame.setNavigationOverride", *controlsValue, *overrideValue);
+          "uber_frame.setNavigationOverride",
+          base::StringValue(chrome::kChromeUIHistoryHost),
+          base::StringValue(overrides_history ? "yes" : "no"));
       break;
     }
     default:
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
index 2790756..a66d5c9 100644
--- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
@@ -76,32 +76,6 @@
   return location / grid_size * grid_size;
 }
 
-// A special test class for use with browser creation - it will create a
-// browser thread and deletes it after all other things have been destroyed.
-class WindowSizerTestWithBrowser : public WindowSizerTest {
- public:
-  WindowSizerTestWithBrowser();
-  virtual ~WindowSizerTestWithBrowser();
-
- private:
-  // Note: It is important to delete the thread after the browser instances got
-  // deleted. For this we transfer the thread here.
-  scoped_ptr<content::TestBrowserThread> ui_thread_;
-
-  DISALLOW_COPY_AND_ASSIGN(WindowSizerTestWithBrowser);
-};
-
-// The class function definitions from window_sizer_common_unittest.h
-WindowSizerTestWithBrowser::WindowSizerTestWithBrowser() {
-  // Set up a UI message thread.
-  base::MessageLoopForUI* ui_loop = message_loop();
-  ui_thread_.reset(
-      new content::TestBrowserThread(content::BrowserThread::UI, ui_loop));
-}
-
-WindowSizerTestWithBrowser::~WindowSizerTestWithBrowser() {
-}
-
 }  // namespace
 
 // Test that the window is sized appropriately for the first run experience
@@ -456,7 +430,7 @@
 }
 
 // Test the placement of newly created windows.
-TEST_F(WindowSizerTestWithBrowser, PlaceNewWindows) {
+TEST_F(WindowSizerTest, PlaceNewWindows) {
   // Create a dummy window.
   scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
   window->SetBounds(gfx::Rect(16, 32, 640, 320));
@@ -576,7 +550,7 @@
 // Test the placement of newly created windows on an empty desktop.
 // This test supplements "PlaceNewWindows" by testing the creation of a newly
 // created browser window on an empty desktop.
-TEST_F(WindowSizerTestWithBrowser, PlaceNewBrowserWindowOnEmptyDesktop) {
+TEST_F(WindowSizerTest, PlaceNewBrowserWindowOnEmptyDesktop) {
   // Create a browser which we can use to pass into the GetWindowBounds
   // function.
   scoped_ptr<TestingProfile> profile(new TestingProfile());
@@ -652,7 +626,7 @@
 #endif
 
 // Test the placement of newly created windows on multiple dislays.
-TEST_F(WindowSizerTestWithBrowser, MAYBE_PlaceNewWindowsOnMultipleDisplays) {
+TEST_F(WindowSizerTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) {
   UpdateDisplay("1600x1200,1600x1200");
   const gfx::Rect secondary(1600, 0, 1600, 1200);
 
@@ -741,7 +715,7 @@
 }
 
 // Test that the show state is properly returned for non default cases.
-TEST_F(WindowSizerTestWithBrowser, TestShowState) {
+TEST_F(WindowSizerTest, TestShowState) {
   // Creating a browser & window to play with.
   scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
   window->SetBounds(gfx::Rect(16, 32, 640, 320));
@@ -846,7 +820,7 @@
 }
 
 // Test that the default show state override behavior is properly handled.
-TEST_F(WindowSizerTestWithBrowser, TestShowStateDefaults) {
+TEST_F(WindowSizerTest, TestShowStateDefaults) {
   // Creating a browser & window to play with.
   scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
   window->SetBounds(gfx::Rect(16, 32, 640, 320));
diff --git a/chrome/browser/upload_list.cc b/chrome/browser/upload_list.cc
new file mode 100644
index 0000000..3f618aa
--- /dev/null
+++ b/chrome/browser/upload_list.cc
@@ -0,0 +1,95 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/upload_list.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "base/bind.h"
+#include "base/file_util.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_split.h"
+#include "content/public/browser/browser_thread.h"
+
+using content::BrowserThread;
+
+UploadList::UploadInfo::UploadInfo(const std::string& c, const base::Time& t)
+    : id(c), time(t) {}
+
+UploadList::UploadInfo::~UploadInfo() {}
+
+UploadList::UploadList(Delegate* delegate,
+                       const base::FilePath& upload_log_path)
+    : delegate_(delegate),
+      upload_log_path_(upload_log_path) {}
+
+UploadList::~UploadList() {}
+
+void UploadList::LoadUploadListAsynchronously() {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  BrowserThread::PostBlockingPoolTask(
+      FROM_HERE,
+      base::Bind(&UploadList::LoadUploadListAndInformDelegateOfCompletion,
+                 this));
+}
+
+void UploadList::ClearDelegate() {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  delegate_ = NULL;
+}
+
+void UploadList::LoadUploadListAndInformDelegateOfCompletion() {
+  LoadUploadList();
+  BrowserThread::PostTask(
+      BrowserThread::UI,
+      FROM_HERE,
+      base::Bind(&UploadList::InformDelegateOfCompletion, this));
+}
+
+void UploadList::LoadUploadList() {
+  if (base::PathExists(upload_log_path_)) {
+    std::string contents;
+    file_util::ReadFileToString(upload_log_path_, &contents);
+    std::vector<std::string> log_entries;
+    base::SplitStringAlongWhitespace(contents, &log_entries);
+    ParseLogEntries(log_entries);
+  }
+}
+
+void UploadList::AppendUploadInfo(const UploadInfo& info) {
+  uploads_.push_back(info);
+}
+
+void UploadList::ParseLogEntries(
+    const std::vector<std::string>& log_entries) {
+  std::vector<std::string>::const_reverse_iterator i;
+  for (i = log_entries.rbegin(); i != log_entries.rend(); ++i) {
+    std::vector<std::string> components;
+    base::SplitString(*i, ',', &components);
+    // Skip any blank (or corrupted) lines.
+    if (components.size() != 2)
+      continue;
+    double seconds_since_epoch;
+    if (!base::StringToDouble(components[0], &seconds_since_epoch))
+      continue;
+    UploadInfo info(components[1],
+                    base::Time::FromDoubleT(seconds_since_epoch));
+    uploads_.push_back(info);
+  }
+}
+
+void UploadList::InformDelegateOfCompletion() {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  if (delegate_)
+    delegate_->OnUploadListAvailable();
+}
+
+void UploadList::GetUploads(unsigned int max_count,
+                            std::vector<UploadInfo>* uploads) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  std::copy(uploads_.begin(),
+            uploads_.begin() + std::min<size_t>(uploads_.size(), max_count),
+            std::back_inserter(*uploads));
+}
diff --git a/base/upload_list.h b/chrome/browser/upload_list.h
similarity index 75%
rename from base/upload_list.h
rename to chrome/browser/upload_list.h
index dd136f0..23c4ff5 100644
--- a/base/upload_list.h
+++ b/chrome/browser/upload_list.h
@@ -2,23 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_UPLOAD_LIST_H_
-#define BASE_UPLOAD_LIST_H_
+#ifndef CHROME_BROWSER_UPLOAD_LIST_H_
+#define CHROME_BROWSER_UPLOAD_LIST_H_
 
 #include <string>
 #include <vector>
 
-#include "base/base_export.h"
 #include "base/files/file_path.h"
 #include "base/gtest_prod_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/time/time.h"
 
-namespace base {
-
-class SingleThreadTaskRunner;
-class SequencedWorkerPool;
-
 // Loads and parses an upload list text file of the format
 // time,id
 // time,id
@@ -26,14 +20,14 @@
 // where each line represents an upload and "time" is Unix time. Must be used
 // from the UI thread. The loading and parsing is done on a blocking pool task
 // runner.
-class BASE_EXPORT UploadList : public RefCountedThreadSafe<UploadList> {
+class UploadList : public base::RefCountedThreadSafe<UploadList> {
  public:
-  struct BASE_EXPORT UploadInfo {
-    UploadInfo(const std::string& c, const Time& t);
+  struct UploadInfo {
+    UploadInfo(const std::string& c, const base::Time& t);
     ~UploadInfo();
 
     std::string id;
-    Time time;
+    base::Time time;
   };
 
   class Delegate {
@@ -47,13 +41,11 @@
   };
 
   // Creates a new upload list with the given callback delegate.
-  UploadList(Delegate* delegate,
-             const FilePath& upload_log_path,
-             SingleThreadTaskRunner* task_runner);
+  UploadList(Delegate* delegate, const base::FilePath& upload_log_path);
 
   // Starts loading the upload list. OnUploadListAvailable will be called when
   // loading is complete.
-  void LoadUploadListAsynchronously(SequencedWorkerPool* worker_pool);
+  void LoadUploadListAsynchronously();
 
   // Clears the delegate, so that any outstanding asynchronous load will not
   // call the delegate on completion.
@@ -74,7 +66,7 @@
   void AppendUploadInfo(const UploadInfo& info);
 
  private:
-  friend class RefCountedThreadSafe<UploadList>;
+  friend class base::RefCountedThreadSafe<UploadList>;
   FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseLogEntries);
 
   // Manages the background thread work for LoadUploadListAsynchronously().
@@ -88,12 +80,9 @@
 
   std::vector<UploadInfo> uploads_;
   Delegate* delegate_;
-  const FilePath upload_log_path_;
-  SingleThreadTaskRunner* task_runner_;
+  const base::FilePath upload_log_path_;
 
   DISALLOW_COPY_AND_ASSIGN(UploadList);
 };
 
-}  // namespace base
-
-#endif  // BASE_UPLOAD_LIST_H_
+#endif  // CHROME_BROWSER_UPLOAD_LIST_H_
diff --git a/base/upload_list_unittest.cc b/chrome/browser/upload_list_unittest.cc
similarity index 88%
rename from base/upload_list_unittest.cc
rename to chrome/browser/upload_list_unittest.cc
index 41e1782..153f9db 100644
--- a/base/upload_list_unittest.cc
+++ b/chrome/browser/upload_list_unittest.cc
@@ -6,14 +6,11 @@
 
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/time/time.h"
-#include "base/upload_list.h"
+#include "chrome/browser/upload_list.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace base {
-
 // Test that UploadList can parse a vector of log entry strings to a vector of
 // UploadInfo objects. See the UploadList declaration for a description of the
 // log entry string format.
@@ -25,7 +22,7 @@
   test_entry.append(kTestID, sizeof(kTestID));
 
   scoped_refptr<UploadList> upload_list =
-      new UploadList(NULL, base::FilePath(), MessageLoopProxy::current());
+      new UploadList(NULL, base::FilePath());
 
   // 1 entry.
   std::vector<std::string> log_entries;
@@ -45,5 +42,3 @@
   EXPECT_STREQ(kTestTime, base::DoubleToString(time_double).c_str());
   EXPECT_STREQ(kTestID, upload_list->uploads_[3].id.c_str());
 }
-
-}  // namespace base
diff --git a/chrome/browser/usb/usb_device.cc b/chrome/browser/usb/usb_device_handle.cc
similarity index 82%
rename from chrome/browser/usb/usb_device.cc
rename to chrome/browser/usb/usb_device_handle.cc
index 13fc395..99faad1 100644
--- a/chrome/browser/usb/usb_device.cc
+++ b/chrome/browser/usb/usb_device_handle.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 
+#include <algorithm>
 #include <vector>
 
 #include "base/stl_util.h"
@@ -28,36 +29,36 @@
 }
 
 static uint8 CreateRequestType(const UsbEndpointDirection direction,
-    const UsbDevice::TransferRequestType request_type,
-    const UsbDevice::TransferRecipient recipient) {
+    const UsbDeviceHandle::TransferRequestType request_type,
+    const UsbDeviceHandle::TransferRecipient recipient) {
   uint8 result = ConvertTransferDirection(direction);
 
   switch (request_type) {
-    case UsbDevice::STANDARD:
+    case UsbDeviceHandle::STANDARD:
       result |= LIBUSB_REQUEST_TYPE_STANDARD;
       break;
-    case UsbDevice::CLASS:
+    case UsbDeviceHandle::CLASS:
       result |= LIBUSB_REQUEST_TYPE_CLASS;
       break;
-    case UsbDevice::VENDOR:
+    case UsbDeviceHandle::VENDOR:
       result |= LIBUSB_REQUEST_TYPE_VENDOR;
       break;
-    case UsbDevice::RESERVED:
+    case UsbDeviceHandle::RESERVED:
       result |= LIBUSB_REQUEST_TYPE_RESERVED;
       break;
   }
 
   switch (recipient) {
-    case UsbDevice::DEVICE:
+    case UsbDeviceHandle::DEVICE:
       result |= LIBUSB_RECIPIENT_DEVICE;
       break;
-    case UsbDevice::INTERFACE:
+    case UsbDeviceHandle::INTERFACE:
       result |= LIBUSB_RECIPIENT_INTERFACE;
       break;
-    case UsbDevice::ENDPOINT:
+    case UsbDeviceHandle::ENDPOINT:
       result |= LIBUSB_RECIPIENT_ENDPOINT;
       break;
-    case UsbDevice::OTHER:
+    case UsbDeviceHandle::OTHER:
       result |= LIBUSB_RECIPIENT_OTHER;
       break;
   }
@@ -90,33 +91,35 @@
 
 static void LIBUSB_CALL HandleTransferCompletion(
     struct libusb_transfer* transfer) {
-  UsbDevice* const device = reinterpret_cast<UsbDevice*>(transfer->user_data);
+  UsbDeviceHandle* const device =
+      reinterpret_cast<UsbDeviceHandle*>(transfer->user_data);
   device->TransferComplete(transfer);
 }
 
 }  // namespace
 
-UsbDevice::Transfer::Transfer() : length(0) {}
+UsbDeviceHandle::Transfer::Transfer() : length(0) {}
 
-UsbDevice::Transfer::~Transfer() {}
+UsbDeviceHandle::Transfer::~Transfer() {}
 
-UsbDevice::UsbDevice(UsbService* service, PlatformUsbDeviceHandle handle)
+UsbDeviceHandle::UsbDeviceHandle(
+    UsbService* service,
+    PlatformUsbDeviceHandle handle)
     : service_(service), handle_(handle) {
   DCHECK(handle) << "Cannot create device with NULL handle.";
 }
 
-UsbDevice::UsbDevice() : service_(NULL), handle_(NULL) {}
+UsbDeviceHandle::UsbDeviceHandle() : service_(NULL), handle_(NULL) {}
 
-UsbDevice::~UsbDevice() {}
+UsbDeviceHandle::~UsbDeviceHandle() {}
 
-void UsbDevice::Close(const base::Callback<void()>& callback) {
+void UsbDeviceHandle::Close() {
   CheckDevice();
   service_->CloseDevice(this);
   handle_ = NULL;
-  callback.Run();
 }
 
-void UsbDevice::TransferComplete(PlatformUsbTransferHandle handle) {
+void UsbDeviceHandle::TransferComplete(PlatformUsbTransferHandle handle) {
   base::AutoLock lock(lock_);
 
   // TODO(gdk): Handle device disconnect.
@@ -196,8 +199,7 @@
   libusb_free_transfer(handle);
 }
 
-void UsbDevice::ListInterfaces(UsbConfigDescriptor* config,
-                               const UsbInterfaceCallback& callback) {
+bool UsbDeviceHandle::ListInterfaces(UsbConfigDescriptor* config) {
   CheckDevice();
 
   PlatformUsbDevice device = libusb_get_device(handle_);
@@ -208,39 +210,41 @@
   if (list_result == 0) {
     config->Reset(platform_config);
   }
-  callback.Run(list_result == 0);
+  return list_result == 0;
 }
 
-void UsbDevice::ClaimInterface(const int interface_number,
-                               const UsbInterfaceCallback& callback) {
+bool UsbDeviceHandle::ClaimInterface(const int interface_number) {
   CheckDevice();
 
   const int claim_result = libusb_claim_interface(handle_, interface_number);
-  callback.Run(claim_result == 0);
+  return claim_result == 0;
 }
 
-void UsbDevice::ReleaseInterface(const int interface_number,
-                                 const UsbInterfaceCallback& callback) {
+bool UsbDeviceHandle::ReleaseInterface(const int interface_number) {
   CheckDevice();
 
   const int release_result = libusb_release_interface(handle_,
                                                       interface_number);
-  callback.Run(release_result == 0);
+  return release_result == 0;
 }
 
-void UsbDevice::SetInterfaceAlternateSetting(
+bool UsbDeviceHandle::SetInterfaceAlternateSetting(
     const int interface_number,
-    const int alternate_setting,
-    const UsbInterfaceCallback& callback) {
+    const int alternate_setting) {
   CheckDevice();
 
   const int setting_result = libusb_set_interface_alt_setting(handle_,
       interface_number, alternate_setting);
 
-  callback.Run(setting_result == 0);
+  return setting_result == 0;
 }
 
-void UsbDevice::ControlTransfer(const UsbEndpointDirection direction,
+bool UsbDeviceHandle::ResetDevice() {
+  CheckDevice();
+  return libusb_reset_device(handle_) == 0;
+}
+
+void UsbDeviceHandle::ControlTransfer(const UsbEndpointDirection direction,
     const TransferRequestType request_type, const TransferRecipient recipient,
     const uint8 request, const uint16 value, const uint16 index,
     net::IOBuffer* buffer, const size_t length, const unsigned int timeout,
@@ -267,7 +271,7 @@
                  callback);
 }
 
-void UsbDevice::BulkTransfer(const UsbEndpointDirection direction,
+void UsbDeviceHandle::BulkTransfer(const UsbEndpointDirection direction,
     const uint8 endpoint, net::IOBuffer* buffer, const size_t length,
     const unsigned int timeout, const UsbTransferCallback& callback) {
   CheckDevice();
@@ -280,7 +284,7 @@
   SubmitTransfer(transfer, USB_TRANSFER_BULK, buffer, length, callback);
 }
 
-void UsbDevice::InterruptTransfer(const UsbEndpointDirection direction,
+void UsbDeviceHandle::InterruptTransfer(const UsbEndpointDirection direction,
     const uint8 endpoint, net::IOBuffer* buffer, const size_t length,
     const unsigned int timeout, const UsbTransferCallback& callback) {
   CheckDevice();
@@ -293,7 +297,7 @@
   SubmitTransfer(transfer, USB_TRANSFER_INTERRUPT, buffer, length, callback);
 }
 
-void UsbDevice::IsochronousTransfer(const UsbEndpointDirection direction,
+void UsbDeviceHandle::IsochronousTransfer(const UsbEndpointDirection direction,
     const uint8 endpoint, net::IOBuffer* buffer, const size_t length,
     const unsigned int packets, const unsigned int packet_length,
     const unsigned int timeout, const UsbTransferCallback& callback) {
@@ -313,16 +317,11 @@
   SubmitTransfer(transfer, USB_TRANSFER_ISOCHRONOUS, buffer, length, callback);
 }
 
-void UsbDevice::ResetDevice(const base::Callback<void(bool)>& callback) {
-  CheckDevice();
-  callback.Run(libusb_reset_device(handle_) == 0);
-}
-
-void UsbDevice::CheckDevice() {
+void UsbDeviceHandle::CheckDevice() {
   DCHECK(handle_) << "Device is already closed.";
 }
 
-void UsbDevice::SubmitTransfer(PlatformUsbTransferHandle handle,
+void UsbDeviceHandle::SubmitTransfer(PlatformUsbTransferHandle handle,
                                UsbTransferType transfer_type,
                                net::IOBuffer* buffer,
                                const size_t length,
diff --git a/chrome/browser/usb/usb_device.h b/chrome/browser/usb/usb_device_handle.h
similarity index 81%
rename from chrome/browser/usb/usb_device.h
rename to chrome/browser/usb/usb_device_handle.h
index 0625e74..e46ab19 100644
--- a/chrome/browser/usb/usb_device.h
+++ b/chrome/browser/usb/usb_device_handle.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_BROWSER_USB_USB_DEVICE_H_
-#define CHROME_BROWSER_USB_USB_DEVICE_H_
+#ifndef CHROME_BROWSER_USB_USB_DEVICE_HANDLE_H_
+#define CHROME_BROWSER_USB_USB_DEVICE_HANDLE_H_
 
 #include <map>
 #include <vector>
@@ -43,12 +43,11 @@
 
 typedef base::Callback<void(UsbTransferStatus, scoped_refptr<net::IOBuffer>,
     size_t)> UsbTransferCallback;
-typedef base::Callback<void(bool)> UsbInterfaceCallback;
 
 // A UsbDevice wraps the platform's underlying representation of what a USB
 // device actually is, and provides accessors for performing many of the
 // standard USB operations.
-class UsbDevice : public base::RefCounted<UsbDevice> {
+class UsbDeviceHandle : public base::RefCounted<UsbDeviceHandle> {
  public:
   enum TransferRequestType { STANDARD, CLASS, VENDOR, RESERVED };
   enum TransferRecipient { DEVICE, INTERFACE, ENDPOINT, OTHER };
@@ -56,28 +55,23 @@
   // Usually you will not want to directly create a UsbDevice, favoring to let
   // the UsbService take care of the logistics of getting a platform device
   // handle and handling events for it.
-  UsbDevice(UsbService* service, PlatformUsbDeviceHandle handle);
+  UsbDeviceHandle(UsbService* service, PlatformUsbDeviceHandle handle);
 
   PlatformUsbDeviceHandle handle() { return handle_; }
 
-  // Close the USB device and release the underlying platform device. |callback|
-  // is invoked after the device has been closed.
-  virtual void Close(const base::Callback<void()>& callback);
+  // Close the USB device and release the underlying platform device.
+  virtual void Close();
 
-  virtual void ListInterfaces(UsbConfigDescriptor* config,
-                              const UsbInterfaceCallback& callback);
-
-  virtual void ClaimInterface(const int interface_number,
-                              const UsbInterfaceCallback& callback);
-
-  virtual void ReleaseInterface(const int interface_number,
-                                const UsbInterfaceCallback& callback);
-
-  virtual void SetInterfaceAlternateSetting(
+  // Device manipulation operations. These methods are blocking.
+  virtual bool ListInterfaces(UsbConfigDescriptor* config);
+  virtual bool ClaimInterface(const int interface_number);
+  virtual bool ReleaseInterface(const int interface_number);
+  virtual bool SetInterfaceAlternateSetting(
       const int interface_number,
-      const int alternate_setting,
-      const UsbInterfaceCallback& callback);
+      const int alternate_setting);
+  virtual bool ResetDevice();
 
+  // Async IO.
   virtual void ControlTransfer(const UsbEndpointDirection direction,
                                const TransferRequestType request_type,
                                const TransferRecipient recipient,
@@ -112,8 +106,6 @@
                                    const unsigned int timeout,
                                    const UsbTransferCallback& callback);
 
-  virtual void ResetDevice(const base::Callback<void(bool)>& callback);
-
   // Normal code should not call this function. It is called by the platform's
   // callback mechanism in such a way that it cannot be made private. Invokes
   // the callbacks associated with a given transfer, and removes it from the
@@ -122,10 +114,10 @@
 
  protected:
   // This constructor variant is for use in testing only.
-  UsbDevice();
+  UsbDeviceHandle();
 
-  friend class base::RefCounted<UsbDevice>;
-  virtual ~UsbDevice();
+  friend class base::RefCounted<UsbDeviceHandle>;
+  virtual ~UsbDeviceHandle();
 
  private:
   struct Transfer {
@@ -163,7 +155,7 @@
   base::Lock lock_;
   std::map<PlatformUsbTransferHandle, Transfer> transfers_;
 
-  DISALLOW_COPY_AND_ASSIGN(UsbDevice);
+  DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle);
 };
 
-#endif  // CHROME_BROWSER_USB_USB_DEVICE_H_
+#endif  // CHROME_BROWSER_USB_USB_DEVICE_HANDLE_H_
diff --git a/chrome/browser/usb/usb_interface.h b/chrome/browser/usb/usb_interface.h
index eb57f92..ca01210 100644
--- a/chrome/browser/usb/usb_interface.h
+++ b/chrome/browser/usb/usb_interface.h
@@ -18,7 +18,7 @@
 typedef const libusb_interface* PlatformUsbInterface;
 typedef const libusb_interface_descriptor* PlatformUsbInterfaceDescriptor;
 
-class UsbDevice;
+class UsbDeviceHandle;
 
 enum UsbTransferType {
   USB_TRANSFER_CONTROL = 0,
diff --git a/chrome/browser/usb/usb_service.cc b/chrome/browser/usb/usb_service.cc
index e44c8aa..33c54dd 100644
--- a/chrome/browser/usb/usb_service.cc
+++ b/chrome/browser/usb/usb_service.cc
@@ -10,7 +10,9 @@
 #include "base/bind_helpers.h"
 #include "base/logging.h"
 #include "base/stl_util.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "base/synchronization/waitable_event.h"
+#include "chrome/browser/usb/usb_device_handle.h"
+#include "third_party/libusb/src/libusb/interrupt.h"
 #include "third_party/libusb/src/libusb/libusb.h"
 
 #if defined(OS_CHROMEOS)
@@ -27,34 +29,38 @@
 class UsbEventHandler : public base::PlatformThread::Delegate {
  public:
   explicit UsbEventHandler(PlatformUsbContext context)
-      : running_(true), context_(context) {
-    base::PlatformThread::CreateNonJoinable(0, this);
+      : running_(true),
+        context_(context),
+        thread_handle_(0),
+        started_event_(false, false) {
+    base::PlatformThread::Create(0, this, &thread_handle_);
+    started_event_.Wait();
   }
 
   virtual ~UsbEventHandler() {}
 
   virtual void ThreadMain() OVERRIDE {
     base::PlatformThread::SetName("UsbEventHandler");
-
-    DLOG(INFO) << "UsbEventHandler started.";
-    while (running_) {
+    VLOG(1) << "UsbEventHandler started.";
+    started_event_.Signal();
+    while (running_)
       libusb_handle_events(context_);
-    }
-    DLOG(INFO) << "UsbEventHandler shutting down.";
-    libusb_exit(context_);
-
-    delete this;
+    VLOG(1) << "UsbEventHandler shutting down.";
   }
 
   void Stop() {
     running_ = false;
+    base::subtle::MemoryBarrier();
+    libusb_interrupt_handle_event(context_);
+    base::PlatformThread::Join(thread_handle_);
   }
 
  private:
-  bool running_;
+  volatile bool running_;
   PlatformUsbContext context_;
-
-  DISALLOW_EVIL_CONSTRUCTORS(UsbEventHandler);
+  base::PlatformThreadHandle thread_handle_;
+  base::WaitableEvent started_event_;
+  DISALLOW_COPY_AND_ASSIGN(UsbEventHandler);
 };
 
 UsbService::UsbService() {
@@ -64,15 +70,17 @@
 
 UsbService::~UsbService() {}
 
-void UsbService::Cleanup() {
+void UsbService::Shutdown() {
   event_handler_->Stop();
-  event_handler_ = NULL;
+  delete event_handler_;
+  libusb_exit(context_);
+  context_ = NULL;
 }
 
 void UsbService::FindDevices(const uint16 vendor_id,
                              const uint16 product_id,
                              int interface_id,
-                             vector<scoped_refptr<UsbDevice> >* devices,
+                             vector<scoped_refptr<UsbDeviceHandle> >* devices,
                              const base::Callback<void()>& callback) {
   DCHECK(event_handler_) << "FindDevices called after event handler stopped.";
 #if defined(OS_CHROMEOS)
@@ -105,7 +113,7 @@
 }
 
 void UsbService::EnumerateDevices(
-    std::vector<scoped_refptr<UsbDevice> >* devices) {
+    std::vector<scoped_refptr<UsbDeviceHandle> >* devices) {
   devices->clear();
 
   DeviceVector enumerated_devices;
@@ -114,17 +122,18 @@
   for (DeviceVector::iterator it = enumerated_devices.begin();
        it != enumerated_devices.end(); ++it) {
     PlatformUsbDevice device = it->device();
-    UsbDevice* const wrapper = LookupOrCreateDevice(device);
+    UsbDeviceHandle* const wrapper = LookupOrCreateDevice(device);
     if (wrapper)
       devices->push_back(wrapper);
   }
 }
 
-void UsbService::FindDevicesImpl(const uint16 vendor_id,
-                                 const uint16 product_id,
-                                 vector<scoped_refptr<UsbDevice> >* devices,
-                                 const base::Callback<void()>& callback,
-                                 bool success) {
+void UsbService::FindDevicesImpl(
+    const uint16 vendor_id,
+    const uint16 product_id,
+    vector<scoped_refptr<UsbDeviceHandle> >* devices,
+    const base::Callback<void()>& callback,
+    bool success) {
   base::ScopedClosureRunner run_callback(callback);
 
   devices->clear();
@@ -142,14 +151,14 @@
        it != enumerated_devices.end(); ++it) {
     PlatformUsbDevice device = it->device();
     if (DeviceMatches(device, vendor_id, product_id)) {
-      UsbDevice* const wrapper = LookupOrCreateDevice(device);
+      UsbDeviceHandle* const wrapper = LookupOrCreateDevice(device);
       if (wrapper)
         devices->push_back(wrapper);
     }
   }
 }
 
-void UsbService::CloseDevice(scoped_refptr<UsbDevice> device) {
+void UsbService::CloseDevice(scoped_refptr<UsbDeviceHandle> device) {
   DCHECK(event_handler_) << "CloseDevice called after event handler stopped.";
 
   PlatformUsbDevice platform_device = libusb_get_device(device->handle());
@@ -206,7 +215,7 @@
   return descriptor.idVendor == vendor_id && descriptor.idProduct == product_id;
 }
 
-UsbDevice* UsbService::LookupOrCreateDevice(PlatformUsbDevice device) {
+UsbDeviceHandle* UsbService::LookupOrCreateDevice(PlatformUsbDevice device) {
   if (!ContainsKey(devices_, device)) {
     libusb_device_handle* handle = NULL;
     if (libusb_open(device, &handle)) {
@@ -214,7 +223,7 @@
       return NULL;
     }
 
-    UsbDevice* wrapper = new UsbDevice(this, handle);
+    UsbDeviceHandle* wrapper = new UsbDeviceHandle(this, handle);
     devices_[device] = wrapper;
   }
   return devices_[device].get();
diff --git a/chrome/browser/usb/usb_service.h b/chrome/browser/usb/usb_service.h
index f2cfd3c..666a26c 100644
--- a/chrome/browser/usb/usb_service.h
+++ b/chrome/browser/usb/usb_service.h
@@ -11,7 +11,7 @@
 
 #include "base/basictypes.h"
 #include "base/threading/platform_thread.h"
-#include "chrome/browser/usb/usb_device.h"
+#include "chrome/browser/usb/usb_device_handle.h"
 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
 #include "third_party/libusb/src/libusb/libusb.h"
 
@@ -27,9 +27,9 @@
   UsbService();
   virtual ~UsbService();
 
-  // Cleanup must be invoked before the service is destroyed. It interrupts the
+  // Shutdown must be invoked before the service is destroyed. It interrupts the
   // event handling thread and disposes of open devices.
-  void Cleanup();
+  virtual void Shutdown() OVERRIDE;
 
   // Find all of the devices attached to the system that are identified by
   // |vendor_id| and |product_id|, inserting them into |devices|. Clears
@@ -37,16 +37,16 @@
   void FindDevices(const uint16 vendor_id,
                    const uint16 product_id,
                    int interface_id,
-                   std::vector<scoped_refptr<UsbDevice> >* devices,
+                   std::vector<scoped_refptr<UsbDeviceHandle> >* devices,
                    const base::Callback<void()>& callback);
 
   // Find all of the devices attached to the system, inserting them into
   // |devices|. Clears |devices| before use.
-  void EnumerateDevices(std::vector<scoped_refptr<UsbDevice> >* devices);
+  void EnumerateDevices(std::vector<scoped_refptr<UsbDeviceHandle> >* devices);
 
   // This function should not be called by normal code. It is invoked by a
   // UsbDevice's Close function and disposes of the associated platform handle.
-  void CloseDevice(scoped_refptr<UsbDevice> device);
+  void CloseDevice(scoped_refptr<UsbDeviceHandle> device);
 
  private:
   // RefCountedPlatformUsbDevice takes care of managing the underlying reference
@@ -78,7 +78,7 @@
   // FindDevices.
   void FindDevicesImpl(const uint16 vendor_id,
                        const uint16 product_id,
-                       std::vector<scoped_refptr<UsbDevice> >* devices,
+                       std::vector<scoped_refptr<UsbDeviceHandle> >* devices,
                        const base::Callback<void()>& callback,
                        bool success);
 
@@ -88,7 +88,7 @@
   // If a UsbDevice wrapper corresponding to |device| has already been created,
   // returns it. Otherwise, opens the device, creates a wrapper, and associates
   // the wrapper with the device internally.
-  UsbDevice* LookupOrCreateDevice(PlatformUsbDevice device);
+  UsbDeviceHandle* LookupOrCreateDevice(PlatformUsbDevice device);
 
   PlatformUsbContext context_;
   UsbEventHandler* event_handler_;
@@ -96,7 +96,8 @@
   // The devices_ map contains scoped_refptrs to all open devices, indicated by
   // their vendor and product id. This allows for reusing an open device without
   // creating another platform handle for it.
-  typedef std::map<PlatformUsbDevice, scoped_refptr<UsbDevice> > DeviceMap;
+  typedef std::map<PlatformUsbDevice, scoped_refptr<UsbDeviceHandle> >
+      DeviceMap;
   DeviceMap devices_;
 
   DISALLOW_COPY_AND_ASSIGN(UsbService);
diff --git a/chrome/browser/usb/usb_service_unittest.cc b/chrome/browser/usb/usb_service_unittest.cc
new file mode 100644
index 0000000..b0eeb9b
--- /dev/null
+++ b/chrome/browser/usb/usb_service_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/usb/usb_service.h"
+
+#include "build/build_config.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+typedef testing::Test UsbServiceTest;
+
+#if defined(OS_LINUX)
+// Linux trybot does not support usb.
+#define MAYBE_GracefulShutdown DISABLED_GracefulShutdown
+#elif defined(OS_ANDROID)
+// Android build does not include usb support.
+#define MAYBE_GracefulShutdown DISABLED_GracefulShutdown
+#else
+#define MAYBE_GracefulShutdown GracefulShutdown
+#endif
+
+TEST_F(UsbServiceTest, MAYBE_GracefulShutdown) {
+  base::TimeTicks start = base::TimeTicks::Now();
+  scoped_ptr<UsbService> service(new UsbService());
+  service->Shutdown();
+  base::TimeDelta elapse = base::TimeTicks::Now() - start;
+  if (elapse > base::TimeDelta::FromSeconds(2)) {
+    FAIL();
+  }
+}
+
+}  // namespace
diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm
index ad056e7..a4957b8 100644
--- a/chrome/browser/web_applications/web_app_mac_unittest.mm
+++ b/chrome/browser/web_applications/web_app_mac_unittest.mm
@@ -54,49 +54,67 @@
   info.extension_path = base::FilePath("/fake/extension/path");
   info.title = ASCIIToUTF16("Shortcut Title");
   info.url = GURL("http://example.com/");
-  info.profile_path = base::FilePath("Profile 1");
+  info.profile_path = base::FilePath("user_data_dir").Append("Profile 1");
   info.profile_name = "profile name";
   return info;
 }
 
+class WebAppShortcutCreatorTest : public testing::Test {
+ protected:
+  WebAppShortcutCreatorTest() {}
+
+  virtual void SetUp() {
+    EXPECT_TRUE(app_data_path_temp_dir_.CreateUniqueTempDir());
+    EXPECT_TRUE(destination_path_temp_dir_.CreateUniqueTempDir());
+    app_data_path_ = app_data_path_temp_dir_.path();
+    destination_path_ = destination_path_temp_dir_.path();
+
+    info_ = GetShortcutInfo();
+    shim_base_name_ = base::FilePath(
+        info_.profile_path.BaseName().value() +
+        " " + info_.extension_id + ".app");
+    internal_shim_path_ = app_data_path_.Append(shim_base_name_);
+    shim_path_ = destination_path_.Append(shim_base_name_);
+  }
+
+  base::ScopedTempDir app_data_path_temp_dir_;
+  base::ScopedTempDir destination_path_temp_dir_;
+  base::FilePath app_data_path_;
+  base::FilePath destination_path_;
+
+  ShellIntegration::ShortcutInfo info_;
+  base::FilePath shim_base_name_;
+  base::FilePath internal_shim_path_;
+  base::FilePath shim_path_;
+ private:
+  DISALLOW_COPY_AND_ASSIGN(WebAppShortcutCreatorTest);
+};
+
+
 }  // namespace
 
 namespace web_app {
 
-TEST(WebAppShortcutCreatorTest, CreateShortcuts) {
-  base::ScopedTempDir temp_app_data_path;
-  EXPECT_TRUE(temp_app_data_path.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-
-  ShellIntegration::ShortcutInfo info = GetShortcutInfo();
-
-  base::FilePath app_name(
-      info.profile_path.value() + " " + info.extension_id + ".app");
-  base::FilePath app_in_app_data_path_path =
-      temp_app_data_path.path().Append(app_name);
-  base::FilePath dst_folder = temp_dst_dir.path();
-  base::FilePath dst_path = dst_folder.Append(app_name);
-
-  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
-      temp_app_data_path.path(), info);
+TEST_F(WebAppShortcutCreatorTest, CreateShortcuts) {
+  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(app_data_path_, info_);
   EXPECT_CALL(shortcut_creator, GetDestinationPath())
-      .WillRepeatedly(Return(dst_folder));
+      .WillRepeatedly(Return(destination_path_));
   EXPECT_CALL(shortcut_creator, RevealAppShimInFinder());
 
   EXPECT_TRUE(shortcut_creator.CreateShortcuts());
-  EXPECT_TRUE(base::PathExists(app_in_app_data_path_path));
-  EXPECT_TRUE(base::PathExists(dst_path));
-  EXPECT_EQ(dst_path.BaseName(), shortcut_creator.GetShortcutName());
+  EXPECT_TRUE(base::PathExists(shim_path_));
+  EXPECT_TRUE(base::PathExists(destination_path_));
+  EXPECT_EQ(shim_base_name_, shortcut_creator.GetShortcutName());
 
-  base::FilePath plist_path = dst_path.Append("Contents").Append("Info.plist");
+  base::FilePath plist_path =
+      shim_path_.Append("Contents").Append("Info.plist");
   NSDictionary* plist = [NSDictionary dictionaryWithContentsOfFile:
       base::mac::FilePathToNSString(plist_path)];
-  EXPECT_NSEQ(base::SysUTF8ToNSString(info.extension_id),
+  EXPECT_NSEQ(base::SysUTF8ToNSString(info_.extension_id),
               [plist objectForKey:app_mode::kCrAppModeShortcutIDKey]);
-  EXPECT_NSEQ(base::SysUTF16ToNSString(info.title),
+  EXPECT_NSEQ(base::SysUTF16ToNSString(info_.title),
               [plist objectForKey:app_mode::kCrAppModeShortcutNameKey]);
-  EXPECT_NSEQ(base::SysUTF8ToNSString(info.url.spec()),
+  EXPECT_NSEQ(base::SysUTF8ToNSString(info_.url.spec()),
               [plist objectForKey:app_mode::kCrAppModeShortcutURLKey]);
 
   // Make sure all values in the plist are actually filled in.
@@ -110,137 +128,90 @@
   }
 }
 
-TEST(WebAppShortcutCreatorTest, UpdateShortcuts) {
-  base::ScopedTempDir temp_app_data_path;
-  EXPECT_TRUE(temp_app_data_path.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir_other;
-  EXPECT_TRUE(temp_dst_dir_other.CreateUniqueTempDir());
+TEST_F(WebAppShortcutCreatorTest, UpdateShortcuts) {
+  base::ScopedTempDir other_folder_temp_dir;
+  EXPECT_TRUE(other_folder_temp_dir.CreateUniqueTempDir());
+  base::FilePath other_folder = other_folder_temp_dir.path();
+  base::FilePath other_shim_path = other_folder.Append(shim_base_name_);
 
-  ShellIntegration::ShortcutInfo info = GetShortcutInfo();
-
-  base::FilePath app_name(
-      info.profile_path.value() + " " + info.extension_id + ".app");
-  base::FilePath app_in_app_data_path_path =
-      temp_app_data_path.path().Append(app_name);
-  base::FilePath dst_folder = temp_dst_dir.path();
-  base::FilePath other_folder = temp_dst_dir_other.path();
-
-  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
-      temp_app_data_path.path(), info);
+  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(app_data_path_, info_);
   EXPECT_CALL(shortcut_creator, GetDestinationPath())
-      .WillRepeatedly(Return(dst_folder));
+      .WillRepeatedly(Return(destination_path_));
 
   std::string expected_bundle_id = kFakeChromeBundleId;
-  expected_bundle_id += ".app.Profile-1-" + info.extension_id;
+  expected_bundle_id += ".app.Profile-1-" + info_.extension_id;
   EXPECT_CALL(shortcut_creator, GetAppBundleById(expected_bundle_id))
-      .WillOnce(Return(other_folder.Append(app_name)));
+      .WillOnce(Return(other_shim_path));
 
-  shortcut_creator.BuildShortcut(other_folder.Append(app_name));
+  EXPECT_TRUE(shortcut_creator.BuildShortcut(other_shim_path));
 
-  EXPECT_TRUE(base::DeleteFile(
-      other_folder.Append(app_name).Append("Contents"), true));
+  EXPECT_TRUE(base::DeleteFile(other_shim_path.Append("Contents"), true));
 
   EXPECT_TRUE(shortcut_creator.UpdateShortcuts());
-  EXPECT_FALSE(base::PathExists(dst_folder.Append(app_name)));
-  EXPECT_TRUE(base::PathExists(
-      other_folder.Append(app_name).Append("Contents")));
+  EXPECT_FALSE(base::PathExists(shim_path_));
+  EXPECT_TRUE(base::PathExists(other_shim_path.Append("Contents")));
 
   // Also test case where GetAppBundleById fails.
   EXPECT_CALL(shortcut_creator, GetAppBundleById(expected_bundle_id))
       .WillOnce(Return(base::FilePath()));
 
-  shortcut_creator.BuildShortcut(other_folder.Append(app_name));
+  EXPECT_TRUE(shortcut_creator.BuildShortcut(other_shim_path));
 
-  EXPECT_TRUE(base::DeleteFile(
-      other_folder.Append(app_name).Append("Contents"), true));
+  EXPECT_TRUE(base::DeleteFile(other_shim_path.Append("Contents"), true));
 
   EXPECT_FALSE(shortcut_creator.UpdateShortcuts());
-  EXPECT_FALSE(base::PathExists(dst_folder.Append(app_name)));
-  EXPECT_FALSE(base::PathExists(
-      other_folder.Append(app_name).Append("Contents")));
+  EXPECT_FALSE(base::PathExists(shim_path_));
+  EXPECT_FALSE(base::PathExists(other_shim_path.Append("Contents")));
 }
 
-TEST(WebAppShortcutCreatorTest, CreateAppListShortcut) {
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-
-  ShellIntegration::ShortcutInfo info = GetShortcutInfo();
-
-  base::FilePath dst_folder = temp_dst_dir.path();
-
+TEST_F(WebAppShortcutCreatorTest, CreateAppListShortcut) {
   // With an empty |profile_name|, the shortcut path should not have the profile
   // directory prepended to the extension id on the app bundle name.
-  info.profile_name.clear();
-  base::FilePath dst_path = dst_folder.Append(info.extension_id + ".app");
+  info_.profile_name.clear();
+  base::FilePath dst_path =
+      destination_path_.Append(info_.extension_id + ".app");
 
-  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(base::FilePath(), info);
+  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(base::FilePath(), info_);
   EXPECT_CALL(shortcut_creator, GetDestinationPath())
-      .WillRepeatedly(Return(dst_folder));
+      .WillRepeatedly(Return(destination_path_));
   EXPECT_EQ(dst_path.BaseName(), shortcut_creator.GetShortcutName());
 }
 
-TEST(WebAppShortcutCreatorTest, RunShortcut) {
-  base::ScopedTempDir temp_app_data_path;
-  EXPECT_TRUE(temp_app_data_path.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-
-  ShellIntegration::ShortcutInfo info = GetShortcutInfo();
-
-  base::FilePath dst_folder = temp_dst_dir.path();
-  base::FilePath dst_path = dst_folder.Append(
-      info.profile_path.value() + " " + info.extension_id + ".app");
-
-  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
-      temp_app_data_path.path(), info);
+TEST_F(WebAppShortcutCreatorTest, RunShortcut) {
+  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(app_data_path_, info_);
   EXPECT_CALL(shortcut_creator, GetDestinationPath())
-      .WillRepeatedly(Return(dst_folder));
+      .WillRepeatedly(Return(destination_path_));
   EXPECT_CALL(shortcut_creator, RevealAppShimInFinder());
 
   EXPECT_TRUE(shortcut_creator.CreateShortcuts());
-  EXPECT_TRUE(base::PathExists(dst_path));
+  EXPECT_TRUE(base::PathExists(shim_path_));
 
   ssize_t status = getxattr(
-      dst_path.value().c_str(), "com.apple.quarantine", NULL, 0, 0, 0);
+      shim_path_.value().c_str(), "com.apple.quarantine", NULL, 0, 0, 0);
   EXPECT_EQ(-1, status);
   EXPECT_EQ(ENOATTR, errno);
 }
 
-TEST(WebAppShortcutCreatorTest, CreateFailure) {
-  base::ScopedTempDir temp_app_data_path;
-  EXPECT_TRUE(temp_app_data_path.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-
+TEST_F(WebAppShortcutCreatorTest, CreateFailure) {
   base::FilePath non_existent_path =
-      temp_dst_dir.path().Append("not-existent").Append("name.app");
+      destination_path_.Append("not-existent").Append("name.app");
 
-  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
-      temp_app_data_path.path(), GetShortcutInfo());
+  NiceMock<WebAppShortcutCreatorMock> shortcut_creator(app_data_path_, info_);
   EXPECT_CALL(shortcut_creator, GetDestinationPath())
       .WillRepeatedly(Return(non_existent_path));
   EXPECT_FALSE(shortcut_creator.CreateShortcuts());
 }
 
-TEST(WebAppShortcutCreatorTest, UpdateIcon) {
-  base::ScopedTempDir temp_app_data_path;
-  EXPECT_TRUE(temp_app_data_path.CreateUniqueTempDir());
-  base::ScopedTempDir temp_dst_dir;
-  EXPECT_TRUE(temp_dst_dir.CreateUniqueTempDir());
-  base::FilePath dst_path = temp_dst_dir.path();
-
-  ShellIntegration::ShortcutInfo info = GetShortcutInfo();
+TEST_F(WebAppShortcutCreatorTest, UpdateIcon) {
   gfx::Image product_logo =
       ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
           IDR_PRODUCT_LOGO_32);
-  info.favicon.Add(product_logo);
-  WebAppShortcutCreatorMock shortcut_creator(temp_app_data_path.path(), info);
+  info_.favicon.Add(product_logo);
+  WebAppShortcutCreatorMock shortcut_creator(app_data_path_, info_);
 
-  ASSERT_TRUE(shortcut_creator.UpdateIcon(dst_path));
+  ASSERT_TRUE(shortcut_creator.UpdateIcon(shim_path_));
   base::FilePath icon_path =
-      dst_path.Append("Contents").Append("Resources").Append("app.icns");
+      shim_path_.Append("Contents").Append("Resources").Append("app.icns");
 
   base::scoped_nsobject<NSImage> image([[NSImage alloc]
       initWithContentsOfFile:base::mac::FilePathToNSString(icon_path)]);
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 32ea061..767a22a 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -377,8 +377,6 @@
             }],
             ['enable_mdns == 1', {
               'sources': [
-                'utility/local_discovery/local_domain_resolver.cc',
-                'utility/local_discovery/local_domain_resolver.h',
                 'utility/local_discovery/service_discovery_client_impl.cc',
                 'utility/local_discovery/service_discovery_client_impl.h',
                 'utility/local_discovery/service_discovery_message_handler.cc',
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 8ed8adc..27d7415 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -439,6 +439,10 @@
         'browser/content_settings/host_content_settings_map.h',
         'browser/content_settings/local_shared_objects_container.cc',
         'browser/content_settings/local_shared_objects_container.h',
+        'browser/content_settings/permission_queue_controller.cc',
+        'browser/content_settings/permission_queue_controller.h',
+        'browser/content_settings/permission_request_id.cc',
+        'browser/content_settings/permission_request_id.h',
         'browser/content_settings/tab_specific_content_settings.cc',
         'browser/content_settings/tab_specific_content_settings.h',
         'browser/crash_upload_list.cc',
@@ -603,10 +607,6 @@
         'browser/geolocation/geolocation_infobar_delegate.h',
         'browser/geolocation/geolocation_infobar_delegate_android.cc',
         'browser/geolocation/geolocation_infobar_delegate_android.h',
-        'browser/geolocation/geolocation_infobar_queue_controller.cc',
-        'browser/geolocation/geolocation_infobar_queue_controller.h',
-        'browser/geolocation/geolocation_permission_request_id.cc',
-        'browser/geolocation/geolocation_permission_request_id.h',
         'browser/geolocation/geolocation_prefs.cc',
         'browser/geolocation/geolocation_prefs.h',
         'browser/global_keyboard_shortcuts_mac.h',
@@ -837,8 +837,6 @@
         'browser/importer/firefox_profile_lock.h',
         'browser/importer/firefox_profile_lock_posix.cc',
         'browser/importer/firefox_profile_lock_win.cc',
-        'browser/importer/firefox_proxy_settings.cc',
-        'browser/importer/firefox_proxy_settings.h',
         'browser/importer/importer_list.cc',
         'browser/importer/importer_list.h',
         'browser/importer/importer_list_observer.h',
@@ -902,6 +900,8 @@
         'browser/lifetime/application_lifetime_mac.mm',
         'browser/lifetime/application_lifetime_stub.cc',
         'browser/lifetime/application_lifetime_win.cc',
+        'browser/local_discovery/privet_confirm_api_flow.cc',
+        'browser/local_discovery/privet_confirm_api_flow.h',
         'browser/local_discovery/privet_constants.h',
         'browser/local_discovery/privet_constants.cc',
         'browser/local_discovery/privet_url_fetcher.cc',
@@ -1098,13 +1098,15 @@
         'browser/net/dns_probe_service.h',
         'browser/net/evicted_domain_cookie_counter.cc',
         'browser/net/evicted_domain_cookie_counter.h',
+        'browser/net/firefox_proxy_settings.cc',
+        'browser/net/firefox_proxy_settings.h',
         'browser/net/gaia/gaia_oauth_consumer.h',
         'browser/net/gaia/gaia_oauth_fetcher.cc',
         'browser/net/gaia/gaia_oauth_fetcher.h',
         'browser/net/http_pipelining_compatibility_client.cc',
         'browser/net/http_pipelining_compatibility_client.h',
-        'browser/net/http_server_properties_manager.h',
         'browser/net/http_server_properties_manager.cc',
+        'browser/net/http_server_properties_manager.h',
         'browser/net/load_time_stats.cc',
         'browser/net/load_time_stats.h',
         'browser/net/net_error_tab_helper.cc',
@@ -2270,8 +2272,10 @@
         'browser/upgrade_detector.h',
         'browser/upgrade_detector_impl.cc',
         'browser/upgrade_detector_impl.h',
-        'browser/usb/usb_device.cc',
-        'browser/usb/usb_device.h',
+        'browser/upload_list.cc',
+        'browser/upload_list.h',
+        'browser/usb/usb_device_handle.cc',
+        'browser/usb/usb_device_handle.h',
         'browser/usb/usb_interface.cc',
         'browser/usb/usb_interface.h',
         'browser/usb/usb_service.cc',
@@ -2383,7 +2387,7 @@
             '../ui/surface/surface.gyp:surface',
             '../ui/web_dialogs/web_dialogs.gyp:web_dialogs',
             '../v8/tools/gyp/v8.gyp:v8',
-            '../webkit/glue/webkit_glue_common.gyp:glue_common',
+            '../webkit/common/webkit_common.gyp:webkit_common',
             '../webkit/plugins/webkit_plugins.gyp:plugins_common',
             '../webkit/storage_browser.gyp:webkit_storage_browser',
             '../webkit/storage_common.gyp:webkit_storage_common',
@@ -2504,8 +2508,8 @@
             'browser/nacl_host/pnacl_host.h',
             'browser/nacl_host/pnacl_translation_cache.cc',
             'browser/nacl_host/pnacl_translation_cache.h',
-            'common/nacl_debug_exception_handler_win.cc',
-            'common/nacl_debug_exception_handler_win.h',
+            '../components/nacl/common/nacl_debug_exception_handler_win.cc',
+            '../components/nacl/common/nacl_debug_exception_handler_win.h',
           ],
           'dependencies': [
             '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
@@ -2839,12 +2843,6 @@
             ['exclude', '^browser/automation/'],
           ],
         }],
-        ['enable_language_detection==0', {
-          'sources!': [
-            'browser/language_usage_metrics.cc',
-            'browser/language_usage_metrics.h',
-          ],
-        }],
         ['enable_printing!=1', {
           'sources/': [
             ['exclude', '^browser/printing/'],
@@ -2979,6 +2977,7 @@
             ['include', '^browser/first_run/first_run.cc'], # For ctor/dtor of a struct.
             ['exclude', '^browser/importer/'],
             ['exclude', '^browser/media_galleries/'],
+            ['exclude', '^browser/net/firefox_*'],
             ['exclude', '^browser/service/'],
             ['exclude', '^browser/sync/glue/app_'],
             ['exclude', '^browser/sync/glue/extension_'],
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi
index c891274..3e713d7 100644
--- a/chrome/chrome_browser_chromeos.gypi
+++ b/chrome/chrome_browser_chromeos.gypi
@@ -249,8 +249,6 @@
         'browser/chromeos/drive/file_errors.h',
         'browser/chromeos/drive/file_system.cc',
         'browser/chromeos/drive/file_system.h',
-        'browser/chromeos/drive/file_system/close_file_operation.cc',
-        'browser/chromeos/drive/file_system/close_file_operation.h',
         'browser/chromeos/drive/file_system/copy_operation.cc',
         'browser/chromeos/drive/file_system/copy_operation.h',
         'browser/chromeos/drive/file_system/create_directory_operation.cc',
@@ -391,6 +389,8 @@
         'browser/chromeos/input_method/input_method_engine.h',
         'browser/chromeos/input_method/input_method_manager_impl.cc',
         'browser/chromeos/input_method/input_method_manager_impl.h',
+        'browser/chromeos/input_method/input_method_manager_impl_ll.cc',
+        'browser/chromeos/input_method/input_method_manager_impl_ll.h',
         'browser/chromeos/input_method/input_method_persistence.cc',
         'browser/chromeos/input_method/input_method_persistence.h',
         'browser/chromeos/input_method/input_method_util.cc',
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index aabc152..ba052bd 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -44,7 +44,6 @@
         '../webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
         '../webkit/storage_browser.gyp:webkit_storage_browser',
         '../webkit/storage_common.gyp:webkit_storage_common',
-        '../webkit/support/webkit_support.gyp:glue',
         '../webkit/webkit_resources.gyp:webkit_resources',
       ],
       'include_dirs': [
@@ -455,10 +454,10 @@
         'browser/extensions/api/system_display/display_info_provider_x11.cc',
         'browser/extensions/api/system_display/system_display_api.cc',
         'browser/extensions/api/system_display/system_display_api.h',
-        'browser/extensions/api/system_info_memory/memory_info_provider.cc',
-        'browser/extensions/api/system_info_memory/memory_info_provider.h',
-        'browser/extensions/api/system_info_memory/system_info_memory_api.cc',
-        'browser/extensions/api/system_info_memory/system_info_memory_api.h',
+        'browser/extensions/api/system_memory/memory_info_provider.cc',
+        'browser/extensions/api/system_memory/memory_info_provider.h',
+        'browser/extensions/api/system_memory/system_memory_api.cc',
+        'browser/extensions/api/system_memory/system_memory_api.h',
         'browser/extensions/api/system_info_storage/storage_free_space_observer.h',
         'browser/extensions/api/system_info_storage/storage_info_provider.cc',
         'browser/extensions/api/system_info_storage/storage_info_provider.h',
@@ -972,6 +971,11 @@
             'browser/extensions/platform_app_launcher.h',
           ],
         }],
+        ['chrome_multiple_dll!=1', {
+          'dependencies': [
+            '../webkit/support/webkit_support.gyp:glue',
+          ],
+        }],
       ],
     },
   ],
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index ee61dee..70ae5f9 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -2417,7 +2417,6 @@
             '../webkit/common/webkit_common.gyp:webkit_common',
             '../webkit/storage_browser.gyp:webkit_storage_browser',
             '../webkit/storage_common.gyp:webkit_storage_common',
-            '../webkit/support/webkit_support.gyp:glue',
             '../webkit/webkit_resources.gyp:webkit_resources',
           ],
           'defines': [
@@ -2441,6 +2440,11 @@
             ['include', '^browser/ui/profile_error_dialog\\.cc$'],
           ],
         }],
+        ['OS!="ios" and chrome_multiple_dll!=1', {
+          'dependencies': [
+            '../webkit/support/webkit_support.gyp:glue',
+          ],
+        }],
         ['OS == "android"', {
           'dependencies': [
             '../third_party/openssl/openssl.gyp:openssl',
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 5444c5d..6ae85c4 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -24,6 +24,7 @@
         # TODO(gregoryd): chrome_resources and chrome_strings could be
         #  shared with the 64-bit target, but it does not work due to a gyp
         # issue.
+        '../third_party/cld/cld.gyp:cld',
         'common_net',
         'common_version',
         'installer_util',
@@ -53,8 +54,6 @@
       'sources': [
         '../apps/app_shim/app_shim_launch.h',
         '../apps/app_shim/app_shim_messages.h',
-        '../extensions/common/constants.cc',
-        '../extensions/common/constants.h',
         '../extensions/common/crx_file.cc',
         '../extensions/common/crx_file.h',
         '../extensions/common/draggable_region.cc',
@@ -405,11 +404,6 @@
         'common/multi_process_lock_linux.cc',
         'common/multi_process_lock_mac.cc',
         'common/multi_process_lock_win.cc',
-        'common/nacl_host_messages.h',
-        'common/nacl_messages.cc',
-        'common/nacl_messages.h',
-        'common/nacl_types.cc',
-        'common/nacl_types.h',
         'common/omaha_query_params/omaha_query_params.cc',
         'common/omaha_query_params/omaha_query_params.h',
         'common/omnibox_focus_state.h',
@@ -420,8 +414,6 @@
         'common/pepper_flash.h',
         'common/pepper_permission_util.cc',
         'common/pepper_permission_util.h',
-        'common/pnacl_types.cc',
-        'common/pnacl_types.h',
         'common/policy/policy_schema.cc',
         'common/policy/policy_schema.h',
         'common/pref_names_util.cc',
@@ -480,8 +472,11 @@
         'common/web_application_info.h',
         'common/worker_thread_ticker.cc',
         'common/worker_thread_ticker.h',
+        '../components/nacl/common/nacl_host_messages.h',
         '../components/nacl/common/nacl_process_type.h',
         '../components/nacl/common/nacl_sandbox_type_mac.h',
+        '../components/nacl/common/pnacl_types.cc',
+        '../components/nacl/common/pnacl_types.h',
       ],
       'conditions': [
         ['enable_extensions==1', {
@@ -538,7 +533,6 @@
             '<(DEPTH)/third_party/adobe/flash/flash_player.gyp:flapper_version_h',
             '<(DEPTH)/third_party/re2/re2.gyp:re2',
             '<(DEPTH)/third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
-            '<(DEPTH)/webkit/support/webkit_support.gyp:glue',
           ],
         }, {  # OS == ios
           'sources/': [
@@ -573,6 +567,11 @@
             '<(DEPTH)/breakpad/src',
           ],
         }],
+        ['OS!="ios" and chrome_multiple_dll!=1', {
+          'dependencies': [
+            '<(DEPTH)/webkit/support/webkit_support.gyp:glue',
+          ],
+        }],
         ['OS=="android"', {
           'sources/': [
             ['exclude', '^common/chrome_version_info_posix.cc'],
@@ -652,11 +651,6 @@
             'common/media/webrtc_logging_messages.h',
           ]
         }],
-        ['enable_language_detection==1', {
-          'dependencies': [
-            '../third_party/cld/cld.gyp:cld',
-          ],
-        }],
       ],
       'target_conditions': [
         ['OS == "ios"', {
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index fa6d12d..5063926 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -27,12 +27,11 @@
         '../third_party/re2/re2.gyp:re2',
         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
         '../ui/surface/surface.gyp:surface',
+        '../webkit/common/webkit_common.gyp:webkit_common',
         '../webkit/support/webkit_support.gyp:glue_child',
-        '../webkit/glue/webkit_glue_common.gyp:glue_common',
         '../webkit/renderer/webkit_renderer.gyp:webkit_renderer',
         '../webkit/support/webkit_support.gyp:glue',
         '../webkit/support/webkit_support.gyp:plugins',
-        '../webkit/support/webkit_support.gyp:webkit_media',
         '../webkit/webkit_resources.gyp:webkit_resources',
       ],
       'include_dirs': [
@@ -234,8 +233,6 @@
         'renderer/external_extension.h',
         'renderer/page_load_histograms.cc',
         'renderer/page_load_histograms.h',
-        'renderer/pepper/chrome_ppapi_interfaces.cc',
-        'renderer/pepper/chrome_ppapi_interfaces.h',
         'renderer/pepper/chrome_renderer_pepper_host_factory.cc',
         'renderer/pepper/chrome_renderer_pepper_host_factory.h',
         'renderer/pepper/pepper_extensions_common_host.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 1412782..84b38ff 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -974,8 +974,7 @@
         'test/chromedriver/session.h',
         'test/chromedriver/session_commands.cc',
         'test/chromedriver/session_commands.h',
-        'test/chromedriver/session_map.h',
-        'test/chromedriver/synchronized_map.h',
+        'test/chromedriver/session_thread_map.h',
         'test/chromedriver/util.cc',
         'test/chromedriver/util.h',
         'test/chromedriver/window_commands.cc',
@@ -1059,14 +1058,11 @@
         'test/chromedriver/chrome/web_view_impl_unittest.cc',
         'test/chromedriver/chrome_launcher_unittest.cc',
         'test/chromedriver/commands_unittest.cc',
-        'test/chromedriver/fake_session_accessor.cc',
-        'test/chromedriver/fake_session_accessor.h',
         'test/chromedriver/logging_unittest.cc',
         'test/chromedriver/server/http_handler_unittest.cc',
         'test/chromedriver/server/http_response_unittest.cc',
         'test/chromedriver/session_commands_unittest.cc',
         'test/chromedriver/session_unittest.cc',
-        'test/chromedriver/synchronized_map_unittest.cc',
         'test/chromedriver/util_unittest.cc',
       ],
       'conditions': [
@@ -1342,7 +1338,7 @@
         'browser/extensions/api/system_indicator/system_indicator_apitest.cc',
         'browser/extensions/api/system_cpu/system_cpu_apitest.cc',
         'browser/extensions/api/system_display/system_display_apitest.cc',
-        'browser/extensions/api/system_info_memory/system_info_memory_apitest.cc',
+        'browser/extensions/api/system_memory/system_memory_apitest.cc',
         'browser/extensions/api/system_info_storage/system_info_storage_apitest.cc',
         'browser/extensions/api/system_private/system_private_apitest.cc',
         'browser/extensions/api/system_info_storage/system_info_storage_eject_apitest.cc',
@@ -1453,6 +1449,7 @@
         'browser/media/chrome_media_stream_infobar_browsertest.cc',
         'browser/media/chrome_webrtc_browsertest.cc',
         'browser/media/chrome_webrtc_video_quality_browsertest.cc',
+        'browser/media/webrtc_browsertest_common.cc',
         'browser/media_galleries/fileapi/itunes_finder_win_browsertest.cc',
         'browser/media_galleries/fileapi/media_file_validator_unittest.cc',
         'browser/media_galleries/media_galleries_dialog_controller_mock.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index f772dd5..aa457f2 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -179,6 +179,7 @@
         'browser/ui/find_bar/find_bar_host_unittest_util.h',
         'browser/ui/fullscreen/fullscreen_controller_state_test.cc',
         'browser/ui/fullscreen/fullscreen_controller_state_test.h',
+        'browser/ui/fullscreen/fullscreen_controller_state_tests.h',
         'browser/ui/fullscreen/fullscreen_controller_test.cc',
         'browser/ui/fullscreen/fullscreen_controller_test.h',
         'browser/ui/gtk/find_bar_host_unittest_util_gtk.cc',
@@ -248,6 +249,8 @@
         'test/base/testing_browser_process.h',
         'test/base/testing_browser_process_platform_part.h',
         'test/base/testing_browser_process_platform_part.cc',
+        'test/base/testing_io_thread_state.cc',
+        'test/base/testing_io_thread_state.h',
         'test/base/testing_pref_service_syncable.cc',
         'test/base/testing_pref_service_syncable.h',
         'test/base/testing_profile.cc',
@@ -597,7 +600,6 @@
         'browser/chromeos/drive/file_cache_metadata_unittest.cc',
         'browser/chromeos/drive/file_cache_unittest.cc',
         'browser/chromeos/drive/file_change_unittest.cc',
-        'browser/chromeos/drive/file_system/close_file_operation_unittest.cc',
         'browser/chromeos/drive/file_system/copy_operation_unittest.cc',
         'browser/chromeos/drive/file_system/create_directory_operation_unittest.cc',
         'browser/chromeos/drive/file_system/create_file_operation_unittest.cc',
@@ -717,6 +719,7 @@
         'browser/content_settings/host_content_settings_map_unittest.cc',
         'browser/content_settings/mock_settings_observer.cc',
         'browser/content_settings/mock_settings_observer.h',
+        'browser/content_settings/permission_queue_controller_unittest.cc',
         'browser/content_settings/tab_specific_content_settings_unittest.cc',
         'browser/custom_handlers/protocol_handler_registry_unittest.cc',
         'browser/diagnostics/diagnostics_model_unittest.cc',
@@ -859,7 +862,6 @@
         'browser/file_select_helper_unittest.cc',
         'browser/first_run/first_run_unittest.cc',
         'browser/geolocation/chrome_geolocation_permission_context_unittest.cc',
-        'browser/geolocation/geolocation_infobar_queue_controller_unittest.cc',
         'browser/global_keyboard_shortcuts_mac_unittest.mm',
         'browser/google/google_search_counter_unittest.cc',
         'browser/google/google_update_settings_unittest.cc',
@@ -912,7 +914,6 @@
         'browser/history/visit_filter_unittest.cc',
         'browser/history/visit_tracker_unittest.cc',
         'browser/importer/firefox_profile_lock_unittest.cc',
-        'browser/importer/firefox_proxy_settings_unittest.cc',
         'browser/importer/profile_writer_unittest.cc',
         'browser/internal_auth_unittest.cc',
         'browser/invalidation/invalidation_service_android_unittest.cc',
@@ -921,6 +922,7 @@
         'browser/invalidation/invalidator_storage_unittest.cc',
         'browser/invalidation/ticl_invalidation_service_unittest.cc',
         'browser/language_usage_metrics_unittest.cc',
+        'browser/local_discovery/privet_confirm_api_flow_unittest.cc',
         'browser/local_discovery/privet_http_unittest.cc',
         'browser/local_discovery/privet_url_fetcher_unittest.cc',
         'browser/mac/keystone_glue_unittest.mm',
@@ -958,6 +960,7 @@
         'browser/net/dns_probe_runner_unittest.cc',
         'browser/net/dns_probe_service_unittest.cc',
         'browser/net/evicted_domain_cookie_counter_unittest.cc',
+        'browser/net/firefox_proxy_settings_unittest.cc',
         'browser/net/gaia/gaia_oauth_fetcher_unittest.cc',
         'browser/net/http_pipelining_compatibility_client_unittest.cc',
         'browser/net/http_server_properties_manager_unittest.cc',
@@ -1597,8 +1600,10 @@
         'browser/ui/window_sizer/window_sizer_common_unittest.cc',
         'browser/ui/window_sizer/window_sizer_unittest.cc',
         'browser/ui/zoom/zoom_controller_unittest.cc',
+        'browser/upload_list_unittest.cc',
         'browser/chrome_content_browser_client_unittest.cc',
         'browser/undo/undo_manager_test.cc',
+        'browser/usb/usb_service_unittest.cc',
         'browser/user_style_sheet_watcher_unittest.cc',
         'browser/value_store/leveldb_value_store_unittest.cc',
         'browser/value_store/testing_value_store_unittest.cc',
@@ -2436,9 +2441,12 @@
 
             # Android uses a different invaliator.
             'browser/invalidation/ticl_invalidation_service_unittest.cc',
-            
+
             # The importer code is not used on Android.
             'common/importer/firefox_importer_utils_unittest.cc',
+
+            # USB service is not supported on Android.
+            'browser/usb/usb_service_unittest.cc',
           ],
           'sources/': [
             ['exclude', '^browser/captive_portal/'],
@@ -2446,6 +2454,7 @@
             ['exclude', '^browser/first_run/'],
             ['exclude', '^browser/lifetime/'],
             ['exclude', '^browser/media_galleries/'],
+            ['exclude', '^browser/net/firefox_*'],
             ['exclude', '^browser/profile_resetter/'],
             ['exclude', '^browser/speech/'],
             ['exclude', '^browser/sync/glue/app_'],
@@ -2488,11 +2497,6 @@
             ['exclude', '^browser/themes/'],
           ],
         }],
-        ['enable_language_detection==0', {
-          'sources!': [
-            'browser/language_usage_metrics_unittest.cc',
-          ],
-        }],
         ['toolkit_views==1', {
           'dependencies': [
             '../ui/views/views.gyp:views',
diff --git a/chrome/common/all_messages.h b/chrome/common/all_messages.h
index fb1438e..56756ab 100644
--- a/chrome/common/all_messages.h
+++ b/chrome/common/all_messages.h
@@ -22,4 +22,4 @@
 #endif
 
 #include "chrome/common/common_message_generator.h"
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index f6960d0..25e5d05 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -144,8 +144,6 @@
 const char    kMultiProfileDirPrefix[] = "Profile ";
 const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile");
 const wchar_t kBrowserResourcesDll[] = L"chrome.dll";
-const base::FilePath::CharType kExtensionFileExtension[] = FPL(".crx");
-const base::FilePath::CharType kExtensionKeyFileExtension[] = FPL(".pem");
 
 // filenames
 #if defined(OS_ANDROID)
diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h
index 03d57ba..195b4c8 100644
--- a/chrome/common/chrome_constants.h
+++ b/chrome/common/chrome_constants.h
@@ -46,8 +46,6 @@
 extern const char    kMultiProfileDirPrefix[];
 extern const base::FilePath::CharType kGuestProfileDir[];
 extern const wchar_t kBrowserResourcesDll[];
-extern const base::FilePath::CharType kExtensionFileExtension[];
-extern const base::FilePath::CharType kExtensionKeyFileExtension[];
 
 // filenames
 #if defined(OS_ANDROID)
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 3d7fa6b..8bd54dd 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -8,7 +8,6 @@
 #include "base/cpu.h"
 #include "base/file_util.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 81b7dbb..e9c67c5 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -663,6 +663,9 @@
 // supported server-side for searches on google.com.
 const char kEnableSdch[]                    = "enable-sdch";
 
+// Enables support of sticky keys.
+const char kEnableStickyKeys[]              = "enable-sticky-keys";
+
 // Disable SPDY/3.1. This is a temporary testing flag.
 const char kDisableSpdy31[]                 = "disable-spdy31";
 
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 7ae2b4d..89faf47 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -189,6 +189,7 @@
 extern const char kEnableResourceContentSettings[];
 extern const char kEnableSavePasswordBubble[];
 extern const char kEnableSdch[];
+extern const char kEnableStickyKeys[];
 extern const char kDisableSpdy31[];
 extern const char kEnableSpdy4a2[];
 extern const char kEnableSpdyCredentialFrames[];
diff --git a/chrome/common/cloud_print/cloud_print_constants.cc b/chrome/common/cloud_print/cloud_print_constants.cc
index b25773b..1541946 100644
--- a/chrome/common/cloud_print/cloud_print_constants.cc
+++ b/chrome/common/cloud_print/cloud_print_constants.cc
@@ -9,6 +9,7 @@
 const char kCloudPrintUserAgent[] = "GoogleCloudPrintProxy";
 const char kChromeCloudPrintProxyHeader[] = "X-CloudPrint-Proxy: Chrome";
 const char kCloudPrintPushNotificationsSource[] = "cloudprint.google.com";
+const char kCloudPrintAuth[] = "https://www.googleapis.com/auth/cloudprint";
 
 const char kProxyIdValue[] = "proxy";
 const char kPrinterNameValue[] = "printer";
@@ -57,4 +58,3 @@
 const char kJobFetchReasonRetry[] = "retry";
 
 }  // namespace cloud_print
-
diff --git a/chrome/common/cloud_print/cloud_print_constants.h b/chrome/common/cloud_print/cloud_print_constants.h
index c9933cd..0f5a582 100644
--- a/chrome/common/cloud_print/cloud_print_constants.h
+++ b/chrome/common/cloud_print/cloud_print_constants.h
@@ -15,6 +15,8 @@
 extern const char kChromeCloudPrintProxyHeader[];
 // The source of cloud print notifications.
 extern const char kCloudPrintPushNotificationsSource[];
+// The cloud print OAuth2 scope.
+extern const char kCloudPrintAuth[];
 
 // Values used to register or update a printer with the cloud print service.
 extern const char kProxyIdValue[];
@@ -115,4 +117,3 @@
 }  // namespace cloud_print
 
 #endif  // CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_CONSTANTS_H_
-
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index 9e11e25..75dfc0f 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -8,7 +8,6 @@
 #include "chrome/common/benchmarking_messages.h"
 #include "chrome/common/chrome_utility_messages.h"
 #include "chrome/common/extensions/extension_messages.h"
-#include "chrome/common/nacl_host_messages.h"
 #include "chrome/common/one_click_signin_messages.h"
 #include "chrome/common/prerender_messages.h"
 #include "chrome/common/print_messages.h"
@@ -18,6 +17,7 @@
 #include "chrome/common/spellcheck_messages.h"
 #include "chrome/common/tts_messages.h"
 #include "chrome/common/validation_message_messages.h"
+#include "components/nacl/common/nacl_host_messages.h"
 
 #if defined(ENABLE_MDNS)
 #include "chrome/common/local_discovery/local_discovery_messages.h"
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json
index dcd1d59..bf9516c 100644
--- a/chrome/common/extensions/api/_api_features.json
+++ b/chrome/common/extensions/api/_api_features.json
@@ -466,8 +466,8 @@
     "dependencies": ["permission:system.display"],
     "contexts": ["blessed_extension"]
   },
-  "systemInfo.memory": {
-    "dependencies": ["permission:systemInfo.memory"],
+  "system.memory": {
+    "dependencies": ["permission:system.memory"],
     "contexts": ["blessed_extension"]
   },
   "systemPrivate": {
diff --git a/chrome/common/extensions/api/_manifest_features.json b/chrome/common/extensions/api/_manifest_features.json
index 0aed543..d512179 100644
--- a/chrome/common/extensions/api/_manifest_features.json
+++ b/chrome/common/extensions/api/_manifest_features.json
@@ -203,8 +203,8 @@
     "extension_types": "all"
   },
   "media_galleries_handlers": {
-    "channel": "stable",
-    "extension_types": ["packaged_app", "platform_app"]
+    "channel": "dev",
+    "extension_types": ["platform_app"]
   },
   "mime_types": {
     "channel": "stable",
diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json
index 71ad388..308af3c 100644
--- a/chrome/common/extensions/api/_permission_features.json
+++ b/chrome/common/extensions/api/_permission_features.json
@@ -532,7 +532,7 @@
     ],
     "whitelist": [""]
   },
-  "systemInfo.memory": {
+  "system.memory": {
     "channel": "dev",
     "extension_types": [
       "extension", "packaged_app", "hosted_app", "platform_app"
diff --git a/chrome/common/extensions/api/api.gyp b/chrome/common/extensions/api/api.gyp
index 6aeef3d..b151335 100644
--- a/chrome/common/extensions/api/api.gyp
+++ b/chrome/common/extensions/api/api.gyp
@@ -55,7 +55,7 @@
           'location.idl',
           'experimental_media_galleries.idl',
           'experimental_record.json',
-          'system_info_memory.idl',
+          'system_memory.idl',
           'experimental_system_info_storage.idl',
           'extension.json',
           'feedback_private.idl',
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl
index af6eac1..75afceb 100644
--- a/chrome/common/extensions/api/downloads.idl
+++ b/chrome/common/extensions/api/downloads.idl
@@ -76,12 +76,15 @@
   //     <dt>host</dt>
   //     <dd>The download came from a host known to distribute malicious
   //     binaries and is likely dangerous.</dd>
+  //     <dt>unwanted</dt>
+  //     <dd>The download is potentially unwanted or unsafe. E.g. it could make
+  //     changes to browser or system settings.</dd>
   //     <dt>safe</dt>
   //     <dd>The download presents no known danger to the user's computer.</dd>
   //     <dt>accepted</dt>
   //     <dd>The user has accepted the dangerous download.</dd>
   // </dl>
-  enum DangerType {file, url, content, uncommon, host, safe, accepted};
+  enum DangerType {file, url, content, uncommon, host, unwanted, safe, accepted};
 
   // <dl><dt>in_progress</dt>
   //     <dd>The download is currently receiving data from the server.</dd>
diff --git a/chrome/common/extensions/api/experimental_system_info_storage.idl b/chrome/common/extensions/api/experimental_system_info_storage.idl
index f960872..9ae9aff 100644
--- a/chrome/common/extensions/api/experimental_system_info_storage.idl
+++ b/chrome/common/extensions/api/experimental_system_info_storage.idl
@@ -25,9 +25,6 @@
     // The total amount of the storage space, in bytes.
     // Default value is 0 if query operation fails.
     double capacity;
-    // The available amount of the storage space, in bytes.
-    // Default value is 0 if query operation fails.
-    double availableCapacity;
   };
 
   [inline_doc] enum EjectDeviceResultCode {
diff --git a/chrome/common/extensions/api/notifications.idl b/chrome/common/extensions/api/notifications.idl
index 321cd5c..5e24848 100644
--- a/chrome/common/extensions/api/notifications.idl
+++ b/chrome/common/extensions/api/notifications.idl
@@ -13,7 +13,10 @@
     image,
 
     // icon, title, message, items, up to two buttons
-    list
+    list,
+
+    // icon, title, message, progress, up to two buttons
+    progress
   };
 
   dictionary NotificationItem {
@@ -70,6 +73,9 @@
 
     // Items for multi-item notifications.
     NotificationItem[]? items;
+
+    // Current progress ranges from 0 to 100.
+    long? progress;
   };
 
   callback CreateCallback = void (DOMString notificationId);
diff --git a/chrome/common/extensions/api/system_info_memory.idl b/chrome/common/extensions/api/system_memory.idl
similarity index 79%
rename from chrome/common/extensions/api/system_info_memory.idl
rename to chrome/common/extensions/api/system_memory.idl
index af2501c..64af214 100644
--- a/chrome/common/extensions/api/system_info_memory.idl
+++ b/chrome/common/extensions/api/system_memory.idl
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// The <code>chrome.systemInfo.memory</code> API.
-namespace systemInfo.memory {
+// The <code>chrome.system.memory</code> API.
+namespace system.memory {
 
   dictionary MemoryInfo {
     // The total amount of physical memory capacity, in bytes.
@@ -16,6 +16,6 @@
 
   interface Functions {
     // Get physical memory information.
-    static void get(MemoryInfoCallback callback);
+    static void getInfo(MemoryInfoCallback callback);
   };
 };
diff --git a/chrome/common/extensions/api/windows.json b/chrome/common/extensions/api/windows.json
index eaa6760..7e3d2d6 100644
--- a/chrome/common/extensions/api/windows.json
+++ b/chrome/common/extensions/api/windows.json
@@ -160,8 +160,7 @@
             "name": "createData",
             "properties": {
               "url": {
-                "type": "string",
-                "description": "A URL or list of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
+                "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
                 "optional": true,
                 "choices": [
                   {"type": "string"},
diff --git a/chrome/common/extensions/background_info.cc b/chrome/common/extensions/background_info.cc
index 8d21f5d..ae25782 100644
--- a/chrome/common/extensions/background_info.cc
+++ b/chrome/common/extensions/background_info.cc
@@ -11,11 +11,11 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/extensions/extension_file_util.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/common/extensions/permissions/api_permission_set.h"
 #include "chrome/common/extensions/permissions/permissions_data.h"
+#include "extensions/common/constants.h"
 #include "extensions/common/error_utils.h"
 #include "grit/generated_resources.h"
 #include "ui/base/l10n/l10n_util.h"
@@ -57,8 +57,7 @@
   const BackgroundInfo& info = GetBackgroundInfo(extension);
   if (info.background_scripts_.empty())
     return info.background_url_;
-  return extension->GetResourceURL(
-      extension_filenames::kGeneratedBackgroundPageFilename);
+  return extension->GetResourceURL(kGeneratedBackgroundPageFilename);
 }
 
 // static
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/active_issues.js b/chrome/common/extensions/docs/examples/extensions/buildbot/active_issues.js
new file mode 100644
index 0000000..f85f32f
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/active_issues.js
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function(){
+
+window.buildbot = window.buildbot || {};
+
+buildbot.ActiveIssues = function() {
+  this.issues_ = {};
+  this.eventCallback_ = null;
+};
+
+buildbot.ActiveIssues.prototype = {
+  forEach: function(callback) {
+    for (var key in this.issues_)
+      callback(this.issues_[key]);
+  },
+
+  getIssue: function(number) {
+    return this.issues_[number];
+  },
+
+  updateIssue: function(issue) {
+    var eventType = this.issues_.hasOwnProperty(issue.issue) ?
+      "issueUpdated" : "issueAdded";
+    this.issues_[issue.issue] = issue;
+    this.postEvent_({event: eventType, issue: issue.issue});
+  },
+
+  removeIssue: function(issue) {
+    delete this.issues_[issue.issue];
+    this.postEvent_({event: "issueRemoved", issue: issue.issue});
+  },
+
+  setEventCallback: function(callback) {
+    this.eventCallback_ = callback;
+  },
+
+  postEvent_: function(obj) {
+    if (this.eventCallback_)
+      this.eventCallback_(obj);
+  }
+};
+
+buildbot.getActiveIssues = function() {
+  var background = chrome.extension.getBackgroundPage();
+  if (!background.buildbot.hasOwnProperty("activeIssues"))
+    background.buildbot.activeIssues = new buildbot.ActiveIssues;
+
+  return background.buildbot.activeIssues;
+};
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/bg.js b/chrome/common/extensions/docs/examples/extensions/buildbot/bg.js
index b5111f5..c9f21b8 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/bg.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/bg.js
@@ -7,13 +7,15 @@
 // Notification object when event pages get reloaded.  See
 // http://crbug.com/165276.
 
+(function() {
+
 var statusURL = "http://chromium-status.appspot.com/current?format=raw";
 var statusHistoryURL =
   "http://chromium-status.appspot.com/allstatus?limit=20&format=json";
 var pollFrequencyInMs = 30000;
 var tryPollFrequencyInMs = 30000;
 
-var prefs = new Prefs;
+var prefs = new buildbot.PrefStore;
 
 function updateBadgeOnErrorStatus() {
   chrome.browserAction.setBadgeText({text:"?"});
@@ -33,7 +35,7 @@
 
 // The type parameter should be "open", "closed", or "throttled".
 function getLastStatusTime(callback, type) {
-  requestURL(statusHistoryURL, "text", function(text) {
+  buildbot.requestURL(statusHistoryURL, "text", function(text) {
     var entries = JSON.parse(text);
 
     for (var i = 0; i < entries.length; i++) {
@@ -115,88 +117,141 @@
 }
 
 function requestStatus() {
-  requestURL(statusURL, "text", updateStatus, updateBadgeOnErrorStatus);
+  buildbot.requestURL(statusURL,
+                      "text",
+                      updateStatus,
+                      updateBadgeOnErrorStatus);
   setTimeout(requestStatus, pollFrequencyInMs);
 }
 
-var activeIssues = {};
 // Record of the last defunct build number we're aware of on each builder.  If
 // the build number is less than or equal to this number, the buildbot
 // information is not available and a request will return a 404.
 var lastDefunctTryJob = {};
 
-function fetchTryJobResults(fullPatchset, builder, buildnumber) {
+function fetchTryJobResults(fullPatchset, builder, buildnumber, completed) {
   var tryJobURL =
     "http://build.chromium.org/p/tryserver.chromium/json/builders/" +
         builder + "/builds/" + buildnumber;
 
   if (lastDefunctTryJob.hasOwnProperty(builder) &&
-      buildnumber <= lastDefunctTryJob[builder])
+      buildnumber <= lastDefunctTryJob[builder]) {
+    completed();
     return;
+  }
 
-  var onStatusError = function(status) {
-    if (status == 404)
-      lastDefunctTryJob[builder] = buildnumber;
-  };
-
-  requestURL(tryJobURL, "json", function(tryJobResult) {
+  buildbot.requestURL(tryJobURL, "json", function(tryJobResult) {
     if (!fullPatchset.full_try_job_results)
       fullPatchset.full_try_job_results = {};
 
     var key = builder + "-" + buildnumber;
     fullPatchset.full_try_job_results[key] = tryJobResult;
-  }, onStatusError);
+
+    completed();
+  }, function(errorStatus) {
+    if (errorStatus == 404) {
+      lastDefunctTryJob[builder] =
+          Math.max(lastDefunctTryJob[builder] || 0, buildnumber);
+    }
+    completed();
+  });
 }
 
-function fetchPatches(issue, completed) {
+// Enums corresponding to how much state has been loaded for an issue.
+var PATCHES_COMPLETE = 0;
+var TRY_JOBS_COMPLETE = 1;
+
+function fetchPatches(issue, updatedCallback) {
+  // Notify updated once after receiving all patchsets, and a second time after
+  // receiving all try job results.
   var patchsetsRetrieved = 0;
+  var tryJobResultsOutstanding = 0;
   issue.patchsets.forEach(function(patchset) {
     var patchURL = "https://codereview.chromium.org/api/" + issue.issue +
         "/" + patchset;
 
-    requestURL(patchURL, "json", function(patch) {
+    buildbot.requestURL(patchURL, "json", function(patch) {
       if (!issue.full_patchsets)
         issue.full_patchsets = {};
 
       issue.full_patchsets[patch.patchset] = patch;
 
       patch.try_job_results.forEach(function(results) {
-        if (results.buildnumber)
-          fetchTryJobResults(patch, results.builder, results.buildnumber);
+        if (results.buildnumber) {
+          tryJobResultsOutstanding++;
+
+          fetchTryJobResults(patch, results.builder, results.buildnumber,
+                             function() {
+            if (--tryJobResultsOutstanding == 0)
+              updatedCallback(TRY_JOBS_COMPLETE);
+          });
+        }
       });
 
       if (++patchsetsRetrieved == issue.patchsets.length)
-        completed(issue);
+        updatedCallback(PATCHES_COMPLETE);
     });
   });
 }
 
 function updateTryStatus(status) {
   var seen = {};
+  var activeIssues = buildbot.getActiveIssues();
   status.results.forEach(function(result) {
     var issueURL = "https://codereview.chromium.org/api/" + result.issue;
 
-    requestURL(issueURL, "json", function(issue) {
-      fetchPatches(issue, function() {activeIssues[issue.issue] = issue;});
+    buildbot.requestURL(issueURL, "json", function(issue) {
+      fetchPatches(issue, function(state) {
+        // If the issue already exists, wait until all the issue state has
+        // loaded before updating the issue so we don't lose try job information
+        // from the display.
+        if (activeIssues.getIssue(issue.issue)) {
+          if (state == TRY_JOBS_COMPLETE)
+            activeIssues.updateIssue(issue);
+        } else {
+          activeIssues.updateIssue(issue);
+        }
+      });
     });
 
     seen[result.issue] = true;
   });
 
-  for (var issue in activeIssues)
-    if (!seen[issue])
-      delete activeIssues[issue];
+  activeIssues.forEach(function(issue) {
+    if (!seen[issue.issue])
+      activeIssues.removeIssue(issue);
+  });
+}
+
+function fetchTryStatus(username) {
+  if (!username)
+    return;
+
+  var url = "https://codereview.chromium.org/search" +
+      // commit=2 is CLs with commit bit set, commit=3 is CLs with commit
+      // bit cleared, commit=1 is either.
+      "?closed=3&commit=1&limit=100&order=-modified&format=json&owner=" +
+      username.trim();
+  buildbot.requestURL(url, "json", updateTryStatus);
 }
 
 function requestTryStatus() {
+  var searchBaseURL = "https://codereview.chromium.org/search";
+
   prefs.getTryJobUsername(function(username) {
-    if (username) {
-      var url = "https://codereview.chromium.org/search" +
-          // commit=2 is CLs with commit bit set, commit=3 is CLs with commit
-          // bit cleared, commit=1 is either.
-          "?closed=3&commit=1&limit=100&order=-modified&format=json&owner=" +
-              username;
-      requestURL(url, "json", updateTryStatus);
+    if (username == null) {
+      var usernameScrapingURL = "https://codereview.chromium.org/search";
+      // Try scraping username from Rietveld if unset.
+      buildbot.requestURL(usernameScrapingURL, "text", function(text) {
+        var match = /([^<>\s]+@\S+)\s+\(.+\)/.exec(text);
+        if (match) {
+          username = match[1];
+          prefs.setTryJobUsername(username);
+          fetchTryStatus(username);
+        }
+      });
+    } else {
+      fetchTryStatus(username);
     }
 
     setTimeout(requestTryStatus, tryPollFrequencyInMs);
@@ -209,3 +264,5 @@
 }
 
 main();
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/manifest.json b/chrome/common/extensions/docs/examples/extensions/buildbot/manifest.json
index d2ba004..37eea10 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/manifest.json
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/manifest.json
@@ -1,10 +1,14 @@
 {
   "name": "Chromium Buildbot Monitor",
-  "version": "0.8.1",
+  "version": "0.8.2",
   "description": "Displays the status of the Chromium buildbot in the toolbar.  Click to see more detailed status in a popup.",
   "icons": { "128": "icon.png" },
   "background": {
-    "scripts": ["utils.js", "prefs.js", "try_status.js", "bg.js"]
+    "scripts": ["utils.js",
+                "prefs.js",
+                "try_status.js",
+                "active_issues.js",
+                "bg.js"]
   },
   "permissions": [
     "notifications",
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/options.js b/chrome/common/extensions/docs/examples/extensions/buildbot/options.js
index 38eeb64..78c2994 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/options.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/options.js
@@ -2,7 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-var prefs = new Prefs;
+(function() {
+
+window.buildbot = window.buildbot || {};
+
+var prefs = new buildbot.PrefStore;
 
 // Initialize the checkbox checked state from the saved preference.
 function main() {
@@ -24,3 +28,5 @@
 }
 
 main();
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/popup.css b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.css
new file mode 100644
index 0000000..a6f597e
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.css
@@ -0,0 +1,93 @@
+/**
+ * Copyright 2013 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+body {
+  font-family: sans-serif;
+  font-size: 0.8em;
+  overflow: hidden;
+}
+
+a {
+  text-decoration: underline;
+  color: #444;
+}
+
+a:hover {
+  color: black;
+  cursor: pointer;
+}
+
+.status-label {
+  text-align: right;
+  font-size: 12px;
+  font-weight: bold;
+  min-width: 85px;
+  padding: 0px;
+}
+
+.trunk-status-cell {
+  padding: 0px;
+}
+
+.trunk-status-cell > iframe {
+  height: 10px;
+  border: none;
+}
+
+[data-issue] + .trunk-status-row > td,
+.closer-status-row + .other-status-row > td {
+  padding-top: 5px;
+}
+
+div.issue-status {
+  display: table;
+  border-spacing: 1px 1px;
+  width: 284px;
+  margin: 1px 0px 1px 9px;
+}
+
+.issue-status-build {
+  display: table-cell;
+  width: 1px;
+  height: 10px;
+}
+
+/* build statuses */
+.success {
+  color: #FFFFFF;
+  background-color: #8fdf5f;
+  border-color: #4F8530;
+}
+
+.failure {
+  color: #FFFFFF;
+  background-color: #e98080;
+  border-color: #A77272;
+}
+
+.warnings {
+  color: #FFFFFF;
+  background-color: #ffc343;
+  border-color: #C29D46;
+}
+
+.never {
+  color: #FFFFFF;
+  background-color: #f0f0e0;
+  border-color: #A77272;
+}
+
+.exception, .retry {
+  color: #FFFFFF;
+  background-color: #e0b0ff;
+  border-color: #ACA0B3;
+}
+
+.running {
+  color: #666666;
+  background-color: #fffc6c;
+  border-color: #C5C56D;
+}
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/popup.html b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.html
index 2cdc83f..d9366f5 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/popup.html
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.html
@@ -2,49 +2,13 @@
 <html>
   <head>
     <title>Chromium Buildbot Monitor Popup</title>
-    <style>
-    body {
-      font-family: sans-serif;
-      font-size: 0.8em;
-      overflow: hidden;
-    }
-
-    a {
-      text-decoration: underline;
-      color: #444;
-    }
-
-    a:hover {
-      color: black;
-      cursor: pointer;
-    }
-
-    .status-label {
-      text-align: right;
-      font-size: 12px;
-      font-weight: bold;
-      min-width: 85px;
-      padding: 0px;
-    }
-
-    .botstatus {
-      padding: 0px;
-    }
-
-    .statusiframe {
-      height: 10px;
-      border: none;
-    }
-
-    .spacer {
-    }
-  </style>
-</head>
-<body>
-  <table id="status-table">
-  </table>
-  <script src='utils.js'></script>
-  <script src='try_status.js'></script>
-  <script src='popup.js'></script>
-</body>
+    <link href="popup.css" rel="stylesheet" type="text/css" />
+  </head>
+  <body>
+    <table id="status-table"></table>
+    <script src='utils.js'></script>
+    <script src='try_status.js'></script>
+    <script src='active_issues.js'></script>
+    <script src='popup.js'></script>
+  </body>
 </html>
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/popup.js b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.js
index 1c578df..1fb4b04 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/popup.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/popup.js
@@ -2,36 +2,43 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+(function(){
+
 var lkgrURL = 'http://chromium-status.appspot.com/lkgr';
 
+// Interval at which to reload the non-CL bot status.
+var botStatusRefreshIntervalInMs = 60 * 1000;
+// Interval at which to check for LKGR updates.
+var lkgrRefreshIntervalInMs = 60 * 1000;
+
 function getClassForTryJobResult(result) {
   // Some win bots seem to report a null result while building.
   if (result === null)
-    result = RUNNING;
+    result = buildbot.RUNNING;
 
   switch (parseInt(result)) {
-  case RUNNING:
+  case buildbot.RUNNING:
     return "running";
 
-  case SUCCESS:
+  case buildbot.SUCCESS:
     return "success";
 
-  case WARNINGS:
+  case buildbot.WARNINGS:
     return "warnings";
 
-  case FAILURE:
+  case buildbot.FAILURE:
     return "failure";
 
-  case SKIPPED:
+  case buildbot.SKIPPED:
     return "skipped";
 
-  case EXCEPTION:
+  case buildbot.EXCEPTION:
     return "exception";
 
-  case RETRY:
+  case buildbot.RETRY:
     return "retry";
 
-  case NOT_STARTED:
+  case buildbot.NOT_STARTED:
   default:
     return "never";
   }
@@ -65,14 +72,14 @@
   if (fullTryJob.currentStep)
     stepText.push("running " + fullTryJob.currentStep.name);
 
-  if (fullTryJob.results == FAILURE && fullTryJob.text) {
+  if (fullTryJob.results == buildbot.FAILURE && fullTryJob.text) {
     stepText.push(fullTryJob.text.join(" "));
   } else {
     // Sometimes a step can fail without setting the try job text.  Look
     // through all the steps to identify if this is the case.
     var text = [];
     fullTryJob.steps.forEach(function(step) {
-      if (step.results[0] == FAILURE)
+      if (step.results[0] == buildbot.FAILURE)
         text.push(step.results[1][0]);
     });
 
@@ -88,32 +95,12 @@
   return title;
 }
 
-// Create an iframe mimicking the horizontal_one_box_per_builder format and
-// reuse its CSS, to get the same visual styling.
 function createPatchsetStatusElement(patchset) {
-  var cssURL = "http://chromium-build.appspot.com/p/chromium/default.css";
-  var content =
-    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " +
-    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\
-    <html>\
-  <head>\
-    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\
-    <link href=\"" + cssURL + "\" rel=\"stylesheet\" type=\"text/css\" />\
-    <style>td {vertical-align: bottom;}</style>\
-  </head>\
-  <body vlink=\"#800080\">\
-    <table style=\"width: 100%\"><tr id=\"bot-table-row\"></tr></table>\
-  </body>\
-</html>";
-  var doc = (new DOMParser()).parseFromString(content, "text/xml");
-  var row = doc.getElementById("bot-table-row");
+  var table = document.createElement("div");
+  table.className = "issue-status";
 
   var tryJobs = filterOldTryJobs(patchset.try_job_results);
   tryJobs.forEach(function(tryJob) {
-    var cell = doc.createElement("td");
-    cell.className = "mini-box";
-    row.appendChild(cell);
-
     var key = tryJob.builder + "-" + tryJob.buildnumber;
     var fullTryJob = patchset.full_try_job_results &&
         patchset.full_try_job_results[key];
@@ -121,63 +108,90 @@
     var tryJobAnchor = document.createElement("a");
     tryJobAnchor.textContent = "  ";
     tryJobAnchor.title = createTryJobAnchorTitle(tryJob, fullTryJob);
-    tryJobAnchor.className = "LastBuild " +
+    tryJobAnchor.className = "issue-status-build " +
       getClassForTryJobResult(tryJob.result);
     tryJobAnchor.target = "_blank";
     tryJobAnchor.href = tryJob.url;
-    cell.appendChild(tryJobAnchor);
+    table.appendChild(tryJobAnchor);
   });
 
-  var iframe = document.createElement("iframe");
-  iframe.className="statusiframe";
-  iframe.scrolling="no";
-  iframe.srcdoc = (new XMLSerializer).serializeToString(doc);
-  return iframe;
+  return table;
 }
 
-function addTryStatusRows(table) {
+function getLastFullPatchsetWithTryJobs(issue) {
+  var index = issue.patchsets.length - 1;
+  var fullPatchsets = issue.full_patchsets;
+  while (index >= 0 &&
+         (!fullPatchsets ||
+          !fullPatchsets[issue.patchsets[index]] ||
+          !fullPatchsets[issue.patchsets[index]].try_job_results ||
+          fullPatchsets[issue.patchsets[index]].try_job_results.length == 0)) {
+    index--;
+  }
+
+  return index >= 0 ? fullPatchsets[issue.patchsets[index]] : null;
+}
+
+function createTryStatusRow(issue) {
+  var table = document.getElementById("status-table");
+
+  // Order by decreasing issue number.
+  var position =
+      document.getElementsByClassName("trunk-status-row")[0].rowIndex;
+  while (position > 0 &&
+         parseInt(issue.issue) >
+             parseInt(table.rows[position - 1].getAttribute("data-issue"))) {
+    position--;
+  }
+
+  var row = table.insertRow(position);
+  row.setAttribute("data-issue", issue.issue);
+
+  return row;
+}
+
+function updateIssueDisplay(issue) {
   var codereviewBaseURL = "https://codereview.chromium.org";
 
-  var background = chrome.extension.getBackgroundPage();
+  var lastFullPatchset = getLastFullPatchsetWithTryJobs(issue);
 
-  var issues = [];
-  for (var key in background.activeIssues)
-    issues.push(background.activeIssues[key]);
+  var row = document.querySelector("*[data-issue='" + issue.issue + "']");
+  if (!lastFullPatchset) {
+    if (row)
+      row.parentNode.removeChild(row);
+    return;
+  }
 
-  // Sort issues in descending order.
-  issues.sort(function(a, b) {return parseInt(b.issue) - parseInt(a.issue);});
+  if (!row)
+    row = createTryStatusRow(issue);
 
-  issues.forEach(function(issue) {
-    var codereviewURL = codereviewBaseURL + "/" + issue.issue;
+  var label = row.childNodes[0] || row.insertCell(-1);
+  var status = row.childNodes[1] || row.insertCell(-1);
 
-    if (!issue.full_patchsets)
-      return;
+  label.className = "status-label";
+  var clAnchor = label.childNodes[0] ||
+    label.appendChild(document.createElement("a"));
+  clAnchor.textContent = "CL " + issue.issue;
+  clAnchor.href = codereviewBaseURL + "/" + issue.issue;
+  clAnchor.title = issue.subject;
+  if (lastFullPatchset && lastFullPatchset.message)
+    clAnchor.title += " | " + lastFullPatchset.message;
+  clAnchor.target = "_blank";
 
-    var lastPatchset = issue.patchsets[issue.patchsets.length - 1];
-    var lastFullPatchset = issue.full_patchsets[lastPatchset];
+  var statusElement = createPatchsetStatusElement(lastFullPatchset);
+  if (status.childElementCount < 1)
+    status.appendChild(statusElement);
+  else
+    status.replaceChild(statusElement, status.firstChild);
+}
 
-    if (!lastFullPatchset.try_job_results ||
-        lastFullPatchset.try_job_results.length == 0)
-      return;
+function removeIssueDisplay(issueNumber) {
+  var row = document.querySelector("*[data-issue='" + issueNumber + "']");
+  row.parentNode.removeChild(row);
+}
 
-    var row = table.insertRow(-1);
-    var label = row.insertCell(-1);
-    label.className = "status-label";
-    var clAnchor = document.createElement("a");
-    clAnchor.textContent = "CL " + issue.issue;
-    clAnchor.href = codereviewURL;
-    clAnchor.title = issue.subject;
-    if (lastFullPatchset.message)
-      clAnchor.title += " | " + lastFullPatchset.message;
-    clAnchor.target = "_blank";
-    label.appendChild(clAnchor);
-
-    var status = row.insertCell(-1);
-    status.appendChild(createPatchsetStatusElement(lastFullPatchset));
-  });
-
-  if (issues.length > 0)
-    table.insertRow(-1).insertCell().className = "spacer";
+function addTryStatusRows() {
+  buildbot.getActiveIssues().forEach(updateIssueDisplay);
 }
 
 function updateLKGR(lkgr) {
@@ -185,13 +199,16 @@
   link.textContent = 'LKGR (' + lkgr + ')';
 }
 
-function addBotStatusRow(table, bot) {
+function addBotStatusRow(bot, className) {
+  var table = document.getElementById("status-table");
+
   var baseURL = "http://build.chromium.org/p/chromium" +
     (bot.id != "" ? "." + bot.id : "");
   var consoleURL = baseURL + "/console";
   var statusURL = baseURL + "/horizontal_one_box_per_builder";
 
   var row = table.insertRow(-1);
+  row.className = "trunk-status-row " + className;
   var label = row.insertCell(-1);
   label.className = "status-label";
   var labelAnchor = document.createElement("a");
@@ -202,15 +219,14 @@
   label.appendChild(labelAnchor);
 
   var status = row.insertCell(-1);
-  status.className = "botstatus";
+  status.className = "trunk-status-cell";
   var statusIframe = document.createElement("iframe");
-  statusIframe.className = "statusiframe";
   statusIframe.scrolling = "no";
   statusIframe.src = statusURL;
   status.appendChild(statusIframe);
 }
 
-function addBotStatusRows(table) {
+function addBotStatusRows() {
   var closerBots = [
     {id: "", label: "Chromium"},
     {id: "win", label: "Win"},
@@ -230,25 +246,56 @@
   ];
 
   closerBots.forEach(function(bot) {
-    addBotStatusRow(table, bot);
+    addBotStatusRow(bot, "closer-status-row");
   });
 
-  table.insertRow(-1).insertCell().className = "spacer";
-
   otherBots.forEach(function(bot) {
-    addBotStatusRow(table, bot);
+    addBotStatusRow(bot, "other-status-row");
   });
 }
 
 function fillStatusTable() {
-  var table = document.getElementById("status-table");
-  addTryStatusRows(table);
-  addBotStatusRows(table);
+  addBotStatusRows();
+  addTryStatusRows();
 }
 
 function main() {
-  requestURL(lkgrURL, "text", updateLKGR);
+  buildbot.requestURL(lkgrURL, "text", updateLKGR);
   fillStatusTable();
+
+  buildbot.getActiveIssues().setEventCallback(function(request) {
+    // NOTE(wittman): It doesn't appear that we can reliably detect closing of
+    // the popup and remove the event callback, so ensure the popup window is
+    // displayed before processing the event.
+    if (!chrome.extension.getViews({type: "popup"}))
+      return;
+
+    switch (request.event) {
+    case "issueUpdated":
+    case "issueAdded":
+      updateIssueDisplay(buildbot.getActiveIssues().getIssue(request.issue));
+      break;
+
+    case "issueRemoved":
+      removeIssueDisplay(request.issue);
+      break;
+    }
+  });
+
+  setInterval(function() {
+    buildbot.requestURL(lkgrURL, "text", updateLKGR);
+  }, lkgrRefreshIntervalInMs);
+
+  setInterval(function() {
+    var botStatusElements =
+        document.getElementsByClassName("trunk-status-iframe");
+    for (var i = 0; i < botStatusElements.length; i++)
+      // Force a reload of the iframe in a way that doesn't cause cross-domain
+      // policy violations.
+      botStatusElements.item(i).src = botStatusElements.item(i).src;
+  }, botStatusRefreshIntervalInMs);
 }
 
 main();
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/prefs.js b/chrome/common/extensions/docs/examples/extensions/buildbot/prefs.js
index d8df783..3071be3 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/prefs.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/prefs.js
@@ -2,12 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-function Prefs() {
-  this.defaults_ = {prefs: {use_notifications: false,
-                            try_job_username: ""}};
-}
+(function() {
 
-Prefs.prototype = {
+window.buildbot = window.buildbot || {};
+
+buildbot.PrefStore = function() {
+  this.defaults_ = {prefs: {use_notifications: false,
+                            try_job_username: null}};
+};
+
+buildbot.PrefStore.prototype = {
   get_: function(key, callback) {
     chrome.storage.sync.get(this.defaults_,
         function (storage) {
@@ -39,3 +43,5 @@
     this.set_("try_job_username", try_job_username);
   }
 };
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/try_status.js b/chrome/common/extensions/docs/examples/extensions/buildbot/try_status.js
index d909d08..1641580 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/try_status.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/try_status.js
@@ -2,11 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-var RUNNING = -1;
-var SUCCESS = 0;
-var WARNINGS = 1;
-var FAILURE = 2;
-var SKIPPED = 3;
-var EXCEPTION = 4;
-var RETRY = 5;
-var NOT_STARTED = 6;
+(function() {
+
+window.buildbot = window.buildbot || {};
+
+buildbot.RUNNING = -1;
+buildbot.SUCCESS = 0;
+buildbot.WARNINGS = 1;
+buildbot.FAILURE = 2;
+buildbot.SKIPPED = 3;
+buildbot.EXCEPTION = 4;
+buildbot.RETRY = 5;
+buildbot.NOT_STARTED = 6;
+
+})();
diff --git a/chrome/common/extensions/docs/examples/extensions/buildbot/utils.js b/chrome/common/extensions/docs/examples/extensions/buildbot/utils.js
index 9805a2e..ace9ed5 100644
--- a/chrome/common/extensions/docs/examples/extensions/buildbot/utils.js
+++ b/chrome/common/extensions/docs/examples/extensions/buildbot/utils.js
@@ -2,7 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-function requestURL(url, responseType, callback, opt_errorStatusCallback) {
+(function() {
+
+window.buildbot = window.buildbot || {};
+
+buildbot.requestURL =
+    function(url, responseType, callback, opt_errorStatusCallback) {
   var xhr = new XMLHttpRequest();
   if (responseType == "json")
     // WebKit doesn't handle xhr.responseType = "json" as of Chrome 25.
@@ -29,4 +34,6 @@
 
   xhr.open("GET", url, true);
   xhr.send();
-}
+};
+
+})();
diff --git a/chrome/common/extensions/docs/templates/articles/app_csp.html b/chrome/common/extensions/docs/templates/articles/app_csp.html
index 5d8f668..db87189 100644
--- a/chrome/common/extensions/docs/templates/articles/app_csp.html
+++ b/chrome/common/extensions/docs/templates/articles/app_csp.html
@@ -8,7 +8,7 @@
 It covers the broader web platform view of CSP;
 packaged apps CSP isn't as flexible.
 You should read the
-<a href="http://code.google.com/chrome/extensions/contentSecurityPolicy.html">Chrome extension Content Security Policy</a>
+<a href="/extensions/contentSecurityPolicy.html">Chrome extension Content Security Policy</a>
 as it's the foundation for the packaged app CSP.
 For brevity's sake,
 we don't repeat the same information here.
diff --git a/chrome/common/extensions/docs/templates/articles/declare_permissions.html b/chrome/common/extensions/docs/templates/articles/declare_permissions.html
index 60cbe2b..0a9bf92 100644
--- a/chrome/common/extensions/docs/templates/articles/declare_permissions.html
+++ b/chrome/common/extensions/docs/templates/articles/declare_permissions.html
@@ -198,7 +198,7 @@
 <tr>
   <td> "experimental" </td>
   <td> Required if the extension or app uses any
-       <a href="http://code.google.com/chrome/extensions/dev/experimental.html">chrome.experimental.* APIs</a>.</td>
+       <a href="experimental.html">chrome.experimental.* APIs</a>.</td>
 </tr>
 {{^is_apps}}
 <tr>
diff --git a/chrome/common/extensions/docs/templates/articles/experimental.html b/chrome/common/extensions/docs/templates/articles/experimental.html
index ffac972..c01521d 100644
--- a/chrome/common/extensions/docs/templates/articles/experimental.html
+++ b/chrome/common/extensions/docs/templates/articles/experimental.html
@@ -1,25 +1,4 @@
 <h1 class="page_title">chrome.experimental.* APIs</h1>
-{{^is_apps}}
-<div class="doc-family extensions">
-<p>
-Before you start, <strong>choose the right version of this page.</strong>
-You should read either:
-</p>
-
-<ul>
-  <li> <a href="http://code.google.com/chrome/extensions/trunk/experimental.html">Most recent experimental APIs</a>
-  <li> <a href="http://code.google.com/chrome/extensions/dev/experimental.html">Dev channel experimental APIs</a></li>
-</ul>
-
-<p>
-For information about browser versions such as
-Canary (bleeding edge) and the Dev channel, see
-<a href="http://www.chromium.org/getting-involved/dev-channel">Chrome Release Channels</a>.
-For details about channel-specific docs,
-see <a href="docs.html#versions">Doc versions</a>.
-</p>
-</div>
-{{/is_apps}}
 
 <h2 id="overview">
 List of APIs
@@ -79,12 +58,6 @@
     we need your feedback on the latest incarnation of the APIs,
     which you can find in Canary and on the Dev channel.
   </li>
-  <li class="doc-family extensions">
-    Using either the
-    <a href="http://code.google.com/chrome/extensions/trunk/experimental.html">most recent API documentation</a> (if you're using Canary) or the
-    <a href="http://code.google.com/chrome/extensions/dev/experimental.html">API documentation for the Dev channel</a>,
-    write the code for your extension.
-  </li>
   {{/is_apps}}
   <li>
     Specify the "experimental"
diff --git a/chrome/common/extensions/docs/templates/articles/faq.html b/chrome/common/extensions/docs/templates/articles/faq.html
index fce26c9..fb46764 100644
--- a/chrome/common/extensions/docs/templates/articles/faq.html
+++ b/chrome/common/extensions/docs/templates/articles/faq.html
@@ -89,7 +89,7 @@
   Now you can reload extensions,
   load an unpacked directory of files as if it were a packaged extension,
   and more. For a complete tutorial, see
-  <a href="http://code.google.com/chrome/extensions/getstarted.html">Getting Started</a>.
+  <a href="/extensions/getstarted.html">Getting Started</a>.
 </p>
 {{/is_apps}}
 
@@ -101,7 +101,7 @@
   scripting. Because Chrome supports HTML5 and CSS3, developers can
   use the latest open web technologies such as canvas and CSS animations in
   their extensions. Extensions also have access to several
-  <a href="http://code.google.com/chrome/extensions/api_other.html">JavaScript APIs</a>
+  <a href="/extensions/api_other.html">JavaScript APIs</a>
   that help perform functions like JSON encoding and interacting with the
   browser.
 </p>
@@ -162,7 +162,7 @@
 <h3 id="faq-dev-02">Can extensions make cross-domain Ajax requests?</h3>
 <p>
   Yes. Extensions can make cross-domain requests.  See
-  <a href="http://code.google.com/chrome/extensions/xhr.html">this page</a>
+  <a href="/extensions/xhr.html">this page</a>
   for more information.
 </p>
 
@@ -315,7 +315,7 @@
 <h3 id="faq-dev-10">How do I create an options menu for my application?</h3>
 <p>
   You can let users set options for your extension by creating an
-  <a href="http://code.google.com/chrome/extensions/trunk/options.html">options page</a>,
+  <a href="/extensions/options.html">options page</a>,
   which is a simple HTML page that will be loaded when a user clicks the
   "options" button for your extension. This page can read and write settings
   to localStorage, or even send options to a web server so that they can be
@@ -327,7 +327,7 @@
 <p>
   Chrome's built-in developer tools can be used to debug extensions
   as well as web pages. See this
-  <a href="http://code.google.com/chrome/extensions/tut_debugging.html ">tutorial on debugging extensions</a>
+  <a href="/extensions/tut_debugging.html ">tutorial on debugging extensions</a>
   for more information.
 </p>
 
diff --git a/chrome/common/extensions/docs/templates/articles/sandboxingEval.html b/chrome/common/extensions/docs/templates/articles/sandboxingEval.html
index ef322d2..00db83a 100644
--- a/chrome/common/extensions/docs/templates/articles/sandboxingEval.html
+++ b/chrome/common/extensions/docs/templates/articles/sandboxingEval.html
@@ -60,7 +60,7 @@
 
 <p>
   If you'd like to dive straight into code, please grab the
-  <a href='http://code.google.com/chrome/extensions/samples.html#3c6dfba67f6a7480d931b5a4a646c151ad1a049b'>sandboxing
+  <a href='/extensions/samples.html#3c6dfba67f6a7480d931b5a4a646c151ad1a049b'>sandboxing
   sample extension and take off</a>. It's a working example of a tiny messaging
   API built on top of the <a href='http://handlebarsjs.com'>Handlebars</a>
   templating library, and it should give you everything you need to get going.
@@ -91,10 +91,10 @@
 <p>
   In order to do something interesting with the sandboxed file, we need to load
   it in a context where it can be addressed by the extension's code. Here,
-  <a href='http://code.google.com/chrome/extensions/examples/howto/sandbox/sandbox.html'>sandbox.html</a>
-  has been loaded into the extension's <a href='http://code.google.com/chrome/extensions/dev/event_pages.html'>Event
-  Page</a> (<a href='http://code.google.com/chrome/extensions/examples/howto/sandbox/eventpage.html'>eventpage.html</a>)
-  via an <code>iframe</code>. <a href='http://code.google.com/chrome/extensions/examples/howto/sandbox/eventpage.js'>eventpage.js</a>
+  <a href='/extensions/examples/howto/sandbox/sandbox.html'>sandbox.html</a>
+  has been loaded into the extension's <a href='event_pages.html'>Event
+  Page</a> (<a href='/extensions/examples/howto/sandbox/eventpage.html'>eventpage.html</a>)
+  via an <code>iframe</code>. <a href='/extensions/examples/howto/sandbox/eventpage.js'>eventpage.js</a>
   contains code that sends a message into the sandbox whenever the browser
   action is clicked by finding the <code>iframe</code> on the page, and
   executing the <code>postMessage</code> method on its
diff --git a/chrome/common/extensions/docs/templates/articles/tut_oauth.html b/chrome/common/extensions/docs/templates/articles/tut_oauth.html
index b0f009f..4122f42 100644
--- a/chrome/common/extensions/docs/templates/articles/tut_oauth.html
+++ b/chrome/common/extensions/docs/templates/articles/tut_oauth.html
@@ -89,7 +89,7 @@
 <p>
 To use the OAuth library,
 you must declare the "tabs" permision in the
-<a href="http://code.google.com/chrome/extensions/manifest.html">extension manifest</a>.
+<a href="manifest.html">extension manifest</a>.
 You must also declare the sites you are using
 including the request URL, the authorize URL, access URL,
 and, if necessary, the scope URL.
diff --git a/chrome/common/extensions/docs/templates/intros/browserAction.html b/chrome/common/extensions/docs/templates/intros/browserAction.html
index 034558b..c13878f 100644
--- a/chrome/common/extensions/docs/templates/intros/browserAction.html
+++ b/chrome/common/extensions/docs/templates/intros/browserAction.html
@@ -81,6 +81,7 @@
 
 <p>Static images can be in any format WebKit can display,
   including BMP, GIF, ICO, JPEG, or PNG.
+  For unpacked extensions, images must be in the PNG format.
   </p>
 
 <p>To set the icon,
diff --git a/chrome/common/extensions/docs/templates/json/intro_tables.json b/chrome/common/extensions/docs/templates/json/intro_tables.json
index 507a393..c3d634e 100644
--- a/chrome/common/extensions/docs/templates/json/intro_tables.json
+++ b/chrome/common/extensions/docs/templates/json/intro_tables.json
@@ -395,7 +395,7 @@
   "syncFileSystem": {
     "Learn More": [
       {
-        "link": "http://developer.chrome.com/trunk/apps/app_storage.html",
+        "link": "app_storage.html",
         "text": "Manage Data"
       },
       {
diff --git a/chrome/common/extensions/docs/templates/public/apps/pushMessaging.html b/chrome/common/extensions/docs/templates/public/apps/pushMessaging.html
index 54bc8b5..92e6d73 100644
--- a/chrome/common/extensions/docs/templates/public/apps/pushMessaging.html
+++ b/chrome/common/extensions/docs/templates/public/apps/pushMessaging.html
@@ -1 +1 @@
-{{+partials.standard_apps_api api:apis.push_messaging}}
+{{+partials.standard_apps_api api:apis.push_messaging intro:intros.pushMessaging}}
diff --git a/chrome/common/extensions/docs/templates/public/apps/redirects.json b/chrome/common/extensions/docs/templates/public/apps/redirects.json
index 268ed65..e861aed 100644
--- a/chrome/common/extensions/docs/templates/public/apps/redirects.json
+++ b/chrome/common/extensions/docs/templates/public/apps/redirects.json
@@ -3,5 +3,6 @@
   "index.html": "about_apps.html",
   "app_csp.html": "contentSecurityPolicy.html",
   "systemInfo_cpu.html": "system_cpu.html",
-  "systemInfo_display.html": "system_display.html"
+  "systemInfo_display.html": "system_display.html",
+  "systemInfo_memory.html": "system_memory.html"
 }
diff --git a/chrome/common/extensions/docs/templates/public/apps/systemInfo_memory.html b/chrome/common/extensions/docs/templates/public/apps/systemInfo_memory.html
deleted file mode 100644
index 9dba072..0000000
--- a/chrome/common/extensions/docs/templates/public/apps/systemInfo_memory.html
+++ /dev/null
@@ -1 +0,0 @@
-{{+partials.standard_apps_api api:apis.system_info_memory}}
diff --git a/chrome/common/extensions/docs/templates/public/apps/system_memory.html b/chrome/common/extensions/docs/templates/public/apps/system_memory.html
new file mode 100644
index 0000000..0691784
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/public/apps/system_memory.html
@@ -0,0 +1 @@
+{{+partials.standard_apps_api api:apis.system_memory}}
diff --git a/chrome/common/extensions/docs/templates/public/extensions/pushMessaging.html b/chrome/common/extensions/docs/templates/public/extensions/pushMessaging.html
index 5e93636..d4eb2c4 100644
--- a/chrome/common/extensions/docs/templates/public/extensions/pushMessaging.html
+++ b/chrome/common/extensions/docs/templates/public/extensions/pushMessaging.html
@@ -1 +1 @@
-{{+partials.standard_extensions_api api:apis.push_messaging}}
+{{+partials.standard_extensions_api api:apis.push_messaging intro:intros.pushMessaging}}
diff --git a/chrome/common/extensions/docs/templates/public/extensions/redirects.json b/chrome/common/extensions/docs/templates/public/extensions/redirects.json
index c912230..2f53a07 100644
--- a/chrome/common/extensions/docs/templates/public/extensions/redirects.json
+++ b/chrome/common/extensions/docs/templates/public/extensions/redirects.json
@@ -1,4 +1,5 @@
 {
   "": "index.html",
-  "systemInfo_cpu.html": "system_cpu.html"
+  "systemInfo_cpu.html": "system_cpu.html",
+  "systemInfo_memory.html": "system_memory.html"
 }
diff --git a/chrome/common/extensions/docs/templates/public/extensions/system_memory.html b/chrome/common/extensions/docs/templates/public/extensions/system_memory.html
new file mode 100644
index 0000000..0691784
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/public/extensions/system_memory.html
@@ -0,0 +1 @@
+{{+partials.standard_apps_api api:apis.system_memory}}
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 8afdbd5..9c94936 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -20,7 +20,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "base/version.h"
-#include "chrome/common/chrome_constants.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/common/extensions/manifest.h"
 #include "chrome/common/extensions/manifest_handler.h"
@@ -28,7 +27,7 @@
 #include "chrome/common/extensions/permissions/permission_set.h"
 #include "chrome/common/extensions/permissions/permissions_data.h"
 #include "chrome/common/extensions/permissions/permissions_info.h"
-#include "chrome/common/url_constants.h"
+#include "content/public/common/url_constants.h"
 #include "extensions/common/constants.h"
 #include "extensions/common/error_utils.h"
 #include "extensions/common/id_util.h"
@@ -185,11 +184,6 @@
   return true;
 }
 
-// static
-bool Extension::IsExtension(const base::FilePath& file_name) {
-  return file_name.MatchesExtension(chrome::kExtensionFileExtension);
-}
-
 Manifest::Type Extension::GetType() const {
   return converted_from_user_script() ?
       Manifest::TYPE_USER_SCRIPT : manifest_->type();
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 3840266..394b927 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -178,9 +178,6 @@
   // Checks to see if the extension has a valid ID.
   static bool IdIsValid(const std::string& id);
 
-  // Returns true if the specified file is an extension.
-  static bool IsExtension(const base::FilePath& file_name);
-
   // See Type definition in Manifest.
   Manifest::Type GetType() const;
 
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index 1ca0105..04e2343 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -90,24 +90,6 @@
 
 }  // namespace extension_urls
 
-namespace extension_filenames {
-
-const char kTempExtensionName[] = "CRX_INSTALL";
-
-// The file to write our decoded images to, relative to the extension_path.
-const char kDecodedImagesFilename[] = "DECODED_IMAGES";
-
-// The file to write our decoded message catalogs to, relative to the
-// extension_path.
-const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS";
-
-const char kGeneratedBackgroundPageFilename[] =
-    "_generated_background_page.html";
-
-const char kModulesDir[] = "_modules";
-
-}  // namespace extension_filenames
-
 namespace extension_misc {
 
 const char kBookmarkManagerId[] = "eemcgdkfndhakfknompkggombfjjjeno";
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index e4def4c..8f688cd 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -56,26 +56,6 @@
   extern const char kGalleryBrowsePrefix[];
 }  // namespace extension_urls
 
-namespace extension_filenames {
-  // The name of a temporary directory to install an extension into for
-  // validation before finalizing install.
-  extern const char kTempExtensionName[];
-
-  // The file to write our decoded images to, relative to the extension_path.
-  extern const char kDecodedImagesFilename[];
-
-  // The file to write our decoded message catalogs to, relative to the
-  // extension_path.
-  extern const char kDecodedMessageCatalogsFilename[];
-
-  // The filename to use for a background page generated from
-  // background.scripts.
-  extern const char kGeneratedBackgroundPageFilename[];
-
-  // Path to imported modules.
-  extern const char kModulesDir[];
-}
-
 namespace extension_misc {
   // Matches chrome.windows.WINDOW_ID_NONE.
   const int kUnknownWindowId = -1;
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 16b1e54..29ed5ca 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -18,7 +18,6 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread_restrictions.h"
-#include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/extensions/api/extension_action/action_info.h"
 #include "chrome/common/extensions/extension.h"
@@ -208,7 +207,7 @@
                                  base::FileEnumerator::FILES);
   for (base::FilePath current = traversal.Next(); !current.empty();
        current = traversal.Next()) {
-    if (!current.MatchesExtension(chrome::kExtensionKeyFileExtension))
+    if (!current.MatchesExtension(extensions::kExtensionKeyFileExtension))
       continue;
 
     std::string key_contents;
diff --git a/chrome/common/extensions/manifest_handlers/shared_module_info.cc b/chrome/common/extensions/manifest_handlers/shared_module_info.cc
index f1f965a..dd906b4 100644
--- a/chrome/common/extensions/manifest_handlers/shared_module_info.cc
+++ b/chrome/common/extensions/manifest_handlers/shared_module_info.cc
@@ -10,9 +10,9 @@
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/version.h"
-#include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/common/extensions/permissions/permission_set.h"
+#include "extensions/common/constants.h"
 #include "extensions/common/error_utils.h"
 
 namespace keys = extension_manifest_keys;
@@ -50,7 +50,7 @@
                                          std::string* import_relative_path) {
   std::vector<std::string> tokens;
   Tokenize(path, std::string("/"), &tokens);
-  if (tokens.size() > 2 && tokens[0] == extension_filenames::kModulesDir &&
+  if (tokens.size() > 2 && tokens[0] == kModulesDir &&
       Extension::IdIsValid(tokens[1])) {
     *import_id = tokens[1];
     *import_relative_path = tokens[2];
@@ -63,7 +63,7 @@
 bool SharedModuleInfo::IsImportedPath(const std::string& path) {
   std::vector<std::string> tokens;
   Tokenize(path, std::string("/"), &tokens);
-  if (tokens.size() > 2 && tokens[0] == extension_filenames::kModulesDir &&
+  if (tokens.size() > 2 && tokens[0] == kModulesDir &&
       Extension::IdIsValid(tokens[1])) {
     return true;
   }
@@ -224,5 +224,4 @@
   return std::vector<std::string>(keys, keys + arraysize(keys));
 }
 
-}  // extensions
-
+}  // namespace extensions
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
index 7b49cca..a6fcab1 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
@@ -13,6 +13,7 @@
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/common/extensions/features/base_feature_provider.h"
 #include "chrome/common/extensions/features/feature.h"
+#include "extensions/common/constants.h"
 #include "extensions/common/error_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -46,7 +47,7 @@
 
   EXPECT_TRUE(BackgroundInfo::HasBackgroundPage(extension.get()));
   EXPECT_EQ(
-      std::string("/") + extension_filenames::kGeneratedBackgroundPageFilename,
+      std::string("/") + kGeneratedBackgroundPageFilename,
       BackgroundInfo::GetBackgroundURL(extension.get()).path());
 
   manifest->SetString("background_page", "monkey.html");
diff --git a/chrome/common/extensions/permissions/api_permission.h b/chrome/common/extensions/permissions/api_permission.h
index 46d13f0..d043f93 100644
--- a/chrome/common/extensions/permissions/api_permission.h
+++ b/chrome/common/extensions/permissions/api_permission.h
@@ -136,7 +136,7 @@
     kWebstorePrivate,
     kWebView,
     kSystemCpu,
-    kSystemInfoMemory,
+    kSystemMemory,
     kEnumBoundary
   };
 
diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc
index 8c1ec15..a4558af 100644
--- a/chrome/common/extensions/permissions/chrome_api_permissions.cc
+++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc
@@ -287,7 +287,7 @@
       IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR,
       PermissionMessage::kSystemIndicator },
     { APIPermission::kSystemCpu, "system.cpu" },
-    { APIPermission::kSystemInfoMemory, "systemInfo.memory" },
+    { APIPermission::kSystemMemory, "system.memory" },
     { APIPermission::kSystemDisplay, "system.display" },
     { APIPermission::kPointerLock, "pointerLock" },
     { APIPermission::kFullscreen, "fullscreen" },
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 2dff13b..c8fade4 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -648,7 +648,7 @@
   skip.insert(APIPermission::kScreensaver);
   skip.insert(APIPermission::kStorage);
   skip.insert(APIPermission::kSystemCpu);
-  skip.insert(APIPermission::kSystemInfoMemory);
+  skip.insert(APIPermission::kSystemMemory);
   skip.insert(APIPermission::kSystemDisplay);
   skip.insert(APIPermission::kTts);
   skip.insert(APIPermission::kUnlimitedStorage);
diff --git a/chrome/common/importer/firefox_importer_utils.cc b/chrome/common/importer/firefox_importer_utils.cc
index d6ec2d3..5ec56d6 100644
--- a/chrome/common/importer/firefox_importer_utils.cc
+++ b/chrome/common/importer/firefox_importer_utils.cc
@@ -226,78 +226,6 @@
   return false;
 }
 
-bool ParsePrefFile(const base::FilePath& pref_file, DictionaryValue* prefs) {
-  // The string that is before a pref key.
-  const std::string kUserPrefString = "user_pref(\"";
-  std::string contents;
-  if (!file_util::ReadFileToString(pref_file, &contents))
-    return false;
-
-  std::vector<std::string> lines;
-  Tokenize(contents, "\n", &lines);
-
-  for (std::vector<std::string>::const_iterator iter = lines.begin();
-       iter != lines.end(); ++iter) {
-    const std::string& line = *iter;
-    size_t start_key = line.find(kUserPrefString);
-    if (start_key == std::string::npos)
-      continue;  // Could be a comment or a blank line.
-    start_key += kUserPrefString.length();
-    size_t stop_key = line.find('"', start_key);
-    if (stop_key == std::string::npos) {
-      LOG(ERROR) << "Invalid key found in Firefox pref file '" <<
-          pref_file.value() << "' line is '" << line << "'.";
-      continue;
-    }
-    std::string key = line.substr(start_key, stop_key - start_key);
-    size_t start_value = line.find(',', stop_key + 1);
-    if (start_value == std::string::npos) {
-      LOG(ERROR) << "Invalid value found in Firefox pref file '" <<
-          pref_file.value() << "' line is '" << line << "'.";
-      continue;
-    }
-    size_t stop_value = line.find(");", start_value + 1);
-    if (stop_value == std::string::npos) {
-      LOG(ERROR) << "Invalid value found in Firefox pref file '" <<
-          pref_file.value() << "' line is '" << line << "'.";
-      continue;
-    }
-    std::string value = line.substr(start_value + 1,
-                                    stop_value - start_value - 1);
-    TrimWhitespace(value, TRIM_ALL, &value);
-    // Value could be a boolean.
-    bool is_value_true = LowerCaseEqualsASCII(value, "true");
-    if (is_value_true || LowerCaseEqualsASCII(value, "false")) {
-      prefs->SetBoolean(key, is_value_true);
-      continue;
-    }
-
-    // Value could be a string.
-    if (value.size() >= 2U &&
-        value[0] == '"' && value[value.size() - 1] == '"') {
-      value = value.substr(1, value.size() - 2);
-      // ValueString only accept valid UTF-8.  Simply ignore that entry if it is
-      // not UTF-8.
-      if (IsStringUTF8(value))
-        prefs->SetString(key, value);
-      else
-        VLOG(1) << "Non UTF8 value for key " << key << ", ignored.";
-      continue;
-    }
-
-    // Or value could be an integer.
-    int int_value = 0;
-    if (base::StringToInt(value, &int_value)) {
-      prefs->SetInteger(key, int_value);
-      continue;
-    }
-
-    LOG(ERROR) << "Invalid value found in Firefox pref file '"
-               << pref_file.value() << "' value is '" << value << "'.";
-  }
-  return true;
-}
-
 std::string GetPrefsJsValue(const std::string& content,
                             const std::string& pref_key) {
   // This file has the syntax: user_pref("key", value);
diff --git a/chrome/common/importer/firefox_importer_utils.h b/chrome/common/importer/firefox_importer_utils.h
index 09da571..54c5a74 100644
--- a/chrome/common/importer/firefox_importer_utils.h
+++ b/chrome/common/importer/firefox_importer_utils.h
@@ -84,15 +84,6 @@
 // directory.
 bool IsDefaultHomepage(const GURL& homepage, const base::FilePath& app_path);
 
-// Parses the prefs found in the file |pref_file| and puts the key/value pairs
-// in |prefs|. Keys are strings, and values can be strings, booleans or
-// integers.  Returns true if it succeeded, false otherwise (in which case
-// |prefs| is not filled).
-// Note: for strings, only valid UTF-8 string values are supported. If a
-// key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|.
-bool ParsePrefFile(const base::FilePath& pref_file,
-                   base::DictionaryValue* prefs);
-
 // Parses the value of a particular firefox preference from a string that is the
 // contents of the prefs file.
 std::string GetPrefsJsValue(const std::string& prefs,
diff --git a/chrome/common/local_discovery/service_discovery_client.h b/chrome/common/local_discovery/service_discovery_client.h
index 940d518..30dcbd2 100644
--- a/chrome/common/local_discovery/service_discovery_client.h
+++ b/chrome/common/local_discovery/service_discovery_client.h
@@ -11,6 +11,7 @@
 #include "base/callback.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/time/time.h"
+#include "net/base/address_family.h"
 #include "net/base/host_port_pair.h"
 #include "net/base/net_util.h"
 
@@ -91,6 +92,16 @@
   virtual std::string GetName() const = 0;
 };
 
+class LocalDomainResolver {
+ public:
+  typedef base::Callback<void(bool, const net::IPAddressNumber&)>
+      IPAddressCallback;
+
+  virtual ~LocalDomainResolver() {}
+
+  virtual void Start() = 0;
+};
+
 class ServiceDiscoveryClient {
  public:
   virtual ~ServiceDiscoveryClient() {}
@@ -106,6 +117,12 @@
   virtual scoped_ptr<ServiceResolver> CreateServiceResolver(
       const std::string& service_name,
       const ServiceResolver::ResolveCompleteCallback& callback) = 0;
+
+  // Create a resolver for local domain, both ipv4 or ipv6.
+  virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver(
+      const std::string& domain,
+      net::AddressFamily address_family,
+      const LocalDomainResolver::IPAddressCallback& callback) = 0;
 };
 
 }  // namespace local_discovery
diff --git a/chrome/common/mac/launchd.mm b/chrome/common/mac/launchd.mm
index 31dbba3..ec0acd9 100644
--- a/chrome/common/mac/launchd.mm
+++ b/chrome/common/mac/launchd.mm
@@ -10,7 +10,7 @@
 #include "base/mac/mac_util.h"
 #include "base/mac/scoped_cftyperef.h"
 #include "base/mac/scoped_nsautorelease_pool.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/sys_string_conversions.h"
 #include "third_party/GTM/Foundation/GTMServiceManagement.h"
diff --git a/chrome/common/mac/mock_launchd.cc b/chrome/common/mac/mock_launchd.cc
index 178943f..361629f 100644
--- a/chrome/common/mac/mock_launchd.cc
+++ b/chrome/common/mac/mock_launchd.cc
@@ -14,7 +14,6 @@
 #include "base/mac/foundation_util.h"
 #include "base/mac/scoped_cftyperef.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/sys_string_conversions.h"
diff --git a/chrome/common/metrics/variations/variation_ids.h b/chrome/common/metrics/variations/variation_ids.h
index 4a3afd2..39b5ae7 100644
--- a/chrome/common/metrics/variations/variation_ids.h
+++ b/chrome/common/metrics/variations/variation_ids.h
@@ -174,6 +174,8 @@
   // Reserve a contiguous chunk of IDs for Instant Extended.
   EXTENDED_INSTANT_RANGE_ID_MIN           = 3310265,
   EXTENDED_INSTANT_RANGE_ID_MAX           = 3310365,
+  EXTENDED_INSTANT_RANGE2_ID_MIN          = 3310368,
+  EXTENDED_INSTANT_RANGE2_ID_MAX          = 3310468,
 
   // Reserve 100 IDs to be used by autocomplete dynamic field trials.
   // The dynamic field trials are activated by a call to
@@ -228,7 +230,7 @@
   // NEXT ID: When adding new IDs, please add them above this section, starting
   // with the value of NEXT_ID, and updating NEXT_ID to (end of your reserved
   // range) + 1.
-  NEXT_ID = 3310368,
+  NEXT_ID = 3310469,
 
   // USABLE IDs END HERE.
   //
diff --git a/chrome/common/multi_process_lock_unittest.cc b/chrome/common/multi_process_lock_unittest.cc
index 1059448..95939de 100644
--- a/chrome/common/multi_process_lock_unittest.cc
+++ b/chrome/common/multi_process_lock_unittest.cc
@@ -6,6 +6,7 @@
 #include "base/environment.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/process/kill.h"
 #include "base/rand_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/test/multiprocess_test.h"
diff --git a/chrome/common/nacl_debug_exception_handler_win.h b/chrome/common/nacl_debug_exception_handler_win.h
deleted file mode 100644
index 301fbe7..0000000
--- a/chrome/common/nacl_debug_exception_handler_win.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
-#define CHROME_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
-
-#include "base/callback.h"
-#include "base/message_loop/message_loop.h"
-#include "base/process.h"
-
-void NaClStartDebugExceptionHandlerThread(
-    base::ProcessHandle nacl_process,
-    const std::string& startup_info,
-    base::MessageLoopProxy* message_loop,
-    const base::Callback<void(bool)>& on_connected);
-
-#endif  // CHROME_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 78702ba..1e8eaf7 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -2122,6 +2122,10 @@
 
 // Whether the user may exit enrollment.
 const char kDeviceEnrollmentCanExit[] = "enrollment.can_exit";
+
+// Dictionary of per-user Least Recently Used input method (used at login
+// screen).
+extern const char kUsersLRUInputMethod[] = "UsersLRUInputMethod";
 #endif
 
 // Whether there is a Flash version installed that supports clearing LSO data.
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 6d1d322..e128646 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -773,6 +773,7 @@
 extern const char kDeviceEnrollmentRequisition[];
 extern const char kDeviceEnrollmentAutoStart[];
 extern const char kDeviceEnrollmentCanExit[];
+extern const char kUsersLRUInputMethod[];
 #endif
 
 extern const char kClearPluginLSODataEnabled[];
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index f138dc5..08bbab0 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -11,7 +11,7 @@
 #include "base/basictypes.h"
 #include "base/files/file_path.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
@@ -21,11 +21,11 @@
 #include "chrome/common/content_settings.h"
 #include "chrome/common/content_settings_pattern.h"
 #include "chrome/common/instant_types.h"
-#include "chrome/common/nacl_types.h"
 #include "chrome/common/omnibox_focus_state.h"
 #include "chrome/common/search_provider.h"
 #include "chrome/common/translate/language_detection_details.h"
 #include "chrome/common/translate/translate_errors.h"
+#include "components/nacl/common/nacl_types.h"
 #include "content/public/common/common_param_traits.h"
 #include "content/public/common/referrer.h"
 #include "content/public/common/top_controls_state.h"
diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc
index f72e697..74a4967 100644
--- a/chrome/common/service_process_util.cc
+++ b/chrome/common/service_process_util.cc
@@ -8,7 +8,6 @@
 #include "base/logging.h"
 #include "base/memory/singleton.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/sha1.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h
index cd588f3..a85f4df 100644
--- a/chrome/common/service_process_util.h
+++ b/chrome/common/service_process_util.h
@@ -11,7 +11,7 @@
 #include "base/callback_forward.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_channel_handle.h"
 
 class CommandLine;
diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm
index 0222710..d023627 100644
--- a/chrome/common/service_process_util_mac.mm
+++ b/chrome/common/service_process_util_mac.mm
@@ -18,7 +18,6 @@
 #include "base/mac/scoped_nsautorelease_pool.h"
 #include "base/mac/scoped_nsobject.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/sys_string_conversions.h"
diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc
index b38ee5a..5e89256 100644
--- a/chrome/common/service_process_util_unittest.cc
+++ b/chrome/common/service_process_util_unittest.cc
@@ -8,7 +8,8 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 
 #if !defined(OS_MACOSX)
 #include "base/at_exit.h"
diff --git a/chrome/common/translate/language_detection_util.cc b/chrome/common/translate/language_detection_util.cc
index a834f97..73e4823 100644
--- a/chrome/common/translate/language_detection_util.cc
+++ b/chrome/common/translate/language_detection_util.cc
@@ -11,11 +11,8 @@
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/translate/translate_common_metrics.h"
 #include "chrome/common/translate/translate_util.h"
-
-#if defined(ENABLE_LANGUAGE_DETECTION)
 #include "third_party/cld/encodings/compact_lang_det/compact_lang_det.h"
 #include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h"
-#endif
 
 namespace {
 
@@ -64,7 +61,6 @@
   TranslateUtil::ToTranslateLanguageSynonym(code);
 }
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
 // Returns the ISO 639 language code of the specified |text|, or 'unknown' if it
 // failed.
 // |is_cld_reliable| will be set as true if CLD says the detection is reliable.
@@ -100,7 +96,6 @@
           << "\n*************************************\n";
   return language;
 }
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
 
 // Checks if CLD can complement a sub code when the page language doesn't know
 // the sub code.
@@ -122,7 +117,6 @@
                                   const base::string16& contents,
                                   std::string* cld_language_p,
                                   bool* is_cld_reliable_p) {
-#if defined(ENABLE_LANGUAGE_DETECTION)
   base::TimeTicks begin_time = base::TimeTicks::Now();
   bool is_cld_reliable;
   std::string cld_language = DetermineTextLanguage(contents, &is_cld_reliable);
@@ -134,7 +128,6 @@
   if (is_cld_reliable_p != NULL)
     *is_cld_reliable_p = is_cld_reliable;
   TranslateUtil::ToTranslateLanguageSynonym(&cld_language);
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
 
   // Check if html lang attribute is valid.
   std::string modified_html_lang;
@@ -158,7 +151,6 @@
   std::string language = modified_html_lang.empty() ? modified_code :
                                                       modified_html_lang;
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
   // If |language| is empty, just use CLD result even though it might be
   // chrome::kUnknownLanguageCode.
   if (language.empty()) {
@@ -192,10 +184,6 @@
     // gives up suggesting a translation.
     return std::string(chrome::kUnknownLanguageCode);
   }
-#else  // defined(ENABLE_LANGUAGE_DETECTION)
-  TranslateCommonMetrics::ReportLanguageVerification(
-      TranslateCommonMetrics::LANGUAGE_VERIFICATION_CLD_DISABLED);
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
 
   return language;
 }
@@ -303,11 +291,7 @@
 }
 
 std::string GetCLDVersion() {
-#if defined(ENABLE_LANGUAGE_DETECTION)
   return CompactLangDet::DetectLanguageVersion();
-#else
-  return ""
-#endif
 }
 
 }  // namespace LanguageDetectionUtil
diff --git a/chrome/common/translate/translate_common_metrics.cc b/chrome/common/translate/translate_common_metrics.cc
index 028be6d..977bb5c 100644
--- a/chrome/common/translate/translate_common_metrics.cc
+++ b/chrome/common/translate/translate_common_metrics.cc
@@ -122,14 +122,10 @@
   UMA_HISTOGRAM_ENUMERATION(kTranslatePageScheme, type, SCHEME_MAX);
 }
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
-
 void ReportLanguageDetectionTime(base::TimeTicks begin, base::TimeTicks end) {
   UMA_HISTOGRAM_MEDIUM_TIMES(kRenderer4LanguageDetection, end - begin);
 }
 
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
-
 void ReportSimilarLanguageMatch(bool match) {
   UMA_HISTOGRAM_BOOLEAN(kTranslateSimilarLanguageMatch, match);
 }
diff --git a/chrome/common/translate/translate_common_metrics.h b/chrome/common/translate/translate_common_metrics.h
index cfd6b14..0faed7f 100644
--- a/chrome/common/translate/translate_common_metrics.h
+++ b/chrome/common/translate/translate_common_metrics.h
@@ -39,7 +39,7 @@
 // When a valid Content-Language is provided, TranslateHelper checks if a
 // server provided Content-Language matches to a language CLD determined.
 enum LanguageVerificationType {
-  LANGUAGE_VERIFICATION_CLD_DISABLED,
+  LANGUAGE_VERIFICATION_CLD_DISABLED,  // obsolete
   LANGUAGE_VERIFICATION_CLD_ONLY,
   LANGUAGE_VERIFICATION_UNKNOWN,
   LANGUAGE_VERIFICATION_CLD_AGREE,
@@ -89,13 +89,9 @@
 // Called when a translation is triggered.
 void ReportPageScheme(const std::string& scheme);
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
-
 // Called when CLD detects page language.
 void ReportLanguageDetectionTime(base::TimeTicks begin, base::TimeTicks end);
 
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
-
 // Called when CLD agreed on a language which is different, but in the similar
 // language list.
 void ReportSimilarLanguageMatch(bool match);
diff --git a/chrome/common/translate/translate_common_metrics_unittest.cc b/chrome/common/translate/translate_common_metrics_unittest.cc
index 4815cb1..cd0753e 100644
--- a/chrome/common/translate/translate_common_metrics_unittest.cc
+++ b/chrome/common/translate/translate_common_metrics_unittest.cc
@@ -288,8 +288,6 @@
   EXPECT_EQ(1, recorder.GetCount(kFalse));
 }
 
-#if defined(ENABLE_LANGUAGE_DETECTION)
-
 TEST(TranslateCommonMetricsTest, ReportLanguageDetectionTime) {
   MetricsRecorder recorder(TranslateCommonMetrics::GetMetricsName(
       TranslateCommonMetrics::UMA_LANGUAGE_DETECTION));
@@ -300,5 +298,3 @@
   recorder.CheckValueInLogs(9.009);
   recorder.CheckTotalCount(1);
 }
-
-#endif  // defined(ENABLE_LANGUAGE_DETECTION)
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index a7e5549..79e856b 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -466,6 +466,9 @@
 const char kDownloadScanningLearnMoreURL[] =
     "https://support.google.com/chrome/?p=ib_download_scan";
 
+const char kDownloadPotentiallyUnwantedLearnMoreURL[] =
+    "https://support.google.com/chrome/?p=ui_protect_settings";
+
 const char kDownloadInterruptedLearnMoreURL[] =
     "https://support.google.com/chrome/?p=ui_download_errors";
 
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index 3f80aa2..c4b2e93 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -389,6 +389,10 @@
 // The URL for the "Learn more" page for download scanning.
 extern const char kDownloadScanningLearnMoreURL[];
 
+// The URL for the "Learn more" page for downloads flagged as potentially
+// unwanted by the SafeBrowsing service.
+extern const char kDownloadPotentiallyUnwantedLearnMoreURL[];
+
 // The URL for the "Learn more" page for interrupted downloads.
 extern const char kDownloadInterruptedLearnMoreURL[];
 
diff --git a/chrome/common_constants.gyp b/chrome/common_constants.gyp
index b0ee2cd..3cb4843 100644
--- a/chrome/common_constants.gyp
+++ b/chrome/common_constants.gyp
@@ -13,6 +13,9 @@
 
   'target_defaults': {
     'sources': [
+      # TODO(yoz): Create an extension_constants target for these.
+      '../extensions/common/constants.cc',
+      '../extensions/common/constants.h',
       'common/chrome_constants.cc',
       'common/chrome_constants.h',
       'common/chrome_paths.cc',
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 002e370..c4a2d6e 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -25,7 +25,7 @@
 #include "base/basictypes.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc
index 09a65b3..1d5c506 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.cc
+++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
@@ -11,7 +11,7 @@
 #include "base/file_util.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/win/registry.h"
 
diff --git a/chrome/installer/setup/DEPS b/chrome/installer/setup/DEPS
index a96cf4b..3a8062c 100644
--- a/chrome/installer/setup/DEPS
+++ b/chrome/installer/setup/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
   "+chrome/app",
   "+courgette",
+  "+extensions/common/constants.h",
 ]
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 3b1d781..15e2062 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -16,7 +16,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 4b59a2c..5135c51 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -17,7 +17,7 @@
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index 4ca4447..2ca0e88 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -13,7 +13,9 @@
 #include "base/files/file_enumerator.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_util.h"
 #include "base/version.h"
 #include "base/win/windows_version.h"
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index 490475c..17105fc 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -12,7 +12,10 @@
 #include "base/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/path_service.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/threading/platform_thread.h"
 #include "base/time/time.h"
 #include "base/version.h"
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 2d86535..30af416 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -13,7 +13,7 @@
 #include "base/file_util.h"
 #include "base/files/file_enumerator.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
@@ -45,6 +45,7 @@
 #include "chrome/installer/util/shell_util.h"
 #include "chrome/installer/util/util_constants.h"
 #include "content/public/common/result_codes.h"
+#include "extensions/common/constants.h"
 #include "rlz/lib/rlz_lib.h"
 
 // Build-time generated include file.
@@ -908,7 +909,7 @@
     // Delete Software\Classes\.crx,
     string16 ext_association(ShellUtil::kRegClasses);
     ext_association.append(L"\\");
-    ext_association.append(chrome::kExtensionFileExtension);
+    ext_association.append(extensions::kExtensionFileExtension);
     InstallUtil::DeleteRegistryKey(roots[i], ext_association);
   }
 }
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index c8cf3b2..886ff06 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -39,7 +39,8 @@
 #include "base/logging.h"
 #include "base/path_service.h"
 #include "base/platform_file.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_util.h"
 #include "base/version.h"
 #include "base/win/pe_image.h"
diff --git a/chrome/installer/util/copy_tree_work_item_unittest.cc b/chrome/installer/util/copy_tree_work_item_unittest.cc
index 3b64832..3d6fb04 100644
--- a/chrome/installer/util/copy_tree_work_item_unittest.cc
+++ b/chrome/installer/util/copy_tree_work_item_unittest.cc
@@ -12,7 +12,6 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "base/threading/platform_thread.h"
 #include "chrome/installer/util/copy_tree_work_item.h"
diff --git a/chrome/installer/util/delete_tree_work_item_unittest.cc b/chrome/installer/util/delete_tree_work_item_unittest.cc
index 3181c53..91b7c8a 100644
--- a/chrome/installer/util/delete_tree_work_item_unittest.cc
+++ b/chrome/installer/util/delete_tree_work_item_unittest.cc
@@ -12,7 +12,6 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "chrome/installer/util/delete_tree_work_item.h"
 #include "chrome/installer/util/work_item.h"
diff --git a/chrome/installer/util/google_update_util.cc b/chrome/installer/util/google_update_util.cc
index b002356..2448ba4 100644
--- a/chrome/installer/util/google_update_util.cc
+++ b/chrome/installer/util/google_update_util.cc
@@ -14,7 +14,8 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_split.h"
 #include "base/time/time.h"
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index 424acef..fd1ad19 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -18,7 +18,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/sys_info.h"
 #include "base/values.h"
diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc
index a5142b3..45497d5 100644
--- a/chrome/installer/util/installer_state_unittest.cc
+++ b/chrome/installer/util/installer_state_unittest.cc
@@ -13,7 +13,6 @@
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/test_reg_util_win.h"
diff --git a/chrome/installer/util/lzma_util_unittest.cc b/chrome/installer/util/lzma_util_unittest.cc
index 668f42c..e90c3f9 100644
--- a/chrome/installer/util/lzma_util_unittest.cc
+++ b/chrome/installer/util/lzma_util_unittest.cc
@@ -7,7 +7,6 @@
 #include "base/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/installer/util/lzma_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc
index c00a44d..614b9d4 100644
--- a/chrome/installer/util/move_tree_work_item_unittest.cc
+++ b/chrome/installer/util/move_tree_work_item_unittest.cc
@@ -11,7 +11,6 @@
 #include "base/files/memory_mapped_file.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_util.h"
 #include "chrome/installer/util/installer_util_test_common.h"
 #include "chrome/installer/util/move_tree_work_item.h"
diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc
index bb8c963..dc70b16 100644
--- a/chrome/installer/util/product.cc
+++ b/chrome/installer/util/product.cc
@@ -8,7 +8,7 @@
 
 #include "base/command_line.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/win/registry.h"
 #include "chrome/installer/util/chrome_app_host_operations.h"
 #include "chrome/installer/util/chrome_binaries_operations.h"
diff --git a/chrome/installer/util/user_experiment.cc b/chrome/installer/util/user_experiment.cc
index ec28d7f..afe81dd 100644
--- a/chrome/installer/util/user_experiment.cc
+++ b/chrome/installer/util/user_experiment.cc
@@ -11,7 +11,7 @@
 
 #include "base/command_line.h"
 #include "base/files/file_path.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/rand_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index 7fcf051..3b7cf04 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -54,8 +54,8 @@
             'sources': [
               'app/nacl_fork_delegate_linux.cc',
               'app/nacl_fork_delegate_linux.h',
-              'common/nacl_paths.cc',
-              'common/nacl_paths.h',
+              '../components/nacl/common/nacl_paths.cc',
+              '../components/nacl/common/nacl_paths.h',
             ],
           },],
         ],
@@ -114,12 +114,9 @@
                 '../ppapi/ppapi_internal.gyp:ppapi_ipc_win64',
               ],
               'sources': [
-                'common/nacl_debug_exception_handler_win.cc',
-                'common/nacl_messages.cc',
-                'common/nacl_types.cc',
                 'nacl/nacl_broker_listener.cc',
                 'nacl/nacl_broker_listener.h',
-                '../components/nacl/common/nacl_cmd_line.cc',
+                '../components/nacl/common/nacl_debug_exception_handler_win.cc',
               ],
               'include_dirs': [
                 '..',
@@ -150,6 +147,7 @@
                 '..',
               ],
               'dependencies': [
+                '../components/nacl_common.gyp:nacl_common',
                 '../crypto/crypto.gyp:crypto',
                 '../sandbox/sandbox.gyp:libc_urandom_override',
                 '../sandbox/sandbox.gyp:sandbox',
@@ -159,8 +157,6 @@
                 'nacl/nacl_helper_linux.cc',
                 'nacl/nacl_sandbox_linux.cc',
                 '../base/posix/unix_domain_socket_linux.cc',
-                '../chrome/common/nacl_messages.cc',
-                '../chrome/common/nacl_types.cc',
                 '../content/common/child_process_sandbox_support_impl_shm_linux.cc',
                 '../content/common/sandbox_init_linux.cc',
                 '../content/common/sandbox_seccomp_bpf_linux.cc',
diff --git a/chrome/nacl/OWNERS b/chrome/nacl/OWNERS
index 8345057..4d8e916 100644
--- a/chrome/nacl/OWNERS
+++ b/chrome/nacl/OWNERS
@@ -4,3 +4,6 @@
 mseaborn@chromium.org
 noelallen@chromium.org
 sehr@chromium.org
+
+per-file nacl_sandbox_linux.*=jln@chromium.org
+per-file nacl_sandbox_linux.*=mseaborn@chromium.org
diff --git a/chrome/nacl/nacl_broker_listener.cc b/chrome/nacl/nacl_broker_listener.cc
index b01e7e3..efe8b3c 100644
--- a/chrome/nacl/nacl_broker_listener.cc
+++ b/chrome/nacl/nacl_broker_listener.cc
@@ -10,11 +10,10 @@
 #include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/nacl_debug_exception_handler_win.h"
-#include "chrome/common/nacl_messages.h"
 #include "components/nacl/common/nacl_cmd_line.h"
+#include "components/nacl/common/nacl_debug_exception_handler_win.h"
+#include "components/nacl/common/nacl_messages.h"
 #include "components/nacl/common/nacl_switches.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/sandbox_init.h"
diff --git a/chrome/nacl/nacl_broker_listener.h b/chrome/nacl/nacl_broker_listener.h
index 6df012c..e834b50 100644
--- a/chrome/nacl/nacl_broker_listener.h
+++ b/chrome/nacl/nacl_broker_listener.h
@@ -6,8 +6,8 @@
 #define CHROME_NACL_NACL_BROKER_LISTENER_H_
 
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
-#include "chrome/common/nacl_types.h"
+#include "base/process/process.h"
+#include "components/nacl/common/nacl_types.h"
 #include "content/public/common/sandboxed_process_launcher_delegate.h"
 #include "ipc/ipc_listener.h"
 
diff --git a/chrome/nacl/nacl_exe_win_64.cc b/chrome/nacl/nacl_exe_win_64.cc
index f03491e..92b980e 100644
--- a/chrome/nacl/nacl_exe_win_64.cc
+++ b/chrome/nacl/nacl_exe_win_64.cc
@@ -8,7 +8,8 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/power_monitor/power_monitor.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
+#include "base/process/memory.h"
 #include "base/strings/string_util.h"
 #include "base/timer/hi_res_timer_manager.h"
 #include "chrome/app/breakpad_win.h"
diff --git a/chrome/nacl/nacl_helper_linux.cc b/chrome/nacl/nacl_helper_linux.cc
index 16cbe62..1718c86 100644
--- a/chrome/nacl/nacl_helper_linux.cc
+++ b/chrome/nacl/nacl_helper_linux.cc
@@ -4,7 +4,7 @@
 
 // A mini-zygote specifically for Native Client.
 
-#include "chrome/common/nacl_helper_linux.h"
+#include "components/nacl/common/nacl_helper_linux.h"
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/chrome/nacl/nacl_listener.cc b/chrome/nacl/nacl_listener.cc
index 01aef4e..7562daa 100644
--- a/chrome/nacl/nacl_listener.cc
+++ b/chrome/nacl/nacl_listener.cc
@@ -16,10 +16,10 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/rand_util.h"
-#include "chrome/common/nacl_messages.h"
 #include "chrome/nacl/nacl_ipc_adapter.h"
 #include "chrome/nacl/nacl_validation_db.h"
 #include "chrome/nacl/nacl_validation_query.h"
+#include "components/nacl/common/nacl_messages.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_switches.h"
 #include "ipc/ipc_sync_channel.h"
diff --git a/chrome/nacl/nacl_listener.h b/chrome/nacl/nacl_listener.h
index a6cec25..148cc71 100644
--- a/chrome/nacl/nacl_listener.h
+++ b/chrome/nacl/nacl_listener.h
@@ -10,7 +10,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
-#include "chrome/common/nacl_types.h"
+#include "components/nacl/common/nacl_types.h"
 #include "ipc/ipc_listener.h"
 
 namespace IPC {
diff --git a/chrome/nacl/nacl_sandbox_linux.cc b/chrome/nacl/nacl_sandbox_linux.cc
index 19585ea..3164ddc 100644
--- a/chrome/nacl/nacl_sandbox_linux.cc
+++ b/chrome/nacl/nacl_sandbox_linux.cc
@@ -10,6 +10,7 @@
 #include "base/callback.h"
 #include "base/compiler_specific.h"
 #include "base/logging.h"
+#include "build/build_config.h"
 #include "content/public/common/sandbox_init.h"
 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
 #include "sandbox/linux/services/linux_syscalls.h"
@@ -19,26 +20,103 @@
 
 namespace {
 
-// This policy does very little:
-// - Any invalid system call for the current architecture is handled by
-//   the baseline policy.
-// - ptrace() is denied.
-// - Anything else is allowed.
-// Note that the seccomp-bpf sandbox always prevents cross-architecture
-// system calls (on x86, long/compatibility/x32).
-// So even this trivial policy has a security benefit.
+inline bool IsPlatformX86() {
+#if defined(__x86_64__) || defined(__i386__)
+  return true;
+#else
+  return false;
+#endif
+}
+
+// On ARM and x86_64, System V shared memory calls have each their own system
+// call, while on i386 they are multiplexed.
+#if defined(__x86_64__) || defined(__arm__)
+bool IsSystemVSharedMemory(int sysno) {
+  switch (sysno) {
+    case __NR_shmat:
+    case __NR_shmctl:
+    case __NR_shmdt:
+    case __NR_shmget:
+      return true;
+    default:
+      return false;
+  }
+}
+#endif
+
+#if defined(__i386__)
+// Big system V multiplexing system call.
+bool IsSystemVIpc(int sysno) {
+  switch (sysno) {
+    case __NR_ipc:
+      return true;
+    default:
+      return false;
+  }
+}
+#endif
+
 ErrorCode NaClBpfSandboxPolicy(
-    playground2::Sandbox* sb, int sysnum, void* aux) {
+    playground2::Sandbox* sb, int sysno, void* aux) {
   const playground2::BpfSandboxPolicyCallback baseline_policy =
       content::GetBpfSandboxBaselinePolicy();
-  if (!playground2::Sandbox::IsValidSyscallNumber(sysnum)) {
-    return baseline_policy.Run(sb, sysnum, aux);
-  }
-  switch (sysnum) {
+  switch (sysno) {
+    // TODO(jln): NaCl's GDB debug stub uses the following socket system calls,
+    // see if it can be restricted a bit.
+#if defined(__x86_64__) || defined(__arm__)
+    // transport_common.cc needs this.
+    case __NR_accept:
+    case __NR_setsockopt:
+#elif defined(__i386__)
+    case __NR_socketcall:
+#endif
+    // trusted/service_runtime/linux/thread_suspension.c needs sigwait() and is
+    // used by NaCl's GDB debug stub.
+    case __NR_rt_sigtimedwait:
+#if defined(__i386__)
+    // Needed on i386 to set-up the custom segments.
+    case __NR_modify_ldt:
+#endif
+    // NaClAddrSpaceBeforeAlloc needs prlimit64.
+    case __NR_prlimit64:
+    // NaCl uses custom signal stacks.
+    case __NR_sigaltstack:
+    // Below is fairly similar to the policy for a Chromium renderer.
+    // TODO(jln): restrict clone(), ioctl() and prctl().
+    case __NR_ioctl:
+#if defined(__i386__) || defined(__x86_64__)
+    case __NR_getrlimit:
+#endif
+#if defined(__i386__) || defined(__arm__)
+    case __NR_ugetrlimit:
+#endif
+    case __NR_pread64:
+    case __NR_pwrite64:
+    case __NR_sched_get_priority_max:
+    case __NR_sched_get_priority_min:
+    case __NR_sched_getaffinity:
+    case __NR_sched_getparam:
+    case __NR_sched_getscheduler:
+    case __NR_sched_setscheduler:
+    case __NR_setpriority:
+    case __NR_sysinfo:
+    case __NR_uname:
+      return ErrorCode(ErrorCode::ERR_ALLOWED);
     case __NR_ptrace:
       return ErrorCode(EPERM);
     default:
-      return ErrorCode(ErrorCode::ERR_ALLOWED);
+      // TODO(jln): look into getting rid of System V shared memory:
+      // platform_qualify/linux/sysv_shm_and_mmap.c makes it a requirement, but
+      // it may not be needed in all cases. Chromium renderers don't need
+      // System V shared memory on Aura.
+#if defined(__x86_64__) || defined(__arm__)
+      if (IsSystemVSharedMemory(sysno))
+        return ErrorCode(ErrorCode::ERR_ALLOWED);
+#elif defined(__i386__)
+      if (IsSystemVIpc(sysno))
+        return ErrorCode(ErrorCode::ERR_ALLOWED);
+#endif
+      return baseline_policy.Run(sb, sysno, aux);
   }
   NOTREACHED();
   // GCC wants this.
@@ -57,6 +135,9 @@
 }  // namespace
 
 bool InitializeBpfSandbox() {
+  // TODO(jln): enable the sandbox on ARM as well.
+  if (!IsPlatformX86())
+    return false;
   bool sandbox_is_initialized =
       content::InitializeSandbox(NaClBpfSandboxPolicy);
   if (sandbox_is_initialized) {
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS
index c00b5fb..12111d0 100644
--- a/chrome/renderer/DEPS
+++ b/chrome/renderer/DEPS
@@ -20,11 +20,6 @@
   "+webkit/renderer",
 
   # TODO(jam): eliminate all of these. http://crbug.com/263054
-  "!webkit/plugins/ppapi/ppb_file_ref_impl.h",
-  "!webkit/plugins/ppapi/ppapi_interface_factory.h",
-  "!webkit/plugins/ppapi/ppb_image_data_impl.h",
-  "!webkit/plugins/ppapi/host_globals.h",
-  "!webkit/plugins/ppapi/plugin_module.h",
   "!webkit/plugins/ppapi/ppapi_plugin_instance.h",
   "!webkit/plugins/plugin_constants.h",
 
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index ab39f59..f0262c0 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -48,8 +48,9 @@
 #include "chrome/renderer/net_benchmarking_extension.h"
 #include "chrome/renderer/one_click_signin_agent.h"
 #include "chrome/renderer/page_load_histograms.h"
-#include "chrome/renderer/pepper/chrome_ppapi_interfaces.h"
 #include "chrome/renderer/pepper/pepper_helper.h"
+#include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
+#include "chrome/renderer/pepper/ppb_pdf_impl.h"
 #include "chrome/renderer/playback_extension.h"
 #include "chrome/renderer/plugins/plugin_placeholder.h"
 #include "chrome/renderer/plugins/plugin_uma.h"
@@ -80,6 +81,8 @@
 #include "grit/renderer_resources.h"
 #include "ipc/ipc_sync_channel.h"
 #include "net/base/net_errors.h"
+#include "ppapi/c/private/ppb_nacl_private.h"
+#include "ppapi/c/private/ppb_pdf.h"
 #include "ppapi/shared_impl/ppapi_switches.h"
 #include "third_party/WebKit/public/web/WebCache.h"
 #include "third_party/WebKit/public/web/WebDataSource.h"
@@ -97,9 +100,6 @@
 #include "ui/base/layout.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/webui/jstemplate_builder.h"
-#include "webkit/plugins/ppapi/plugin_module.h"
-#include "webkit/plugins/ppapi/ppapi_interface_factory.h"
-
 #include "widevine_cdm_version.h"  // In SHARED_INTERMEDIATE_DIR.
 
 #if defined(ENABLE_WEBRTC)
@@ -1204,11 +1204,17 @@
       IsOtherExtensionWithWebRequestInstalled();
 }
 
-void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories(
-    webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
+const void* ChromeContentRendererClient::CreatePPAPIInterface(
+    const std::string& interface_name) {
 #if defined(ENABLE_PLUGINS)
-  factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory);
+#if !defined(DISABLE_NACL)
+  if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
+    return PPB_NaCl_Private_Impl::GetInterface();
+#endif  // DISABLE_NACL
+  if (interface_name == PPB_PDF_INTERFACE)
+    return PPB_PDF_Impl::GetInterface();
 #endif
+  return NULL;
 }
 
 bool ChromeContentRendererClient::IsPluginAllowedToCallRequestOSFileHandle(
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index 8af6d11..44f2774 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -126,8 +126,8 @@
                                       const std::string& value) OVERRIDE;
   virtual bool AllowBrowserPlugin(
       WebKit::WebPluginContainer* container) const OVERRIDE;
-  virtual void RegisterPPAPIInterfaceFactories(
-      webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE;
+  virtual const void* CreatePPAPIInterface(
+      const std::string& interface_name) OVERRIDE;
   // TODO(victorhsieh): move to ChromeContentBrowserClient once we migrate
   // PPAPI FileIO host to browser.
   virtual bool IsPluginAllowedToCallRequestOSFileHandle(
diff --git a/chrome/renderer/pepper/DEPS b/chrome/renderer/pepper/DEPS
index 721a7a4..ea5f65b 100644
--- a/chrome/renderer/pepper/DEPS
+++ b/chrome/renderer/pepper/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/nacl/common",
   "+ppapi/host",
   
   # TODO(raymes): Once all of the resources are refactored to the new pepper
diff --git a/chrome/renderer/pepper/chrome_ppapi_interfaces.cc b/chrome/renderer/pepper/chrome_ppapi_interfaces.cc
deleted file mode 100644
index 91f5d3b..0000000
--- a/chrome/renderer/pepper/chrome_ppapi_interfaces.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/renderer/pepper/chrome_ppapi_interfaces.h"
-
-#include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
-#include "chrome/renderer/pepper/ppb_pdf_impl.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
-#include "ppapi/c/private/ppb_pdf.h"
-#include "webkit/plugins/ppapi/ppapi_interface_factory.h"
-
-namespace chrome {
-
-const void* ChromePPAPIInterfaceFactory(const std::string& interface_name) {
-#if !defined(DISABLE_NACL)
-  if (interface_name == PPB_NACL_PRIVATE_INTERFACE)
-    return PPB_NaCl_Private_Impl::GetInterface();
-#endif  // DISABLE_NACL
-  if (interface_name == PPB_PDF_INTERFACE)
-    return PPB_PDF_Impl::GetInterface();
-  return NULL;
-}
-
-}  // namespace chrome
diff --git a/chrome/renderer/pepper/chrome_ppapi_interfaces.h b/chrome/renderer/pepper/chrome_ppapi_interfaces.h
deleted file mode 100644
index cda78a7..0000000
--- a/chrome/renderer/pepper/chrome_ppapi_interfaces.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_RENDERER_PEPPER_CHROME_PPAPI_INTERFACES_H_
-#define CHROME_RENDERER_PEPPER_CHROME_PPAPI_INTERFACES_H_
-
-#include <string>
-
-namespace chrome {
-
-const void* ChromePPAPIInterfaceFactory(const std::string& interface_name);
-
-}  // chrome
-
-#endif  // CHROME_RENDERER_PEPPER_CHROME_PPAPI_INTERFACES_H_
-
diff --git a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
index 863bde9..85662db 100644
--- a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
+++ b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc
@@ -12,9 +12,7 @@
 #include "ppapi/host/ppapi_host.h"
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppb_file_ref_proxy.h"
-#include "webkit/plugins/ppapi/plugin_module.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
 
 namespace chrome {
 
@@ -53,17 +51,15 @@
   if (!plugin_instance)
     return PP_ERROR_FAILED;
 
-  base::FilePath plugin_dir = plugin_instance->module()->path().DirName();
+  base::FilePath plugin_dir = plugin_instance->GetModulePath().DirName();
   DCHECK(!plugin_dir.empty());
   base::FilePath voucher_file = plugin_dir.Append(
       base::FilePath(kVoucherFilename));
 
-  webkit::ppapi::PPB_FileRef_Impl* ref =
-      webkit::ppapi::PPB_FileRef_Impl::CreateExternal(
-          pp_instance(), voucher_file, "");
   ppapi::PPB_FileRef_CreateInfo create_info;
-  ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef(ref->GetReference(),
-                                                    &create_info);
+  ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef(
+      plugin_instance->CreateExternalFileReference(voucher_file),
+      &create_info);
   context->reply_msg =
       PpapiPluginMsg_FlashDRM_GetVoucherFileReply(create_info);
   return PP_OK;
diff --git a/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
index 967650e..6bc0c30 100644
--- a/chrome/renderer/pepper/pepper_flash_renderer_host.cc
+++ b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
@@ -29,7 +29,6 @@
 #include "ui/gfx/rect.h"
 #include "url/gurl.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
 
 using ppapi::thunk::EnterResourceNoLock;
 using ppapi::thunk::PPB_ImageData_API;
@@ -106,17 +105,6 @@
       params.glyph_indices.empty())
     return PP_ERROR_FAILED;
 
-  EnterResourceNoLock<PPB_ImageData_API> enter(
-      params.image_data.host_resource(), true);
-  if (enter.failed())
-    return PP_ERROR_FAILED;
-  webkit::ppapi::PPB_ImageData_Impl* image_resource =
-      static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter.object());
-
-  webkit::ppapi::ImageDataAutoMapper mapper(image_resource);
-  if (!mapper.is_valid())
-    return PP_ERROR_FAILED;
-
   // Set up the typeface.
   int style = SkTypeface::kNormal;
   if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >=
@@ -130,8 +118,24 @@
   if (!typeface)
     return PP_ERROR_FAILED;
 
+  EnterResourceNoLock<PPB_ImageData_API> enter(
+      params.image_data.host_resource(), true);
+  if (enter.failed())
+    return PP_ERROR_FAILED;
+
   // Set up the canvas.
-  SkCanvas* canvas = image_resource->GetPlatformCanvas();
+  PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(
+      enter.object());
+  SkCanvas* canvas = image->GetPlatformCanvas();
+  bool needs_unmapping = false;
+  if (!canvas) {
+    needs_unmapping = true;
+    image->Map();
+    canvas = image->GetPlatformCanvas();
+    if (!canvas)
+      return PP_ERROR_FAILED;  // Failure mapping.
+  }
+
   SkAutoCanvasRestore acr(canvas, true);
 
   // Clip is applied in pixels before the transform.
@@ -173,19 +177,22 @@
 
   // Build up the skia advances.
   size_t glyph_count = params.glyph_indices.size();
-  if (glyph_count == 0)
-    return PP_OK;
-  std::vector<SkPoint> storage;
-  storage.resize(glyph_count);
-  SkPoint* sk_positions = &storage[0];
-  for (uint32_t i = 0; i < glyph_count; i++) {
-    sk_positions[i].set(x, y);
-    x += SkFloatToScalar(params.glyph_advances[i].x);
-    y += SkFloatToScalar(params.glyph_advances[i].y);
+  if (glyph_count) {
+    std::vector<SkPoint> storage;
+    storage.resize(glyph_count);
+    SkPoint* sk_positions = &storage[0];
+    for (uint32_t i = 0; i < glyph_count; i++) {
+      sk_positions[i].set(x, y);
+      x += SkFloatToScalar(params.glyph_advances[i].x);
+      y += SkFloatToScalar(params.glyph_advances[i].y);
+    }
+
+    canvas->drawPosText(&params.glyph_indices[0], glyph_count * 2, sk_positions,
+                        paint);
   }
 
-  canvas->drawPosText(&params.glyph_indices[0], glyph_count * 2, sk_positions,
-                      paint);
+  if (needs_unmapping)
+    image->Unmap();
 
   return PP_OK;
 }
diff --git a/chrome/renderer/pepper/pepper_pdf_host.cc b/chrome/renderer/pepper/pepper_pdf_host.cc
index 69275fa..afe05a6 100644
--- a/chrome/renderer/pepper/pepper_pdf_host.cc
+++ b/chrome/renderer/pepper/pepper_pdf_host.cc
@@ -19,8 +19,11 @@
 #include "ppapi/proxy/host_dispatcher.h"
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/proxy/ppb_image_data_proxy.h"
+#include "ppapi/shared_impl/ppb_image_data_shared.h"
 #include "ppapi/shared_impl/scoped_pp_resource.h"
 #include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_image_data_api.h"
+#include "skia/ext/platform_canvas.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
 #include "third_party/WebKit/public/web/WebElement.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
@@ -34,7 +37,6 @@
 #include "ui/gfx/image/image_skia_rep.h"
 #include "ui/gfx/point.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
 
 using webkit::ppapi::PluginInstance;
 
@@ -314,7 +316,7 @@
   uint32_t byte_count = 0;
   bool success = CreateImageData(
       pp_instance(),
-      webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(),
+      ppapi::PPB_ImageData_Shared::GetNativeImageDataFormat(),
       pp_size,
       image_skia_rep.sk_bitmap(),
       &host_resource,
@@ -371,17 +373,26 @@
   if (enter_resource.failed())
     return false;
 
-  webkit::ppapi::PPB_ImageData_Impl* image_data =
-      static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter_resource.object());
-  webkit::ppapi::ImageDataAutoMapper mapper(image_data);
-  if (!mapper.is_valid())
-    return false;
+  ppapi::thunk::PPB_ImageData_API* image_data =
+      static_cast<ppapi::thunk::PPB_ImageData_API*>(enter_resource.object());
+  SkCanvas* canvas = image_data->GetCanvas();
+  bool needs_unmapping = false;
+  if (!canvas) {
+    needs_unmapping = true;
+    image_data->Map();
+    canvas = image_data->GetCanvas();
+    if (!canvas)
+      return false;  // Failure mapping.
+  }
 
-  const SkBitmap* bitmap = image_data->GetMappedBitmap();
+  const SkBitmap* bitmap = &skia::GetTopDevice(*canvas)->accessBitmap(false);
   pixels_to_write.copyPixelsTo(bitmap->getPixels(),
                                bitmap->getSize(),
                                bitmap->rowBytes());
 
+  if (needs_unmapping)
+    image_data->Unmap();
+
   return true;
 }
 
diff --git a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
index f445993..23f507b 100644
--- a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
+++ b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc
@@ -12,7 +12,8 @@
 #include "content/public/renderer/renderer_ppapi_host.h"
 #include "ppapi/host/ppapi_host.h"
 #include "ppapi/proxy/ppapi_messages.h"
-#include "webkit/plugins/ppapi/host_globals.h"
+#include "ppapi/shared_impl/var_tracker.h"
+#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
 
 namespace chrome {
 
@@ -54,8 +55,8 @@
 
   base::SharedMemoryHandle host_shm_handle;
   shm->ShareToProcess(base::GetCurrentProcessHandle(), &host_shm_handle);
-  *host_handle_id = content::GetHostGlobals()->GetVarTracker()->
-      TrackSharedMemoryHandle(instance, host_shm_handle, size);
+  *host_handle_id = webkit::ppapi::PluginInstance::Get(instance)->
+      GetVarTracker()->TrackSharedMemoryHandle(instance, host_shm_handle, size);
 
   base::PlatformFile host_handle =
 #if defined(OS_WIN)
diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.cc b/chrome/renderer/pepper/pnacl_translation_resource_host.cc
index fd6572a..463d186 100644
--- a/chrome/renderer/pepper/pnacl_translation_resource_host.cc
+++ b/chrome/renderer/pepper/pnacl_translation_resource_host.cc
@@ -5,7 +5,7 @@
 #include "pnacl_translation_resource_host.h"
 
 #ifndef DISABLE_NACL
-#include "chrome/common/nacl_host_messages.h"
+#include "components/nacl/common/nacl_host_messages.h"
 #include "ppapi/c/pp_errors.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 
diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.h b/chrome/renderer/pepper/pnacl_translation_resource_host.h
index 41edcbf..271b27d 100644
--- a/chrome/renderer/pepper/pnacl_translation_resource_host.h
+++ b/chrome/renderer/pepper/pnacl_translation_resource_host.h
@@ -7,7 +7,7 @@
 
 #include <map>
 
-#include "chrome/common/pnacl_types.h"
+#include "components/nacl/common/pnacl_types.h"
 #include "ipc/ipc_channel_proxy.h"
 #include "ipc/ipc_platform_file.h"
 #include "ppapi/c/private/pp_file_handle.h"
diff --git a/chrome/renderer/pepper/ppb_nacl_private_impl.cc b/chrome/renderer/pepper/ppb_nacl_private_impl.cc
index 4d91899..ecf653a 100644
--- a/chrome/renderer/pepper/ppb_nacl_private_impl.cc
+++ b/chrome/renderer/pepper/ppb_nacl_private_impl.cc
@@ -11,10 +11,10 @@
 #include "base/logging.h"
 #include "base/rand_util.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/nacl_host_messages.h"
-#include "chrome/common/nacl_types.h"
 #include "chrome/renderer/chrome_render_process_observer.h"
 #include "chrome/renderer/pepper/pnacl_translation_resource_host.h"
+#include "components/nacl/common/nacl_host_messages.h"
+#include "components/nacl/common/nacl_types.h"
 #include "content/public/common/content_client.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/sandbox_init.h"
@@ -24,6 +24,7 @@
 #include "ppapi/c/pp_bool.h"
 #include "ppapi/c/private/pp_file_handle.h"
 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
 #include "ppapi/shared_impl/ppapi_preferences.h"
 #include "ppapi/shared_impl/var.h"
 #include "ppapi/thunk/enter.h"
@@ -32,8 +33,6 @@
 #include "third_party/WebKit/public/web/WebFrame.h"
 #include "third_party/WebKit/public/web/WebPluginContainer.h"
 #include "third_party/WebKit/public/web/WebView.h"
-#include "webkit/plugins/ppapi/host_globals.h"
-#include "webkit/plugins/ppapi/plugin_module.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
 
 namespace {
@@ -78,7 +77,7 @@
 }
 
 // Launch NaCl's sel_ldr process.
-PP_NaClResult LaunchSelLdr(PP_Instance instance,
+PP_ExternalPluginResult LaunchSelLdr(PP_Instance instance,
                            const char* alleged_url,
                            PP_Bool uses_irt,
                            PP_Bool uses_ppapi,
@@ -99,7 +98,7 @@
   if (uses_ppapi) {
     routing_id = GetRoutingID(instance);
     if (!routing_id)
-      return PP_NACL_FAILED;
+      return PP_EXTERNAL_PLUGIN_FAILED;
   }
 
   InstanceInfo instance_info;
@@ -125,11 +124,11 @@
                                  PP_ToBool(enable_exception_handling)),
           &launch_result,
           &error_message_string))) {
-    return PP_NACL_FAILED;
+    return PP_EXTERNAL_PLUGIN_FAILED;
   }
   if (!error_message_string.empty()) {
     *error_message = ppapi::StringVar::StringToPPVar(error_message_string);
-    return PP_NACL_FAILED;
+    return PP_EXTERNAL_PLUGIN_FAILED;
   }
   result_socket = launch_result.imc_channel_handle;
   instance_info.channel_handle = launch_result.ipc_channel_handle;
@@ -147,50 +146,32 @@
   *(static_cast<NaClHandle*>(imc_handle)) =
       nacl::ToNativeHandle(result_socket);
 
-  return PP_NACL_OK;
+  return PP_EXTERNAL_PLUGIN_OK;
 }
 
-PP_NaClResult StartPpapiProxy(PP_Instance instance) {
+PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance) {
   InstanceInfoMap& map = g_instance_info.Get();
   InstanceInfoMap::iterator it = map.find(instance);
   if (it == map.end()) {
     DLOG(ERROR) << "Could not find instance ID";
-    return PP_NACL_FAILED;
+    return PP_EXTERNAL_PLUGIN_FAILED;
   }
   InstanceInfo instance_info = it->second;
   map.erase(it);
 
   webkit::ppapi::PluginInstance* plugin_instance =
-      content::GetHostGlobals()->GetInstance(instance);
+      webkit::ppapi::PluginInstance::Get(instance);
   if (!plugin_instance) {
     DLOG(ERROR) << "GetInstance() failed";
-    return PP_NACL_ERROR_MODULE;
+    return PP_EXTERNAL_PLUGIN_ERROR_MODULE;
   }
 
-  // Create a new module for each instance of the NaCl plugin that is using
-  // the IPC based out-of-process proxy. We can't use the existing module,
-  // because it is configured for the in-process NaCl plugin, and we must
-  // keep it that way to allow the page to create other instances.
-  webkit::ppapi::PluginModule* plugin_module = plugin_instance->module();
-  scoped_refptr<webkit::ppapi::PluginModule> nacl_plugin_module(
-      plugin_module->CreateModuleForNaClInstance());
-
-  content::RendererPpapiHost* renderer_ppapi_host =
-      content::RendererPpapiHost::CreateExternalPluginModule(
-          nacl_plugin_module,
-          plugin_instance,
-          base::FilePath().AppendASCII(instance_info.url.spec()),
-          instance_info.permissions,
-          instance_info.channel_handle,
-          instance_info.plugin_pid,
-          instance_info.plugin_child_id);
-  if (!renderer_ppapi_host) {
-    DLOG(ERROR) << "CreateExternalPluginModule() failed";
-    return PP_NACL_ERROR_MODULE;
-  }
-
-  // Finally, switch the instance to the proxy.
-  return nacl_plugin_module->InitAsProxiedNaCl(plugin_instance);
+  return plugin_instance->SwitchToOutOfProcessProxy(
+      base::FilePath().AppendASCII(instance_info.url.spec()),
+      instance_info.permissions,
+      instance_info.channel_handle,
+      instance_info.plugin_pid,
+      instance_info.plugin_child_id);
 }
 
 int UrandomFD(void) {
@@ -316,7 +297,7 @@
       CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePnacl));
 }
 
-PP_NaClResult ReportNaClError(PP_Instance instance,
+PP_ExternalPluginResult ReportNaClError(PP_Instance instance,
                               PP_NaClError error_id) {
   IPC::Sender* sender = content::RenderThread::Get();
 
@@ -326,9 +307,9 @@
               // or is it safe to include the appropriate headers in
               // render_messages.h?
               GetRoutingID(instance), static_cast<int>(error_id)))) {
-    return PP_NACL_FAILED;
+    return PP_EXTERNAL_PLUGIN_FAILED;
   }
-  return PP_NACL_OK;
+  return PP_EXTERNAL_PLUGIN_OK;
 }
 
 PP_FileHandle OpenNaClExecutable(PP_Instance instance,
diff --git a/chrome/renderer/pepper/ppb_pdf_impl.cc b/chrome/renderer/pepper/ppb_pdf_impl.cc
index 93aec84..9148e10 100644
--- a/chrome/renderer/pepper/ppb_pdf_impl.cc
+++ b/chrome/renderer/pepper/ppb_pdf_impl.cc
@@ -13,7 +13,6 @@
 #include "chrome/common/render_messages.h"
 #include "chrome/renderer/printing/print_web_view_helper.h"
 #include "content/public/common/child_process_sandbox_support_linux.h"
-#include "content/public/common/content_client.h"
 #include "content/public/common/referrer.h"
 #include "content/public/renderer/render_thread.h"
 #include "content/public/renderer/render_view.h"
@@ -21,10 +20,10 @@
 #include "grit/webkit_strings.h"
 #include "ppapi/c/pp_resource.h"
 #include "ppapi/c/private/ppb_pdf.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/resource.h"
 #include "ppapi/shared_impl/resource_tracker.h"
 #include "ppapi/shared_impl/var.h"
-#include "skia/ext/platform_canvas.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
 #include "third_party/WebKit/public/web/WebElement.h"
@@ -35,14 +34,9 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/layout.h"
 #include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/image/image_skia.h"
-#include "ui/gfx/image/image_skia_rep.h"
-#include "webkit/plugins/ppapi/host_globals.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
-#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
 
 using ppapi::PpapiGlobals;
-using webkit::ppapi::HostGlobals;
 using webkit::ppapi::PluginInstance;
 using WebKit::WebElement;
 using WebKit::WebView;
@@ -139,7 +133,7 @@
 #if defined(ENABLE_PRINTING)
 
 WebKit::WebElement GetWebElement(PP_Instance instance_id) {
-  PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return WebKit::WebElement();
   return instance->container()->element();
@@ -172,8 +166,7 @@
 
 PP_Var GetLocalizedString(PP_Instance instance_id,
                           PP_ResourceString string_id) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return PP_MakeUndefined();
 
@@ -199,7 +192,7 @@
     PP_PrivateFontCharset charset) {
 #if defined(OS_LINUX) || defined(OS_OPENBSD)
   // Validate the instance before using it below.
-  if (!content::GetHostGlobals()->GetInstance(instance_id))
+  if (!PluginInstance::Get(instance_id))
     return 0;
 
   scoped_refptr<ppapi::StringVar> face_name(ppapi::StringVar::FromPPVar(
@@ -293,24 +286,21 @@
 }
 
 void DidStartLoading(PP_Instance instance_id) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return;
   instance->render_view()->DidStartLoading();
 }
 
 void DidStopLoading(PP_Instance instance_id) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return;
   instance->render_view()->DidStopLoading();
 }
 
 void SetContentRestriction(PP_Instance instance_id, int restrictions) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return;
   instance->render_view()->Send(
@@ -330,8 +320,7 @@
 }
 
 void HasUnsupportedFeature(PP_Instance instance_id) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return;
 
@@ -346,8 +335,7 @@
 }
 
 void SaveAs(PP_Instance instance_id) {
-  PluginInstance* instance =
-      content::GetHostGlobals()->GetInstance(instance_id);
+  PluginInstance* instance = PluginInstance::Get(instance_id);
   if (!instance)
     return;
   GURL url = instance->plugin_url();
@@ -383,7 +371,10 @@
   if (res_id == 0)
     return 0;
 
-  ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale);
+  // Validate the instance.
+  PluginInstance* instance = PluginInstance::Get(instance_id);
+  if (!instance)
+    return 0;
 
   gfx::ImageSkia* res_image_skia =
       ResourceBundle::GetSharedInstance().GetImageSkiaNamed(res_id);
@@ -391,38 +382,7 @@
   if (!res_image_skia)
     return 0;
 
-  // Validate the instance.
-  if (!content::GetHostGlobals()->GetInstance(instance_id))
-    return 0;
-
-  gfx::ImageSkiaRep image_skia_rep = res_image_skia->GetRepresentation(
-      scale_factor);
-
-  if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor)
-    return 0;
-
-  scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data(
-      new webkit::ppapi::PPB_ImageData_Impl(
-          instance_id,
-          webkit::ppapi::PPB_ImageData_Impl::PLATFORM));
-  if (!image_data->Init(
-          webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(),
-          image_skia_rep.pixel_width(),
-          image_skia_rep.pixel_height(),
-          false)) {
-    return 0;
-  }
-
-  webkit::ppapi::ImageDataAutoMapper mapper(image_data.get());
-  if (!mapper.is_valid())
-    return 0;
-
-  skia::PlatformCanvas* canvas = image_data->GetPlatformCanvas();
-  // Note: Do not skBitmap::copyTo the canvas bitmap directly because it will
-  // ignore the allocated pixels in shared memory and re-allocate a new buffer.
-  canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0);
-
-  return image_data->GetReference();
+  return instance->CreateImage(res_image_skia, scale);
 }
 
 PP_Resource GetResourceImage(PP_Instance instance_id,
diff --git a/chrome/renderer/resources/extensions/app_custom_bindings.js b/chrome/renderer/resources/extensions/app_custom_bindings.js
index 733395d..2ba59e6 100644
--- a/chrome/renderer/resources/extensions/app_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_custom_bindings.js
@@ -17,33 +17,25 @@
 var logActivity = requireNative('activityLogger');
 
 function wrapForLogging(fun) {
-  var id = extensionId;
-  return (function() {
+  if (!extensionId)
+    return fun;  // nothing interesting to log without an extension
+
+  return function() {
     // TODO(ataly): We need to make sure we use the right prototype for
     // fun.apply. Array slice can either be rewritten or similarly defined.
-    logActivity.LogAPICall(id, "app." + fun.name,
+    logActivity.LogAPICall(extensionId, "app." + fun.name,
         $Array.slice(arguments));
     return $Function.apply(fun, this, arguments);
-  });
+  };
 }
 
 // This becomes chrome.app
-var app;
-if (!extensionId) {
-  app = {
-    getIsInstalled: appNatives.GetIsInstalled,
-    getDetails: appNatives.GetDetails,
-    getDetailsForFrame: appNatives.GetDetailsForFrame,
-    runningState: appNatives.GetRunningState
-  };
-} else {
-  app = {
-    getIsInstalled: wrapForLogging(appNatives.GetIsInstalled),
-    getDetails: wrapForLogging(appNatives.GetDetails),
-    getDetailsForFrame: wrapForLogging(appNatives.GetDetailsForFrame),
-    runningState: wrapForLogging(appNatives.GetRunningState)
-  };
-}
+var app = {
+  getIsInstalled: wrapForLogging(appNatives.GetIsInstalled),
+  getDetails: wrapForLogging(appNatives.GetDetails),
+  getDetailsForFrame: wrapForLogging(appNatives.GetDetailsForFrame),
+  runningState: wrapForLogging(appNatives.GetRunningState)
+};
 
 // Tricky; "getIsInstalled" is actually exposed as the getter "isInstalled",
 // but we don't have a way to express this in the schema JSON (nor is it
@@ -51,18 +43,20 @@
 //
 // So, define it manually, and let the getIsInstalled function act as its
 // documentation.
-if (!extensionId)
-  app.__defineGetter__('isInstalled', appNatives.GetIsInstalled);
-else
-  app.__defineGetter__('isInstalled',
-                       wrapForLogging(appNatives.GetIsInstalled));
+app.__defineGetter__('isInstalled', wrapForLogging(appNatives.GetIsInstalled));
 
 // Called by app_bindings.cc.
 function onInstallStateResponse(state, callbackId) {
   var callback = callbacks[callbackId];
   delete callbacks[callbackId];
-  if (typeof(callback) == 'function')
-    callback(state);
+  if (typeof(callback) == 'function') {
+    try {
+      callback(state);
+    } catch (e) {
+      console.error('Exception in chrome.app.installState response handler: ' +
+                    e.stack);
+    }
+  }
 }
 
 // TODO(kalman): move this stuff to its own custom bindings.
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index d8a666a..2d1a083 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -423,7 +423,7 @@
     var detail = e.detail ? JSON.parse(e.detail) : {};
     if (detail.id != requestId)
       return;
-    browserPluginNode['-internal-setPermission'](requestId, false);
+    browserPluginNode['-internal-setPermission'](requestId, false, '');
   }
 
   browserPluginNode.addEventListener('-internal-newwindow', function(e) {
@@ -463,12 +463,12 @@
           // then we will fail and it will be treated as if the new window
           // was rejected. The permission API plumbing is used here to clean
           // up the state created for the new window if attaching fails.
-          browserPluginNode['-internal-setPermission'](requestId, attached);
+          browserPluginNode['-internal-setPermission'](requestId, attached, '');
         }, 0);
       },
       discard: function() {
         validateCall();
-        browserPluginNode['-internal-setPermission'](requestId, false);
+        browserPluginNode['-internal-setPermission'](requestId, false, '');
       }
     };
     evt.window = window;
@@ -483,7 +483,7 @@
     if (!actionTaken && !defaultPrevented) {
       actionTaken = true;
       // The default action is to discard the window.
-      browserPluginNode['-internal-setPermission'](requestId, false);
+      browserPluginNode['-internal-setPermission'](requestId, false, '');
       console.warn(WARNING_MSG_NEWWINDOW_BLOCKED);
     }
   });
@@ -552,7 +552,7 @@
     var detail = e.detail ? JSON.parse(e.detail) : {};
     if (detail.id != requestId)
       return;
-    browserPluginNode['-internal-setPermission'](requestId, false);
+    browserPluginNode['-internal-setPermission'](requestId, false, '');
   }
 
   browserPluginNode.addEventListener(internalevent, function(e) {
@@ -575,7 +575,7 @@
           if (decisionMade) {
             throw new Error(ERROR_MSG_PERMISSION_ALREADY_DECIDED);
           } else {
-            browserPluginNode['-internal-setPermission'](requestId, true);
+            browserPluginNode['-internal-setPermission'](requestId, true, '');
             decisionMade = true;
           }
         },
@@ -583,7 +583,7 @@
           if (decisionMade) {
             throw new Error(ERROR_MSG_PERMISSION_ALREADY_DECIDED);
           } else {
-            browserPluginNode['-internal-setPermission'](requestId, false);
+            browserPluginNode['-internal-setPermission'](requestId, false, '');
             decisionMade = true;
           }
         }
@@ -600,7 +600,7 @@
       var defaultPrevented = !node.dispatchEvent(evt);
       if (!decisionMade && !defaultPrevented) {
         decisionMade = true;
-        browserPluginNode['-internal-setPermission'](requestId, false);
+        browserPluginNode['-internal-setPermission'](requestId, false, '');
       }
     }
   });
diff --git a/chrome/renderer/resources/extensions/web_view_experimental.js b/chrome/renderer/resources/extensions/web_view_experimental.js
index 4a10dd4..56f8bd3 100644
--- a/chrome/renderer/resources/extensions/web_view_experimental.js
+++ b/chrome/renderer/resources/extensions/web_view_experimental.js
@@ -21,6 +21,7 @@
  */
 WebView.prototype.maybeSetupExperimentalAPI_ = function() {
   this.setupWebRequestEvents_();
+  this.setupDialogEvent_();
 };
 
 /**
@@ -58,3 +59,75 @@
     });
   }
 };
+
+/**
+ * @private
+ */
+WebView.prototype.setupDialogEvent_ = function() {
+  var ERROR_MSG_DIALOG_ACTION_ALREADY_TAKEN = '<webview>: ' +
+      'An action has already been taken for this "dialog" event.';
+
+  var WARNING_MSG_DIALOG_BLOCKED = '<webview>: A dialog was blocked.';
+
+  var DIALOG_EVENT_ATTRIBUTES = [
+    'defaultPromptText',
+    'messageText',
+    'messageType',
+    'url'
+  ];
+
+  var self = this;
+  var node = this.webviewNode_;
+  var browserPluginNode = this.browserPluginNode_;
+
+  var onTrackedObjectGone = function(requestId, e) {
+    var detail = e.detail ? JSON.parse(e.detail) : {};
+    if (detail.id != requestId)
+      return;
+    browserPluginNode['-internal-setPermission'](requestId, false, '');
+  }
+
+  browserPluginNode.addEventListener('-internal-dialog', function(e) {
+    var evt = new Event('dialog', { bubbles: true, cancelable: true });
+    var detail = e.detail ? JSON.parse(e.detail) : {};
+
+    $Array.forEach(DIALOG_EVENT_ATTRIBUTES, function(attribName) {
+      evt[attribName] = detail[attribName];
+    });
+    var requestId = detail.requestId;
+    var actionTaken = false;
+
+    var validateCall = function() {
+      if (actionTaken)
+        throw new Error(ERROR_MSG_DIALOG_ACTION_ALREADY_TAKEN);
+      actionTaken = true;
+    };
+
+    var dialog = {
+      ok: function(user_input) {
+        validateCall();
+        browserPluginNode['-internal-setPermission'](
+            requestId, true, user_input);
+      },
+      cancel: function() {
+        validateCall();
+        browserPluginNode['-internal-setPermission'](requestId, false, '');
+      }
+    };
+    evt.dialog = dialog;
+    // Make browser plugin track lifetime of |window|.
+    var onTrackedObjectGoneWithRequestId =
+        $Function.bind(onTrackedObjectGone, self, requestId);
+    browserPluginNode.addEventListener('-internal-trackedobjectgone',
+        onTrackedObjectGoneWithRequestId);
+    browserPluginNode['-internal-trackObjectLifetime'](dialog, requestId);
+
+    var defaultPrevented = !node.dispatchEvent(evt);
+    if (!actionTaken && !defaultPrevented) {
+      actionTaken = true;
+      // The default action is equivalent to canceling the dialog.
+      browserPluginNode['-internal-setPermission'](requestId, false, '');
+      console.warn(WARNING_MSG_DIALOG_BLOCKED);
+    }
+  });
+};
diff --git a/chrome/renderer/resources/extensions/webstore_custom_bindings.js b/chrome/renderer/resources/extensions/webstore_custom_bindings.js
index 7e60d16..963adaa 100644
--- a/chrome/renderer/resources/extensions/webstore_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/webstore_custom_bindings.js
@@ -11,9 +11,8 @@
 }
 
 Installer.prototype.install = function(url, onSuccess, onFailure) {
-  if (this._pendingInstall) {
+  if (this._pendingInstall)
     throw 'A Chrome Web Store installation is already pending.';
-  }
   var installId = webstoreNatives.Install(url, onSuccess, onFailure);
   if (installId !== undefined) {
     this._pendingInstall = {
@@ -36,6 +35,9 @@
       pendingInstall.onSuccess();
     else if (!success && pendingInstall.onFailure)
       pendingInstall.onFailure(error);
+  } catch (e) {
+    console.error('Exception in chrome.webstore.install response handler: ' +
+                  e.stack);
   } finally {
     this._pendingInstall = null;
   }
diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc
index 47d2360..24af3dc 100644
--- a/chrome/service/cloud_print/cloud_print_proxy.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy.cc
@@ -7,7 +7,8 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 #include "base/values.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/cloud_print/cloud_print_constants.h"
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 88cd919..de55b4b 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -11,7 +11,7 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/message_loop/message_loop_proxy.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/chrome_utility_messages.h"
@@ -26,6 +26,7 @@
 #if defined(OS_WIN)
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/process/launch.h"
 #include "base/win/scoped_handle.h"
 #include "content/public/common/sandbox_init.h"
 #include "content/public/common/sandboxed_process_launcher_delegate.h"
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index 9be55d7..6876a61 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -14,7 +14,7 @@
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/public/common/child_process_host_delegate.h"
 #include "ipc/ipc_channel.h"
 #include "printing/pdf_render_settings.h"
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc
index 28f5787..d9b8c06 100644
--- a/chrome/test/base/browser_with_test_window_test.cc
+++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -4,7 +4,7 @@
 
 #include "chrome/test/base/browser_with_test_window_test.h"
 
-#include "base/synchronization/waitable_event.h"
+#include "base/run_loop.h"
 #include "chrome/browser/profiles/profile_destroyer.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_navigator.h"
@@ -25,24 +25,16 @@
 #include "ash/test/ash_test_helper.h"
 #endif
 
-using content::BrowserThread;
 using content::NavigationController;
 using content::RenderViewHost;
 using content::RenderViewHostTester;
 using content::WebContents;
 
 BrowserWithTestWindowTest::BrowserWithTestWindowTest()
-    : ui_thread_(BrowserThread::UI, message_loop()),
-      db_thread_(BrowserThread::DB),
-      file_thread_(BrowserThread::FILE, message_loop()),
-      file_user_blocking_thread_(
-          BrowserThread::FILE_USER_BLOCKING, message_loop()),
-      host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE) {
-  db_thread_.Start();
+    : host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE) {
 }
 
 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() {
-  db_thread_.Stop();
 }
 
 void BrowserWithTestWindowTest::SetHostDesktopType(
@@ -57,10 +49,12 @@
   // TODO(jamescook): Windows Ash support. This will require refactoring
   // AshTestHelper and AuraTestHelper so they can be used at the same time,
   // perhaps by AshTestHelper owning an AuraTestHelper.
-  ash_test_helper_.reset(new ash::test::AshTestHelper(&ui_loop_));
+  ash_test_helper_.reset(new ash::test::AshTestHelper(
+      base::MessageLoopForUI::current()));
   ash_test_helper_->SetUp();
 #elif defined(USE_AURA)
-  aura_test_helper_.reset(new aura::test::AuraTestHelper(&ui_loop_));
+  aura_test_helper_.reset(new aura::test::AuraTestHelper(
+      base::MessageLoopForUI::current()));
   aura_test_helper_->SetUp();
 #endif  // USE_AURA
 
@@ -79,10 +73,7 @@
 void BrowserWithTestWindowTest::TearDown() {
   // Some tests end up posting tasks to the DB thread that must be completed
   // before the profile can be destroyed and the test safely shut down.
-  base::WaitableEvent done(false, false);
-  BrowserThread::PostTask(BrowserThread::DB, FROM_HERE,
-      base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
-  done.Wait();
+  base::RunLoop().RunUntilIdle();
 
   // Reset the profile here because some profile keyed services (like the
   // audio service) depend on test stubs that the helpers below will remove.
diff --git a/chrome/test/base/browser_with_test_window_test.h b/chrome/test/base/browser_with_test_window_test.h
index 4faaa47..f4e6e51 100644
--- a/chrome/test/base/browser_with_test_window_test.h
+++ b/chrome/test/base/browser_with_test_window_test.h
@@ -11,7 +11,7 @@
 #include "chrome/browser/ui/host_desktop.h"
 #include "chrome/test/base/test_browser_window.h"
 #include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "content/public/test/test_renderer_host.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -99,8 +99,6 @@
 
   TestingProfile* GetProfile() { return profile_.get(); }
 
-  base::MessageLoop* message_loop() { return &ui_loop_; }
-
   BrowserWindow* release_browser_window() WARN_UNUSED_RESULT {
     return window_.release();
   }
@@ -142,12 +140,8 @@
 
  private:
   // We need to create a MessageLoop, otherwise a bunch of things fails.
-  base::MessageLoopForUI ui_loop_;
+  content::TestBrowserThreadBundle thread_bundle_;
   base::ShadowingAtExitManager at_exit_manager_;
-  content::TestBrowserThread ui_thread_;
-  content::TestBrowserThread db_thread_;
-  content::TestBrowserThread file_thread_;
-  content::TestBrowserThread file_user_blocking_thread_;
 
 #if defined(OS_CHROMEOS)
   chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
diff --git a/chrome/test/base/testing_io_thread_state.cc b/chrome/test/base/testing_io_thread_state.cc
new file mode 100644
index 0000000..46f396a
--- /dev/null
+++ b/chrome/test/base/testing_io_thread_state.cc
@@ -0,0 +1,102 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/base/testing_io_thread_state.h"
+
+#include "base/message_loop/message_loop_proxy.h"
+#include "base/run_loop.h"
+#include "base/time/default_tick_clock.h"
+#include "base/time/tick_clock.h"
+#include "chrome/browser/io_thread.h"
+#include "chrome/test/base/testing_browser_process.h"
+#include "content/public/browser/browser_thread.h"
+#include "net/base/network_time_notifier.h"
+
+#if defined(OS_CHROMEOS)
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/network/network_handler.h"
+#endif
+
+using content::BrowserThread;
+
+namespace {
+
+base::Closure ThreadSafeQuit(base::RunLoop* run_loop) {
+  if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
+    return run_loop->QuitClosure();
+  } else {
+    using base::Bind;
+    using base::IgnoreResult;
+    return Bind(IgnoreResult(&base::MessageLoopProxy::PostTask),
+                base::MessageLoopProxy::current(),
+                FROM_HERE,
+                run_loop->QuitClosure());
+  }
+}
+
+}  // namespace
+
+namespace chrome {
+
+TestingIOThreadState::TestingIOThreadState() {
+#if defined(OS_CHROMEOS)
+  // Needed by IOThread constructor.
+  chromeos::DBusThreadManager::InitializeWithStub();
+  chromeos::NetworkHandler::Initialize();
+#endif
+
+  io_thread_state_.reset(
+      new IOThread(TestingBrowserProcess::GetGlobal()->local_state(),
+                   TestingBrowserProcess::GetGlobal()->policy_service(),
+                   NULL, NULL));
+
+  // Safe because there are no virtuals.
+  base::RunLoop run_loop;
+  CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+                                base::Bind(&TestingIOThreadState::Initialize,
+                                           base::Unretained(this),
+                                           ThreadSafeQuit(&run_loop))));
+  run_loop.Run();
+
+  TestingBrowserProcess::GetGlobal()->SetIOThread(io_thread_state_.get());
+}
+
+TestingIOThreadState::~TestingIOThreadState() {
+  // Remove all the local IOThread state.
+  base::RunLoop run_loop;
+  CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+                                base::Bind(&TestingIOThreadState::Shutdown,
+                                           base::Unretained(this),
+                                           ThreadSafeQuit(&run_loop))));
+  run_loop.Run();
+  TestingBrowserProcess::GetGlobal()->SetIOThread(NULL);
+
+  io_thread_state_.reset();
+
+#if defined(OS_CHROMEOS)
+  chromeos::NetworkHandler::Shutdown();
+  chromeos::DBusThreadManager::Shutdown();
+#endif
+}
+
+void TestingIOThreadState::Initialize(const base::Closure& done) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+  io_thread_state_->SetGlobalsForTesting(new IOThread::Globals());
+  io_thread_state_->globals()->network_time_notifier.reset(
+      new net::NetworkTimeNotifier(
+          scoped_ptr<base::TickClock>(new base::DefaultTickClock())));
+
+  done.Run();
+}
+
+void TestingIOThreadState::Shutdown(const base::Closure& done) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+  delete io_thread_state_->globals();
+  io_thread_state_->SetGlobalsForTesting(NULL);
+  done.Run();
+}
+
+}  // namespace chrome
diff --git a/chrome/test/base/testing_io_thread_state.h b/chrome/test/base/testing_io_thread_state.h
new file mode 100644
index 0000000..5028103
--- /dev/null
+++ b/chrome/test/base/testing_io_thread_state.h
@@ -0,0 +1,38 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
+#define CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
+
+class IOThread;
+
+namespace chrome {
+
+// Convenience class for creating an IOThread object in unittests.
+// Usual usage is to create one of these in the test fixture, after the
+// BrowserThreadBundle and TestingBrowserProcess have been initialized.
+//
+// If code requires the use of io thread globals, those can be set by
+// accessing io_thread_state()->globals() on the IO thread during test setup.
+class TestingIOThreadState {
+ public:
+  TestingIOThreadState();
+  ~TestingIOThreadState();
+  IOThread* io_thread_state() { return io_thread_state_.get(); }
+
+ private:
+  void Initialize(const base::Closure& done);
+  void Shutdown(const base::Closure& done);
+
+  scoped_ptr<IOThread> io_thread_state_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestingIOThreadState);
+};
+
+}  // namespace chrome
+
+#endif  // CHROME_TEST_BASE_TESTING_IO_THREAD_STATE_H_
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 2704bc7..3a3c019 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -170,6 +170,7 @@
       last_session_exited_cleanly_(true),
       browser_context_dependency_manager_(
           BrowserContextDependencyManager::GetInstance()),
+      resource_context_(NULL),
       delegate_(NULL) {
   CreateTempProfileDir();
   profile_path_ = temp_dir_.path();
@@ -187,6 +188,7 @@
       profile_path_(path),
       browser_context_dependency_manager_(
           BrowserContextDependencyManager::GetInstance()),
+      resource_context_(NULL),
       delegate_(NULL) {
   Init();
   FinishInit();
@@ -202,6 +204,7 @@
       profile_path_(path),
       browser_context_dependency_manager_(
           BrowserContextDependencyManager::GetInstance()),
+      resource_context_(NULL),
       delegate_(delegate) {
   Init();
   if (delegate_) {
@@ -228,6 +231,7 @@
       profile_path_(path),
       browser_context_dependency_manager_(
           BrowserContextDependencyManager::GetInstance()),
+      resource_context_(NULL),
       delegate_(delegate) {
 
   // If no profile path was supplied, create one.
@@ -320,6 +324,9 @@
 }
 
 TestingProfile::~TestingProfile() {
+  // Any objects holding live URLFetchers should be deleted before teardown.
+  TemplateURLFetcherFactory::ShutdownForProfile(this);
+
   MaybeSendDestroyedNotification();
 
   browser_context_dependency_manager_->DestroyBrowserContextServices(this);
@@ -331,6 +338,14 @@
 
   if (pref_proxy_config_tracker_.get())
     pref_proxy_config_tracker_->DetachFromPrefService();
+  // Failing a post == leaks == heapcheck failure. Make that an immediate test
+  // failure.
+  if (resource_context_) {
+    CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
+                                    resource_context_));
+    resource_context_ = NULL;
+    content::RunAllPendingInMessageLoop(BrowserThread::IO);
+  }
 }
 
 static BrowserContextKeyedService* BuildFaviconService(
@@ -596,12 +611,13 @@
 }
 
 net::URLRequestContextGetter* TestingProfile::GetRequestContext() {
-  return request_context_.get();
+  return GetDefaultStoragePartition(this)->GetURLRequestContext();
 }
 
 net::URLRequestContextGetter* TestingProfile::CreateRequestContext(
     content::ProtocolHandlerMap* protocol_handlers) {
-  return request_context_.get();
+  return new net::TestURLRequestContextGetter(
+            BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
 }
 
 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
@@ -611,20 +627,6 @@
   return rph->GetStoragePartition()->GetURLRequestContext();
 }
 
-void TestingProfile::CreateRequestContext() {
-  if (!request_context_.get())
-    request_context_ = new net::TestURLRequestContextGetter(
-        BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
-}
-
-void TestingProfile::ResetRequestContext() {
-  // Any objects holding live URLFetchers should be deleted before the request
-  // context is shut down.
-  TemplateURLFetcherFactory::ShutdownForProfile(this);
-
-  request_context_ = NULL;
-}
-
 net::URLRequestContextGetter* TestingProfile::GetMediaRequestContext() {
   return NULL;
 }
@@ -674,9 +676,9 @@
 }
 
 content::ResourceContext* TestingProfile::GetResourceContext() {
-  if (!resource_context_.get())
-    resource_context_.reset(new content::MockResourceContext());
-  return resource_context_.get();
+  if (!resource_context_)
+    resource_context_ = new content::MockResourceContext();
+  return resource_context_;
 }
 
 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() {
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h
index 916bc33..939e772 100644
--- a/chrome/test/base/testing_profile.h
+++ b/chrome/test/base/testing_profile.h
@@ -174,14 +174,6 @@
   virtual bool IsOffTheRecord() const OVERRIDE;
   virtual content::DownloadManagerDelegate*
       GetDownloadManagerDelegate() OVERRIDE;
-  // Returns a testing ContextGetter (if one has been created via
-  // CreateRequestContext) or NULL. This is not done on-demand for two reasons:
-  // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because
-  // of the special memory management considerations for the
-  // TestURLRequestContextGetter class, many tests would find themseleves
-  // leaking if they called this method without the necessary IO thread. This
-  // getter is currently only capable of returning a Context that helps test
-  // the CookieMonster. See implementation comments for more details.
   virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
   virtual net::URLRequestContextGetter* CreateRequestContext(
       content::ProtocolHandlerMap* protocol_handlers) OVERRIDE;
@@ -207,9 +199,9 @@
       ExtensionSpecialStoragePolicy* extension_special_storage_policy);
   virtual ExtensionSpecialStoragePolicy*
       GetExtensionSpecialStoragePolicy() OVERRIDE;
-  // The CookieMonster will only be returned if a Context has been created. Do
-  // this by calling CreateRequestContext(). See the note at GetRequestContext
-  // for more information.
+  // TODO(ajwong): Remove this API in favor of directly retrieving the
+  // CookieStore from the StoragePartition after ExtensionURLRequestContext
+  // has been removed.
   net::CookieMonster* GetCookieMonster();
 
   virtual PrefService* GetPrefs() OVERRIDE;
@@ -217,11 +209,6 @@
   virtual history::TopSites* GetTopSites() OVERRIDE;
   virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE;
 
-  void CreateRequestContext();
-  // Clears out the created request context (which must be done before shutting
-  // down the IO thread to avoid leaks).
-  void ResetRequestContext();
-
   virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE;
   virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
       int renderer_child_id) OVERRIDE;
@@ -313,7 +300,6 @@
 
   // Internally, this is a TestURLRequestContextGetter that creates a dummy
   // request context. Currently, only the CookieMonster is hooked up.
-  scoped_refptr<net::URLRequestContextGetter> request_context_;
   scoped_refptr<net::URLRequestContextGetter> extensions_request_context_;
 
   std::wstring id_;
@@ -349,7 +335,9 @@
   // testing.
   BrowserContextDependencyManager* browser_context_dependency_manager_;
 
-  scoped_ptr<content::MockResourceContext> resource_context_;
+  // Owned, but must be deleted on the IO thread so not placing in a
+  // scoped_ptr<>.
+  content::MockResourceContext* resource_context_;
 
   scoped_ptr<policy::ProfilePolicyConnector> profile_policy_connector_;
 
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index a5fcc48..302b6d8 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -371,8 +371,13 @@
 void WaitForTemplateURLServiceToLoad(TemplateURLService* service) {
   if (service->loaded())
     return;
+
+  content::WindowedNotificationObserver observer(
+      chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
+      content::Source<TemplateURLService>(service));
   service->Load();
-  TemplateURLServiceTestUtil::BlockTillServiceProcessesRequests();
+  observer.Wait();
+
   ASSERT_TRUE(service->loaded());
 }
 
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc
index 0c84147..aabfb25 100644
--- a/chrome/test/base/view_event_test_base.cc
+++ b/chrome/test/base/view_event_test_base.cc
@@ -71,8 +71,7 @@
 
 ViewEventTestBase::ViewEventTestBase()
   : window_(NULL),
-    content_view_(NULL),
-    ui_thread_(content::BrowserThread::UI, &message_loop_) {
+    content_view_(NULL) {
 }
 
 void ViewEventTestBase::Done() {
@@ -119,7 +118,8 @@
 #elif defined(USE_AURA)
   // Instead of using the ash shell, use an AuraTestHelper to create and manage
   // the test screen.
-  aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
+  aura_test_helper_.reset(
+      new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
   aura_test_helper_->SetUp();
   context = aura_test_helper_->root_window();
 #endif
diff --git a/chrome/test/base/view_event_test_base.h b/chrome/test/base/view_event_test_base.h
index a139f26..c6c7be7 100644
--- a/chrome/test/base/view_event_test_base.h
+++ b/chrome/test/base/view_event_test_base.h
@@ -15,7 +15,7 @@
 #include "base/compiler_specific.h"
 #include "base/message_loop/message_loop.h"
 #include "base/threading/thread.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/views/widget/widget_delegate.h"
 
@@ -141,9 +141,7 @@
   // Thread for posting background MouseMoves.
   scoped_ptr<base::Thread> dnd_thread_;
 
-  base::MessageLoopForUI message_loop_;
-
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
 #if defined(OS_WIN)
   ui::ScopedOleInitializer ole_initializer_;
diff --git a/chrome/test/chromedriver/README.txt b/chrome/test/chromedriver/README.txt
index 35f0d54..03154fe 100644
--- a/chrome/test/chromedriver/README.txt
+++ b/chrome/test/chromedriver/README.txt
@@ -4,10 +4,12 @@
 ChromeDriver is an implementation of the WebDriver standard,
 which allows users to automate testing of their website across browsers.
 
+See the user site at http://code.google.com/p/chromedriver.
+
 =====Getting started=====
 Build ChromeDriver by building the 'chromedriver2_server' target. This will
-create an executable binary in the build folder named 'chromedriver2_server.exe'
-on Windows or 'chromedriver2_server' on Mac and Linux.
+create an executable binary in the build folder named
+'chromedriver2_server[.exe]'.
 
 Once built, ChromeDriver can be used interactively with python.
 
@@ -31,26 +33,30 @@
 
 =====Architecture=====
 ChromeDriver is shipped separately from Chrome. It controls Chrome out of
-process through DevTools (WebKit Inspector). ChromeDriver is a standalone server
-executable which communicates via the WebDriver JSON wire protocol. This can be
-used with the open source WebDriver client libraries.
+process through DevTools. ChromeDriver is a standalone server which
+communicates with the WebDriver client via the WebDriver wire protocol, which
+is essentially synchronous JSON commands over HTTP. WebDriver clients are
+available in many languages, and many are available from the open source
+selenium/webdriver project: http://code.google.com/p/selenium.
 
-When a new session is created, a new thread is started that is dedicated to the
-session. All commands for the session runs on this thread. This thread is
-stopped when the session is deleted. Besides, there is an IO thread and it is
-used to keep reading incoming data from Chrome in the background.
+ChromeDriver has several threads. The webserver code, third_party/mongoose,
+spawns a thread for the server socket and a certain amount of request handling
+threads. When a request is received, the command is processed on the message
+loop of the main thread, also called the command thread. Commands may be handled
+asynchronously on the command thread, but the request handler threads
+will block waiting for the response. One of the commands allows the user to
+create a session, which includes spawning a dedicated session thread. Session
+commands will be dispatched to the session thread and handled synchronously
+there. Lastly, there is an IO/net thread on which the net/ code operates.
+This is used to keep reading incoming data from Chrome in the background.
 
 =====Code structure=====
-Code under the 'chrome' subdirectory is intended to be unaware of WebDriver and
-serve as a basic C++ interface for controlling Chrome remotely via DevTools.
-As such, it should not have any WebDriver-related dependencies.
-
 1) chrome/test/chromedriver
 Implements chromedriver commands.
 
 2) chrome/test/chromedriver/chrome
-Code to deal with chrome specific stuff, like starting Chrome on different OS
-platforms, controlling Chrome via DevTools, handling events from DevTools, etc.
+A basic interface for controlling Chrome via DevTools. Should not have
+knowledge about WebDriver, and thus not depend on chrome/test/chromedriver.
 
 3) chrome/test/chromedriver/js
 Javascript helper scripts.
@@ -71,6 +77,9 @@
 8) chrome/test/chromedriver/third_party
 Third party libraries used by chromedriver.
 
+9) third_party/mongoose
+The webserver for chromedriver.
+
 =====Testing=====
 There are 4 test suites for verifying ChromeDriver's correctness:
 
diff --git a/chrome/test/chromedriver/alert_commands.cc b/chrome/test/chromedriver/alert_commands.cc
index 2eef257..85836b9 100644
--- a/chrome/test/chromedriver/alert_commands.cc
+++ b/chrome/test/chromedriver/alert_commands.cc
@@ -4,6 +4,7 @@
 
 #include "chrome/test/chromedriver/alert_commands.h"
 
+#include "base/callback.h"
 #include "base/values.h"
 #include "chrome/test/chromedriver/chrome/chrome.h"
 #include "chrome/test/chromedriver/chrome/devtools_client.h"
diff --git a/chrome/test/chromedriver/chrome/adb_impl.cc b/chrome/test/chromedriver/chrome/adb_impl.cc
index c830608..cd4919f 100644
--- a/chrome/test/chromedriver/chrome/adb_impl.cc
+++ b/chrome/test/chromedriver/chrome/adb_impl.cc
@@ -9,7 +9,7 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_tokenizer.h"
@@ -71,10 +71,10 @@
 }  // namespace
 
 AdbImpl::AdbImpl(
-    const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy,
+    const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
     Log* log)
-    : io_message_loop_proxy_(io_message_loop_proxy), log_(log) {
-  CHECK(io_message_loop_proxy_.get());
+    : io_task_runner_(io_task_runner), log_(log) {
+  CHECK(io_task_runner_.get());
 }
 
 AdbImpl::~AdbImpl() {}
@@ -185,7 +185,7 @@
     const std::string& command, std::string* response) {
   scoped_refptr<ResponseBuffer> response_buffer = new ResponseBuffer;
   log_->AddEntry(Log::kDebug, "Sending adb command: " + command);
-  io_message_loop_proxy_->PostTask(
+  io_task_runner_->PostTask(
       FROM_HERE,
       base::Bind(&ExecuteCommandOnIOThread, command, response_buffer));
   Status status = response_buffer->GetResponse(
diff --git a/chrome/test/chromedriver/chrome/adb_impl.h b/chrome/test/chromedriver/chrome/adb_impl.h
index 47f9853..b8bb411 100644
--- a/chrome/test/chromedriver/chrome/adb_impl.h
+++ b/chrome/test/chromedriver/chrome/adb_impl.h
@@ -13,7 +13,7 @@
 #include "chrome/test/chromedriver/chrome/adb.h"
 
 namespace base {
-class MessageLoopProxy;
+class SingleThreadTaskRunner;
 }
 
 class Log;
@@ -22,7 +22,7 @@
 class AdbImpl : public Adb {
  public:
   explicit AdbImpl(
-      const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy,
+      const scoped_refptr<base::SingleThreadTaskRunner>& io_message_loop_proxy,
       Log* log);
   virtual ~AdbImpl();
 
@@ -53,7 +53,7 @@
                                  const std::string& shell_command,
                                  std::string* response);
 
-  scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
+  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
 
   Log* log_;
 };
diff --git a/chrome/test/chromedriver/command.h b/chrome/test/chromedriver/command.h
index 6654694..e57a5f2 100644
--- a/chrome/test/chromedriver/command.h
+++ b/chrome/test/chromedriver/command.h
@@ -17,10 +17,14 @@
 
 class Status;
 
-typedef base::Callback<Status(
+typedef base::Callback<void(
+    const Status&,
+    scoped_ptr<base::Value>,
+    const std::string&)> CommandCallback;
+
+typedef base::Callback<void(
     const base::DictionaryValue&,
     const std::string&,
-    scoped_ptr<base::Value>*,
-    std::string*)> Command;
+    const CommandCallback&)> Command;
 
 #endif  // CHROME_TEST_CHROMEDRIVER_COMMAND_H_
diff --git a/chrome/test/chromedriver/commands.cc b/chrome/test/chromedriver/commands.cc
index 36f403f..6ab6135 100644
--- a/chrome/test/chromedriver/commands.cc
+++ b/chrome/test/chromedriver/commands.cc
@@ -5,10 +5,19 @@
 #include "chrome/test/chromedriver/commands.h"
 
 #include <list>
+#include <utility>
 
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/lazy_instance.h"
 #include "base/logging.h"  // For CHECK macros.
+#include "base/memory/linked_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
+#include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
 #include "base/sys_info.h"
+#include "base/threading/thread_local.h"
 #include "base/values.h"
 #include "chrome/test/chromedriver/capabilities.h"
 #include "chrome/test/chromedriver/chrome/chrome.h"
@@ -24,14 +33,13 @@
 #include "chrome/test/chromedriver/net/net_util.h"
 #include "chrome/test/chromedriver/net/url_request_context_getter.h"
 #include "chrome/test/chromedriver/session.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
 #include "chrome/test/chromedriver/util.h"
 
-Status ExecuteGetStatus(
+void ExecuteGetStatus(
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id) {
+    const CommandCallback& callback) {
   base::DictionaryValue build;
   build.SetString("version", "alpha");
 
@@ -43,30 +51,34 @@
   base::DictionaryValue info;
   info.Set("build", build.DeepCopy());
   info.Set("os", os.DeepCopy());
-  out_value->reset(info.DeepCopy());
-  return Status(kOk);
+  callback.Run(
+      Status(kOk), scoped_ptr<base::Value>(info.DeepCopy()), std::string());
 }
 
 NewSessionParams::NewSessionParams(
     Log* log,
-    SessionMap* session_map,
+    SessionThreadMap* session_thread_map,
     scoped_refptr<URLRequestContextGetter> context_getter,
     const SyncWebSocketFactory& socket_factory,
     DeviceManager* device_manager)
     : log(log),
-      session_map(session_map),
+      session_thread_map(session_thread_map),
       context_getter(context_getter),
       socket_factory(socket_factory),
       device_manager(device_manager) {}
 
 NewSessionParams::~NewSessionParams() {}
 
-Status ExecuteNewSession(
+namespace {
+
+base::LazyInstance<base::ThreadLocalPointer<Session> >
+    lazy_tls_session = LAZY_INSTANCE_INITIALIZER;
+
+Status CreateSessionOnSessionThreadHelper(
     const NewSessionParams& bound_params,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id) {
+    scoped_ptr<base::Value>* out_value) {
   int port;
   if (!FindOpenPort(&port))
     return Status(kUnknownError, "failed to find an open port for Chrome");
@@ -108,67 +120,182 @@
         Status(kUnknownError, "unable to discover open window in chrome");
   }
 
-  std::string new_id = session_id;
-  if (new_id.empty())
-    new_id = GenerateId();
-  scoped_ptr<Session> session(new Session(new_id, chrome.Pass()));
+  scoped_ptr<Session> session(new Session(session_id, chrome.Pass()));
   session->devtools_logs.swap(devtools_logs);
-  if (!session->thread.Start()) {
-    chrome->Quit();
-    return Status(kUnknownError,
-                  "failed to start a thread for the new session");
-  }
   session->window = web_view_ids.front();
   session->detach = capabilities.detach;
   out_value->reset(session->capabilities->DeepCopy());
-  *out_session_id = new_id;
-
-  scoped_refptr<SessionAccessor> accessor(
-      new SessionAccessorImpl(session.Pass()));
-  bound_params.session_map->Set(new_id, accessor);
-
+  lazy_tls_session.Pointer()->Set(session.release());
   return Status(kOk);
 }
 
-Status ExecuteQuit(
-    bool allow_detach,
-    SessionMap* session_map,
+void CreateSessionOnSessionThread(
+    const scoped_refptr<base::SingleThreadTaskRunner>& cmd_task_runner,
+    const NewSessionParams& bound_params,
+    scoped_ptr<base::DictionaryValue> params,
+    const std::string& session_id,
+    const CommandCallback& callback_on_cmd) {
+  scoped_ptr<base::Value> value;
+  Status status = CreateSessionOnSessionThreadHelper(
+      bound_params, *params, session_id, &value);
+  cmd_task_runner->PostTask(
+      FROM_HERE,
+      base::Bind(callback_on_cmd, status, base::Passed(&value), session_id));
+}
+
+}  // namespace
+
+void ExecuteNewSession(
+    const NewSessionParams& bound_params,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id) {
-  *out_session_id = session_id;
-  scoped_refptr<SessionAccessor> session_accessor;
-  if (!session_map->Get(session_id, &session_accessor))
-    return Status(kOk);
-  scoped_ptr<base::AutoLock> session_lock;
-  Session* session = session_accessor->Access(&session_lock);
-  if (!session)
-    return Status(kOk);
-  CHECK(session_map->Remove(session->id));
-  if (allow_detach && session->detach) {
-    session_accessor->DeleteSession();
-    return Status(kOk);
+    const CommandCallback& callback) {
+  std::string new_id = session_id;
+  if (new_id.empty())
+    new_id = GenerateId();
+  scoped_ptr<base::Thread> thread(new base::Thread(new_id.c_str()));
+  if (!thread->Start()) {
+    callback.Run(
+        Status(kUnknownError, "failed to start a thread for the new session"),
+        scoped_ptr<base::Value>(),
+        std::string());
+    return;
+  }
+
+  thread->message_loop()
+      ->PostTask(FROM_HERE,
+                 base::Bind(&CreateSessionOnSessionThread,
+                            base::MessageLoopProxy::current(),
+                            bound_params,
+                            base::Passed(make_scoped_ptr(params.DeepCopy())),
+                            new_id,
+                            callback));
+  bound_params.session_thread_map
+      ->insert(std::make_pair(new_id, make_linked_ptr(thread.release())));
+}
+
+namespace {
+
+void OnSessionQuit(const base::WeakPtr<size_t>& quit_remaining_count,
+                   const base::Closure& all_quit_func,
+                   const Status& status,
+                   scoped_ptr<base::Value> value,
+                   const std::string& session_id) {
+  // |quit_remaining_count| may no longer be valid if a timeout occurred.
+  if (!quit_remaining_count)
+    return;
+
+  (*quit_remaining_count)--;
+  if (!*quit_remaining_count)
+    all_quit_func.Run();
+}
+
+}  // namespace
+
+void ExecuteQuitAll(
+    const Command& quit_command,
+    SessionThreadMap* session_thread_map,
+    const base::DictionaryValue& params,
+    const std::string& session_id,
+    const CommandCallback& callback) {
+  size_t quit_remaining_count = session_thread_map->size();
+  base::WeakPtrFactory<size_t> weak_ptr_factory(&quit_remaining_count);
+  if (!quit_remaining_count) {
+    callback.Run(Status(kOk), scoped_ptr<base::Value>(), session_id);
+    return;
+  }
+  base::RunLoop run_loop;
+  for (SessionThreadMap::const_iterator iter = session_thread_map->begin();
+       iter != session_thread_map->end();
+       ++iter) {
+    quit_command.Run(params,
+                     iter->first,
+                     base::Bind(&OnSessionQuit,
+                                weak_ptr_factory.GetWeakPtr(),
+                                run_loop.QuitClosure()));
+  }
+  base::MessageLoop::current()->PostDelayedTask(
+      FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10));
+  // Uses a nested run loop to block this thread until all the quit
+  // commands have executed, or the timeout expires.
+  base::MessageLoop::current()->SetNestableTasksAllowed(true);
+  run_loop.Run();
+  callback.Run(Status(kOk), scoped_ptr<base::Value>(), session_id);
+}
+
+namespace {
+
+void TerminateSessionThreadOnCommandThread(SessionThreadMap* session_thread_map,
+                                           const std::string& session_id) {
+  session_thread_map->erase(session_id);
+}
+
+void ExecuteSessionCommandOnSessionThread(
+    const SessionCommand& command,
+    bool return_ok_without_session,
+    scoped_ptr<base::DictionaryValue> params,
+    scoped_refptr<base::SingleThreadTaskRunner> cmd_task_runner,
+    const CommandCallback& callback_on_cmd,
+    const base::Closure& terminate_on_cmd) {
+  Session* session = lazy_tls_session.Pointer()->Get();
+  if (!session) {
+    cmd_task_runner->PostTask(
+        FROM_HERE,
+        base::Bind(callback_on_cmd,
+                   Status(return_ok_without_session ? kOk : kNoSuchSession),
+                   base::Passed(scoped_ptr<base::Value>()),
+                   std::string()));
+    return;
+  }
+
+  scoped_ptr<base::Value> value;
+  Status status = command.Run(session, *params, &value);
+  if (status.IsError() && session->chrome)
+    status.AddDetails("Session info: chrome=" + session->chrome->GetVersion());
+
+  cmd_task_runner->PostTask(
+      FROM_HERE,
+      base::Bind(callback_on_cmd, status, base::Passed(&value), session->id));
+
+  if (session->quit) {
+    lazy_tls_session.Pointer()->Set(NULL);
+    delete session;
+    cmd_task_runner->PostTask(FROM_HERE, terminate_on_cmd);
+  }
+}
+
+}  // namespace
+
+void ExecuteSessionCommand(
+    SessionThreadMap* session_thread_map,
+    const SessionCommand& command,
+    bool return_ok_without_session,
+    const base::DictionaryValue& params,
+    const std::string& session_id,
+    const CommandCallback& callback) {
+  SessionThreadMap::iterator iter = session_thread_map->find(session_id);
+  if (iter == session_thread_map->end()) {
+    Status status(return_ok_without_session ? kOk : kNoSuchSession);
+    callback.Run(status, scoped_ptr<base::Value>(), session_id);
   } else {
-    Status status = session->chrome->Quit();
-    session_accessor->DeleteSession();
-    return status;
+    iter->second->message_loop()
+        ->PostTask(FROM_HERE,
+                   base::Bind(&ExecuteSessionCommandOnSessionThread,
+                              command,
+                              return_ok_without_session,
+                              base::Passed(make_scoped_ptr(params.DeepCopy())),
+                              base::MessageLoopProxy::current(),
+                              callback,
+                              base::Bind(&TerminateSessionThreadOnCommandThread,
+                                         session_thread_map,
+                                         session_id)));
   }
 }
 
-Status ExecuteQuitAll(
-    Command quit_command,
-    SessionMap* session_map,
-    const base::DictionaryValue& params,
-    const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id) {
-  std::vector<std::string> session_ids;
-  session_map->GetKeys(&session_ids);
-  for (size_t i = 0; i < session_ids.size(); ++i) {
-    scoped_ptr<base::Value> unused_value;
-    std::string unused_session_id;
-    quit_command.Run(params, session_ids[i], &unused_value, &unused_session_id);
-  }
-  return Status(kOk);
+namespace internal {
+
+void CreateSessionOnSessionThreadForTesting(const std::string& id) {
+  lazy_tls_session.Pointer()->Set(new Session(id));
 }
+
+}  // namespace internal
diff --git a/chrome/test/chromedriver/commands.h b/chrome/test/chromedriver/commands.h
index 2e624e4..e69764c 100644
--- a/chrome/test/chromedriver/commands.h
+++ b/chrome/test/chromedriver/commands.h
@@ -12,7 +12,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "chrome/test/chromedriver/command.h"
 #include "chrome/test/chromedriver/net/sync_websocket_factory.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
 
 namespace base {
 class DictionaryValue;
@@ -21,55 +21,63 @@
 
 class DeviceManager;
 class Log;
+struct Session;
 class Status;
 class URLRequestContextGetter;
 
 // Gets status/info about ChromeDriver.
-Status ExecuteGetStatus(
+void ExecuteGetStatus(
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id);
+    const CommandCallback& callback);
 
 struct NewSessionParams {
   NewSessionParams(Log* log,
-                   SessionMap* session_map,
+                   SessionThreadMap* session_thread_map,
                    scoped_refptr<URLRequestContextGetter> context_getter,
                    const SyncWebSocketFactory& socket_factory,
                    DeviceManager* device_manager);
   ~NewSessionParams();
 
   Log* log;
-  SessionMap* session_map;
+  SessionThreadMap* session_thread_map;
   scoped_refptr<URLRequestContextGetter> context_getter;
   SyncWebSocketFactory socket_factory;
   DeviceManager* device_manager;
 };
 
 // Creates a new session.
-Status ExecuteNewSession(
+void ExecuteNewSession(
     const NewSessionParams& bound_params,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id);
-
-// Quits a particular session.
-Status ExecuteQuit(
-    bool allow_detach,
-    SessionMap* session_map,
-    const base::DictionaryValue& params,
-    const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id);
+    const CommandCallback& callback);
 
 // Quits all sessions.
-Status ExecuteQuitAll(
-    Command quit_command,
-    SessionMap* session_map,
+void ExecuteQuitAll(
+    const Command& quit_command,
+    SessionThreadMap* session_thread_map,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id);
+    const CommandCallback& callback);
+
+typedef base::Callback<Status(
+    Session* session,
+    const base::DictionaryValue&,
+    scoped_ptr<base::Value>*)> SessionCommand;
+
+// Executes a given session command, after acquiring access to the appropriate
+// session.
+void ExecuteSessionCommand(
+    SessionThreadMap* session_thread_map,
+    const SessionCommand& command,
+    bool return_ok_without_session,
+    const base::DictionaryValue& params,
+    const std::string& session_id,
+    const CommandCallback& callback);
+
+namespace internal {
+void CreateSessionOnSessionThreadForTesting(const std::string& id);
+}  // namespace internal
 
 #endif  // CHROME_TEST_CHROMEDRIVER_COMMANDS_H_
diff --git a/chrome/test/chromedriver/commands_unittest.cc b/chrome/test/chromedriver/commands_unittest.cc
index 5e7ea33..064fb95 100644
--- a/chrome/test/chromedriver/commands_unittest.cc
+++ b/chrome/test/chromedriver/commands_unittest.cc
@@ -9,7 +9,10 @@
 #include "base/compiler_specific.h"
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/synchronization/lock.h"
+#include "base/threading/thread.h"
 #include "base/values.h"
 #include "chrome/test/chromedriver/chrome/status.h"
 #include "chrome/test/chromedriver/chrome/stub_chrome.h"
@@ -17,18 +20,18 @@
 #include "chrome/test/chromedriver/chrome/web_view.h"
 #include "chrome/test/chromedriver/commands.h"
 #include "chrome/test/chromedriver/element_commands.h"
-#include "chrome/test/chromedriver/fake_session_accessor.h"
+#include "chrome/test/chromedriver/session.h"
 #include "chrome/test/chromedriver/session_commands.h"
 #include "chrome/test/chromedriver/window_commands.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/webdriver/atoms.h"
 
-TEST(CommandsTest, GetStatus) {
-  base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string session_id;
-  ASSERT_EQ(
-      kOk, ExecuteGetStatus(params, std::string(), &value, &session_id).code());
+namespace {
+
+void OnGetStatus(const Status& status,
+                 scoped_ptr<base::Value> value,
+                 const std::string& session_id) {
+  ASSERT_EQ(kOk, status.code());
   base::DictionaryValue* dict;
   ASSERT_TRUE(value->GetAsDictionary(&dict));
   base::Value* unused;
@@ -38,145 +41,188 @@
   ASSERT_TRUE(dict->Get("build.version", &unused));
 }
 
+}  // namespace
+
+TEST(CommandsTest, GetStatus) {
+  base::DictionaryValue params;
+  ExecuteGetStatus(params, std::string(), base::Bind(&OnGetStatus));
+}
+
 namespace {
 
-Status ExecuteStubQuit(
+void ExecuteStubQuit(
     int* count,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* value,
-    std::string* out_session_id) {
+    const CommandCallback& callback) {
   if (*count == 0) {
     EXPECT_STREQ("id", session_id.c_str());
   } else {
     EXPECT_STREQ("id2", session_id.c_str());
   }
   (*count)++;
-  return Status(kOk);
+  callback.Run(Status(kOk), scoped_ptr<base::Value>(), session_id);
+}
+
+void OnQuitAll(const Status& status,
+               scoped_ptr<base::Value> value,
+               const std::string& session_id) {
+  ASSERT_EQ(kOk, status.code());
+  ASSERT_FALSE(value.get());
 }
 
 }  // namespace
 
 TEST(CommandsTest, QuitAll) {
-  SessionMap map;
+  SessionThreadMap map;
   Session session("id");
   Session session2("id2");
-  map.Set(session.id,
-          scoped_refptr<SessionAccessor>(new FakeSessionAccessor(&session)));
-  map.Set(session2.id,
-          scoped_refptr<SessionAccessor>(new FakeSessionAccessor(&session2)));
+  map[session.id] = make_linked_ptr(new base::Thread("1"));
+  map[session2.id] = make_linked_ptr(new base::Thread("2"));
 
   int count = 0;
   Command cmd = base::Bind(&ExecuteStubQuit, &count);
   base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string session_id;
-  Status status =
-      ExecuteQuitAll(cmd, &map, params, std::string(), &value, &session_id);
-  ASSERT_EQ(kOk, status.code());
-  ASSERT_FALSE(value.get());
+  base::MessageLoop loop;
+  ExecuteQuitAll(cmd, &map, params, std::string(), base::Bind(&OnQuitAll));
   ASSERT_EQ(2, count);
 }
 
-TEST(CommandsTest, Quit) {
-  SessionMap map;
-  Session session("id", scoped_ptr<Chrome>(new StubChrome()));
-  scoped_refptr<FakeSessionAccessor> session_accessor(
-      new FakeSessionAccessor(&session));
-  map.Set(session.id, session_accessor);
+namespace {
+
+Status ExecuteSimpleCommand(
+    const std::string& expected_id,
+    base::DictionaryValue* expected_params,
+    base::Value* value,
+    Session* session,
+    const base::DictionaryValue& params,
+    scoped_ptr<base::Value>* return_value) {
+  EXPECT_EQ(expected_id, session->id);
+  EXPECT_TRUE(expected_params->Equals(&params));
+  return_value->reset(value->DeepCopy());
+  session->quit = true;
+  return Status(kOk);
+}
+
+void OnSimpleCommand(base::RunLoop* run_loop,
+                     const std::string& expected_session_id,
+                     base::Value* expected_value,
+                     const Status& status,
+                     scoped_ptr<base::Value> value,
+                     const std::string& session_id) {
+  ASSERT_EQ(kOk, status.code());
+  ASSERT_TRUE(expected_value->Equals(value.get()));
+  ASSERT_EQ(expected_session_id, session_id);
+  run_loop->Quit();
+}
+
+}  // namespace
+
+TEST(CommandsTest, ExecuteSessionCommand) {
+  SessionThreadMap map;
+  linked_ptr<base::Thread> thread(new base::Thread("1"));
+  ASSERT_TRUE(thread->Start());
+  std::string id("id");
+  thread->message_loop()->PostTask(
+      FROM_HERE,
+      base::Bind(&internal::CreateSessionOnSessionThreadForTesting, id));
+  map[id] = thread;
+
   base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string out_session_id;
-  ASSERT_EQ(kOk,
-            ExecuteQuit(false, &map, params, session.id, &value,
-                        &out_session_id).code());
-  ASSERT_FALSE(map.Has(session.id));
-  ASSERT_TRUE(session_accessor->IsSessionDeleted());
-  ASSERT_FALSE(value.get());
+  params.SetInteger("param", 5);
+  base::FundamentalValue expected_value(6);
+  SessionCommand cmd = base::Bind(
+      &ExecuteSimpleCommand, id, &params, &expected_value);
+
+  base::MessageLoop loop;
+  base::RunLoop run_loop;
+  ExecuteSessionCommand(
+      &map,
+      cmd,
+      false,
+      params,
+      id,
+      base::Bind(&OnSimpleCommand, &run_loop, id, &expected_value));
+  run_loop.Run();
 }
 
 namespace {
 
-class DetachChrome : public StubChrome {
- public:
-  DetachChrome() : quit_called(false) {}
-  virtual ~DetachChrome() {}
+Status ShouldNotBeCalled(
+    Session* session,
+    const base::DictionaryValue& params,
+    scoped_ptr<base::Value>* value) {
+  EXPECT_TRUE(false);
+  return Status(kOk);
+}
 
-  bool IsQuitCalled() {
-    return quit_called;
-  }
+void OnNoSuchSession(const Status& status,
+                     scoped_ptr<base::Value> value,
+                     const std::string& session_id) {
+  EXPECT_EQ(kNoSuchSession, status.code());
+  EXPECT_FALSE(value.get());
+}
 
-  // Overridden from Chrome:
-  virtual Status Quit() OVERRIDE {
-    quit_called = true;
-    return Status(kOk);
-  }
-
- private:
-  bool quit_called;
-};
+void OnNoSuchSessionIsOk(const Status& status,
+                         scoped_ptr<base::Value> value,
+                         const std::string& session_id) {
+  EXPECT_EQ(kOk, status.code());
+  EXPECT_FALSE(value.get());
+}
 
 }  // namespace
 
-TEST(CommandsTest, QuitWhenDetach) {
-  SessionMap map;
-  DetachChrome* chrome = new DetachChrome();
-  Session session("id", scoped_ptr<Chrome>(chrome));
-  session.detach = true;
-
-  scoped_refptr<FakeSessionAccessor> session_accessor(
-      new FakeSessionAccessor(&session));
+TEST(CommandsTest, ExecuteSessionCommandOnNoSuchSession) {
+  SessionThreadMap map;
   base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string out_session_id;
+  ExecuteSessionCommand(&map,
+                        base::Bind(&ShouldNotBeCalled),
+                        false,
+                        params,
+                        "session",
+                        base::Bind(&OnNoSuchSession));
+}
 
-  map.Set(session.id, session_accessor);
-  ASSERT_EQ(kOk,
-            ExecuteQuit(true, &map, params, session.id, &value,
-                        &out_session_id).code());
-  ASSERT_FALSE(map.Has(session.id));
-  ASSERT_FALSE(value.get());
-  ASSERT_FALSE(chrome->IsQuitCalled());
-
-  map.Set(session.id, session_accessor);
-  ASSERT_EQ(kOk,
-            ExecuteQuit(false, &map, params, session.id, &value,
-                        &out_session_id).code());
-  ASSERT_FALSE(map.Has(session.id));
-  ASSERT_FALSE(value.get());
-  ASSERT_TRUE(chrome->IsQuitCalled());
+TEST(CommandsTest, ExecuteSessionCommandOnNoSuchSessionWhenItExpectsOk) {
+  SessionThreadMap map;
+  base::DictionaryValue params;
+  ExecuteSessionCommand(&map,
+                        base::Bind(&ShouldNotBeCalled),
+                        true,
+                        params,
+                        "session",
+                        base::Bind(&OnNoSuchSessionIsOk));
 }
 
 namespace {
 
-class FailsToQuitChrome : public StubChrome {
- public:
-  FailsToQuitChrome() {}
-  virtual ~FailsToQuitChrome() {}
-
-  // Overridden from Chrome:
-  virtual Status Quit() OVERRIDE {
-    return Status(kUnknownError);
-  }
-};
+void OnNoSuchSessionAndQuit(base::RunLoop* run_loop,
+                            const Status& status,
+                            scoped_ptr<base::Value> value,
+                            const std::string& session_id) {
+  run_loop->Quit();
+  EXPECT_EQ(kNoSuchSession, status.code());
+  EXPECT_FALSE(value.get());
+}
 
 }  // namespace
 
-TEST(CommandsTest, QuitFails) {
-  SessionMap map;
-  Session session("id", scoped_ptr<Chrome>(new FailsToQuitChrome()));
-  scoped_refptr<FakeSessionAccessor> session_accessor(
-      new FakeSessionAccessor(&session));
-  map.Set(session.id, session_accessor);
-  base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string out_session_id;
-  ASSERT_EQ(kUnknownError,
-            ExecuteQuit(false, &map, params, session.id, &value,
-                        &out_session_id).code());
-  ASSERT_FALSE(map.Has(session.id));
-  ASSERT_TRUE(session_accessor->IsSessionDeleted());
-  ASSERT_FALSE(value.get());
+TEST(CommandsTest, ExecuteSessionCommandOnJustDeletedSession) {
+  SessionThreadMap map;
+  linked_ptr<base::Thread> thread(new base::Thread("1"));
+  ASSERT_TRUE(thread->Start());
+  std::string id("id");
+  map[id] = thread;
+
+  base::MessageLoop loop;
+  base::RunLoop run_loop;
+  ExecuteSessionCommand(&map,
+                        base::Bind(&ShouldNotBeCalled),
+                        false,
+                        base::DictionaryValue(),
+                        "session",
+                        base::Bind(&OnNoSuchSessionAndQuit, &run_loop));
+  run_loop.Run();
 }
 
 namespace {
diff --git a/chrome/test/chromedriver/fake_session_accessor.cc b/chrome/test/chromedriver/fake_session_accessor.cc
deleted file mode 100644
index 2114e22..0000000
--- a/chrome/test/chromedriver/fake_session_accessor.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/chromedriver/fake_session_accessor.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-FakeSessionAccessor::FakeSessionAccessor(Session* session)
-    : session_(session),
-      is_accessed_(false),
-      is_session_deleted_(false) {}
-
-Session* FakeSessionAccessor::Access(
-    scoped_ptr<base::AutoLock>* lock) {
-  is_accessed_ = true;
-  return session_;
-}
-
-bool FakeSessionAccessor::IsSessionDeleted() const {
-  return is_session_deleted_;
-}
-
-void FakeSessionAccessor::DeleteSession() {
-  ASSERT_TRUE(is_accessed_);
-  is_session_deleted_ = true;
-}
-
-FakeSessionAccessor::~FakeSessionAccessor() {}
diff --git a/chrome/test/chromedriver/fake_session_accessor.h b/chrome/test/chromedriver/fake_session_accessor.h
deleted file mode 100644
index b9b5275..0000000
--- a/chrome/test/chromedriver/fake_session_accessor.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_TEST_CHROMEDRIVER_FAKE_SESSION_ACCESSOR_H_
-#define CHROME_TEST_CHROMEDRIVER_FAKE_SESSION_ACCESSOR_H_
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/test/chromedriver/session.h"
-
-namespace base {
-class AutoLock;
-}
-
-// Fake session accessor that doesn't actually lock.
-class FakeSessionAccessor : public SessionAccessor {
- public:
-  explicit FakeSessionAccessor(Session* session);
-
-  bool IsSessionDeleted() const;
-
-  // Overridden from SessionAccessor:
-  virtual Session* Access(scoped_ptr<base::AutoLock>* lock) OVERRIDE;
-  virtual void DeleteSession() OVERRIDE;
-
- private:
-  virtual ~FakeSessionAccessor();
-
-  Session* session_;
-  bool is_accessed_;
-  bool is_session_deleted_;
-};
-
-#endif  // CHROME_TEST_CHROMEDRIVER_FAKE_SESSION_ACCESSOR_H_
diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc
index 75cc9c2..1da71e8 100644
--- a/chrome/test/chromedriver/server/chromedriver_server.cc
+++ b/chrome/test/chromedriver/server/chromedriver_server.cc
@@ -7,14 +7,18 @@
 #include <vector>
 
 #include "base/at_exit.h"
+#include "base/bind.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
 #include "chrome/test/chromedriver/chrome/log.h"
 #include "chrome/test/chromedriver/chrome/version.h"
 #include "chrome/test/chromedriver/server/http_handler.h"
@@ -29,6 +33,23 @@
 
 namespace {
 
+void SendHttpResponse(bool shutdown,
+                      const HttpResponseSenderFunc& send_response_func,
+                      scoped_ptr<HttpResponse> response) {
+  send_response_func.Run(response.Pass());
+  if (shutdown)
+    base::MessageLoop::current()->QuitWhenIdle();
+}
+
+void HandleHttpRequest(HttpHandler* handler,
+                       const net::HttpServerRequestInfo& request,
+                       const HttpResponseSenderFunc& send_response_func) {
+  handler->Handle(request,
+                  base::Bind(&SendHttpResponse,
+                             handler->ShouldShutdown(request),
+                             send_response_func));
+}
+
 void ReadRequestBody(const struct mg_request_info* const request_info,
                      struct mg_connection* const connection,
                      std::string* request_body) {
@@ -56,11 +77,22 @@
   }
 }
 
+typedef base::Callback<
+    void(const net::HttpServerRequestInfo&, const HttpResponseSenderFunc&)>
+    HttpRequestHandlerFunc;
+
 struct MongooseUserData {
-  HttpHandler* handler;
-  base::WaitableEvent* shutdown_event;
+  base::SingleThreadTaskRunner* cmd_task_runner;
+  HttpRequestHandlerFunc* handler_func;
 };
 
+void DoneProcessing(base::WaitableEvent* event,
+                    scoped_ptr<HttpResponse>* response_to_set,
+                    scoped_ptr<HttpResponse> response) {
+  *response_to_set = response.Pass();
+  event->Signal();
+}
+
 void* ProcessHttpRequest(mg_event event_raised,
                          struct mg_connection* connection,
                          const struct mg_request_info* request_info) {
@@ -74,16 +106,20 @@
   request.path = request_info->uri;
   ReadRequestBody(request_info, connection, &request.data);
 
-  HttpResponse response;
-  user_data->handler->Handle(request, &response);
+  base::WaitableEvent event(false, false);
+  scoped_ptr<HttpResponse> response;
+  user_data->cmd_task_runner
+      ->PostTask(FROM_HERE,
+                 base::Bind(*user_data->handler_func,
+                            request,
+                            base::Bind(&DoneProcessing, &event, &response)));
+  event.Wait();
 
   // Don't allow HTTP keep alive.
-  response.AddHeader("connection", "close");
+  response->AddHeader("connection", "close");
   std::string data;
-  response.GetData(&data);
+  response->GetData(&data);
   mg_write(connection, data.data(), data.length());
-  if (user_data->handler->ShouldShutdown(request))
-    user_data->shutdown_event->Signal();
   return reinterpret_cast<void*>(true);
 }
 
@@ -103,7 +139,7 @@
 int main(int argc, char *argv[]) {
   CommandLine::Init(argc, argv);
 
-  base::AtExitManager exit;
+  base::AtExitManager at_exit;
   CommandLine* cmd_line = CommandLine::ForCurrentProcess();
 
   // Parse command line flags.
@@ -175,10 +211,16 @@
   if (!cmd_line->HasSwitch("verbose"))
     logging::SetMinLogLevel(logging::LOG_FATAL);
 
+  base::Thread io_thread("ChromeDriver IO");
+  CHECK(io_thread.StartWithOptions(
+      base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
+
   scoped_ptr<Log> log(new Logger(log_level));
-  HttpHandler handler(log.get(), url_base);
-  base::WaitableEvent shutdown_event(false, false);
-  MongooseUserData user_data = { &handler, &shutdown_event };
+  HttpHandler handler(io_thread.message_loop_proxy(), log.get(), url_base);
+  base::MessageLoop cmd_loop;
+  HttpRequestHandlerFunc handler_func =
+      base::Bind(&HandleHttpRequest, &handler);
+  MongooseUserData user_data = { cmd_loop.message_loop_proxy(), &handler_func };
 
   std::vector<std::string> args;
   MakeMongooseOptions(port, http_threads, &args);
@@ -210,8 +252,10 @@
   }
 #endif
 
-  // Run until we receive command to shutdown.
-  shutdown_event.Wait();
-
-  return 0;
+  base::RunLoop cmd_run_loop;
+  cmd_run_loop.Run();
+  // Don't run destructors for objects passed via MongooseUserData,
+  // because ProcessHttpRequest may be accessing them.
+  // TODO(kkania): Fix when switching to net::HttpServer.
+  exit(0);
 }
diff --git a/chrome/test/chromedriver/server/http_handler.cc b/chrome/test/chromedriver/server/http_handler.cc
index fb408b6..4699b93 100644
--- a/chrome/test/chromedriver/server/http_handler.cc
+++ b/chrome/test/chromedriver/server/http_handler.cc
@@ -23,15 +23,11 @@
 #include "chrome/test/chromedriver/chrome/log.h"
 #include "chrome/test/chromedriver/chrome/status.h"
 #include "chrome/test/chromedriver/chrome/version.h"
-#include "chrome/test/chromedriver/commands.h"
-#include "chrome/test/chromedriver/element_commands.h"
 #include "chrome/test/chromedriver/net/url_request_context_getter.h"
 #include "chrome/test/chromedriver/server/http_response.h"
 #include "chrome/test/chromedriver/session.h"
-#include "chrome/test/chromedriver/session_commands.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
 #include "chrome/test/chromedriver/util.h"
-#include "chrome/test/chromedriver/window_commands.h"
 #include "net/server/http_server_request_info.h"
 
 #if defined(OS_MACOSX)
@@ -44,12 +40,11 @@
 const char kSessionStorage[] = "sessionStorage";
 const char kShutdownPath[] = "shutdown";
 
-Status UnimplementedCommand(
+void UnimplementedCommand(
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* value,
-    std::string* out_session_id) {
-  return Status(kUnknownCommand);
+    const CommandCallback& callback) {
+  callback.Run(Status(kUnknownCommand), scoped_ptr<base::Value>(), session_id);
 }
 
 }  // namespace
@@ -63,294 +58,411 @@
 
 HttpHandler::HttpHandler(Log* log, const std::string& url_base)
     : log_(log),
-      io_thread_("ChromeDriver IO"),
-      url_base_(url_base) {
+      url_base_(url_base),
+      received_shutdown_(false),
+      command_map_(new CommandMap()),
+      weak_ptr_factory_(this) {}
+
+HttpHandler::HttpHandler(
+    const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+    Log* log,
+    const std::string& url_base)
+    : log_(log),
+      url_base_(url_base),
+      received_shutdown_(false),
+      weak_ptr_factory_(this) {
 #if defined(OS_MACOSX)
   base::mac::ScopedNSAutoreleasePool autorelease_pool;
 #endif
-  base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
-  CHECK(io_thread_.StartWithOptions(options));
-  context_getter_ = new URLRequestContextGetter(
-      io_thread_.message_loop_proxy());
+  context_getter_ = new URLRequestContextGetter(io_task_runner);
   socket_factory_ = CreateSyncWebSocketFactory(context_getter_.get());
-  adb_.reset(new AdbImpl(io_thread_.message_loop_proxy(), log_));
+  adb_.reset(new AdbImpl(io_task_runner, log_));
   device_manager_.reset(new DeviceManager(adb_.get()));
 
   CommandMapping commands[] = {
-      CommandMapping(kPost, internal::kNewSessionPathPattern,
+      CommandMapping(kPost,
+                     internal::kNewSessionPathPattern,
                      base::Bind(&ExecuteNewSession,
-                                NewSessionParams(log_, &session_map_,
-                                    context_getter_, socket_factory_,
-                                    device_manager_.get()))),
-      CommandMapping(kGet, "session/:sessionId",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetSessionCapabilities,
-                             &session_map_))),
-      CommandMapping(kDelete, "session/:sessionId",
-                     base::Bind(&ExecuteQuit, false, &session_map_)),
-      CommandMapping(kGet, "session/:sessionId/window_handle",
+                                NewSessionParams(log_,
+                                                 &session_thread_map_,
+                                                 context_getter_,
+                                                 socket_factory_,
+                                                 device_manager_.get()))),
+      CommandMapping(kGet,
+                     "session/:sessionId",
+                     WrapToCommand(base::Bind(&ExecuteGetSessionCapabilities))),
+      CommandMapping(kDelete,
+                     "session/:sessionId",
+                     base::Bind(&ExecuteSessionCommand,
+                                &session_thread_map_,
+                                base::Bind(&ExecuteQuit, false),
+                                true)),
+      CommandMapping(kGet,
+                     "session/:sessionId/window_handle",
                      WrapToCommand(base::Bind(&ExecuteGetCurrentWindowHandle))),
-      CommandMapping(kGet, "session/:sessionId/window_handles",
+      CommandMapping(kGet,
+                     "session/:sessionId/window_handles",
                      WrapToCommand(base::Bind(&ExecuteGetWindowHandles))),
-      CommandMapping(kPost, "session/:sessionId/url",
+      CommandMapping(kPost,
+                     "session/:sessionId/url",
                      WrapToCommand(base::Bind(&ExecuteGet))),
-      CommandMapping(kGet, "session/:sessionId/alert",
-                     WrapToCommand(
-                         base::Bind(&ExecuteAlertCommand,
-                                     base::Bind(&ExecuteGetAlert)))),
-      CommandMapping(kPost, "session/:sessionId/dismiss_alert",
-                     WrapToCommand(
-                         base::Bind(&ExecuteAlertCommand,
-                                    base::Bind(&ExecuteDismissAlert)))),
-      CommandMapping(kPost, "session/:sessionId/accept_alert",
-                     WrapToCommand(
-                         base::Bind(&ExecuteAlertCommand,
-                                    base::Bind(&ExecuteAcceptAlert)))),
-      CommandMapping(kGet, "session/:sessionId/alert_text",
-                     WrapToCommand(
-                         base::Bind(&ExecuteAlertCommand,
-                                    base::Bind(&ExecuteGetAlertText)))),
-      CommandMapping(kPost, "session/:sessionId/alert_text",
-                     WrapToCommand(
-                         base::Bind(&ExecuteAlertCommand,
-                                    base::Bind(&ExecuteSetAlertValue)))),
-      CommandMapping(kPost, "session/:sessionId/forward",
+      CommandMapping(kGet,
+                     "session/:sessionId/alert",
+                     WrapToCommand(base::Bind(&ExecuteAlertCommand,
+                                              base::Bind(&ExecuteGetAlert)))),
+      CommandMapping(
+          kPost,
+          "session/:sessionId/dismiss_alert",
+          WrapToCommand(base::Bind(&ExecuteAlertCommand,
+                                   base::Bind(&ExecuteDismissAlert)))),
+      CommandMapping(
+          kPost,
+          "session/:sessionId/accept_alert",
+          WrapToCommand(base::Bind(&ExecuteAlertCommand,
+                                   base::Bind(&ExecuteAcceptAlert)))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/alert_text",
+          WrapToCommand(base::Bind(&ExecuteAlertCommand,
+                                   base::Bind(&ExecuteGetAlertText)))),
+      CommandMapping(
+          kPost,
+          "session/:sessionId/alert_text",
+          WrapToCommand(base::Bind(&ExecuteAlertCommand,
+                                   base::Bind(&ExecuteSetAlertValue)))),
+      CommandMapping(kPost,
+                     "session/:sessionId/forward",
                      WrapToCommand(base::Bind(&ExecuteGoForward))),
-      CommandMapping(kPost, "session/:sessionId/back",
+      CommandMapping(kPost,
+                     "session/:sessionId/back",
                      WrapToCommand(base::Bind(&ExecuteGoBack))),
-      CommandMapping(kPost, "session/:sessionId/refresh",
+      CommandMapping(kPost,
+                     "session/:sessionId/refresh",
                      WrapToCommand(base::Bind(&ExecuteRefresh))),
-      CommandMapping(kPost, "session/:sessionId/execute",
+      CommandMapping(kPost,
+                     "session/:sessionId/execute",
                      WrapToCommand(base::Bind(&ExecuteExecuteScript))),
-      CommandMapping(kPost, "session/:sessionId/execute_async",
+      CommandMapping(kPost,
+                     "session/:sessionId/execute_async",
                      WrapToCommand(base::Bind(&ExecuteExecuteAsyncScript))),
-      CommandMapping(kGet, "session/:sessionId/url",
+      CommandMapping(kGet,
+                     "session/:sessionId/url",
                      WrapToCommand(base::Bind(&ExecuteGetCurrentUrl))),
-      CommandMapping(kGet, "session/:sessionId/title",
+      CommandMapping(kGet,
+                     "session/:sessionId/title",
                      WrapToCommand(base::Bind(&ExecuteGetTitle))),
-      CommandMapping(kGet, "session/:sessionId/source",
+      CommandMapping(kGet,
+                     "session/:sessionId/source",
                      WrapToCommand(base::Bind(&ExecuteGetPageSource))),
-      CommandMapping(kGet, "session/:sessionId/screenshot",
+      CommandMapping(kGet,
+                     "session/:sessionId/screenshot",
                      WrapToCommand(base::Bind(&ExecuteScreenshot))),
-      CommandMapping(kPost, "session/:sessionId/visible",
+      CommandMapping(kPost,
+                     "session/:sessionId/visible",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/visible",
+      CommandMapping(kGet,
+                     "session/:sessionId/visible",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/element",
+      CommandMapping(kPost,
+                     "session/:sessionId/element",
                      WrapToCommand(base::Bind(&ExecuteFindElement, 50))),
-      CommandMapping(kPost, "session/:sessionId/elements",
+      CommandMapping(kPost,
+                     "session/:sessionId/elements",
                      WrapToCommand(base::Bind(&ExecuteFindElements, 50))),
-      CommandMapping(kPost, "session/:sessionId/element/active",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/active",
                      WrapToCommand(base::Bind(&ExecuteGetActiveElement))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/element",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/element",
                      WrapToCommand(base::Bind(&ExecuteFindChildElement, 50))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/elements",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/elements",
                      WrapToCommand(base::Bind(&ExecuteFindChildElements, 50))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/click",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/click",
                      WrapToCommand(base::Bind(&ExecuteClickElement))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/clear",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/clear",
                      WrapToCommand(base::Bind(&ExecuteClearElement))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/submit",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/submit",
                      WrapToCommand(base::Bind(&ExecuteSubmitElement))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/text",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/text",
                      WrapToCommand(base::Bind(&ExecuteGetElementText))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/value",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/value",
                      WrapToCommand(base::Bind(&ExecuteSendKeysToElement))),
-      CommandMapping(kPost, "session/:sessionId/file",
+      CommandMapping(kPost,
+                     "session/:sessionId/file",
                      WrapToCommand(base::Bind(&ExecuteUploadFile))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/value",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/value",
                      WrapToCommand(base::Bind(&ExecuteGetElementValue))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/name",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/name",
                      WrapToCommand(base::Bind(&ExecuteGetElementTagName))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/selected",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/selected",
                      WrapToCommand(base::Bind(&ExecuteIsElementSelected))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/enabled",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/enabled",
                      WrapToCommand(base::Bind(&ExecuteIsElementEnabled))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/displayed",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/displayed",
                      WrapToCommand(base::Bind(&ExecuteIsElementDisplayed))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/hover",
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/hover",
                      WrapToCommand(base::Bind(&ExecuteHoverOverElement))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/location",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/location",
                      WrapToCommand(base::Bind(&ExecuteGetElementLocation))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/location_in_view",
-                     WrapToCommand(
-                         base::Bind(
-                             &ExecuteGetElementLocationOnceScrolledIntoView))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/size",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/location_in_view",
+                     WrapToCommand(base::Bind(
+                         &ExecuteGetElementLocationOnceScrolledIntoView))),
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/size",
                      WrapToCommand(base::Bind(&ExecuteGetElementSize))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/attribute/:name",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/attribute/:name",
                      WrapToCommand(base::Bind(&ExecuteGetElementAttribute))),
-      CommandMapping(kGet, "session/:sessionId/element/:id/equals/:other",
+      CommandMapping(kGet,
+                     "session/:sessionId/element/:id/equals/:other",
                      WrapToCommand(base::Bind(&ExecuteElementEquals))),
-      CommandMapping(kGet, "session/:sessionId/cookie",
+      CommandMapping(kGet,
+                     "session/:sessionId/cookie",
                      WrapToCommand(base::Bind(&ExecuteGetCookies))),
-      CommandMapping(kPost, "session/:sessionId/cookie",
+      CommandMapping(kPost,
+                     "session/:sessionId/cookie",
                      WrapToCommand(base::Bind(&ExecuteAddCookie))),
-      CommandMapping(kDelete, "session/:sessionId/cookie",
+      CommandMapping(kDelete,
+                     "session/:sessionId/cookie",
                      WrapToCommand(base::Bind(&ExecuteDeleteAllCookies))),
-      CommandMapping(kDelete, "session/:sessionId/cookie/:name",
+      CommandMapping(kDelete,
+                     "session/:sessionId/cookie/:name",
                      WrapToCommand(base::Bind(&ExecuteDeleteCookie))),
-      CommandMapping(kPost, "session/:sessionId/frame",
+      CommandMapping(kPost,
+                     "session/:sessionId/frame",
                      WrapToCommand(base::Bind(&ExecuteSwitchToFrame))),
-      CommandMapping(kPost, "session/:sessionId/window",
+      CommandMapping(kPost,
+                     "session/:sessionId/window",
                      WrapToCommand(base::Bind(&ExecuteSwitchToWindow))),
-      CommandMapping(kGet, "session/:sessionId/window/:windowHandle/size",
+      CommandMapping(kGet,
+                     "session/:sessionId/window/:windowHandle/size",
                      WrapToCommand(base::Bind(&ExecuteGetWindowSize))),
-      CommandMapping(kGet, "session/:sessionId/window/:windowHandle/position",
+      CommandMapping(kGet,
+                     "session/:sessionId/window/:windowHandle/position",
                      WrapToCommand(base::Bind(&ExecuteGetWindowPosition))),
-      CommandMapping(kPost, "session/:sessionId/window/:windowHandle/size",
+      CommandMapping(kPost,
+                     "session/:sessionId/window/:windowHandle/size",
                      WrapToCommand(base::Bind(&ExecuteSetWindowSize))),
-      CommandMapping(kPost, "session/:sessionId/window/:windowHandle/position",
+      CommandMapping(kPost,
+                     "session/:sessionId/window/:windowHandle/position",
                      WrapToCommand(base::Bind(&ExecuteSetWindowPosition))),
-      CommandMapping(kPost, "session/:sessionId/window/:windowHandle/maximize",
+      CommandMapping(kPost,
+                     "session/:sessionId/window/:windowHandle/maximize",
                      WrapToCommand(base::Bind(&ExecuteMaximizeWindow))),
-      CommandMapping(kDelete, "session/:sessionId/window",
-                     WrapToCommand(base::Bind(&ExecuteClose, &session_map_))),
-      CommandMapping(kPost, "session/:sessionId/element/:id/drag",
+      CommandMapping(kDelete,
+                     "session/:sessionId/window",
+                     WrapToCommand(base::Bind(&ExecuteClose))),
+      CommandMapping(kPost,
+                     "session/:sessionId/element/:id/drag",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/element/:id/css/:propertyName",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetElementValueOfCSSProperty))),
-      CommandMapping(kPost, "session/:sessionId/timeouts/implicit_wait",
+      CommandMapping(
+          kGet,
+          "session/:sessionId/element/:id/css/:propertyName",
+          WrapToCommand(base::Bind(&ExecuteGetElementValueOfCSSProperty))),
+      CommandMapping(kPost,
+                     "session/:sessionId/timeouts/implicit_wait",
                      WrapToCommand(base::Bind(&ExecuteImplicitlyWait))),
-      CommandMapping(kPost, "session/:sessionId/timeouts/async_script",
+      CommandMapping(kPost,
+                     "session/:sessionId/timeouts/async_script",
                      WrapToCommand(base::Bind(&ExecuteSetScriptTimeout))),
-      CommandMapping(kPost, "session/:sessionId/timeouts",
+      CommandMapping(kPost,
+                     "session/:sessionId/timeouts",
                      WrapToCommand(base::Bind(&ExecuteSetTimeout))),
-      CommandMapping(kPost, "session/:sessionId/execute_sql",
+      CommandMapping(kPost,
+                     "session/:sessionId/execute_sql",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/location",
+      CommandMapping(kGet,
+                     "session/:sessionId/location",
                      WrapToCommand(base::Bind(&ExecuteGetLocation))),
-      CommandMapping(kPost, "session/:sessionId/location",
+      CommandMapping(kPost,
+                     "session/:sessionId/location",
                      WrapToCommand(base::Bind(&ExecuteSetLocation))),
-      CommandMapping(kGet, "session/:sessionId/application_cache/status",
+      CommandMapping(kGet,
+                     "session/:sessionId/application_cache/status",
                      base::Bind(&ExecuteGetStatus)),
-      CommandMapping(kGet, "session/:sessionId/browser_connection",
+      CommandMapping(kGet,
+                     "session/:sessionId/browser_connection",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/browser_connection",
+      CommandMapping(kPost,
+                     "session/:sessionId/browser_connection",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/local_storage/key/:key",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageItem, kLocalStorage))),
-      CommandMapping(kDelete, "session/:sessionId/local_storage/key/:key",
-                     WrapToCommand(
-                         base::Bind(&ExecuteRemoveStorageItem, kLocalStorage))),
-      CommandMapping(kGet, "session/:sessionId/local_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageKeys, kLocalStorage))),
-      CommandMapping(kPost, "session/:sessionId/local_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteSetStorageItem, kLocalStorage))),
-      CommandMapping(kDelete, "session/:sessionId/local_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteClearStorage, kLocalStorage))),
-      CommandMapping(kGet, "session/:sessionId/local_storage/size",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageSize, kLocalStorage))),
-      CommandMapping(kGet, "session/:sessionId/session_storage/key/:key",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageItem, kSessionStorage))),
-      CommandMapping(kDelete, "session/:sessionId/session_storage/key/:key",
-                     WrapToCommand(
-                         base::Bind(
-                             &ExecuteRemoveStorageItem, kSessionStorage))),
-      CommandMapping(kGet, "session/:sessionId/session_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageKeys, kSessionStorage))),
-      CommandMapping(kPost, "session/:sessionId/session_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteSetStorageItem, kSessionStorage))),
-      CommandMapping(kDelete, "session/:sessionId/session_storage",
-                     WrapToCommand(
-                         base::Bind(&ExecuteClearStorage, kSessionStorage))),
-      CommandMapping(kGet, "session/:sessionId/session_storage/size",
-                     WrapToCommand(
-                         base::Bind(&ExecuteGetStorageSize, kSessionStorage))),
-      CommandMapping(kGet, "session/:sessionId/orientation",
+      CommandMapping(
+          kGet,
+          "session/:sessionId/local_storage/key/:key",
+          WrapToCommand(base::Bind(&ExecuteGetStorageItem, kLocalStorage))),
+      CommandMapping(
+          kDelete,
+          "session/:sessionId/local_storage/key/:key",
+          WrapToCommand(base::Bind(&ExecuteRemoveStorageItem, kLocalStorage))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/local_storage",
+          WrapToCommand(base::Bind(&ExecuteGetStorageKeys, kLocalStorage))),
+      CommandMapping(
+          kPost,
+          "session/:sessionId/local_storage",
+          WrapToCommand(base::Bind(&ExecuteSetStorageItem, kLocalStorage))),
+      CommandMapping(
+          kDelete,
+          "session/:sessionId/local_storage",
+          WrapToCommand(base::Bind(&ExecuteClearStorage, kLocalStorage))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/local_storage/size",
+          WrapToCommand(base::Bind(&ExecuteGetStorageSize, kLocalStorage))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/session_storage/key/:key",
+          WrapToCommand(base::Bind(&ExecuteGetStorageItem, kSessionStorage))),
+      CommandMapping(kDelete,
+                     "session/:sessionId/session_storage/key/:key",
+                     WrapToCommand(base::Bind(&ExecuteRemoveStorageItem,
+                                              kSessionStorage))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/session_storage",
+          WrapToCommand(base::Bind(&ExecuteGetStorageKeys, kSessionStorage))),
+      CommandMapping(
+          kPost,
+          "session/:sessionId/session_storage",
+          WrapToCommand(base::Bind(&ExecuteSetStorageItem, kSessionStorage))),
+      CommandMapping(
+          kDelete,
+          "session/:sessionId/session_storage",
+          WrapToCommand(base::Bind(&ExecuteClearStorage, kSessionStorage))),
+      CommandMapping(
+          kGet,
+          "session/:sessionId/session_storage/size",
+          WrapToCommand(base::Bind(&ExecuteGetStorageSize, kSessionStorage))),
+      CommandMapping(kGet,
+                     "session/:sessionId/orientation",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/orientation",
+      CommandMapping(kPost,
+                     "session/:sessionId/orientation",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/click",
+      CommandMapping(kPost,
+                     "session/:sessionId/click",
                      WrapToCommand(base::Bind(&ExecuteMouseClick))),
-      CommandMapping(kPost, "session/:sessionId/doubleclick",
+      CommandMapping(kPost,
+                     "session/:sessionId/doubleclick",
                      WrapToCommand(base::Bind(&ExecuteMouseDoubleClick))),
-      CommandMapping(kPost, "session/:sessionId/buttondown",
+      CommandMapping(kPost,
+                     "session/:sessionId/buttondown",
                      WrapToCommand(base::Bind(&ExecuteMouseButtonDown))),
-      CommandMapping(kPost, "session/:sessionId/buttonup",
+      CommandMapping(kPost,
+                     "session/:sessionId/buttonup",
                      WrapToCommand(base::Bind(&ExecuteMouseButtonUp))),
-      CommandMapping(kPost, "session/:sessionId/moveto",
+      CommandMapping(kPost,
+                     "session/:sessionId/moveto",
                      WrapToCommand(base::Bind(&ExecuteMouseMoveTo))),
-      CommandMapping(kPost, "session/:sessionId/keys",
-                     WrapToCommand(
-                         base::Bind(&ExecuteSendKeysToActiveElement))),
-      CommandMapping(kGet, "session/:sessionId/ime/available_engines",
+      CommandMapping(
+          kPost,
+          "session/:sessionId/keys",
+          WrapToCommand(base::Bind(&ExecuteSendKeysToActiveElement))),
+      CommandMapping(kGet,
+                     "session/:sessionId/ime/available_engines",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/ime/active_engine",
+      CommandMapping(kGet,
+                     "session/:sessionId/ime/active_engine",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kGet, "session/:sessionId/ime/activated",
+      CommandMapping(kGet,
+                     "session/:sessionId/ime/activated",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/ime/deactivate",
+      CommandMapping(kPost,
+                     "session/:sessionId/ime/deactivate",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/ime/activate",
+      CommandMapping(kPost,
+                     "session/:sessionId/ime/activate",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/click",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/click",
                      WrapToCommand(base::Bind(&ExecuteTouchSingleTap))),
-      CommandMapping(kPost, "session/:sessionId/touch/down",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/down",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/up",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/up",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/move",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/move",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/scroll",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/scroll",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/doubleclick",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/doubleclick",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/longclick",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/longclick",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/touch/flick",
+      CommandMapping(kPost,
+                     "session/:sessionId/touch/flick",
                      base::Bind(&UnimplementedCommand)),
-      CommandMapping(kPost, "session/:sessionId/log",
+      CommandMapping(kPost,
+                     "session/:sessionId/log",
                      WrapToCommand(base::Bind(&ExecuteGetLog))),
-      CommandMapping(kGet, "session/:sessionId/log/types",
+      CommandMapping(kGet,
+                     "session/:sessionId/log/types",
                      WrapToCommand(base::Bind(&ExecuteGetAvailableLogTypes))),
       CommandMapping(kPost, "logs", base::Bind(&UnimplementedCommand)),
       CommandMapping(kGet, "status", base::Bind(&ExecuteGetStatus)),
 
       // Custom Chrome commands:
       // Allow quit all to be called with GET or POST.
-      CommandMapping(kGet, kShutdownPath,
+      CommandMapping(kGet,
+                     kShutdownPath,
                      base::Bind(&ExecuteQuitAll,
-                                base::Bind(&ExecuteQuit, true, &session_map_),
-                                &session_map_)),
-      CommandMapping(kPost, kShutdownPath,
+                                WrapToCommand(base::Bind(&ExecuteQuit, true)),
+                                &session_thread_map_)),
+      CommandMapping(kPost,
+                     kShutdownPath,
                      base::Bind(&ExecuteQuitAll,
-                                base::Bind(&ExecuteQuit, true, &session_map_),
-                                &session_map_)),
-      CommandMapping(kGet, "session/:sessionId/is_loading",
-                     WrapToCommand(base::Bind(&ExecuteIsLoading))),
-  };
-  this->command_map_.reset(
+                                WrapToCommand(base::Bind(&ExecuteQuit, true)),
+                                &session_thread_map_)),
+      CommandMapping(kGet,
+                     "session/:sessionId/is_loading",
+                     WrapToCommand(base::Bind(&ExecuteIsLoading))), };
+  command_map_.reset(
       new CommandMap(commands, commands + arraysize(commands)));
 }
 
 HttpHandler::~HttpHandler() {}
 
 void HttpHandler::Handle(const net::HttpServerRequestInfo& request,
-                         HttpResponse* response) {
-  log_->AddEntry(
-      Log::kLog,
-      base::StringPrintf("received WebDriver request: %s %s %s",
-                         request.method.c_str(),
-                         request.path.c_str(),
-                         request.data.c_str()));
+                         const HttpResponseSenderFunc& send_response_func) {
+  CHECK(thread_checker_.CalledOnValidThread());
 
-  HandleInternal(request, response);
+  if (received_shutdown_)
+    return;
+  if (ShouldShutdown(request))
+    received_shutdown_ = true;
 
-  log_->AddEntry(
-      Log::kLog,
-      base::StringPrintf("sending WebDriver response: %d %s",
-                         response->status(),
-                         response->body().c_str()));
+  std::string path = request.path;
+  if (!StartsWithASCII(path, url_base_, true)) {
+    scoped_ptr<HttpResponse> response(
+        new HttpResponse(HttpResponse::kBadRequest));
+    response->set_body("unhandled request");
+    send_response_func.Run(response.Pass());
+    return;
+  }
+
+  path.erase(0, url_base_.length());
+
+  HandleCommand(request, path, send_response_func);
 }
 
 bool HttpHandler::ShouldShutdown(const net::HttpServerRequestInfo& request) {
@@ -359,7 +471,8 @@
 
 Command HttpHandler::WrapToCommand(
     const SessionCommand& session_command) {
-  return base::Bind(&ExecuteSessionCommand, &session_map_, session_command);
+  return base::Bind(
+      &ExecuteSessionCommand, &session_thread_map_, session_command, false);
 }
 
 Command HttpHandler::WrapToCommand(
@@ -374,34 +487,26 @@
       base::Bind(&ExecuteElementCommand, element_command));
 }
 
-void HttpHandler::HandleInternal(const net::HttpServerRequestInfo& request,
-                                 HttpResponse* response) {
-  std::string path = request.path;
-  if (!StartsWithASCII(path, url_base_, true)) {
-    *response = HttpResponse(HttpResponse::kBadRequest);
-    response->set_body("unhandled request");
-    return;
-  }
-
-  path.erase(0, url_base_.length());
-
-  if (!HandleWebDriverCommand(request, path, response)) {
-    *response = HttpResponse(HttpResponse::kNotFound);
-    response->set_body("unknown command: " + path);
-    return;
-  }
-}
-
-bool HttpHandler::HandleWebDriverCommand(
+void HttpHandler::HandleCommand(
     const net::HttpServerRequestInfo& request,
     const std::string& trimmed_path,
-    HttpResponse* response) {
+    const HttpResponseSenderFunc& send_response_func) {
+  log_->AddEntry(Log::kLog,
+                 base::StringPrintf("handling command: %s %s %s",
+                                    request.method.c_str(),
+                                    trimmed_path.c_str(),
+                                    request.data.c_str()));
+
   base::DictionaryValue params;
   std::string session_id;
   CommandMap::const_iterator iter = command_map_->begin();
   while (true) {
     if (iter == command_map_->end()) {
-      return false;
+      scoped_ptr<HttpResponse> response(
+          new HttpResponse(HttpResponse::kNotFound));
+      response->set_body("unknown command: " + trimmed_path);
+      send_response_func.Run(response.Pass());
+      return;
     }
     if (internal::MatchesCommand(
             request.method, trimmed_path, *iter, &session_id, &params)) {
@@ -414,40 +519,69 @@
     base::DictionaryValue* body_params;
     scoped_ptr<base::Value> parsed_body(base::JSONReader::Read(request.data));
     if (!parsed_body || !parsed_body->GetAsDictionary(&body_params)) {
-      *response = HttpResponse(HttpResponse::kBadRequest);
+      scoped_ptr<HttpResponse> response(
+          new HttpResponse(HttpResponse::kBadRequest));
       response->set_body("missing command parameters");
-      return true;
+      send_response_func.Run(response.Pass());
+      return;
     }
     params.MergeDictionary(body_params);
   }
 
-  scoped_ptr<base::Value> value;
-  std::string out_session_id;
-  Status status = iter->command.Run(
-      params, session_id, &value, &out_session_id);
+  iter->command.Run(params,
+                    session_id,
+                    base::Bind(&HttpHandler::PrepareResponse,
+                               weak_ptr_factory_.GetWeakPtr(),
+                               trimmed_path,
+                               send_response_func));
+}
 
+void HttpHandler::PrepareResponse(
+    const std::string& trimmed_path,
+    const HttpResponseSenderFunc& send_response_func,
+    const Status& status,
+    scoped_ptr<base::Value> value,
+    const std::string& session_id) {
+  CHECK(thread_checker_.CalledOnValidThread());
+  scoped_ptr<HttpResponse> response =
+      PrepareResponseHelper(trimmed_path, status, value.Pass(), session_id);
+  log_->AddEntry(Log::kLog,
+                 base::StringPrintf("sending response: %d %s",
+                                    response->status(),
+                                    response->body().c_str()));
+  send_response_func.Run(response.Pass());
+}
+
+scoped_ptr<HttpResponse> HttpHandler::PrepareResponseHelper(
+    const std::string& trimmed_path,
+    const Status& status,
+    scoped_ptr<base::Value> value,
+    const std::string& session_id) {
   if (status.code() == kUnknownCommand) {
-    *response = HttpResponse(HttpResponse::kNotImplemented);
+    scoped_ptr<HttpResponse> response(
+        new HttpResponse(HttpResponse::kNotImplemented));
     response->set_body("unimplemented command: " + trimmed_path);
-    return true;
+    return response.Pass();
   }
 
-  if (iter->path_pattern == internal::kNewSessionPathPattern && status.IsOk()) {
+  if (trimmed_path == internal::kNewSessionPathPattern && status.IsOk()) {
     // Creating a session involves a HTTP request to /session, which is
     // supposed to redirect to /session/:sessionId, which returns the
     // session info.
-    *response = HttpResponse(HttpResponse::kSeeOther);
-    response->AddHeader("Location", url_base_ + "session/" + out_session_id);
-    return true;
+    scoped_ptr<HttpResponse> response(
+        new HttpResponse(HttpResponse::kSeeOther));
+    response->AddHeader("Location", url_base_ + "session/" + session_id);
+    return response.Pass();
   } else if (status.IsError()) {
-    status.AddDetails(base::StringPrintf(
+    Status full_status(status);
+    full_status.AddDetails(base::StringPrintf(
         "Driver info: chromedriver=%s,platform=%s %s %s",
         kChromeDriverVersion,
         base::SysInfo::OperatingSystemName().c_str(),
         base::SysInfo::OperatingSystemVersion().c_str(),
         base::SysInfo::OperatingSystemArchitecture().c_str()));
     scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue());
-    error->SetString("message", status.message());
+    error->SetString("message", full_status.message());
     value.reset(error.release());
   }
   if (!value)
@@ -456,15 +590,15 @@
   base::DictionaryValue body_params;
   body_params.SetInteger("status", status.code());
   body_params.Set("value", value.release());
-  body_params.SetString("sessionId", out_session_id);
+  body_params.SetString("sessionId", session_id);
   std::string body;
   base::JSONWriter::WriteWithOptions(
       &body_params, base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION,
       &body);
-  *response = HttpResponse(HttpResponse::kOk);
+  scoped_ptr<HttpResponse> response(new HttpResponse(HttpResponse::kOk));
   response->SetMimeType("application/json; charset=utf-8");
   response->set_body(body);
-  return true;
+  return response.Pass();
 }
 
 namespace internal {
diff --git a/chrome/test/chromedriver/server/http_handler.h b/chrome/test/chromedriver/server/http_handler.h
index d40fab8..3ad42a1 100644
--- a/chrome/test/chromedriver/server/http_handler.h
+++ b/chrome/test/chromedriver/server/http_handler.h
@@ -10,17 +10,21 @@
 
 #include "base/compiler_specific.h"
 #include "base/gtest_prod_util.h"
+#include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/threading/thread.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
 #include "chrome/test/chromedriver/command.h"
+#include "chrome/test/chromedriver/commands.h"
 #include "chrome/test/chromedriver/element_commands.h"
 #include "chrome/test/chromedriver/net/sync_websocket_factory.h"
 #include "chrome/test/chromedriver/session_commands.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
 #include "chrome/test/chromedriver/window_commands.h"
 
 namespace base {
 class DictionaryValue;
+class SingleThreadTaskRunner;
 }
 
 namespace net {
@@ -50,13 +54,18 @@
   Command command;
 };
 
+typedef base::Callback<void(scoped_ptr<HttpResponse>)> HttpResponseSenderFunc;
+
 class HttpHandler {
  public:
   HttpHandler(Log* log, const std::string& url_base);
+  HttpHandler(const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+              Log* log,
+              const std::string& url_base);
   ~HttpHandler();
 
   void Handle(const net::HttpServerRequestInfo& request,
-              HttpResponse* response);
+              const HttpResponseSenderFunc& send_response_func);
   bool ShouldShutdown(const net::HttpServerRequestInfo& request);
 
  private:
@@ -70,23 +79,33 @@
   Command WrapToCommand(const SessionCommand& session_command);
   Command WrapToCommand(const WindowCommand& window_command);
   Command WrapToCommand(const ElementCommand& element_command);
-  void HandleInternal(const net::HttpServerRequestInfo& request,
-                      HttpResponse* response);
-  bool HandleWebDriverCommand(
-      const net::HttpServerRequestInfo& request,
+  void HandleCommand(const net::HttpServerRequestInfo& request,
+                     const std::string& trimmed_path,
+                     const HttpResponseSenderFunc& send_response_func);
+  void PrepareResponse(const std::string& trimmed_path,
+                       const HttpResponseSenderFunc& send_response_func,
+                       const Status& status,
+                       scoped_ptr<base::Value> value,
+                       const std::string& session_id);
+  scoped_ptr<HttpResponse> PrepareResponseHelper(
       const std::string& trimmed_path,
-      HttpResponse* response);
+      const Status& status,
+      scoped_ptr<base::Value> value,
+      const std::string& session_id);
 
+  base::ThreadChecker thread_checker_;
   Log* log_;
-  base::Thread io_thread_;
   std::string url_base_;
+  bool received_shutdown_;
   scoped_refptr<URLRequestContextGetter> context_getter_;
   SyncWebSocketFactory socket_factory_;
-  SessionMap session_map_;
+  SessionThreadMap session_thread_map_;
   scoped_ptr<CommandMap> command_map_;
   scoped_ptr<Adb> adb_;
   scoped_ptr<DeviceManager> device_manager_;
 
+  base::WeakPtrFactory<HttpHandler> weak_ptr_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(HttpHandler);
 };
 
diff --git a/chrome/test/chromedriver/server/http_handler_unittest.cc b/chrome/test/chromedriver/server/http_handler_unittest.cc
index 76c4f6e..3fc6cd8 100644
--- a/chrome/test/chromedriver/server/http_handler_unittest.cc
+++ b/chrome/test/chromedriver/server/http_handler_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/values.h"
 #include "chrome/test/chromedriver/chrome/log.h"
 #include "chrome/test/chromedriver/chrome/status.h"
+#include "chrome/test/chromedriver/command.h"
 #include "chrome/test/chromedriver/server/http_handler.h"
 #include "chrome/test/chromedriver/server/http_response.h"
 #include "net/server/http_server_request_info.h"
@@ -17,15 +18,19 @@
 
 namespace {
 
-Status DummyCommand(
-    Status status,
+void DummyCommand(
+    const Status& status,
     const base::DictionaryValue& params,
     const std::string& session_id,
-    scoped_ptr<base::Value>* value,
-    std::string* out_session_id) {
-  value->reset(new base::FundamentalValue(1));
-  *out_session_id = "session_id";
-  return status;
+    const CommandCallback& callback) {
+  callback.Run(status,
+               scoped_ptr<base::Value>(new base::FundamentalValue(1)),
+               "session_id");
+}
+
+void OnResponse(HttpResponse* response_to_set,
+                scoped_ptr<HttpResponse> response) {
+  *response_to_set = *response;
 }
 
 }  // namespace
@@ -38,7 +43,7 @@
   request.path = "base/path";
   request.data = "body";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kBadRequest, response.status());
 }
 
@@ -49,7 +54,7 @@
   request.method = "get";
   request.path = "/path";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kNotFound, response.status());
 }
 
@@ -64,7 +69,7 @@
   request.method = "post";
   request.path = "/base/session";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kSeeOther, response.status());
   std::string location;
   ASSERT_TRUE(response.GetHeader("Location", &location));
@@ -82,7 +87,7 @@
   request.path = "/path";
   request.data = "should be a dictionary";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kBadRequest, response.status());
 }
 
@@ -96,7 +101,7 @@
   request.method = "post";
   request.path = "/path";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kNotImplemented, response.status());
 }
 
@@ -109,7 +114,7 @@
   request.method = "post";
   request.path = "/path";
   HttpResponse response;
-  handler.Handle(request, &response);
+  handler.Handle(request, base::Bind(&OnResponse, &response));
   ASSERT_EQ(HttpResponse::kOk, response.status());
   std::string mime;
   ASSERT_TRUE(response.GetHeader("Content-Type", &mime));
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc
index 51a409d..ea6da2c 100644
--- a/chrome/test/chromedriver/session.cc
+++ b/chrome/test/chromedriver/session.cc
@@ -24,7 +24,7 @@
 
 Session::Session(const std::string& id)
     : id(id),
-      thread(("SessionThread_" + id).c_str()),
+      quit(false),
       detach(false),
       sticky_modifiers(0),
       mouse_position(0, 0),
@@ -35,7 +35,7 @@
 
 Session::Session(const std::string& id, scoped_ptr<Chrome> chrome)
     : id(id),
-      thread(("SessionThread_" + id).c_str()),
+      quit(false),
       detach(false),
       chrome(chrome.Pass()),
       sticky_modifiers(0),
@@ -96,17 +96,3 @@
   caps->SetBoolean("nativeEvents", true);
   return caps.Pass();
 }
-
-SessionAccessorImpl::SessionAccessorImpl(scoped_ptr<Session> session)
-    : session_(session.Pass()) {}
-
-Session* SessionAccessorImpl::Access(scoped_ptr<base::AutoLock>* lock) {
-  lock->reset(new base::AutoLock(session_lock_));
-  return session_.get();
-}
-
-void SessionAccessorImpl::DeleteSession() {
-  session_.reset();
-}
-
-SessionAccessorImpl::~SessionAccessorImpl() {}
diff --git a/chrome/test/chromedriver/session.h b/chrome/test/chromedriver/session.h
index 8b2ac53..40ec9e9 100644
--- a/chrome/test/chromedriver/session.h
+++ b/chrome/test/chromedriver/session.h
@@ -10,11 +10,8 @@
 
 #include "base/basictypes.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/scoped_vector.h"
-#include "base/synchronization/lock.h"
-#include "base/threading/thread.h"
 #include "chrome/test/chromedriver/basic_types.h"
 #include "chrome/test/chromedriver/chrome/geoposition.h"
 
@@ -52,7 +49,7 @@
   std::string GetCurrentFrameId() const;
 
   const std::string id;
-  base::Thread thread;
+  bool quit;
   bool detach;
   scoped_ptr<Chrome> chrome;
   std::string window;
@@ -76,32 +73,4 @@
   scoped_ptr<base::DictionaryValue> CreateCapabilities();
 };
 
-class SessionAccessor : public base::RefCountedThreadSafe<SessionAccessor> {
- public:
-  virtual Session* Access(scoped_ptr<base::AutoLock>* lock) = 0;
-
-  // The session should be accessed before its deletion.
-  virtual void DeleteSession() = 0;
-
- protected:
-  friend class base::RefCountedThreadSafe<SessionAccessor>;
-  virtual ~SessionAccessor() {}
-};
-
-class SessionAccessorImpl : public SessionAccessor {
- public:
-  explicit SessionAccessorImpl(scoped_ptr<Session> session);
-
-  virtual Session* Access(scoped_ptr<base::AutoLock>* lock) OVERRIDE;
-  virtual void DeleteSession() OVERRIDE;
-
- private:
-  virtual ~SessionAccessorImpl();
-
-  base::Lock session_lock_;
-  scoped_ptr<Session> session_;
-
-  DISALLOW_COPY_AND_ASSIGN(SessionAccessorImpl);
-};
-
 #endif  // CHROME_TEST_CHROMEDRIVER_SESSION_H_
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc
index 45c6f54..23f362b 100644
--- a/chrome/test/chromedriver/session_commands.cc
+++ b/chrome/test/chromedriver/session_commands.cc
@@ -23,7 +23,6 @@
 #include "chrome/test/chromedriver/chrome/web_view.h"
 #include "chrome/test/chromedriver/logging.h"
 #include "chrome/test/chromedriver/session.h"
-#include "chrome/test/chromedriver/session_map.h"
 #include "chrome/test/chromedriver/util.h"
 
 namespace {
@@ -43,53 +42,22 @@
   return true;
 }
 
-void ExecuteOnSessionThread(
-    const SessionCommand& command,
-    Session* session,
-    const base::DictionaryValue* params,
-    scoped_ptr<base::Value>* value,
-    Status* status,
-    base::WaitableEvent* event) {
-  *status = command.Run(session, *params, value);
-  event->Signal();
-}
-
 }  // namespace
 
-Status ExecuteSessionCommand(
-    SessionMap* session_map,
-    const SessionCommand& command,
+Status ExecuteQuit(
+    bool allow_detach,
+    Session* session,
     const base::DictionaryValue& params,
-    const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id) {
-  *out_session_id = session_id;
-  scoped_refptr<SessionAccessor> session_accessor;
-  if (!session_map->Get(session_id, &session_accessor))
-    return Status(kNoSuchSession, session_id);
-  scoped_ptr<base::AutoLock> session_lock;
-  Session* session = session_accessor->Access(&session_lock);
-  if (!session)
-    return Status(kNoSuchSession, session_id);
-
-  Status status(kUnknownError);
-  base::WaitableEvent event(false, false);
-  session->thread.message_loop_proxy()->PostTask(
-      FROM_HERE,
-      base::Bind(&ExecuteOnSessionThread, command, session,
-                 &params, out_value, &status, &event));
-  event.Wait();
-  if (status.IsError() && session->chrome)
-    status.AddDetails("Session info: chrome=" + session->chrome->GetVersion());
-  // Delete the session, because concurrent requests might hold a reference to
-  // the SessionAccessor already.
-  if (!session_map->Has(session_id))
-    session_accessor->DeleteSession();
-  return status;
+    scoped_ptr<base::Value>* value) {
+  if (allow_detach && session->detach) {
+    return Status(kOk);
+  } else {
+    session->quit = true;
+    return session->chrome->Quit();
+  }
 }
 
 Status ExecuteGetSessionCapabilities(
-    SessionMap* session_map,
     Session* session,
     const base::DictionaryValue& params,
     scoped_ptr<base::Value>* value) {
@@ -111,7 +79,6 @@
 }
 
 Status ExecuteClose(
-    SessionMap* session_map,
     Session* session,
     const base::DictionaryValue& params,
     scoped_ptr<base::Value>* value) {
@@ -135,7 +102,7 @@
   if ((status.code() == kChromeNotReachable && is_last_web_view) ||
       (status.IsOk() && web_view_ids.empty())) {
     // If no window is open, close is the equivalent of calling "quit".
-    CHECK(session_map->Remove(session->id));
+    session->quit = true;
     return session->chrome->Quit();
   }
 
diff --git a/chrome/test/chromedriver/session_commands.h b/chrome/test/chromedriver/session_commands.h
index 23af156..618f124 100644
--- a/chrome/test/chromedriver/session_commands.h
+++ b/chrome/test/chromedriver/session_commands.h
@@ -9,7 +9,8 @@
 
 #include "base/callback_forward.h"
 #include "base/memory/scoped_ptr.h"
-#include "chrome/test/chromedriver/session_map.h"
+#include "chrome/test/chromedriver/command.h"
+#include "chrome/test/chromedriver/session_thread_map.h"
 
 namespace base {
 class DictionaryValue;
@@ -19,24 +20,15 @@
 struct Session;
 class Status;
 
-typedef base::Callback<Status(
+// Quits a session.
+Status ExecuteQuit(
+    bool allow_detach,
     Session* session,
-    const base::DictionaryValue&,
-    scoped_ptr<base::Value>*)> SessionCommand;
-
-// Executes a given session command, after acquiring access to the appropriate
-// session.
-Status ExecuteSessionCommand(
-    SessionMap* session_map,
-    const SessionCommand& command,
     const base::DictionaryValue& params,
-    const std::string& session_id,
-    scoped_ptr<base::Value>* out_value,
-    std::string* out_session_id);
+    scoped_ptr<base::Value>* value);
 
 // Gets the capabilities of a particular session.
 Status ExecuteGetSessionCapabilities(
-    SessionMap* session_map,
     Session* session,
     const base::DictionaryValue& params,
     scoped_ptr<base::Value>* value);
@@ -49,7 +41,6 @@
 
 // Close the target window.
 Status ExecuteClose(
-    SessionMap* session_map,
     Session* session,
     const base::DictionaryValue& params,
     scoped_ptr<base::Value>* value);
diff --git a/chrome/test/chromedriver/session_commands_unittest.cc b/chrome/test/chromedriver/session_commands_unittest.cc
index 33a748b..1b6ef7b 100644
--- a/chrome/test/chromedriver/session_commands_unittest.cc
+++ b/chrome/test/chromedriver/session_commands_unittest.cc
@@ -8,97 +8,19 @@
 #include "base/callback.h"
 #include "base/file_util.h"
 #include "base/files/file_path.h"
+#include "base/memory/linked_ptr.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/threading/thread.h"
 #include "base/values.h"
 #include "chrome/test/chromedriver/chrome/status.h"
 #include "chrome/test/chromedriver/chrome/stub_chrome.h"
-#include "chrome/test/chromedriver/fake_session_accessor.h"
+#include "chrome/test/chromedriver/commands.h"
 #include "chrome/test/chromedriver/session.h"
 #include "chrome/test/chromedriver/session_commands.h"
-#include "chrome/test/chromedriver/session_map.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace {
-
-Status ExecuteSimpleCommand(
-    Session* expected_session,
-    base::DictionaryValue* expected_params,
-    base::Value* value,
-    Session* session,
-    const base::DictionaryValue& params,
-    scoped_ptr<base::Value>* return_value) {
-  EXPECT_EQ(expected_session, session);
-  EXPECT_TRUE(expected_params->Equals(&params));
-  return_value->reset(value->DeepCopy());
-  return Status(kOk);
-}
-
-}  // namespace
-
-TEST(SessionCommandTest, SimpleCommand) {
-  SessionMap map;
-  Session session("session", scoped_ptr<Chrome>(new StubChrome()));
-  ASSERT_TRUE(session.thread.Start());
-  scoped_refptr<SessionAccessor> accessor(new FakeSessionAccessor(&session));
-  map.Set(session.id, accessor);
-
-  base::DictionaryValue params;
-  params.SetInteger("param", 5);
-  base::FundamentalValue expected_value(6);
-  SessionCommand cmd = base::Bind(
-      &ExecuteSimpleCommand, &session, &params, &expected_value);
-
-  scoped_ptr<base::Value> value;
-  std::string session_id;
-  Status status = ExecuteSessionCommand(
-      &map, cmd, params,
-      session.id, &value, &session_id);
-  ASSERT_EQ(kOk, status.code());
-  ASSERT_TRUE(expected_value.Equals(value.get()));
-  ASSERT_STREQ(session.id.c_str(), session_id.c_str());
-}
-
-namespace {
-
-Status ShouldNotBeCalled(
-    Session* session,
-    const base::DictionaryValue& params,
-    scoped_ptr<base::Value>* value) {
-  EXPECT_TRUE(false);
-  return Status(kOk);
-}
-
-}  // namespace
-
-TEST(SessionCommandTest, NoSuchSession) {
-  SessionMap map;
-  base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string session_id;
-  Status status = ExecuteSessionCommand(
-      &map, base::Bind(&ShouldNotBeCalled), params,
-      "session", &value, &session_id);
-  ASSERT_EQ(kNoSuchSession, status.code());
-  ASSERT_FALSE(value.get());
-  ASSERT_STREQ("session", session_id.c_str());
-}
-
-TEST(SessionCommandTest, SessionDeletedWhileWaiting) {
-  SessionMap map;
-  scoped_refptr<SessionAccessor> accessor(new FakeSessionAccessor(NULL));
-  map.Set("session", accessor);
-
-  base::DictionaryValue params;
-  scoped_ptr<base::Value> value;
-  std::string session_id;
-  Status status = ExecuteSessionCommand(
-      &map, base::Bind(&ShouldNotBeCalled), params,
-      "session", &value, &session_id);
-  ASSERT_EQ(kNoSuchSession, status.code());
-  ASSERT_FALSE(value.get());
-  ASSERT_STREQ("session", session_id.c_str());
-}
-
 TEST(SessionCommandTest, FileUpload) {
   Session session("id");
   base::DictionaryValue params;
@@ -119,3 +41,73 @@
   ASSERT_TRUE(file_util::ReadFileToString(base::FilePath(path), &data));
   ASSERT_STREQ("COW\n", data.c_str());
 }
+
+namespace {
+
+class DetachChrome : public StubChrome {
+ public:
+  DetachChrome() : quit_called_(false) {}
+  virtual ~DetachChrome() {}
+
+  // Overridden from Chrome:
+  virtual Status Quit() OVERRIDE {
+    quit_called_ = true;
+    return Status(kOk);
+  }
+
+  bool quit_called_;
+};
+
+}  // namespace
+
+TEST(SessionCommandsTest, Quit) {
+  DetachChrome* chrome = new DetachChrome();
+  Session session("id", scoped_ptr<Chrome>(chrome));
+
+  base::DictionaryValue params;
+  scoped_ptr<base::Value> value;
+
+  ASSERT_EQ(kOk, ExecuteQuit(false, &session, params, &value).code());
+  ASSERT_TRUE(chrome->quit_called_);
+
+  chrome->quit_called_ = false;
+  ASSERT_EQ(kOk, ExecuteQuit(true, &session, params, &value).code());
+  ASSERT_TRUE(chrome->quit_called_);
+}
+
+TEST(SessionCommandsTest, QuitWithDetach) {
+  DetachChrome* chrome = new DetachChrome();
+  Session session("id", scoped_ptr<Chrome>(chrome));
+  session.detach = true;
+
+  base::DictionaryValue params;
+  scoped_ptr<base::Value> value;
+
+  ASSERT_EQ(kOk, ExecuteQuit(true, &session, params, &value).code());
+  ASSERT_FALSE(chrome->quit_called_);
+
+  ASSERT_EQ(kOk, ExecuteQuit(false, &session, params, &value).code());
+  ASSERT_TRUE(chrome->quit_called_);
+}
+
+namespace {
+
+class FailsToQuitChrome : public StubChrome {
+ public:
+  FailsToQuitChrome() {}
+  virtual ~FailsToQuitChrome() {}
+
+  // Overridden from Chrome:
+  virtual Status Quit() OVERRIDE {
+    return Status(kUnknownError);
+  }
+};
+
+}  // namespace
+
+TEST(SessionCommandsTest, QuitFails) {
+  Session session("id", scoped_ptr<Chrome>(new FailsToQuitChrome()));
+  base::DictionaryValue params;
+  scoped_ptr<base::Value> value;
+  ASSERT_EQ(kUnknownError, ExecuteQuit(false, &session, params, &value).code());
+}
diff --git a/chrome/test/chromedriver/session_map.h b/chrome/test/chromedriver/session_map.h
deleted file mode 100644
index 1af8884..0000000
--- a/chrome/test/chromedriver/session_map.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_TEST_CHROMEDRIVER_SESSION_MAP_H_
-#define CHROME_TEST_CHROMEDRIVER_SESSION_MAP_H_
-
-#include <string>
-
-#include "base/memory/ref_counted.h"
-#include "chrome/test/chromedriver/synchronized_map.h"
-
-class SessionAccessor;
-
-typedef SynchronizedMap<std::string, scoped_refptr<SessionAccessor> >
-    SessionMap;
-
-#endif  // CHROME_TEST_CHROMEDRIVER_SESSION_MAP_H_
diff --git a/chrome/test/chromedriver/session_thread_map.h b/chrome/test/chromedriver/session_thread_map.h
new file mode 100644
index 0000000..b0eaa57
--- /dev/null
+++ b/chrome/test/chromedriver/session_thread_map.h
@@ -0,0 +1,16 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_CHROMEDRIVER_SESSION_THREAD_MAP_H_
+#define CHROME_TEST_CHROMEDRIVER_SESSION_THREAD_MAP_H_
+
+#include <map>
+#include <string>
+
+#include "base/memory/linked_ptr.h"
+#include "base/threading/thread.h"
+
+typedef std::map<std::string, linked_ptr<base::Thread> > SessionThreadMap;
+
+#endif  // CHROME_TEST_CHROMEDRIVER_SESSION_THREAD_MAP_H_
diff --git a/chrome/test/chromedriver/session_unittest.cc b/chrome/test/chromedriver/session_unittest.cc
index 5f6d0d0..8f0afb2 100644
--- a/chrome/test/chromedriver/session_unittest.cc
+++ b/chrome/test/chromedriver/session_unittest.cc
@@ -5,25 +5,13 @@
 #include <list>
 #include <string>
 
-#include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
 #include "chrome/test/chromedriver/chrome/status.h"
 #include "chrome/test/chromedriver/chrome/stub_chrome.h"
 #include "chrome/test/chromedriver/chrome/stub_web_view.h"
 #include "chrome/test/chromedriver/session.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-TEST(SessionAccessorTest, LocksSession) {
-  scoped_ptr<Session> scoped_session(new Session("id"));
-  Session* session = scoped_session.get();
-  scoped_refptr<SessionAccessor> accessor(
-      new SessionAccessorImpl(scoped_session.Pass()));
-  scoped_ptr<base::AutoLock> lock;
-  ASSERT_EQ(session, accessor->Access(&lock));
-  ASSERT_TRUE(lock.get());
-}
-
 namespace {
 
 class MockChrome : public StubChrome {
diff --git a/chrome/test/chromedriver/synchronized_map.h b/chrome/test/chromedriver/synchronized_map.h
deleted file mode 100644
index a7bbb78..0000000
--- a/chrome/test/chromedriver/synchronized_map.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_TEST_CHROMEDRIVER_SYNCHRONIZED_MAP_H_
-#define CHROME_TEST_CHROMEDRIVER_SYNCHRONIZED_MAP_H_
-
-#include <map>
-#include <utility>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/synchronization/lock.h"
-
-template <typename K, typename V>
-class SynchronizedMap {
- public:
-  SynchronizedMap();
-  ~SynchronizedMap();
-
-  void Set(const K& key, const V& value);
-  bool Get(const K& key, V* value) const;
-  bool Has(const K& key) const;
-  bool Remove(const K& key);
-
-  void GetKeys(std::vector<K>* keys) const;
-
- private:
-  typedef std::map<K, V> Map;
-  Map map_;
-  mutable base::Lock map_lock_;
-
-  DISALLOW_COPY_AND_ASSIGN(SynchronizedMap);
-};
-
-template <typename K, typename V>
-SynchronizedMap<K, V>::SynchronizedMap() {}
-
-template <typename K, typename V>
-SynchronizedMap<K, V>::~SynchronizedMap() {}
-
-template <typename K, typename V>
-void SynchronizedMap<K, V>::Set(const K& key, const V& value) {
-  base::AutoLock lock(map_lock_);
-  typename Map::iterator iter = map_.find(key);
-  if (iter != map_.end())
-    map_.erase(iter);
-  map_.insert(std::make_pair(key, value));
-}
-
-template <typename K, typename V>
-bool SynchronizedMap<K, V>::Get(const K& key, V* value) const {
-  base::AutoLock lock(map_lock_);
-  typename Map::const_iterator iter = map_.find(key);
-  if (iter == map_.end())
-    return false;
-  *value = iter->second;
-  return true;
-}
-
-template <typename K, typename V>
-bool SynchronizedMap<K, V>::Has(const K& key) const {
-  base::AutoLock lock(map_lock_);
-  return map_.find(key) != map_.end();
-}
-
-template <typename K, typename V>
-bool SynchronizedMap<K, V>::Remove(const K& key) {
-  base::AutoLock lock(map_lock_);
-  typename Map::iterator iter = map_.find(key);
-  if (iter == map_.end())
-    return false;
-  map_.erase(iter);
-  return true;
-}
-
-template <typename K, typename V>
-void SynchronizedMap<K, V>::GetKeys(std::vector<K>* keys) const {
-  keys->clear();
-  base::AutoLock lock(map_lock_);
-  typename Map::const_iterator iter;
-  for (iter = map_.begin(); iter != map_.end(); iter++)
-    keys->push_back(iter->first);
-}
-
-#endif  // CHROME_TEST_CHROMEDRIVER_SYNCHRONIZED_MAP_H_
diff --git a/chrome/test/chromedriver/synchronized_map_unittest.cc b/chrome/test/chromedriver/synchronized_map_unittest.cc
deleted file mode 100644
index 4e52395..0000000
--- a/chrome/test/chromedriver/synchronized_map_unittest.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <vector>
-
-#include "chrome/test/chromedriver/synchronized_map.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(SynchronizedMapTest, Set) {
-  SynchronizedMap<int, int> map;
-  map.Set(1, 2);
-  ASSERT_TRUE(map.Has(1));
-  int val = 0;
-  ASSERT_TRUE(map.Get(1, &val));
-  ASSERT_EQ(2, val);
-
-  map.Set(1, 3);
-  ASSERT_TRUE(map.Has(1));
-  ASSERT_TRUE(map.Get(1, &val));
-  ASSERT_EQ(3, val);
-
-  map.Set(3, 1);
-  ASSERT_TRUE(map.Has(1));
-  ASSERT_TRUE(map.Get(1, &val));
-  ASSERT_EQ(3, val);
-  ASSERT_TRUE(map.Has(3));
-  ASSERT_TRUE(map.Get(3, &val));
-  ASSERT_EQ(1, val);
-}
-
-TEST(SynchronizedMapTest, Get) {
-  SynchronizedMap<int, int> map;
-  int val = 0;
-  ASSERT_FALSE(map.Get(1, &val));
-  map.Set(1, 2);
-  ASSERT_TRUE(map.Get(1, &val));
-  ASSERT_EQ(2, val);
-
-  ASSERT_TRUE(map.Remove(1));
-  val = 100;
-  ASSERT_FALSE(map.Get(1, &val));
-  ASSERT_EQ(100, val);
-}
-
-TEST(SynchronizedMapTest, Has) {
-  SynchronizedMap<int, int> map;
-  ASSERT_FALSE(map.Has(1));
-  map.Set(1, 2);
-  ASSERT_TRUE(map.Has(1));
-  ASSERT_FALSE(map.Has(2));
-
-  ASSERT_TRUE(map.Remove(1));
-  ASSERT_FALSE(map.Has(1));
-}
-
-TEST(SynchronizedMapTest, GetKeys) {
-  SynchronizedMap<int, int> map;
-
-  std::vector<int> keys;
-  map.GetKeys(&keys);
-  ASSERT_EQ(0u, keys.size());
-
-  keys.push_back(100);
-  map.GetKeys(&keys);
-  ASSERT_EQ(0u, keys.size());
-
-  map.Set(1, 2);
-  map.GetKeys(&keys);
-  ASSERT_EQ(1u, keys.size());
-  ASSERT_EQ(1, keys[0]);
-
-  map.Set(2, 4);
-  map.GetKeys(&keys);
-  ASSERT_EQ(2u, keys.size());
-  ASSERT_EQ(1, keys[0]);
-  ASSERT_EQ(2, keys[1]);
-}
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 1953ffe..df11ee7 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -38,6 +38,10 @@
 #include "ui/gl/gl_switches.h"
 #include "webkit/plugins/plugin_switches.h"
 
+#if defined(OS_WIN) && defined(USE_ASH)
+#include "base/win/windows_version.h"
+#endif
+
 using content::DomOperationNotificationDetails;
 using content::RenderViewHost;
 
@@ -254,6 +258,14 @@
 }
 
 void PPAPITestBase::RunTestURL(const GURL& test_url) {
+#if defined(OS_WIN) && defined(USE_ASH)
+  // PPAPITests are broken in Ash browser tests (http://crbug.com/263548).
+  if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+    LOG(WARNING) << "PPAPITests are disabled for Ash browser tests.";
+    return;
+  }
+#endif
+
   // See comment above TestingInstance in ppapi/test/testing_instance.h.
   // Basically it sends messages using the DOM automation controller. The
   // value of "..." means it's still working and we should continue to wait,
diff --git a/chrome/utility/extensions/unpacker.cc b/chrome/utility/extensions/unpacker.cc
index 4ae8853..e6bb4bc 100644
--- a/chrome/utility/extensions/unpacker.cc
+++ b/chrome/utility/extensions/unpacker.cc
@@ -23,7 +23,6 @@
 #include "chrome/common/extensions/extension_l10n_util.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/common/extensions/manifest.h"
-#include "chrome/common/url_constants.h"
 #include "content/public/child/image_decoder_utils.h"
 #include "content/public/common/common_param_traits.h"
 #include "extensions/common/constants.h"
@@ -37,7 +36,6 @@
 
 namespace errors = extension_manifest_errors;
 namespace keys = extension_manifest_keys;
-namespace filenames = extension_filenames;
 
 namespace {
 
@@ -162,7 +160,7 @@
 
   // <profile>/Extensions/CRX_INSTALL
   temp_install_dir_ =
-      extension_path_.DirName().AppendASCII(filenames::kTempExtensionName);
+      extension_path_.DirName().AppendASCII(kTempExtensionName);
 
   if (!file_util::CreateDirectory(temp_install_dir_)) {
     SetUTF16Error(
@@ -229,7 +227,7 @@
   IPC::WriteParam(&pickle, internal_data_->decoded_images);
 
   base::FilePath path = extension_path_.DirName().AppendASCII(
-      filenames::kDecodedImagesFilename);
+      kDecodedImagesFilename);
   if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()),
                             pickle.size())) {
     SetError("Could not write image data to disk.");
@@ -244,7 +242,7 @@
   IPC::WriteParam(&pickle, *parsed_catalogs_.get());
 
   base::FilePath path = extension_path_.DirName().AppendASCII(
-      filenames::kDecodedMessageCatalogsFilename);
+      kDecodedMessageCatalogsFilename);
   if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()),
                             pickle.size())) {
     SetError("Could not write message catalogs to disk.");
diff --git a/chrome/utility/extensions/unpacker_unittest.cc b/chrome/utility/extensions/unpacker_unittest.cc
index 3a66b29..8ddd737 100644
--- a/chrome/utility/extensions/unpacker_unittest.cc
+++ b/chrome/utility/extensions/unpacker_unittest.cc
@@ -10,14 +10,13 @@
 #include "base/values.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/extensions/extension_manifest_constants.h"
 #include "chrome/utility/extensions/unpacker.h"
+#include "extensions/common/constants.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 
 namespace errors = extension_manifest_errors;
-namespace filenames = extension_filenames;
 namespace keys = extension_manifest_keys;
 
 namespace extensions {
@@ -134,7 +133,7 @@
   const char* kExpected = "Could not create directory for unzipping: ";
   SetupUnpacker("good_package.crx");
   base::FilePath path =
-      temp_dir_.path().AppendASCII(filenames::kTempExtensionName);
+      temp_dir_.path().AppendASCII(kTempExtensionName);
   ASSERT_TRUE(file_util::WriteFile(path, "foo", 3));
   EXPECT_FALSE(unpacker_->Run());
   EXPECT_TRUE(StartsWith(unpacker_->error_message(),
diff --git a/chrome/utility/local_discovery/local_domain_resolver.cc b/chrome/utility/local_discovery/local_domain_resolver.cc
deleted file mode 100644
index abe629d..0000000
--- a/chrome/utility/local_discovery/local_domain_resolver.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/bind.h"
-#include "chrome/utility/local_discovery/local_domain_resolver.h"
-#include "net/dns/dns_protocol.h"
-#include "net/dns/record_parsed.h"
-#include "net/dns/record_rdata.h"
-
-namespace local_discovery {
-
-LocalDomainResolver::LocalDomainResolver(net::MDnsClient* mdns_client,
-                                         const std::string& domain,
-                                         net::AddressFamily address_family,
-                                         const IPAddressCallback& callback)
-    : domain_(domain), address_family_(address_family), callback_(callback),
-      transaction_failures_(0), mdns_client_(mdns_client) {
-}
-
-LocalDomainResolver::~LocalDomainResolver() {
-}
-
-bool LocalDomainResolver::Start() {
-  if (address_family_ == net::ADDRESS_FAMILY_IPV4 ||
-      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
-    transaction_a_ = CreateTransaction(net::dns_protocol::kTypeA);
-    if (!transaction_a_->Start())
-      return false;
-  }
-
-  if (address_family_ == net::ADDRESS_FAMILY_IPV6 ||
-      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
-    transaction_aaaa_ = CreateTransaction(net::dns_protocol::kTypeAAAA);
-    if (!transaction_aaaa_->Start())
-      return false;
-  }
-
-  return true;
-}
-
-scoped_ptr<net::MDnsTransaction> LocalDomainResolver::CreateTransaction(
-    uint16 type) {
-  return mdns_client_->CreateTransaction(
-      type, domain_, net::MDnsTransaction::SINGLE_RESULT |
-                     net::MDnsTransaction::QUERY_CACHE |
-                     net::MDnsTransaction::QUERY_NETWORK,
-      base::Bind(&LocalDomainResolver::OnTransactionComplete,
-                 base::Unretained(this)));
-}
-
-void LocalDomainResolver::OnTransactionComplete(
-    net::MDnsTransaction::Result result, const net::RecordParsed* record) {
-  if (result != net::MDnsTransaction::RESULT_RECORD &&
-      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
-    transaction_failures_++;
-
-    if (transaction_failures_ < 2) {
-      return;
-    }
-  }
-
-  transaction_a_.reset();
-  transaction_aaaa_.reset();
-
-  net::IPAddressNumber address;
-  if (result == net::MDnsTransaction::RESULT_RECORD) {
-    if (record->type() == net::dns_protocol::kTypeA) {
-      const net::ARecordRdata* rdata = record->rdata<net::ARecordRdata>();
-      DCHECK(rdata);
-      address = rdata->address();
-    } else {
-      DCHECK(record->type() == net::dns_protocol::kTypeAAAA);
-      const net::AAAARecordRdata* rdata = record->rdata<net::AAAARecordRdata>();
-      address = rdata->address();
-    }
-  }
-
-  callback_.Run(result == net::MDnsTransaction::RESULT_RECORD, address);
-}
-
-}  // namespace local_discovery
diff --git a/chrome/utility/local_discovery/local_domain_resolver.h b/chrome/utility/local_discovery/local_domain_resolver.h
deleted file mode 100644
index dc17e9d..0000000
--- a/chrome/utility/local_discovery/local_domain_resolver.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-
-#include "base/callback.h"
-#include "net/base/address_family.h"
-#include "net/base/net_util.h"
-#include "net/dns/mdns_client.h"
-
-#ifndef CHROME_UTILITY_LOCAL_DISCOVERY_LOCAL_DOMAIN_RESOLVER_H_
-#define CHROME_UTILITY_LOCAL_DISCOVERY_LOCAL_DOMAIN_RESOLVER_H_
-
-namespace local_discovery {
-
-class LocalDomainResolver {
- public:
-  typedef base::Callback<void(bool, const net::IPAddressNumber&)>
-      IPAddressCallback;
-
-  // |mdns_client| must outlive the LocalDomainResolver.
-  LocalDomainResolver(net::MDnsClient* mdns_client,
-                      const std::string& domain,
-                      net::AddressFamily address_family,
-                      const IPAddressCallback& callback);
-  ~LocalDomainResolver();
-
-  bool Start();
-
-  const std::string& domain() { return domain_; }
-
- private:
-  void OnTransactionComplete(
-      net::MDnsTransaction::Result result,
-      const net::RecordParsed* record);
-
-  scoped_ptr<net::MDnsTransaction> CreateTransaction(uint16 type);
-
-  std::string domain_;
-  net::AddressFamily address_family_;
-  IPAddressCallback callback_;
-
-  scoped_ptr<net::MDnsTransaction> transaction_a_;
-  scoped_ptr<net::MDnsTransaction> transaction_aaaa_;
-
-  int transaction_failures_;
-
-  net::MDnsClient* mdns_client_;
-
-  DISALLOW_COPY_AND_ASSIGN(LocalDomainResolver);
-};
-
-}  // namespace local_discovery
-
-#endif  // CHROME_UTILITY_LOCAL_DISCOVERY_LOCAL_DOMAIN_RESOLVER_H_
diff --git a/chrome/utility/local_discovery/local_domain_resolver_unittest.cc b/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
index c0530af..c1fd51c 100644
--- a/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
+++ b/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/utility/local_discovery/local_domain_resolver.h"
+#include "chrome/utility/local_discovery/service_discovery_client_impl.h"
 #include "net/dns/mdns_client_impl.h"
 #include "net/dns/mock_mdns_socket_factory.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -101,15 +101,15 @@
 };
 
 TEST_F(LocalDomainResolverTest, ResolveDomainA) {
-  LocalDomainResolver resolver(
-      &mdns_client_, "myhello.local", net::ADDRESS_FAMILY_IPV4,
+  LocalDomainResolverImpl resolver(
+      "myhello.local", net::ADDRESS_FAMILY_IPV4,
       base::Bind(&LocalDomainResolverTest::AddressCallback,
-                 base::Unretained(this)));
+                 base::Unretained(this)), &mdns_client_);
 
   EXPECT_CALL(*socket_factory_, OnSendTo(_))
       .Times(2);  // Twice per query
 
-  EXPECT_TRUE(resolver.Start());
+  resolver.Start();
 
   EXPECT_CALL(*this, AddressCallbackInternal(true, "1.2.3.4"));
 
@@ -118,15 +118,15 @@
 }
 
 TEST_F(LocalDomainResolverTest, ResolveDomainAAAA) {
-  LocalDomainResolver resolver(
-      &mdns_client_, "myhello.local", net::ADDRESS_FAMILY_IPV6,
+  LocalDomainResolverImpl resolver(
+      "myhello.local", net::ADDRESS_FAMILY_IPV6,
       base::Bind(&LocalDomainResolverTest::AddressCallback,
-                 base::Unretained(this)));
+                 base::Unretained(this)), &mdns_client_);
 
   EXPECT_CALL(*socket_factory_, OnSendTo(_))
       .Times(2);  // Twice per query
 
-  EXPECT_TRUE(resolver.Start());
+  resolver.Start();
 
   EXPECT_CALL(*this, AddressCallbackInternal(true, "a::1:2:3:4"));
 
@@ -135,15 +135,15 @@
 }
 
 TEST_F(LocalDomainResolverTest, ResolveDomainAny) {
-  LocalDomainResolver resolver(
-      &mdns_client_, "myhello.local", net::ADDRESS_FAMILY_UNSPECIFIED,
+  LocalDomainResolverImpl resolver(
+      "myhello.local", net::ADDRESS_FAMILY_UNSPECIFIED,
       base::Bind(&LocalDomainResolverTest::AddressCallback,
-                 base::Unretained(this)));
+                 base::Unretained(this)), &mdns_client_);
 
   EXPECT_CALL(*socket_factory_, OnSendTo(_))
       .Times(4);  // Twice per query
 
-  EXPECT_TRUE(resolver.Start());
+  resolver.Start();
 
   EXPECT_CALL(*this, AddressCallbackInternal(true, "a::1:2:3:4"));
 
@@ -152,15 +152,15 @@
 }
 
 TEST_F(LocalDomainResolverTest, ResolveDomainNone) {
-  LocalDomainResolver resolver(
-      &mdns_client_, "myhello.local", net::ADDRESS_FAMILY_UNSPECIFIED,
+  LocalDomainResolverImpl resolver(
+      "myhello.local", net::ADDRESS_FAMILY_UNSPECIFIED,
       base::Bind(&LocalDomainResolverTest::AddressCallback,
-                 base::Unretained(this)));
+                 base::Unretained(this)), &mdns_client_);
 
   EXPECT_CALL(*socket_factory_, OnSendTo(_))
       .Times(4);  // Twice per query
 
-  EXPECT_TRUE(resolver.Start());
+  resolver.Start();
 
   EXPECT_CALL(*this, AddressCallbackInternal(false, ""));
 
diff --git a/chrome/utility/local_discovery/service_discovery_client_impl.cc b/chrome/utility/local_discovery/service_discovery_client_impl.cc
index 7e00922..524f176 100644
--- a/chrome/utility/local_discovery/service_discovery_client_impl.cc
+++ b/chrome/utility/local_discovery/service_discovery_client_impl.cc
@@ -35,6 +35,15 @@
       service_name, callback, mdns_client_));
 }
 
+scoped_ptr<LocalDomainResolver>
+ServiceDiscoveryClientImpl::CreateLocalDomainResolver(
+      const std::string& domain,
+      net::AddressFamily address_family,
+      const LocalDomainResolver::IPAddressCallback& callback) {
+  return scoped_ptr<LocalDomainResolver>(new LocalDomainResolverImpl(
+      domain, address_family, callback, mdns_client_));
+}
+
 ServiceWatcherImpl::ServiceWatcherImpl(
     const std::string& service_type,
     const ServiceWatcher::UpdatedCallback& callback,
@@ -378,4 +387,69 @@
   return a_rdata->address();
 }
 
+LocalDomainResolverImpl::LocalDomainResolverImpl(
+    const std::string& domain,
+    net::AddressFamily address_family,
+    const IPAddressCallback& callback,
+    net::MDnsClient* mdns_client)
+    : domain_(domain), address_family_(address_family), callback_(callback),
+      transaction_failures_(0), mdns_client_(mdns_client) {
+}
+
+LocalDomainResolverImpl::~LocalDomainResolverImpl() {
+}
+
+void LocalDomainResolverImpl::Start() {
+  if (address_family_ == net::ADDRESS_FAMILY_IPV4 ||
+      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
+    transaction_a_ = CreateTransaction(net::dns_protocol::kTypeA);
+    transaction_a_->Start();
+  }
+
+  if (address_family_ == net::ADDRESS_FAMILY_IPV6 ||
+      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
+    transaction_aaaa_ = CreateTransaction(net::dns_protocol::kTypeAAAA);
+    transaction_aaaa_->Start();
+  }
+}
+
+scoped_ptr<net::MDnsTransaction> LocalDomainResolverImpl::CreateTransaction(
+    uint16 type) {
+  return mdns_client_->CreateTransaction(
+      type, domain_, net::MDnsTransaction::SINGLE_RESULT |
+                     net::MDnsTransaction::QUERY_CACHE |
+                     net::MDnsTransaction::QUERY_NETWORK,
+      base::Bind(&LocalDomainResolverImpl::OnTransactionComplete,
+                 base::Unretained(this)));
+}
+
+void LocalDomainResolverImpl::OnTransactionComplete(
+    net::MDnsTransaction::Result result, const net::RecordParsed* record) {
+  if (result != net::MDnsTransaction::RESULT_RECORD &&
+      address_family_ == net::ADDRESS_FAMILY_UNSPECIFIED) {
+    transaction_failures_++;
+
+    if (transaction_failures_ < 2) {
+      return;
+    }
+  }
+
+  transaction_a_.reset();
+  transaction_aaaa_.reset();
+
+  net::IPAddressNumber address;
+  if (result == net::MDnsTransaction::RESULT_RECORD) {
+    if (record->type() == net::dns_protocol::kTypeA) {
+      const net::ARecordRdata* rdata = record->rdata<net::ARecordRdata>();
+      address = rdata->address();
+    } else {
+      DCHECK_EQ(net::dns_protocol::kTypeAAAA, record->type());
+      const net::AAAARecordRdata* rdata = record->rdata<net::AAAARecordRdata>();
+      address = rdata->address();
+    }
+  }
+
+  callback_.Run(result == net::MDnsTransaction::RESULT_RECORD, address);
+}
+
 }  // namespace local_discovery
diff --git a/chrome/utility/local_discovery/service_discovery_client_impl.h b/chrome/utility/local_discovery/service_discovery_client_impl.h
index f7506ca..f04f311 100644
--- a/chrome/utility/local_discovery/service_discovery_client_impl.h
+++ b/chrome/utility/local_discovery/service_discovery_client_impl.h
@@ -33,6 +33,12 @@
   virtual scoped_ptr<ServiceResolver> CreateServiceResolver(
       const std::string& service_name,
       const ServiceResolver::ResolveCompleteCallback& callback) OVERRIDE;
+
+  virtual scoped_ptr<LocalDomainResolver> CreateLocalDomainResolver(
+      const std::string& domain,
+      net::AddressFamily address_family,
+      const LocalDomainResolver::IPAddressCallback& callback) OVERRIDE;
+
  private:
   net::MDnsClient* mdns_client_;
 
@@ -187,6 +193,40 @@
   DISALLOW_COPY_AND_ASSIGN(ServiceResolverImpl);
 };
 
+class LocalDomainResolverImpl : public LocalDomainResolver {
+ public:
+  LocalDomainResolverImpl(const std::string& domain,
+                          net::AddressFamily address_family,
+                          const IPAddressCallback& callback,
+                          net::MDnsClient* mdns_client);
+  virtual ~LocalDomainResolverImpl();
+
+  virtual void Start() OVERRIDE;
+
+  const std::string& domain() { return domain_; }
+
+ private:
+  void OnTransactionComplete(
+      net::MDnsTransaction::Result result,
+      const net::RecordParsed* record);
+
+  scoped_ptr<net::MDnsTransaction> CreateTransaction(uint16 type);
+
+  std::string domain_;
+  net::AddressFamily address_family_;
+  IPAddressCallback callback_;
+
+  scoped_ptr<net::MDnsTransaction> transaction_a_;
+  scoped_ptr<net::MDnsTransaction> transaction_aaaa_;
+
+  int transaction_failures_;
+
+  net::MDnsClient* mdns_client_;
+
+  DISALLOW_COPY_AND_ASSIGN(LocalDomainResolverImpl);
+};
+
+
 }  // namespace local_discovery
 
 #endif  // CHROME_UTILITY_LOCAL_DISCOVERY_SERVICE_DISCOVERY_CLIENT_IMPL_H_
diff --git a/chrome_frame/buggy_bho_handling.cc b/chrome_frame/buggy_bho_handling.cc
index fef41f4..491bae5 100644
--- a/chrome_frame/buggy_bho_handling.cc
+++ b/chrome_frame/buggy_bho_handling.cc
@@ -7,7 +7,7 @@
 #include <algorithm>
 
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/win/scoped_comptr.h"
 #include "chrome_frame/exception_barrier.h"
 #include "chrome_frame/function_stub.h"
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index b99ba0b..9a76b78 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -15,7 +15,6 @@
 #include "base/logging.h"
 #include "base/memory/singleton.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 4735e64..bcf4f06 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -14,7 +14,7 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/synchronization/lock.h"
diff --git a/chrome_frame/chrome_frame_unittest_main.cc b/chrome_frame/chrome_frame_unittest_main.cc
index 14042b0..f8be06e 100644
--- a/chrome_frame/chrome_frame_unittest_main.cc
+++ b/chrome_frame/chrome_frame_unittest_main.cc
@@ -4,9 +4,11 @@
 
 #include <atlbase.h>
 #include <atlcom.h>
+
 #include "base/at_exit.h"
 #include "base/command_line.h"
-#include "base/process.h"
+#include "base/process/kill.h"
+#include "base/process/process.h"
 #include "chrome_frame/crash_server_init.h"
 #include "chrome_frame/test/chrome_frame_test_utils.h"
 #include "gtest/gtest.h"
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 8728c95..6ddfd49 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -18,6 +18,7 @@
 #include "base/logging.h"
 #include "base/logging_win.h"
 #include "base/path_service.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece.h"
diff --git a/chrome_frame/ready_mode/internal/registry_ready_mode_state.cc b/chrome_frame/ready_mode/internal/registry_ready_mode_state.cc
index 4ff419d..0a66e7d 100644
--- a/chrome_frame/ready_mode/internal/registry_ready_mode_state.cc
+++ b/chrome_frame/ready_mode/internal/registry_ready_mode_state.cc
@@ -7,7 +7,7 @@
 #include <windows.h>
 
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/time/time.h"
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index ff0e6ef..6041030 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -9,6 +9,7 @@
 #include <iepmapi.h>
 #include <sddl.h>
 #include <shlobj.h>
+#include <TlHelp32.h>
 #include <winsock2.h>
 
 #include "base/command_line.h"
@@ -17,8 +18,10 @@
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process.h"
+#include "base/process/process_iterator.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece.h"
 #include "base/strings/string_util.h"
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index 926143a..f9c08e2 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -18,7 +18,7 @@
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/run_loop.h"
 #include "base/test/test_reg_util_win.h"
 #include "base/time/time.h"
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc
index b9af356..5431f1e 100644
--- a/chrome_frame/test/html_util_unittests.cc
+++ b/chrome_frame/test/html_util_unittests.cc
@@ -14,7 +14,6 @@
 #include "base/memory/scoped_handle.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "net/base/net_util.h"
 
diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h
index bf0ebc8..f4dac94 100644
--- a/chrome_frame/test/net/fake_external_tab.h
+++ b/chrome_frame/test/net/fake_external_tab.h
@@ -10,7 +10,7 @@
 #include "base/cancelable_callback.h"
 #include "base/files/file_path.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/win/scoped_handle.h"
 #include "chrome/browser/browser_process_impl.h"
 #include "chrome_frame/test/net/test_automation_provider.h"
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index f068264..443d441 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 #include "chrome_frame/test/perf/chrome_frame_perftest.h"
 
-#include <atlwin.h>
 #include <atlhost.h>
+#include <atlwin.h>
 
 #include <map>
 #include <string>
@@ -15,7 +15,9 @@
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_iterator.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/chrome_frame/test/perf/run_all.cc b/chrome_frame/test/perf/run_all.cc
index c6ff9fa..f4945e3 100644
--- a/chrome_frame/test/perf/run_all.cc
+++ b/chrome_frame/test/perf/run_all.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "base/memory/scoped_ptr.h"
+#include "base/process/kill.h"
 #include "base/test/perf_test_suite.h"
 #include "base/threading/platform_thread.h"
 #include "chrome/common/chrome_paths.h"
diff --git a/chrome_frame/test/reliability/run_all_unittests.cc b/chrome_frame/test/reliability/run_all_unittests.cc
index d1572aa..72b8ef8 100644
--- a/chrome_frame/test/reliability/run_all_unittests.cc
+++ b/chrome_frame/test/reliability/run_all_unittests.cc
@@ -5,6 +5,7 @@
 #include "chrome_frame/test/reliability/reliability_test_suite.h"
 
 #include "base/command_line.h"
+#include "base/process/kill.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome_frame/test/chrome_frame_test_utils.h"
 #include "chrome_frame/test_utils.h"
diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc
index f9b7335..97fb40b 100644
--- a/chrome_frame/test/run_all_unittests.cc
+++ b/chrome_frame/test/run_all_unittests.cc
@@ -5,7 +5,8 @@
 #include <atlbase.h>
 
 #include "base/command_line.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/memory.h"
 #include "base/test/test_suite.h"
 #include "base/threading/platform_thread.h"
 #include "base/win/scoped_com_initializer.h"
diff --git a/chrome_frame/test/simulate_input.h b/chrome_frame/test/simulate_input.h
index 97f7e0e..7992768 100644
--- a/chrome_frame/test/simulate_input.h
+++ b/chrome_frame/test/simulate_input.h
@@ -9,7 +9,7 @@
 #include <string>
 
 #include "base/basictypes.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 
 namespace simulate_input {
 
diff --git a/chrome_frame/test/test_scrubber.cc b/chrome_frame/test/test_scrubber.cc
index dc8902c..8881a8b 100644
--- a/chrome_frame/test/test_scrubber.cc
+++ b/chrome_frame/test/test_scrubber.cc
@@ -15,7 +15,7 @@
 #include "base/files/file_path.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/test_process_killer_win.h"
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index b002022..68df297 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -10,6 +10,7 @@
 #include "base/files/memory_mapped_file.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/path_service.h"
+#include "base/process/kill.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/test_timeouts.h"
diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc
index a473732..ef78046 100644
--- a/chrome_frame/test_utils.cc
+++ b/chrome_frame/test_utils.cc
@@ -15,7 +15,8 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/scoped_handle.h"
diff --git a/chrome_frame/turndown_prompt/turndown_prompt.cc b/chrome_frame/turndown_prompt/turndown_prompt.cc
index 4d26a2f..513852a 100644
--- a/chrome_frame/turndown_prompt/turndown_prompt.cc
+++ b/chrome_frame/turndown_prompt/turndown_prompt.cc
@@ -12,7 +12,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/win/scoped_bstr.h"
 #include "base/win/scoped_comptr.h"
 #include "base/win/win_util.h"
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM
index 76eade3..f62c049 100644
--- a/chromeos/CHROMEOS_LKGM
+++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@
-4441.0.0
\ No newline at end of file
+4443.0.0
\ No newline at end of file
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc
index 9ef642b..a61b91b 100644
--- a/chromeos/chromeos_switches.cc
+++ b/chromeos/chromeos_switches.cc
@@ -127,6 +127,10 @@
 const char kFileManagerEnableFolderShortcuts[] =
     "file-manager-enable-folder-shortcuts";
 
+// Enables the webstore integration feature in the Files.app.
+const char kFileManagerEnableWebstoreIntegration[] =
+    "file-manager-enable-webstore-integration";
+
 // Passed to Chrome on first boot. Not passed on restart after sign out.
 const char kFirstBoot[]                     = "first-boot";
 
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h
index 6c892a4..4d36520 100644
--- a/chromeos/chromeos_switches.h
+++ b/chromeos/chromeos_switches.h
@@ -53,6 +53,7 @@
 CHROMEOS_EXPORT extern const char kFileManagerShowCheckboxes[];
 CHROMEOS_EXPORT extern const char kFileManagerEnableSharing[];
 CHROMEOS_EXPORT extern const char kFileManagerEnableFolderShortcuts[];
+CHROMEOS_EXPORT extern const char kFileManagerEnableWebstoreIntegration[];
 CHROMEOS_EXPORT extern const char kFirstBoot[];
 CHROMEOS_EXPORT extern const char kForceLoginManagerInTests[];
 CHROMEOS_EXPORT extern const char kGuestSession[];
diff --git a/chromeos/ime/component_extension_ime_manager.cc b/chromeos/ime/component_extension_ime_manager.cc
index c557d09..c65bb5d 100644
--- a/chromeos/ime/component_extension_ime_manager.cc
+++ b/chromeos/ime/component_extension_ime_manager.cc
@@ -128,11 +128,13 @@
   std::vector<std::string> result;
   for (size_t i = 0; i < component_extension_imes_.size(); ++i) {
     for (size_t j = 0; j < component_extension_imes_[i].engines.size(); ++j) {
-      if (component_extension_imes_[i].engines[j].language_code == language)
-        result.push_back(
-            GetComponentExtensionIMEId(
-                component_extension_imes_[i].id,
-                component_extension_imes_[i].engines[j].engine_id));
+      const ComponentExtensionIME& ime = component_extension_imes_[i];
+      if (std::find(ime.engines[j].language_codes.begin(),
+                    ime.engines[j].language_codes.end(),
+                    language) != ime.engines[j].language_codes.end()) {
+        result.push_back(GetComponentExtensionIMEId(ime.id,
+                                                    ime.engines[j].engine_id));
+      }
     }
   }
   return result;
@@ -143,9 +145,6 @@
   input_method::InputMethodDescriptors result;
   for (size_t i = 0; i < component_extension_imes_.size(); ++i) {
     for (size_t j = 0; j < component_extension_imes_[i].engines.size(); ++j) {
-      std::vector<std::string> languages;
-      languages.push_back(
-          component_extension_imes_[i].engines[j].language_code);
       result.push_back(
           input_method::InputMethodDescriptor(
               GetComponentExtensionIMEId(
@@ -153,7 +152,7 @@
                   component_extension_imes_[i].engines[j].engine_id),
               component_extension_imes_[i].engines[j].display_name,
               component_extension_imes_[i].engines[j].layouts,
-              languages,
+              component_extension_imes_[i].engines[j].language_codes,
               component_extension_imes_[i].options_page_url));
     }
   }
diff --git a/chromeos/ime/component_extension_ime_manager.h b/chromeos/ime/component_extension_ime_manager.h
index 23a5d89..2685ee8 100644
--- a/chromeos/ime/component_extension_ime_manager.h
+++ b/chromeos/ime/component_extension_ime_manager.h
@@ -19,7 +19,7 @@
   ~ComponentExtensionEngine();
   std::string engine_id;  // The engine id.
   std::string display_name;  // The display name.
-  std::string language_code;  // The engine's language(ex. "en").
+  std::vector<std::string> language_codes;  // The engine's language(ex. "en").
   std::string description;  // The engine description.
   std::vector<std::string> layouts;  // The list of keyboard layout of engine.
 };
diff --git a/chromeos/ime/component_extension_ime_manager_unittest.cc b/chromeos/ime/component_extension_ime_manager_unittest.cc
index d404480..4fc66ab 100644
--- a/chromeos/ime/component_extension_ime_manager_unittest.cc
+++ b/chromeos/ime/component_extension_ime_manager_unittest.cc
@@ -41,21 +41,21 @@
     ComponentExtensionEngine ext1_engine1;
     ext1_engine1.engine_id = "ext1_engine1_engine_id";
     ext1_engine1.display_name = "ext1_engine_1_display_name";
-    ext1_engine1.language_code = "en";
+    ext1_engine1.language_codes.push_back("en");
     ext1_engine1.layouts.push_back("us");
     ext1.engines.push_back(ext1_engine1);
 
     ComponentExtensionEngine ext1_engine2;
     ext1_engine2.engine_id = "ext1_engine2_engine_id";
     ext1_engine2.display_name = "ext1_engine2_display_name";
-    ext1_engine2.language_code = "en";
+    ext1_engine2.language_codes.push_back("en");
     ext1_engine2.layouts.push_back("us");
     ext1.engines.push_back(ext1_engine2);
 
     ComponentExtensionEngine ext1_engine3;
     ext1_engine3.engine_id = "ext1_engine3_engine_id";
     ext1_engine3.display_name = "ext1_engine3_display_name";
-    ext1_engine3.language_code = "ja";
+    ext1_engine3.language_codes.push_back("ja");
     ext1_engine3.layouts.push_back("us");
     ext1.engines.push_back(ext1_engine3);
 
@@ -69,21 +69,21 @@
     ComponentExtensionEngine ext2_engine1;
     ext2_engine1.engine_id = "ext2_engine1_engine_id";
     ext2_engine1.display_name = "ext2_engine_1_display_name";
-    ext2_engine1.language_code = "en";
+    ext2_engine1.language_codes.push_back("en");
     ext2_engine1.layouts.push_back("us");
     ext2.engines.push_back(ext2_engine1);
 
     ComponentExtensionEngine ext2_engine2;
     ext2_engine2.engine_id = "ext2_engine2_engine_id";
     ext2_engine2.display_name = "ext2_engine2_display_name";
-    ext2_engine2.language_code = "hi";
+    ext2_engine2.language_codes.push_back("hi");
     ext2_engine2.layouts.push_back("us");
     ext2.engines.push_back(ext2_engine2);
 
     ComponentExtensionEngine ext2_engine3;
     ext2_engine3.engine_id = "ext2_engine3_engine_id";
     ext2_engine3.display_name = "ext2_engine3_display_name";
-    ext2_engine3.language_code = "ja";
+    ext2_engine3.language_codes.push_back("ja");
     ext2_engine3.layouts.push_back("jp");
     ext2.engines.push_back(ext2_engine3);
 
@@ -92,28 +92,28 @@
     ComponentExtensionIME ext3;
     ext3.id = "ext3_id";
     ext3.description = "ext3_description";
-    ext1.options_page_url =
-        GURL("chrome-extension://" + ext3.id + "/options.html");
+    ext3.options_page_url =
+    GURL("chrome-extension://" + ext3.id + "/options.html");
     ext3.path = base::FilePath("ext3_file_path");
 
     ComponentExtensionEngine ext3_engine1;
     ext3_engine1.engine_id = "ext3_engine1_engine_id";
     ext3_engine1.display_name = "ext3_engine_1_display_name";
-    ext3_engine1.language_code = "hi";
+    ext3_engine1.language_codes.push_back("hi");
     ext3_engine1.layouts.push_back("us");
     ext3.engines.push_back(ext3_engine1);
 
     ComponentExtensionEngine ext3_engine2;
     ext3_engine2.engine_id = "ext3_engine2_engine_id";
     ext3_engine2.display_name = "ext3_engine2_display_name";
-    ext3_engine2.language_code = "en";
+    ext3_engine2.language_codes.push_back("en");
     ext3_engine2.layouts.push_back("us");
     ext3.engines.push_back(ext3_engine2);
 
     ComponentExtensionEngine ext3_engine3;
     ext3_engine3.engine_id = "ext3_engine3_engine_id";
     ext3_engine3.display_name = "ext3_engine3_display_name";
-    ext3_engine3.language_code = "en";
+    ext3_engine3.language_codes.push_back("en");
     ext3_engine3.layouts.push_back("us");
     ext3.engines.push_back(ext3_engine3);
 
diff --git a/chromeos/ime/ibus_daemon_controller.cc b/chromeos/ime/ibus_daemon_controller.cc
index e3c46f8..c328512 100644
--- a/chromeos/ime/ibus_daemon_controller.cc
+++ b/chromeos/ime/ibus_daemon_controller.cc
@@ -11,7 +11,8 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/observer_list.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/rand_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
diff --git a/chromeos/ime/input_method_manager.h b/chromeos/ime/input_method_manager.h
index bfeacf6..5a94455 100644
--- a/chromeos/ime/input_method_manager.h
+++ b/chromeos/ime/input_method_manager.h
@@ -98,6 +98,11 @@
   // extension input methods.
   virtual scoped_ptr<InputMethodDescriptors> GetActiveInputMethods() const = 0;
 
+  // Returns the list of input methods we can select (i.e. active) including
+  // extension input methods.
+  // The same as GetActiveInputMethods but returns reference to internal list.
+  virtual const std::vector<std::string>& GetActiveInputMethodIds() const = 0;
+
   // Returns the number of active input methods including extension input
   // methods.
   virtual size_t GetNumActiveInputMethods() const = 0;
@@ -125,6 +130,11 @@
   virtual bool EnableInputMethods(
       const std::vector<std::string>& new_active_input_method_ids) = 0;
 
+  // Adds one entry to the list of active input method IDs, and then starts or
+  // stops the system input method framework as needed.
+  virtual bool EnableInputMethod(
+      const std::string& new_active_input_method_id) = 0;
+
   // Remaps old input methods like "mozc" to new input methods. Return true if
   // at least one IME is migrated.
   // TODO(nona): Remove this function after few milestones are passed.
@@ -180,11 +190,15 @@
   virtual bool SwitchToNextInputMethod() = 0;
 
   // Switches the current input method (or keyboard layout) to the previous one.
-  virtual bool SwitchToPreviousInputMethod() = 0;
+  virtual bool SwitchToPreviousInputMethod(
+      const ui::Accelerator& accelerator) = 0;
 
   // Switches to an input method (or keyboard layout) which is associated with
   // the |accelerator|.
   virtual bool SwitchInputMethod(const ui::Accelerator& accelerator) = 0;
+
+  // If keyboard layout can be uset at login screen
+  virtual bool IsFullLatinKeyboard(const std::string& layout) const = 0;
 };
 
 }  // namespace input_method
diff --git a/chromeos/ime/input_methods.txt b/chromeos/ime/input_methods.txt
index 85ee9b9..213ea96 100644
--- a/chromeos/ime/input_methods.txt
+++ b/chromeos/ime/input_methods.txt
@@ -56,6 +56,15 @@
 #   XKB layout), you should also update IsMod3UsedByCurrentInputMethod() method
 #   in chrome/browser/ui/ash/event_rewriter.cc. Otherwise, Mod3Mask might be
 #   removed unexpectedly by the rewriter.
+#
+#   If you add a new language such that some of its layouts can be used at
+#   signin screen (e.g. it is "Full Latin Keyboard Layout" therefore allowing
+#   input of gmail password), you should also update
+#   kHasLatinKeyboardLanguageList[] in
+#   chrome/browser/chromeos/input_method/input_method_manager_impl_ll.cc
+#
+#   If you add a new keyboard layout for existing language, please ensure
+#   that information in kHasLatinKeyboardLanguageList[] is still correct.
 
 # U.S. English
 xkb:us::eng	us	en-US
diff --git a/chromeos/ime/xkeyboard.cc b/chromeos/ime/xkeyboard.cc
index b8c2e28..b73a8d1 100644
--- a/chromeos/ime/xkeyboard.cc
+++ b/chromeos/ime/xkeyboard.cc
@@ -14,7 +14,8 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/threading/thread_checker.h"
diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc
index 781a097..714304f 100644
--- a/chromeos/network/device_state.cc
+++ b/chromeos/network/device_state.cc
@@ -65,6 +65,15 @@
     return GetStringValue(key, value, &technology_family_);
   } else if (key == flimflam::kCarrierProperty) {
     return GetStringValue(key, value, &carrier_);
+  } else if (key == flimflam::kFoundNetworksProperty) {
+    const base::ListValue* list = NULL;
+    if (!value.GetAsList(&list))
+      return false;
+    CellularScanResults parsed_results;
+    if (!network_util::ParseCellularScanResults(*list, &parsed_results))
+      return false;
+    scan_results_.swap(parsed_results);
+    return true;
   } else if (key == flimflam::kSIMLockStatusProperty) {
     const base::DictionaryValue* dict = NULL;
     if (!value.GetAsDictionary(&dict))
diff --git a/chromeos/network/device_state.h b/chromeos/network/device_state.h
index 08bc6fb..00a6cdc 100644
--- a/chromeos/network/device_state.h
+++ b/chromeos/network/device_state.h
@@ -7,6 +7,7 @@
 
 #include "base/values.h"
 #include "chromeos/network/managed_state.h"
+#include "chromeos/network/network_util.h"
 
 namespace chromeos {
 
@@ -14,6 +15,8 @@
 // see network_state.h for usage guidelines.
 class CHROMEOS_EXPORT DeviceState : public ManagedState {
  public:
+  typedef std::vector<CellularScanResult> CellularScanResults;
+
   explicit DeviceState(const std::string& path);
   virtual ~DeviceState();
 
@@ -38,6 +41,7 @@
   const std::string& imei() const { return imei_; }
   const std::string& iccid() const { return iccid_; }
   const std::string& mdn() const { return mdn_; }
+  const CellularScanResults& scan_results() const { return scan_results_; }
   const DictionaryValue& properties() const { return properties_; }
 
   // Returns true if the technology family is GSM and sim_present_ is false.
@@ -61,6 +65,7 @@
   std::string imei_;
   std::string iccid_;
   std::string mdn_;
+  CellularScanResults scan_results_;
   // Keep all Device properties in a dictionary. Devices are limited and should
   // change rarely if ever, so the overhead for this is small.
   DictionaryValue properties_;
diff --git a/chromeos/network/network_device_handler.cc b/chromeos/network/network_device_handler.cc
index 47acf7d..8933003 100644
--- a/chromeos/network/network_device_handler.cc
+++ b/chromeos/network/network_device_handler.cc
@@ -99,6 +99,27 @@
     callback.Run();
 }
 
+void ProposeScanCallback(
+    const std::string& device_path,
+    const base::Closure& callback,
+    const network_handler::ErrorCallback& error_callback,
+    DBusMethodCallStatus call_status) {
+  if (call_status != DBUS_METHOD_CALL_SUCCESS) {
+    NET_LOG_ERROR(
+        base::StringPrintf("Device.ProposeScan failed: %d", call_status),
+        device_path);
+    network_handler::ShillErrorCallbackFunction(
+        "Device.ProposeScan Failed",
+        device_path,
+        error_callback,
+        base::StringPrintf("DBus call failed: %d", call_status), "");
+    return;
+  }
+  NET_LOG_EVENT("Device.ProposeScan succeeded.", device_path);
+  if (!callback.is_null())
+    callback.Run();
+}
+
 }  // namespace
 
 const char NetworkDeviceHandler::kErrorFailure[] = "failure";
@@ -148,6 +169,15 @@
                       error_callback);
 }
 
+void NetworkDeviceHandler::ProposeScan(
+    const std::string& device_path,
+    const base::Closure& callback,
+    const network_handler::ErrorCallback& error_callback) {
+  DBusThreadManager::Get()->GetShillDeviceClient()->ProposeScan(
+      dbus::ObjectPath(device_path),
+      base::Bind(&ProposeScanCallback, device_path, callback, error_callback));
+}
+
 void NetworkDeviceHandler::SetCarrier(
     const std::string& device_path,
     const std::string& carrier,
diff --git a/chromeos/network/network_device_handler.h b/chromeos/network/network_device_handler.h
index 1370a8a..300cbf5 100644
--- a/chromeos/network/network_device_handler.h
+++ b/chromeos/network/network_device_handler.h
@@ -75,6 +75,21 @@
       const base::Closure& callback,
       const network_handler::ErrorCallback& error_callback);
 
+  // Requests a network scan on the device specified by |device_path|.
+  // For cellular networks, the result of this call gets asynchronously stored
+  // in the corresponding DeviceState object through a property update. For all
+  // other technologies a service gets created for each found network, which
+  // can be accessed through the corresponding NetworkState object.
+  //
+  // TODO(armansito): Device.ProposeScan is deprecated and the preferred method
+  // of requesting a network scan is Manager.RequestScan, however shill
+  // currently doesn't support cellular network scans via Manager.RequestScan.
+  // Remove this method once shill supports it (crbug.com/262356).
+  void ProposeScan(
+      const std::string& device_path,
+      const base::Closure& callback,
+      const network_handler::ErrorCallback& error_callback);
+
   // Tells the device to set the modem carrier firmware, as specified by
   // |carrier|.
   //
diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
index 299eb9f..70198ba 100644
--- a/chromeos/network/network_util.cc
+++ b/chromeos/network/network_util.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/string_tokenizer.h"
 #include "base/strings/stringprintf.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
 
 namespace chromeos {
 
@@ -24,6 +25,12 @@
 WifiAccessPoint::~WifiAccessPoint() {
 }
 
+CellularScanResult::CellularScanResult() {
+}
+
+CellularScanResult::~CellularScanResult() {
+}
+
 namespace network_util {
 
 std::string PrefixLengthToNetmask(int32 prefix_length) {
@@ -92,5 +99,32 @@
   return prefix_length;
 }
 
+bool ParseCellularScanResults(
+    const ListValue& list, std::vector<CellularScanResult>* scan_results) {
+  scan_results->clear();
+  scan_results->reserve(list.GetSize());
+  for (ListValue::const_iterator it = list.begin(); it != list.end(); ++it) {
+    if (!(*it)->IsType(base::Value::TYPE_DICTIONARY))
+      return false;
+    CellularScanResult scan_result;
+    const DictionaryValue* dict = static_cast<const DictionaryValue*>(*it);
+    // If the network id property is not present then this network cannot be
+    // connected to so don't include it in the results.
+    if (!dict->GetStringWithoutPathExpansion(flimflam::kNetworkIdProperty,
+                                             &scan_result.network_id))
+      continue;
+    dict->GetStringWithoutPathExpansion(flimflam::kStatusProperty,
+                                        &scan_result.status);
+    dict->GetStringWithoutPathExpansion(flimflam::kLongNameProperty,
+                                        &scan_result.long_name);
+    dict->GetStringWithoutPathExpansion(flimflam::kShortNameProperty,
+                                        &scan_result.short_name);
+    dict->GetStringWithoutPathExpansion(flimflam::kTechnologyProperty,
+                                        &scan_result.technology);
+    scan_results->push_back(scan_result);
+  }
+  return true;
+}
+
 }  // namespace network_util
 }  // namespace chromeos
diff --git a/chromeos/network/network_util.h b/chromeos/network/network_util.h
index 442face..3098312 100644
--- a/chromeos/network/network_util.h
+++ b/chromeos/network/network_util.h
@@ -16,6 +16,7 @@
 #include "base/basictypes.h"
 #include "base/callback.h"
 #include "base/time/time.h"
+#include "base/values.h"
 #include "chromeos/chromeos_export.h"
 
 namespace chromeos {
@@ -44,6 +45,18 @@
   int channel;  // Wifi channel number.
 };
 
+// Struct for passing network scan result data.
+struct CHROMEOS_EXPORT CellularScanResult {
+  CellularScanResult();
+  ~CellularScanResult();
+  std::string status;  // The network's availability status. (One of "unknown",
+                       // "available", "current", or "forbidden")
+  std::string network_id;  // 3GPP operator code ("MCCMNC").
+  std::string short_name;  // Short-format name of the operator.
+  std::string long_name;  // Long-format name of the operator.
+  std::string technology;  // Access technology.
+};
+
 typedef std::vector<WifiAccessPoint> WifiAccessPointVector;
 
 // Describes whether there is an error and whether the error came from
@@ -72,6 +85,12 @@
 // e.g. a |netmask| of 255.255.255.0 is converted to a prefixlen of 24
 CHROMEOS_EXPORT int32 NetmaskToPrefixLength(const std::string& netmask);
 
+// Parses |list|, which contains DictionaryValues and returns a vector of
+// CellularScanResult in |scan_results|. Returns false if parsing fails,
+// in which case the contents of |scan_results| will be undefined.
+CHROMEOS_EXPORT bool ParseCellularScanResults(
+    const ListValue& list, std::vector<CellularScanResult>* scan_results);
+
 }  // namespace network_util
 }  // namespace chromeos
 
diff --git a/chromeos/network/network_util_unittest.cc b/chromeos/network/network_util_unittest.cc
index 21c0d59..17c09bb 100644
--- a/chromeos/network/network_util_unittest.cc
+++ b/chromeos/network/network_util_unittest.cc
@@ -5,9 +5,12 @@
 #include "chromeos/network/network_util.h"
 
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
 
+using chromeos::CellularScanResult;
 using chromeos::network_util::NetmaskToPrefixLength;
 using chromeos::network_util::PrefixLengthToNetmask;
+using chromeos::network_util::ParseCellularScanResults;
 
 typedef testing::Test NetworkUtilTest;
 
@@ -99,3 +102,50 @@
   EXPECT_EQ("", PrefixLengthToNetmask(33));
   EXPECT_EQ("", PrefixLengthToNetmask(255));
 }
+
+TEST_F(NetworkUtilTest, ParseScanResults) {
+  ListValue list;
+  std::vector<CellularScanResult> scan_results;
+
+  // Empty list value.
+  EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
+
+  // List contains invalid item.
+  list.AppendInteger(0);
+  EXPECT_FALSE(ParseCellularScanResults(list, &scan_results));
+
+  // Scan result has no network id.
+  list.Clear();
+  DictionaryValue* dict_value = new DictionaryValue();
+  dict_value->SetString(flimflam::kStatusProperty, "available");
+  list.Append(dict_value);
+  EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
+  EXPECT_TRUE(scan_results.empty());
+
+  // Mixed parse results.
+  dict_value = new DictionaryValue();
+  dict_value->SetString(flimflam::kNetworkIdProperty, "000001");
+  dict_value->SetString(flimflam::kStatusProperty, "unknown");
+  dict_value->SetString(flimflam::kTechnologyProperty, "GSM");
+  list.Append(dict_value);
+
+  dict_value = new DictionaryValue();
+  dict_value->SetString(flimflam::kNetworkIdProperty, "000002");
+  dict_value->SetString(flimflam::kStatusProperty, "available");
+  dict_value->SetString(flimflam::kLongNameProperty, "Long Name");
+  list.Append(dict_value);
+
+  EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
+  EXPECT_EQ(static_cast<size_t>(2), scan_results.size());
+  EXPECT_EQ("000001", scan_results[0].network_id);
+  EXPECT_EQ("unknown", scan_results[0].status);
+  EXPECT_EQ("GSM", scan_results[0].technology);
+  EXPECT_TRUE(scan_results[0].long_name.empty());
+  EXPECT_TRUE(scan_results[0].short_name.empty());
+
+  EXPECT_EQ("000002", scan_results[1].network_id);
+  EXPECT_EQ("available", scan_results[1].status);
+  EXPECT_EQ("Long Name", scan_results[1].long_name);
+  EXPECT_TRUE(scan_results[1].short_name.empty());
+  EXPECT_TRUE(scan_results[1].technology.empty());
+}
diff --git a/chromeos/process_proxy/process_proxy.cc b/chromeos/process_proxy/process_proxy.cc
index 990e736..c536bd8 100644
--- a/chromeos/process_proxy/process_proxy.cc
+++ b/chromeos/process_proxy/process_proxy.cc
@@ -11,9 +11,10 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/file_util.h"
-#include "base/posix/eintr_wrapper.h"
-#include "base/process_util.h"
 #include "base/logging.h"
+#include "base/posix/eintr_wrapper.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 #include "base/threading/thread.h"
 #include "chromeos/process_proxy/process_output_watcher.h"
 
diff --git a/chromeos/process_proxy/process_proxy_unittest.cc b/chromeos/process_proxy/process_proxy_unittest.cc
index 729ee61..429c868 100644
--- a/chromeos/process_proxy/process_proxy_unittest.cc
+++ b/chromeos/process_proxy/process_proxy_unittest.cc
@@ -11,7 +11,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/posix/eintr_wrapper.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
 #include "chromeos/process_proxy/process_proxy_registry.h"
diff --git a/chromeos/system/name_value_pairs_parser.cc b/chromeos/system/name_value_pairs_parser.cc
index d476520..091e1fc 100644
--- a/chromeos/system/name_value_pairs_parser.cc
+++ b/chromeos/system/name_value_pairs_parser.cc
@@ -8,7 +8,7 @@
 #include "base/file_util.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/stl_util.h"
 #include "base/strings/string_tokenizer.h"
 #include "base/strings/string_util.h"
diff --git a/cloud_print/gcp20/prototype/cloud_print_requester.cc b/cloud_print/gcp20/prototype/cloud_print_requester.cc
index 857b3de..ded4b47 100644
--- a/cloud_print/gcp20/prototype/cloud_print_requester.cc
+++ b/cloud_print/gcp20/prototype/cloud_print_requester.cc
@@ -18,6 +18,8 @@
 #include "net/url_request/url_request_context_builder.h"
 #include "url/gurl.h"
 
+const char* kCloudPrintUrl = "https://www.google.com/cloudprint";
+
 namespace {
 
 const char kProxyIdValue[] = "proxy";
@@ -28,12 +30,8 @@
 
 const int kGaiaMaxRetries = 3;
 
-std::string GetCloudPrintUrl() {
-  return "https://www.google.com/cloudprint";
-}
-
 GURL CreateRegisterUrl() {
-  return GURL(GetCloudPrintUrl() + "/register");
+  return GURL(std::string(kCloudPrintUrl) + "/register");
 }
 
 }  // namespace
@@ -123,7 +121,7 @@
   if (!CreateRequest(
       CreateRegisterUrl(), net::URLFetcher::POST,
       base::Bind(&CloudPrintRequester::ParseRegisterStartResponse,
-                 base::Unretained(this)))) {
+                 AsWeakPtr()))) {
     return false;
   }
   fetcher_->SetUploadData(mime_type, data);
@@ -137,7 +135,7 @@
       GURL(polling_url_ + oauth_client_info_.client_id),
       net::URLFetcher::GET,
       base::Bind(&CloudPrintRequester::ParseRegisterCompleteResponse,
-                 base::Unretained(this)))) {
+                 AsWeakPtr()))) {
     return false;
   }
   fetcher_->Start();
diff --git a/cloud_print/gcp20/prototype/cloud_print_requester.h b/cloud_print/gcp20/prototype/cloud_print_requester.h
index 345bfce..369cca7 100644
--- a/cloud_print/gcp20/prototype/cloud_print_requester.h
+++ b/cloud_print/gcp20/prototype/cloud_print_requester.h
@@ -10,6 +10,7 @@
 
 #include "base/basictypes.h"
 #include "base/callback.h"
+#include "base/memory/weak_ptr.h"
 #include "base/values.h"
 #include "google_apis/gaia/gaia_oauth_client.h"
 #include "net/url_request/url_fetcher.h"
@@ -20,8 +21,11 @@
 
 class CloudPrintURLRequestContextGetter;
 
+extern const char* kCloudPrintUrl;
+
 // Class for requesting CloudPrint server and parsing responses.
-class CloudPrintRequester : public net::URLFetcherDelegate,
+class CloudPrintRequester : public base::SupportsWeakPtr<CloudPrintRequester>,
+                            public net::URLFetcherDelegate,
                             public gaia::GaiaOAuthClient::Delegate {
  public:
   class Delegate {
diff --git a/cloud_print/gcp20/prototype/command_line_reader.cc b/cloud_print/gcp20/prototype/command_line_reader.cc
new file mode 100644
index 0000000..a5474e6
--- /dev/null
+++ b/cloud_print/gcp20/prototype/command_line_reader.cc
@@ -0,0 +1,53 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cloud_print/gcp20/prototype/command_line_reader.h"
+
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "base/strings/string_number_conversions.h"
+
+namespace {
+
+const uint16 kDefaultHttpPort = 10101;
+const uint32 kDefaultTTL = 60*60;
+
+}  // namespace
+
+namespace command_line_reader {
+
+uint16 ReadHttpPort() {
+  uint32 http_port = kDefaultHttpPort;
+
+  std::string http_port_string =
+      CommandLine::ForCurrentProcess()->GetSwitchValueASCII("http-port");
+
+  if (!base::StringToUint(http_port_string, &http_port))
+    http_port = kDefaultHttpPort;
+
+  if (http_port > kuint16max) {
+    LOG(ERROR) << "Port " << http_port << " is too large (maximum is " <<
+        kuint16max << "). Using default port: " << kDefaultHttpPort;
+
+    http_port = kDefaultHttpPort;
+  }
+
+  VLOG(1) << "HTTP port for responses: " << http_port;
+  return static_cast<uint16>(http_port);
+}
+
+uint32 ReadTtl() {
+  uint32 ttl = kDefaultTTL;
+
+  if (!base::StringToUint(
+      CommandLine::ForCurrentProcess()->GetSwitchValueASCII("ttl"), &ttl)) {
+    ttl = kDefaultTTL;
+  }
+
+  VLOG(1) << "TTL for announcements: " << ttl;
+  return ttl;
+}
+
+}  // namespace command_line_reader
+
diff --git a/cloud_print/gcp20/prototype/command_line_reader.h b/cloud_print/gcp20/prototype/command_line_reader.h
new file mode 100644
index 0000000..1043890
--- /dev/null
+++ b/cloud_print/gcp20/prototype/command_line_reader.h
@@ -0,0 +1,18 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CLOUD_PRINT_GCP20_PROTOTYPE_COMMAND_LINE_READER_H_
+#define CLOUD_PRINT_GCP20_PROTOTYPE_COMMAND_LINE_READER_H_
+
+#include "base/basictypes.h"
+
+namespace command_line_reader {
+
+uint16 ReadHttpPort();
+uint32 ReadTtl();
+
+}  // namespace command_line_reader
+
+#endif  // CLOUD_PRINT_GCP20_PROTOTYPE_COMMAND_LINE_READER_H_
+
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc
index cecb8d5..38dfb35 100644
--- a/cloud_print/gcp20/prototype/dns_sd_server.cc
+++ b/cloud_print/gcp20/prototype/dns_sd_server.cc
@@ -66,7 +66,7 @@
   SendAnnouncement(full_ttl_);
   base::MessageLoop::current()->PostTask(
       FROM_HERE,
-      base::Bind(&DnsSdServer::OnDatagramReceived, base::Unretained(this)));
+      base::Bind(&DnsSdServer::OnDatagramReceived, AsWeakPtr()));
 
   return true;
 }
@@ -242,11 +242,8 @@
   do {
     if (rv > 0)
       ProcessMessage(rv, recv_buf_.get());
-    rv = socket_->RecvFrom(
-        recv_buf_.get(),
-        recv_buf_->size(),
-        &recv_address_,
-        base::Bind(&DnsSdServer::DoLoop, base::Unretained(this)));
+    rv = socket_->RecvFrom(recv_buf_.get(), recv_buf_->size(), &recv_address_,
+                           base::Bind(&DnsSdServer::DoLoop, AsWeakPtr()));
   } while (rv > 0);
 
   // TODO(maksymb): Add handler for errors
@@ -285,7 +282,7 @@
   // Schedule next announcement.
   base::MessageLoop::current()->PostDelayedTask(
       FROM_HERE,
-      base::Bind(&DnsSdServer::Update, base::Unretained(this)),
+      base::Bind(&DnsSdServer::Update, AsWeakPtr()),
       base::TimeDelta::FromSeconds(static_cast<int64>(
           kTimeToNextAnnouncement*full_ttl_)));
 }
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.h b/cloud_print/gcp20/prototype/dns_sd_server.h
index a0dbb64..a0d0128 100644
--- a/cloud_print/gcp20/prototype/dns_sd_server.h
+++ b/cloud_print/gcp20/prototype/dns_sd_server.h
@@ -10,6 +10,7 @@
 
 #include "base/basictypes.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
 #include "cloud_print/gcp20/prototype/service_parameters.h"
 #include "net/base/ip_endpoint.h"
 #include "net/udp/udp_socket.h"
@@ -26,7 +27,7 @@
 // Class for sending multicast announcements, receiving queries and answering on
 // them.
 // TODO(maksymb): Implement probing.
-class DnsSdServer {
+class DnsSdServer : public base::SupportsWeakPtr<DnsSdServer> {
  public:
   // Constructor does not start server.
   DnsSdServer();
diff --git a/cloud_print/gcp20/prototype/gcp20_device.gyp b/cloud_print/gcp20/prototype/gcp20_device.gyp
index c380d20..795167b 100644
--- a/cloud_print/gcp20/prototype/gcp20_device.gyp
+++ b/cloud_print/gcp20/prototype/gcp20_device.gyp
@@ -20,39 +20,42 @@
       'type': 'static_library',
       'dependencies': [
         '<(DEPTH)/base/base.gyp:base',
+        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
         '<(DEPTH)/google_apis/google_apis.gyp:google_apis',
         '<(DEPTH)/net/net.gyp:http_server',
         '<(DEPTH)/net/net.gyp:net',
         '<(DEPTH)/url/url.gyp:url_lib',
-        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
       ],
       'sources': [
         'cloud_print_response_parser.cc',
         'cloud_print_response_parser.h',
         'cloud_print_requester.cc',
         'cloud_print_requester.h',  
+        'command_line_reader.cc',
+        'command_line_reader.h',
         'dns_packet_parser.cc',
         'dns_packet_parser.h',
         'dns_response_builder.cc',
         'dns_response_builder.h',
         'dns_sd_server.cc',
         'dns_sd_server.h',
-        'gcp20_device.cc',
         'printer.cc',
         'printer.h',
         'privet_http_server.cc',
         'privet_http_server.h',
         'service_parameters.cc',
         'service_parameters.h',
+        'x_privet_token.cc',
+        'x_privet_token.h',
       ],
     },
     {
       'target_name': 'gcp20_device',
       'type': 'executable',
       'dependencies': [
-        'gcp20_device.gyp:gcp20_device_lib',
+        'gcp20_device_lib',
       ],
-      'sources': [        
+      'sources': [
         'gcp20_device.cc',
       ],
       'msvs_settings': {
@@ -67,5 +70,27 @@
         },
       },
     },
+    {
+      'target_name': 'gcp20_device_unittests',
+      'type': 'executable',
+      'sources': [
+        'x_privet_token_unittest.cc',
+      ],
+      'dependencies': [
+        'gcp20_device_lib',
+        '<(DEPTH)/base/base.gyp:run_all_unittests',
+        '<(DEPTH)/base/base.gyp:test_support_base',
+        '<(DEPTH)/testing/gmock.gyp:gmock',
+        '<(DEPTH)/testing/gtest.gyp:gtest',
+      ],
+      'msvs_settings': {
+        'VCLinkerTool': {
+          'SubSystem': '1',         # Set /SUBSYSTEM:CONSOLE
+          'AdditionalDependencies': [
+            'secur32.lib',
+          ],
+        },
+      },
+    },
   ],
 }
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc
index dcbef5a..04d3066 100644
--- a/cloud_print/gcp20/prototype/printer.cc
+++ b/cloud_print/gcp20/prototype/printer.cc
@@ -10,11 +10,17 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/guid.h"
+#include "base/json/json_reader.h"
+#include "base/json/json_writer.h"
 #include "base/strings/string_number_conversions.h"
+#include "cloud_print/gcp20/prototype/command_line_reader.h"
 #include "cloud_print/gcp20/prototype/service_parameters.h"
 #include "net/base/net_util.h"
 #include "net/base/url_util.h"
 
+const base::FilePath::CharType kPrinterStatePath[] =
+    FILE_PATH_LITERAL("printer_state.json");
+
 namespace {
 
 const char* kServiceType = "_privet._tcp.local";
@@ -22,9 +28,7 @@
 const char* kServiceDomainName = "my-privet-device.local";
 
 const char* kPrinterName = "Google GCP2.0 Prototype";
-
-const uint16 kDefaultTTL = 60*60;
-const uint16 kDefaultHttpPort = 10101;
+const char* kPrinterDescription = "Printer emulator";
 
 const char* kCdd =
 "{\n"
@@ -55,38 +59,6 @@
 "  }\n"
 "}\n";
 
-std::string GenerateProxyId() {
-  return "{" + base::GenerateGUID() + "}";
-}
-
-uint16 ReadHttpPortFromCommandLine() {
-  uint32 http_port_tmp = kDefaultHttpPort;
-
-  std::string http_port_string_tmp =
-      CommandLine::ForCurrentProcess()->GetSwitchValueASCII("http-port");
-  base::StringToUint(http_port_string_tmp, &http_port_tmp);
-
-  if (http_port_tmp > kuint16max) {
-    LOG(ERROR) << "Port " << http_port_tmp << " is too large (maximum is " <<
-        kDefaultHttpPort << "). Using default port.";
-
-    http_port_tmp = kDefaultHttpPort;
-  }
-
-  VLOG(1) << "HTTP port for responses: " << http_port_tmp;
-  return static_cast<uint16>(http_port_tmp);
-}
-
-uint16 ReadTtlFromCommandLine() {
-  uint32 ttl = kDefaultTTL;
-
-  base::StringToUint(
-      CommandLine::ForCurrentProcess()->GetSwitchValueASCII("ttl"), &ttl);
-
-  VLOG(1) << "TTL for announcements: " << ttl;
-  return ttl;
-}
-
 // Returns local IP address number of first interface found (except loopback).
 // Return value is empty if no interface found. Possible interfaces names are
 // "eth0", "wlan0" etc. If interface name is empty, function will return IP
@@ -139,27 +111,24 @@
   }
   VLOG(1) << "Local address: " << net::IPAddressToString(ip);
 
-  uint16 port = ReadHttpPortFromCommandLine();
-
-  // TODO(maksymb): Add loading state from drive.
-  reg_info_ = RegistrationInfo();
-
-  // Starting DNS-SD server.
-  bool success = dns_server_.Start(
-      ServiceParameters(kServiceType, kServiceNamePrefix, kServiceDomainName,
-                        ip, port),
-      ReadTtlFromCommandLine(),
-      CreateTxt());
-
-  if (!success)
-    return false;
+  uint16 port = command_line_reader::ReadHttpPort();
 
   // Starting HTTP server.
-  success = http_server_.Start(port);
-  if (!success)
+  if (!http_server_.Start(port))
     return false;
-  // TODO(maksymb): Check what happened if DNS server will start but HTTP
-  // server won't.
+
+  if (!LoadFromFile(base::FilePath(kPrinterStatePath)))
+    reg_info_ = RegistrationInfo();
+
+  // Starting DNS-SD server.
+  if (!dns_server_.Start(
+      ServiceParameters(kServiceType, kServiceNamePrefix, kServiceDomainName,
+                        ip, port),
+      command_line_reader::ReadTtl(),
+      CreateTxt())) {
+    http_server_.Shutdown();
+    return false;
+  }
 
   // Creating Cloud Requester.
   requester_.reset(
@@ -167,6 +136,9 @@
           base::MessageLoop::current()->message_loop_proxy(),
           this));
 
+  xtoken_ = XPrivetToken();
+  starttime_ = base::Time::Now();
+
   return true;
 }
 
@@ -182,8 +154,8 @@
 
 PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationStart(
     const std::string& user) {
-  PrivetHttpServer::RegistrationErrorStatus status;
-  if (!CheckRegistrationState(user, false, &status))
+  PrivetHttpServer::RegistrationErrorStatus status = CheckCommonRegErrors(user);
+  if (status != PrivetHttpServer::REG_ERROR_OK)
     return status;
 
   if (reg_info_.state != RegistrationInfo::DEV_REG_UNREGISTERED)
@@ -198,12 +170,20 @@
   return PrivetHttpServer::REG_ERROR_OK;
 }
 
+bool Printer::CheckXPrivetTokenHeader(const std::string& token) const {
+  return xtoken_.CheckValidXToken(token);
+}
+
+bool Printer::IsRegistered() const {
+  return reg_info_.state == RegistrationInfo::DEV_REG_REGISTERED;
+}
+
 PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationGetClaimToken(
     const std::string& user,
     std::string* token,
     std::string* claim_url) {
-  PrivetHttpServer::RegistrationErrorStatus status;
-  if (!CheckRegistrationState(user, false, &status))
+  PrivetHttpServer::RegistrationErrorStatus status = CheckCommonRegErrors(user);
+  if (status != PrivetHttpServer::REG_ERROR_OK)
     return status;
 
   // TODO(maksymb): Add user confirmation.
@@ -224,13 +204,14 @@
 PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationComplete(
     const std::string& user,
     std::string* device_id) {
-  PrivetHttpServer::RegistrationErrorStatus status;
-  if (!CheckRegistrationState(user, false, &status))
+  PrivetHttpServer::RegistrationErrorStatus status = CheckCommonRegErrors(user);
+  if (status != PrivetHttpServer::REG_ERROR_OK)
     return status;
 
   if (reg_info_.state !=
-      RegistrationInfo::DEV_REG_REGISTRATION_CLAIM_TOKEN_READY)
+      RegistrationInfo::DEV_REG_REGISTRATION_CLAIM_TOKEN_READY) {
     return PrivetHttpServer::REG_ERROR_INVALID_ACTION;
+  }
 
   reg_info_.state = RegistrationInfo::DEV_REG_REGISTRATION_COMPLETING;
   requester_->CompleteRegistration();
@@ -242,9 +223,11 @@
 
 PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationCancel(
     const std::string& user) {
-  PrivetHttpServer::RegistrationErrorStatus status;
-  if (!CheckRegistrationState(user, true, &status))
+  PrivetHttpServer::RegistrationErrorStatus status = CheckCommonRegErrors(user);
+  if (status != PrivetHttpServer::REG_ERROR_OK &&
+      status != PrivetHttpServer::REG_ERROR_SERVER_ERROR) {
     return status;
+  }
 
   if (reg_info_.state == RegistrationInfo::DEV_REG_UNREGISTERED)
     return PrivetHttpServer::REG_ERROR_INVALID_ACTION;
@@ -261,11 +244,28 @@
 }
 
 void Printer::CreateInfo(PrivetHttpServer::DeviceInfo* info) {
+  // TODO(maksymb): Replace "text" with constants.
+
   *info = PrivetHttpServer::DeviceInfo();
   info->version = "1.0";
+  info->name = kPrinterName;
+  info->description = kPrinterDescription;
+  info->url = kCloudPrintUrl;
+  info->id = reg_info_.device_id;
+  info->device_state = "idle";
+  info->connection_state = "offline";
   info->manufacturer = "Google";
+  info->model = "Prototype";
+  info->serial_number = "2.3.5.7.13.17.19.31.61.89.107.127.521.607.1279.2203";
+  info->firmware = "3.7.31.127.8191.131071.524287.2147483647";
+  info->uptime = static_cast<int>((base::Time::Now() - starttime_).InSeconds());
+
+  info->x_privet_token = xtoken_.GenerateXToken();
+
   if (reg_info_.state == RegistrationInfo::DEV_REG_UNREGISTERED)
     info->api.push_back("/privet/register");
+
+  info->type.push_back("printer");
 }
 
 void Printer::OnRegistrationStartResponseParsed(
@@ -281,6 +281,7 @@
 void Printer::OnGetAuthCodeResponseParsed(const std::string& refresh_token) {
   reg_info_.state = RegistrationInfo::DEV_REG_REGISTERED;
   reg_info_.refresh_token = refresh_token;
+  SaveToFile(base::FilePath(kPrinterStatePath));
 }
 
 void Printer::OnRegistrationError(const std::string& description) {
@@ -291,36 +292,31 @@
   reg_info_.error_description = description;
 }
 
-bool Printer::CheckRegistrationState(
-    const std::string& user,
-    bool ignore_error,
-    PrivetHttpServer::RegistrationErrorStatus* status) const {
-  if (reg_info_.state == RegistrationInfo::DEV_REG_REGISTERED) {
-     *status = PrivetHttpServer::REG_ERROR_REGISTERED;
-    return false;
-  }
+PrivetHttpServer::RegistrationErrorStatus Printer::CheckCommonRegErrors(
+    const std::string& user) const {
+  DCHECK(!IsRegistered());
 
   if (reg_info_.state != RegistrationInfo::DEV_REG_UNREGISTERED &&
       user != reg_info_.user) {
-    *status = PrivetHttpServer::REG_ERROR_DEVICE_BUSY;
-    return false;
+    return PrivetHttpServer::REG_ERROR_DEVICE_BUSY;
   }
 
-  if (!ignore_error &&
-      reg_info_.state == RegistrationInfo::DEV_REG_REGISTRATION_ERROR) {
-    *status = PrivetHttpServer::REG_ERROR_SERVER_ERROR;
-    return false;
-  }
+  if (reg_info_.state == RegistrationInfo::DEV_REG_REGISTRATION_ERROR)
+    return PrivetHttpServer::REG_ERROR_SERVER_ERROR;
 
-  return true;
+  return PrivetHttpServer::REG_ERROR_OK;
+}
+
+std::string Printer::GenerateProxyId() const {
+  return "{" + base::GenerateGUID() +"}";
 }
 
 std::vector<std::string> Printer::CreateTxt() const {
   std::vector<std::string> txt;
   txt.push_back("txtvers=1");
   txt.push_back("ty=" + std::string(kPrinterName));
-  txt.push_back("note=");
-  txt.push_back("url=https://www.google.com/cloudprint");
+  txt.push_back("note=" + std::string(kPrinterDescription));
+  txt.push_back("url=" + std::string(kCloudPrintUrl));
   txt.push_back("type=printer");
   txt.push_back("id=" + reg_info_.device_id);
   txt.push_back("cs=offline");
@@ -328,3 +324,84 @@
   return txt;
 }
 
+void Printer::SaveToFile(const base::FilePath& file_path) const {
+  base::DictionaryValue json;
+  // TODO(maksymb): Get rid of in-place constants.
+  if (IsRegistered()) {
+    json.SetBoolean("registered", true);
+    json.SetString("user", reg_info_.user);
+    json.SetString("device_id", reg_info_.device_id);
+    json.SetString("refresh_token", reg_info_.refresh_token);
+  } else {
+    json.SetBoolean("registered", false);
+  }
+
+  std::string json_str;
+  base::JSONWriter::WriteWithOptions(&json,
+                                     base::JSONWriter::OPTIONS_PRETTY_PRINT,
+                                     &json_str);
+  if (!file_util::WriteFile(file_path, json_str.data(),
+                            static_cast<int>(json_str.size()))) {
+    LOG(ERROR) << "Cannot write state.";
+  }
+  LOG(INFO) << "State written to file.";
+}
+
+bool Printer::LoadFromFile(const base::FilePath& file_path) {
+  if (!base::PathExists(file_path)) {
+    LOG(INFO) << "Registration info is not found. Printer is unregistered.";
+    return false;
+  }
+
+  LOG(INFO) << "Loading registration info from file.";
+  std::string json_str;
+  if (!file_util::ReadFileToString(file_path, &json_str)) {
+    LOG(ERROR) << "Cannot open file.";
+    return false;
+  }
+
+  scoped_ptr<base::Value> json_val(base::JSONReader::Read(json_str));
+  base::DictionaryValue* json = NULL;
+  if (!json_val || !json_val->GetAsDictionary(&json)) {
+    LOG(ERROR) << "Cannot read JSON dictionary from file.";
+    return false;
+  }
+
+  bool registered = false;
+  if (!json->GetBoolean("registered", &registered)) {
+    LOG(ERROR) << "Cannot parse |registered| state.";
+    return false;
+  }
+
+  if (!registered) {
+    reg_info_ = RegistrationInfo();
+    return true;
+  }
+
+  std::string user;
+  if (!json->GetString("user", &user)) {
+    LOG(ERROR) << "Cannot parse |user|.";
+    return false;
+  }
+
+  std::string device_id;
+  if (!json->GetString("device_id", &device_id)) {
+    LOG(ERROR) << "Cannot parse |device_id|.";
+    return false;
+  }
+
+  std::string refresh_token;
+  if (!json->GetString("refresh_token", &refresh_token)) {
+    LOG(ERROR) << "Cannot parse |refresh_token|.";
+    return false;
+  }
+
+  reg_info_ = RegistrationInfo();
+  reg_info_.state = RegistrationInfo::DEV_REG_REGISTERED;
+  reg_info_.user = user;
+  reg_info_.device_id = device_id;
+  reg_info_.refresh_token = refresh_token;
+
+  return true;
+}
+
diff --git a/cloud_print/gcp20/prototype/printer.h b/cloud_print/gcp20/prototype/printer.h
index 86c58b0..246e3df 100644
--- a/cloud_print/gcp20/prototype/printer.h
+++ b/cloud_print/gcp20/prototype/printer.h
@@ -11,6 +11,7 @@
 #include "cloud_print/gcp20/prototype/cloud_print_requester.h"
 #include "cloud_print/gcp20/prototype/dns_sd_server.h"
 #include "cloud_print/gcp20/prototype/privet_http_server.h"
+#include "cloud_print/gcp20/prototype/x_privet_token.h"
 
 // This class maintain work of DNS-SD server, HTTP server and others.
 class Printer : public PrivetHttpServer::Delegate,
@@ -78,6 +79,8 @@
       const std::string& user) OVERRIDE;
   virtual void GetRegistrationServerError(std::string* description) OVERRIDE;
   virtual void CreateInfo(PrivetHttpServer::DeviceInfo* info) OVERRIDE;
+  virtual bool IsRegistered() const OVERRIDE;
+  virtual bool CheckXPrivetTokenHeader(const std::string& token) const OVERRIDE;
 
   // CloudRequester::Delegate methods:
   virtual void OnRegistrationStartResponseParsed(
@@ -89,17 +92,23 @@
   virtual void OnRegistrationError(const std::string& description) OVERRIDE;
 
   // Checks if register call is called correctly (|user| is correct,
-  // error is no set etc).
-  bool CheckRegistrationState(
-      const std::string& user,
-      bool ignore_error,
-      PrivetHttpServer::RegistrationErrorStatus* status) const;
+  // error is no set etc). Returns |false| if error status is put into |status|.
+  // Otherwise no error was occurred.
+  PrivetHttpServer::RegistrationErrorStatus CheckCommonRegErrors(
+      const std::string& user) const;
+
+  // Generates ProxyId for this device.
+  std::string GenerateProxyId() const;
 
   // Creates data for DNS TXT respond.
   std::vector<std::string> CreateTxt() const;
 
   RegistrationInfo reg_info_;
 
+  // Saving and loading registration info from file.
+  void SaveToFile(const base::FilePath& file_path) const;
+  bool LoadFromFile(const base::FilePath& file_path);
+
   // Contains DNS-SD server.
   DnsSdServer dns_server_;
 
@@ -109,6 +118,11 @@
   // Contains Cloud Print client.
   scoped_ptr<CloudPrintRequester> requester_;
 
+  XPrivetToken xtoken_;
+
+  // Uses for calculating uptime.
+  base::Time starttime_;
+
   DISALLOW_COPY_AND_ASSIGN(Printer);
 };
 
diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc
index 2114360..33fd2ab 100644
--- a/cloud_print/gcp20/prototype/privet_http_server.cc
+++ b/cloud_print/gcp20/prototype/privet_http_server.cc
@@ -4,6 +4,7 @@
 
 #include "cloud_print/gcp20/prototype/privet_http_server.h"
 
+#include "base/command_line.h"
 #include "base/json/json_writer.h"
 #include "net/base/ip_endpoint.h"
 #include "net/base/net_errors.h"
@@ -39,9 +40,24 @@
   return error.Pass();
 }
 
+// Returns |true| if |request| should be GET method.
+bool IsGetMethod(const std::string& request) {
+  return request == "/privet/info"/* ||
+         request == "/privet/accesstoken" ||
+         request == "/privet/capabilities" ||
+         request == "/privet/printer/jobstate"*/;
+}
+
+// Returns |true| if |request| should be POST method.
+bool IsPostMethod(const std::string& request) {
+  return request == "/privet/register"/* ||
+         request == "/privet/printer/createjob" ||
+         request == "/privet/printer/submitdoc"*/;
+}
+
 }  // namespace
 
-PrivetHttpServer::DeviceInfo::DeviceInfo() {
+PrivetHttpServer::DeviceInfo::DeviceInfo() : uptime(0) {
 }
 
 PrivetHttpServer::DeviceInfo::~DeviceInfo() {
@@ -85,11 +101,35 @@
   VLOG(1) << "Processing HTTP request: " << info.path;
   GURL url("http://host" + info.path);
 
-  // TODO(maksymb): Add checking for X-PrivetToken.
-  std::string response;
-  net::HttpStatusCode status_code = ProcessHttpRequest(url, &response);
+  if (!ValidateRequestMethod(connection_id, url.path(), info.method))
+    return;
 
-  server_->Send(connection_id, status_code, response, "text/plain");
+  if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-x-token")) {
+    net::HttpServerRequestInfo::HeadersMap::const_iterator iter =
+        info.headers.find("X-Privet-Token");
+    if (iter == info.headers.end()) {
+      server_->Send(connection_id, net::HTTP_BAD_REQUEST,
+                    "Missing X-Privet-Token header.\n"
+                    "TODO: Message should be in header, not in the body!",
+                    "text/plain");
+      return;
+    }
+
+    if (url.path() != "/privet/info" &&
+        !delegate_->CheckXPrivetTokenHeader(iter->second)) {
+      server_->Send(connection_id, net::HTTP_BAD_REQUEST,
+                    "{\"error\":\"invalid_x_privet_token\"}",
+                    "application/json");
+      return;
+    }
+  }
+
+  std::string response;
+  net::HttpStatusCode status_code =
+      ProcessHttpRequest(url, info.data, &response);
+  // TODO(maksymb): Add checking for right |info.method| in query.
+
+  server_->Send(connection_id, status_code, response, "application/json");
 }
 
 void PrivetHttpServer::OnWebSocketRequest(
@@ -103,8 +143,36 @@
 void PrivetHttpServer::OnClose(int connection_id) {
 }
 
+void PrivetHttpServer::ReportInvalidMethod(int connection_id) {
+  server_->Send(connection_id, net::HTTP_BAD_REQUEST, "Invalid method",
+                "text/plain");
+}
+
+bool PrivetHttpServer::ValidateRequestMethod(int connection_id,
+                                             const std::string& request,
+                                             const std::string& method) {
+  DCHECK(!IsGetMethod(request) || !IsPostMethod(request));
+
+  if (!IsGetMethod(request) && !IsPostMethod(request)) {
+    server_->Send404(connection_id);
+    return false;
+  }
+
+  if (CommandLine::ForCurrentProcess()->HasSwitch("disable-method-check"))
+    return true;
+
+  if ((IsGetMethod(request) && method != "GET") ||
+      (IsPostMethod(request) && method != "POST")) {
+    ReportInvalidMethod(connection_id);
+    return false;
+  }
+
+  return true;
+}
+
 net::HttpStatusCode PrivetHttpServer::ProcessHttpRequest(
     const GURL& url,
+    const std::string& data,
     std::string* response) {
   net::HttpStatusCode status_code = net::HTTP_OK;
   scoped_ptr<base::DictionaryValue> json_response;
@@ -114,8 +182,7 @@
   } else if (url.path() == "/privet/register") {
     json_response = ProcessRegister(url, &status_code);
   } else {
-    response->clear();
-    return net::HTTP_NOT_FOUND;
+    NOTREACHED();
   }
 
   if (!json_response) {
@@ -139,13 +206,29 @@
 
   scoped_ptr<base::DictionaryValue> response(new base::DictionaryValue);
   response->SetString("version", info.version);
+  response->SetString("name", info.name);
+  response->SetString("description", info.description);
+  response->SetString("url", info.url);
+  response->SetString("id", info.id);
+  response->SetString("device_state", info.device_state);
+  response->SetString("connection_state", info.connection_state);
   response->SetString("manufacturer", info.manufacturer);
+  response->SetString("model", info.model);
+  response->SetString("serial_number", info.serial_number);
+  response->SetString("firmware", info.firmware);
+  response->SetInteger("uptime", info.uptime);
+  response->SetString("x-privet-token", info.x_privet_token);
 
   base::ListValue api;
   for (size_t i = 0; i < info.api.size(); ++i)
     api.AppendString(info.api[i]);
   response->Set("api", api.DeepCopy());
 
+  base::ListValue type;
+  for (size_t i = 0; i < info.type.size(); ++i)
+    type.AppendString(info.type[i]);
+  response->Set("type", type.DeepCopy());
+
   *status_code = net::HTTP_OK;
   return response.Pass();
 }
@@ -153,7 +236,10 @@
 scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister(
     const GURL& url,
     net::HttpStatusCode* status_code) {
-  // TODO(maksymb): Add saving state to drive.
+  if (delegate_->IsRegistered()) {
+    *status_code = net::HTTP_NOT_FOUND;
+    return scoped_ptr<base::DictionaryValue>();
+  }
 
   std::string action;
   if (!net::GetValueForKeyInQuery(url, "action", &action)) {
@@ -213,10 +299,6 @@
       *status_code = net::HTTP_BAD_REQUEST;
       current_response->reset();
       break;
-    case REG_ERROR_REGISTERED:
-      *status_code = net::HTTP_NOT_FOUND;
-      current_response->reset();
-      break;
 
     case REG_ERROR_DEVICE_BUSY:
       *status_code = net::HTTP_OK;
diff --git a/cloud_print/gcp20/prototype/privet_http_server.h b/cloud_print/gcp20/prototype/privet_http_server.h
index b412bad..84a464c 100644
--- a/cloud_print/gcp20/prototype/privet_http_server.h
+++ b/cloud_print/gcp20/prototype/privet_http_server.h
@@ -10,6 +10,7 @@
 
 #include "base/basictypes.h"
 #include "base/values.h"
+#include "net/http/http_status_code.h"
 #include "net/server/http_server.h"
 #include "net/server/http_server_request_info.h"
 
@@ -22,7 +23,6 @@
   enum RegistrationErrorStatus {
     REG_ERROR_OK,
     REG_ERROR_NO_RESULT,  // default value, never set.
-    REG_ERROR_REGISTERED,
 
     REG_ERROR_DEVICE_BUSY,
     REG_ERROR_PENDING_USER_ACTION,
@@ -38,8 +38,21 @@
     ~DeviceInfo();
 
     std::string version;
+    std::string name;
+    std::string description;
+    std::string url;
+    std::string id;
+    std::string device_state;
+    std::string connection_state;
     std::string manufacturer;
+    std::string model;
+    std::string serial_number;
+    std::string firmware;
+    int uptime;
+    std::string x_privet_token;
+
     std::vector<std::string> api;
+    std::vector<std::string> type;
   };
 
   class Delegate {
@@ -70,8 +83,14 @@
     // Invoked for receiving server error details.
     virtual void GetRegistrationServerError(std::string* description) = 0;
 
-    // Invoked if /privet/info is called.
+    // Invoked when /privet/info is called.
     virtual void CreateInfo(DeviceInfo* info) = 0;
+
+    // Invoked for checking should /privet/register be exposed.
+    virtual bool IsRegistered() const = 0;
+
+    // Invoked when XPrivetToken has to be checked.
+    virtual bool CheckXPrivetTokenHeader(const std::string& token) const = 0;
   };
 
   // Constructor doesn't start server.
@@ -98,9 +117,19 @@
                                   const std::string& data) OVERRIDE;
   virtual void OnClose(int connection_id) OVERRIDE;
 
+  // Sends error as response. Invoked when request method is invalid.
+  void ReportInvalidMethod(int connection_id);
+
+  // Returns |true| if |request| should be done with correct |method|.
+  // Otherwise sends |Invalid method| error.
+  // Also checks support of |request| by this server.
+  bool ValidateRequestMethod(int connection_id, const std::string& request,
+                             const std::string& method);
+
   // Processes http request after all preparations (XPrivetHeader check,
   // data handling etc.)
   net::HttpStatusCode ProcessHttpRequest(const GURL& url,
+                                         const std::string& data,
                                          std::string* response);
 
   // Pivet API methods. Return reference to NULL if output should be empty.
diff --git a/cloud_print/gcp20/prototype/x_privet_token.cc b/cloud_print/gcp20/prototype/x_privet_token.cc
new file mode 100644
index 0000000..b9afd10
--- /dev/null
+++ b/cloud_print/gcp20/prototype/x_privet_token.cc
@@ -0,0 +1,78 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cloud_print/gcp20/prototype/x_privet_token.h"
+
+#include "base/base64.h"
+#include "base/format_macros.h"
+#include "base/guid.h"
+#include "base/logging.h"
+#include "base/sha1.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/stringprintf.h"
+
+namespace {
+
+const char kXPrivetTokenDelimeter = ':';
+const uint64 kTimeExpiration = 24*60*60;  // in seconds
+
+}  // namespace
+
+using base::Time;
+using base::TimeDelta;
+
+XPrivetToken::XPrivetToken() {
+  UpdateSecret();
+}
+
+XPrivetToken::XPrivetToken(const std::string& secret,
+                           const base::Time& gen_time)
+    : secret_(secret),
+      last_gen_time_(gen_time) {
+}
+
+std::string XPrivetToken::GenerateXToken() {
+  if (Time::Now() > last_gen_time_ + TimeDelta::FromSeconds(kTimeExpiration))
+    UpdateSecret();
+
+  return GenerateXTokenWithTime(static_cast<uint64>(Time::Now().ToTimeT()));
+}
+
+bool XPrivetToken::CheckValidXToken(const std::string& token_encoded) const {
+  std::string token;
+  if (!base::Base64Decode(token_encoded, &token))
+    return false;
+
+  size_t delimeter_pos = token.find(kXPrivetTokenDelimeter);
+  if (delimeter_pos == std::string::npos)
+    return false;
+
+  std::string issue_time_str = token.substr(delimeter_pos + 1);
+  uint64 issue_time;
+  if (!base::StringToUint64(issue_time_str, &issue_time))
+    return false;
+
+  if (GenerateXTokenWithTime(issue_time) != token_encoded)
+    return false;
+
+  return Time::FromTimeT(issue_time) - last_gen_time_ <
+      TimeDelta::FromSeconds(kTimeExpiration);
+}
+
+std::string XPrivetToken::GenerateXTokenWithTime(uint64 issue_time) const {
+  std::string result;
+  std::string issue_time_str = base::StringPrintf("%"PRIu64, issue_time);
+  std::string hash = base::SHA1HashString(secret_ +
+                                          kXPrivetTokenDelimeter +
+                                          issue_time_str);
+  base::Base64Encode(hash + kXPrivetTokenDelimeter + issue_time_str, &result);
+  return result;
+}
+
+void XPrivetToken::UpdateSecret() {
+  secret_ = base::GenerateGUID();
+  last_gen_time_ = base::Time::Now();
+  VLOG(1) << "New Secret is Generated.";
+}
+
diff --git a/cloud_print/gcp20/prototype/x_privet_token.h b/cloud_print/gcp20/prototype/x_privet_token.h
new file mode 100644
index 0000000..edfc283
--- /dev/null
+++ b/cloud_print/gcp20/prototype/x_privet_token.h
@@ -0,0 +1,52 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CLOUD_PRINT_GCP20_PROTOTYPE_X_PRIVET_TOKEN_H_
+#define CLOUD_PRINT_GCP20_PROTOTYPE_X_PRIVET_TOKEN_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
+#include "base/time/time.h"
+
+// Class for generating and checking X-Privet-Token.
+class XPrivetToken {
+ public:
+  // Initializes the object.
+  XPrivetToken();
+
+  // Destroys the object.
+  ~XPrivetToken() {}
+
+  // Generates X-Privet-Token for /privet/info request. Updates secret
+  // if expired.
+  std::string GenerateXToken();
+
+  // Checks
+  bool CheckValidXToken(const std::string& token_encoded) const;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(XPrivetTokenTest, Generation);
+  FRIEND_TEST_ALL_PREFIXES(XPrivetTokenTest, CheckingValid);
+  FRIEND_TEST_ALL_PREFIXES(XPrivetTokenTest, CheckingInvalid);
+
+  // For testing purposes.
+  XPrivetToken(const std::string& secret, const base::Time& gen_time);
+
+  // Generates X-Privet-Token for with certain time of issue.
+  std::string GenerateXTokenWithTime(uint64 issue_time) const;
+
+  // Creates new XPrivetToken secret.
+  void UpdateSecret();
+
+  // X-Privet-Token secret.
+  std::string secret_;
+
+  // Time of last secret generation.
+  base::Time last_gen_time_;
+};
+
+#endif  // CLOUD_PRINT_GCP20_PROTOTYPE_X_PRIVET_TOKEN_H_
+
diff --git a/cloud_print/gcp20/prototype/x_privet_token_unittest.cc b/cloud_print/gcp20/prototype/x_privet_token_unittest.cc
new file mode 100644
index 0000000..4317459
--- /dev/null
+++ b/cloud_print/gcp20/prototype/x_privet_token_unittest.cc
@@ -0,0 +1,123 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cloud_print/gcp20/prototype/x_privet_token.h"
+
+#include <stdio.h>
+
+#include "base/base64.h"
+#include "base/basictypes.h"
+#include "base/format_macros.h"
+#include "base/logging.h"
+#include "base/sha1.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/stringprintf.h"
+#include "base/time/time.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(XPrivetTokenTest, Generation) {
+  std::string secret = "E3E92296-E290-4E77-B678-6AEF256C30C8";
+  uint64 gen_time = 1372444784;
+  uint64 issue_time = gen_time;
+
+  XPrivetToken xtoken(secret, base::Time::FromTimeT(gen_time));
+
+  std::string issue_time_str = base::StringPrintf("%"PRIu64, issue_time);
+  std::string sha1_val = base::SHA1HashString(secret + ":" + issue_time_str);
+
+  EXPECT_STRCASEEQ("2216828f9eefc3931c1b9a110dcca3dbec23571d",
+                   base::HexEncode(sha1_val.data(), sha1_val.size()).c_str());
+
+  std::string base64_val;
+  base::Base64Encode(sha1_val + ":" + issue_time_str, &base64_val);
+
+  EXPECT_EQ(base64_val, xtoken.GenerateXTokenWithTime(issue_time));
+
+  EXPECT_NE(xtoken.GenerateXTokenWithTime(issue_time),
+            xtoken.GenerateXTokenWithTime(issue_time + 1));
+}
+
+TEST(XPrivetTokenTest, CheckingValid) {
+  base::Time gen_time = base::Time::FromTimeT(1372444784);
+  XPrivetToken xtoken("9CEEA1AD-BC24-4D5A-8AB4-A6CE3E0CC4CD", gen_time);
+
+  std::string token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT());
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 1);
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 55);
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 60*60 - 5);
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 60*60 + 10);
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 24*60*60 - 1);
+  EXPECT_TRUE(xtoken.CheckValidXToken(token));
+}
+
+TEST(XPrivetTokenTest, CheckingInvalid) {
+  base::Time gen_time = base::Time::FromTimeT(1372444784);
+  XPrivetToken xtoken("9CEEA1AD-BC24-4D5A-8AB4-A6CE3E0CC4CD", gen_time);
+
+  // Meaningless tokens:
+
+  std::string token = "CEEA1AD9CEEA1AD9CEEA1AD9CEEA1AD";
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA1AD9CEEA1AD9CEEA1AD", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA:1AD9CEEA1AD9CEEA1AD", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA:1AD9CEEA1AD9:CEEA1AD", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA:123456", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA:", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  base::Base64Encode("CEEA1AD9CEEA:1372444784", &token);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  EXPECT_FALSE(xtoken.CheckValidXToken(""));
+
+  // Expired tokens:
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 24*60*60 + 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = xtoken.GenerateXTokenWithTime(gen_time.ToTimeT() + 7*24*60*60 - 1023);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  // Tokens with different secret:
+
+  XPrivetToken another("6F02AC4E-6F37-4078-AF42-5EE5D8180284", gen_time);
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT() - 24*60*60 - 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT() - 24*60*60 + 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT());
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT() + 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT() + 24*60*60 - 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+
+  token = another.GenerateXTokenWithTime(gen_time.ToTimeT() + 24*60*60 + 1);
+  EXPECT_FALSE(xtoken.CheckValidXToken(token));
+}
+
diff --git a/components/auto_login_parser.target.darwin-arm.mk b/components/auto_login_parser.target.darwin-arm.mk
index 43163b3..c7476b1 100644
--- a/components/auto_login_parser.target.darwin-arm.mk
+++ b/components/auto_login_parser.target.darwin-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/auto_login_parser.target.darwin-mips.mk b/components/auto_login_parser.target.darwin-mips.mk
index 961d43c..ee40c08 100644
--- a/components/auto_login_parser.target.darwin-mips.mk
+++ b/components/auto_login_parser.target.darwin-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -150,10 +150,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/auto_login_parser.target.darwin-x86.mk b/components/auto_login_parser.target.darwin-x86.mk
index 59bafd0..e50ec4a 100644
--- a/components/auto_login_parser.target.darwin-x86.mk
+++ b/components/auto_login_parser.target.darwin-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/auto_login_parser.target.linux-arm.mk b/components/auto_login_parser.target.linux-arm.mk
index 43163b3..c7476b1 100644
--- a/components/auto_login_parser.target.linux-arm.mk
+++ b/components/auto_login_parser.target.linux-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/auto_login_parser.target.linux-mips.mk b/components/auto_login_parser.target.linux-mips.mk
index 961d43c..ee40c08 100644
--- a/components/auto_login_parser.target.linux-mips.mk
+++ b/components/auto_login_parser.target.linux-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -150,10 +150,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/auto_login_parser.target.linux-x86.mk b/components/auto_login_parser.target.linux-x86.mk
index 59bafd0..e50ec4a 100644
--- a/components/auto_login_parser.target.linux-x86.mk
+++ b/components/auto_login_parser.target.linux-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill/content/browser/autocheckout_manager_unittest.cc b/components/autofill/content/browser/autocheckout_manager_unittest.cc
index e5d5aa5..3b39631 100644
--- a/components/autofill/content/browser/autocheckout_manager_unittest.cc
+++ b/components/autofill/content/browser/autocheckout_manager_unittest.cc
@@ -7,7 +7,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/tuple.h"
 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "chrome/test/base/testing_profile.h"
 #include "components/autofill/content/browser/autocheckout_manager.h"
 #include "components/autofill/core/browser/autofill_common_test.h"
 #include "components/autofill/core/browser/autofill_manager.h"
@@ -417,7 +416,6 @@
   virtual void SetUp() OVERRIDE {
     SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
     ChromeRenderViewHostTestHarness::SetUp();
-    profile()->CreateRequestContext();
     autofill_manager_delegate_.reset(new MockAutofillManagerDelegate());
     autofill_driver_.reset(new TestAutofillDriver(web_contents()));
     autofill_manager_.reset(new TestAutofillManager(
@@ -432,7 +430,6 @@
     autofill_manager_delegate_.reset();
     autofill_manager_.reset();
     autofill_driver_.reset();
-    profile()->ResetRequestContext();
     ChromeRenderViewHostTestHarness::TearDown();
   }
 
diff --git a/components/autofill/content/browser/wallet/wallet_client_unittest.cc b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
index 6536c3e..9360b95 100644
--- a/components/autofill/content/browser/wallet/wallet_client_unittest.cc
+++ b/components/autofill/content/browser/wallet/wallet_client_unittest.cc
@@ -20,7 +20,7 @@
 #include "components/autofill/core/browser/autofill_metrics.h"
 #include "components/autofill/core/common/autocheckout_status.h"
 #include "content/public/test/test_browser_context.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/escape.h"
 #include "net/base/net_errors.h"
 #include "net/http/http_request_headers.h"
@@ -658,8 +658,6 @@
 
 class WalletClientTest : public testing::Test {
  public:
-  WalletClientTest() {}
-
   virtual void SetUp() OVERRIDE {
     wallet_client_.reset(
         new WalletClient(browser_context_.GetRequestContext(), &delegate_));
@@ -772,6 +770,9 @@
     return clean_upload_data;
   }
 
+  // The profile's request context must be released on the IO thread.
+  content::TestBrowserThreadBundle thread_bundle_;
+
   net::TestURLFetcherFactory factory_;
 };
 
diff --git a/components/autofill/content/browser/wallet/wallet_service_url.cc b/components/autofill/content/browser/wallet/wallet_service_url.cc
index bebdf7f..e95a201 100644
--- a/components/autofill/content/browser/wallet/wallet_service_url.cc
+++ b/components/autofill/content/browser/wallet/wallet_service_url.cc
@@ -85,11 +85,11 @@
 }
 
 GURL GetManageInstrumentsUrl() {
-  return GetBaseSecureUrl().Resolve("manage/w/0/#paymentMethods:");
+  return GetBaseSecureUrl().Resolve("manage/paymentMethods");
 }
 
 GURL GetManageAddressesUrl() {
-  return GetBaseSecureUrl().Resolve("manage/w/0/#settings:addresses");
+  return GetBaseSecureUrl().Resolve("manage/settings/addresses");
 }
 
 GURL GetAcceptLegalDocumentsUrl() {
diff --git a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
index 793c95b..3ed3600 100644
--- a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
+++ b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
@@ -18,10 +18,9 @@
   EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/v2/"
             "autocheckout/v1/getFullWalletJwtless?s7e=otp",
             GetGetFullWalletUrl().spec());
-  EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/#paymentMethods:",
+  EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/paymentMethods",
             GetManageInstrumentsUrl().spec());
-  EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/"
-            "#settings:addresses",
+  EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/settings/addresses",
             GetManageAddressesUrl().spec());
   EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/"
             "autocheckout/v1/acceptLegalDocument",
diff --git a/components/autofill/content/browser/wallet/wallet_signin_helper_unittest.cc b/components/autofill/content/browser/wallet/wallet_signin_helper_unittest.cc
index a4f2bd9..c980fba 100644
--- a/components/autofill/content/browser/wallet/wallet_signin_helper_unittest.cc
+++ b/components/autofill/content/browser/wallet/wallet_signin_helper_unittest.cc
@@ -78,9 +78,7 @@
 }  // namespace
 
 class WalletSigninHelperTest : public testing::Test {
- public:
-  WalletSigninHelperTest() {}
-
+ protected:
   virtual void SetUp() OVERRIDE {
     signin_helper_.reset(new WalletSigninHelperForTesting(
         &mock_delegate_,
@@ -92,7 +90,6 @@
     signin_helper_.reset();
   }
 
- protected:
   // Sets up a response for the mock URLFetcher and completes the request.
   void SetUpFetcherResponseAndCompleteRequest(
       const std::string& url,
@@ -158,8 +155,9 @@
   content::TestBrowserContext browser_context_;
 
  private:
-  net::TestURLFetcherFactory factory_;
+  // The profile's request context must be released on the IO thread.
   content::TestBrowserThreadBundle thread_bundle_;
+  net::TestURLFetcherFactory factory_;
 };
 
 TEST_F(WalletSigninHelperTest, PassiveSigninSuccessful) {
diff --git a/components/autofill/core/browser/autofill_download_unittest.cc b/components/autofill/core/browser/autofill_download_unittest.cc
index ec6bad1..ed2c705 100644
--- a/components/autofill/core/browser/autofill_download_unittest.cc
+++ b/components/autofill/core/browser/autofill_download_unittest.cc
@@ -15,14 +15,13 @@
 #include "components/autofill/core/browser/autofill_type.h"
 #include "components/autofill/core/browser/form_structure.h"
 #include "components/autofill/core/common/form_data.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "net/url_request/test_url_fetcher_factory.h"
 #include "net/url_request/url_request_status.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/public/web/WebInputElement.h"
 
-using content::BrowserThread;
 using WebKit::WebInputElement;
 
 namespace autofill {
@@ -65,18 +64,7 @@
                              public testing::Test {
  public:
   AutofillDownloadTest()
-      : download_manager_(&profile_, this),
-        io_thread_(BrowserThread::IO) {
-  }
-
-  virtual void SetUp() {
-    io_thread_.StartIOThread();
-    profile_.CreateRequestContext();
-  }
-
-  virtual void TearDown() {
-    profile_.ResetRequestContext();
-    io_thread_.Stop();
+      : download_manager_(&profile_, this) {
   }
 
   void LimitCache(size_t cache_size) {
@@ -128,16 +116,12 @@
   };
   std::list<ResponseData> responses_;
 
+  content::TestBrowserThreadBundle thread_bundle_;
   TestingProfile profile_;
   AutofillDownloadManager download_manager_;
-
- private:
-  // The profile's request context must be released on the IO thread.
-  content::TestBrowserThread io_thread_;
 };
 
 TEST_F(AutofillDownloadTest, QueryAndUploadTest) {
-  base::MessageLoopForUI message_loop;
   // Create and register factory.
   net::TestURLFetcherFactory factory;
 
@@ -349,7 +333,6 @@
 }
 
 TEST_F(AutofillDownloadTest, CacheQueryTest) {
-  base::MessageLoopForUI message_loop;
   // Create and register factory.
   net::TestURLFetcherFactory factory;
 
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index d133cf3..639d733 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -770,12 +770,6 @@
     personal_data_.SetBrowserContext(NULL);
   }
 
-  virtual content::BrowserContext* CreateBrowserContext() OVERRIDE {
-    TestingProfile* profile = new TestingProfile();
-    profile->CreateRequestContext();
-    return profile;
-  }
-
   void GetAutofillSuggestions(int query_id,
                               const FormData& form,
                               const FormFieldData& field) {
@@ -2082,7 +2076,7 @@
   form.fields.push_back(field);
 
   test::CreateTestFormField("", "address", "", "text", &field);
-  field.autocomplete_attribute = "section-billing street-address";
+  field.autocomplete_attribute = "section-billing address-line1";
   form.fields.push_back(field);
 
   test::CreateTestFormField("", "city", "", "text", &field);
diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc
index a5e58b5..ce125fa 100644
--- a/components/autofill/core/browser/autofill_metrics_unittest.cc
+++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -287,7 +287,6 @@
   // Ensure Mac OS X does not pop up a modal dialog for the Address Book.
   autofill::test::DisableSystemServices(profile());
 
-  profile()->CreateRequestContext();
   PersonalDataManagerFactory::GetInstance()->SetTestingFactory(profile(), NULL);
 
   TabAutofillManagerDelegate::CreateForWebContents(web_contents());
@@ -315,7 +314,6 @@
   autofill_manager_.reset();
   autofill_driver_.reset();
   personal_data_.reset();
-  profile()->ResetRequestContext();
   ChromeRenderViewHostTestHarness::TearDown();
 }
 
@@ -810,7 +808,7 @@
   field.autocomplete_attribute = "email";
   forms.back().fields.push_back(field);
   test::CreateTestFormField("", "", "", "text", &field);
-  field.autocomplete_attribute = "street-address";
+  field.autocomplete_attribute = "address-line1";
   forms.back().fields.push_back(field);
 
   // Expect both the "form parsed" metric and the author-specified field type
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc
index ff3f84e..0e97d98 100644
--- a/components/autofill/core/browser/form_structure.cc
+++ b/components/autofill/core/browser/form_structure.cc
@@ -210,8 +210,7 @@
   if (autocomplete_type == "organization")
     return COMPANY_NAME;
 
-  if (autocomplete_type == "street-address" ||
-      autocomplete_type == "address-line1")
+  if (autocomplete_type == "address-line1")
     return ADDRESS_HOME_LINE1;
 
   if (autocomplete_type == "address-line2")
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc
index 995cfd3..0c78751 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -673,7 +673,7 @@
 
   field.autocomplete_attribute = "section-foo email";
   form.fields.push_back(field);
-  field.autocomplete_attribute = "section-foo street-address";
+  field.autocomplete_attribute = "section-foo address-line1";
   form.fields.push_back(field);
 
   FormStructure form_structure(form, std::string());
@@ -702,7 +702,7 @@
   field.form_control_type = "text";
 
   field.name = ASCIIToUTF16("one");
-  field.autocomplete_attribute = "street-address";
+  field.autocomplete_attribute = "address-line1";
   form.fields.push_back(field);
   field.name = base::string16();
   field.autocomplete_attribute = "section-foo email";
@@ -711,7 +711,7 @@
   field.autocomplete_attribute = "name";
   form.fields.push_back(field);
   field.name = ASCIIToUTF16("two");
-  field.autocomplete_attribute = "street-address";
+  field.autocomplete_attribute = "address-line1";
   form.fields.push_back(field);
 
   FormStructure form_structure(form, std::string());
diff --git a/components/autofill_content_browser.target.darwin-arm.mk b/components/autofill_content_browser.target.darwin-arm.mk
index dd5197b..48f50bb 100644
--- a/components/autofill_content_browser.target.darwin-arm.mk
+++ b/components/autofill_content_browser.target.darwin-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -93,20 +94,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -141,8 +141,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -229,20 +229,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -278,8 +277,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -366,7 +365,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_browser.target.darwin-mips.mk b/components/autofill_content_browser.target.darwin-mips.mk
index 0ee4e98..9611d77 100644
--- a/components/autofill_content_browser.target.darwin-mips.mk
+++ b/components/autofill_content_browser.target.darwin-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -92,20 +93,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -140,8 +140,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -227,20 +227,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -276,8 +275,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -360,7 +359,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_browser.target.darwin-x86.mk b/components/autofill_content_browser.target.darwin-x86.mk
index 4747751..4b0fd58 100644
--- a/components/autofill_content_browser.target.darwin-x86.mk
+++ b/components/autofill_content_browser.target.darwin-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -95,20 +96,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -142,8 +142,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -233,20 +233,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -281,8 +280,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -364,7 +363,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_browser.target.linux-arm.mk b/components/autofill_content_browser.target.linux-arm.mk
index dd5197b..48f50bb 100644
--- a/components/autofill_content_browser.target.linux-arm.mk
+++ b/components/autofill_content_browser.target.linux-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -93,20 +94,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -141,8 +141,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -229,20 +229,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -278,8 +277,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -366,7 +365,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_browser.target.linux-mips.mk b/components/autofill_content_browser.target.linux-mips.mk
index 0ee4e98..9611d77 100644
--- a/components/autofill_content_browser.target.linux-mips.mk
+++ b/components/autofill_content_browser.target.linux-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -92,20 +93,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -140,8 +140,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -227,20 +227,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -276,8 +275,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -360,7 +359,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_browser.target.linux-x86.mk b/components/autofill_content_browser.target.linux-x86.mk
index 4747751..4b0fd58 100644
--- a/components/autofill_content_browser.target.linux-x86.mk
+++ b/components/autofill_content_browser.target.linux-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_autofill_content_risk_proto_gyp)/components_autofill_content_risk_proto_gyp.a \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -95,20 +96,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -142,8 +142,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -233,20 +233,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -281,8 +280,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -364,7 +363,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	components_autofill_content_risk_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_content_renderer.target.darwin-arm.mk b/components/autofill_content_renderer.target.darwin-arm.mk
index 0716432..bfcf758 100644
--- a/components/autofill_content_renderer.target.darwin-arm.mk
+++ b/components/autofill_content_renderer.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -76,17 +77,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -182,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -214,8 +213,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_renderer.target.darwin-mips.mk b/components/autofill_content_renderer.target.darwin-mips.mk
index a9b1d4c..6844cd6 100644
--- a/components/autofill_content_renderer.target.darwin-mips.mk
+++ b/components/autofill_content_renderer.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -75,17 +76,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -106,8 +106,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -180,17 +180,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,8 +211,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -282,7 +281,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_renderer.target.darwin-x86.mk b/components/autofill_content_renderer.target.darwin-x86.mk
index 743b3f8..fe4d57e 100644
--- a/components/autofill_content_renderer.target.darwin-x86.mk
+++ b/components/autofill_content_renderer.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,17 +187,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -219,8 +218,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_renderer.target.linux-arm.mk b/components/autofill_content_renderer.target.linux-arm.mk
index 0716432..bfcf758 100644
--- a/components/autofill_content_renderer.target.linux-arm.mk
+++ b/components/autofill_content_renderer.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -76,17 +77,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -182,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -214,8 +213,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_renderer.target.linux-mips.mk b/components/autofill_content_renderer.target.linux-mips.mk
index a9b1d4c..6844cd6 100644
--- a/components/autofill_content_renderer.target.linux-mips.mk
+++ b/components/autofill_content_renderer.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -75,17 +76,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -106,8 +106,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -180,17 +180,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,8 +211,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -282,7 +281,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_renderer.target.linux-x86.mk b/components/autofill_content_renderer.target.linux-x86.mk
index 743b3f8..fe4d57e 100644
--- a/components/autofill_content_renderer.target.linux-x86.mk
+++ b/components/autofill_content_renderer.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,components_component_strings_gyp)/component_strings.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,17 +187,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -219,8 +218,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/autofill_content_risk_proto.target.darwin-arm.mk b/components/autofill_content_risk_proto.target.darwin-arm.mk
index 84b2f20..60a6055 100644
--- a/components/autofill_content_risk_proto.target.darwin-arm.mk
+++ b/components/autofill_content_risk_proto.target.darwin-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_content_risk_proto.target.darwin-mips.mk b/components/autofill_content_risk_proto.target.darwin-mips.mk
index 770292b..2f036d2 100644
--- a/components/autofill_content_risk_proto.target.darwin-mips.mk
+++ b/components/autofill_content_risk_proto.target.darwin-mips.mk
@@ -95,10 +95,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_content_risk_proto.target.darwin-x86.mk b/components/autofill_content_risk_proto.target.darwin-x86.mk
index 10afef4..67f1395 100644
--- a/components/autofill_content_risk_proto.target.darwin-x86.mk
+++ b/components/autofill_content_risk_proto.target.darwin-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_content_risk_proto.target.linux-arm.mk b/components/autofill_content_risk_proto.target.linux-arm.mk
index 84b2f20..60a6055 100644
--- a/components/autofill_content_risk_proto.target.linux-arm.mk
+++ b/components/autofill_content_risk_proto.target.linux-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_content_risk_proto.target.linux-mips.mk b/components/autofill_content_risk_proto.target.linux-mips.mk
index 770292b..2f036d2 100644
--- a/components/autofill_content_risk_proto.target.linux-mips.mk
+++ b/components/autofill_content_risk_proto.target.linux-mips.mk
@@ -95,10 +95,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_content_risk_proto.target.linux-x86.mk b/components/autofill_content_risk_proto.target.linux-x86.mk
index 10afef4..67f1395 100644
--- a/components/autofill_content_risk_proto.target.linux-x86.mk
+++ b/components/autofill_content_risk_proto.target.linux-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/components/autofill_core_browser.target.darwin-arm.mk b/components/autofill_core_browser.target.darwin-arm.mk
index be2b5ce..973f381 100644
--- a/components/autofill_core_browser.target.darwin-arm.mk
+++ b/components/autofill_core_browser.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -117,17 +118,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -162,8 +162,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -253,17 +253,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -299,8 +298,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -389,7 +388,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_browser.target.darwin-mips.mk b/components/autofill_core_browser.target.darwin-mips.mk
index 3897b86..c19dde6 100644
--- a/components/autofill_core_browser.target.darwin-mips.mk
+++ b/components/autofill_core_browser.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -116,17 +117,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -161,8 +161,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -251,17 +251,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -297,8 +296,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -383,7 +382,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_browser.target.darwin-x86.mk b/components/autofill_core_browser.target.darwin-x86.mk
index 337d66f..1b3a919 100644
--- a/components/autofill_core_browser.target.darwin-x86.mk
+++ b/components/autofill_core_browser.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -119,17 +120,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -163,8 +163,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -257,17 +257,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -302,8 +301,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -387,7 +386,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_browser.target.linux-arm.mk b/components/autofill_core_browser.target.linux-arm.mk
index be2b5ce..973f381 100644
--- a/components/autofill_core_browser.target.linux-arm.mk
+++ b/components/autofill_core_browser.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -117,17 +118,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -162,8 +162,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -253,17 +253,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -299,8 +298,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -389,7 +388,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_browser.target.linux-mips.mk b/components/autofill_core_browser.target.linux-mips.mk
index 3897b86..c19dde6 100644
--- a/components/autofill_core_browser.target.linux-mips.mk
+++ b/components/autofill_core_browser.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -116,17 +117,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -161,8 +161,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -251,17 +251,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -297,8 +296,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -383,7 +382,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_browser.target.linux-x86.mk b/components/autofill_core_browser.target.linux-x86.mk
index 337d66f..1b3a919 100644
--- a/components/autofill_core_browser.target.linux-x86.mk
+++ b/components/autofill_core_browser.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,components_autofill_regexes_gyp)/autofill_regexes.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_libphonenumber_libphonenumber_without_metadata_gyp)/third_party_libphonenumber_libphonenumber_without_metadata_gyp.a \
@@ -119,17 +120,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -163,8 +163,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -257,17 +257,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -302,8 +301,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -387,7 +386,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp \
 	ui_ui_gyp
 
diff --git a/components/autofill_core_common.target.darwin-arm.mk b/components/autofill_core_common.target.darwin-arm.mk
index 6c96d46..b8d497d 100644
--- a/components/autofill_core_common.target.darwin-arm.mk
+++ b/components/autofill_core_common.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/autofill_core_common.target.darwin-mips.mk b/components/autofill_core_common.target.darwin-mips.mk
index f45972c..2e71b22 100644
--- a/components/autofill_core_common.target.darwin-mips.mk
+++ b/components/autofill_core_common.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/autofill_core_common.target.darwin-x86.mk b/components/autofill_core_common.target.darwin-x86.mk
index ec7be90..3debf78 100644
--- a/components/autofill_core_common.target.darwin-x86.mk
+++ b/components/autofill_core_common.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/autofill_core_common.target.linux-arm.mk b/components/autofill_core_common.target.linux-arm.mk
index 6c96d46..b8d497d 100644
--- a/components/autofill_core_common.target.linux-arm.mk
+++ b/components/autofill_core_common.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/autofill_core_common.target.linux-mips.mk b/components/autofill_core_common.target.linux-mips.mk
index f45972c..2e71b22 100644
--- a/components/autofill_core_common.target.linux-mips.mk
+++ b/components/autofill_core_common.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/autofill_core_common.target.linux-x86.mk b/components/autofill_core_common.target.linux-x86.mk
index ec7be90..3debf78 100644
--- a/components/autofill_core_common.target.linux-x86.mk
+++ b/components/autofill_core_common.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/autofill_jni_headers.target.darwin-arm.mk b/components/autofill_jni_headers.target.darwin-arm.mk
index fe70f23..45ba4c3 100644
--- a/components/autofill_jni_headers.target.darwin-arm.mk
+++ b/components/autofill_jni_headers.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill_jni_headers.target.darwin-mips.mk b/components/autofill_jni_headers.target.darwin-mips.mk
index 2f18a90..6cb8efe 100644
--- a/components/autofill_jni_headers.target.darwin-mips.mk
+++ b/components/autofill_jni_headers.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill_jni_headers.target.darwin-x86.mk b/components/autofill_jni_headers.target.darwin-x86.mk
index d090517..f1df2ef 100644
--- a/components/autofill_jni_headers.target.darwin-x86.mk
+++ b/components/autofill_jni_headers.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill_jni_headers.target.linux-arm.mk b/components/autofill_jni_headers.target.linux-arm.mk
index fe70f23..45ba4c3 100644
--- a/components/autofill_jni_headers.target.linux-arm.mk
+++ b/components/autofill_jni_headers.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill_jni_headers.target.linux-mips.mk b/components/autofill_jni_headers.target.linux-mips.mk
index 2f18a90..6cb8efe 100644
--- a/components/autofill_jni_headers.target.linux-mips.mk
+++ b/components/autofill_jni_headers.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/autofill_jni_headers.target.linux-x86.mk b/components/autofill_jni_headers.target.linux-x86.mk
index d090517..f1df2ef 100644
--- a/components/autofill_jni_headers.target.linux-x86.mk
+++ b/components/autofill_jni_headers.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/breakpad/breakpad_client.cc b/components/breakpad/breakpad_client.cc
index 502884e..ecfe166 100644
--- a/components/breakpad/breakpad_client.cc
+++ b/components/breakpad/breakpad_client.cc
@@ -4,6 +4,7 @@
 
 #include "components/breakpad/breakpad_client.h"
 
+#include "base/files/file_path.h"
 #include "base/logging.h"
 
 namespace breakpad {
@@ -35,7 +36,8 @@
 void BreakpadClient::GetProductNameAndVersion(const base::FilePath& exe_path,
                                               base::string16* product_name,
                                               base::string16* version,
-                                              base::string16* special_build) {
+                                              base::string16* special_build,
+                                              base::string16* channel_name) {
 }
 
 bool BreakpadClient::ShouldShowRestartDialog(base::string16* title,
@@ -47,12 +49,32 @@
 bool BreakpadClient::AboutToRestart() {
   return true;
 }
+
+base::string16 BreakpadClient::GetCrashGUID() {
+  return base::string16();
+}
+
+bool BreakpadClient::GetDeferredUploadsSupported(bool is_per_usr_install) {
+  return false;
+}
+
+bool BreakpadClient::GetIsPerUserInstall(const base::FilePath& exe_path) {
+  return false;
+}
+
+bool BreakpadClient::GetShouldDumpLargerDumps(bool is_per_user_install) {
+  return false;
+}
 #endif
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
 void BreakpadClient::GetProductNameAndVersion(std::string* product_name,
                                               std::string* version) {
 }
+
+base::FilePath BreakpadClient::GetReporterLogFilename() {
+  return base::FilePath();
+}
 #endif
 
 bool BreakpadClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
@@ -72,4 +94,10 @@
   return false;
 }
 
+#if defined(OS_WIN) || defined(OS_MACOSX)
+bool BreakpadClient::GetCollectStatsConsent() {
+  return false;
+}
+#endif
+
 }  // namespace breakpad
diff --git a/components/breakpad/breakpad_client.h b/components/breakpad/breakpad_client.h
index 12dccde..b678dcf 100644
--- a/components/breakpad/breakpad_client.h
+++ b/components/breakpad/breakpad_client.h
@@ -41,7 +41,8 @@
   virtual void GetProductNameAndVersion(const base::FilePath& exe_path,
                                         base::string16* product_name,
                                         base::string16* version,
-                                        base::string16* special_build);
+                                        base::string16* special_build,
+                                        base::string16* channel_name);
 
   // Returns true if a restart dialog should be displayed. In that case,
   // |message| and |title| are set to a message to display in a dialog box with
@@ -54,6 +55,18 @@
   // Returns true if it is ok to restart the application. Invoked right before
   // restarting after a crash.
   virtual bool AboutToRestart();
+
+  // Returns a GUID to embed in the crash report.
+  virtual base::string16 GetCrashGUID();
+
+  // Returns true if the crash report uploader supports deferred uploads.
+  virtual bool GetDeferredUploadsSupported(bool is_per_user_install);
+
+  // Returns true if the running binary is a per-user installation.
+  virtual bool GetIsPerUserInstall(const base::FilePath& exe_path);
+
+  // Returns true if larger crash dumps should be dumped.
+  virtual bool GetShouldDumpLargerDumps(bool is_per_user_install);
 #endif
 
 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
@@ -61,6 +74,8 @@
   // in the crash report.
   virtual void GetProductNameAndVersion(std::string* product_name,
                                         std::string* version);
+
+  virtual base::FilePath GetReporterLogFilename();
 #endif
 
   // The location where minidump files should be written. Returns true if
@@ -79,6 +94,11 @@
 
   // Returns true if running in unattended mode (for automated testing).
   virtual bool IsRunningUnattended();
+
+#if defined(OS_WIN) || defined(OS_MACOSX)
+  // Returns true if the user has given consent to collect stats.
+  virtual bool GetCollectStatsConsent();
+#endif
 };
 
 }  // namespace breakpad
diff --git a/components/components_tests.gypi b/components/components_tests.gypi
index 2de146b..b8e5600 100644
--- a/components/components_tests.gypi
+++ b/components/components_tests.gypi
@@ -79,6 +79,14 @@
                 '../sync/sync.gyp:sync',
               ],
             }],
+            ['OS=="linux" and component=="shared_library" and linux_use_tcmalloc==1', {
+            'dependencies': [
+                '<(DEPTH)/base/allocator/allocator.gyp:allocator',
+            ],
+            'link_settings': {
+                'ldflags': ['-rdynamic'],
+            },
+            }],
           ],
           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
           'msvs_disabled_warnings': [4267, ],
diff --git a/components/encryptor.target.darwin-arm.mk b/components/encryptor.target.darwin-arm.mk
index 06e40e2..16315df 100644
--- a/components/encryptor.target.darwin-arm.mk
+++ b/components/encryptor.target.darwin-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -149,10 +149,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/encryptor.target.darwin-mips.mk b/components/encryptor.target.darwin-mips.mk
index 15bcfac..d9bddbb 100644
--- a/components/encryptor.target.darwin-mips.mk
+++ b/components/encryptor.target.darwin-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -147,10 +147,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/encryptor.target.darwin-x86.mk b/components/encryptor.target.darwin-x86.mk
index 865c642..4da8243 100644
--- a/components/encryptor.target.darwin-x86.mk
+++ b/components/encryptor.target.darwin-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/encryptor.target.linux-arm.mk b/components/encryptor.target.linux-arm.mk
index 06e40e2..16315df 100644
--- a/components/encryptor.target.linux-arm.mk
+++ b/components/encryptor.target.linux-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -149,10 +149,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/encryptor.target.linux-mips.mk b/components/encryptor.target.linux-mips.mk
index 15bcfac..d9bddbb 100644
--- a/components/encryptor.target.linux-mips.mk
+++ b/components/encryptor.target.linux-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -147,10 +147,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/encryptor.target.linux-x86.mk b/components/encryptor.target.linux-x86.mk
index 865c642..4da8243 100644
--- a/components/encryptor.target.linux-x86.mk
+++ b/components/encryptor.target.linux-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/nacl/common/DEPS b/components/nacl/common/DEPS
new file mode 100644
index 0000000..9583dc6
--- /dev/null
+++ b/components/nacl/common/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+  "+native_client/src",
+]
diff --git a/components/nacl/common/OWNERS b/components/nacl/common/OWNERS
new file mode 100644
index 0000000..6a8067e
--- /dev/null
+++ b/components/nacl/common/OWNERS
@@ -0,0 +1,10 @@
+# Changes to IPC messages require a security review to avoid introducing
+# new sandbox escapes.
+per-file *_messages*.h=set noparent
+per-file *_messages*.h=cdn@chromium.org
+per-file *_messages*.h=cevans@chromium.org
+per-file *_messages*.h=jln@chromium.org
+per-file *_messages*.h=jschuh@chromium.org
+per-file *_messages*.h=palmer@chromium.org
+per-file *_messages*.h=tsepez@chromium.org
+
diff --git a/chrome/common/nacl_debug_exception_handler_win.cc b/components/nacl/common/nacl_debug_exception_handler_win.cc
similarity index 93%
rename from chrome/common/nacl_debug_exception_handler_win.cc
rename to components/nacl/common/nacl_debug_exception_handler_win.cc
index 01206ec..f661391 100644
--- a/chrome/common/nacl_debug_exception_handler_win.cc
+++ b/components/nacl/common/nacl_debug_exception_handler_win.cc
@@ -1,11 +1,10 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/common/nacl_debug_exception_handler_win.h"
+#include "components/nacl/common/nacl_debug_exception_handler_win.h"
 
 #include "base/bind.h"
-#include "base/process_util.h"
 #include "base/threading/platform_thread.h"
 #include "base/win/scoped_handle.h"
 #include "native_client/src/trusted/service_runtime/win/debug_exception_handler.h"
diff --git a/components/nacl/common/nacl_debug_exception_handler_win.h b/components/nacl/common/nacl_debug_exception_handler_win.h
new file mode 100644
index 0000000..42beefe
--- /dev/null
+++ b/components/nacl/common/nacl_debug_exception_handler_win.h
@@ -0,0 +1,18 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_NACL_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
+#define COMPONENTS_NACL_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
+
+#include "base/callback.h"
+#include "base/message_loop/message_loop.h"
+#include "base/process/process.h"
+
+void NaClStartDebugExceptionHandlerThread(
+    base::ProcessHandle nacl_process,
+    const std::string& startup_info,
+    base::MessageLoopProxy* message_loop,
+    const base::Callback<void(bool)>& on_connected);
+
+#endif  // COMPONENTS_NACL_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
diff --git a/chrome/common/nacl_helper_linux.h b/components/nacl/common/nacl_helper_linux.h
similarity index 86%
rename from chrome/common/nacl_helper_linux.h
rename to components/nacl/common/nacl_helper_linux.h
index 0f21895..732b215 100644
--- a/chrome/common/nacl_helper_linux.h
+++ b/components/nacl/common/nacl_helper_linux.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_COMMON_NACL_HELPER_LINUX_H_
-#define CHROME_COMMON_NACL_HELPER_LINUX_H_
+#ifndef COMPONENTS_NACL_COMMON_NACL_HELPER_LINUX_H_
+#define COMPONENTS_NACL_COMMON_NACL_HELPER_LINUX_H_
 
 // A mini-zygote specifically for Native Client. This file defines
 // constants used to implement communication between the nacl_helper
@@ -39,4 +39,4 @@
 #define kNaClDummyFDIndex 1
 #define kNaClParentFDIndex 2
 
-#endif  // CHROME_COMMON_NACL_HELPER_LINUX_H_
+#endif  // COMPONENTS_NACL_COMMON_NACL_HELPER_LINUX_H_
diff --git a/chrome/common/nacl_host_messages.h b/components/nacl/common/nacl_host_messages.h
similarity index 96%
rename from chrome/common/nacl_host_messages.h
rename to components/nacl/common/nacl_host_messages.h
index 13d1f46..0f3df7e 100644
--- a/chrome/common/nacl_host_messages.h
+++ b/components/nacl/common/nacl_host_messages.h
@@ -7,11 +7,10 @@
 #include <string>
 
 #include "base/basictypes.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"
-#include "chrome/common/common_param_traits.h"
-#include "chrome/common/nacl_types.h"
-#include "chrome/common/pnacl_types.h"
+#include "components/nacl/common/nacl_types.h"
+#include "components/nacl/common/pnacl_types.h"
 #include "content/public/common/common_param_traits.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_message_macros.h"
diff --git a/chrome/common/nacl_messages.cc b/components/nacl/common/nacl_messages.cc
similarity index 64%
rename from chrome/common/nacl_messages.cc
rename to components/nacl/common/nacl_messages.cc
index 66e4df2..2140736 100644
--- a/chrome/common/nacl_messages.cc
+++ b/components/nacl/common/nacl_messages.cc
@@ -1,34 +1,34 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Get basic type definitions.
 #define IPC_MESSAGE_IMPL
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 
 // Generate constructors.
 #include "ipc/struct_constructor_macros.h"
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 
 // Generate destructors.
 #include "ipc/struct_destructor_macros.h"
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 
 // Generate param traits write methods.
 #include "ipc/param_traits_write_macros.h"
 namespace IPC {
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 }  // namespace IPC
 
 // Generate param traits read methods.
 #include "ipc/param_traits_read_macros.h"
 namespace IPC {
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 }  // namespace IPC
 
 // Generate param traits log methods.
 #include "ipc/param_traits_log_macros.h"
 namespace IPC {
-#include "chrome/common/nacl_messages.h"
+#include "components/nacl/common/nacl_messages.h"
 }  // namespace IPC
 
diff --git a/chrome/common/nacl_messages.h b/components/nacl/common/nacl_messages.h
similarity index 96%
rename from chrome/common/nacl_messages.h
rename to components/nacl/common/nacl_messages.h
index f37ca83..068a0f9 100644
--- a/chrome/common/nacl_messages.h
+++ b/components/nacl/common/nacl_messages.h
@@ -1,12 +1,12 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Defines messages between the browser and NaCl process.
 
 // Multiply-included message file, no traditional include guard.
-#include "base/process.h"
-#include "chrome/common/nacl_types.h"
+#include "base/process/process.h"
+#include "components/nacl/common/nacl_types.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_message_macros.h"
 #include "ipc/ipc_platform_file.h"
diff --git a/chrome/common/nacl_paths.cc b/components/nacl/common/nacl_paths.cc
similarity index 96%
rename from chrome/common/nacl_paths.cc
rename to components/nacl/common/nacl_paths.cc
index 22f9c22..cb046c2 100644
--- a/chrome/common/nacl_paths.cc
+++ b/components/nacl/common/nacl_paths.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/common/nacl_paths.h"
+#include "components/nacl/common/nacl_paths.h"
 
 #include "base/file_util.h"
 #include "base/path_service.h"
diff --git a/chrome/common/nacl_paths.h b/components/nacl/common/nacl_paths.h
similarity index 83%
rename from chrome/common/nacl_paths.h
rename to components/nacl/common/nacl_paths.h
index 1ae755f..424d8bd 100644
--- a/chrome/common/nacl_paths.h
+++ b/components/nacl/common/nacl_paths.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_COMMON_NACL_PATHS_H_
-#define CHROME_COMMON_NACL_PATHS_H_
+#ifndef COMPONENTS_NACL_COMMON_NACL_PATHS_H_
+#define COMPONENTS_NACL_COMMON_NACL_PATHS_H_
 
 #include "build/build_config.h"
 
@@ -28,4 +28,4 @@
 
 }  // namespace nacl
 
-#endif  // CHROME_COMMON_NACL_PATHS_H_
+#endif  // COMPONENTS_NACL_COMMON_NACL_PATHS_H_
diff --git a/chrome/common/nacl_types.cc b/components/nacl/common/nacl_types.cc
similarity index 95%
rename from chrome/common/nacl_types.cc
rename to components/nacl/common/nacl_types.cc
index 7607e27..dea0239 100644
--- a/chrome/common/nacl_types.cc
+++ b/components/nacl/common/nacl_types.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/common/nacl_types.h"
+#include "components/nacl/common/nacl_types.h"
 #include "ipc/ipc_platform_file.h"
 
 namespace nacl {
diff --git a/chrome/common/nacl_types.h b/components/nacl/common/nacl_types.h
similarity index 92%
rename from chrome/common/nacl_types.h
rename to components/nacl/common/nacl_types.h
index 7660262..c1f6943 100644
--- a/chrome/common/nacl_types.h
+++ b/components/nacl/common/nacl_types.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_COMMON_NACL_TYPES_H_
-#define CHROME_COMMON_NACL_TYPES_H_
+#ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_
+#define COMPONENTS_NACL_COMMON_NACL_TYPES_H_
 
 #include <string>
 #include <vector>
@@ -98,4 +98,4 @@
 
 }  // namespace nacl
 
-#endif  // CHROME_COMMON_NACL_TYPES_H_
+#endif  // COMPONENTS_NACL_COMMON_NACL_TYPES_H_
diff --git a/chrome/common/pnacl_types.cc b/components/nacl/common/pnacl_types.cc
similarity index 66%
rename from chrome/common/pnacl_types.cc
rename to components/nacl/common/pnacl_types.cc
index 889fc2e..f6302bc 100644
--- a/chrome/common/pnacl_types.cc
+++ b/components/nacl/common/pnacl_types.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/common/pnacl_types.h"
+#include "components/nacl/common/pnacl_types.h"
 
 namespace nacl {
 
diff --git a/chrome/common/pnacl_types.h b/components/nacl/common/pnacl_types.h
similarity index 79%
rename from chrome/common/pnacl_types.h
rename to components/nacl/common/pnacl_types.h
index 8c986fe..802319b 100644
--- a/chrome/common/pnacl_types.h
+++ b/components/nacl/common/pnacl_types.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CHROME_COMMON_PNACL_TYPES_H_
-#define CHROME_COMMON_PNACL_TYPES_H_
+#ifndef COMPONENTS_NACL_COMMON_PNACL_TYPES_H_
+#define COMPONENTS_NACL_COMMON_PNACL_TYPES_H_
 
 // This file exists (instead of putting this type into nacl_types.h) because
 // nacl_types is built into nacl_helper in addition to chrome, and we don't
@@ -30,4 +30,4 @@
 
 }  // namespace nacl
 
-#endif  // CHROME_COMMON_PNACL_TYPES_H_
+#endif  // COMPONENTS_NACL_COMMON_PNACL_TYPES_H_
diff --git a/components/nacl_common.gyp b/components/nacl_common.gyp
index 642d61a..1364ef2 100644
--- a/components/nacl_common.gyp
+++ b/components/nacl_common.gyp
@@ -21,6 +21,10 @@
       'sources': [
         'nacl/common/nacl_cmd_line.cc',
         'nacl/common/nacl_cmd_line.h',
+        'nacl/common/nacl_messages.cc',
+        'nacl/common/nacl_messages.h',
+        'nacl/common/nacl_types.cc',
+        'nacl/common/nacl_types.h',
       ],
       'include_dirs': [
         '..',
@@ -52,6 +56,10 @@
           'sources': [
             'nacl/common/nacl_cmd_line.cc',
             'nacl/common/nacl_cmd_line.h',
+            'nacl/common/nacl_messages.cc',
+            'nacl/common/nacl_messages.h',
+            'nacl/common/nacl_types.cc',
+            'nacl/common/nacl_types.h',
           ],
           'include_dirs': [
             '..',
diff --git a/components/navigation_interception.target.darwin-arm.mk b/components/navigation_interception.target.darwin-arm.mk
index d80d11b..33ed0dd 100644
--- a/components/navigation_interception.target.darwin-arm.mk
+++ b/components/navigation_interception.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/navigation_interception.target.darwin-mips.mk b/components/navigation_interception.target.darwin-mips.mk
index 017b3fa..35a4964 100644
--- a/components/navigation_interception.target.darwin-mips.mk
+++ b/components/navigation_interception.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/navigation_interception.target.darwin-x86.mk b/components/navigation_interception.target.darwin-x86.mk
index 59caa18..436945f 100644
--- a/components/navigation_interception.target.darwin-x86.mk
+++ b/components/navigation_interception.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception.target.linux-arm.mk b/components/navigation_interception.target.linux-arm.mk
index d80d11b..33ed0dd 100644
--- a/components/navigation_interception.target.linux-arm.mk
+++ b/components/navigation_interception.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/navigation_interception.target.linux-mips.mk b/components/navigation_interception.target.linux-mips.mk
index 017b3fa..35a4964 100644
--- a/components/navigation_interception.target.linux-mips.mk
+++ b/components/navigation_interception.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/navigation_interception.target.linux-x86.mk b/components/navigation_interception.target.linux-x86.mk
index 59caa18..436945f 100644
--- a/components/navigation_interception.target.linux-x86.mk
+++ b/components/navigation_interception.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
index dfccb30..e1bd566 100644
--- a/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
+++ b/components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc
@@ -26,13 +26,14 @@
 #include "net/http/http_response_headers.h"
 #include "net/http/http_response_info.h"
 #include "net/url_request/url_request.h"
+#include "net/url_request/url_request_test_util.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 using testing::_;
 using testing::Eq;
-using testing::Property;
 using testing::Ne;
+using testing::Property;
 using testing::Return;
 
 namespace navigation_interception {
@@ -117,7 +118,8 @@
                     const std::string& request_method,
                     RedirectMode redirect_mode,
                     MockInterceptCallbackReceiver* callback_receiver)
-      : request_(url, NULL, resource_context_.GetRequestContext()) {
+      : resource_context_(&test_url_request_context_),
+        request_(url, NULL, resource_context_.GetRequestContext()) {
     DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
       if (render_process_id != MSG_ROUTING_NONE &&
           render_view_id != MSG_ROUTING_NONE) {
@@ -164,6 +166,7 @@
   }
 
  private:
+  net::TestURLRequestContext test_url_request_context_;
   content::MockResourceContext resource_context_;
   net::URLRequest request_;
   scoped_ptr<InterceptNavigationResourceThrottle> throttle_;
diff --git a/components/navigation_interception_jni_headers.target.darwin-arm.mk b/components/navigation_interception_jni_headers.target.darwin-arm.mk
index 3552ff1..212bfee 100644
--- a/components/navigation_interception_jni_headers.target.darwin-arm.mk
+++ b/components/navigation_interception_jni_headers.target.darwin-arm.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception_jni_headers.target.darwin-mips.mk b/components/navigation_interception_jni_headers.target.darwin-mips.mk
index 5ab080a..87a4032 100644
--- a/components/navigation_interception_jni_headers.target.darwin-mips.mk
+++ b/components/navigation_interception_jni_headers.target.darwin-mips.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception_jni_headers.target.darwin-x86.mk b/components/navigation_interception_jni_headers.target.darwin-x86.mk
index 05f9c0a..67297d6 100644
--- a/components/navigation_interception_jni_headers.target.darwin-x86.mk
+++ b/components/navigation_interception_jni_headers.target.darwin-x86.mk
@@ -100,10 +100,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception_jni_headers.target.linux-arm.mk b/components/navigation_interception_jni_headers.target.linux-arm.mk
index 3552ff1..212bfee 100644
--- a/components/navigation_interception_jni_headers.target.linux-arm.mk
+++ b/components/navigation_interception_jni_headers.target.linux-arm.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception_jni_headers.target.linux-mips.mk b/components/navigation_interception_jni_headers.target.linux-mips.mk
index 5ab080a..87a4032 100644
--- a/components/navigation_interception_jni_headers.target.linux-mips.mk
+++ b/components/navigation_interception_jni_headers.target.linux-mips.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/navigation_interception_jni_headers.target.linux-x86.mk b/components/navigation_interception_jni_headers.target.linux-x86.mk
index 05f9c0a..67297d6 100644
--- a/components/navigation_interception_jni_headers.target.linux-x86.mk
+++ b/components/navigation_interception_jni_headers.target.linux-x86.mk
@@ -100,10 +100,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/sessions.gypi b/components/sessions.gypi
index ad56821..401015e 100644
--- a/components/sessions.gypi
+++ b/components/sessions.gypi
@@ -25,7 +25,7 @@
         'sessions/serialized_navigation_entry.h',
       ],
       'conditions': [
-        ['OS != "ios"', {
+        ['OS != "ios" and chrome_multiple_dll != 1', {
           'dependencies': [
             '../webkit/support/webkit_support.gyp:glue',
           ]
diff --git a/components/tracing.target.darwin-arm.mk b/components/tracing.target.darwin-arm.mk
index d9c0739..de5ddf0 100644
--- a/components/tracing.target.darwin-arm.mk
+++ b/components/tracing.target.darwin-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/tracing.target.darwin-mips.mk b/components/tracing.target.darwin-mips.mk
index 54f3ded..983d9d5 100644
--- a/components/tracing.target.darwin-mips.mk
+++ b/components/tracing.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/tracing.target.darwin-x86.mk b/components/tracing.target.darwin-x86.mk
index 808d4ed..c372771 100644
--- a/components/tracing.target.darwin-x86.mk
+++ b/components/tracing.target.darwin-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/tracing.target.linux-arm.mk b/components/tracing.target.linux-arm.mk
index d9c0739..de5ddf0 100644
--- a/components/tracing.target.linux-arm.mk
+++ b/components/tracing.target.linux-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/tracing.target.linux-mips.mk b/components/tracing.target.linux-mips.mk
index 54f3ded..983d9d5 100644
--- a/components/tracing.target.linux-mips.mk
+++ b/components/tracing.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/tracing.target.linux-x86.mk b/components/tracing.target.linux-x86.mk
index 808d4ed..c372771 100644
--- a/components/tracing.target.linux-x86.mk
+++ b/components/tracing.target.linux-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/components/user_prefs.target.darwin-arm.mk b/components/user_prefs.target.darwin-arm.mk
index 4586d8d..a15104a 100644
--- a/components/user_prefs.target.darwin-arm.mk
+++ b/components/user_prefs.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/components/user_prefs.target.darwin-mips.mk b/components/user_prefs.target.darwin-mips.mk
index 1a0b1bf..33c81a4 100644
--- a/components/user_prefs.target.darwin-mips.mk
+++ b/components/user_prefs.target.darwin-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/components/user_prefs.target.darwin-x86.mk b/components/user_prefs.target.darwin-x86.mk
index bc80344..4c5a8a6 100644
--- a/components/user_prefs.target.darwin-x86.mk
+++ b/components/user_prefs.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/user_prefs.target.linux-arm.mk b/components/user_prefs.target.linux-arm.mk
index 4586d8d..a15104a 100644
--- a/components/user_prefs.target.linux-arm.mk
+++ b/components/user_prefs.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/components/user_prefs.target.linux-mips.mk b/components/user_prefs.target.linux-mips.mk
index 1a0b1bf..33c81a4 100644
--- a/components/user_prefs.target.linux-mips.mk
+++ b/components/user_prefs.target.linux-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/components/user_prefs.target.linux-x86.mk b/components/user_prefs.target.linux-x86.mk
index bc80344..4c5a8a6 100644
--- a/components/user_prefs.target.linux-x86.mk
+++ b/components/user_prefs.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSER_PREFS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/components/visitedlink/browser/visitedlink_master.cc b/components/visitedlink/browser/visitedlink_master.cc
index 699f587..7cf6891 100644
--- a/components/visitedlink/browser/visitedlink_master.cc
+++ b/components/visitedlink/browser/visitedlink_master.cc
@@ -20,7 +20,6 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/strings/string_util.h"
 #include "base/threading/thread_restrictions.h"
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc
index b0e5fcd..0943106 100644
--- a/components/visitedlink/test/visitedlink_unittest.cc
+++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -10,7 +10,7 @@
 #include "base/memory/shared_memory.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/run_loop.h"
 #include "base/strings/string_util.h"
 #include "base/time/time.h"
diff --git a/components/visitedlink_browser.target.darwin-arm.mk b/components/visitedlink_browser.target.darwin-arm.mk
index 02cecaa..1a5198a 100644
--- a/components/visitedlink_browser.target.darwin-arm.mk
+++ b/components/visitedlink_browser.target.darwin-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_browser.target.darwin-mips.mk b/components/visitedlink_browser.target.darwin-mips.mk
index b72a6d6..a993f1a 100644
--- a/components/visitedlink_browser.target.darwin-mips.mk
+++ b/components/visitedlink_browser.target.darwin-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_browser.target.darwin-x86.mk b/components/visitedlink_browser.target.darwin-x86.mk
index 8cec8e1..373399e 100644
--- a/components/visitedlink_browser.target.darwin-x86.mk
+++ b/components/visitedlink_browser.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_browser.target.linux-arm.mk b/components/visitedlink_browser.target.linux-arm.mk
index 02cecaa..1a5198a 100644
--- a/components/visitedlink_browser.target.linux-arm.mk
+++ b/components/visitedlink_browser.target.linux-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_browser.target.linux-mips.mk b/components/visitedlink_browser.target.linux-mips.mk
index b72a6d6..a993f1a 100644
--- a/components/visitedlink_browser.target.linux-mips.mk
+++ b/components/visitedlink_browser.target.linux-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_browser.target.linux-x86.mk b/components/visitedlink_browser.target.linux-x86.mk
index 8cec8e1..373399e 100644
--- a/components/visitedlink_browser.target.linux-x86.mk
+++ b/components/visitedlink_browser.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.darwin-arm.mk b/components/visitedlink_common.target.darwin-arm.mk
index 81c186b..48a7f56 100644
--- a/components/visitedlink_common.target.darwin-arm.mk
+++ b/components/visitedlink_common.target.darwin-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.darwin-mips.mk b/components/visitedlink_common.target.darwin-mips.mk
index 627f538..a1b4f4c 100644
--- a/components/visitedlink_common.target.darwin-mips.mk
+++ b/components/visitedlink_common.target.darwin-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.darwin-x86.mk b/components/visitedlink_common.target.darwin-x86.mk
index 5811f63..988efdf 100644
--- a/components/visitedlink_common.target.darwin-x86.mk
+++ b/components/visitedlink_common.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.linux-arm.mk b/components/visitedlink_common.target.linux-arm.mk
index 81c186b..48a7f56 100644
--- a/components/visitedlink_common.target.linux-arm.mk
+++ b/components/visitedlink_common.target.linux-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.linux-mips.mk b/components/visitedlink_common.target.linux-mips.mk
index 627f538..a1b4f4c 100644
--- a/components/visitedlink_common.target.linux-mips.mk
+++ b/components/visitedlink_common.target.linux-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_common.target.linux-x86.mk b/components/visitedlink_common.target.linux-x86.mk
index 5811f63..988efdf 100644
--- a/components/visitedlink_common.target.linux-x86.mk
+++ b/components/visitedlink_common.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/visitedlink_renderer.target.darwin-arm.mk b/components/visitedlink_renderer.target.darwin-arm.mk
index d5219ca..514048d 100644
--- a/components/visitedlink_renderer.target.darwin-arm.mk
+++ b/components/visitedlink_renderer.target.darwin-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -71,17 +71,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -104,8 +103,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -217,8 +215,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/visitedlink_renderer.target.darwin-mips.mk b/components/visitedlink_renderer.target.darwin-mips.mk
index 100da8e..e801739 100644
--- a/components/visitedlink_renderer.target.darwin-mips.mk
+++ b/components/visitedlink_renderer.target.darwin-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -70,17 +70,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -103,8 +102,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -181,17 +180,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -215,8 +213,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -289,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/visitedlink_renderer.target.darwin-x86.mk b/components/visitedlink_renderer.target.darwin-x86.mk
index 219b11e..aa2599f 100644
--- a/components/visitedlink_renderer.target.darwin-x86.mk
+++ b/components/visitedlink_renderer.target.darwin-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -73,17 +73,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -106,8 +105,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -188,17 +187,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -222,8 +220,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/visitedlink_renderer.target.linux-arm.mk b/components/visitedlink_renderer.target.linux-arm.mk
index d5219ca..514048d 100644
--- a/components/visitedlink_renderer.target.linux-arm.mk
+++ b/components/visitedlink_renderer.target.linux-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -71,17 +71,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -104,8 +103,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -217,8 +215,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/visitedlink_renderer.target.linux-mips.mk b/components/visitedlink_renderer.target.linux-mips.mk
index 100da8e..e801739 100644
--- a/components/visitedlink_renderer.target.linux-mips.mk
+++ b/components/visitedlink_renderer.target.linux-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -70,17 +70,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -103,8 +102,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -181,17 +180,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -215,8 +213,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -289,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/visitedlink_renderer.target.linux-x86.mk b/components/visitedlink_renderer.target.linux-x86.mk
index 219b11e..aa2599f 100644
--- a/components/visitedlink_renderer.target.linux-x86.mk
+++ b/components/visitedlink_renderer.target.linux-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -73,17 +73,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -106,8 +105,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -188,17 +187,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -222,8 +220,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/components/web_contents_delegate_android.target.darwin-arm.mk b/components/web_contents_delegate_android.target.darwin-arm.mk
index 6e45493..720f9e9 100644
--- a/components/web_contents_delegate_android.target.darwin-arm.mk
+++ b/components/web_contents_delegate_android.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -75,18 +76,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -185,18 +185,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -295,7 +294,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android.target.darwin-mips.mk b/components/web_contents_delegate_android.target.darwin-mips.mk
index 0810faf..1f48e44 100644
--- a/components/web_contents_delegate_android.target.darwin-mips.mk
+++ b/components/web_contents_delegate_android.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -74,18 +75,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -183,18 +183,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -289,7 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android.target.darwin-x86.mk b/components/web_contents_delegate_android.target.darwin-x86.mk
index 3066510..171d218 100644
--- a/components/web_contents_delegate_android.target.darwin-x86.mk
+++ b/components/web_contents_delegate_android.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -77,17 +78,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -189,17 +189,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -293,7 +292,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android.target.linux-arm.mk b/components/web_contents_delegate_android.target.linux-arm.mk
index 6e45493..720f9e9 100644
--- a/components/web_contents_delegate_android.target.linux-arm.mk
+++ b/components/web_contents_delegate_android.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -75,18 +76,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -185,18 +185,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -295,7 +294,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android.target.linux-mips.mk b/components/web_contents_delegate_android.target.linux-mips.mk
index 0810faf..1f48e44 100644
--- a/components/web_contents_delegate_android.target.linux-mips.mk
+++ b/components/web_contents_delegate_android.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -74,18 +75,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -183,18 +183,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -289,7 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android.target.linux-x86.mk b/components/web_contents_delegate_android.target.linux-x86.mk
index 3066510..171d218 100644
--- a/components/web_contents_delegate_android.target.linux-x86.mk
+++ b/components/web_contents_delegate_android.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_gyp)/webkit_support_glue_gyp.a \
 	$(call intermediates-dir-for,GYP,components_web_contents_delegate_android_jni_headers_gyp)/web_contents_delegate_android_jni_headers.stamp
@@ -77,17 +78,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -189,17 +189,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -293,7 +292,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_gyp
 
diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk
index 4be80a3..711a517 100644
--- a/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk
index 989f652..02838b6 100644
--- a/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk
index b885467..366cd39 100644
--- a/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk
@@ -100,10 +100,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk b/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk
index 4be80a3..711a517 100644
--- a/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk b/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk
index 989f652..02838b6 100644
--- a/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk b/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk
index b885467..366cd39 100644
--- a/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk
+++ b/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk
@@ -100,10 +100,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/components/webdata_common.target.darwin-arm.mk b/components/webdata_common.target.darwin-arm.mk
index 58ee803..aff5f88 100644
--- a/components/webdata_common.target.darwin-arm.mk
+++ b/components/webdata_common.target.darwin-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/webdata_common.target.darwin-mips.mk b/components/webdata_common.target.darwin-mips.mk
index 1f7586e..93d30d4 100644
--- a/components/webdata_common.target.darwin-mips.mk
+++ b/components/webdata_common.target.darwin-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/webdata_common.target.darwin-x86.mk b/components/webdata_common.target.darwin-x86.mk
index eb2815a..270b487 100644
--- a/components/webdata_common.target.darwin-x86.mk
+++ b/components/webdata_common.target.darwin-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/webdata_common.target.linux-arm.mk b/components/webdata_common.target.linux-arm.mk
index 58ee803..aff5f88 100644
--- a/components/webdata_common.target.linux-arm.mk
+++ b/components/webdata_common.target.linux-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/webdata_common.target.linux-mips.mk b/components/webdata_common.target.linux-mips.mk
index 1f7586e..93d30d4 100644
--- a/components/webdata_common.target.linux-mips.mk
+++ b/components/webdata_common.target.linux-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/components/webdata_common.target.linux-x86.mk b/components/webdata_common.target.linux-x86.mk
index eb2815a..270b487 100644
--- a/components/webdata_common.target.linux-x86.mk
+++ b/components/webdata_common.target.linux-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBDATA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/content/browser/DEPS b/content/browser/DEPS
index bb20905..4322368 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -71,7 +71,6 @@
   "!third_party/WebKit/public/web/gtk/WebInputEventFactory.h",
   "!third_party/WebKit/public/web/linux/WebFontInfo.h",
   "!third_party/WebKit/public/web/mac/WebInputEventFactory.h",
-  "!third_party/WebKit/public/web/win/WebInputEventFactory.h",
 
   # DO NOT ADD ANY CHROME OR COMPONENTS INCLUDES HERE!!!
   # See https://sites.google.com/a/chromium.org/dev/developers/content-module
diff --git a/content/browser/android/child_process_launcher_android.h b/content/browser/android/child_process_launcher_android.h
index e83e04e..b90ff23 100644
--- a/content/browser/android/child_process_launcher_android.h
+++ b/content/browser/android/child_process_launcher_android.h
@@ -10,7 +10,7 @@
 #include "base/callback.h"
 #include "base/command_line.h"
 #include "base/platform_file.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/public/browser/file_descriptor_info.h"
 
 namespace content {
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index 84cc6fa..065b3e7 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -72,6 +72,13 @@
   parsed_command_line->AppendSwitch(switches::kEnableFixedLayout);
   parsed_command_line->AppendSwitch(switches::kEnableViewport);
 
+  // Disable <canvas> path antialiasing.
+  parsed_command_line->AppendSwitch(switches::kDisable2dCanvasAntialiasing);
+
+  // Disable anti-aliasing.
+  parsed_command_line->AppendSwitch(
+      cc::switches::kDisableCompositedAntialiasing);
+
   if (!plugin_descriptor.empty()) {
     parsed_command_line->AppendSwitchNative(
       switches::kRegisterPepperPlugins, plugin_descriptor);
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 9ee3838..4d19514 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -325,15 +325,6 @@
   return rwhva->GetCachedBackgroundColor();
 }
 
-void ContentViewCoreImpl::SetBackgroundColor(JNIEnv* env,
-                                             jobject obj,
-                                             jint color) {
-  RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
-  if (!rwhva)
-    return;
-  rwhva->OnDidChangeBodyBackgroundColor(color);
-}
-
 void ContentViewCoreImpl::OnHide(JNIEnv* env, jobject obj) {
   Hide();
 }
diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h
index 967f2af..4d78c9f 100644
--- a/content/browser/android/content_view_core_impl.h
+++ b/content/browser/android/content_view_core_impl.h
@@ -13,7 +13,7 @@
 #include "base/compiler_specific.h"
 #include "base/i18n/rtl.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/browser/renderer_host/render_widget_host_view_android.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/android/content_view_core.h"
diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h
index 5b1169e..29ed69e 100644
--- a/content/browser/appcache/appcache_dispatcher_host.h
+++ b/content/browser/appcache/appcache_dispatcher_host.h
@@ -9,7 +9,7 @@
 
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/browser/appcache/appcache_frontend_proxy.h"
 #include "content/public/browser/browser_message_filter.h"
 #include "webkit/browser/appcache/appcache_backend_impl.h"
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index a915228..6155776 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -12,7 +12,6 @@
 #include "base/logging.h"
 #include "base/metrics/histogram.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/stl_util.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/waitable_event.h"
diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h
index 9933ca3..e25b514 100644
--- a/content/browser/browser_child_process_host_impl.h
+++ b/content/browser/browser_child_process_host_impl.h
@@ -9,7 +9,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/synchronization/waitable_event_watcher.h"
 #include "content/browser/child_process_launcher.h"
 #include "content/public/browser/browser_child_process_host.h"
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index d7553cc..241b7e5 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -13,6 +13,7 @@
 #include "base/metrics/histogram.h"
 #include "base/pending_task.h"
 #include "base/power_monitor/power_monitor.h"
+#include "base/process/process_metrics.h"
 #include "base/run_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/system_monitor/system_monitor.h"
@@ -91,7 +92,6 @@
 #if defined(OS_POSIX) && !defined(OS_MACOSX)
 #include <sys/stat.h>
 
-#include "base/process_util.h"
 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
 #include "content/browser/zygote_host/zygote_host_impl_linux.h"
 #endif
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 2a83c98..7542862 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -61,7 +61,7 @@
 // should be able to handle the response to their permission request.
 class BrowserPluginGuest::PermissionRequest {
  public:
-  virtual void Respond(bool should_allow) = 0;
+  virtual void Respond(bool should_allow, const std::string& user_input) = 0;
   virtual ~PermissionRequest() {}
   virtual BrowserPluginPermissionType GetType() const = 0;
  protected:
@@ -77,8 +77,8 @@
     RecordAction(
         UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Download"));
   }
-
-  virtual void Respond(bool should_allow) OVERRIDE {
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
     callback_.Run(should_allow);
   }
 
@@ -105,7 +105,8 @@
         UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation"));
   }
 
-  virtual void Respond(bool should_allow) OVERRIDE {
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
     WebContents* web_contents = guest_->embedder_web_contents();
     if (should_allow && web_contents) {
       // If renderer side embedder decides to allow gelocation, we need to check
@@ -161,7 +162,8 @@
         UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Media"));
   }
 
-  virtual void Respond(bool should_allow) OVERRIDE {
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
     WebContentsImpl* web_contents = guest_->embedder_web_contents();
     if (should_allow && web_contents) {
       // Re-route the request to the embedder's WebContents; the guest gets the
@@ -193,7 +195,8 @@
         UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.NewWindow"));
   }
 
-  virtual void Respond(bool should_allow) OVERRIDE {
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
     int embedder_render_process_id =
         guest_->embedder_web_contents()->GetRenderProcessHost()->GetID();
     BrowserPluginGuest* guest =
@@ -219,6 +222,29 @@
   BrowserPluginGuest* guest_;
 };
 
+class BrowserPluginGuest::JavaScriptDialogRequest : public PermissionRequest {
+ public:
+  JavaScriptDialogRequest(const DialogClosedCallback& callback)
+      : callback_(callback) {
+    RecordAction(
+        UserMetricsAction(
+            "BrowserPlugin.Guest.PermissionRequest.JavaScriptDialog"));
+  }
+
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
+    callback_.Run(should_allow, UTF8ToUTF16(user_input));
+  }
+
+  virtual BrowserPluginPermissionType GetType() const OVERRIDE {
+    return BrowserPluginPermissionTypeJavaScriptDialog;
+  }
+
+  virtual ~JavaScriptDialogRequest() {}
+ private:
+   DialogClosedCallback callback_;
+};
+
 class BrowserPluginGuest::PointerLockRequest : public PermissionRequest {
  public:
   PointerLockRequest(BrowserPluginGuest* guest)
@@ -227,7 +253,8 @@
         UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.PointerLock"));
   }
 
-  virtual void Respond(bool should_allow) OVERRIDE {
+  virtual void Respond(bool should_allow,
+                       const std::string& user_input) OVERRIDE {
     guest_->SendMessageToEmbedder(
         new BrowserPluginMsg_SetMouseLock(guest_->instance_id(), should_allow));
   }
@@ -244,26 +271,40 @@
 namespace {
 const size_t kNumMaxOutstandingPermissionRequests = 1024;
 
-static std::string WindowOpenDispositionToString(
+std::string WindowOpenDispositionToString(
   WindowOpenDisposition window_open_disposition) {
   switch (window_open_disposition) {
-      case IGNORE_ACTION:
-        return "ignore";
-      case SAVE_TO_DISK:
-        return "save_to_disk";
-      case CURRENT_TAB:
-        return "current_tab";
-      case NEW_BACKGROUND_TAB:
-        return "new_background_tab";
-      case NEW_FOREGROUND_TAB:
-        return "new_foreground_tab";
-      case NEW_WINDOW:
-        return "new_window";
-      case NEW_POPUP:
-        return "new_popup";
-      default:
-        NOTREACHED() << "Unknown Window Open Disposition";
-        return "ignore";
+    case IGNORE_ACTION:
+      return "ignore";
+    case SAVE_TO_DISK:
+      return "save_to_disk";
+    case CURRENT_TAB:
+      return "current_tab";
+    case NEW_BACKGROUND_TAB:
+      return "new_background_tab";
+    case NEW_FOREGROUND_TAB:
+      return "new_foreground_tab";
+    case NEW_WINDOW:
+      return "new_window";
+    case NEW_POPUP:
+      return "new_popup";
+    default:
+      NOTREACHED() << "Unknown Window Open Disposition";
+      return "ignore";
+  }
+}
+
+std::string JavaScriptMessageTypeToString(JavaScriptMessageType message_type) {
+  switch (message_type) {
+    case JAVASCRIPT_MESSAGE_TYPE_ALERT:
+      return "alert";
+    case JAVASCRIPT_MESSAGE_TYPE_CONFIRM:
+      return "confirm";
+    case JAVASCRIPT_MESSAGE_TYPE_PROMPT:
+      return "prompt";
+    default:
+      NOTREACHED() << "Unknown JavaScript Message Type.";
+      return "unknown";
   }
 }
 
@@ -611,6 +652,10 @@
   delegate_->Close();
 }
 
+JavaScriptDialogManager* BrowserPluginGuest::GetJavaScriptDialogManager() {
+  return this;
+}
+
 bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) {
   // TODO(fsamuel): We show the regular page context menu handler for now until
   // we implement the Apps Context Menu API for Browser Plugin (see
@@ -1344,14 +1389,15 @@
 void BrowserPluginGuest::OnRespondPermission(
     int instance_id,
     int request_id,
-    bool should_allow) {
+    bool should_allow,
+    const std::string& user_input) {
   RequestMap::iterator request_itr = permission_request_map_.find(request_id);
   if (request_itr == permission_request_map_.end()) {
     LOG(INFO) << "Not a valid request ID.";
     return;
   }
   BrowserPluginPermissionType permission_type = request_itr->second->GetType();
-  request_itr->second->Respond(should_allow);
+  request_itr->second->Respond(should_allow, user_input);
 
   // Geolocation requests have to hang around for a while, so we don't delete
   // them here.
@@ -1479,6 +1525,61 @@
       request_id, request_info));
 }
 
+void BrowserPluginGuest::RunJavaScriptDialog(
+    WebContents* web_contents,
+    const GURL& origin_url,
+    const std::string& accept_lang,
+    JavaScriptMessageType javascript_message_type,
+    const string16& message_text,
+    const string16& default_prompt_text,
+    const DialogClosedCallback& callback,
+    bool* did_suppress_message) {
+  if (permission_request_map_.size() >= kNumMaxOutstandingPermissionRequests) {
+    // Cancel the dialog.
+    callback.Run(false, string16());
+    return;
+  }
+  int request_id = next_permission_request_id_++;
+  permission_request_map_[request_id] = new JavaScriptDialogRequest(callback);
+  base::DictionaryValue request_info;
+  request_info.Set(
+      browser_plugin::kDefaultPromptText,
+      base::Value::CreateStringValue(UTF16ToUTF8(default_prompt_text)));
+  request_info.Set(
+      browser_plugin::kMessageText,
+      base::Value::CreateStringValue(UTF16ToUTF8(message_text)));
+  request_info.Set(
+      browser_plugin::kMessageType,
+      base::Value::CreateStringValue(
+          JavaScriptMessageTypeToString(javascript_message_type)));
+  request_info.Set(
+      browser_plugin::kURL,
+      base::Value::CreateStringValue(origin_url.spec()));
+  SendMessageToEmbedder(new BrowserPluginMsg_RequestPermission(
+      instance_id(), BrowserPluginPermissionTypeJavaScriptDialog,
+      request_id, request_info));
+}
+
+void BrowserPluginGuest::RunBeforeUnloadDialog(
+    WebContents* web_contents,
+    const string16& message_text,
+    bool is_reload,
+    const DialogClosedCallback& callback) {
+  // This is called if the guest has a beforeunload event handler.
+  // This callback allows navigation to proceed.
+  callback.Run(true, string16());
+}
+
+bool BrowserPluginGuest::HandleJavaScriptDialog(
+    WebContents* web_contents,
+    bool accept,
+    const string16* prompt_override) {
+  return false;
+}
+
+void BrowserPluginGuest::ResetJavaScriptState(WebContents* web_contents) {
+}
+
 void BrowserPluginGuest::OnUpdateRect(
     const ViewHostMsg_UpdateRect_Params& params) {
   BrowserPluginMsg_UpdateRect_Params relay_params;
@@ -1538,7 +1639,8 @@
     int permission_request_id,
     const std::string& url) {
   if (url.empty()) {
-    OnRespondPermission(instance_id(), permission_request_id, false);
+    OnRespondPermission(instance_id(), permission_request_id,
+        false, std::string());
     return;
   }
 
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index 38275fd..0a36571 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -33,6 +33,7 @@
 #include "content/common/edit_command.h"
 #include "content/port/common/input_event_ack_state.h"
 #include "content/public/browser/browser_plugin_guest_delegate.h"
+#include "content/public/browser/javascript_dialog_manager.h"
 #include "content/public/browser/notification_observer.h"
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/render_view_host_observer.h"
@@ -83,7 +84,8 @@
 // CreateNewWindow. The newly created guest will live in the same partition,
 // which means it can share storage and can script this guest.
 class CONTENT_EXPORT BrowserPluginGuest
-    : public NotificationObserver,
+    : public JavaScriptDialogManager,
+      public NotificationObserver,
       public WebContentsDelegate,
       public WebContentsObserver,
       public base::SupportsWeakPtr<BrowserPluginGuest> {
@@ -161,7 +163,6 @@
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
 
   // WebContentsDelegate implementation.
-
   virtual bool AddMessageToConsole(WebContents* source,
                                    int32 level,
                                    const string16& message,
@@ -181,6 +182,7 @@
                            const std::string& request_method,
                            const base::Callback<void(bool)>& callback) OVERRIDE;
   virtual void CloseContents(WebContents* source) OVERRIDE;
+  virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
   virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE;
   virtual void HandleKeyboardEvent(
       WebContents* source,
@@ -202,6 +204,26 @@
       const MediaStreamRequest& request,
       const MediaResponseCallback& callback) OVERRIDE;
 
+  // JavaScriptDialogManager implementation.
+  virtual void RunJavaScriptDialog(
+      WebContents* web_contents,
+      const GURL& origin_url,
+      const std::string& accept_lang,
+      JavaScriptMessageType javascript_message_type,
+      const string16& message_text,
+      const string16& default_prompt_text,
+      const DialogClosedCallback& callback,
+      bool* did_suppress_message) OVERRIDE;
+  virtual void RunBeforeUnloadDialog(
+      WebContents* web_contents,
+      const string16& message_text,
+      bool is_reload,
+      const DialogClosedCallback& callback) OVERRIDE;
+  virtual bool HandleJavaScriptDialog(WebContents* web_contents,
+                                      bool accept,
+                                      const string16* prompt_override) OVERRIDE;
+  virtual void ResetJavaScriptState(WebContents* web_contents) OVERRIDE;
+
   // Exposes the protected web_contents() from WebContentsObserver.
   WebContentsImpl* GetWebContents();
 
@@ -264,6 +286,7 @@
 
   class DownloadRequest;
   class GeolocationRequest;
+  class JavaScriptDialogRequest;
   // MediaRequest because of naming conflicts with MediaStreamRequest.
   class MediaRequest;
   class NewWindowRequest;
@@ -307,7 +330,8 @@
   // chance to decide.
   void OnRespondPermission(int instance_id,
                            int request_id,
-                           bool should_allow);
+                           bool should_allow,
+                           const std::string& user_input);
   // Handles drag events from the embedder.
   // When dragging, the drag events go to the embedder first, and if the drag
   // happens on the browser plugin, then the plugin sends a corresponding
diff --git a/content/browser/browser_plugin/test_browser_plugin_guest.h b/content/browser/browser_plugin/test_browser_plugin_guest.h
index aa3aa3b..7fccb00 100644
--- a/content/browser/browser_plugin/test_browser_plugin_guest.h
+++ b/content/browser/browser_plugin/test_browser_plugin_guest.h
@@ -6,7 +6,6 @@
 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_GUEST_H_
 
 #include "base/compiler_specific.h"
-#include "base/process_util.h"
 #include "content/browser/browser_plugin/browser_plugin_guest.h"
 #include "content/public/test/test_utils.h"
 #include "ui/gfx/size.h"
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index e497762..ce0f626 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -12,7 +12,6 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "base/synchronization/lock.h"
 #include "base/threading/thread.h"
 #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h
index f1c8f0d..5a6e1f9 100644
--- a/content/browser/child_process_launcher.h
+++ b/content/browser/child_process_launcher.h
@@ -7,7 +7,8 @@
 
 #include "base/basictypes.h"
 #include "base/memory/ref_counted.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
 #include "content/common/content_export.h"
 
 class CommandLine;
diff --git a/content/browser/child_process_security_policy_browsertest.cc b/content/browser/child_process_security_policy_browsertest.cc
index e475c02..db27a53 100644
--- a/content/browser/child_process_security_policy_browsertest.cc
+++ b/content/browser/child_process_security_policy_browsertest.cc
@@ -6,7 +6,6 @@
 
 #include "base/basictypes.h"
 #include "base/files/file_path.h"
-#include "base/process_util.h"
 #include "content/browser/child_process_security_policy_impl.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/render_process_host.h"
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index f9ba44e..d7640d3 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -49,29 +49,22 @@
     kReadFilePermissions |
     base::PLATFORM_FILE_ENUMERATE;
 
-const int kReadWriteFilePermissions =
-    base::PLATFORM_FILE_OPEN |
-    base::PLATFORM_FILE_CREATE |
+// TODO(tommycli): These flag sets need some work to make more obvious.
+// Why for instance, does Create|Write != Create|Write? http://crbug.com/263150
+const int kCreateReadWriteFilePermissions =
+    kReadFilePermissions |
+    kWriteFilePermissions |
+    kCreateFilePermissions |
     base::PLATFORM_FILE_OPEN_ALWAYS |
     base::PLATFORM_FILE_CREATE_ALWAYS |
-    base::PLATFORM_FILE_OPEN_TRUNCATED |
-    base::PLATFORM_FILE_READ |
-    base::PLATFORM_FILE_WRITE |
-    base::PLATFORM_FILE_EXCLUSIVE_READ |
-    base::PLATFORM_FILE_EXCLUSIVE_WRITE |
-    base::PLATFORM_FILE_ASYNC |
-    base::PLATFORM_FILE_WRITE_ATTRIBUTES;
+    base::PLATFORM_FILE_OPEN_TRUNCATED;
 
 const int kCreateWriteFilePermissions =
-      base::PLATFORM_FILE_CREATE |
-      base::PLATFORM_FILE_CREATE_ALWAYS |
-      base::PLATFORM_FILE_OPEN |
-      base::PLATFORM_FILE_OPEN_ALWAYS |
-      base::PLATFORM_FILE_OPEN_TRUNCATED |
-      base::PLATFORM_FILE_WRITE |
-      base::PLATFORM_FILE_WRITE_ATTRIBUTES |
-      base::PLATFORM_FILE_ASYNC;
-      // need EXCLUSIVE_WRITE in this mix?
+    kWriteFilePermissions |
+    kCreateFilePermissions |
+    base::PLATFORM_FILE_OPEN_ALWAYS |
+    base::PLATFORM_FILE_CREATE_ALWAYS |
+    base::PLATFORM_FILE_OPEN_TRUNCATED;
 
 }  // namespace
 
@@ -434,7 +427,7 @@
 
 void ChildProcessSecurityPolicyImpl::GrantCreateReadWriteFile(
     int child_id, const base::FilePath& file) {
-  GrantPermissionsForFile(child_id, file, kReadWriteFilePermissions);
+  GrantPermissionsForFile(child_id, file, kCreateReadWriteFilePermissions);
 }
 
 void ChildProcessSecurityPolicyImpl::GrantCreateWriteFile(
@@ -485,6 +478,14 @@
                                 kCreateFilePermissions);
 }
 
+void ChildProcessSecurityPolicyImpl::GrantCopyIntoFileSystem(
+    int child_id, const std::string& filesystem_id) {
+  // TODO(tommycli): These granted permissions a bit too broad, but not abused.
+  // We are fixing in http://crbug.com/262142 and associated CL.
+  GrantPermissionsForFileSystem(child_id, filesystem_id,
+                                kCreateFilePermissions);
+}
+
 void ChildProcessSecurityPolicyImpl::GrantScheme(int child_id,
                                                  const std::string& scheme) {
   base::AutoLock lock(lock_);
@@ -601,6 +602,22 @@
   return HasPermissionsForFile(child_id, file, kReadFilePermissions);
 }
 
+bool ChildProcessSecurityPolicyImpl::CanWriteFile(int child_id,
+                                                  const base::FilePath& file) {
+  return HasPermissionsForFile(child_id, file, kWriteFilePermissions);
+}
+
+bool ChildProcessSecurityPolicyImpl::CanCreateFile(int child_id,
+                                                   const base::FilePath& file) {
+  return HasPermissionsForFile(child_id, file, kCreateFilePermissions);
+}
+
+bool ChildProcessSecurityPolicyImpl::CanCreateWriteFile(
+    int child_id,
+    const base::FilePath& file) {
+  return HasPermissionsForFile(child_id, file, kCreateWriteFilePermissions);
+}
+
 bool ChildProcessSecurityPolicyImpl::CanReadDirectory(
     int child_id, const base::FilePath& directory) {
   return HasPermissionsForFile(child_id,
@@ -623,6 +640,15 @@
                                      kWriteFilePermissions);
 }
 
+bool ChildProcessSecurityPolicyImpl::CanCopyIntoFileSystem(
+    int child_id, const std::string& filesystem_id) {
+  // TODO(tommycli): These granted permissions a bit too broad, but not abused.
+  // We are fixing in http://crbug.com/262142 and associated CL.
+  return HasPermissionsForFileSystem(child_id,
+                                     filesystem_id,
+                                     kCreateFilePermissions);
+}
+
 bool ChildProcessSecurityPolicyImpl::HasPermissionsForFile(
     int child_id, const base::FilePath& file, int permissions) {
   base::AutoLock lock(lock_);
@@ -681,6 +707,31 @@
   return false;
 }
 
+bool ChildProcessSecurityPolicyImpl::CanReadFileSystemFile(
+    int child_id,
+    const fileapi::FileSystemURL& url) {
+  return HasPermissionsForFileSystemFile(child_id, url, kReadFilePermissions);
+}
+
+bool ChildProcessSecurityPolicyImpl::CanWriteFileSystemFile(
+    int child_id,
+    const fileapi::FileSystemURL& url) {
+  return HasPermissionsForFileSystemFile(child_id, url, kWriteFilePermissions);
+}
+
+bool ChildProcessSecurityPolicyImpl::CanCreateFileSystemFile(
+    int child_id,
+    const fileapi::FileSystemURL& url) {
+  return HasPermissionsForFileSystemFile(child_id, url, kCreateFilePermissions);
+}
+
+bool ChildProcessSecurityPolicyImpl::CanCreateWriteFileSystemFile(
+    int child_id,
+    const fileapi::FileSystemURL& url) {
+  return HasPermissionsForFileSystemFile(child_id, url,
+                                         kCreateWriteFilePermissions);
+}
+
 bool ChildProcessSecurityPolicyImpl::HasWebUIBindings(int child_id) {
   base::AutoLock lock(lock_);
 
diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h
index 713ef59..3477f1e 100644
--- a/content/browser/child_process_security_policy_impl.h
+++ b/content/browser/child_process_security_policy_impl.h
@@ -44,7 +44,7 @@
   virtual bool IsWebSafeScheme(const std::string& scheme) OVERRIDE;
   virtual void GrantReadFile(int child_id, const base::FilePath& file) OVERRIDE;
   virtual void GrantCreateReadWriteFile(int child_id,
-                                  const base::FilePath& file) OVERRIDE;
+                                        const base::FilePath& file) OVERRIDE;
   virtual void GrantCreateWriteFile(int child_id,
                                     const base::FilePath& file) OVERRIDE;
   virtual void GrantReadFileSystem(
@@ -56,13 +56,22 @@
   virtual void GrantCreateFileForFileSystem(
       int child_id,
       const std::string& filesystem_id) OVERRIDE;
+  virtual void GrantCopyIntoFileSystem(
+      int child_id,
+      const std::string& filesystem_id) OVERRIDE;
   virtual void GrantScheme(int child_id, const std::string& scheme) OVERRIDE;
   virtual bool CanReadFile(int child_id, const base::FilePath& file) OVERRIDE;
+  virtual bool CanWriteFile(int child_id, const base::FilePath& file) OVERRIDE;
+  virtual bool CanCreateFile(int child_id, const base::FilePath& file) OVERRIDE;
+  virtual bool CanCreateWriteFile(int child_id,
+                                  const base::FilePath& file) OVERRIDE;
   virtual bool CanReadFileSystem(int child_id,
                                  const std::string& filesystem_id) OVERRIDE;
   virtual bool CanReadWriteFileSystem(
       int child_id,
       const std::string& filesystem_id) OVERRIDE;
+  virtual bool CanCopyIntoFileSystem(int child_id,
+                                     const std::string& filesystem_id) OVERRIDE;
 
   // Pseudo schemes are treated differently than other schemes because they
   // cannot be requested like normal URLs.  There is no mechanism for revoking
@@ -129,18 +138,27 @@
   // the browser should call this method to check for the capability.
   bool CanReadDirectory(int child_id, const base::FilePath& directory);
 
+  // Deprecated: Use CanReadFile, etc. methods instead.
   // Determines if certain permissions were granted for a file. |permissions|
   // must be a bitwise-or'd value of base::PlatformFileFlags.
   bool HasPermissionsForFile(int child_id,
                              const base::FilePath& file,
                              int permissions);
 
+  // Deprecated: Use CanReadFileSystemFile, etc. methods instead.
   // Determines if certain permissions were granted for a file in FileSystem
   // API. |permissions| must be a bitwise-or'd value of base::PlatformFileFlags.
   bool HasPermissionsForFileSystemFile(int child_id,
                                        const fileapi::FileSystemURL& url,
                                        int permissions);
 
+  // Explicit permissions checks for FileSystemURL specified files.
+  bool CanReadFileSystemFile(int child_id, const fileapi::FileSystemURL& url);
+  bool CanWriteFileSystemFile(int child_id, const fileapi::FileSystemURL& url);
+  bool CanCreateFileSystemFile(int child_id, const fileapi::FileSystemURL& url);
+  bool CanCreateWriteFileSystemFile(int child_id,
+                                    const fileapi::FileSystemURL& url);
+
   // Returns true if the specified child_id has been granted WebUIBindings.
   // The browser should check this property before assuming the child process is
   // allowed to use WebUIBindings.
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc
index e6473e9..b914eac 100644
--- a/content/browser/child_process_security_policy_unittest.cc
+++ b/content/browser/child_process_security_policy_unittest.cc
@@ -13,6 +13,10 @@
 #include "content/test/test_content_browser_client.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
+#include "webkit/browser/fileapi/file_permission_policy.h"
+#include "webkit/browser/fileapi/file_system_url.h"
+#include "webkit/browser/fileapi/isolated_context.h"
+#include "webkit/common/fileapi/file_system_types.h"
 
 namespace content {
 namespace {
@@ -90,6 +94,7 @@
   ContentBrowserClient* old_browser_client_;
 };
 
+
 TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) {
   ChildProcessSecurityPolicyImpl* p =
       ChildProcessSecurityPolicyImpl::GetInstance();
@@ -278,28 +283,203 @@
   p->Remove(kRendererID);
 }
 
-TEST_F(ChildProcessSecurityPolicyTest, CanReadFiles) {
+TEST_F(ChildProcessSecurityPolicyTest, FileSystemGrantsTest) {
   ChildProcessSecurityPolicyImpl* p =
       ChildProcessSecurityPolicyImpl::GetInstance();
 
   p->Add(kRendererID);
+  std::string read_id = fileapi::IsolatedContext::GetInstance()->
+      RegisterFileSystemForVirtualPath(fileapi::kFileSystemTypeTest,
+                                       "read_filesystem",
+                                       base::FilePath());
+  std::string read_write_id = fileapi::IsolatedContext::GetInstance()->
+      RegisterFileSystemForVirtualPath(fileapi::kFileSystemTypeTest,
+                                       "read_write_filesystem",
+                                       base::FilePath());
+  std::string copy_into_id = fileapi::IsolatedContext::GetInstance()->
+      RegisterFileSystemForVirtualPath(fileapi::kFileSystemTypeTest,
+                                       "copy_into_filesystem",
+                                       base::FilePath());
 
-  EXPECT_FALSE(p->CanReadFile(kRendererID,
-                              base::FilePath(TEST_PATH("/etc/passwd"))));
-  p->GrantReadFile(kRendererID, base::FilePath(TEST_PATH("/etc/passwd")));
-  EXPECT_TRUE(p->CanReadFile(kRendererID,
-                             base::FilePath(TEST_PATH("/etc/passwd"))));
-  EXPECT_FALSE(p->CanReadFile(kRendererID,
-                              base::FilePath(TEST_PATH("/etc/shadow"))));
+  // Test initially having no permissions.
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_id));
 
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_write_id));
+
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, copy_into_id));
+
+  // Testing varying combinations of grants and checks.
+  p->GrantReadFileSystem(kRendererID, read_id);
+  EXPECT_TRUE(p->CanReadFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_id));
+
+  p->GrantReadFileSystem(kRendererID, read_write_id);
+  p->GrantWriteFileSystem(kRendererID, read_write_id);
+  EXPECT_TRUE(p->CanReadFileSystem(kRendererID, read_write_id));
+  EXPECT_TRUE(p->CanReadWriteFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_write_id));
+
+  p->GrantCopyIntoFileSystem(kRendererID, copy_into_id);
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, copy_into_id));
+  EXPECT_TRUE(p->CanCopyIntoFileSystem(kRendererID, copy_into_id));
+
+  // Test revoke permissions on renderer ID removal.
   p->Remove(kRendererID);
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_id));
+
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_write_id));
+
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, copy_into_id));
+
+  // Test having no permissions upon re-adding same renderer ID.
   p->Add(kRendererID);
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_id));
 
-  EXPECT_FALSE(p->CanReadFile(kRendererID,
-                              base::FilePath(TEST_PATH("/etc/passwd"))));
-  EXPECT_FALSE(p->CanReadFile(kRendererID,
-                              base::FilePath(TEST_PATH("/etc/shadow"))));
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, read_write_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, read_write_id));
 
+  EXPECT_FALSE(p->CanReadFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanReadWriteFileSystem(kRendererID, copy_into_id));
+  EXPECT_FALSE(p->CanCopyIntoFileSystem(kRendererID, copy_into_id));
+
+  // Cleanup.
+  p->Remove(kRendererID);
+  fileapi::IsolatedContext::GetInstance()->RevokeFileSystem(read_id);
+  fileapi::IsolatedContext::GetInstance()->RevokeFileSystem(read_write_id);
+  fileapi::IsolatedContext::GetInstance()->RevokeFileSystem(copy_into_id);
+}
+
+TEST_F(ChildProcessSecurityPolicyTest, FilePermissionGrantingAndRevoking) {
+  ChildProcessSecurityPolicyImpl* p =
+      ChildProcessSecurityPolicyImpl::GetInstance();
+
+  p->RegisterFileSystemPermissionPolicy(
+      fileapi::kFileSystemTypeTest,
+      fileapi::FILE_PERMISSION_USE_FILE_PERMISSION);
+
+  p->Add(kRendererID);
+  base::FilePath file(TEST_PATH("/dir/testfile"));
+  file = file.NormalizePathSeparators();
+  fileapi::FileSystemURL url = fileapi::FileSystemURL::CreateForTest(
+      GURL("http://foo/"), fileapi::kFileSystemTypeTest, file);
+
+  // Test initially having no permissions.
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  // Testing every combination of permissions granting and revoking.
+  p->GrantReadFile(kRendererID, file);
+  EXPECT_TRUE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+  p->RevokeAllPermissionsForFile(kRendererID, file);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  p->GrantCreateReadWriteFile(kRendererID, file);
+  EXPECT_TRUE(p->CanReadFile(kRendererID, file));
+  EXPECT_TRUE(p->CanWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+  p->RevokeAllPermissionsForFile(kRendererID, file);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  p->GrantCreateWriteFile(kRendererID, file);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_TRUE(p->CanWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+  p->RevokeAllPermissionsForFile(kRendererID, file);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  // Test revoke permissions on renderer ID removal.
+  p->GrantCreateReadWriteFile(kRendererID, file);
+  EXPECT_TRUE(p->CanReadFile(kRendererID, file));
+  EXPECT_TRUE(p->CanWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateFile(kRendererID, file));
+  EXPECT_TRUE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_TRUE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_TRUE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+  p->Remove(kRendererID);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  // Test having no permissions upon re-adding same renderer ID.
+  p->Add(kRendererID);
+  EXPECT_FALSE(p->CanReadFile(kRendererID, file));
+  EXPECT_FALSE(p->CanWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateFile(kRendererID, file));
+  EXPECT_FALSE(p->CanCreateWriteFile(kRendererID, file));
+  EXPECT_FALSE(p->CanReadFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanWriteFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateFileSystemFile(kRendererID, url));
+  EXPECT_FALSE(p->CanCreateWriteFileSystemFile(kRendererID, url));
+
+  // Cleanup.
   p->Remove(kRendererID);
 }
 
diff --git a/content/browser/device_orientation/data_fetcher_impl_android_unittest.cc b/content/browser/device_orientation/data_fetcher_impl_android_unittest.cc
index 506dca0..85d5184 100644
--- a/content/browser/device_orientation/data_fetcher_impl_android_unittest.cc
+++ b/content/browser/device_orientation/data_fetcher_impl_android_unittest.cc
@@ -7,7 +7,6 @@
 #include "base/android/jni_android.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace content {
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc
index 55b2787..6afc65d 100644
--- a/content/browser/devtools/devtools_http_handler_impl.cc
+++ b/content/browser/devtools/devtools_http_handler_impl.cc
@@ -43,6 +43,7 @@
 #include "net/base/io_buffer.h"
 #include "net/base/ip_endpoint.h"
 #include "net/server/http_server_request_info.h"
+#include "net/server/http_server_response_info.h"
 #include "ui/base/layout.h"
 #include "url/gurl.h"
 #include "webkit/common/user_agent/user_agent.h"
@@ -754,19 +755,15 @@
   scoped_ptr<base::Value> message_object(new base::StringValue(message));
   base::JSONWriter::Write(message_object.get(), &json_message);
 
-  std::string response;
-  std::string mime_type = "application/json; charset=UTF-8";
-
-  response = base::StringPrintf("%s%s", json_value.c_str(), message.c_str());
+  net::HttpServerResponseInfo response(status_code);
+  response.SetBody(json_value + message, "application/json; charset=UTF-8");
 
   thread_->message_loop()->PostTask(
       FROM_HERE,
-      base::Bind(&net::HttpServer::Send,
+      base::Bind(&net::HttpServer::SendResponse,
                  server_.get(),
                  connection_id,
-                 status_code,
-                 response,
-                 mime_type));
+                 response));
 }
 
 void DevToolsHttpHandlerImpl::Send200(int connection_id,
diff --git a/content/browser/devtools/devtools_http_handler_impl.h b/content/browser/devtools/devtools_http_handler_impl.h
index 766bb61..88dcd31 100644
--- a/content/browser/devtools/devtools_http_handler_impl.h
+++ b/content/browser/devtools/devtools_http_handler_impl.h
@@ -16,6 +16,7 @@
 #include "content/public/browser/devtools_http_handler.h"
 #include "content/public/browser/devtools_http_handler_delegate.h"
 #include "content/public/browser/worker_service.h"
+#include "net/http/http_status_code.h"
 #include "net/server/http_server.h"
 
 namespace base {
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 38663b8..79ad19c 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -10,15 +10,18 @@
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
 #include "content/browser/byte_stream.h"
 #include "content/browser/download/download_file_factory.h"
 #include "content/browser/download/download_file_impl.h"
 #include "content/browser/download/download_item_impl.h"
 #include "content/browser/download/download_manager_impl.h"
 #include "content/browser/download/download_resource_handler.h"
+#include "content/browser/plugin_service_impl.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/power_save_blocker.h"
 #include "content/public/common/content_switches.h"
+#include "content/public/common/webplugininfo.h"
 #include "content/public/test/download_test_observer.h"
 #include "content/public/test/test_file_error_injector.h"
 #include "content/public/test/test_utils.h"
@@ -779,6 +782,28 @@
       file2, GetTestFilePath("download", "download-test.lib")));
 }
 
+#if defined(ENABLE_PLUGINS)
+// Content served with a MIME type of application/octet-stream should be
+// downloaded even when a plugin can be found that handles the file type.
+IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadOctetStream) {
+  const base::FilePath::CharType kTestFilePath[] =
+      FILE_PATH_LITERAL("octet-stream.abc");
+  const char kTestPluginName[] = "TestPlugin";
+  const char kTestMimeType[] = "application/x-test-mime-type";
+  const char kTestFileType[] = "abc";
+
+  WebPluginInfo plugin_info;
+  plugin_info.name = base::ASCIIToUTF16(kTestPluginName);
+  plugin_info.mime_types.push_back(
+      WebPluginMimeType(kTestMimeType, kTestFileType, ""));
+  PluginServiceImpl::GetInstance()->RegisterInternalPlugin(plugin_info, false);
+
+  // The following is served with a Content-Type of application/octet-stream.
+  GURL url(URLRequestMockHTTPJob::GetMockUrl(base::FilePath(kTestFilePath)));
+  DownloadAndWait(shell(), url, DownloadItem::COMPLETE);
+}
+#endif
+
 // Try to cancel just before we release the download file, by delaying final
 // rename callback.
 IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtFinalRename) {
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 00686d4..5471df2 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -616,7 +616,8 @@
           danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
           danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT ||
           danger_type_ == DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT ||
-          danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST);
+          danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST ||
+          danger_type_ == DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED);
 #else
   return (danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE ||
           danger_type_ == DOWNLOAD_DANGER_TYPE_DANGEROUS_URL);
diff --git a/content/browser/download/download_net_log_parameters.cc b/content/browser/download/download_net_log_parameters.cc
index 0485cf2..f464298 100644
--- a/content/browser/download/download_net_log_parameters.cc
+++ b/content/browser/download/download_net_log_parameters.cc
@@ -31,6 +31,7 @@
   "UNCOMMON_CONTENT",
   "USER_VALIDATED",
   "DANGEROUS_HOST",
+  "POTENTIALLY_UNWANTED"
 };
 
 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(download_type_names) == SRC_SAVE_PAGE_AS + 1,
diff --git a/content/browser/download/mhtml_generation_manager.h b/content/browser/download/mhtml_generation_manager.h
index ffdb95b..efc6b46 100644
--- a/content/browser/download/mhtml_generation_manager.h
+++ b/content/browser/download/mhtml_generation_manager.h
@@ -9,7 +9,7 @@
 
 #include "base/memory/singleton.h"
 #include "base/platform_file.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_platform_file.h"
 
 namespace base {
diff --git a/content/browser/gamepad/gamepad_provider_unittest.cc b/content/browser/gamepad/gamepad_provider_unittest.cc
index 12d8845..0e5785c 100644
--- a/content/browser/gamepad/gamepad_provider_unittest.cc
+++ b/content/browser/gamepad/gamepad_provider_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process_util.h"
 #include "content/browser/gamepad/gamepad_data_fetcher.h"
 #include "content/browser/gamepad/gamepad_provider.h"
 #include "content/browser/gamepad/gamepad_test_helpers.h"
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.h b/content/browser/gpu/browser_gpu_channel_host_factory.h
index 8baf263..fb34b64 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.h
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.h
@@ -7,7 +7,7 @@
 
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/synchronization/waitable_event.h"
 #include "content/common/gpu/client/gpu_channel_host.h"
 #include "ipc/ipc_channel_handle.h"
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index ede4bb7..497d3bd 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -13,7 +13,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/singleton.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/synchronization/lock.h"
 #include "base/time/time.h"
 #include "base/values.h"
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 7bf6292..c7b4666 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -13,7 +13,6 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "base/sha1.h"
 #include "base/threading/thread.h"
 #include "content/browser/browser_child_process_host_impl.h"
@@ -279,6 +278,8 @@
 
 }  // anonymous namespace
 
+// Single process not supported in multiple dll mode currently.
+#if !defined(CHROME_MULTIPLE_DLL)
 // This class creates a GPU thread (instead of a GPU process), when running
 // with --in-process-gpu or --single-process.
 class GpuMainThread : public base::Thread {
@@ -312,6 +313,7 @@
 
   DISALLOW_COPY_AND_ASSIGN(GpuMainThread);
 };
+#endif  // !CHROME_MULTIPLE_DLL
 
 // static
 bool GpuProcessHost::ValidateHost(GpuProcessHost* host) {
@@ -596,6 +598,8 @@
   if (channel_id.empty())
     return false;
 
+  // Single process not supported in multiple dll mode currently.
+#if !defined(CHROME_MULTIPLE_DLL)
   if (in_process_) {
     CommandLine::ForCurrentProcess()->AppendSwitch(
         switches::kDisableGpuWatchdog);
@@ -604,7 +608,9 @@
     in_process_gpu_thread_->Start();
 
     OnProcessLaunched();  // Fake a callback that the process is ready.
-  } else if (!LaunchGpuProcess(channel_id)) {
+  } else
+#endif  // !CHROME_MULTIPLE_DLL
+      if (!LaunchGpuProcess(channel_id)) {
     return false;
   }
 
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 7b2f6a8..8908a10 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -214,7 +214,9 @@
   bool swiftshader_rendering_;
   GpuProcessKind kind_;
 
+#if !defined(CHROME_MULTIPLE_DLL)
   scoped_ptr<GpuMainThread> in_process_gpu_thread_;
+#endif
 
   // Whether we actually launched a GPU process.
   bool process_launched_;
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index 2d0c425..5081042 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -11,7 +11,6 @@
 #include "base/debug/trace_event.h"
 #include "base/id_map.h"
 #include "base/lazy_instance.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "content/browser/gpu/gpu_data_manager_impl.h"
 #include "content/browser/gpu/gpu_process_host.h"
diff --git a/content/browser/histogram_message_filter.cc b/content/browser/histogram_message_filter.cc
index 7522190..d46b96b 100644
--- a/content/browser/histogram_message_filter.cc
+++ b/content/browser/histogram_message_filter.cc
@@ -7,7 +7,6 @@
 #include "base/command_line.h"
 #include "base/metrics/histogram.h"
 #include "base/metrics/statistics_recorder.h"
-#include "base/process_util.h"
 #include "content/browser/histogram_controller.h"
 #include "content/browser/tcmalloc_internals_request_job.h"
 #include "content/common/child_process_messages.h"
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index 108954e..ab010cb 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -8,7 +8,6 @@
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/thread_test_helper.h"
 #include "content/browser/browser_main_loop.h"
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index f833c22..2b4c64f 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -7,8 +7,7 @@
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
 #include "base/strings/utf_string_conversions.h"
 #include "content/browser/indexed_db/indexed_db_callbacks.h"
 #include "content/browser/indexed_db/indexed_db_connection.h"
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index 151924a..02e5552 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -13,7 +13,6 @@
 #include "base/logging.h"
 #include "base/memory/shared_memory.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "content/browser/devtools/devtools_netlog_observer.h"
 #include "content/browser/host_zoom_map_impl.h"
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 8fabb52..f09798f 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/memory/scoped_vector.h"
 #include "base/message_loop/message_loop.h"
 #include "base/pickle.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "content/browser/browser_thread_impl.h"
diff --git a/content/browser/loader/resource_loader_unittest.cc b/content/browser/loader/resource_loader_unittest.cc
index 4801876..634a553 100644
--- a/content/browser/loader/resource_loader_unittest.cc
+++ b/content/browser/loader/resource_loader_unittest.cc
@@ -4,16 +4,18 @@
 
 #include "content/browser/loader/resource_loader.h"
 
-#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/loader/resource_loader_delegate.h"
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/test/mock_resource_context.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "content/test/test_content_browser_client.h"
 #include "net/cert/x509_certificate.h"
 #include "net/ssl/client_cert_store.h"
 #include "net/ssl/ssl_cert_request_info.h"
 #include "net/url_request/url_request.h"
+#include "net/url_request/url_request_test_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace content {
@@ -144,13 +146,9 @@
 class ResourceLoaderTest : public testing::Test,
                            public ResourceLoaderDelegate {
  protected:
-  // testing::Test:
-  virtual void SetUp() OVERRIDE {
-    message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO));
-    ui_thread_.reset(
-        new BrowserThreadImpl(BrowserThread::UI, message_loop_.get()));
-    io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO,
-                                           message_loop_.get()));
+  ResourceLoaderTest()
+    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+      resource_context_(&test_url_request_context_) {
   }
 
   // ResourceLoaderDelegate:
@@ -179,10 +177,9 @@
   virtual void DidReceiveResponse(ResourceLoader* loader) OVERRIDE {}
   virtual void DidFinishLoading(ResourceLoader* loader) OVERRIDE {}
 
-  scoped_ptr<base::MessageLoop> message_loop_;
-  scoped_ptr<BrowserThreadImpl> ui_thread_;
-  scoped_ptr<BrowserThreadImpl> io_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
 
+  net::TestURLRequestContext test_url_request_context_;
   content::MockResourceContext resource_context_;
 };
 
@@ -236,7 +233,7 @@
   // Everything is set up. Trigger the resource loader certificate request event
   // and run the message loop.
   loader.OnCertificateRequested(raw_ptr_to_request, cert_request_info.get());
-  message_loop_->RunUntilIdle();
+  base::RunLoop().RunUntilIdle();
 
   // Restore the original content browser client.
   SetBrowserClientForTesting(old_client);
diff --git a/content/browser/mach_broker_mac.h b/content/browser/mach_broker_mac.h
index e38e86f..51038bf 100644
--- a/content/browser/mach_broker_mac.h
+++ b/content/browser/mach_broker_mac.h
@@ -11,8 +11,8 @@
 #include <mach/mach.h>
 
 #include "base/memory/singleton.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
+#include "base/process/process_metrics.h"
 #include "base/synchronization/lock.h"
 #include "content/public/browser/browser_child_process_observer.h"
 #include "content/public/browser/notification_observer.h"
diff --git a/content/browser/media/webrtc_internals.h b/content/browser/media/webrtc_internals.h
index c5b110e..58e9a9f 100644
--- a/content/browser/media/webrtc_internals.h
+++ b/content/browser/media/webrtc_internals.h
@@ -7,7 +7,7 @@
 
 #include "base/memory/singleton.h"
 #include "base/observer_list.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/values.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/browser_child_process_observer.h"
diff --git a/content/browser/plugin_process_host_mac.cc b/content/browser/plugin_process_host_mac.cc
index f283ecd..9350300 100644
--- a/content/browser/plugin_process_host_mac.cc
+++ b/content/browser/plugin_process_host_mac.cc
@@ -11,7 +11,6 @@
 #include "base/bind.h"
 #include "base/logging.h"
 #include "base/mac/mac_util.h"
-#include "base/process_util.h"
 #include "content/browser/browser_child_process_host_impl.h"
 #include "content/browser/plugin_process_host.h"
 #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index d080e9e..b44d1e6 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -10,7 +10,6 @@
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/metrics/field_trial.h"
-#include "base/process_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "content/browser/browser_child_process_host_impl.h"
 #include "content/browser/plugin_service_impl.h"
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index f516b17..78d6bd6 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -12,7 +12,7 @@
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
 #include "content/browser/renderer_host/pepper/pepper_message_filter.h"
diff --git a/content/browser/profiler_controller_impl.h b/content/browser/profiler_controller_impl.h
index 1efbafa..34c76ec 100644
--- a/content/browser/profiler_controller_impl.h
+++ b/content/browser/profiler_controller_impl.h
@@ -6,7 +6,7 @@
 #define CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
 
 #include "base/memory/singleton.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/profiler_controller.h"
 #include "content/public/common/process_type.h"
diff --git a/content/browser/profiler_message_filter.cc b/content/browser/profiler_message_filter.cc
index 9eeaa03..cb30f25 100644
--- a/content/browser/profiler_message_filter.cc
+++ b/content/browser/profiler_message_filter.cc
@@ -5,7 +5,6 @@
 #include "content/browser/profiler_message_filter.h"
 
 #include "base/tracked_objects.h"
-#include "base/process_util.h"
 #include "content/browser/profiler_controller_impl.h"
 #include "content/browser/tcmalloc_internals_request_job.h"
 #include "content/common/child_process_messages.h"
diff --git a/content/browser/renderer_host/backing_store_manager.h b/content/browser/renderer_host/backing_store_manager.h
index 6f27336..8611188 100644
--- a/content/browser/renderer_host/backing_store_manager.h
+++ b/content/browser/renderer_host/backing_store_manager.h
@@ -9,7 +9,7 @@
 
 #include "base/basictypes.h"
 #include "base/callback_forward.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ui/gfx/rect.h"
 #include "ui/gfx/size.h"
 #include "ui/surface/transport_dib.h"
diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc
index c396a7f..8ab2280 100644
--- a/content/browser/renderer_host/gpu_message_filter.cc
+++ b/content/browser/renderer_host/gpu_message_filter.cc
@@ -10,7 +10,6 @@
 
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/process_util.h"
 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
 #include "content/browser/gpu/gpu_process_host.h"
 #include "content/browser/gpu/gpu_surface_tracker.h"
diff --git a/content/browser/renderer_host/input/web_input_event_builders_win.cc b/content/browser/renderer_host/input/web_input_event_builders_win.cc
new file mode 100644
index 0000000..b529bf5
--- /dev/null
+++ b/content/browser/renderer_host/input/web_input_event_builders_win.cc
@@ -0,0 +1,456 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/input/web_input_event_builders_win.h"
+
+#include "base/logging.h"
+
+using WebKit::WebInputEvent;
+using WebKit::WebKeyboardEvent;
+using WebKit::WebMouseEvent;
+using WebKit::WebMouseWheelEvent;
+
+namespace content {
+
+static const unsigned long kDefaultScrollLinesPerWheelDelta = 3;
+static const unsigned long kDefaultScrollCharsPerWheelDelta = 1;
+
+static bool IsKeyDown(WPARAM wparam) {
+  return (GetKeyState(wparam) & 0x8000) != 0;
+}
+
+static int GetLocationModifier(WPARAM wparam, LPARAM lparam) {
+  int modifier = 0;
+  switch (wparam) {
+  case VK_RETURN:
+    if ((lparam >> 16) & KF_EXTENDED)
+      modifier = WebInputEvent::IsKeyPad;
+    break;
+  case VK_INSERT:
+  case VK_DELETE:
+  case VK_HOME:
+  case VK_END:
+  case VK_PRIOR:
+  case VK_NEXT:
+  case VK_UP:
+  case VK_DOWN:
+  case VK_LEFT:
+  case VK_RIGHT:
+    if (!((lparam >> 16) & KF_EXTENDED))
+      modifier = WebInputEvent::IsKeyPad;
+    break;
+  case VK_NUMLOCK:
+  case VK_NUMPAD0:
+  case VK_NUMPAD1:
+  case VK_NUMPAD2:
+  case VK_NUMPAD3:
+  case VK_NUMPAD4:
+  case VK_NUMPAD5:
+  case VK_NUMPAD6:
+  case VK_NUMPAD7:
+  case VK_NUMPAD8:
+  case VK_NUMPAD9:
+  case VK_DIVIDE:
+  case VK_MULTIPLY:
+  case VK_SUBTRACT:
+  case VK_ADD:
+  case VK_DECIMAL:
+  case VK_CLEAR:
+    modifier = WebInputEvent::IsKeyPad;
+    break;
+  case VK_SHIFT:
+    if (IsKeyDown(VK_LSHIFT))
+      modifier = WebInputEvent::IsLeft;
+    else if (IsKeyDown(VK_RSHIFT))
+      modifier = WebInputEvent::IsRight;
+    break;
+  case VK_CONTROL:
+    if (IsKeyDown(VK_LCONTROL))
+      modifier = WebInputEvent::IsLeft;
+    else if (IsKeyDown(VK_RCONTROL))
+      modifier = WebInputEvent::IsRight;
+    break;
+  case VK_MENU:
+    if (IsKeyDown(VK_LMENU))
+      modifier = WebInputEvent::IsLeft;
+    else if (IsKeyDown(VK_RMENU))
+      modifier = WebInputEvent::IsRight;
+    break;
+  case VK_LWIN:
+    modifier = WebInputEvent::IsLeft;
+    break;
+  case VK_RWIN:
+    modifier = WebInputEvent::IsRight;
+    break;
+  }
+
+  DCHECK(!modifier
+         || modifier == WebInputEvent::IsKeyPad
+         || modifier == WebInputEvent::IsLeft
+         || modifier == WebInputEvent::IsRight);
+  return modifier;
+}
+
+// Loads the state for toggle keys into the event.
+static void SetToggleKeyState(WebInputEvent* event) {
+  // Low bit set from GetKeyState indicates "toggled".
+  if (::GetKeyState(VK_NUMLOCK) & 1)
+    event->modifiers |= WebInputEvent::NumLockOn;
+  if (::GetKeyState(VK_CAPITAL) & 1)
+    event->modifiers |= WebInputEvent::CapsLockOn;
+}
+
+WebKeyboardEvent WebKeyboardEventBuilder::Build(HWND hwnd, UINT message,
+                                                WPARAM wparam, LPARAM lparam) {
+  WebKeyboardEvent result;
+
+  // TODO(pkasting): http://b/1117926 Are we guaranteed that the message that
+  // GetMessageTime() refers to is the same one that we're passed in? Perhaps
+  // one of the construction parameters should be the time passed by the
+  // caller, who would know for sure.
+  result.timeStampSeconds = ::GetMessageTime() / 1000.0;
+
+  result.windowsKeyCode = static_cast<int>(wparam);
+  // Record the scan code (along with other context bits) for this key event.
+  result.nativeKeyCode = static_cast<int>(lparam);
+
+  switch (message) {
+  case WM_SYSKEYDOWN:
+    result.isSystemKey = true;
+  case WM_KEYDOWN:
+    result.type = WebInputEvent::RawKeyDown;
+    break;
+  case WM_SYSKEYUP:
+    result.isSystemKey = true;
+  case WM_KEYUP:
+    result.type = WebInputEvent::KeyUp;
+    break;
+  case WM_IME_CHAR:
+    result.type = WebInputEvent::Char;
+    break;
+  case WM_SYSCHAR:
+    result.isSystemKey = true;
+    result.type = WebInputEvent::Char;
+  case WM_CHAR:
+    result.type = WebInputEvent::Char;
+    break;
+  default:
+    NOTREACHED();
+  }
+
+  if (result.type == WebInputEvent::Char
+   || result.type == WebInputEvent::RawKeyDown) {
+    result.text[0] = result.windowsKeyCode;
+    result.unmodifiedText[0] = result.windowsKeyCode;
+  }
+  if (result.type != WebInputEvent::Char)
+    result.setKeyIdentifierFromWindowsKeyCode();
+
+  if (::GetKeyState(VK_SHIFT) & 0x8000)
+    result.modifiers |= WebInputEvent::ShiftKey;
+  if (::GetKeyState(VK_CONTROL) & 0x8000)
+    result.modifiers |= WebInputEvent::ControlKey;
+  if (::GetKeyState(VK_MENU) & 0x8000)
+    result.modifiers |= WebInputEvent::AltKey;
+  // NOTE: There doesn't seem to be a way to query the mouse button state in
+  // this case.
+
+  if (LOWORD(lparam) > 1)
+    result.modifiers |= WebInputEvent::IsAutoRepeat;
+
+  result.modifiers |= GetLocationModifier(wparam, lparam);
+
+  SetToggleKeyState(&result);
+  return result;
+}
+
+// WebMouseEvent --------------------------------------------------------------
+
+static int g_last_click_count = 0;
+static double g_last_click_time = 0;
+
+static LPARAM GetRelativeCursorPos(HWND hwnd) {
+  POINT pos = {-1, -1};
+  GetCursorPos(&pos);
+  ScreenToClient(hwnd, &pos);
+  return MAKELPARAM(pos.x, pos.y);
+}
+
+WebMouseEvent WebMouseEventBuilder::Build(HWND hwnd, UINT message,
+                                          WPARAM wparam, LPARAM lparam) {
+  WebMouseEvent result;
+
+  switch (message) {
+  case WM_MOUSEMOVE:
+    result.type = WebInputEvent::MouseMove;
+    if (wparam & MK_LBUTTON)
+      result.button = WebMouseEvent::ButtonLeft;
+    else if (wparam & MK_MBUTTON)
+      result.button = WebMouseEvent::ButtonMiddle;
+    else if (wparam & MK_RBUTTON)
+      result.button = WebMouseEvent::ButtonRight;
+    else
+      result.button = WebMouseEvent::ButtonNone;
+    break;
+  case WM_MOUSELEAVE:
+    result.type = WebInputEvent::MouseLeave;
+    result.button = WebMouseEvent::ButtonNone;
+    // set the current mouse position (relative to the client area of the
+    // current window) since none is specified for this event
+    lparam = GetRelativeCursorPos(hwnd);
+    break;
+  case WM_LBUTTONDOWN:
+  case WM_LBUTTONDBLCLK:
+    result.type = WebInputEvent::MouseDown;
+    result.button = WebMouseEvent::ButtonLeft;
+    break;
+  case WM_MBUTTONDOWN:
+  case WM_MBUTTONDBLCLK:
+    result.type = WebInputEvent::MouseDown;
+    result.button = WebMouseEvent::ButtonMiddle;
+    break;
+  case WM_RBUTTONDOWN:
+  case WM_RBUTTONDBLCLK:
+    result.type = WebInputEvent::MouseDown;
+    result.button = WebMouseEvent::ButtonRight;
+    break;
+  case WM_LBUTTONUP:
+    result.type = WebInputEvent::MouseUp;
+    result.button = WebMouseEvent::ButtonLeft;
+    break;
+  case WM_MBUTTONUP:
+    result.type = WebInputEvent::MouseUp;
+    result.button = WebMouseEvent::ButtonMiddle;
+    break;
+  case WM_RBUTTONUP:
+    result.type = WebInputEvent::MouseUp;
+    result.button = WebMouseEvent::ButtonRight;
+    break;
+  default:
+    NOTREACHED();
+  }
+
+  // TODO(pkasting): http://b/1117926 Are we guaranteed that the message that
+  // GetMessageTime() refers to is the same one that we're passed in? Perhaps
+  // one of the construction parameters should be the time passed by the
+  // caller, who would know for sure.
+  result.timeStampSeconds = ::GetMessageTime() / 1000.0;
+
+  // set position fields:
+
+  result.x = static_cast<short>(LOWORD(lparam));
+  result.y = static_cast<short>(HIWORD(lparam));
+  result.windowX = result.x;
+  result.windowY = result.y;
+
+  POINT global_point = { result.x, result.y };
+  ClientToScreen(hwnd, &global_point);
+
+  result.globalX = global_point.x;
+  result.globalY = global_point.y;
+
+  // calculate number of clicks:
+
+  // This differs slightly from the WebKit code in WebKit/win/WebView.cpp
+  // where their original code looks buggy.
+  static int last_click_position_x;
+  static int last_click_position_Y;
+  static WebMouseEvent::Button last_click_button = WebMouseEvent::ButtonLeft;
+
+  double current_time = result.timeStampSeconds;
+  bool cancel_previous_click =
+      (abs(last_click_position_x - result.x) >
+          (::GetSystemMetrics(SM_CXDOUBLECLK) / 2))
+      || (abs(last_click_position_x - result.y) >
+          (::GetSystemMetrics(SM_CYDOUBLECLK) / 2))
+      || ((current_time - g_last_click_time) * 1000.0 > ::GetDoubleClickTime());
+
+  if (result.type == WebInputEvent::MouseDown) {
+    if (!cancel_previous_click && (result.button == last_click_button)) {
+      ++g_last_click_count;
+    } else {
+      g_last_click_count = 1;
+      last_click_position_x = result.x;
+      last_click_position_x = result.y;
+    }
+    g_last_click_time = current_time;
+    last_click_button = result.button;
+  } else if (result.type == WebInputEvent::MouseMove
+          || result.type == WebInputEvent::MouseLeave) {
+    if (cancel_previous_click) {
+      g_last_click_count = 0;
+      last_click_position_x = 0;
+      last_click_position_x = 0;
+      g_last_click_time = 0;
+    }
+  }
+  result.clickCount = g_last_click_count;
+
+  // set modifiers:
+
+  if (wparam & MK_CONTROL)
+    result.modifiers |= WebInputEvent::ControlKey;
+  if (wparam & MK_SHIFT)
+    result.modifiers |= WebInputEvent::ShiftKey;
+  if (::GetKeyState(VK_MENU) & 0x8000)
+    result.modifiers |= WebInputEvent::AltKey;
+  if (wparam & MK_LBUTTON)
+    result.modifiers |= WebInputEvent::LeftButtonDown;
+  if (wparam & MK_MBUTTON)
+    result.modifiers |= WebInputEvent::MiddleButtonDown;
+  if (wparam & MK_RBUTTON)
+    result.modifiers |= WebInputEvent::RightButtonDown;
+
+  SetToggleKeyState(&result);
+  return result;
+}
+
+// WebMouseWheelEvent ---------------------------------------------------------
+
+WebMouseWheelEvent
+WebMouseWheelEventBuilder::Build(HWND hwnd, UINT message,
+                                 WPARAM wparam, LPARAM lparam) {
+  WebMouseWheelEvent result;
+
+  result.type = WebInputEvent::MouseWheel;
+
+  // TODO(pkasting): http://b/1117926 Are we guaranteed that the message that
+  // GetMessageTime() refers to is the same one that we're passed in? Perhaps
+  // one of the construction parameters should be the time passed by the
+  // caller, who would know for sure.
+  result.timeStampSeconds = ::GetMessageTime() / 1000.0;
+
+  result.button = WebMouseEvent::ButtonNone;
+
+  // Get key state, coordinates, and wheel delta from event.
+  typedef SHORT (WINAPI *GetKeyStateFunction)(int key);
+  GetKeyStateFunction get_key_state_func;
+  UINT key_state;
+  float wheel_delta;
+  bool horizontal_scroll = false;
+  if ((message == WM_VSCROLL) || (message == WM_HSCROLL)) {
+    // Synthesize mousewheel event from a scroll event.  This is needed to
+    // simulate middle mouse scrolling in some laptops.  Use GetAsyncKeyState
+    // for key state since we are synthesizing the input event.
+    get_key_state_func = GetAsyncKeyState;
+    key_state = 0;
+    if (get_key_state_func(VK_SHIFT))
+      key_state |= MK_SHIFT;
+    if (get_key_state_func(VK_CONTROL))
+      key_state |= MK_CONTROL;
+    // NOTE: There doesn't seem to be a way to query the mouse button state
+    // in this case.
+
+    POINT cursor_position = {0};
+    GetCursorPos(&cursor_position);
+    result.globalX = cursor_position.x;
+    result.globalY = cursor_position.y;
+
+    switch (LOWORD(wparam)) {
+      case SB_LINEUP:    // == SB_LINELEFT
+        wheel_delta = WHEEL_DELTA;
+        break;
+      case SB_LINEDOWN:  // == SB_LINERIGHT
+        wheel_delta = -WHEEL_DELTA;
+        break;
+      case SB_PAGEUP:
+        wheel_delta = 1;
+        result.scrollByPage = true;
+        break;
+      case SB_PAGEDOWN:
+        wheel_delta = -1;
+        result.scrollByPage = true;
+        break;
+      default:  // We don't supoprt SB_THUMBPOSITION or SB_THUMBTRACK here.
+        wheel_delta = 0;
+        break;
+    }
+
+    if (message == WM_HSCROLL)
+      horizontal_scroll = true;
+  } else {
+    // Non-synthesized event; we can just read data off the event.
+    get_key_state_func = ::GetKeyState;
+    key_state = GET_KEYSTATE_WPARAM(wparam);
+
+    result.globalX = static_cast<short>(LOWORD(lparam));
+    result.globalY = static_cast<short>(HIWORD(lparam));
+
+    wheel_delta = static_cast<float>(GET_WHEEL_DELTA_WPARAM(wparam));
+    if (message == WM_MOUSEHWHEEL) {
+      horizontal_scroll = true;
+      wheel_delta = -wheel_delta;  // Windows is <- -/+ ->, WebKit <- +/- ->.
+    }
+  }
+  if (key_state & MK_SHIFT)
+    horizontal_scroll = true;
+
+  // Set modifiers based on key state.
+  if (key_state & MK_SHIFT)
+    result.modifiers |= WebInputEvent::ShiftKey;
+  if (key_state & MK_CONTROL)
+    result.modifiers |= WebInputEvent::ControlKey;
+  if (get_key_state_func(VK_MENU) & 0x8000)
+    result.modifiers |= WebInputEvent::AltKey;
+  if (key_state & MK_LBUTTON)
+    result.modifiers |= WebInputEvent::LeftButtonDown;
+  if (key_state & MK_MBUTTON)
+    result.modifiers |= WebInputEvent::MiddleButtonDown;
+  if (key_state & MK_RBUTTON)
+    result.modifiers |= WebInputEvent::RightButtonDown;
+
+  SetToggleKeyState(&result);
+
+  // Set coordinates by translating event coordinates from screen to client.
+  POINT client_point = { result.globalX, result.globalY };
+  MapWindowPoints(0, hwnd, &client_point, 1);
+  result.x = client_point.x;
+  result.y = client_point.y;
+  result.windowX = result.x;
+  result.windowY = result.y;
+
+  // Convert wheel delta amount to a number of pixels to scroll.
+  //
+  // How many pixels should we scroll per line?  Gecko uses the height of the
+  // current line, which means scroll distance changes as you go through the
+  // page or go to different pages.  IE 8 is ~60 px/line, although the value
+  // seems to vary slightly by page and zoom level.  Also, IE defaults to
+  // smooth scrolling while Firefox doesn't, so it can get away with somewhat
+  // larger scroll values without feeling as jerky.  Here we use 100 px per
+  // three lines (the default scroll amount is three lines per wheel tick).
+  // Even though we have smooth scrolling, we don't make this as large as IE
+  // because subjectively IE feels like it scrolls farther than you want while
+  // reading articles.
+  static const float kScrollbarPixelsPerLine = 100.0f / 3.0f;
+  wheel_delta /= WHEEL_DELTA;
+  float scroll_delta = wheel_delta * kScrollbarPixelsPerLine;
+  if (horizontal_scroll) {
+    unsigned long scroll_chars = kDefaultScrollCharsPerWheelDelta;
+    SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scroll_chars, 0);
+    // TODO(pkasting): Should probably have a different multiplier
+    // scrollbarPixelsPerChar here.
+    scroll_delta *= static_cast<float>(scroll_chars);
+  } else {
+    unsigned long scroll_lines = kDefaultScrollLinesPerWheelDelta;
+    SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0);
+    if (scroll_lines == WHEEL_PAGESCROLL)
+      result.scrollByPage = true;
+    if (!result.scrollByPage)
+      scroll_delta *= static_cast<float>(scroll_lines);
+  }
+
+  // Set scroll amount based on above calculations.  WebKit expects positive
+  // deltaY to mean "scroll up" and positive deltaX to mean "scroll left".
+  if (horizontal_scroll) {
+    result.deltaX = scroll_delta;
+    result.wheelTicksX = wheel_delta;
+  } else {
+    result.deltaY = scroll_delta;
+    result.wheelTicksY = wheel_delta;
+  }
+
+  return result;
+}
+
+}  // namespace content
diff --git a/content/browser/renderer_host/input/web_input_event_builders_win.h b/content/browser/renderer_host/input/web_input_event_builders_win.h
new file mode 100644
index 0000000..f01cd29
--- /dev/null
+++ b/content/browser/renderer_host/input/web_input_event_builders_win.h
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_WIN_H_
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_WEB_INPUT_EVENT_BUILDERS_WIN_H_
+
+#include <windows.h>
+
+#include "third_party/WebKit/public/web/WebInputEvent.h"
+
+namespace content {
+
+class WebKeyboardEventBuilder {
+ public:
+  static WebKit::WebKeyboardEvent Build(HWND hwnd, UINT message,
+                                        WPARAM wparam, LPARAM lparam);
+};
+
+class WebMouseEventBuilder {
+ public:
+  static WebKit::WebMouseEvent Build(HWND hwnd, UINT message,
+                                     WPARAM wparam, LPARAM lparam);
+};
+
+class WebMouseWheelEventBuilder {
+ public:
+  static WebKit::WebMouseWheelEvent Build(HWND hwnd, UINT message,
+                                          WPARAM wparam, LPARAM lparam);
+};
+
+} // namespace content
+
+#endif  // CONTENT_BROWSER_RENDERER_HOST_WEB_INPUT_EVENT_BUILDERS_WIN_H_
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index 6f07227..4a2f731 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -7,7 +7,7 @@
 #include "base/bind.h"
 #include "base/memory/shared_memory.h"
 #include "base/metrics/histogram.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
 #include "content/browser/renderer_host/media/audio_input_sync_writer.h"
 #include "content/browser/renderer_host/media/media_stream_manager.h"
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.h b/content/browser/renderer_host/media/audio_input_renderer_host.h
index a86e362..d16ebfa 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.h
@@ -32,7 +32,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sequenced_task_runner_helpers.h"
 #include "content/common/media/audio_messages.h"
 #include "content/public/browser/browser_message_filter.h"
diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.cc b/content/browser/renderer_host/media/audio_input_sync_writer.cc
index aab0961..572abf3 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -7,7 +7,6 @@
 #include <algorithm>
 
 #include "base/memory/shared_memory.h"
-#include "base/process_util.h"
 
 namespace content {
 
diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.h b/content/browser/renderer_host/media/audio_input_sync_writer.h
index 868219b..4cfe9e3 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.h
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.h
@@ -6,7 +6,7 @@
 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
 
 #include "base/file_descriptor_posix.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sync_socket.h"
 #include "media/audio/audio_input_controller.h"
 
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index bf87d06..53f2eb2 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -9,7 +9,7 @@
 #include "base/command_line.h"
 #include "base/memory/shared_memory.h"
 #include "base/metrics/histogram.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/browser/browser_main_loop.h"
 #include "content/browser/media/media_internals.h"
 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h
index 2bb597a..47dbee9 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_renderer_host.h
@@ -42,7 +42,7 @@
 #include "base/gtest_prod_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sequenced_task_runner_helpers.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/browser_message_filter.h"
diff --git a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
index ea8247d..42fecc0 100644
--- a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
@@ -6,7 +6,6 @@
 #include "base/environment.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/sync_socket.h"
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
diff --git a/content/browser/renderer_host/media/audio_sync_reader.cc b/content/browser/renderer_host/media/audio_sync_reader.cc
index b2ec0a1..7f2bf40 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -8,7 +8,6 @@
 
 #include "base/memory/shared_memory.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "media/audio/audio_buffers_state.h"
 #include "media/audio/audio_parameters.h"
 #include "media/audio/shared_memory_util.h"
diff --git a/content/browser/renderer_host/media/audio_sync_reader.h b/content/browser/renderer_host/media/audio_sync_reader.h
index 87bf215..385e329 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.h
+++ b/content/browser/renderer_host/media/audio_sync_reader.h
@@ -6,7 +6,7 @@
 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
 
 #include "base/file_descriptor_posix.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sync_socket.h"
 #include "base/synchronization/lock.h"
 #include "base/time/time.h"
diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc
index 56f4099..116511f 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -7,7 +7,7 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/debug/trace_event.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/browser/browser_main_loop.h"
 #include "content/browser/media/media_internals.h"
 #include "content/common/media/midi_messages.h"
diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.cc b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
index 3919be7..b986055 100644
--- a/content/browser/renderer_host/media/peer_connection_tracker_host.cc
+++ b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
@@ -3,7 +3,6 @@
 // found in the LICENSE file.
 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h"
 
-#include "base/process_util.h"
 #include "content/browser/media/webrtc_internals.h"
 #include "content/common/media/peer_connection_tracker_messages.h"
 
diff --git a/content/browser/renderer_host/media/video_capture_buffer_pool.h b/content/browser/renderer_host/media/video_capture_buffer_pool.h
index 20df46f..6d96077 100644
--- a/content/browser/renderer_host/media/video_capture_buffer_pool.h
+++ b/content/browser/renderer_host/media/video_capture_buffer_pool.h
@@ -9,7 +9,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_vector.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/synchronization/lock.h"
 #include "content/common/content_export.h"
 #include "ui/gfx/size.h"
diff --git a/content/browser/renderer_host/media/video_capture_controller.h b/content/browser/renderer_host/media/video_capture_controller.h
index a872050..5d33d01 100644
--- a/content/browser/renderer_host/media/video_capture_controller.h
+++ b/content/browser/renderer_host/media/video_capture_controller.h
@@ -21,7 +21,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/synchronization/lock.h"
 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h"
 #include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
index 00155bf..58b9564 100644
--- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
@@ -10,7 +10,6 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/renderer_host/media/media_stream_provider.h"
 #include "content/browser/renderer_host/media/video_capture_controller.h"
diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc
index f4fdc1c..762148c 100644
--- a/content/browser/renderer_host/media/video_capture_host_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/file_util.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/run_loop.h"
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
diff --git a/content/browser/renderer_host/media/video_capture_manager_unittest.cc b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
index 78b2979..83c0646 100644
--- a/content/browser/renderer_host/media/video_capture_manager_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
@@ -10,7 +10,6 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/renderer_host/media/media_stream_provider.h"
 #include "content/browser/renderer_host/media/video_capture_manager.h"
diff --git a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc
index 9ac05b7..deb8741 100644
--- a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc
@@ -292,8 +292,7 @@
       RenderWidgetHostDelegate* widget_delegate,
       int routing_id,
       int main_frame_routing_id,
-      bool swapped_out,
-      SessionStorageNamespace* session_storage_namespace) OVERRIDE {
+      bool swapped_out) OVERRIDE {
     return new CaptureTestRenderViewHost(instance, delegate, widget_delegate,
                                          routing_id, main_frame_routing_id,
                                          swapped_out, controller_);
diff --git a/content/browser/renderer_host/native_web_keyboard_event_win.cc b/content/browser/renderer_host/native_web_keyboard_event_win.cc
index 4a800a0..42d3cce 100644
--- a/content/browser/renderer_host/native_web_keyboard_event_win.cc
+++ b/content/browser/renderer_host/native_web_keyboard_event_win.cc
@@ -4,9 +4,8 @@
 
 #include "content/public/browser/native_web_keyboard_event.h"
 
-#include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
+#include "content/browser/renderer_host/input/web_input_event_builders_win.h"
 
-using WebKit::WebInputEventFactory;
 using WebKit::WebKeyboardEvent;
 
 namespace content {
@@ -18,10 +17,10 @@
 
 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
     : WebKeyboardEvent(
-          WebInputEventFactory::keyboardEvent(native_event.hwnd,
-                                              native_event.message,
-                                              native_event.wParam,
-                                              native_event.lParam)),
+          WebKeyboardEventBuilder::Build(native_event.hwnd,
+                                         native_event.message,
+                                         native_event.wParam,
+                                         native_event.lParam)),
       os_event(native_event),
       skip_in_browser(false) {
 }
diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc b/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc
index af30a13..c338a99 100644
--- a/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc
+++ b/content/browser/renderer_host/pepper/browser_ppapi_host_test.cc
@@ -4,7 +4,6 @@
 
 #include "content/browser/renderer_host/pepper/browser_ppapi_host_test.h"
 
-#include "base/process_util.h"
 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
 
 namespace content {
diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h
index 057adc1..7931764 100644
--- a/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h
+++ b/content/browser/renderer_host/pepper/pepper_flash_file_message_filter.h
@@ -8,7 +8,7 @@
 #include "base/compiler_specific.h"
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ppapi/c/pp_instance.h"
 #include "ppapi/host/resource_host.h"
 #include "ppapi/host/resource_message_filter.h"
diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.cc b/content/browser/renderer_host/pepper/pepper_message_filter.cc
index 56eec74..43145e0 100644
--- a/content/browser/renderer_host/pepper/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_message_filter.cc
@@ -12,7 +12,6 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
 #include "base/threading/sequenced_worker_pool.h"
 #include "base/threading/worker_pool.h"
 #include "build/build_config.h"
diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.h b/content/browser/renderer_host/pepper/pepper_message_filter.h
index dcb45bc..04252ac 100644
--- a/content/browser/renderer_host/pepper/pepper_message_filter.h
+++ b/content/browser/renderer_host/pepper/pepper_message_filter.h
@@ -14,7 +14,7 @@
 #include "base/files/file_path.h"
 #include "base/memory/linked_ptr.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "content/public/browser/browser_message_filter.h"
 #include "content/public/browser/content_browser_client.h"
 #include "content/public/common/process_type.h"
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 5f71dac..29bdc0f 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -10,7 +10,6 @@
 #include "base/bind_helpers.h"
 #include "base/command_line.h"
 #include "base/debug/alias.h"
-#include "base/process_util.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread.h"
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 37bb266..ef3f0a3 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -27,7 +27,6 @@
 #include "base/metrics/histogram.h"
 #include "base/path_service.h"
 #include "base/platform_file.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/stl_util.h"
 #include "base/strings/string_util.h"
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 65933f6..65d85a0 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -10,7 +10,7 @@
 #include <string>
 
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/timer/timer.h"
 #include "content/browser/child_process_launcher.h"
 #include "content/common/content_export.h"
diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc
index 58cee3e..d2b4592 100644
--- a/content/browser/renderer_host/render_sandbox_host_linux.cc
+++ b/content/browser/renderer_host/render_sandbox_host_linux.cc
@@ -24,7 +24,7 @@
 #include "base/pickle.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/posix/unix_domain_socket_linux.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "content/child/webkitplatformsupport_impl.h"
diff --git a/content/browser/renderer_host/render_view_host_delegate.cc b/content/browser/renderer_host/render_view_host_delegate.cc
index f340a46..5ef5dc0 100644
--- a/content/browser/renderer_host/render_view_host_delegate.cc
+++ b/content/browser/renderer_host/render_view_host_delegate.cc
@@ -45,4 +45,9 @@
   return false;
 }
 
+SessionStorageNamespace* RenderViewHostDelegate::GetSessionStorageNamespace(
+    SiteInstance* instance) {
+  return NULL;
+}
+
 }  // namespace content
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index f73b041..5ce2a44 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -10,7 +10,7 @@
 #include "base/basictypes.h"
 #include "base/callback.h"
 #include "base/i18n/rtl.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "content/common/content_export.h"
 #include "content/public/common/javascript_message_type.h"
@@ -58,6 +58,7 @@
 struct NativeWebKeyboardEvent;
 struct Referrer;
 struct RendererPreferences;
+class SiteInstance;
 
 //
 // RenderViewHostDelegate
@@ -414,6 +415,11 @@
       const MediaStreamRequest& request,
       const MediaResponseCallback& callback) {}
 
+  // Returns the SessionStorageNamespace the render view should use. Might
+  // create the SessionStorageNamespace on the fly.
+  virtual SessionStorageNamespace* GetSessionStorageNamespace(
+      SiteInstance* instance);
+
  protected:
   virtual ~RenderViewHostDelegate() {}
 };
diff --git a/content/browser/renderer_host/render_view_host_factory.cc b/content/browser/renderer_host/render_view_host_factory.cc
index 4f01d54..20d15d3 100644
--- a/content/browser/renderer_host/render_view_host_factory.cc
+++ b/content/browser/renderer_host/render_view_host_factory.cc
@@ -19,17 +19,14 @@
     RenderWidgetHostDelegate* widget_delegate,
     int routing_id,
     int main_frame_routing_id,
-    bool swapped_out,
-    SessionStorageNamespace* session_storage_namespace) {
+    bool swapped_out) {
   if (factory_) {
     return factory_->CreateRenderViewHost(instance, delegate, widget_delegate,
                                           routing_id, main_frame_routing_id,
-                                          swapped_out,
-                                          session_storage_namespace);
+                                          swapped_out);
   }
   return new RenderViewHostImpl(instance, delegate, widget_delegate, routing_id,
-                                main_frame_routing_id, swapped_out,
-                                session_storage_namespace);
+                                main_frame_routing_id, swapped_out);
 }
 
 // static
diff --git a/content/browser/renderer_host/render_view_host_factory.h b/content/browser/renderer_host/render_view_host_factory.h
index df61552..6226187 100644
--- a/content/browser/renderer_host/render_view_host_factory.h
+++ b/content/browser/renderer_host/render_view_host_factory.h
@@ -29,8 +29,7 @@
       RenderWidgetHostDelegate* widget_delegate,
       int routing_id,
       int main_frame_routing_id,
-      bool swapped_out,
-      SessionStorageNamespace* session_storage);
+      bool swapped_out);
 
   // Returns true if there is currently a globally-registered factory.
   static bool has_factory() {
@@ -49,8 +48,7 @@
       RenderWidgetHostDelegate* widget_delegate,
       int routing_id,
       int main_frame_routing_id,
-      bool swapped_out,
-      SessionStorageNamespace* session_storage_namespace) = 0;
+      bool swapped_out) = 0;
 
   // Registers your factory to be called when new RenderViewHosts are created.
   // We have only one global factory, so there must be no factory registered
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 0fa0d6c..56801c0 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -153,8 +153,7 @@
     RenderWidgetHostDelegate* widget_delegate,
     int routing_id,
     int main_frame_routing_id,
-    bool swapped_out,
-    SessionStorageNamespace* session_storage)
+    bool swapped_out)
     : RenderWidgetHostImpl(widget_delegate, instance->GetProcess(), routing_id),
       delegate_(delegate),
       instance_(static_cast<SiteInstanceImpl*>(instance)),
@@ -173,10 +172,7 @@
       unload_ack_is_for_cross_site_transition_(false),
       are_javascript_messages_suppressed_(false),
       sudden_termination_allowed_(false),
-      session_storage_namespace_(
-          static_cast<SessionStorageNamespaceImpl*>(session_storage)),
       render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
-  DCHECK(session_storage_namespace_.get());
   DCHECK(instance_.get());
   CHECK(delegate_);  // http://crbug.com/82827
 
@@ -257,7 +253,8 @@
   params.view_id = GetRoutingID();
   params.main_frame_routing_id = main_render_frame_host_->routing_id();
   params.surface_id = surface_id();
-  params.session_storage_namespace_id = session_storage_namespace_->id();
+  params.session_storage_namespace_id =
+      delegate_->GetSessionStorageNamespace(instance_)->id();
   params.frame_name = frame_name;
   // Ensure the RenderView sets its opener correctly.
   params.opener_route_id = opener_route_id;
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index 7f63ba9..20caaf5 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -13,7 +13,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/observer_list.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "content/browser/renderer_host/render_frame_host_impl.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/browser/site_instance_impl.h"
@@ -123,8 +123,7 @@
       RenderWidgetHostDelegate* widget_delegate,
       int routing_id,
       int main_frame_routing_id,
-      bool swapped_out,
-      SessionStorageNamespace* session_storage_namespace);
+      bool swapped_out);
   virtual ~RenderViewHostImpl();
 
   // RenderViewHost implementation.
@@ -688,9 +687,6 @@
   // True if the render view can be shut down suddenly.
   bool sudden_termination_allowed_;
 
-  // The session storage namespace to be used by the associated render view.
-  scoped_refptr<SessionStorageNamespaceImpl> session_storage_namespace_;
-
   // The termination status of the last render view that terminated.
   base::TerminationStatus render_view_termination_status_;
 
diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h
index 8a462c5..c5e80a1 100644
--- a/content/browser/renderer_host/render_widget_helper.h
+++ b/content/browser/renderer_host/render_widget_helper.h
@@ -11,7 +11,7 @@
 #include "base/atomic_sequence_num.h"
 #include "base/containers/hash_tables.h"
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/synchronization/lock.h"
 #include "base/synchronization/waitable_event.h"
 #include "content/public/browser/browser_thread.h"
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 0eb19cb..adeab8f 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -129,7 +129,6 @@
       is_accelerated_compositing_active_(false),
       repaint_ack_pending_(false),
       resize_ack_pending_(false),
-      screen_info_out_of_date_(false),
       overdraw_bottom_height_(0.f),
       should_auto_resize_(false),
       waiting_for_screen_rects_ack_(false),
@@ -566,7 +565,7 @@
 
   bool size_changed = new_size != last_requested_size_;
   bool side_payload_changed =
-      screen_info_out_of_date_ ||
+      !screen_info_.get() ||
       old_physical_backing_size != physical_backing_size_ ||
       was_fullscreen != is_fullscreen_ ||
       old_overdraw_bottom_height != overdraw_bottom_height_;
@@ -1140,11 +1139,14 @@
   // The resize message (which may not happen immediately) will carry with it
   // the screen info as well as the new size (if the screen has changed scale
   // factor).
-  screen_info_.reset();
-  screen_info_out_of_date_ = true;
+  InvalidateScreenInfo();
   WasResized();
 }
 
+void RenderWidgetHostImpl::InvalidateScreenInfo() {
+  screen_info_.reset();
+}
+
 void RenderWidgetHostImpl::GetSnapshotFromRenderer(
     const gfx::Rect& src_subrect,
     const base::Callback<void(bool, const SkBitmap&)>& callback) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 752c7c0..362c6d7 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -18,7 +18,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/observer_list.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string16.h"
 #include "base/time/time.h"
 #include "base/timer/timer.h"
@@ -184,6 +184,11 @@
   // Notification that the screen info has changed.
   void NotifyScreenInfoChanged();
 
+  // Invalidates the cached screen info so that next resize request
+  // will carry the up to date screen info. Unlike
+  // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer.
+  void InvalidateScreenInfo();
+
   // Sets the View of this RenderWidgetHost.
   void SetView(RenderWidgetHostView* view);
 
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 9911354..46d9e4f 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -905,13 +905,13 @@
 // -----------------------------------------------------------------------------
 
 TEST_F(RenderWidgetHostTest, Resize) {
-  // The initial bounds is the empty rect, so setting it to the same thing
-  // should do nothing.
+  // The initial bounds is the empty rect, but the screen info hasn't been sent
+  // yet, so setting it to the same thing should send the resize message.
   view_->set_bounds(gfx::Rect());
   host_->WasResized();
   EXPECT_FALSE(host_->resize_ack_pending_);
   EXPECT_EQ(gfx::Size(), host_->last_requested_size_);
-  EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID));
+  EXPECT_TRUE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID));
 
   // Setting the bounds to a "real" rect should send out the notification.
   // but should not expect ack for empty physical backing size.
@@ -1012,6 +1012,9 @@
 // Test for crbug.com/25097.  If a renderer crashes between a resize and the
 // corresponding update message, we must be sure to clear the resize ack logic.
 TEST_F(RenderWidgetHostTest, ResizeThenCrash) {
+  // Clear the first Resize message that carried screen info.
+  process_->sink().ClearMessages();
+
   // Setting the bounds to a "real" rect should send out the notification.
   gfx::Rect original_size(0, 0, 100, 100);
   view_->set_bounds(original_size);
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 6783e7c..630ead9 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -13,7 +13,7 @@
 #include "base/i18n/rtl.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "cc/layers/delegated_renderer_layer_client.h"
 #include "cc/layers/texture_layer_client.h"
 #include "cc/output/begin_frame_args.h"
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 8fbaad8..ba4e9b1 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -767,6 +767,9 @@
 }
 
 void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) {
+  if (HasDisplayPropertyChanged(window_))
+    host_->InvalidateScreenInfo();
+
   window_->SetBounds(rect);
   host_->WasResized();
   MaybeCreateResizeLock();
@@ -1719,10 +1722,12 @@
 
 static void CopyFromCompositingSurfaceFinished(
     const base::Callback<void(bool, const SkBitmap&)>& callback,
+    const cc::TextureMailbox::ReleaseCallback& release_callback,
     scoped_ptr<SkBitmap> bitmap,
     scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
     bool result) {
   bitmap_pixels_lock.reset();
+  release_callback.Run(0, false);
   callback.Run(result, *bitmap);
 }
 
@@ -1770,6 +1775,7 @@
       pixels,
       base::Bind(&CopyFromCompositingSurfaceFinished,
                  callback,
+                 texture_mailbox->callback(),
                  base::Passed(&bitmap),
                  base::Passed(&bitmap_pixels_lock)));
 }
@@ -1801,6 +1807,14 @@
   callback.Run(true, bitmap);
 }
 
+static void CopyFromCompositingSurfaceFinishedForVideo(
+    const base::Callback<void(bool)>& callback,
+    const cc::TextureMailbox::ReleaseCallback& release_callback,
+    bool result) {
+  release_callback.Run(0, false);
+  callback.Run(result);
+}
+
 // static
 void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo(
     base::WeakPtr<RenderWidgetHostViewAura> rwhva,
@@ -1884,11 +1898,15 @@
   }
 
   scoped_callback_runner.Release();
+  base::Callback<void(bool result)> finished_callback = base::Bind(
+      &CopyFromCompositingSurfaceFinishedForVideo,
+      callback,
+      texture_mailbox->callback());
   yuv_readback_pipeline->ReadbackYUV(
       texture_mailbox->name(),
       texture_mailbox->sync_point(),
       video_frame.get(),
-      callback);
+      finished_callback);
 }
 
 void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) {
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index b611a66..03f7d5c 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -18,6 +18,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "ui/aura/client/aura_constants.h"
 #include "ui/aura/env.h"
+#include "ui/aura/layout_manager.h"
 #include "ui/aura/root_window.h"
 #include "ui/aura/test/aura_test_helper.h"
 #include "ui/aura/test/test_cursor_client.h"
@@ -135,6 +136,40 @@
   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraTest);
 };
 
+// A layout manager that always resizes a child to the root window size.
+class FullscreenLayoutManager : public aura::LayoutManager {
+ public:
+  explicit FullscreenLayoutManager(aura::RootWindow* owner)
+      : owner_(owner) {}
+  virtual ~FullscreenLayoutManager() {}
+
+  // Overridden from aura::LayoutManager:
+  virtual void OnWindowResized() OVERRIDE {
+    aura::Window::Windows::const_iterator i;
+    for (i = owner_->children().begin(); i != owner_->children().end(); ++i) {
+      (*i)->SetBounds(gfx::Rect());
+    }
+  }
+  virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE {
+    child->SetBounds(gfx::Rect());
+  }
+  virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE {
+  }
+  virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE {
+  }
+  virtual void OnChildWindowVisibilityChanged(aura::Window* child,
+                                              bool visible) OVERRIDE {
+  }
+  virtual void SetChildBounds(aura::Window* child,
+                              const gfx::Rect& requested_bounds) OVERRIDE {
+    SetChildBoundsDirect(child, gfx::Rect(owner_->bounds().size()));
+  }
+
+ private:
+  aura::RootWindow* owner_;
+  DISALLOW_COPY_AND_ASSIGN(FullscreenLayoutManager);
+};
+
 }  // namespace
 
 // Checks that a fullscreen view has the correct show-state and receives the
@@ -509,4 +544,44 @@
   cursor_client.RemoveObserver(view_);
 }
 
+// Resizing in fullscreen mode should send the up-to-date screen info.
+TEST_F(RenderWidgetHostViewAuraTest, FullscreenResize) {
+  aura::RootWindow* root_window = aura_test_helper_->root_window();
+  root_window->SetLayoutManager(new FullscreenLayoutManager(root_window));
+  view_->InitAsFullscreen(parent_view_);
+  view_->WasShown();
+  widget_host_->ResetSizeAndRepaintPendingFlags();
+  sink_->ClearMessages();
+
+  // Call WasResized to flush the old screen info.
+  view_->GetRenderWidgetHost()->WasResized();
+  {
+    // 0 is CreatingNew message.
+    const IPC::Message* msg = sink_->GetMessageAt(0);
+    EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
+    ViewMsg_Resize::Param params;
+    ViewMsg_Resize::Read(msg, &params);
+    EXPECT_EQ("0,0 800x600",
+              gfx::Rect(params.a.screen_info.availableRect).ToString());
+    EXPECT_EQ("800x600", params.a.new_size.ToString());
+  }
+
+  widget_host_->ResetSizeAndRepaintPendingFlags();
+  sink_->ClearMessages();
+
+  // Make sure the corrent screen size is set along in the resize
+  // request when the screen size has changed.
+  aura_test_helper_->test_screen()->SetUIScale(0.5);
+  EXPECT_EQ(1u, sink_->message_count());
+  {
+    const IPC::Message* msg = sink_->GetMessageAt(0);
+    EXPECT_EQ(ViewMsg_Resize::ID, msg->type());
+    ViewMsg_Resize::Param params;
+    ViewMsg_Resize::Read(msg, &params);
+    EXPECT_EQ("0,0 1600x1200",
+              gfx::Rect(params.a.screen_info.availableRect).ToString());
+    EXPECT_EQ("1600x1200", params.a.new_size.ToString());
+  }
+}
+
 }  // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 8783ee9..815b944 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -456,16 +456,20 @@
   if (impl)
     impl->SendScreenRects();
 
+  if (HasDisplayPropertyChanged(view) && impl)
+    impl->NotifyScreenInfoChanged();
+}
+
+bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) {
   gfx::Display display =
       gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view);
   if (current_display_area_ == display.work_area() &&
       current_device_scale_factor_ == display.device_scale_factor()) {
-    return;
+    return false;
   }
   current_display_area_ = display.work_area();
   current_device_scale_factor_ = display.device_scale_factor();
-  if (impl)
-    impl->NotifyScreenInfoChanged();
+  return true;
 }
 
 SmoothScrollGesture* RenderWidgetHostViewBase::CreateSmoothScrollGesture(
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 895bf41..2efd132 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -88,6 +88,10 @@
   // Notification that a resize or move session ended on the native widget.
   void UpdateScreenInfo(gfx::NativeView view);
 
+  // Tells if the display property (work area/scale factor) has
+  // changed since the last time.
+  bool HasDisplayPropertyChanged(gfx::NativeView view);
+
 #if defined(OS_WIN)
   // The callback that DetachPluginsHelper calls for each child window. Call
   // this directly if you want to do custom filtering on plugin windows first.
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 8916d05..50a658a 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -18,7 +18,6 @@
 #include "base/debug/trace_event.h"
 #include "base/i18n/rtl.h"
 #include "base/metrics/histogram.h"
-#include "base/process_util.h"
 #include "base/threading/thread.h"
 #include "base/win/metro.h"
 #include "base/win/scoped_comptr.h"
@@ -34,6 +33,7 @@
 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
 #include "content/browser/renderer_host/backing_store.h"
 #include "content/browser/renderer_host/backing_store_win.h"
+#include "content/browser/renderer_host/input/web_input_event_builders_win.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/browser/renderer_host/ui_events_helper.h"
@@ -54,7 +54,6 @@
 #include "skia/ext/skia_utils_win.h"
 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
 #include "third_party/WebKit/public/web/WebInputEvent.h"
-#include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
 #include "third_party/skia/include/core/SkRegion.h"
 #include "ui/base/events/event.h"
 #include "ui/base/events/event_utils.h"
@@ -80,7 +79,6 @@
 using base::TimeTicks;
 using ui::ViewProp;
 using WebKit::WebInputEvent;
-using WebKit::WebInputEventFactory;
 using WebKit::WebMouseEvent;
 using WebKit::WebTextDirection;
 
@@ -2008,7 +2006,7 @@
 
   if (render_widget_host_) {
     WebKit::WebMouseWheelEvent wheel_event =
-        WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, lparam);
+        WebMouseWheelEventBuilder::Build(m_hWnd, message, wparam, lparam);
     float scale = ui::win::GetDeviceScaleFactor();
     wheel_event.x /= scale;
     wheel_event.y /= scale;
@@ -2903,7 +2901,7 @@
   lparam = MAKELPARAM(point.x(), point.y());
 
   WebMouseEvent event(
-      WebInputEventFactory::mouseEvent(m_hWnd, message, wparam, lparam));
+      WebMouseEventBuilder::Build(m_hWnd, message, wparam, lparam));
 
   if (mouse_locked_) {
     event.movementX = event.globalX - last_mouse_position_.locked_global.x();
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index 7641261..7783e80 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -24,17 +24,6 @@
 namespace content {
 
 namespace {
-// Normally this is done by the NavigationController, but we'll fake it out
-// here for testing.
-SessionStorageNamespaceImpl* CreateSessionStorageNamespace(
-    SiteInstance* instance) {
-  RenderProcessHost* process_host = instance->GetProcess();
-  DOMStorageContext* dom_storage_context =
-      BrowserContext::GetStoragePartition(process_host->GetBrowserContext(),
-                                          instance)->GetDOMStorageContext();
-  return new SessionStorageNamespaceImpl(
-      static_cast<DOMStorageContextImpl*>(dom_storage_context));
-}
 
 const int64 kFrameId = 13UL;
 
@@ -258,8 +247,7 @@
                          widget_delegate,
                          routing_id,
                          main_frame_routing_id,
-                         swapped_out,
-                         CreateSessionStorageNamespace(instance)),
+                         swapped_out),
       render_view_created_(false),
       delete_counter_(NULL),
       simulate_fetch_via_proxy_(false),
diff --git a/content/browser/renderer_host/web_input_event_aurawin.cc b/content/browser/renderer_host/web_input_event_aurawin.cc
index 4264c00..771b792 100644
--- a/content/browser/renderer_host/web_input_event_aurawin.cc
+++ b/content/browser/renderer_host/web_input_event_aurawin.cc
@@ -6,7 +6,7 @@
 
 #include "base/event_types.h"
 #include "base/logging.h"
-#include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
+#include "content/browser/renderer_host/input/web_input_event_builders_win.h"
 
 namespace content {
 
@@ -15,26 +15,26 @@
 
 WebKit::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent(
     base::NativeEvent native_event) {
-  return WebKit::WebInputEventFactory::mouseEvent(native_event.hwnd,
-                                                  native_event.message,
-                                                  native_event.wParam,
-                                                  native_event.lParam);
+  return WebMouseEventBuilder::Build(native_event.hwnd,
+                                     native_event.message,
+                                     native_event.wParam,
+                                     native_event.lParam);
 }
 
 WebKit::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent(
     base::NativeEvent native_event) {
-  return WebKit::WebInputEventFactory::mouseWheelEvent(native_event.hwnd,
-                                                       native_event.message,
-                                                       native_event.wParam,
-                                                       native_event.lParam);
+  return WebMouseWheelEventBuilder::Build(native_event.hwnd,
+                                          native_event.message,
+                                          native_event.wParam,
+                                          native_event.lParam);
 }
 
 WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent(
     base::NativeEvent native_event) {
-  return WebKit::WebInputEventFactory::keyboardEvent(native_event.hwnd,
-                                                     native_event.message,
-                                                     native_event.wParam,
-                                                     native_event.lParam);
+  return WebKeyboardEventBuilder::Build(native_event.hwnd,
+                                        native_event.message,
+                                        native_event.wParam,
+                                        native_event.lParam);
 }
 
 WebKit::WebGestureEvent MakeWebGestureEventFromNativeEvent(
diff --git a/content/browser/speech/proto/speech_proto.target.darwin-arm.mk b/content/browser/speech/proto/speech_proto.target.darwin-arm.mk
index 54b7c88..38bb5da 100644
--- a/content/browser/speech/proto/speech_proto.target.darwin-arm.mk
+++ b/content/browser/speech/proto/speech_proto.target.darwin-arm.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/speech/proto/speech_proto.target.darwin-mips.mk b/content/browser/speech/proto/speech_proto.target.darwin-mips.mk
index ee0729c..d392272 100644
--- a/content/browser/speech/proto/speech_proto.target.darwin-mips.mk
+++ b/content/browser/speech/proto/speech_proto.target.darwin-mips.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/speech/proto/speech_proto.target.darwin-x86.mk b/content/browser/speech/proto/speech_proto.target.darwin-x86.mk
index 5d0b4cc..4c058d4 100644
--- a/content/browser/speech/proto/speech_proto.target.darwin-x86.mk
+++ b/content/browser/speech/proto/speech_proto.target.darwin-x86.mk
@@ -101,10 +101,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -191,10 +191,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/speech/proto/speech_proto.target.linux-arm.mk b/content/browser/speech/proto/speech_proto.target.linux-arm.mk
index 54b7c88..38bb5da 100644
--- a/content/browser/speech/proto/speech_proto.target.linux-arm.mk
+++ b/content/browser/speech/proto/speech_proto.target.linux-arm.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/speech/proto/speech_proto.target.linux-mips.mk b/content/browser/speech/proto/speech_proto.target.linux-mips.mk
index ee0729c..d392272 100644
--- a/content/browser/speech/proto/speech_proto.target.linux-mips.mk
+++ b/content/browser/speech/proto/speech_proto.target.linux-mips.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/speech/proto/speech_proto.target.linux-x86.mk b/content/browser/speech/proto/speech_proto.target.linux-x86.mk
index 5d0b4cc..4c058d4 100644
--- a/content/browser/speech/proto/speech_proto.target.linux-x86.mk
+++ b/content/browser/speech/proto/speech_proto.target.linux-x86.mk
@@ -101,10 +101,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -191,10 +191,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/content/browser/tcmalloc_internals_request_job.h b/content/browser/tcmalloc_internals_request_job.h
index 03912d1..20b2d4f 100644
--- a/content/browser/tcmalloc_internals_request_job.h
+++ b/content/browser/tcmalloc_internals_request_job.h
@@ -8,7 +8,7 @@
 #include <map>
 #include "base/basictypes.h"
 #include "base/memory/singleton.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "build/build_config.h"  // USE_TCMALLOC
 #include "net/url_request/url_request_simple_job.h"
 
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index 6e9dfa7..db062c5 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -58,6 +58,8 @@
 // are many globals used in the utility process.
 static base::LazyInstance<base::Lock> g_one_utility_thread_lock;
 
+// Single process not supported in multiple dll mode currently.
+#if !defined(CHROME_MULTIPLE_DLL)
 class UtilityMainThread : public base::Thread {
  public:
   UtilityMainThread(const std::string& channel_id)
@@ -98,6 +100,7 @@
 
   DISALLOW_COPY_AND_ASSIGN(UtilityMainThread);
 };
+#endif  // !CHROME_MULTIPLE_DLL
 
 UtilityProcessHost* UtilityProcessHost::Create(
     UtilityProcessHostClient* client,
@@ -193,12 +196,16 @@
   if (channel_id.empty())
     return false;
 
+  // Single process not supported in multiple dll mode currently.
+#if !defined(CHROME_MULTIPLE_DLL)
   if (RenderProcessHost::run_renderer_in_process()) {
     // See comment in RenderProcessHostImpl::Init() for the background on why we
     // support single process mode this way.
     in_process_thread_.reset(new UtilityMainThread(channel_id));
     in_process_thread_->Start();
-  } else {
+  } else
+#endif  // !CHROME_MULTIPLE_DLL
+  {
     const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
     int child_flags = child_flags_;
 
diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h
index 45d2b3f..6eecd3d 100644
--- a/content/browser/utility_process_host_impl.h
+++ b/content/browser/utility_process_host_impl.h
@@ -83,8 +83,10 @@
 
   scoped_ptr<BrowserChildProcessHostImpl> process_;
 
+#if !defined(CHROME_MULTIPLE_DLL)
   // Used in single-process mode instead of process_.
   scoped_ptr<UtilityMainThread> in_process_thread_;
+#endif
 
   DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl);
 };
diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc
index 4acea35..f08b0c9 100644
--- a/content/browser/web_contents/interstitial_page_impl.cc
+++ b/content/browser/web_contents/interstitial_page_impl.cc
@@ -493,7 +493,7 @@
   DOMStorageContextImpl* dom_storage_context =
       static_cast<DOMStorageContextImpl*>(BrowserContext::GetStoragePartition(
           browser_context, site_instance.get())->GetDOMStorageContext());
-  SessionStorageNamespaceImpl* session_storage_namespace_impl =
+  session_storage_namespace_ =
       new SessionStorageNamespaceImpl(dom_storage_context);
 
   RenderViewHostImpl* render_view_host =
@@ -502,8 +502,7 @@
                              this,
                              MSG_ROUTING_NONE,
                              MSG_ROUTING_NONE,
-                             false,
-                             session_storage_namespace_impl);
+                             false);
   web_contents_->RenderViewForInterstitialPageCreated(render_view_host);
   return render_view_host;
 }
@@ -704,6 +703,11 @@
       << "InterstitialPage does not support showing full screen popups.";
 }
 
+SessionStorageNamespace* InterstitialPageImpl::GetSessionStorageNamespace(
+    SiteInstance* instance) {
+  return session_storage_namespace_.get();
+}
+
 void InterstitialPageImpl::Disable() {
   enabled_ = false;
 }
diff --git a/content/browser/web_contents/interstitial_page_impl.h b/content/browser/web_contents/interstitial_page_impl.h
index be4bd8c..1f4d94f 100644
--- a/content/browser/web_contents/interstitial_page_impl.h
+++ b/content/browser/web_contents/interstitial_page_impl.h
@@ -8,7 +8,6 @@
 #include "base/compiler_specific.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process_util.h"
 #include "content/browser/renderer_host/render_view_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
 #include "content/public/browser/interstitial_page.h"
@@ -129,6 +128,9 @@
                                  const gfx::Rect& initial_pos) OVERRIDE;
   virtual void ShowCreatedFullscreenWidget(int route_id) OVERRIDE;
 
+  virtual SessionStorageNamespace* GetSessionStorageNamespace(
+      SiteInstance* instance) OVERRIDE;
+
   // RenderWidgetHostDelegate implementation:
   virtual void RenderWidgetDeleted(
       RenderWidgetHostImpl* render_widget_host) OVERRIDE;
@@ -241,6 +243,8 @@
 
   base::WeakPtrFactory<InterstitialPageImpl> weak_ptr_factory_;
 
+  scoped_refptr<SessionStorageNamespace> session_storage_namespace_;
+
   DISALLOW_COPY_AND_ASSIGN(InterstitialPageImpl);
 };
 
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index e593397..6176606 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -600,11 +600,13 @@
   GoToIndex(GetIndexForOffset(offset));
 }
 
-void NavigationControllerImpl::RemoveEntryAtIndex(int index) {
-  if (index == last_committed_entry_index_)
-    return;
+bool NavigationControllerImpl::RemoveEntryAtIndex(int index) {
+  if (index == last_committed_entry_index_ ||
+      index == pending_entry_index_)
+    return false;
 
   RemoveEntryAtIndexInternal(index);
+  return true;
 }
 
 void NavigationControllerImpl::UpdateVirtualURLToURL(
diff --git a/content/browser/web_contents/navigation_controller_impl.h b/content/browser/web_contents/navigation_controller_impl.h
index f0fd491..c95ef45 100644
--- a/content/browser/web_contents/navigation_controller_impl.h
+++ b/content/browser/web_contents/navigation_controller_impl.h
@@ -69,7 +69,7 @@
   virtual void GoForward() OVERRIDE;
   virtual void GoToIndex(int index) OVERRIDE;
   virtual void GoToOffset(int offset) OVERRIDE;
-  virtual void RemoveEntryAtIndex(int index) OVERRIDE;
+  virtual bool RemoveEntryAtIndex(int index) OVERRIDE;
   virtual const SessionStorageNamespaceMap&
       GetSessionStorageNamespaceMap() const OVERRIDE;
   virtual SessionStorageNamespace*
diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc
index 2c327f2..a1904d0 100644
--- a/content/browser/web_contents/navigation_controller_impl_unittest.cc
+++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc
@@ -2398,20 +2398,25 @@
   test_rvh()->SendNavigate(4, url5);
 
   // Try to remove the last entry.  Will fail because it is the current entry.
-  controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1);
+  EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
   EXPECT_EQ(5, controller.GetEntryCount());
   EXPECT_EQ(4, controller.GetLastCommittedEntryIndex());
 
-  // Go back and remove the last entry.
+  // Go back, but don't commit yet. Check that we can't delete the current
+  // and pending entries.
   controller.GoBack();
+  EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
+  EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 2));
+
+  // Now commit and delete the last entry.
   test_rvh()->SendNavigate(3, url4);
-  controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1);
+  EXPECT_TRUE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
   EXPECT_EQ(4, controller.GetEntryCount());
   EXPECT_EQ(3, controller.GetLastCommittedEntryIndex());
   EXPECT_FALSE(controller.GetPendingEntry());
 
   // Remove an entry which is not the last committed one.
-  controller.RemoveEntryAtIndex(0);
+  EXPECT_TRUE(controller.RemoveEntryAtIndex(0));
   EXPECT_EQ(3, controller.GetEntryCount());
   EXPECT_EQ(2, controller.GetLastCommittedEntryIndex());
   EXPECT_FALSE(controller.GetPendingEntry());
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index 4c93537..4201eb8 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -83,9 +83,7 @@
   render_view_host_ = static_cast<RenderViewHostImpl*>(
       RenderViewHostFactory::Create(
           site_instance, render_view_delegate_, render_widget_delegate_,
-          routing_id, main_frame_routing_id, false, delegate_->
-          GetControllerForRenderManager().GetSessionStorageNamespace(
-              site_instance)));
+          routing_id, main_frame_routing_id, false));
 
   // Keep track of renderer processes as they start to shut down or are
   // crashed/killed.
@@ -661,10 +659,11 @@
     // Create a new RenderViewHost if we don't find an existing one.
     new_render_view_host = static_cast<RenderViewHostImpl*>(
         RenderViewHostFactory::Create(instance,
-            render_view_delegate_, render_widget_delegate_, MSG_ROUTING_NONE,
-            MSG_ROUTING_NONE, swapped_out, delegate_->
-            GetControllerForRenderManager().GetSessionStorageNamespace(
-                instance)));
+                                      render_view_delegate_,
+                                      render_widget_delegate_,
+                                      MSG_ROUTING_NONE,
+                                      MSG_ROUTING_NONE,
+                                      swapped_out));
 
     // If the new RVH is swapped out already, store it.  Otherwise prevent the
     // process from exiting while we're trying to navigate in it.
diff --git a/content/browser/web_contents/touch_editable_impl_aura.cc b/content/browser/web_contents/touch_editable_impl_aura.cc
index 5731b63..fb430d0 100644
--- a/content/browser/web_contents/touch_editable_impl_aura.cc
+++ b/content/browser/web_contents/touch_editable_impl_aura.cc
@@ -113,6 +113,7 @@
       static_cast<const ui::GestureEvent*>(event);
   switch (event->type()) {
     case ui::ET_GESTURE_TAP:
+      tap_gesture_tap_count_queue_.push(gesture_event->details().tap_count());
       if (gesture_event->details().tap_count() > 1)
         selection_gesture_in_process_ = true;
       // When the user taps, we want to show touch editing handles if user
@@ -131,9 +132,10 @@
       }
       // For single taps, not inside selected region, we want to show handles
       // only when the tap is on an already focused textfield.
+      is_tap_on_focused_textfield_ = false;
       if (gesture_event->details().tap_count() == 1 &&
           text_input_type_ != ui::TEXT_INPUT_TYPE_NONE)
-        selection_gesture_in_process_ = true;
+        is_tap_on_focused_textfield_ = true;
       break;
     case ui::ET_GESTURE_LONG_PRESS:
       selection_gesture_in_process_ = true;
@@ -166,15 +168,19 @@
   DCHECK(rwhva_);
   if (gesture_event_type == WebKit::WebInputEvent::GestureTap &&
       text_input_type_ != ui::TEXT_INPUT_TYPE_NONE &&
-      selection_gesture_in_process_) {
+      is_tap_on_focused_textfield_) {
     StartTouchEditing();
     if (touch_selection_controller_)
       touch_selection_controller_->SelectionChanged();
   }
 
-  if (gesture_event_type == WebKit::WebInputEvent::GestureLongPress ||
-      gesture_event_type == WebKit::WebInputEvent::GestureTap)
+  if (gesture_event_type == WebKit::WebInputEvent::GestureLongPress)
     selection_gesture_in_process_ = false;
+  if (gesture_event_type == WebKit::WebInputEvent::GestureTap) {
+    if (tap_gesture_tap_count_queue_.front() > 1)
+      selection_gesture_in_process_ = false;
+    tap_gesture_tap_count_queue_.pop();
+  }
 }
 
 void TouchEditableImplAura::OnViewDestroyed() {
@@ -323,7 +329,8 @@
     : text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
       rwhva_(NULL),
       selection_gesture_in_process_(false),
-      handles_hidden_due_to_scroll_(false) {
+      handles_hidden_due_to_scroll_(false),
+      is_tap_on_focused_textfield_(false) {
 }
 
 void TouchEditableImplAura::Cleanup() {
diff --git a/content/browser/web_contents/touch_editable_impl_aura.h b/content/browser/web_contents/touch_editable_impl_aura.h
index 18c4009..c31d86a 100644
--- a/content/browser/web_contents/touch_editable_impl_aura.h
+++ b/content/browser/web_contents/touch_editable_impl_aura.h
@@ -84,11 +84,20 @@
   scoped_ptr<ui::TouchSelectionController> touch_selection_controller_;
 
   // True if |rwhva_| is currently handling a gesture that could result in a
-  // change in selection.
+  // change in selection (long press, double tap or triple tap).
   bool selection_gesture_in_process_;
 
   bool handles_hidden_due_to_scroll_;
 
+  // Used to track if the current tap gesture is on a focused textfield.
+  bool is_tap_on_focused_textfield_;
+
+  // When we receive ack for a ET_GESTURE_TAP, we do not know if the ack is for
+  // a tap or a double tap (we only get the event type in the ack). So we have
+  // this queue to keep track of the the tap count so that we can distinguish
+  // between double and single tap when we get the ack.
+  std::queue<int> tap_gesture_tap_count_queue_;
+
   DISALLOW_COPY_AND_ASSIGN(TouchEditableImplAura);
 };
 
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 163a118..71dc1df 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1437,9 +1437,17 @@
     int main_frame_route_id,
     const ViewHostMsg_CreateWindow_Params& params,
     SessionStorageNamespace* session_storage_namespace) {
-  if (delegate_ && !delegate_->ShouldCreateWebContents(
-          this, route_id, params.window_container_type, params.frame_name,
-          params.target_url, params.disposition, params.user_gesture)) {
+  if (delegate_ &&
+      !delegate_->ShouldCreateWebContents(this,
+                                          route_id,
+                                          params.window_container_type,
+                                          params.frame_name,
+                                          params.target_url,
+                                          params.referrer,
+                                          params.disposition,
+                                          params.features,
+                                          params.user_gesture,
+                                          params.opener_suppressed)) {
     GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id);
     GetRenderViewHost()->GetProcess()->ResumeRequestsForView(
         main_frame_route_id);
@@ -1698,6 +1706,11 @@
     callback.Run(MediaStreamDevices(), scoped_ptr<MediaStreamUI>());
 }
 
+SessionStorageNamespace* WebContentsImpl::GetSessionStorageNamespace(
+    SiteInstance* instance) {
+  return controller_.GetSessionStorageNamespace(instance);
+}
+
 void WebContentsImpl::DidSendScreenRects(RenderWidgetHostImpl* rwh) {
   if (browser_plugin_embedder_)
     browser_plugin_embedder_->DidSendScreenRects();
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 240f6ea..05b7bde 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -13,7 +13,7 @@
 #include "base/gtest_prod_util.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/observer_list.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/values.h"
 #include "content/browser/renderer_host/render_view_host_delegate.h"
 #include "content/browser/renderer_host/render_widget_host_delegate.h"
@@ -451,6 +451,8 @@
   virtual void RequestMediaAccessPermission(
       const MediaStreamRequest& request,
       const MediaResponseCallback& callback) OVERRIDE;
+  virtual SessionStorageNamespace* GetSessionStorageNamespace(
+      SiteInstance* instance) OVERRIDE;
 
   // RenderWidgetHostDelegate --------------------------------------------------
 
diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
index c7c48f6..bb84e62 100644
--- a/content/browser/zygote_host/zygote_host_impl_linux.cc
+++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
@@ -22,7 +22,8 @@
 #include "base/path_service.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/posix/unix_domain_socket_linux.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
+#include "base/process/memory.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/content/browser/zygote_host/zygote_host_impl_linux.h b/content/browser/zygote_host/zygote_host_impl_linux.h
index 1872840..9027fe7 100644
--- a/content/browser/zygote_host/zygote_host_impl_linux.h
+++ b/content/browser/zygote_host/zygote_host_impl_linux.h
@@ -9,7 +9,7 @@
 #include <vector>
 
 #include "base/pickle.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/synchronization/lock.h"
 #include "content/public/browser/file_descriptor_info.h"
 #include "content/public/browser/zygote_host_linux.h"
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index 859d2b2..05650ad 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -195,6 +195,12 @@
   g_lazy_tls.Pointer()->Set(NULL);
 }
 
+void ChildThread::Shutdown() {
+  // Delete objects that hold references to blink so derived classes can
+  // safely shutdown blink in their Shutdown implementation.
+  file_system_dispatcher_.reset();
+}
+
 void ChildThread::OnChannelConnected(int32 peer_pid) {
   channel_connected_factory_.InvalidateWeakPtrs();
 }
diff --git a/content/child/child_thread.h b/content/child/child_thread.h
index aa04e2e..eb060ee 100644
--- a/content/child/child_thread.h
+++ b/content/child/child_thread.h
@@ -50,7 +50,7 @@
   // has a thread that post tasks to ChildProcess::main_thread(), that thread
   // should be joined in Shutdown().
   virtual ~ChildThread();
-  virtual void Shutdown() = 0;
+  virtual void Shutdown();
 
   // IPC::Sender implementation:
   virtual bool Send(IPC::Message* msg) OVERRIDE;
diff --git a/content/common/DEPS b/content/common/DEPS
index afff5e3..2e11e26 100644
--- a/content/common/DEPS
+++ b/content/common/DEPS
@@ -39,6 +39,7 @@
   "+third_party/WebKit/public/web/WebPopupType.h",
   "+third_party/WebKit/public/web/WebScreenInfo.h",
   "+third_party/WebKit/public/web/WebTextDirection.h",
+  "+third_party/WebKit/public/web/WebWindowFeatures.h",
 
   # These should be burned down. http://crbug.com/237267
   "!third_party/WebKit/public/platform/WebHTTPBody.h",
diff --git a/content/common/browser_plugin/browser_plugin_constants.cc b/content/common/browser_plugin/browser_plugin_constants.cc
index 3752bb4..bd20b85 100644
--- a/content/common/browser_plugin/browser_plugin_constants.cc
+++ b/content/common/browser_plugin/browser_plugin_constants.cc
@@ -44,6 +44,7 @@
 const char kAttributeSrc[] = "src";
 
 // Events.
+const char kEventDialog[] = "dialog";
 const char kEventNewWindow[] = "newwindow";
 const char kEventRequestPermission[] = "permissionrequest";
 const char kEventResponsive[] = "responsive";
@@ -51,17 +52,21 @@
 const char kEventUnresponsive[] = "unresponsive";
 
 // Parameters/properties on events.
+const char kDefaultPromptText[] = "defaultPromptText";
 const char kId[] = "id";
 const char kInitialHeight[] = "initialHeight";
 const char kInitialWidth[] = "initialWidth";
 const char kIsTopLevel[] = "isTopLevel";
 const char kLastUnlockedBySelf[] = "lastUnlockedBySelf";
+const char kMessageText[] = "messageText";
+const char kMessageType[] = "messageType";
 const char kName[] = "name";
 const char kNewHeight[] = "newHeight";
 const char kNewWidth[] = "newWidth";
 const char kOldHeight[] = "oldHeight";
 const char kOldWidth[] = "oldWidth";
 const char kPermission[] = "permission";
+const char kPermissionTypeDialog[] = "dialog";
 const char kPermissionTypeDownload[] = "download";
 const char kPermissionTypeGeolocation[] = "geolocation";
 const char kPermissionTypeMedia[] = "media";
diff --git a/content/common/browser_plugin/browser_plugin_constants.h b/content/common/browser_plugin/browser_plugin_constants.h
index 4ffa7aa..ba8dd06 100644
--- a/content/common/browser_plugin/browser_plugin_constants.h
+++ b/content/common/browser_plugin/browser_plugin_constants.h
@@ -44,6 +44,7 @@
 extern const char kAttributeSrc[];
 
 // Events.
+extern const char kEventDialog[];
 extern const char kEventNewWindow[];
 extern const char kEventRequestPermission[];
 extern const char kEventResponsive[];
@@ -51,17 +52,21 @@
 extern const char kEventUnresponsive[];
 
 // Parameters/properties on events.
+extern const char kDefaultPromptText[];
 extern const char kId[];
 extern const char kInitialHeight[];
 extern const char kInitialWidth[];
 extern const char kIsTopLevel[];
 extern const char kLastUnlockedBySelf[];
+extern const char kMessageText[];
+extern const char kMessageType[];
 extern const char kName[];
 extern const char kNewHeight[];
 extern const char kNewWidth[];
 extern const char kOldHeight[];
 extern const char kOldWidth[];
 extern const char kPermission[];
+extern const char kPermissionTypeDialog[];
 extern const char kPermissionTypeDownload[];
 extern const char kPermissionTypeGeolocation[];
 extern const char kPermissionTypeMedia[];
diff --git a/content/common/browser_plugin/browser_plugin_message_enums.h b/content/common/browser_plugin/browser_plugin_message_enums.h
index 9fe045a..b0503a7 100644
--- a/content/common/browser_plugin/browser_plugin_message_enums.h
+++ b/content/common/browser_plugin/browser_plugin_message_enums.h
@@ -27,6 +27,12 @@
   // API is sufficiently similar that it's convenient to consider it a
   // permission type for code reuse.
   BrowserPluginPermissionTypeNewWindow,
+
+  // JavaScript Dialogs: prompt, alert, confirm
+  // Note: Even through dialogs do not use the permission API, the dialog API
+  // is sufficiently similiar that it's convenient to consider it a permission
+  // type for code reuse.
+  BrowserPluginPermissionTypeJavaScriptDialog
 };
 
 #endif  // CONTENT_COMMON_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_ENUMS_H_
diff --git a/content/common/browser_plugin/browser_plugin_messages.h b/content/common/browser_plugin/browser_plugin_messages.h
index b3d5669..a91f92f 100644
--- a/content/common/browser_plugin/browser_plugin_messages.h
+++ b/content/common/browser_plugin/browser_plugin_messages.h
@@ -253,11 +253,13 @@
 // Note that |allow| = true does not readily mean that the guest will be granted
 // permission, since a security check in the embedder might follow. For example
 // for media access permission, the guest will be granted permission only if its
-// embedder also has access.
-IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_RespondPermission,
+// embedder also has access. For certain APIs, such as the Dialog API,
+// additional information may be passed by the developer through |user_input|.
+IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_RespondPermission,
                     int /* instance_id */,
                     int /* request_id */,
-                    bool /* allow */)
+                    bool /* allow */,
+                    std::string /* user_input */)
 
 // Sends a PointerLock Lock ACK to the BrowserPluginGuest.
 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_LockMouse_ACK,
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc
index 22d5f03..e8afdd1 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -195,20 +195,24 @@
             int32 row_stride_bytes_,
             unsigned char* pixels_,
             const base::Callback<void(bool)>& callback_)
-        : size(size_),
+        : done(false),
+          size(size_),
           bytes_per_row(bytes_per_row_),
           row_stride_bytes(row_stride_bytes_),
           pixels(pixels_),
           callback(callback_),
-          buffer(0) {
+          buffer(0),
+          query(0) {
     }
 
+    bool done;
     gfx::Size size;
     int bytes_per_row;
     int row_stride_bytes;
     unsigned char* pixels;
     base::Callback<void(bool)> callback;
     GLuint buffer;
+    WebKit::WebGLId query;
   };
 
   // A readback pipeline that also converts the data to YUV before
@@ -301,7 +305,7 @@
                        GLHelper::ScalerQuality quality);
 
   static void nullcallback(bool success) {}
-  void ReadbackDone(Request* request);
+  void ReadbackDone(Request *request);
   void FinishRequest(Request* request, bool result);
   void CancelRequests();
 
@@ -389,12 +393,16 @@
                        NULL,
                        GL_STREAM_READ);
 
+  request->query = context_->createQueryEXT();
+  context_->beginQueryEXT(GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM,
+                          request->query);
   context_->readPixels(0, 0, dst_size.width(), dst_size.height(),
                        GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+  context_->endQueryEXT(GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM);
   context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
-  cc::SyncPointHelper::SignalSyncPoint(
+  cc::SyncPointHelper::SignalQuery(
       context_,
-      context_->insertSyncPoint(),
+      request->query,
       base::Bind(&CopyTextureToImpl::ReadbackDone, AsWeakPtr(), request));
 }
 
@@ -472,45 +480,59 @@
                       quality);
 }
 
-void GLHelper::CopyTextureToImpl::ReadbackDone(Request* request) {
+void GLHelper::CopyTextureToImpl::ReadbackDone(Request* finished_request) {
   TRACE_EVENT0("mirror",
                "GLHelper::CopyTextureToImpl::CheckReadbackFramebufferComplete");
-  DCHECK(request == request_queue_.front());
+  finished_request->done = true;
 
-  bool result = false;
-  if (request->buffer != 0) {
-    context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
-                         request->buffer);
-    unsigned char* data = static_cast<unsigned char *>(
-        context_->mapBufferCHROMIUM(
-            GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY));
-    if (data) {
-      result = true;
-      if (request->bytes_per_row == request->size.width() * 4 &&
-          request->bytes_per_row == request->row_stride_bytes) {
-        memcpy(request->pixels, data, request->size.GetArea() * 4);
-      } else {
-        unsigned char* out = request->pixels;
-        for (int y = 0; y < request->size.height(); y++) {
-          memcpy(out, data, request->bytes_per_row);
-          out += request->row_stride_bytes;
-          data += request->size.width() * 4;
-        }
-      }
-      context_->unmapBufferCHROMIUM(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM);
+  // We process transfer requests in the order they were received, regardless
+  // of the order we get the callbacks in.
+  while (!request_queue_.empty()) {
+    Request* request = request_queue_.front();
+    if (!request->done) {
+      break;
     }
-    context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
-  }
 
-  FinishRequest(request, result);
+    bool result = false;
+    if (request->buffer != 0) {
+      context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
+                           request->buffer);
+      unsigned char* data = static_cast<unsigned char *>(
+          context_->mapBufferCHROMIUM(
+              GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, GL_READ_ONLY));
+      if (data) {
+        result = true;
+        if (request->bytes_per_row == request->size.width() * 4 &&
+            request->bytes_per_row == request->row_stride_bytes) {
+          memcpy(request->pixels, data, request->size.GetArea() * 4);
+        } else {
+          unsigned char* out = request->pixels;
+          for (int y = 0; y < request->size.height(); y++) {
+            memcpy(out, data, request->bytes_per_row);
+            out += request->row_stride_bytes;
+            data += request->size.width() * 4;
+          }
+        }
+        context_->unmapBufferCHROMIUM(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM);
+      }
+      context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
+    }
+
+    FinishRequest(request, result);
+  }
 }
 
 void GLHelper::CopyTextureToImpl::FinishRequest(Request* request,
                                                 bool result) {
+  TRACE_EVENT0("mirror", "GLHelper::CopyTextureToImpl::FinishRequest");
   DCHECK(request_queue_.front() == request);
   request_queue_.pop();
   request->callback.Run(result);
   ScopedFlush flush(context_);
+  if (request->query != 0) {
+    context_->deleteQueryEXT(request->query);
+    request->query = 0;
+  }
   if (request->buffer != 0) {
     context_->deleteBuffer(request->buffer);
     request->buffer = 0;
diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc
index 6940d12..ee2b2b6 100644
--- a/content/common/gpu/gpu_memory_manager.cc
+++ b/content/common/gpu/gpu_memory_manager.cc
@@ -70,6 +70,9 @@
 #if defined(OS_ANDROID)
   bytes_default_per_client_ = 16 * 1024 * 1024;
   bytes_minimum_per_client_ = 16 * 1024 * 1024;
+#elif defined(OS_CHROMEOS)
+  bytes_default_per_client_ = 64 * 1024 * 1024;
+  bytes_minimum_per_client_ = 4 * 1024 * 1024;
 #else
   bytes_default_per_client_ = 64 * 1024 * 1024;
   bytes_minimum_per_client_ = 64 * 1024 * 1024;
diff --git a/content/common/gpu/gpu_memory_manager_unittest.cc b/content/common/gpu/gpu_memory_manager_unittest.cc
index 2c601c9..263c585 100644
--- a/content/common/gpu/gpu_memory_manager_unittest.cc
+++ b/content/common/gpu/gpu_memory_manager_unittest.cc
@@ -456,44 +456,6 @@
   EXPECT_TRUE(IsAllocationHibernatedForSurfaceNo(stub4.allocation_));
 }
 
-// Test GpuMemoryAllocation memory allocation bonuses:
-// When the number of visible tabs is small, each tab should get a
-// gpu_resource_size_in_bytes allocation value that is greater than
-// GetMinimumClientAllocation(), and when the number of tabs is large,
-// each should get exactly GetMinimumClientAllocation() and not less.
-TEST_F(GpuMemoryManagerTest, TestForegroundStubsGetBonusAllocation) {
-  size_t max_stubs_before_no_bonus = static_cast<size_t>(
-      GetAvailableGpuMemory() / (GetMinimumClientAllocation() + 1));
-
-  std::vector<FakeClient*> stubs;
-  for (size_t i = 0; i < max_stubs_before_no_bonus; ++i) {
-    stubs.push_back(
-        new FakeClient(&memmgr_, GenerateUniqueSurfaceId(), true));
-  }
-
-  Manage();
-  for (size_t i = 0; i < stubs.size(); ++i) {
-    EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stubs[i]->allocation_));
-    EXPECT_GT(
-        stubs[i]->allocation_.renderer_allocation.bytes_limit_when_visible,
-        GetMinimumClientAllocation());
-  }
-
-  FakeClient extra_stub(&memmgr_, GenerateUniqueSurfaceId(), true);
-
-  Manage();
-  for (size_t i = 0; i < stubs.size(); ++i) {
-    EXPECT_TRUE(IsAllocationForegroundForSurfaceYes(stubs[i]->allocation_));
-    EXPECT_EQ(
-        stubs[i]->allocation_.renderer_allocation.bytes_limit_when_visible,
-        GetMinimumClientAllocation());
-  }
-
-  for (size_t i = 0; i < max_stubs_before_no_bonus; ++i) {
-    delete stubs[i];
-  }
-}
-
 // Test GpuMemoryManager::UpdateAvailableGpuMemory functionality
 TEST_F(GpuMemoryManagerTest, TestUpdateAvailableGpuMemory) {
   FakeClient stub1(&memmgr_, GenerateUniqueSurfaceId(), true),
diff --git a/content/common/gpu/media/rendering_helper.h b/content/common/gpu/media/rendering_helper.h
index 170076b..2986ad3 100644
--- a/content/common/gpu/media/rendering_helper.h
+++ b/content/common/gpu/media/rendering_helper.h
@@ -16,20 +16,39 @@
 
 namespace content {
 
+struct RenderingHelperParams {
+  RenderingHelperParams();
+  ~RenderingHelperParams();
+
+  bool suppress_swap_to_display;
+  int num_windows;
+  // Dimensions of window(s) created for displaying frames. In the
+  // case of thumbnail rendering, these won't match the frame dimensions.
+  std::vector<gfx::Size> window_dimensions;
+  // Dimensions of video frame texture(s).
+  std::vector<gfx::Size> frame_dimensions;
+  // Whether the frames are rendered as scaled thumbnails within a
+  // larger FBO that is in turn rendered to the window.
+  bool render_as_thumbnails;
+  // The size of the FBO containing all visible thumbnails.
+  gfx::Size thumbnails_page_size;
+  // The size of each thumbnail within the FBO.
+  gfx::Size thumbnail_size;
+};
+
 // Creates and draws textures used by the video decoder.
 // This class is not thread safe and thus all the methods of this class
 // (except for ctor/dtor) ensure they're being run on a single thread.
 class RenderingHelper {
  public:
-  // Create a platform specifc implementation this object.
+  // Create a platform specific implementation of this object.
   static RenderingHelper* Create();
 
   RenderingHelper() {}
   virtual ~RenderingHelper() {}
 
   // Create the render context and windows by the specified dimensions.
-  virtual void Initialize(int num_windows,
-                          const std::vector<gfx::Size>& dimensions,
+  virtual void Initialize(const RenderingHelperParams& params,
                           base::WaitableEvent* done) = 0;
 
   // Undo the effects of Initialize() and signal |*done|.
@@ -53,6 +72,12 @@
 
   // Get the platform specific handle to the OpenGL display.
   virtual void* GetGLDisplay() = 0;
+
+  // Get rendered thumbnails as RGB.
+  // Sets alpha_solid to true if the alpha channel is entirely 0xff.
+  virtual void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
+                                  bool* alpha_solid,
+                                  base::WaitableEvent* done) = 0;
 };
 
 }  // namespace content
diff --git a/content/common/gpu/media/rendering_helper_gl.cc b/content/common/gpu/media/rendering_helper_gl.cc
index 9ac6d4a..6fedcd1 100644
--- a/content/common/gpu/media/rendering_helper_gl.cc
+++ b/content/common/gpu/media/rendering_helper_gl.cc
@@ -89,14 +89,17 @@
 
 namespace content {
 
+RenderingHelperParams::RenderingHelperParams() {}
+
+RenderingHelperParams::~RenderingHelperParams() {}
+
 class RenderingHelperGL : public RenderingHelper {
  public:
   RenderingHelperGL();
   virtual ~RenderingHelperGL();
 
   // Implement RenderingHelper.
-  virtual void Initialize(int num_windows,
-                          const std::vector<gfx::Size>& dimensions,
+  virtual void Initialize(const RenderingHelperParams& params,
                           base::WaitableEvent* done) OVERRIDE;
   virtual void UnInitialize(base::WaitableEvent* done) OVERRIDE;
   virtual void CreateTexture(int window_id,
@@ -107,6 +110,9 @@
   virtual void DeleteTexture(uint32 texture_id) OVERRIDE;
   virtual void* GetGLContext() OVERRIDE;
   virtual void* GetGLDisplay() OVERRIDE;
+  virtual void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
+                                  bool* alpha_solid,
+                                  base::WaitableEvent* done) OVERRIDE;
 
   static const gfx::GLImplementation kGLImplementation;
 
@@ -119,7 +125,8 @@
 
 
   base::MessageLoop* message_loop_;
-  std::vector<gfx::Size> dimensions_;
+  std::vector<gfx::Size> window_dimensions_;
+  std::vector<gfx::Size> frame_dimensions_;
 
   NativeContextType gl_context_;
   std::map<uint32, int> texture_id_to_surface_index_;
@@ -137,6 +144,14 @@
   Display* x_display_;
   std::vector<Window> x_windows_;
 #endif
+
+  bool render_as_thumbnails_;
+  int frame_count_;
+  GLuint thumbnails_fbo_id_;
+  GLuint thumbnails_texture_id_;
+  gfx::Size thumbnails_fbo_size_;
+  gfx::Size thumbnail_size_;
+  GLuint program_;
 };
 
 // static
@@ -160,7 +175,8 @@
 }
 
 RenderingHelperGL::~RenderingHelperGL() {
-  CHECK_EQ(dimensions_.size(), 0U) << "Must call UnInitialize before dtor.";
+  CHECK_EQ(window_dimensions_.size(), 0U) <<
+    "Must call UnInitialize before dtor.";
   Clear();
 }
 
@@ -184,13 +200,11 @@
 #endif
 }
 
-void RenderingHelperGL::Initialize(
-    int num_windows,
-    const std::vector<gfx::Size>& dimensions,
-    base::WaitableEvent* done) {
-  // Use dimensions_.size() != 0 as a proxy for the class having already been
-  // Initialize()'d, and UnInitialize() before continuing.
-  if (dimensions_.size()) {
+void RenderingHelperGL::Initialize(const RenderingHelperParams& params,
+                                   base::WaitableEvent* done) {
+  // Use window_dimensions_.size() != 0 as a proxy for the class having already
+  // been Initialize()'d, and UnInitialize() before continuing.
+  if (window_dimensions_.size()) {
     base::WaitableEvent done(false, false);
     UnInitialize(&done);
     done.Wait();
@@ -200,10 +214,13 @@
   scoped_refptr<GLContextStubWithExtensions> stub_context(
       new GLContextStubWithExtensions());
 
-  CHECK_GT(dimensions.size(), 0U);
-  dimensions_ = dimensions;
+  CHECK_GT(params.window_dimensions.size(), 0U);
+  CHECK_EQ(params.frame_dimensions.size(), params.window_dimensions.size());
+  window_dimensions_ = params.window_dimensions;
+  frame_dimensions_ = params.frame_dimensions;
+  render_as_thumbnails_ = params.render_as_thumbnails;
   message_loop_ = base::MessageLoop::current();
-  CHECK_GT(num_windows, 0);
+  CHECK_GT(params.num_windows, 0);
 
 #if GL_VARIANT_GLX
   x_display_ = base::MessagePumpForUI::GetDefaultXDisplay();
@@ -269,11 +286,11 @@
 #endif
 
   // Per-window/surface X11 & EGL initialization.
-  for (int i = 0; i < num_windows; ++i) {
+  for (int i = 0; i < params.num_windows; ++i) {
     // Arrange X windows whimsically, with some padding.
-    int j = i % dimensions_.size();
-    int width = dimensions_[j].width();
-    int height = dimensions_[j].height();
+    int j = i % window_dimensions_.size();
+    int width = window_dimensions_[j].width();
+    int height = window_dimensions_[j].height();
     CHECK_GT(width, 0);
     CHECK_GT(height, 0);
     int top_left_x = (width + 20) * (i % 4);
@@ -323,29 +340,69 @@
   // Must be done after a context is made current.
   gfx::InitializeGLExtensionBindings(kGLImplementation, stub_context.get());
 
+  if (render_as_thumbnails_) {
+    CHECK_EQ(window_dimensions_.size(), 1U);
+
+    GLint max_texture_size;
+    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    CHECK_GE(max_texture_size, params.thumbnails_page_size.width());
+    CHECK_GE(max_texture_size, params.thumbnails_page_size.height());
+
+    thumbnails_fbo_size_ = params.thumbnails_page_size;
+    thumbnail_size_ = params.thumbnail_size;
+
+    glGenFramebuffersEXT(1, &thumbnails_fbo_id_);
+    glGenTextures(1, &thumbnails_texture_id_);
+    glBindTexture(GL_TEXTURE_2D, thumbnails_texture_id_);
+    glTexImage2D(GL_TEXTURE_2D,
+                 0,
+                 GL_RGB,
+                 thumbnails_fbo_size_.width(),
+                 thumbnails_fbo_size_.height(),
+                 0,
+                 GL_RGB,
+                 GL_UNSIGNED_SHORT_5_6_5,
+                 NULL);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+    glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_);
+    glFramebufferTexture2DEXT(GL_FRAMEBUFFER,
+                              GL_COLOR_ATTACHMENT0,
+                              GL_TEXTURE_2D,
+                              thumbnails_texture_id_,
+                              0);
+
+    GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER);
+    CHECK(fb_status == GL_FRAMEBUFFER_COMPLETE) << fb_status;
+    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+    glClear(GL_COLOR_BUFFER_BIT);
+    glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
+  }
+
+  // These vertices and texture coords. map (0,0) in the texture to the
+  // bottom left of the viewport.  Since we get the video frames with the
+  // the top left at (0,0) we need to flip the texture y coordinate
+  // in the vertex shader for this to be rendered the right way up.
+  // In the case of thumbnail rendering we use the same vertex shader
+  // to render the FBO the screen, where we do not want this flipping.
   static const float kVertices[] =
       { -1.f, 1.f, -1.f, -1.f, 1.f, 1.f, 1.f, -1.f, };
   static const float kTextureCoords[] = { 0, 1, 0, 0, 1, 1, 1, 0, };
-// On Windows the textures from Direct3D which renders them flipped.
-#if GL_VARIANT_GLX || defined(OS_WIN)
   static const char kVertexShader[] = STRINGIZE(
       varying vec2 interp_tc;
       attribute vec4 in_pos;
       attribute vec2 in_tc;
+      uniform bool tex_flip;
       void main() {
-        interp_tc = vec2(in_tc.x, 1.0 - in_tc.y);
+        if (tex_flip)
+          interp_tc = vec2(in_tc.x, 1.0 - in_tc.y);
+        else
+          interp_tc = in_tc;
         gl_Position = in_pos;
       });
-#else
-  static const char kVertexShader[] = STRINGIZE(
-      varying vec2 interp_tc;
-      attribute vec4 in_pos;
-      attribute vec2 in_tc;
-      void main() {
-        interp_tc = in_tc;
-        gl_Position = in_pos;
-      });
-#endif
 
 #if GL_VARIANT_EGL
   static const char kFragmentShader[] = STRINGIZE(
@@ -363,27 +420,30 @@
         gl_FragColor = texture2D(tex, interp_tc);
       });
 #endif
-  GLuint program = glCreateProgram();
-  CreateShader(program, GL_VERTEX_SHADER,
-               kVertexShader, arraysize(kVertexShader));
-  CreateShader(program, GL_FRAGMENT_SHADER,
-               kFragmentShader, arraysize(kFragmentShader));
-  glLinkProgram(program);
+  program_ = glCreateProgram();
+  CreateShader(
+      program_, GL_VERTEX_SHADER, kVertexShader, arraysize(kVertexShader));
+  CreateShader(program_,
+               GL_FRAGMENT_SHADER,
+               kFragmentShader,
+               arraysize(kFragmentShader));
+  glLinkProgram(program_);
   int result = GL_FALSE;
-  glGetProgramiv(program, GL_LINK_STATUS, &result);
+  glGetProgramiv(program_, GL_LINK_STATUS, &result);
   if (!result) {
     char log[4096];
-    glGetShaderInfoLog(program, arraysize(log), NULL, log);
+    glGetShaderInfoLog(program_, arraysize(log), NULL, log);
     LOG(FATAL) << log;
   }
-  glUseProgram(program);
-  glDeleteProgram(program);
+  glUseProgram(program_);
+  glDeleteProgram(program_);
 
-  glUniform1i(glGetUniformLocation(program, "tex"), 0);
-  int pos_location = glGetAttribLocation(program, "in_pos");
+  glUniform1i(glGetUniformLocation(program_, "tex_flip"), 0);
+  glUniform1i(glGetUniformLocation(program_, "tex"), 0);
+  int pos_location = glGetAttribLocation(program_, "in_pos");
   glEnableVertexAttribArray(pos_location);
   glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0, kVertices);
-  int tc_location = glGetAttribLocation(program, "in_tc");
+  int tc_location = glGetAttribLocation(program_, "in_tc");
   glEnableVertexAttribArray(tc_location);
   glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, kTextureCoords);
   done->Signal();
@@ -391,6 +451,10 @@
 
 void RenderingHelperGL::UnInitialize(base::WaitableEvent* done) {
   CHECK_EQ(base::MessageLoop::current(), message_loop_);
+  if (render_as_thumbnails_) {
+    glDeleteTextures(1, &thumbnails_texture_id_);
+    glDeleteFramebuffersEXT(1, &thumbnails_fbo_id_);
+  }
 #if GL_VARIANT_GLX
 
   glXDestroyContext(x_display_, gl_context_);
@@ -421,10 +485,16 @@
   MakeCurrent(window_id);
   glGenTextures(1, texture_id);
   glBindTexture(GL_TEXTURE_2D, *texture_id);
-  int dimensions_id = window_id % dimensions_.size();
-  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, dimensions_[dimensions_id].width(),
-               dimensions_[dimensions_id].height(), 0, GL_RGBA,
-               GL_UNSIGNED_BYTE, NULL);
+  int dimensions_id = window_id % frame_dimensions_.size();
+  glTexImage2D(GL_TEXTURE_2D,
+               0,
+               GL_RGBA,
+               frame_dimensions_[dimensions_id].width(),
+               frame_dimensions_[dimensions_id].height(),
+               0,
+               GL_RGBA,
+               GL_UNSIGNED_BYTE,
+               NULL);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   // OpenGLES2.0.25 section 3.8.2 requires CLAMP_TO_EDGE for NPOT textures.
@@ -440,17 +510,48 @@
   CHECK_EQ(base::MessageLoop::current(), message_loop_);
   size_t window_id = texture_id_to_surface_index_[texture_id];
   MakeCurrent(window_id);
-  int dimensions_id = window_id % dimensions_.size();
-  int width = dimensions_[dimensions_id].width();
-  int height = dimensions_[dimensions_id].height();
-  glViewport(0, 0, width, height);
-  glScissor(0, 0, width, height);
+
+  int dimensions_id = window_id % window_dimensions_.size();
+  int width = window_dimensions_[dimensions_id].width();
+  int height = window_dimensions_[dimensions_id].height();
+
+  if (render_as_thumbnails_) {
+    glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_);
+    const int thumbnails_in_row =
+        thumbnails_fbo_size_.width() / thumbnail_size_.width();
+    const int thumbnails_in_column =
+        thumbnails_fbo_size_.height() / thumbnail_size_.height();
+    const int row = (frame_count_ / thumbnails_in_row) % thumbnails_in_column;
+    const int col = frame_count_ % thumbnails_in_row;
+    const int x = col * thumbnail_size_.width();
+    const int y = row * thumbnail_size_.height();
+
+    glViewport(x, y, thumbnail_size_.width(), thumbnail_size_.height());
+    glScissor(x, y, thumbnail_size_.width(), thumbnail_size_.height());
+    glUniform1i(glGetUniformLocation(program_, "tex_flip"), 0);
+  } else {
+    glViewport(0, 0, width, height);
+    glScissor(0, 0, width, height);
+    glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1);
+  }
 
   glActiveTexture(GL_TEXTURE0);
   glBindTexture(GL_TEXTURE_2D, texture_id);
   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
   CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR);
 
+  ++frame_count_;
+
+  if (render_as_thumbnails_) {
+    // Copy from FBO to screen
+    glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1);
+    glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
+    glViewport(0, 0, width, height);
+    glScissor(0, 0, width, height);
+    glBindTexture(GL_TEXTURE_2D, thumbnails_texture_id_);
+    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+  }
+
 #if GL_VARIANT_GLX
   glXSwapBuffers(x_display_, x_windows_[window_id]);
 #else  // EGL
@@ -477,7 +578,8 @@
 }
 
 void RenderingHelperGL::Clear() {
-  dimensions_.clear();
+  window_dimensions_.clear();
+  frame_dimensions_.clear();
   texture_id_to_surface_index_.clear();
   message_loop_ = NULL;
   gl_context_ = NULL;
@@ -485,6 +587,10 @@
   gl_display_ = EGL_NO_DISPLAY;
   gl_surfaces_.clear();
 #endif
+  render_as_thumbnails_ = false;
+  frame_count_ = 0;
+  thumbnails_fbo_id_ = 0;
+  thumbnails_texture_id_ = 0;
 
 #if defined(OS_WIN)
   for (size_t i = 0; i < windows_.size(); ++i) {
@@ -503,4 +609,39 @@
 #endif
 }
 
+void RenderingHelperGL::GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
+                                           bool* alpha_solid,
+                                           base::WaitableEvent* done) {
+  CHECK(render_as_thumbnails_);
+
+  const size_t num_pixels = thumbnails_fbo_size_.GetArea();
+  std::vector<unsigned char> rgba;
+  rgba.resize(num_pixels * 4);
+  glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_);
+  glPixelStorei(GL_PACK_ALIGNMENT, 1);
+  // We can only count on GL_RGBA/GL_UNSIGNED_BYTE support.
+  glReadPixels(0,
+               0,
+               thumbnails_fbo_size_.width(),
+               thumbnails_fbo_size_.height(),
+               GL_RGBA,
+               GL_UNSIGNED_BYTE,
+               &rgba[0]);
+  rgb->resize(num_pixels * 3);
+  // Drop the alpha channel, but check as we go that it is all 0xff.
+  bool solid = true;
+  unsigned char* rgb_ptr = &((*rgb)[0]);
+  unsigned char* rgba_ptr = &rgba[0];
+  for (size_t i = 0; i < num_pixels; ++i) {
+    *rgb_ptr++ = *rgba_ptr++;
+    *rgb_ptr++ = *rgba_ptr++;
+    *rgb_ptr++ = *rgba_ptr++;
+    solid = solid && (*rgba_ptr == 0xff);
+    rgba_ptr++;
+  }
+  *alpha_solid = solid;
+
+  done->Signal();
+}
+
 }  // namespace content
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 439fb49..ec1ab8b 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -30,6 +30,7 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/format_macros.h"
+#include "base/md5.h"
 #include "base/platform_file.h"
 #include "base/process_util.h"
 #include "base/stl_util.h"
@@ -44,6 +45,7 @@
 #include "base/threading/thread.h"
 #include "content/common/gpu/media/rendering_helper.h"
 #include "content/public/common/content_switches.h"
+#include "ui/gfx/codec/png_codec.h"
 
 #if defined(OS_WIN)
 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
@@ -124,6 +126,12 @@
   std::string data_str;
 };
 
+// Presumed minimal display size.
+const gfx::Size kThumbnailsDisplaySize(1366, 768);
+const gfx::Size kThumbnailsPageSize(1600, 1200);
+const gfx::Size kThumbnailSize(160, 120);
+const int kMD5StringLength = 32;
+
 // Parse |data| into its constituent parts, set the various output fields
 // accordingly, and read in video stream. CHECK-fails on unexpected or
 // missing required data. Unspecified optional fields are set to -1.
@@ -179,6 +187,31 @@
   }
 }
 
+// Read in golden MD5s for the thumbnailed rendering of this video
+void ReadGoldenThumbnailMD5s(const TestVideoFile* video_file,
+                             std::vector<std::string>* md5_strings) {
+  base::FilePath filepath(video_file->file_name);
+  filepath = filepath.AddExtension(FILE_PATH_LITERAL(".md5"));
+  std::string all_md5s;
+  file_util::ReadFileToString(filepath, &all_md5s);
+  base::SplitString(all_md5s, '\n', md5_strings);
+  // Check these are legitimate MD5s.
+  for (std::vector<std::string>::iterator md5_string = md5_strings->begin();
+      md5_string != md5_strings->end(); ++md5_string) {
+      // Ignore the empty string added by SplitString
+      if (!md5_string->length())
+        continue;
+
+      CHECK_EQ(static_cast<int>(md5_string->length()),
+               kMD5StringLength) << *md5_string;
+      bool hex_only = std::count_if(md5_string->begin(),
+                                    md5_string->end(), isxdigit) ==
+                                    kMD5StringLength;
+      CHECK(hex_only) << *md5_string;
+  }
+  CHECK_GE(md5_strings->size(), 1U) << all_md5s;
+}
+
 // State of the GLRenderingVDAClient below.  Order matters here as the test
 // makes assumptions about it.
 enum ClientState {
@@ -485,7 +518,7 @@
   if (num_decoded_frames_ > delay_reuse_after_frame_num_) {
     base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(
         &VideoDecodeAccelerator::ReusePictureBuffer,
-        base::Unretained(decoder_.get()), picture.picture_buffer_id()),
+        decoder_->AsWeakPtr(), picture.picture_buffer_id()),
         base::TimeDelta::FromMilliseconds(kReuseDelayMs));
   } else {
     decoder_->ReusePictureBuffer(picture.picture_buffer_id());
@@ -716,18 +749,19 @@
 // - reset_after_frame_num: see GLRenderingVDAClient ctor.
 // - delete_decoder_phase: see GLRenderingVDAClient ctor.
 // - whether to test slow rendering by delaying ReusePictureBuffer().
+// - whether the video frames are rendered as thumbnails.
 class VideoDecodeAcceleratorTest
     : public ::testing::TestWithParam<
-  Tuple7<int, int, int, int, ResetPoint, ClientState, bool> > {
+  Tuple8<int, int, int, int, ResetPoint, ClientState, bool, bool> > {
 };
 
 // Helper so that gtest failures emit a more readable version of the tuple than
 // its byte representation.
 ::std::ostream& operator<<(
     ::std::ostream& os,
-    const Tuple6<int, int, int, int, ResetPoint, ClientState>& t) {
+    const Tuple8<int, int, int, int, ResetPoint, ClientState, bool, bool>& t) {
   return os << t.a << ", " << t.b << ", " << t.c << ", " << t.d << ", " << t.e
-            << ", " << t.f;
+            << ", " << t.f << ", " << t.g << ", " << t.h;
 }
 
 // Wait for |note| to report a state and if it's not |expected_state| then
@@ -763,6 +797,7 @@
   const int reset_point = GetParam().e;
   const int delete_decoder_state = GetParam().f;
   bool test_reuse_delay = GetParam().g;
+  const bool render_as_thumbnails = GetParam().h;
 
   std::vector<TestVideoFile*> test_video_files;
   ParseAndReadTestVideoData(test_video_data, num_concurrent_decoders,
@@ -790,17 +825,32 @@
   scoped_ptr<RenderingHelper> rendering_helper(RenderingHelper::Create());
 
   base::WaitableEvent done(false, false);
-  std::vector<gfx::Size> frame_dimensions;
-  for (size_t index = 0; index < test_video_files.size(); ++index) {
-    frame_dimensions.push_back(gfx::Size(
-        test_video_files[index]->width, test_video_files[index]->height));
+  RenderingHelperParams helper_params;
+  helper_params.num_windows = num_concurrent_decoders;
+  helper_params.render_as_thumbnails = render_as_thumbnails;
+  if (render_as_thumbnails) {
+    // Only one decoder is supported with thumbnail rendering
+    CHECK_EQ(num_concurrent_decoders, 1U);
+    gfx::Size frame_size(test_video_files[0]->width,
+                         test_video_files[0]->height);
+    helper_params.frame_dimensions.push_back(frame_size);
+    helper_params.window_dimensions.push_back(kThumbnailsDisplaySize);
+    helper_params.thumbnails_page_size = kThumbnailsPageSize;
+    helper_params.thumbnail_size = kThumbnailSize;
+  } else {
+    for (size_t index = 0; index < test_video_files.size(); ++index) {
+      gfx::Size frame_size(test_video_files[index]->width,
+                           test_video_files[index]->height);
+      helper_params.frame_dimensions.push_back(frame_size);
+      helper_params.window_dimensions.push_back(frame_size);
+    }
   }
   rendering_thread.message_loop()->PostTask(
       FROM_HERE,
       base::Bind(&RenderingHelper::Initialize,
                  base::Unretained(rendering_helper.get()),
-                 num_concurrent_decoders,
-                 frame_dimensions, &done));
+                 helper_params,
+                 &done));
   done.Wait();
 
   // First kick off all the decoders.
@@ -895,10 +945,53 @@
                      num_fragments_per_decode));
     }
     LOG(INFO) << "Decoder " << i << " fps: " << client->frames_per_second();
-    int min_fps = suppress_rendering ?
-        video_file->min_fps_no_render : video_file->min_fps_render;
-    if (min_fps > 0 && !test_reuse_delay)
-      EXPECT_GT(client->frames_per_second(), min_fps);
+    if (!render_as_thumbnails) {
+      int min_fps = suppress_rendering ?
+          video_file->min_fps_no_render : video_file->min_fps_render;
+      if (min_fps > 0 && !test_reuse_delay)
+        EXPECT_GT(client->frames_per_second(), min_fps);
+    }
+  }
+
+  if (render_as_thumbnails) {
+    std::vector<unsigned char> rgb;
+    bool alpha_solid;
+    rendering_thread.message_loop()->PostTask(
+      FROM_HERE,
+      base::Bind(&RenderingHelper::GetThumbnailsAsRGB,
+                 base::Unretained(rendering_helper.get()),
+                 &rgb, &alpha_solid, &done));
+    done.Wait();
+
+    std::vector<std::string> golden_md5s;
+    std::string md5_string = base::MD5String(
+        base::StringPiece(reinterpret_cast<char*>(&rgb[0]), rgb.size()));
+    ReadGoldenThumbnailMD5s(test_video_files[0], &golden_md5s);
+    std::vector<std::string>::iterator match =
+        find(golden_md5s.begin(), golden_md5s.end(), md5_string);
+    if (match == golden_md5s.end()) {
+      // Convert raw RGB into PNG for export.
+      std::vector<unsigned char> png;
+      gfx::PNGCodec::Encode(&rgb[0],
+                            gfx::PNGCodec::FORMAT_RGB,
+                            kThumbnailsPageSize,
+                            kThumbnailsPageSize.width() * 3,
+                            true,
+                            std::vector<gfx::PNGCodec::Comment>(),
+                            &png);
+
+      LOG(ERROR) << "Unknown thumbnails MD5: " << md5_string;
+
+      base::FilePath filepath(test_video_files[0]->file_name);
+      filepath = filepath.AddExtension(FILE_PATH_LITERAL(".bad_thumbnails"));
+      filepath = filepath.AddExtension(FILE_PATH_LITERAL(".png"));
+      int num_bytes = file_util::WriteFile(filepath,
+                                           reinterpret_cast<char*>(&png[0]),
+                                           png.size());
+      ASSERT_EQ(num_bytes, static_cast<int>(png.size()));
+    }
+    ASSERT_NE(match, golden_md5s.end());
+    EXPECT_EQ(alpha_solid, true) << "RGBA frame had incorrect alpha";
   }
 
   // Output the frame delivery time to file
@@ -941,58 +1034,60 @@
 INSTANTIATE_TEST_CASE_P(
     ReplayAfterEOS, VideoDecodeAcceleratorTest,
     ::testing::Values(
-        MakeTuple(1, 1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false)));
+        MakeTuple(1, 1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false)));
 
 // Test that Reset() mid-stream works fine and doesn't affect decoding even when
 // Decode() calls are made during the reset.
 INSTANTIATE_TEST_CASE_P(
     MidStreamReset, VideoDecodeAcceleratorTest,
     ::testing::Values(
-        MakeTuple(1, 1, 1, 1, MID_STREAM_RESET, CS_RESET, false)));
+        MakeTuple(1, 1, 1, 1, MID_STREAM_RESET, CS_RESET, false, false)));
 
 INSTANTIATE_TEST_CASE_P(
     SlowRendering, VideoDecodeAcceleratorTest,
     ::testing::Values(
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, true)));
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, true, false)));
 
 // Test that Destroy() mid-stream works fine (primarily this is testing that no
 // crashes occur).
 INSTANTIATE_TEST_CASE_P(
     TearDownTiming, VideoDecodeAcceleratorTest,
     ::testing::Values(
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_DECODER_SET, false),
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_INITIALIZED, false),
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_FLUSHING, false),
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_FLUSHED, false),
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESETTING, false),
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_DECODER_SET, false,
+                  false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_INITIALIZED, false,
+                  false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_FLUSHING, false, false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_FLUSHED, false, false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESETTING, false, false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
         MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET,
-                  static_cast<ClientState>(-1), false),
+                  static_cast<ClientState>(-1), false, false),
         MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET,
-                  static_cast<ClientState>(-10), false),
+                  static_cast<ClientState>(-10), false, false),
         MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET,
-                  static_cast<ClientState>(-100), false)));
+                  static_cast<ClientState>(-100), false, false)));
 
 // Test that decoding various variation works: multiple fragments per Decode()
 // call and multiple in-flight decodes.
 INSTANTIATE_TEST_CASE_P(
     DecodeVariations, VideoDecodeAcceleratorTest,
     ::testing::Values(
-        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
-        MakeTuple(1, 1, 10, 1, END_OF_STREAM_RESET, CS_RESET, false),
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
+        MakeTuple(1, 1, 10, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
         // Tests queuing.
-        MakeTuple(1, 1, 15, 1, END_OF_STREAM_RESET, CS_RESET, false),
-        MakeTuple(2, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
-        MakeTuple(3, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
-        MakeTuple(5, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
-        MakeTuple(8, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false),
+        MakeTuple(1, 1, 15, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
+        MakeTuple(2, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
+        MakeTuple(3, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
+        MakeTuple(5, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
+        MakeTuple(8, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false),
         // TODO(fischman): decoding more than 15 NALUs at once breaks decode -
         // visual artifacts are introduced as well as spurious frames are
         // delivered (more pictures are returned than NALUs are fed to the
         // decoder).  Increase the "15" below when
         // http://code.google.com/p/chrome-os-partner/issues/detail?id=4378 is
         // fixed.
-        MakeTuple(15, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false)));
+        MakeTuple(15, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, false)));
 
 // Find out how many concurrent decoders can go before we exhaust system
 // resources.
@@ -1001,9 +1096,15 @@
     ::testing::Values(
         // +0 hack below to promote enum to int.
         MakeTuple(1, kMinSupportedNumConcurrentDecoders + 0, 1, 1,
-                  END_OF_STREAM_RESET, CS_RESET, false),
+                  END_OF_STREAM_RESET, CS_RESET, false, false),
         MakeTuple(1, kMinSupportedNumConcurrentDecoders + 1, 1, 1,
-                  END_OF_STREAM_RESET, CS_RESET, false)));
+                  END_OF_STREAM_RESET, CS_RESET, false, false)));
+
+// Thumbnailing test
+INSTANTIATE_TEST_CASE_P(
+    Thumbnail, VideoDecodeAcceleratorTest,
+    ::testing::Values(
+        MakeTuple(1, 1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, true)));
 
 // TODO(fischman, vrk): add more tests!  In particular:
 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder.
diff --git a/content/common/gpu/testdata/bear.README b/content/common/gpu/testdata/bear.README
index 177951d..6bdecc9 100644
--- a/content/common/gpu/testdata/bear.README
+++ b/content/common/gpu/testdata/bear.README
@@ -5,3 +5,10 @@
   bear.mp4 (https://chromiumcodereview.appspot.com/10805089):
   ffmpeg -i bear.mp4 -vcodec copy -vbsf h264_mp4toannexb \
       -an bear.h264
+
+bear.h264.md5:
+  MD5s of RGB thumbnail rendered version of bear.h264 decoded with Intel
+  VAAPI and Exynos EVDA.  Written out by video_decode_accelerator_unittest.
+  These differ between implementations because color space-converted frames are
+  not specified to the last bit and GLES shader/texture filtering
+  precision varies.
diff --git a/content/common/gpu/testdata/bear.h264.md5 b/content/common/gpu/testdata/bear.h264.md5
new file mode 100644
index 0000000..41af05e
--- /dev/null
+++ b/content/common/gpu/testdata/bear.h264.md5
@@ -0,0 +1,2 @@
+1460776de36c2eab426a619fde19cf87
+ca2ede0f3b553af5a860a000f8d6c1f1
diff --git a/content/common/gpu/testdata/npot-video.README b/content/common/gpu/testdata/npot-video.README
index ff1378b..bc754ec 100644
--- a/content/common/gpu/testdata/npot-video.README
+++ b/content/common/gpu/testdata/npot-video.README
@@ -6,6 +6,12 @@
   ffmpeg -i npot-video.mp4 -vcodec copy -vbsf h264_mp4toannexb \
       -an npot-video.h264
 
+npot-video.h264.md5:
+  MD5s of RGB thumbnail rendered version of npot_video.h264 decoded with Intel
+  VAAPI and Exynos EVDA.  Written out by video_decode_accelerator_unittest.
+  These differ between implementations because color space-converted frames are
+  not specified to the last bit and GLES shader/texture filtering
+  precision varies.
 
 Copyright (c) 2012 The Khronos Group Inc.
 
diff --git a/content/common/gpu/testdata/npot-video.h264.md5 b/content/common/gpu/testdata/npot-video.h264.md5
new file mode 100644
index 0000000..f0ae7c9
--- /dev/null
+++ b/content/common/gpu/testdata/npot-video.h264.md5
@@ -0,0 +1,2 @@
+f8c0f13e30d1f1b6316d4fa59913ff07
+8f57b9517eba244f0a841d55e6eef70a
diff --git a/content/common/gpu/testdata/red-green.README b/content/common/gpu/testdata/red-green.README
index 0f31b90..011b9a5 100644
--- a/content/common/gpu/testdata/red-green.README
+++ b/content/common/gpu/testdata/red-green.README
@@ -6,6 +6,12 @@
   ffmpeg -i red-green.mp4 -vcodec copy -vbsf h264_mp4toannexb \
       -an red-green.h264
 
+red-green.h264.md5:
+  MD5s of RGB thumbnail rendered version of red-green.h264 decoded with Intel
+  VAAPI and Exynos EVDA.  Written out by video_decode_accelerator_unittest.
+  These differ between implementations because color space-converted frames are
+  not specified to the last bit and GLES shader/texture filtering
+  precision varies.
 
 Copyright (c) 2012 The Khronos Group Inc.
 
diff --git a/content/common/gpu/testdata/red-green.h264.md5 b/content/common/gpu/testdata/red-green.h264.md5
new file mode 100644
index 0000000..a529bdf
--- /dev/null
+++ b/content/common/gpu/testdata/red-green.h264.md5
@@ -0,0 +1,2 @@
+19724227e7878c50338ed4a1d42643af
+c75d8fd6c147d12ea5d60d30a1b754f6
diff --git a/content/common/gpu/testdata/test-25fps.README b/content/common/gpu/testdata/test-25fps.README
index ba46586..4ea90d6 100644
--- a/content/common/gpu/testdata/test-25fps.README
+++ b/content/common/gpu/testdata/test-25fps.README
@@ -6,8 +6,19 @@
   ffmpeg -i third_party/WebKit/LayoutTests/media/content/test-25fps.mp4 \
       -vcodec copy -vbsf h264_mp4toannexb -an test-25fps.h264
 
+test-25fps.h264.md5:
+  MD5s of RGB thumbnail rendered version of test-25fps.h264 decoded with Intel
+  VAAPI and Exynos EVDA.  Written out by video_decode_accelerator_unittest.
+  These differ between implementations because color space-converted frames are
+  not specified to the last bit and GLES shader/texture filtering
+  precision varies. 
+
 test-25fps.vp8:
   ffmpeg git-2012-07-19-a8d8e86, libvpx ToT 7/19, chromium r147247,
   mkvextract v5.0.1
   ffmpeg -i test-25fps.h264 -vcodec libvpx -an test-25fps.webm && \
       mkvextract tracks test-25fps.webm 1:test-25fps.vp8 && rm test-25fps.webm
+
+test-25fps.vp8.md5:
+  MD5 of RGB thumbnail rendered version of test-25fps.vp8 decoded with Exynos
+  EVDA.  Written out by video_decode_accelerator_unittest.
\ No newline at end of file
diff --git a/content/common/gpu/testdata/test-25fps.h264.md5 b/content/common/gpu/testdata/test-25fps.h264.md5
new file mode 100644
index 0000000..d623ac9
--- /dev/null
+++ b/content/common/gpu/testdata/test-25fps.h264.md5
@@ -0,0 +1,2 @@
+cebd4bb73a92953982a9d62db1d9452f
+fb20506aa3c882de66ec17954ba18b09
diff --git a/content/common/gpu/testdata/test-25fps.vp8.md5 b/content/common/gpu/testdata/test-25fps.vp8.md5
new file mode 100644
index 0000000..f5923cb
--- /dev/null
+++ b/content/common/gpu/testdata/test-25fps.vp8.md5
@@ -0,0 +1 @@
+506be1764bc0cf48106b1405b91cc565
diff --git a/content/common/media/encoded_video_capture_messages.h b/content/common/media/encoded_video_capture_messages.h
index 8de6fb9..6313f72 100644
--- a/content/common/media/encoded_video_capture_messages.h
+++ b/content/common/media/encoded_video_capture_messages.h
@@ -77,6 +77,13 @@
                      int /* device_id */,
                      media::RuntimeVideoEncodingParameters /* params */)
 
+// Requests a key frame in the encoded bitstream. Upon receiving this request,
+// browser will try to encode an upcoming captured frame as a key frame. This
+// allows the receiver to quickly recover from data loss. The request is served
+// on a best-effort basis and there is no explicit acknowledgement.
+IPC_MESSAGE_CONTROL1(EncodedVideoCaptureHostMsg_RequestKeyFrame,
+                     int /* device_id */)
+
 // Notifies that the data within a buffer has been processed and it can be
 // reused to encode upcoming bitstream.
 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_BitstreamBufferConsumed,
diff --git a/content/common/plugin_list.cc b/content/common/plugin_list.cc
index 615ca26..79f8cc5 100644
--- a/content/common/plugin_list.cc
+++ b/content/common/plugin_list.cc
@@ -25,31 +25,8 @@
 
 namespace {
 
-const char kApplicationOctetStream[] = "application/octet-stream";
-
 base::LazyInstance<PluginList> g_singleton = LAZY_INSTANCE_INITIALIZER;
 
-bool AllowMimeTypeMismatch(const std::string& orig_mime_type,
-                           const std::string& actual_mime_type) {
-  if (orig_mime_type == actual_mime_type) {
-    NOTREACHED();
-    return true;
-  }
-
-  // We do not permit URL-sniff based plug-in MIME type overrides aside from
-  // the case where the "type" was initially missing or generic
-  // (application/octet-stream).
-  // We collected stats to determine this approach isn't a major compat issue,
-  // and we defend against content confusion attacks in various cases, such
-  // as when the user doesn't have the Flash plug-in enabled.
-  bool allow = orig_mime_type.empty() ||
-               orig_mime_type == kApplicationOctetStream;
-  LOG_IF(INFO, !allow) << "Ignoring plugin with unexpected MIME type "
-                       << actual_mime_type << " (expected " << orig_mime_type
-                       << ")";
-  return allow;
-}
-
 }  // namespace
 
 // static
@@ -365,16 +342,20 @@
   }
 
   // Add in plugins by url.
+  // We do not permit URL-sniff based plug-in MIME type overrides aside from
+  // the case where the "type" was initially missing.
+  // We collected stats to determine this approach isn't a major compat issue,
+  // and we defend against content confusion attacks in various cases, such
+  // as when the user doesn't have the Flash plug-in enabled.
   std::string path = url.path();
   std::string::size_type last_dot = path.rfind('.');
-  if (last_dot != std::string::npos) {
+  if (last_dot != std::string::npos && mime_type.empty()) {
     std::string extension = StringToLowerASCII(std::string(path, last_dot+1));
     std::string actual_mime_type;
     for (size_t i = 0; i < plugins_list_.size(); ++i) {
       if (SupportsExtension(plugins_list_[i], extension, &actual_mime_type)) {
         base::FilePath path = plugins_list_[i].path;
-        if (visited_plugins.insert(path).second &&
-            AllowMimeTypeMismatch(mime_type, actual_mime_type)) {
+        if (visited_plugins.insert(path).second) {
           info->push_back(plugins_list_[i]);
           if (actual_mime_types)
             actual_mime_types->push_back(actual_mime_type);
diff --git a/content/common/plugin_list_unittest.cc b/content/common/plugin_list_unittest.cc
index 342200e..a9e592e 100644
--- a/content/common/plugin_list_unittest.cc
+++ b/content/common/plugin_list_unittest.cc
@@ -7,6 +7,7 @@
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
 
 namespace content {
 
@@ -15,6 +16,8 @@
 base::FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin");
 base::FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin");
 const char* kFooName = "Foo Plugin";
+const char* kFooMimeType = "application/x-foo-mime-type";
+const char* kFooFileType = "foo";
 
 bool Equals(const WebPluginInfo& a, const WebPluginInfo& b) {
   return (a.name == b.name &&
@@ -51,6 +54,8 @@
   virtual void SetUp() {
     plugin_list_.DisablePluginsDiscovery();
     plugin_list_.RegisterInternalPlugin(bar_plugin_, false);
+    foo_plugin_.mime_types.push_back(
+        WebPluginMimeType(kFooMimeType, kFooFileType, std::string()));
     plugin_list_.RegisterInternalPlugin(foo_plugin_, false);
   }
 
@@ -81,6 +86,56 @@
   ASSERT_TRUE(Contains(plugins, plugin_3043));
 }
 
+TEST_F(PluginListTest, GetPluginInfoArray) {
+  const char kTargetUrl[] = "http://example.com/test.foo";
+  GURL target_url(kTargetUrl);
+  std::vector<WebPluginInfo> plugins;
+  std::vector<std::string> actual_mime_types;
+
+  // The file type of the URL is supported by foo_plugin_. However,
+  // GetPluginInfoArray should not match foo_plugin_ because the MIME type is
+  // application/octet-stream.
+  plugin_list_.GetPluginInfoArray(target_url,
+                                  "application/octet-stream",
+                                  false, // allow_wildcard
+                                  NULL,  // use_stale
+                                  false, // include_npapi
+                                  &plugins,
+                                  &actual_mime_types);
+  EXPECT_EQ(0u, plugins.size());
+  EXPECT_EQ(0u, actual_mime_types.size());
+
+  // foo_plugin_ matches due to the MIME type.
+  plugins.clear();
+  actual_mime_types.clear();
+  plugin_list_.GetPluginInfoArray(target_url,
+                                  kFooMimeType,
+                                  false, // allow_wildcard
+                                  NULL,  // use_stale
+                                  false, // include_npapi
+                                  &plugins,
+                                  &actual_mime_types);
+  EXPECT_EQ(1u, plugins.size());
+  EXPECT_TRUE(Contains(plugins, foo_plugin_));
+  ASSERT_EQ(1u, actual_mime_types.size());
+  EXPECT_EQ(kFooMimeType, actual_mime_types.front());
+
+  // foo_plugin_ matches due to the file type and empty MIME type.
+  plugins.clear();
+  actual_mime_types.clear();
+  plugin_list_.GetPluginInfoArray(target_url,
+                                  "",
+                                  false, // allow_wildcard
+                                  NULL,  // use_stale
+                                  false, // include_npapi
+                                  &plugins,
+                                  &actual_mime_types);
+  EXPECT_EQ(1u, plugins.size());
+  EXPECT_TRUE(Contains(plugins, foo_plugin_));
+  ASSERT_EQ(1u, actual_mime_types.size());
+  EXPECT_EQ(kFooMimeType, actual_mime_types.front());
+}
+
 #if defined(OS_POSIX) && !defined(OS_MACOSX)
 
 // Test parsing a simple description: Real Audio.
diff --git a/content/common/ssl_status_serialization.h b/content/common/ssl_status_serialization.h
index e3db1a2..fa1230b 100644
--- a/content/common/ssl_status_serialization.h
+++ b/content/common/ssl_status_serialization.h
@@ -7,15 +7,16 @@
 
 #include <string>
 
+#include "content/common/content_export.h"
 #include "net/cert/cert_status_flags.h"
 
 namespace content {
 
 // Convenience methods for serializing/deserializing the security info.
-std::string SerializeSecurityInfo(int cert_id,
-                                  net::CertStatus cert_status,
-                                  int security_bits,
-                                  int connection_status);
+CONTENT_EXPORT std::string SerializeSecurityInfo(int cert_id,
+                                                 net::CertStatus cert_status,
+                                                 int security_bits,
+                                                 int connection_status);
 
 bool DeserializeSecurityInfo(const std::string& state,
                              int* cert_id,
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index bdf9c2f..a34bc69 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -49,6 +49,7 @@
 #include "third_party/WebKit/public/web/WebPopupType.h"
 #include "third_party/WebKit/public/web/WebScreenInfo.h"
 #include "third_party/WebKit/public/web/WebTextDirection.h"
+#include "third_party/WebKit/public/web/WebWindowFeatures.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/ime/text_input_mode.h"
 #include "ui/base/ime/text_input_type.h"
@@ -313,6 +314,25 @@
   IPC_STRUCT_TRAITS_MEMBER(total_scroll_update_latency)
 IPC_STRUCT_TRAITS_END()
 
+IPC_STRUCT_TRAITS_BEGIN(WebKit::WebWindowFeatures)
+  IPC_STRUCT_TRAITS_MEMBER(x)
+  IPC_STRUCT_TRAITS_MEMBER(xSet)
+  IPC_STRUCT_TRAITS_MEMBER(y)
+  IPC_STRUCT_TRAITS_MEMBER(ySet)
+  IPC_STRUCT_TRAITS_MEMBER(width)
+  IPC_STRUCT_TRAITS_MEMBER(widthSet)
+  IPC_STRUCT_TRAITS_MEMBER(height)
+  IPC_STRUCT_TRAITS_MEMBER(heightSet)
+  IPC_STRUCT_TRAITS_MEMBER(menuBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(statusBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(toolBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(locationBarVisible)
+  IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible)
+  IPC_STRUCT_TRAITS_MEMBER(resizable)
+  IPC_STRUCT_TRAITS_MEMBER(fullscreen)
+  IPC_STRUCT_TRAITS_MEMBER(dialog)
+IPC_STRUCT_TRAITS_END()
+
 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params)
   // Routing ID of the view initiating the open.
   IPC_STRUCT_MEMBER(int, opener_id)
@@ -349,6 +369,13 @@
   // The URL that will be loaded in the new window (empty if none has been
   // sepcified).
   IPC_STRUCT_MEMBER(GURL, target_url)
+
+  // The referrer that will be used to load |target_url| (empty if none has
+  // been specified).
+  IPC_STRUCT_MEMBER(content::Referrer, referrer)
+
+  // The window features to use for the new view.
+  IPC_STRUCT_MEMBER(WebKit::WebWindowFeatures, features)
 IPC_STRUCT_END()
 
 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params)
diff --git a/content/common_aidl.target.darwin-arm.mk b/content/common_aidl.target.darwin-arm.mk
index c25b26f..d1d0d3b 100644
--- a/content/common_aidl.target.darwin-arm.mk
+++ b/content/common_aidl.target.darwin-arm.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/common_aidl.target.darwin-mips.mk b/content/common_aidl.target.darwin-mips.mk
index b0ae14d..1b207ed 100644
--- a/content/common_aidl.target.darwin-mips.mk
+++ b/content/common_aidl.target.darwin-mips.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/common_aidl.target.darwin-x86.mk b/content/common_aidl.target.darwin-x86.mk
index c72558f..804ef68 100644
--- a/content/common_aidl.target.darwin-x86.mk
+++ b/content/common_aidl.target.darwin-x86.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/common_aidl.target.linux-arm.mk b/content/common_aidl.target.linux-arm.mk
index 7cd8828..d3d4080 100644
--- a/content/common_aidl.target.linux-arm.mk
+++ b/content/common_aidl.target.linux-arm.mk
@@ -97,10 +97,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/common_aidl.target.linux-mips.mk b/content/common_aidl.target.linux-mips.mk
index 1fe6feb..89867fc 100644
--- a/content/common_aidl.target.linux-mips.mk
+++ b/content/common_aidl.target.linux-mips.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/common_aidl.target.linux-x86.mk b/content/common_aidl.target.linux-x86.mk
index edb6b69..758c564 100644
--- a/content/common_aidl.target.linux-x86.mk
+++ b/content/common_aidl.target.linux-x86.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content.gyp b/content/content.gyp
index f938e36..4234a03 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -112,7 +112,7 @@
             'content_resources.gyp:content_resources',
           ],
           'conditions': [
-            ['OS != "ios"', {
+            ['OS != "ios" and chrome_multiple_dll != 1', {
               'dependencies': [
                 'content_gpu',
                 'content_utility',
@@ -172,6 +172,7 @@
                 'content_gpu.gypi',
               ],
               'dependencies': [
+                'content_child',
                 'content_common',
               ],
             },
@@ -225,6 +226,7 @@
                 'content_utility.gypi',
               ],
               'dependencies': [
+                'content_child',
                 'content_common',
               ],
             },
diff --git a/content/content_app.target.darwin-arm.mk b/content/content_app.target.darwin-arm.mk
index 9a49ba1..5625043 100644
--- a/content/content_app.target.darwin-arm.mk
+++ b/content/content_app.target.darwin-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -78,19 +79,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +189,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -226,8 +225,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -301,7 +300,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_app.target.darwin-mips.mk b/content/content_app.target.darwin-mips.mk
index f0080c7..ff486ff 100644
--- a/content/content_app.target.darwin-mips.mk
+++ b/content/content_app.target.darwin-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,19 +78,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -113,8 +113,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,19 +187,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -224,8 +223,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +294,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_app.target.darwin-x86.mk b/content/content_app.target.darwin-x86.mk
index dcc0b80..058c02a 100644
--- a/content/content_app.target.darwin-x86.mk
+++ b/content/content_app.target.darwin-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -80,18 +81,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -115,8 +115,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -193,18 +193,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -299,7 +298,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_app.target.linux-arm.mk b/content/content_app.target.linux-arm.mk
index 9a49ba1..5625043 100644
--- a/content/content_app.target.linux-arm.mk
+++ b/content/content_app.target.linux-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -78,19 +79,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +189,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -226,8 +225,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -301,7 +300,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_app.target.linux-mips.mk b/content/content_app.target.linux-mips.mk
index f0080c7..ff486ff 100644
--- a/content/content_app.target.linux-mips.mk
+++ b/content/content_app.target.linux-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,19 +78,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -113,8 +113,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,19 +187,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -224,8 +223,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -295,7 +294,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_app.target.linux-x86.mk b/content/content_app.target.linux-x86.mk
index dcc0b80..058c02a 100644
--- a/content/content_app.target.linux-x86.mk
+++ b/content/content_app.target.linux-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -80,18 +81,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -115,8 +115,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -193,18 +193,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -299,7 +298,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index a985d0b..dab1b40 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -776,6 +776,8 @@
     'browser/renderer_host/input/immediate_input_router.h',
     'browser/renderer_host/input/input_router.h',
     'browser/renderer_host/input/input_router_client.h',
+    'browser/renderer_host/input/web_input_event_builders_win.cc',
+    'browser/renderer_host/input/web_input_event_builders_win.h',
     'browser/renderer_host/java/java_bound_object.cc',
     'browser/renderer_host/java/java_bound_object.h',
     'browser/renderer_host/java/java_bridge_channel_host.cc',
@@ -1195,7 +1197,6 @@
         '../net/net.gyp:http_server',
         '../printing/printing.gyp:printing',
         '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
-        '../third_party/WebKit/public/blink.gyp:blink',
         '../ui/surface/surface.gyp:surface',
         '../webkit/common/webkit_common.gyp:webkit_common',
         '../webkit/storage_browser.gyp:webkit_storage_browser',
@@ -1204,6 +1205,11 @@
         '../webkit/webkit_resources.gyp:webkit_strings',
       ],
     }],
+    ['OS!="ios" and chrome_multiple_dll!=1', {
+      'dependencies': [
+        '../third_party/WebKit/public/blink.gyp:blink',
+      ],
+    }],
     ['OS!="mac" and OS!="ios"', {
       'dependencies': [
         '../sandbox/sandbox.gyp:sandbox',
diff --git a/content/content_browser.target.darwin-arm.mk b/content/content_browser.target.darwin-arm.mk
index c89de7e..b494afe 100644
--- a/content/content_browser.target.darwin-arm.mk
+++ b/content/content_browser.target.darwin-arm.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -445,21 +446,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -487,8 +487,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -575,21 +575,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -618,8 +617,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -705,7 +704,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_browser.target.darwin-mips.mk b/content/content_browser.target.darwin-mips.mk
index 2884c46..41557ec 100644
--- a/content/content_browser.target.darwin-mips.mk
+++ b/content/content_browser.target.darwin-mips.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -444,21 +445,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -486,8 +486,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -573,21 +573,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -616,8 +615,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -699,7 +698,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_browser.target.darwin-x86.mk b/content/content_browser.target.darwin-x86.mk
index 4c1ec08..f8a29d4 100644
--- a/content/content_browser.target.darwin-x86.mk
+++ b/content/content_browser.target.darwin-x86.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -447,20 +448,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -488,8 +488,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -579,20 +579,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -621,8 +620,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -703,7 +702,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_browser.target.linux-arm.mk b/content/content_browser.target.linux-arm.mk
index c89de7e..b494afe 100644
--- a/content/content_browser.target.linux-arm.mk
+++ b/content/content_browser.target.linux-arm.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -445,21 +446,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -487,8 +487,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -575,21 +575,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -618,8 +617,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -705,7 +704,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_browser.target.linux-mips.mk b/content/content_browser.target.linux-mips.mk
index 2884c46..41557ec 100644
--- a/content/content_browser.target.linux-mips.mk
+++ b/content/content_browser.target.linux-mips.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -444,21 +445,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -486,8 +486,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -573,21 +573,20 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -616,8 +615,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -699,7 +698,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_browser.target.linux-x86.mk b/content/content_browser.target.linux-x86.mk
index 4c1ec08..f8a29d4 100644
--- a/content/content_browser.target.linux-x86.mk
+++ b/content/content_browser.target.linux-x86.mk
@@ -13,13 +13,14 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,content_browser_speech_proto_speech_proto_gyp)/content_browser_speech_proto_speech_proto_gyp.a \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,content_browser_devtools_devtools_resources_gyp)/devtools_resources.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,sandbox_sandbox_gyp)/sandbox.stamp \
 	$(call intermediates-dir-for,GYP,content_content_jni_headers_gyp)/content_jni_headers.stamp
 
@@ -447,20 +448,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -488,8 +488,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -579,20 +579,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -621,8 +620,8 @@
 	$(gyp_shared_intermediate_dir)/protoc_out \
 	$(LOCAL_PATH)/third_party/protobuf \
 	$(LOCAL_PATH)/third_party/protobuf/src \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -703,7 +702,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	content_browser_speech_proto_speech_proto_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.darwin-arm.mk b/content/content_child.target.darwin-arm.mk
index e56bbf4..552c22a 100644
--- a/content/content_child.target.darwin-arm.mk
+++ b/content/content_child.target.darwin-arm.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -121,19 +121,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,8 +157,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -236,19 +235,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -274,8 +272,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -352,7 +350,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.darwin-mips.mk b/content/content_child.target.darwin-mips.mk
index 3b579ae..640cfc1 100644
--- a/content/content_child.target.darwin-mips.mk
+++ b/content/content_child.target.darwin-mips.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -120,19 +120,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,8 +156,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -234,19 +233,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -272,8 +270,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,7 +344,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.darwin-x86.mk b/content/content_child.target.darwin-x86.mk
index 38f2cd1..d09b00b 100644
--- a/content/content_child.target.darwin-x86.mk
+++ b/content/content_child.target.darwin-x86.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -123,18 +123,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,8 +158,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -240,18 +239,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -277,8 +275,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -350,7 +348,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-arm.mk b/content/content_child.target.linux-arm.mk
index e56bbf4..552c22a 100644
--- a/content/content_child.target.linux-arm.mk
+++ b/content/content_child.target.linux-arm.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -121,19 +121,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,8 +157,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -236,19 +235,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -274,8 +272,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -352,7 +350,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-mips.mk b/content/content_child.target.linux-mips.mk
index 3b579ae..640cfc1 100644
--- a/content/content_child.target.linux-mips.mk
+++ b/content/content_child.target.linux-mips.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -120,19 +120,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,8 +156,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -234,19 +233,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -272,8 +270,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,7 +344,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_child.target.linux-x86.mk b/content/content_child.target.linux-x86.mk
index 38f2cd1..d09b00b 100644
--- a/content/content_child.target.linux-x86.mk
+++ b/content/content_child.target.linux-x86.mk
@@ -14,7 +14,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,webkit_support_glue_child_gyp)/webkit_support_glue_child_gyp.a
 
@@ -123,18 +123,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,8 +158,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -240,18 +239,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -277,8 +275,8 @@
 	$(PWD)/external/icu4c/i18n \
 	$(gyp_shared_intermediate_dir)/content \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -350,7 +348,7 @@
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
 	ui_ui_gyp \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_child_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 3ea4a8d..900aa36 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -391,6 +391,10 @@
         '../webkit/common/webkit_common.gyp:webkit_common',
         '../webkit/storage_browser.gyp:webkit_storage_browser',
         '../webkit/storage_common.gyp:webkit_storage_common',
+      ],
+    }],
+    ['OS!="ios" and chrome_multiple_dll!=1', {
+      'dependencies': [
         '../webkit/support/webkit_support.gyp:glue',
       ],
     }],
diff --git a/content/content_common.target.darwin-arm.mk b/content/content_common.target.darwin-arm.mk
index 4eb297c..bca7e4c 100644
--- a/content/content_common.target.darwin-arm.mk
+++ b/content/content_common.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -179,19 +180,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -213,8 +213,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,19 +294,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -329,8 +328,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -407,7 +406,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_common.target.darwin-mips.mk b/content/content_common.target.darwin-mips.mk
index b0d0b93..f728819 100644
--- a/content/content_common.target.darwin-mips.mk
+++ b/content/content_common.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -178,19 +179,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -212,8 +212,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,19 +292,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -327,8 +326,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -401,7 +400,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_common.target.darwin-x86.mk b/content/content_common.target.darwin-x86.mk
index 149252b..349ffa4 100644
--- a/content/content_common.target.darwin-x86.mk
+++ b/content/content_common.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -181,18 +182,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -214,8 +214,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -298,18 +298,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -332,8 +331,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -405,7 +404,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_common.target.linux-arm.mk b/content/content_common.target.linux-arm.mk
index 4eb297c..bca7e4c 100644
--- a/content/content_common.target.linux-arm.mk
+++ b/content/content_common.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -179,19 +180,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -213,8 +213,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,19 +294,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -329,8 +328,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -407,7 +406,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_common.target.linux-mips.mk b/content/content_common.target.linux-mips.mk
index b0d0b93..f728819 100644
--- a/content/content_common.target.linux-mips.mk
+++ b/content/content_common.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -178,19 +179,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -212,8 +212,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,19 +292,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -327,8 +326,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -401,7 +400,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_common.target.linux-x86.mk b/content/content_common.target.linux-x86.mk
index 149252b..349ffa4 100644
--- a/content/content_common.target.linux-x86.mk
+++ b/content/content_common.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
@@ -181,18 +182,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -214,8 +214,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -298,18 +298,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -332,8 +331,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -405,7 +404,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp \
 	ui_gl_gl_gyp \
 	webkit_support_glue_gyp
diff --git a/content/content_gpu.target.darwin-arm.mk b/content/content_gpu.target.darwin-arm.mk
index f1935e5..b27bfa9 100644
--- a/content/content_gpu.target.darwin-arm.mk
+++ b/content/content_gpu.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -76,17 +77,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -185,17 +185,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,8 +216,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_gpu.target.darwin-mips.mk b/content/content_gpu.target.darwin-mips.mk
index e397e36..87ab604 100644
--- a/content/content_gpu.target.darwin-mips.mk
+++ b/content/content_gpu.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -75,17 +76,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -106,8 +106,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,17 +183,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -215,8 +214,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -286,7 +285,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_gpu.target.darwin-x86.mk b/content/content_gpu.target.darwin-x86.mk
index 4bae0fc..e4f3a77 100644
--- a/content/content_gpu.target.darwin-x86.mk
+++ b/content/content_gpu.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -190,17 +190,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -222,8 +221,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_gpu.target.linux-arm.mk b/content/content_gpu.target.linux-arm.mk
index f1935e5..b27bfa9 100644
--- a/content/content_gpu.target.linux-arm.mk
+++ b/content/content_gpu.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -76,17 +77,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -185,17 +185,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,8 +216,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_gpu.target.linux-mips.mk b/content/content_gpu.target.linux-mips.mk
index e397e36..87ab604 100644
--- a/content/content_gpu.target.linux-mips.mk
+++ b/content/content_gpu.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -75,17 +76,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -106,8 +106,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,17 +183,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -215,8 +214,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -286,7 +285,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_gpu.target.linux-x86.mk b/content/content_gpu.target.linux-x86.mk
index 4bae0fc..e4f3a77 100644
--- a/content/content_gpu.target.linux-x86.mk
+++ b/content/content_gpu.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -190,17 +190,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -222,8 +221,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp
 
 # Enable grouping to fix circular references
diff --git a/content/content_jni_headers.target.darwin-arm.mk b/content/content_jni_headers.target.darwin-arm.mk
index 40fa239..2be2b59 100644
--- a/content/content_jni_headers.target.darwin-arm.mk
+++ b/content/content_jni_headers.target.darwin-arm.mk
@@ -424,10 +424,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -503,10 +503,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_jni_headers.target.darwin-mips.mk b/content/content_jni_headers.target.darwin-mips.mk
index 48f3987..a45bf54 100644
--- a/content/content_jni_headers.target.darwin-mips.mk
+++ b/content/content_jni_headers.target.darwin-mips.mk
@@ -423,10 +423,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -501,10 +501,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_jni_headers.target.darwin-x86.mk b/content/content_jni_headers.target.darwin-x86.mk
index 7736fdc..62d37bb 100644
--- a/content/content_jni_headers.target.darwin-x86.mk
+++ b/content/content_jni_headers.target.darwin-x86.mk
@@ -426,10 +426,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -508,10 +508,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_jni_headers.target.linux-arm.mk b/content/content_jni_headers.target.linux-arm.mk
index 40fa239..2be2b59 100644
--- a/content/content_jni_headers.target.linux-arm.mk
+++ b/content/content_jni_headers.target.linux-arm.mk
@@ -424,10 +424,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -503,10 +503,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_jni_headers.target.linux-mips.mk b/content/content_jni_headers.target.linux-mips.mk
index 48f3987..a45bf54 100644
--- a/content/content_jni_headers.target.linux-mips.mk
+++ b/content/content_jni_headers.target.linux-mips.mk
@@ -423,10 +423,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -501,10 +501,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_jni_headers.target.linux-x86.mk b/content/content_jni_headers.target.linux-x86.mk
index 7736fdc..62d37bb 100644
--- a/content/content_jni_headers.target.linux-x86.mk
+++ b/content/content_jni_headers.target.linux-x86.mk
@@ -426,10 +426,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -508,10 +508,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 852cd78..01a7048 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -19,7 +19,6 @@
     '../v8/tools/gyp/v8.gyp:v8',
     '../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
     '../webkit/common/webkit_common.gyp:webkit_common',
-    '../webkit/glue/webkit_glue_common.gyp:glue_common',
     '../webkit/plugins/webkit_plugins.gyp:plugins_common',
     '../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
     '../webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
@@ -29,7 +28,6 @@
     '../webkit/support/webkit_support.gyp:glue',
     '../webkit/support/webkit_support.gyp:glue_child',
     '../webkit/support/webkit_support.gyp:plugins',
-    '../webkit/support/webkit_support.gyp:webkit_media',
   ],
   'include_dirs': [
     '..',
@@ -189,6 +187,8 @@
     'renderer/media/crypto/key_systems.h',
     'renderer/media/crypto/key_systems_info.cc',
     'renderer/media/crypto/key_systems_info.h',
+    'renderer/media/crypto/ppapi_decryptor.cc',
+    'renderer/media/crypto/ppapi_decryptor.h',
     'renderer/media/crypto/proxy_decryptor.cc',
     'renderer/media/crypto/proxy_decryptor.h',
     'renderer/media/media_stream_audio_renderer.cc',
@@ -595,6 +595,12 @@
         'renderer/render_widget_fullscreen_pepper.h',
       ],
     }],
+    ['enable_pepper_cdms != 1', {
+      'sources!': [
+        'renderer/media/crypto/ppapi_decryptor.cc',
+        'renderer/media/crypto/ppapi_decryptor.h',
+      ],
+    }],
   ],
   'target_conditions': [
     ['OS=="android"', {
diff --git a/content/content_renderer.target.darwin-arm.mk b/content/content_renderer.target.darwin-arm.mk
index bd0929c..14112f8 100644
--- a/content/content_renderer.target.darwin-arm.mk
+++ b/content/content_renderer.target.darwin-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -231,18 +232,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -278,8 +278,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -373,18 +373,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -421,8 +420,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -515,7 +514,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_renderer.target.darwin-mips.mk b/content/content_renderer.target.darwin-mips.mk
index b99fc80..c476a1d 100644
--- a/content/content_renderer.target.darwin-mips.mk
+++ b/content/content_renderer.target.darwin-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -230,18 +231,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -277,8 +277,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -371,18 +371,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -419,8 +418,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -509,7 +508,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_renderer.target.darwin-x86.mk b/content/content_renderer.target.darwin-x86.mk
index e16204d..0d0f8fa 100644
--- a/content/content_renderer.target.darwin-x86.mk
+++ b/content/content_renderer.target.darwin-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -233,17 +234,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -279,8 +279,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -377,17 +377,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -424,8 +423,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -513,7 +512,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_renderer.target.linux-arm.mk b/content/content_renderer.target.linux-arm.mk
index bd0929c..14112f8 100644
--- a/content/content_renderer.target.linux-arm.mk
+++ b/content/content_renderer.target.linux-arm.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -231,18 +232,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -278,8 +278,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -373,18 +373,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -421,8 +420,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -515,7 +514,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_renderer.target.linux-mips.mk b/content/content_renderer.target.linux-mips.mk
index b99fc80..c476a1d 100644
--- a/content/content_renderer.target.linux-mips.mk
+++ b/content/content_renderer.target.linux-mips.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -230,18 +231,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -277,8 +277,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -371,18 +371,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -419,8 +418,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -509,7 +508,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_renderer.target.linux-x86.mk b/content/content_renderer.target.linux-x86.mk
index e16204d..0d0f8fa 100644
--- a/content/content_renderer.target.linux-x86.mk
+++ b/content/content_renderer.target.linux-x86.mk
@@ -13,7 +13,8 @@
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,content_content_resources_gyp)/content_resources.stamp \
 	$(call intermediates-dir-for,GYP,jingle_jingle_glue_gyp)/jingle_glue.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
@@ -233,17 +234,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -279,8 +279,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -377,17 +377,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DFEATURE_ENABLE_SSL' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
@@ -424,8 +423,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/content \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -513,7 +512,7 @@
 
 LOCAL_STATIC_LIBRARIES := \
 	cpufeatures \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	webkit_support_glue_gyp \
 	webkit_support_glue_child_gyp \
 	third_party_libphonenumber_libphonenumber_without_metadata_gyp
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 8bfba6f..129c2a2 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -85,8 +85,8 @@
         'shell/common/webkit_test_helpers.h',
         'shell/geolocation/shell_access_token_store.cc',
         'shell/geolocation/shell_access_token_store.h',
-        'shell/minimal_ash.cc',
-        'shell/minimal_ash.h',
+        'shell/minimal_shell.cc',
+        'shell/minimal_shell.h',
         'shell/notify_done_forwarder.cc',
         'shell/notify_done_forwarder.h',
         'shell/renderer/shell_content_renderer_client.cc',
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 9083289..9e2564d 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -588,7 +588,6 @@
             '../ui/gl/gl.gyp:gl',
             '../v8/tools/gyp/v8.gyp:v8',
             '../webkit/common/webkit_common.gyp:webkit_common',
-            '../webkit/glue/webkit_glue_common.gyp:glue_common',
             '../webkit/plugins/webkit_plugins.gyp:plugins_common',
             '../webkit/renderer/webkit_renderer.gyp:webkit_renderer',
             '../webkit/storage_browser.gyp:webkit_storage_browser',
@@ -598,7 +597,6 @@
             '../webkit/support/webkit_support.gyp:glue_child',
             '../webkit/support/webkit_support.gyp:plugins',
             '../webkit/plugins/webkit_plugins.gyp:plugins_common',
-            '../webkit/support/webkit_support.gyp:webkit_media',
           ],
         }],
         ['enable_plugins==0', {
diff --git a/content/content_utility.target.darwin-arm.mk b/content/content_utility.target.darwin-arm.mk
index 4ad64ed..e1430ac 100644
--- a/content/content_utility.target.darwin-arm.mk
+++ b/content/content_utility.target.darwin-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_utility.target.darwin-mips.mk b/content/content_utility.target.darwin-mips.mk
index 9ccf0b5..7ce4b89 100644
--- a/content/content_utility.target.darwin-mips.mk
+++ b/content/content_utility.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_utility.target.darwin-x86.mk b/content/content_utility.target.darwin-x86.mk
index 349903a..b722f62 100644
--- a/content/content_utility.target.darwin-x86.mk
+++ b/content/content_utility.target.darwin-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_utility.target.linux-arm.mk b/content/content_utility.target.linux-arm.mk
index 4ad64ed..e1430ac 100644
--- a/content/content_utility.target.linux-arm.mk
+++ b/content/content_utility.target.linux-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_utility.target.linux-mips.mk b/content/content_utility.target.linux-mips.mk
index 9ccf0b5..7ce4b89 100644
--- a/content/content_utility.target.linux-mips.mk
+++ b/content/content_utility.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_utility.target.linux-x86.mk b/content/content_utility.target.linux-x86.mk
index 349903a..b722f62 100644
--- a/content/content_utility.target.linux-x86.mk
+++ b/content/content_utility.target.linux-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/content_worker.target.darwin-arm.mk b/content/content_worker.target.darwin-arm.mk
index 3d2168c..71ede02 100644
--- a/content/content_worker.target.darwin-arm.mk
+++ b/content/content_worker.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -110,8 +110,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -191,17 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -224,8 +223,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_worker.target.darwin-mips.mk b/content/content_worker.target.darwin-mips.mk
index 4f73e22..1d0c4e4 100644
--- a/content/content_worker.target.darwin-mips.mk
+++ b/content/content_worker.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -77,17 +78,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,17 +189,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -222,8 +221,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -297,7 +296,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_worker.target.darwin-x86.mk b/content/content_worker.target.darwin-x86.mk
index 6ef095c..79514c2 100644
--- a/content/content_worker.target.darwin-x86.mk
+++ b/content/content_worker.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -80,17 +81,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -112,8 +112,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,17 +196,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -229,8 +228,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_worker.target.linux-arm.mk b/content/content_worker.target.linux-arm.mk
index 3d2168c..71ede02 100644
--- a/content/content_worker.target.linux-arm.mk
+++ b/content/content_worker.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -78,17 +79,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -110,8 +110,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -191,17 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -224,8 +223,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_worker.target.linux-mips.mk b/content/content_worker.target.linux-mips.mk
index 4f73e22..1d0c4e4 100644
--- a/content/content_worker.target.linux-mips.mk
+++ b/content/content_worker.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -77,17 +78,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,17 +189,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -222,8 +221,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -297,7 +296,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/content_worker.target.linux-x86.mk b/content/content_worker.target.linux-x86.mk
index 6ef095c..79514c2 100644
--- a/content/content_worker.target.linux-x86.mk
+++ b/content/content_worker.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
@@ -80,17 +81,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -112,8 +112,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,17 +196,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -229,8 +228,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index df6797a..170b364 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -77,6 +77,7 @@
 }
 
 void GpuChildThread::Shutdown() {
+  ChildThread::Shutdown();
   logging::SetLogMessageHandler(NULL);
 }
 
diff --git a/content/java_set_jni_headers.target.darwin-arm.mk b/content/java_set_jni_headers.target.darwin-arm.mk
index 92e4609..3683fa9 100644
--- a/content/java_set_jni_headers.target.darwin-arm.mk
+++ b/content/java_set_jni_headers.target.darwin-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/java_set_jni_headers.target.darwin-mips.mk b/content/java_set_jni_headers.target.darwin-mips.mk
index 8c6ae4f..de65396 100644
--- a/content/java_set_jni_headers.target.darwin-mips.mk
+++ b/content/java_set_jni_headers.target.darwin-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/java_set_jni_headers.target.darwin-x86.mk b/content/java_set_jni_headers.target.darwin-x86.mk
index d536a24..0989eef 100644
--- a/content/java_set_jni_headers.target.darwin-x86.mk
+++ b/content/java_set_jni_headers.target.darwin-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/java_set_jni_headers.target.linux-arm.mk b/content/java_set_jni_headers.target.linux-arm.mk
index 92e4609..3683fa9 100644
--- a/content/java_set_jni_headers.target.linux-arm.mk
+++ b/content/java_set_jni_headers.target.linux-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/java_set_jni_headers.target.linux-mips.mk b/content/java_set_jni_headers.target.linux-mips.mk
index 8c6ae4f..de65396 100644
--- a/content/java_set_jni_headers.target.linux-mips.mk
+++ b/content/java_set_jni_headers.target.linux-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/java_set_jni_headers.target.linux-x86.mk b/content/java_set_jni_headers.target.linux-x86.mk
index d536a24..0989eef 100644
--- a/content/java_set_jni_headers.target.linux-x86.mk
+++ b/content/java_set_jni_headers.target.linux-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.darwin-arm.mk b/content/page_transition_types_java.target.darwin-arm.mk
index c77b6fc..e5fcd44 100644
--- a/content/page_transition_types_java.target.darwin-arm.mk
+++ b/content/page_transition_types_java.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.darwin-mips.mk b/content/page_transition_types_java.target.darwin-mips.mk
index 93630a3..d0dff22 100644
--- a/content/page_transition_types_java.target.darwin-mips.mk
+++ b/content/page_transition_types_java.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.darwin-x86.mk b/content/page_transition_types_java.target.darwin-x86.mk
index 9c6852a..ecaa4d1 100644
--- a/content/page_transition_types_java.target.darwin-x86.mk
+++ b/content/page_transition_types_java.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.linux-arm.mk b/content/page_transition_types_java.target.linux-arm.mk
index c77b6fc..e5fcd44 100644
--- a/content/page_transition_types_java.target.linux-arm.mk
+++ b/content/page_transition_types_java.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.linux-mips.mk b/content/page_transition_types_java.target.linux-mips.mk
index 93630a3..d0dff22 100644
--- a/content/page_transition_types_java.target.linux-mips.mk
+++ b/content/page_transition_types_java.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/page_transition_types_java.target.linux-x86.mk b/content/page_transition_types_java.target.linux-x86.mk
index 9c6852a..ecaa4d1 100644
--- a/content/page_transition_types_java.target.linux-x86.mk
+++ b/content/page_transition_types_java.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/plugin/plugin_thread.cc b/content/plugin/plugin_thread.cc
index ec74d2e..5faeb74 100644
--- a/content/plugin/plugin_thread.cc
+++ b/content/plugin/plugin_thread.cc
@@ -139,6 +139,8 @@
 }
 
 void PluginThread::Shutdown() {
+  ChildThread::Shutdown();
+
   if (preloaded_plugin_module_) {
     base::UnloadNativeLibrary(preloaded_plugin_module_);
     preloaded_plugin_module_ = NULL;
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index bc7e3f9..e86056e 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -883,12 +883,6 @@
         return Color.WHITE;
     }
 
-    public void setBackgroundColor(int color) {
-        if (mNativeContentViewCore != 0 && getBackgroundColor() != color) {
-            nativeSetBackgroundColor(mNativeContentViewCore, color);
-        }
-    }
-
     @CalledByNative
     private void onBackgroundColorChanged(int color) {
         getContentViewClient().onBackgroundColorChanged(color);
@@ -3101,8 +3095,6 @@
 
     private native int nativeGetBackgroundColor(int nativeContentViewCoreImpl);
 
-    private native void nativeSetBackgroundColor(int nativeContentViewCoreImpl, int color);
-
     private native void nativeOnShow(int nativeContentViewCoreImpl);
     private native void nativeOnHide(int nativeContentViewCoreImpl);
 
diff --git a/content/public/browser/child_process_security_policy.h b/content/public/browser/child_process_security_policy.h
index 9295c34..2ab2d1a 100644
--- a/content/public/browser/child_process_security_policy.h
+++ b/content/public/browser/child_process_security_policy.h
@@ -40,11 +40,7 @@
   // Returns true iff |scheme| has been registered as a web-safe scheme.
   virtual bool IsWebSafeScheme(const std::string& scheme) = 0;
 
-  // Before servicing a child process's request to upload a file to the web, the
-  // browser should call this method to determine whether the process has the
-  // capability to upload the requested file.
-  virtual bool CanReadFile(int child_id, const base::FilePath& file) = 0;
-
+  // This permission grants only read access to a file.
   // Whenever the user picks a file from a <input type="file"> element, the
   // browser should call this function to grant the child process the capability
   // to upload the file to the web. Grants FILE_PERMISSION_READ_ONLY.
@@ -59,6 +55,17 @@
   virtual void GrantCreateWriteFile(int child_id,
                                     const base::FilePath& file) = 0;
 
+  // These methods verify whether or not the child process has been granted
+  // permissions perform these functions on |file|.
+
+  // Before servicing a child process's request to upload a file to the web, the
+  // browser should call this method to determine whether the process has the
+  // capability to upload the requested file.
+  virtual bool CanReadFile(int child_id, const base::FilePath& file) = 0;
+  virtual bool CanWriteFile(int child_id, const base::FilePath& file) = 0;
+  virtual bool CanCreateFile(int child_id, const base::FilePath& file) = 0;
+  virtual bool CanCreateWriteFile(int child_id, const base::FilePath& file) = 0;
+
   // Grants read access permission to the given isolated file system
   // identified by |filesystem_id|. An isolated file system can be
   // created for a set of native files/directories (like dropped files)
@@ -99,19 +106,27 @@
       int child_id,
       const std::string& filesystem_id) = 0;
 
+  // Grants permission to copy-into filesystem |filesystem_id|. 'copy-into'
+  // is used to allow copying files into the destination filesystem without
+  // granting more general create and write permissions.
+  virtual void GrantCopyIntoFileSystem(int child_id,
+                                       const std::string& filesystem_id) = 0;
+
   // Grants the child process the capability to access URLs of the provided
   // scheme.
   virtual void GrantScheme(int child_id, const std::string& scheme) = 0;
 
-  // Returns true iff read access has been granted to the file system with
-  // |filesystem_id|.
+  // Returns true if read access has been granted to |filesystem_id|.
   virtual bool CanReadFileSystem(int child_id,
                                  const std::string& filesystem_id) = 0;
 
-  // Returns true iff read and write access has been granted to the filesystem
-  // with |filesystem_id|.
+  // Returns true if read and write access has been granted to |filesystem_id|.
   virtual bool CanReadWriteFileSystem(int child_id,
                                       const std::string& filesystem_id) = 0;
+
+  // Returns true if copy-into access has been granted to |filesystem_id|.
+  virtual bool CanCopyIntoFileSystem(int child_id,
+                                     const std::string& filesystem_id) = 0;
 };
 
 };  // namespace content
diff --git a/content/public/browser/download_danger_type.h b/content/public/browser/download_danger_type.h
index fbd7aef..bf175c0 100644
--- a/content/public/browser/download_danger_type.h
+++ b/content/public/browser/download_danger_type.h
@@ -41,6 +41,9 @@
   // known to serve mostly malicious content.
   DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST,
 
+  // Applications and extensions that modify browser and/or system settings
+  DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED,
+
   // Memory space for histograms is determined by the max.
   // ALWAYS ADD NEW VALUES BEFORE THIS ONE.
   DOWNLOAD_DANGER_TYPE_MAX
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h
index 382612b..0f77d7e 100644
--- a/content/public/browser/navigation_controller.h
+++ b/content/public/browser/navigation_controller.h
@@ -335,10 +335,10 @@
 
   // Removing of entries -------------------------------------------------------
 
-  // Removes the entry at the specified |index|.  This call dicards any pending
-  // and transient entries.  If the index is the last committed index, this does
-  // nothing and returns false.
-  virtual void RemoveEntryAtIndex(int index) = 0;
+  // Removes the entry at the specified |index|.  This call discards any
+  // transient entries.  If the index is the last committed index or the pending
+  // entry, this does nothing and returns false.
+  virtual bool RemoveEntryAtIndex(int index) = 0;
 
   // Random --------------------------------------------------------------------
 
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index d490122..6810002 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -127,8 +127,11 @@
     WindowContainerType window_container_type,
     const string16& frame_name,
     const GURL& target_url,
+    const Referrer& referrer,
     WindowOpenDisposition disposition,
-    bool user_gesture) {
+    const WebKit::WebWindowFeatures& features,
+    bool user_gesture,
+    bool opener_suppressed) {
   return true;
 }
 
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index ac86a62..34f6597 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -43,6 +43,7 @@
 struct DropData;
 struct FileChooserParams;
 struct NativeWebKeyboardEvent;
+struct Referrer;
 struct SSLStatus;
 }
 
@@ -54,6 +55,7 @@
 
 namespace WebKit {
 class WebLayer;
+struct WebWindowFeatures;
 }
 
 namespace content {
@@ -294,8 +296,11 @@
       WindowContainerType window_container_type,
       const string16& frame_name,
       const GURL& target_url,
+      const Referrer& referrer,
       WindowOpenDisposition disposition,
-      bool user_gesture);
+      const WebKit::WebWindowFeatures& features,
+      bool user_gesture,
+      bool opener_suppressed);
 
   // Notifies the delegate about the creation of a new WebContents. This
   // typically happens when popups are created.
diff --git a/content/public/common/content_client.cc b/content/public/common/content_client.cc
index 2e07275..d4d00c0 100644
--- a/content/public/common/content_client.cc
+++ b/content/public/common/content_client.cc
@@ -9,10 +9,6 @@
 #include "ui/gfx/image/image.h"
 #include "webkit/common/user_agent/user_agent.h"
 
-#if defined(ENABLE_PLUGINS)
-#include "webkit/plugins/ppapi/host_globals.h"
-#endif
-
 namespace content {
 
 static ContentClient* g_client;
@@ -70,14 +66,6 @@
   return webkit_glue::GetUserAgent(url);
 }
 
-webkit::ppapi::HostGlobals* GetHostGlobals() {
-#if defined(ENABLE_PLUGINS)
-  return webkit::ppapi::HostGlobals::Get();
-#else
-  return NULL;
-#endif
-}
-
 ContentClient::ContentClient()
     : browser_(NULL), plugin_(NULL), renderer_(NULL), utility_(NULL) {
 }
diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h
index 10c61e3..e2e0c73 100644
--- a/content/public/common/content_client.h
+++ b/content/public/common/content_client.h
@@ -38,12 +38,6 @@
 class TargetPolicy;
 }
 
-namespace webkit {
-namespace ppapi {
-class HostGlobals;
-}
-}
-
 namespace content {
 
 class ContentBrowserClient;
@@ -81,10 +75,6 @@
 // webkit_glue.
 CONTENT_EXPORT const std::string& GetUserAgent(const GURL& url);
 
-// Returns the PPAPI global singleton. See webkit/plugins/ppapi/host_globals.h
-// TODO(dpranke): Also needed since webkit_glue is a library.
-CONTENT_EXPORT webkit::ppapi::HostGlobals* GetHostGlobals();
-
 // Interface that the embedder implements.
 class CONTENT_EXPORT ContentClient {
  public:
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index bc9565c..1d37ed4 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -158,6 +158,11 @@
   return false;
 }
 
+const void* ContentRendererClient::CreatePPAPIInterface(
+    const std::string& interface_name) {
+  return NULL;
+}
+
 bool ContentRendererClient::IsPluginAllowedToCallRequestOSFileHandle(
     WebKit::WebPluginContainer* container) const {
   return false;
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index dd75eb1..080d5ca 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -47,12 +47,6 @@
 struct WebURLError;
 }
 
-namespace webkit {
-namespace ppapi {
-class PpapiInterfaceFactoryManager;
-}
-}
-
 namespace content {
 
 class RenderView;
@@ -232,8 +226,9 @@
                                       const GURL& first_party_for_cookies,
                                       const std::string& value);
 
-  virtual void RegisterPPAPIInterfaceFactories(
-      webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {}
+  // Allows an embedder to return custom PPAPI interfaces.
+  virtual const void* CreatePPAPIInterface(
+      const std::string& interface_name);
 
   // Returns true if plugin living in the container can use
   // pp::FileIO::RequestOSFileHandle.
diff --git a/content/public/renderer/renderer_ppapi_host.h b/content/public/renderer/renderer_ppapi_host.h
index 8d2e585..5b33f7b 100644
--- a/content/public/renderer/renderer_ppapi_host.h
+++ b/content/public/renderer/renderer_ppapi_host.h
@@ -22,12 +22,10 @@
 }
 
 namespace IPC {
-struct ChannelHandle;
 class Message;
 }
 
 namespace ppapi {
-class PpapiPermissions;
 namespace host {
 class PpapiHost;
 }
@@ -54,20 +52,6 @@
 // There will be one of these objects in the renderer per plugin module.
 class RendererPpapiHost {
  public:
-  // Creates a host and sets up an out-of-process proxy for an external plugin
-  // module. |file_path| should identify the module. It is only used to report
-  // failures to the renderer.
-  // Returns a host if the external module is proxied successfully, otherwise
-  // returns NULL.
-  CONTENT_EXPORT static RendererPpapiHost* CreateExternalPluginModule(
-      scoped_refptr<webkit::ppapi::PluginModule> plugin_module,
-      webkit::ppapi::PluginInstance* plugin_instance,
-      const base::FilePath& file_path,
-      ppapi::PpapiPermissions permissions,
-      const IPC::ChannelHandle& channel_handle,
-      base::ProcessId plugin_pid,
-      int plugin_child_id);
-
   // Returns the RendererPpapiHost associated with the given PP_Instance,
   // or NULL if the instance is invalid.
   CONTENT_EXPORT static RendererPpapiHost* GetForPPInstance(
diff --git a/content/public/test/mock_resource_context.cc b/content/public/test/mock_resource_context.cc
index 2758c2f..adbb6b5 100644
--- a/content/public/test/mock_resource_context.cc
+++ b/content/public/test/mock_resource_context.cc
@@ -5,12 +5,16 @@
 #include "content/public/test/mock_resource_context.h"
 
 #include "net/url_request/url_request_context.h"
-#include "net/url_request/url_request_test_util.h"
 
 namespace content {
 
 MockResourceContext::MockResourceContext()
-    : test_request_context_(new net::TestURLRequestContext) {
+  : test_request_context_(NULL) {
+}
+
+MockResourceContext::MockResourceContext(
+    net::URLRequestContext* test_request_context)
+  : test_request_context_(test_request_context) {
 }
 
 MockResourceContext::~MockResourceContext() {}
@@ -20,7 +24,8 @@
 }
 
 net::URLRequestContext* MockResourceContext::GetRequestContext()  {
-  return test_request_context_.get();
+  CHECK(test_request_context_);
+  return test_request_context_;
 }
 
 }  // namespace content
diff --git a/content/public/test/mock_resource_context.h b/content/public/test/mock_resource_context.h
index b29cbbe..e42f5c6 100644
--- a/content/public/test/mock_resource_context.h
+++ b/content/public/test/mock_resource_context.h
@@ -10,11 +10,19 @@
 #include "base/memory/scoped_ptr.h"
 #include "content/public/browser/resource_context.h"
 
+namespace net {
+class URLRequestContext;
+}
+
 namespace content {
 
 class MockResourceContext : public ResourceContext {
  public:
   MockResourceContext();
+
+  // Does not take ownership of |test_request_context|.
+  explicit MockResourceContext(net::URLRequestContext* test_request_context);
+
   virtual ~MockResourceContext();
 
   // ResourceContext implementation:
@@ -22,7 +30,7 @@
   virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
 
  private:
-  scoped_ptr<net::URLRequestContext> test_request_context_;
+  net::URLRequestContext* test_request_context_;
 
   DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
 };
diff --git a/content/public/test/test_browser_context.cc b/content/public/test/test_browser_context.cc
index ae2fcff..907f748 100644
--- a/content/public/test/test_browser_context.cc
+++ b/content/public/test/test_browser_context.cc
@@ -9,6 +9,7 @@
 #include "content/public/test/mock_resource_context.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
+#include "net/url_request/url_request_test_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webkit/browser/quota/special_storage_policy.h"
 
@@ -16,13 +17,12 @@
 
 class TestContextURLRequestContextGetter : public net::URLRequestContextGetter {
  public:
-  explicit TestContextURLRequestContextGetter(net::URLRequestContext* context)
-      : context_(context),
-        null_task_runner_(new base::NullTaskRunner) {
+  TestContextURLRequestContextGetter()
+      : null_task_runner_(new base::NullTaskRunner) {
   }
 
   virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE {
-    return context_;
+    return &context_;
   }
 
   virtual scoped_refptr<base::SingleThreadTaskRunner>
@@ -33,7 +33,7 @@
  private:
   virtual ~TestContextURLRequestContextGetter() {}
 
-  net::URLRequestContext* context_;
+  net::TestURLRequestContext context_;
   scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_;
 };
 
@@ -71,8 +71,7 @@
 
 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() {
   if (!request_context_.get()) {
-    request_context_ = new TestContextURLRequestContextGetter(
-        GetResourceContext()->GetRequestContext());
+    request_context_ = new TestContextURLRequestContextGetter();
   }
   return request_context_.get();
 }
@@ -110,7 +109,8 @@
 
 ResourceContext* TestBrowserContext::GetResourceContext() {
   if (!resource_context_)
-    resource_context_.reset(new MockResourceContext());
+    resource_context_.reset(new MockResourceContext(
+        GetRequestContext()->GetURLRequestContext()));
   return resource_context_.get();
 }
 
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index e7b711f..4483c58 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -71,6 +71,8 @@
       return browser_plugin::kPermissionTypeNewWindow;
     case BrowserPluginPermissionTypePointerLock:
       return browser_plugin::kPermissionTypePointerLock;
+    case BrowserPluginPermissionTypeJavaScriptDialog:
+      return browser_plugin::kPermissionTypeDialog;
     case BrowserPluginPermissionTypeUnknown:
     default:
       NOTREACHED();
@@ -503,11 +505,14 @@
   // The New Window API is very similiar to the permission API in structure,
   // but exposes a slightly different interface to the developer and so we put
   // it in a separate event.
-  const char* event_name =
-      (permission_type == BrowserPluginPermissionTypeNewWindow) ?
-          browser_plugin::kEventNewWindow :
-              browser_plugin::kEventRequestPermission;
-
+  const char* event_name = NULL;
+  if (permission_type == BrowserPluginPermissionTypeNewWindow) {
+    event_name = browser_plugin::kEventNewWindow;
+  } else if (permission_type == BrowserPluginPermissionTypeJavaScriptDialog) {
+    event_name = browser_plugin::kEventDialog;
+  } else {
+    event_name = browser_plugin::kEventRequestPermission;
+  }
   AddPermissionRequestToSet(request_id);
 
   std::map<std::string, base::Value*> props;
@@ -974,25 +979,29 @@
   return container_;
 }
 
-void BrowserPlugin::RespondPermission(int request_id, bool allow) {
+void BrowserPlugin::RespondPermission(
+    int request_id, bool allow, const std::string& user_input) {
   browser_plugin_manager()->Send(
       new BrowserPluginHostMsg_RespondPermission(
-          render_view_routing_id_, guest_instance_id_, request_id, allow));
+          render_view_routing_id_, guest_instance_id_,
+          request_id, allow, user_input));
 }
 
 void BrowserPlugin::RespondPermissionIfRequestIsPending(
-    int request_id, bool allow) {
+    int request_id, bool allow, const std::string& user_input) {
   PendingPermissionRequests::iterator iter =
       pending_permission_requests_.find(request_id);
   if (iter == pending_permission_requests_.end())
     return;
 
   pending_permission_requests_.erase(iter);
-  RespondPermission(request_id, allow);
+  RespondPermission(request_id, allow, user_input);
 }
 
-void BrowserPlugin::OnEmbedderDecidedPermission(int request_id, bool allow) {
-  RespondPermissionIfRequestIsPending(request_id, allow);
+void BrowserPlugin::OnEmbedderDecidedPermission(int request_id,
+                                                bool allow,
+                                                const std::string& user_input) {
+  RespondPermissionIfRequestIsPending(request_id, allow, user_input);
 }
 
 bool BrowserPlugin::initialize(WebPluginContainer* container) {
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index b0717a8..61f5a98 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -130,7 +130,8 @@
 
   gfx::Point ToLocalCoordinates(const gfx::Point& point) const;
   // Called by browser plugin binding.
-  void OnEmbedderDecidedPermission(int request_id, bool allow);
+  void OnEmbedderDecidedPermission(int request_id, bool allow,
+                                   const std::string& user_input);
 
   // Called when a guest instance ID has been allocated by the browser process.
   void OnInstanceIDAllocated(int guest_instance_id);
@@ -292,12 +293,16 @@
 
   // Informs the BrowserPlugin that the guest's permission request has been
   // allowed or denied by the embedder.
-  void RespondPermission(int request_id, bool allow);
+  void RespondPermission(int request_id,
+                         bool allow,
+                         const std::string& user_input);
 
   // If the request with id |request_id| is pending then informs the
   // BrowserPlugin that the guest's permission request has been allowed or
   // denied by the embedder.
-  void RespondPermissionIfRequestIsPending(int request_id, bool allow);
+  void RespondPermissionIfRequestIsPending(int request_id,
+                                           bool allow,
+                                           const std::string& user_input);
 
   // Called when the tracked object of |id| ID becomes unreachable in
   // JavaScript.
diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc
index fb40d00..13052c2 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -353,7 +353,7 @@
  public:
   BrowserPluginBindingSetPermission()
       : BrowserPluginMethodBinding(
-          browser_plugin::kMethodInternalSetPermission, 2) {
+          browser_plugin::kMethodInternalSetPermission, 3) {
   }
 
   virtual bool Invoke(BrowserPluginBindings* bindings,
@@ -361,7 +361,9 @@
                       NPVariant* result) OVERRIDE {
     int request_id = IntFromNPVariant(args[0]);
     bool allow = NPVARIANT_TO_BOOLEAN(args[1]);
-    bindings->instance()->OnEmbedderDecidedPermission(request_id, allow);
+    std::string user_input = StringFromNPVariant(args[2]);
+    bindings->instance()->OnEmbedderDecidedPermission(
+        request_id, allow, user_input);
     return true;
   }
 
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index da32d22..323039f 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -359,6 +359,10 @@
   layer_tree_host_->SetLatencyInfo(latency_info);
 }
 
+int RenderWidgetCompositor::GetLayerTreeId() const {
+  return layer_tree_host_->id();
+}
+
 bool RenderWidgetCompositor::initialize(cc::LayerTreeSettings settings) {
   scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy =
       RenderThreadImpl::current()->compositor_message_loop_proxy();
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h
index b49f6b9..b6fa9af 100644
--- a/content/renderer/gpu/render_widget_compositor.h
+++ b/content/renderer/gpu/render_widget_compositor.h
@@ -49,6 +49,7 @@
   void SetOverdrawBottomHeight(float overdraw_bottom_height);
   void SetNeedsRedrawRect(gfx::Rect damage_rect);
   void SetLatencyInfo(const ui::LatencyInfo& latency_info);
+  int GetLayerTreeId() const;
 
   // WebLayerTreeView implementation.
   virtual void setSurfaceReady();
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 80419f3..dd608bb 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -876,7 +876,7 @@
 
 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) {
   is_playing_ = is_playing;
-  if (source_type_ != MediaPlayerAndroid::SOURCE_TYPE_MSE || !delegate_)
+  if (!delegate_)
     return;
   if (is_playing)
     delegate_->DidPlay(this);
diff --git a/content/renderer/media/crypto/content_decryption_module_factory.cc b/content/renderer/media/crypto/content_decryption_module_factory.cc
index d3eb9e1..85cf3a4 100644
--- a/content/renderer/media/crypto/content_decryption_module_factory.cc
+++ b/content/renderer/media/crypto/content_decryption_module_factory.cc
@@ -9,21 +9,17 @@
 #include "media/crypto/aes_decryptor.h"
 
 #if defined(ENABLE_PEPPER_CDMS)
+#include "content/renderer/media/crypto/ppapi_decryptor.h"
 #include "third_party/WebKit/public/platform/WebString.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
 #include "third_party/WebKit/public/web/WebMediaPlayerClient.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
-#include "webkit/renderer/media/crypto/ppapi_decryptor.h"
 #elif defined(OS_ANDROID)
 #include "content/renderer/media/android/proxy_media_keys.h"
 #include "content/renderer/media/android/webmediaplayer_proxy_android.h"
 #endif  // defined(ENABLE_PEPPER_CDMS)
 
-#if defined(ENABLE_PEPPER_CDMS)
-using webkit_media::PpapiDecryptor;
-#endif  // defined(ENABLE_PEPPER_CDMS)
-
 namespace content {
 
 #if defined(ENABLE_PEPPER_CDMS)
diff --git a/webkit/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc
similarity index 93%
rename from webkit/renderer/media/crypto/ppapi_decryptor.cc
rename to content/renderer/media/crypto/ppapi_decryptor.cc
index f105bd3..74188fb 100644
--- a/webkit/renderer/media/crypto/ppapi_decryptor.cc
+++ b/content/renderer/media/crypto/ppapi_decryptor.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "webkit/renderer/media/crypto/ppapi_decryptor.h"
+#include "content/renderer/media/crypto/ppapi_decryptor.h"
 
 #include <string>
 
@@ -20,9 +20,9 @@
 #include "webkit/plugins/ppapi/content_decryptor_delegate.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
 
-namespace webkit_media {
+namespace content {
 
-scoped_ptr<webkit_media::PpapiDecryptor> PpapiDecryptor::Create(
+scoped_ptr<PpapiDecryptor> PpapiDecryptor::Create(
     const std::string& key_system,
     const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance,
     const media::KeyAddedCB& key_added_cb,
@@ -33,18 +33,17 @@
       plugin_instance->GetContentDecryptorDelegate();
   if (!plugin_cdm_delegate) {
     DVLOG(1) << "PpapiDecryptor: plugin cdm delegate creation failed.";
-    return scoped_ptr<webkit_media::PpapiDecryptor>();
+    return scoped_ptr<PpapiDecryptor>();
   }
 
   plugin_cdm_delegate->Initialize(key_system);
 
-  return scoped_ptr<webkit_media::PpapiDecryptor>(
-      new PpapiDecryptor(plugin_instance,
-                         plugin_cdm_delegate,
-                         key_added_cb,
-                         key_error_cb,
-                         key_message_cb,
-                         destroy_plugin_cb));
+  return scoped_ptr<PpapiDecryptor>(new PpapiDecryptor(plugin_instance,
+                                                       plugin_cdm_delegate,
+                                                       key_added_cb,
+                                                       key_error_cb,
+                                                       key_message_cb,
+                                                       destroy_plugin_cb));
 }
 
 PpapiDecryptor::PpapiDecryptor(
@@ -305,4 +304,4 @@
   key_message_cb_.Run(session_id, message, default_url);
 }
 
-}  // namespace webkit_media
+}  // namespace content
diff --git a/webkit/renderer/media/crypto/ppapi_decryptor.h b/content/renderer/media/crypto/ppapi_decryptor.h
similarity index 94%
rename from webkit/renderer/media/crypto/ppapi_decryptor.h
rename to content/renderer/media/crypto/ppapi_decryptor.h
index 4e03bac..914dbba 100644
--- a/webkit/renderer/media/crypto/ppapi_decryptor.h
+++ b/content/renderer/media/crypto/ppapi_decryptor.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
-#define WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
+#ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
+#define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
 
 #include <string>
 #include <vector>
@@ -26,14 +26,14 @@
 }
 }
 
-namespace webkit_media {
+namespace content {
 
 // PpapiDecryptor implements media::Decryptor and forwards all calls to the
 // PluginInstance.
 // This class should always be created & destroyed on the main renderer thread.
 class PpapiDecryptor : public media::MediaKeys, public media::Decryptor {
  public:
-  static scoped_ptr<webkit_media::PpapiDecryptor> Create(
+  static scoped_ptr<PpapiDecryptor> Create(
       // TODO(ddorwin): Remove after updating the delegate.
       const std::string& key_system,
       const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance,
@@ -124,6 +124,6 @@
   DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
 };
 
-}  // namespace webkit_media
+}  // namespace content
 
-#endif  // WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
+#endif  // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index 27a0b2a..2b44c5e 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -27,7 +27,7 @@
 #include "content/renderer/p2p/port_allocator.h"
 #include "content/renderer/render_thread_impl.h"
 #include "jingle/glue/thread_wrapper.h"
-#include "media/filters/gpu_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
 #include "third_party/WebKit/public/platform/WebMediaStream.h"
 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
@@ -498,7 +498,7 @@
 
     const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
     if (cmd_line->HasSwitch(switches::kEnableWebRtcHWDecoding)) {
-      scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories =
+      scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories =
           RenderThreadImpl::current()->GetGpuFactories();
       if (gpu_factories.get() != NULL)
         decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.h b/content/renderer/media/renderer_gpu_video_decoder_factories.h
index 2e6f0d9..7f7426b 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.h
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.h
@@ -12,7 +12,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/synchronization/waitable_event.h"
 #include "content/common/content_export.h"
-#include "media/filters/gpu_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/gfx/size.h"
 
@@ -36,7 +36,7 @@
 // renderer thread if threaded compositing is disabled), and shmem-related calls
 // go to the render thread.
 class CONTENT_EXPORT RendererGpuVideoDecoderFactories
-    : public media::GpuVideoDecoder::Factories {
+    : public media::GpuVideoDecoderFactories {
  public:
   // Takes a ref on |gpu_channel_host| and tests |context| for loss before each
   // use.
@@ -45,7 +45,7 @@
       const scoped_refptr<base::MessageLoopProxy>& compositor_message_loop,
       WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
 
-  // media::GpuVideoDecoder::Factories implementation.
+  // media::GpuVideoDecoderFactories implementation.
   virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
       media::VideoCodecProfile profile,
       media::VideoDecodeAccelerator::Client* client) OVERRIDE;
diff --git a/content/renderer/media/rtc_encoding_video_capturer.cc b/content/renderer/media/rtc_encoding_video_capturer.cc
index ff022d4..9561c83 100644
--- a/content/renderer/media/rtc_encoding_video_capturer.cc
+++ b/content/renderer/media/rtc_encoding_video_capturer.cc
@@ -9,6 +9,12 @@
 
 namespace content {
 
+namespace {
+
+static const unsigned int kMaxBitrateKbps = 50 * 1000;
+
+}  // namespace
+
 // Client of EncodedVideoSource. This object is created and owned by the
 // RtcEncodingVideoCapturer.
 class RtcEncodingVideoCapturer::EncodedVideoSourceClient :
@@ -34,6 +40,12 @@
   void set_round_trip_time(base::TimeDelta round_trip_time);
   void set_callback(webrtc::EncodedImageCallback* callback);
 
+  // Sets target bitrate and framerate.
+  void SetRates(uint32_t target_bitrate, uint32_t frame_rate);
+
+  // Requests key frame.
+  void RequestKeyFrame();
+
  private:
   // Convert buffer to webrtc types and invoke encode complete callback.
   void ReportEncodedFrame(
@@ -112,6 +124,17 @@
   params_.runtime_params = params;
 }
 
+void RtcEncodingVideoCapturer::EncodedVideoSourceClient::SetRates(
+    uint32_t target_bitrate, uint32_t frame_rate) {
+  params_.runtime_params.target_bitrate = target_bitrate;
+  params_.runtime_params.frames_per_second = frame_rate;
+  encoded_video_source_->TrySetBitstreamConfig(params_.runtime_params);
+}
+
+void RtcEncodingVideoCapturer::EncodedVideoSourceClient::RequestKeyFrame() {
+  encoded_video_source_->RequestKeyFrame();
+}
+
 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::ReportEncodedFrame(
     scoped_refptr<const media::EncodedBitstreamBuffer> buffer) {
   if (!callback_)
@@ -173,13 +196,16 @@
   DCHECK(!encoded_video_source_client_);
   if (codecSettings->codecType != rtc_codec_type_)
     return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
+  if (codecSettings->startBitrate > kMaxBitrateKbps ||
+      codecSettings->maxBitrate > kMaxBitrateKbps)
+    return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
 
   // Convert |codecSettings| to |params|.
   media::VideoEncodingParameters params;
   params.codec_name = codecSettings->plName;
   params.resolution = gfx::Size(codecSettings->width, codecSettings->height);
-  params.runtime_params.target_bitrate = codecSettings->startBitrate;
-  params.runtime_params.max_bitrate = codecSettings->maxBitrate;
+  params.runtime_params.target_bitrate = codecSettings->startBitrate * 1000;
+  params.runtime_params.max_bitrate = codecSettings->maxBitrate * 1000;
   params.runtime_params.frames_per_second = codecSettings->maxFramerate;
   encoded_video_source_client_.reset(new EncodedVideoSourceClient(
       encoded_video_source_, params, rtc_codec_type_));
@@ -190,7 +216,11 @@
     const webrtc::I420VideoFrame& /* inputImage */,
     const webrtc::CodecSpecificInfo* codecSpecificInfo,
     const std::vector<webrtc::VideoFrameType>* frame_types) {
-  // TODO(hshi): request specific frame type.
+  if (frame_types && !frame_types->empty()) {
+    webrtc::VideoFrameType type = frame_types->front();
+    if (type == webrtc::kKeyFrame)
+      encoded_video_source_client_->RequestKeyFrame();
+  }
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
@@ -221,7 +251,9 @@
                                            uint32_t frameRate) {
   if (!encoded_video_source_client_)
     return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
-  // TODO(hshi): wire up runtime rate control.
+  if (newBitRate > kMaxBitrateKbps)
+    return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
+  encoded_video_source_client_->SetRates(newBitRate * 1000, frameRate);
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index 4a43f43..4d01fbc 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -13,6 +13,7 @@
 #include "base/task_runner_util.h"
 #include "content/child/child_thread.h"
 #include "media/base/bind_to_loop.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "third_party/webrtc/system_wrappers/interface/ref_count.h"
 
 namespace content {
@@ -68,7 +69,7 @@
 RTCVideoDecoder::BufferData::~BufferData() {}
 
 RTCVideoDecoder::RTCVideoDecoder(
-    const scoped_refptr<media::GpuVideoDecoder::Factories>& factories)
+    const scoped_refptr<media::GpuVideoDecoderFactories>& factories)
     : weak_factory_(this),
       weak_this_(weak_factory_.GetWeakPtr()),
       factories_(factories),
@@ -128,7 +129,7 @@
 }
 
 scoped_ptr<RTCVideoDecoder> RTCVideoDecoder::Create(
-    const scoped_refptr<media::GpuVideoDecoder::Factories>& factories) {
+    const scoped_refptr<media::GpuVideoDecoderFactories>& factories) {
   scoped_ptr<RTCVideoDecoder> decoder(new RTCVideoDecoder(factories));
   decoder->vda_.reset(factories->CreateVideoDecodeAccelerator(
       media::VP8PROFILE_MAIN, decoder.get()));
@@ -394,7 +395,7 @@
       visible_rect,
       natural_size,
       timestamp_ms,
-      base::Bind(&media::GpuVideoDecoder::Factories::ReadPixels,
+      base::Bind(&media::GpuVideoDecoderFactories::ReadPixels,
                  factories_,
                  pb.texture_id(),
                  decoder_texture_target_,
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h
index fc95ccb..346cb03 100644
--- a/content/renderer/media/rtc_video_decoder.h
+++ b/content/renderer/media/rtc_video_decoder.h
@@ -6,6 +6,7 @@
 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_
 
 #include <deque>
+#include <map>
 #include <set>
 #include <utility>
 
@@ -19,7 +20,6 @@
 #include "content/common/content_export.h"
 #include "media/base/bitstream_buffer.h"
 #include "media/base/video_decoder.h"
-#include "media/filters/gpu_video_decoder.h"
 #include "media/video/picture.h"
 #include "media/video/video_decode_accelerator.h"
 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
@@ -30,6 +30,7 @@
 
 namespace media {
 class DecoderBuffer;
+class GpuVideoDecoderFactories;
 }
 
 namespace content {
@@ -51,7 +52,7 @@
 
   // Creates a RTCVideoDecoder. Returns NULL if failed.
   static scoped_ptr<RTCVideoDecoder> Create(
-      const scoped_refptr<media::GpuVideoDecoder::Factories>& factories);
+      const scoped_refptr<media::GpuVideoDecoderFactories>& factories);
 
   // webrtc::VideoDecoder implementation.
   // Called on WebRTC DecodingThread.
@@ -111,7 +112,7 @@
   FRIEND_TEST_ALL_PREFIXES(RTCVideoDecoderTest, IsBufferAfterReset);
 
   RTCVideoDecoder(
-      const scoped_refptr<media::GpuVideoDecoder::Factories>& factories);
+      const scoped_refptr<media::GpuVideoDecoderFactories>& factories);
 
   void Initialize(base::WaitableEvent* waiter);
 
@@ -195,19 +196,18 @@
   base::WeakPtrFactory<RTCVideoDecoder> weak_factory_;
   base::WeakPtr<RTCVideoDecoder> weak_this_;
 
-  scoped_refptr<media::GpuVideoDecoder::Factories> factories_;
+  scoped_refptr<media::GpuVideoDecoderFactories> factories_;
 
   // The message loop to run callbacks on. This is should be the same as the one
   // of |factories_|.
   scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_;
 
-  // The thread to create shared memory. Factories::CreateSharedMemory is
-  // trampolined to the child thread. When |vda_loop_proxy_| is the compositor
-  // thread, blocking on the child thread will deadlock. During WebRTC hang up,
-  // the child thread waits for Chrome_libJingle_WorkerThread. libJingle thread
-  // cannot finish when DecodingThread holds a WebRTC lock and blocks on the
-  // child thread. So we need to call CreateSharedMemory asynchronously from a
-  // different thread.
+  // The thread to create shared memory. CreateSharedMemory is trampolined to
+  // the child thread. When |vda_loop_proxy_| is the compositor thread, blocking
+  // on the child thread will deadlock. During WebRTC hang up, the child thread
+  // waits for Chrome_libJingle_WorkerThread. libJingle thread cannot finish
+  // when DecodingThread holds a WebRTC lock and blocks on the child thread. So
+  // we need to call CreateSharedMemory asynchronously from a different thread.
   base::Thread create_shm_thread_;
 
   // The texture target used for decoded pictures.
diff --git a/content/renderer/media/rtc_video_decoder_factory.cc b/content/renderer/media/rtc_video_decoder_factory.cc
index 3c6b9ad..04018b4 100644
--- a/content/renderer/media/rtc_video_decoder_factory.cc
+++ b/content/renderer/media/rtc_video_decoder_factory.cc
@@ -7,11 +7,12 @@
 #include "base/location.h"
 #include "base/memory/scoped_ptr.h"
 #include "content/renderer/media/rtc_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 
 namespace content {
 
 RTCVideoDecoderFactory::RTCVideoDecoderFactory(
-    const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories)
+    const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories)
     : vda_loop_proxy_(gpu_factories->GetMessageLoop()) {
   DVLOG(2) << "RTCVideoDecoderFactory";
   // The decoder cannot be created in CreateVideoDecoder because VDA has to be
diff --git a/content/renderer/media/rtc_video_decoder_factory.h b/content/renderer/media/rtc_video_decoder_factory.h
index 1974701..7977ac9 100644
--- a/content/renderer/media/rtc_video_decoder_factory.h
+++ b/content/renderer/media/rtc_video_decoder_factory.h
@@ -8,10 +8,13 @@
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/threading/thread.h"
 #include "content/common/content_export.h"
-#include "media/filters/gpu_video_decoder.h"
 #include "third_party/libjingle/source/talk/media/webrtc/webrtcvideodecoderfactory.h"
 #include "third_party/webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
 
+namespace media {
+class GpuVideoDecoderFactories;
+}
+
 namespace webrtc {
 class VideoDecoder;
 }
@@ -22,7 +25,7 @@
     : NON_EXPORTED_BASE(public cricket::WebRtcVideoDecoderFactory) {
  public:
   RTCVideoDecoderFactory(
-      const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories);
+      const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories);
   virtual ~RTCVideoDecoderFactory();
 
   // Runs on Chrome_libJingle_WorkerThread. The child thread is blocked while
diff --git a/content/renderer/media/rtc_video_decoder_unittest.cc b/content/renderer/media/rtc_video_decoder_unittest.cc
index 0ff4769..457f7b2 100644
--- a/content/renderer/media/rtc_video_decoder_unittest.cc
+++ b/content/renderer/media/rtc_video_decoder_unittest.cc
@@ -8,7 +8,6 @@
 #include "base/threading/thread.h"
 #include "content/renderer/media/rtc_video_decoder.h"
 #include "media/base/gmock_callback_support.h"
-#include "media/filters/gpu_video_decoder.h"
 #include "media/filters/mock_gpu_video_decoder_factories.h"
 #include "media/video/mock_video_decode_accelerator.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc
index 3df7b61..2edd664 100644
--- a/content/renderer/media/video_capture_impl.cc
+++ b/content/renderer/media/video_capture_impl.cc
@@ -143,6 +143,10 @@
       device_id_, params));
 }
 
+void VideoCaptureImpl::RequestKeyFrame() {
+  Send(new EncodedVideoCaptureHostMsg_RequestKeyFrame(device_id_));
+}
+
 void VideoCaptureImpl::OnEncodingCapabilitiesAvailable(
     const media::VideoEncodingCapabilities& capabilities) {
   capture_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
diff --git a/content/renderer/media/video_capture_impl.h b/content/renderer/media/video_capture_impl.h
index d184fce..b0ac059 100644
--- a/content/renderer/media/video_capture_impl.h
+++ b/content/renderer/media/video_capture_impl.h
@@ -97,6 +97,7 @@
       scoped_refptr<const media::EncodedBitstreamBuffer> buffer) OVERRIDE;
   virtual void TrySetBitstreamConfig(
       const media::RuntimeVideoEncodingParameters& params) OVERRIDE;
+  virtual void RequestKeyFrame() OVERRIDE;
 
   // Stop/resume delivering video frames to clients, based on flag |suspend|.
   virtual void SuspendCapture(bool suspend);
diff --git a/content/renderer/media/video_capture_impl_unittest.cc b/content/renderer/media/video_capture_impl_unittest.cc
index 86c5eb1..22f645a 100644
--- a/content/renderer/media/video_capture_impl_unittest.cc
+++ b/content/renderer/media/video_capture_impl_unittest.cc
@@ -88,6 +88,8 @@
                             DeviceCloseEncodedBitstream)
         IPC_MESSAGE_HANDLER(EncodedVideoCaptureHostMsg_TryConfigureBitstream,
                             DeviceSetEncodingConfig)
+        IPC_MESSAGE_HANDLER(EncodedVideoCaptureHostMsg_RequestKeyFrame,
+                            DeviceRequestKeyFrame)
         IPC_MESSAGE_HANDLER(EncodedVideoCaptureHostMsg_BitstreamBufferConsumed,
                             DeviceReturnEncodedBuffer)
         IPC_MESSAGE_UNHANDLED(handled = false)
@@ -123,6 +125,8 @@
     void DeviceSetEncodingConfig(
         int device_id, media::RuntimeVideoEncodingParameters params) {}
 
+    void DeviceRequestKeyFrame(int device_id) {}
+
     void DeviceReturnEncodedBuffer(int device_id, int buffer_id) {}
   };
 
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index e760baf..32f228f 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -42,6 +42,8 @@
 #include "media/filters/ffmpeg_audio_decoder.h"
 #include "media/filters/ffmpeg_demuxer.h"
 #include "media/filters/ffmpeg_video_decoder.h"
+#include "media/filters/gpu_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "media/filters/opus_audio_decoder.h"
 #include "media/filters/video_renderer_base.h"
 #include "media/filters/vpx_video_decoder.h"
diff --git a/content/renderer/media/webmediaplayer_impl.h b/content/renderer/media/webmediaplayer_impl.h
index 4d91c8f..23b1ddf 100644
--- a/content/renderer/media/webmediaplayer_impl.h
+++ b/content/renderer/media/webmediaplayer_impl.h
@@ -35,7 +35,6 @@
 #include "media/base/media_keys.h"
 #include "media/base/pipeline.h"
 #include "media/base/text_track.h"
-#include "media/filters/gpu_video_decoder.h"
 #include "media/filters/skcanvas_video_renderer.h"
 #include "skia/ext/platform_canvas.h"
 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
@@ -57,6 +56,7 @@
 namespace media {
 class ChunkDemuxer;
 class FFmpegDemuxer;
+class GpuVideoDecoderFactories;
 class MediaLog;
 }
 
@@ -319,7 +319,7 @@
   bool incremented_externally_allocated_memory_;
 
   // Factories for supporting GpuVideoDecoder. May be null.
-  scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_;
+  scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories_;
 
   // Routes audio playback to either AudioRendererSink or WebAudio.
   scoped_refptr<WebAudioSourceProviderImpl> audio_source_provider_;
diff --git a/content/renderer/media/webmediaplayer_params.cc b/content/renderer/media/webmediaplayer_params.cc
index 25fdc41..04fe310 100644
--- a/content/renderer/media/webmediaplayer_params.cc
+++ b/content/renderer/media/webmediaplayer_params.cc
@@ -7,6 +7,7 @@
 #include "base/message_loop/message_loop_proxy.h"
 #include "media/base/audio_renderer_sink.h"
 #include "media/base/media_log.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 
 namespace content {
 
@@ -14,7 +15,7 @@
     const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy,
     const base::Callback<void(const base::Closure&)>& defer_load_cb,
     const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink,
-    const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories,
+    const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories,
     const scoped_refptr<media::MediaLog>& media_log)
     : message_loop_proxy_(message_loop_proxy),
       defer_load_cb_(defer_load_cb),
diff --git a/content/renderer/media/webmediaplayer_params.h b/content/renderer/media/webmediaplayer_params.h
index 135c60f..4347a4a 100644
--- a/content/renderer/media/webmediaplayer_params.h
+++ b/content/renderer/media/webmediaplayer_params.h
@@ -5,8 +5,8 @@
 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_
 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_
 
+#include "base/callback.h"
 #include "base/memory/ref_counted.h"
-#include "media/filters/gpu_video_decoder.h"
 
 namespace base {
 class MessageLoopProxy;
@@ -14,6 +14,7 @@
 
 namespace media {
 class AudioRendererSink;
+class GpuVideoDecoderFactories;
 class MediaLog;
 }
 
@@ -29,7 +30,7 @@
       const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy,
       const base::Callback<void(const base::Closure&)>& defer_load_cb,
       const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink,
-      const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories,
+      const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories,
       const scoped_refptr<media::MediaLog>& media_log);
   ~WebMediaPlayerParams();
 
@@ -45,8 +46,7 @@
     return audio_renderer_sink_;
   }
 
-  const scoped_refptr<media::GpuVideoDecoder::Factories>&
-  gpu_factories() const {
+  const scoped_refptr<media::GpuVideoDecoderFactories>& gpu_factories() const {
     return gpu_factories_;
   }
 
@@ -58,7 +58,7 @@
   scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
   base::Callback<void(const base::Closure&)> defer_load_cb_;
   scoped_refptr<media::AudioRendererSink> audio_renderer_sink_;
-  scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_;
+  scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories_;
   scoped_refptr<media::MediaLog> media_log_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams);
diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.cc b/content/renderer/pepper/pepper_in_process_resource_creation.cc
index d5c7030..bcb7eb5 100644
--- a/content/renderer/pepper/pepper_in_process_resource_creation.cc
+++ b/content/renderer/pepper/pepper_in_process_resource_creation.cc
@@ -59,7 +59,7 @@
   ppapi::Preferences prefs(
       host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences());
   return (new ppapi::proxy::BrowserFontResource_Trusted(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance,
       *description,
       prefs))->GetReference();
@@ -73,7 +73,7 @@
       ppapi::StringVar::FromPPVar(accept_types);
   std::string str = string_var.get() ? string_var->value() : std::string();
   return (new ppapi::proxy::FileChooserResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance,
       mode,
       str.c_str()))->GetReference();
@@ -82,7 +82,7 @@
 PP_Resource PepperInProcessResourceCreation::CreateFileIO(
     PP_Instance instance) {
   return (new ppapi::proxy::FileIOResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance))->GetReference();
 }
 
@@ -90,7 +90,7 @@
     PP_Instance instance,
     PP_FileSystemType type) {
   return (new ppapi::proxy::FileSystemResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance, type))->GetReference();
 }
 
@@ -99,14 +99,14 @@
     const PP_Size* size,
     PP_Bool is_always_opaque) {
   return (new ppapi::proxy::Graphics2DResource(
-          host_impl_->in_process_router()->GetPluginConnection(),
+          host_impl_->in_process_router()->GetPluginConnection(instance),
           instance, *size, is_always_opaque))->GetReference();
 }
 
 PP_Resource PepperInProcessResourceCreation::CreatePrinting(
     PP_Instance instance) {
   return (new ppapi::proxy::PrintingResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance))->GetReference();
 }
 
@@ -120,21 +120,21 @@
 PP_Resource PepperInProcessResourceCreation::CreateURLLoader(
     PP_Instance instance) {
   return (new ppapi::proxy::URLLoaderResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance))->GetReference();
 }
 
 PP_Resource PepperInProcessResourceCreation::CreateURLRequestInfo(
     PP_Instance instance) {
   return (new ppapi::proxy::URLRequestInfoResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance, ::ppapi::URLRequestInfoData()))->GetReference();
 }
 
 PP_Resource PepperInProcessResourceCreation::CreateWebSocket(
     PP_Instance instance) {
   return (new ppapi::proxy::WebSocketResource(
-      host_impl_->in_process_router()->GetPluginConnection(),
+      host_impl_->in_process_router()->GetPluginConnection(instance),
       instance))->GetReference();
 }
 
diff --git a/content/renderer/pepper/pepper_in_process_router.cc b/content/renderer/pepper/pepper_in_process_router.cc
index e0eecaa..d3e7f55 100644
--- a/content/renderer/pepper/pepper_in_process_router.cc
+++ b/content/renderer/pepper/pepper_in_process_router.cc
@@ -6,6 +6,7 @@
 
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
+#include "content/public/renderer/render_view.h"
 #include "content/renderer/pepper/renderer_ppapi_host_impl.h"
 #include "ipc/ipc_message.h"
 #include "ipc/ipc_sender.h"
@@ -58,9 +59,15 @@
   return host_to_plugin_router_.get();
 }
 
-ppapi::proxy::Connection PepperInProcessRouter::GetPluginConnection() {
+ppapi::proxy::Connection PepperInProcessRouter::GetPluginConnection(
+    PP_Instance instance) {
+  int routing_id = 0;
+  RenderView* view = host_impl_->GetRenderViewForInstance(instance);
+  if (view)
+    routing_id = view->GetRoutingID();
   return ppapi::proxy::Connection(dummy_browser_channel_.get(),
-                                  plugin_to_host_router_.get());
+                                  plugin_to_host_router_.get(),
+                                  routing_id);
 }
 
 bool PepperInProcessRouter::SendToHost(IPC::Message* msg) {
diff --git a/content/renderer/pepper/pepper_in_process_router.h b/content/renderer/pepper/pepper_in_process_router.h
index bc2d547..0d2993a 100644
--- a/content/renderer/pepper/pepper_in_process_router.h
+++ b/content/renderer/pepper/pepper_in_process_router.h
@@ -6,6 +6,7 @@
 #include "base/basictypes.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
+#include "ppapi/c/pp_instance.h"
 #include "ppapi/proxy/connection.h"
 #include "ppapi/proxy/resource_message_params.h"
 
@@ -62,7 +63,7 @@
   // Returns a connection pair for use by a resource proxy. This includes
   // the plugin->renderer sender as well as a dummy sender to the browser
   // process. See the class comment above about the dummy sender.
-  ppapi::proxy::Connection GetPluginConnection();
+  ppapi::proxy::Connection GetPluginConnection(PP_Instance instance);
 
  private:
   bool SendToHost(IPC::Message *msg);
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index d6a3b18..bb9be65 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -429,24 +429,6 @@
   return module;
 }
 
-RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
-    scoped_refptr<webkit::ppapi::PluginModule> module,
-    const base::FilePath& path,
-    ppapi::PpapiPermissions permissions,
-    const IPC::ChannelHandle& channel_handle,
-    base::ProcessId peer_pid,
-    int plugin_child_id) {
-  // We don't call PepperPluginRegistry::AddLiveModule, as this module is
-  // managed externally.
-  return CreateOutOfProcessModule(module.get(),
-                                  path,
-                                  permissions,
-                                  channel_handle,
-                                  peer_pid,
-                                  plugin_child_id,
-                                  true);  // is_external = true
-}
-
 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker(
     webkit::ppapi::PluginModule* plugin_module) {
   DCHECK(plugin_module);
@@ -1334,7 +1316,7 @@
     // PPP_Instance function directly.
     scoped_refptr<ppapi::proxy::URLLoaderResource> loader_resource(
         new ppapi::proxy::URLLoaderResource(
-            host_impl->in_process_router()->GetPluginConnection(),
+            host_impl->in_process_router()->GetPluginConnection(pp_instance),
             pp_instance, pending_host_id, data));
 
     PP_Resource loader_pp_resource = loader_resource->GetReference();
@@ -1362,6 +1344,24 @@
   }
 }
 
+RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
+    scoped_refptr<webkit::ppapi::PluginModule> module,
+    const base::FilePath& path,
+    ppapi::PpapiPermissions permissions,
+    const IPC::ChannelHandle& channel_handle,
+    base::ProcessId peer_pid,
+    int plugin_child_id) {
+  // We don't call PepperPluginRegistry::AddLiveModule, as this module is
+  // managed externally.
+  return CreateOutOfProcessModule(module.get(),
+                                  path,
+                                  permissions,
+                                  channel_handle,
+                                  peer_pid,
+                                  plugin_child_id,
+                                  true);  // is_external = true
+}
+
 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory(
     size_t size) {
   return RenderThread::Get()->HostAllocateSharedMemoryBuffer(size).release();
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h
index 4f3da51..0489f87 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h
@@ -30,14 +30,9 @@
 class FilePath;
 }
 
-namespace IPC {
-struct ChannelHandle;
-}
-
 namespace ppapi {
 class PepperFilePath;
 class PPB_X509Certificate_Fields;
-class PpapiPermissions;
 }
 
 namespace webkit {
@@ -75,16 +70,6 @@
     return &pepper_browser_connection_;
   }
 
-  // Sets up the renderer host and out-of-process proxy for an external plugin
-  // module. Returns the renderer host, or NULL if it couldn't be created.
-  RendererPpapiHost* CreateExternalPluginModule(
-      scoped_refptr<webkit::ppapi::PluginModule> module,
-      const base::FilePath& path,
-      ppapi::PpapiPermissions permissions,
-      const IPC::ChannelHandle& channel_handle,
-      base::ProcessId plugin_pid,
-      int plugin_child_id);
-
   // Removes broker from pending_connect_broker_ if present. Returns true if so.
   bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker);
 
@@ -335,6 +320,13 @@
   virtual void HandleDocumentLoad(
       webkit::ppapi::PluginInstance* instance,
       const WebKit::WebURLResponse& response) OVERRIDE;
+  virtual content::RendererPpapiHost* CreateExternalPluginModule(
+      scoped_refptr<webkit::ppapi::PluginModule> module,
+      const base::FilePath& path,
+      ::ppapi::PpapiPermissions permissions,
+      const IPC::ChannelHandle& channel_handle,
+      base::ProcessId plugin_pid,
+      int plugin_child_id) OVERRIDE;
 
   // RenderViewObserver implementation.
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 314a0b2..fb430b4 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -34,34 +34,6 @@
 using webkit::ppapi::PluginModule;
 
 namespace content {
-
-// static
-CONTENT_EXPORT RendererPpapiHost*
-RendererPpapiHost::CreateExternalPluginModule(
-    scoped_refptr<PluginModule> plugin_module,
-    PluginInstance* plugin_instance,
-    const base::FilePath& file_path,
-    ppapi::PpapiPermissions permissions,
-    const IPC::ChannelHandle& channel_handle,
-    base::ProcessId plugin_pid,
-    int plugin_child_id) {
-  RendererPpapiHost* renderer_ppapi_host = NULL;
-  // Since we're the embedder, we can make assumptions about the delegate on
-  // the instance.
-  PepperPluginDelegateImpl* pepper_plugin_delegate =
-      static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate());
-  if (pepper_plugin_delegate) {
-    renderer_ppapi_host = pepper_plugin_delegate->CreateExternalPluginModule(
-        plugin_module,
-        file_path,
-        permissions,
-        channel_handle,
-        plugin_pid,
-        plugin_child_id);
-  }
-  return renderer_ppapi_host;
-}
-
 // static
 CONTENT_EXPORT RendererPpapiHost*
 RendererPpapiHost::GetForPPInstance(PP_Instance instance) {
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 3ce5a94..1179851 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -87,6 +87,7 @@
 #include "ipc/ipc_platform_file.h"
 #include "media/base/audio_hardware_config.h"
 #include "media/base/media.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "net/base/net_errors.h"
 #include "net/base/net_util.h"
 #include "third_party/WebKit/public/platform/WebString.h"
@@ -433,6 +434,8 @@
   FOR_EACH_OBSERVER(
       RenderProcessObserver, observers_, OnRenderProcessShutdown());
 
+  ChildThread::Shutdown();
+
   // Wait for all databases to be closed.
   if (web_database_observer_impl_)
     web_database_observer_impl_->WaitForAllDatabasesToClose();
@@ -889,12 +892,12 @@
   idle_notifications_to_skip_ = 2;
 }
 
-scoped_refptr<media::GpuVideoDecoder::Factories>
+scoped_refptr<media::GpuVideoDecoderFactories>
 RenderThreadImpl::GetGpuFactories() {
   DCHECK(IsMainThread());
 
   const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
-  scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories;
+  scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories;
   WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
   if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
     context3d = GetGpuVDAContext3D();
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 54d6069..cd95d44 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -20,7 +20,6 @@
 #include "content/common/gpu/gpu_process_launch_causes.h"
 #include "content/public/renderer/render_thread.h"
 #include "ipc/ipc_channel_proxy.h"
-#include "media/filters/gpu_video_decoder.h"
 #include "ui/gfx/native_widget_types.h"
 
 class GrContext;
@@ -54,6 +53,7 @@
 
 namespace media {
 class AudioHardwareConfig;
+class GpuVideoDecoderFactories;
 }
 
 namespace v8 {
@@ -257,7 +257,7 @@
 
   // Gets gpu factories. Returns NULL if VDA is disabled or a graphics context
   // cannot be obtained.
-  scoped_refptr<media::GpuVideoDecoder::Factories> GetGpuFactories();
+  scoped_refptr<media::GpuVideoDecoderFactories> GetGpuFactories();
 
   // Returns a graphics context shared among all
   // RendererGpuVideoDecoderFactories, or NULL on error.  Context remains owned
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 6528992..5e8e0c6 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -7,6 +7,7 @@
 #include "base/memory/shared_memory.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
+#include "content/common/ssl_status_serialization.h"
 #include "content/common/view_messages.h"
 #include "content/public/browser/native_web_keyboard_event.h"
 #include "content/public/browser/web_ui_controller_factory.h"
@@ -21,11 +22,15 @@
 #include "content/shell/shell_content_browser_client.h"
 #include "content/test/mock_keyboard.h"
 #include "net/base/net_errors.h"
+#include "net/cert/cert_status_flags.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/public/platform/WebData.h"
 #include "third_party/WebKit/public/platform/WebHTTPBody.h"
 #include "third_party/WebKit/public/platform/WebString.h"
 #include "third_party/WebKit/public/platform/WebURLError.h"
+#include "third_party/WebKit/public/platform/WebURLResponse.h"
+#include "third_party/WebKit/public/web/WebDataSource.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
 #include "third_party/WebKit/public/web/WebHistoryItem.h"
 #include "third_party/WebKit/public/web/WebView.h"
 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
@@ -221,7 +226,7 @@
                                      flags);
     output->assign(1, static_cast<char16>(c));
     return 1;
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
     // We ignore |layout|, which means we are only testing the layout of the
     // current locale. TODO(estade): fix this to respect |layout|.
     std::vector<GdkEvent*> events;
@@ -1973,4 +1978,18 @@
   EXPECT_EQ(ui::TEXT_INPUT_TYPE_EMAIL, type);
 }
 
+TEST_F(RenderViewImplTest, GetSSLStatusOfFrame) {
+  LoadHTML("<!DOCTYPE html><html><body></body></html>");
+
+  WebFrame* frame = GetMainFrame();
+  SSLStatus ssl_status = view()->GetSSLStatusOfFrame(frame);
+  EXPECT_FALSE(net::IsCertStatusError(ssl_status.cert_status));
+
+  const_cast<WebKit::WebURLResponse&>(frame->dataSource()->response()).
+      setSecurityInfo(
+          SerializeSecurityInfo(0, net::CERT_STATUS_ALL_ERRORS, 0, 0));
+  ssl_status = view()->GetSSLStatusOfFrame(frame);
+  EXPECT_TRUE(net::IsCertStatusError(ssl_status.cert_status));
+}
+
 }  // namespace content
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 57799f2..2ebf7aa 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -99,7 +99,6 @@
 #include "content/renderer/media/media_stream_dispatcher.h"
 #include "content/renderer/media/media_stream_impl.h"
 #include "content/renderer/media/render_media_log.h"
-#include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
 #include "content/renderer/media/rtc_peer_connection_handler.h"
 #include "content/renderer/media/video_capture_impl_manager.h"
 #include "content/renderer/media/webmediaplayer_impl.h"
@@ -133,7 +132,7 @@
 #include "media/base/filter_collection.h"
 #include "media/base/media_switches.h"
 #include "media/filters/audio_renderer_impl.h"
-#include "media/filters/gpu_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "net/base/data_url.h"
 #include "net/base/escape.h"
 #include "net/base/net_errors.h"
@@ -422,6 +421,13 @@
       frame->document().referrerPolicy();
 }
 
+static Referrer GetReferrerFromRequest(
+    WebFrame* frame,
+    const WebURLRequest& request) {
+  return Referrer(GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
+                  GetReferrerPolicyFromRequest(frame, request));
+}
+
 static WebURLResponseExtraDataImpl* GetExtraDataFromResponse(
     const WebURLResponse& response) {
   return static_cast<WebURLResponseExtraDataImpl*>(
@@ -497,7 +503,8 @@
 // Returns false unless this is a top-level navigation that crosses origins.
 static bool IsNonLocalTopLevelNavigation(const GURL& url,
                                          WebFrame* frame,
-                                         WebNavigationType type) {
+                                         WebNavigationType type,
+                                         bool is_form_post) {
   if (!IsTopLevelNavigation(frame))
     return false;
 
@@ -510,19 +517,15 @@
   if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme))
     return false;
 
-  // Not interested in reloads/form submits/resubmits/back forward navigations.
   if (type != WebKit::WebNavigationTypeReload &&
-      type != WebKit::WebNavigationTypeFormSubmitted &&
-      type != WebKit::WebNavigationTypeFormResubmitted &&
-      type != WebKit::WebNavigationTypeBackForward) {
+      type != WebKit::WebNavigationTypeBackForward && !is_form_post) {
     // The opener relationship between the new window and the parent allows the
     // new window to script the parent and vice versa. This is not allowed if
     // the origins of the two domains are different. This can be treated as a
     // top level navigation and routed back to the host.
     WebKit::WebFrame* opener = frame->opener();
-    if (!opener) {
+    if (!opener)
       return true;
-    }
 
     if (url.GetOrigin() != GURL(opener->document().url()).GetOrigin())
       return true;
@@ -939,8 +942,10 @@
   // The next group of objects all implement RenderViewObserver, so are deleted
   // along with the RenderView automatically.
   devtools_agent_ = new DevToolsAgent(this);
+  if (RenderWidgetCompositor* rwc = compositor()) {
+    webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId());
+  }
   mouse_lock_dispatcher_ = new RenderViewMouseLockDispatcher(this);
-
   new ImageLoadingHelper(this);
 
   // Create renderer_accessibility_ if needed.
@@ -1907,9 +1912,7 @@
     } else {
       // Bug 654101: the referrer will be empty on https->http transitions. It
       // would be nice if we could get the real referrer from somewhere.
-      params.referrer = Referrer(GURL(
-          original_request.httpHeaderField(WebString::fromUTF8("Referer"))),
-          GetReferrerPolicyFromRequest(frame, original_request));
+      params.referrer = GetReferrerFromRequest(frame, original_request);
     }
 
     string16 method = request.httpMethod();
@@ -2137,8 +2140,11 @@
   params.opener_security_origin = security_url;
   params.opener_suppressed = creator->willSuppressOpenerInNewFrame();
   params.disposition = NavigationPolicyToDisposition(policy);
-  if (!request.isNull())
+  if (!request.isNull()) {
     params.target_url = request.url();
+    params.referrer = GetReferrerFromRequest(creator, request);
+  }
+  params.features = features;
 
   int32 routing_id = MSG_ROUTING_NONE;
   int32 main_frame_routing_id = MSG_ROUTING_NONE;
@@ -2815,6 +2821,14 @@
                     DidHandleGestureEvent(event));
 }
 
+void RenderViewImpl::initializeLayerTreeView() {
+  RenderWidget::initializeLayerTreeView();
+  RenderWidgetCompositor* rwc = compositor();
+  if (!rwc || !webview() || !webview()->devToolsAgent())
+    return;
+  webview()->devToolsAgent()->setLayerTreeId(rwc->GetLayerTreeId());
+}
+
 // WebKit::WebFrameClient -----------------------------------------------------
 
 WebKit::WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame,
@@ -2950,7 +2964,7 @@
     DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink.get();
   }
 
-  scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories =
+  scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories =
       RenderThreadImpl::current()->GetGpuFactories();
 
   WebMediaPlayerParams params(
@@ -3049,16 +3063,24 @@
 }
 
 SSLStatus RenderViewImpl::GetSSLStatusOfFrame(WebKit::WebFrame* frame) const {
-  return SSLStatus();
+  std::string security_info;
+  if (frame && frame->dataSource())
+    security_info = frame->dataSource()->response().securityInfo();
+
+  SSLStatus ssl_status;
+  DeserializeSecurityInfo(security_info,
+                          &ssl_status.cert_id,
+                          &ssl_status.cert_status,
+                          &ssl_status.security_bits,
+                          &ssl_status.connection_status);
+  return ssl_status;
 }
 
 void RenderViewImpl::loadURLExternally(
     WebFrame* frame, const WebURLRequest& request,
     WebNavigationPolicy policy,
     const WebString& suggested_name) {
-  Referrer referrer(
-      GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
-      GetReferrerPolicyFromRequest(frame, request));
+  Referrer referrer(GetReferrerFromRequest(frame, request));
   if (policy == WebKit::WebNavigationPolicyDownload) {
     Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer,
                                      suggested_name));
@@ -3078,9 +3100,7 @@
     return WebKit::WebNavigationPolicyIgnore;
   }
 
-  Referrer referrer(
-      GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
-      GetReferrerPolicyFromRequest(frame, request));
+  Referrer referrer(GetReferrerFromRequest(frame, request));
 
   if (is_swapped_out_) {
     if (request.url() != GURL(kSwappedOutURL)) {
@@ -3143,9 +3163,12 @@
 
   // If the browser is interested, then give it a chance to look at the request.
   if (is_content_initiated) {
+    bool is_form_post = ((type == WebKit::WebNavigationTypeFormSubmitted) ||
+                         (type == WebKit::WebNavigationTypeFormResubmitted)) &&
+                        EqualsASCII(request.httpMethod(), "POST");
     bool browser_handles_request =
         renderer_preferences_.browser_handles_non_local_top_level_requests &&
-        IsNonLocalTopLevelNavigation(url, frame, type);
+        IsNonLocalTopLevelNavigation(url, frame, type, is_form_post);
     if (!browser_handles_request) {
       browser_handles_request =
           renderer_preferences_.browser_handles_all_top_level_requests &&
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 7a6bd3e..bb62aa4 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -410,6 +410,7 @@
   virtual void didActivateCompositor(int input_handler_identifier);
   virtual void didHandleGestureEvent(const WebKit::WebGestureEvent& event,
                                      bool event_cancelled) OVERRIDE;
+  virtual void initializeLayerTreeView() OVERRIDE;
 
   // WebKit::WebViewClient implementation --------------------------------------
 
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index 0fd87e3..8857756 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -52,7 +52,7 @@
 #endif
 
 namespace content {
-
+namespace {
 // This function provides some ways to test crash and assertion handling
 // behavior of the renderer.
 static void HandleRendererErrorTestParameters(const CommandLine& command_line) {
@@ -109,6 +109,13 @@
   DISALLOW_COPY_AND_ASSIGN(MemoryObserver);
 };
 
+
+const void* ContentPPAPIInterfaceFactory(const std::string& interface_name) {
+  return GetContentClient()->renderer()->CreatePPAPIInterface(interface_name);
+}
+
+}  // namespace
+
 // mainline routine for running as the Renderer process
 int RendererMain(const MainFunctionParams& parameters) {
   TRACE_EVENT_BEGIN_ETW("RendererMain", 0, "");
@@ -144,8 +151,7 @@
 
   webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager =
       webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance();
-  GetContentClient()->renderer()->RegisterPPAPIInterfaceFactories(
-      factory_manager);
+  factory_manager->RegisterFactory(ContentPPAPIInterfaceFactory);
 
   base::StatsCounterTimer stats_counter_timer("Content.RendererInit");
   base::StatsScope<base::StatsCounterTimer> startup_timer(stats_counter_timer);
diff --git a/content/result_codes_java.target.darwin-arm.mk b/content/result_codes_java.target.darwin-arm.mk
index cf6aa21..4879f99 100644
--- a/content/result_codes_java.target.darwin-arm.mk
+++ b/content/result_codes_java.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/result_codes_java.target.darwin-mips.mk b/content/result_codes_java.target.darwin-mips.mk
index ada9d54..82a2037 100644
--- a/content/result_codes_java.target.darwin-mips.mk
+++ b/content/result_codes_java.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/result_codes_java.target.darwin-x86.mk b/content/result_codes_java.target.darwin-x86.mk
index c0d62c1..79ac20c 100644
--- a/content/result_codes_java.target.darwin-x86.mk
+++ b/content/result_codes_java.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/result_codes_java.target.linux-arm.mk b/content/result_codes_java.target.linux-arm.mk
index cf6aa21..4879f99 100644
--- a/content/result_codes_java.target.linux-arm.mk
+++ b/content/result_codes_java.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/result_codes_java.target.linux-mips.mk b/content/result_codes_java.target.linux-mips.mk
index ada9d54..82a2037 100644
--- a/content/result_codes_java.target.linux-mips.mk
+++ b/content/result_codes_java.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/result_codes_java.target.linux-x86.mk b/content/result_codes_java.target.linux-x86.mk
index c0d62c1..79ac20c 100644
--- a/content/result_codes_java.target.linux-x86.mk
+++ b/content/result_codes_java.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/shell/minimal_ash.cc b/content/shell/minimal_shell.cc
similarity index 86%
rename from content/shell/minimal_ash.cc
rename to content/shell/minimal_shell.cc
index fdecda2..2e9079e 100644
--- a/content/shell/minimal_ash.cc
+++ b/content/shell/minimal_shell.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/minimal_ash.h"
+#include "content/shell/minimal_shell.h"
 
 #include "ui/aura/client/default_capture_client.h"
 #include "ui/aura/focus_manager.h"
@@ -13,7 +13,7 @@
 
 namespace content {
 
-MinimalAsh::MinimalAsh(const gfx::Size& default_window_size) {
+MinimalShell::MinimalShell(const gfx::Size& default_window_size) {
   root_window_.reset(new aura::RootWindow(
       aura::RootWindow::CreateParams(
           gfx::Rect(default_window_size))));
@@ -40,11 +40,11 @@
       new aura::client::DefaultCaptureClient(root_window_.get()));
 }
 
-MinimalAsh::~MinimalAsh() {
+MinimalShell::~MinimalShell() {
   root_window_event_filter_->RemoveHandler(input_method_filter_.get());
 }
 
-aura::Window* MinimalAsh::GetDefaultParent(
+aura::Window* MinimalShell::GetDefaultParent(
     aura::Window* context,
     aura::Window* window,
     const gfx::Rect& bounds) {
diff --git a/content/shell/minimal_ash.h b/content/shell/minimal_shell.h
similarity index 79%
rename from content/shell/minimal_ash.h
rename to content/shell/minimal_shell.h
index a417891..b2ab9eb 100644
--- a/content/shell/minimal_ash.h
+++ b/content/shell/minimal_shell.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_MINIMAL_ASH_H_
-#define CONTENT_SHELL_MINIMAL_ASH_H_
+#ifndef CONTENT_SHELL_MINIMAL_SHELL_H_
+#define CONTENT_SHELL_MINIMAL_SHELL_H_
 
 #include "base/compiler_specific.h"
 #include "base/memory/scoped_ptr.h"
@@ -38,10 +38,10 @@
 // Creates a minimal environment for running the shell. We can't pull in all of
 // ash here, but we can create attach several of the same things we'd find in
 // the ash parts of the code.
-class MinimalAsh : public aura::client::StackingClient {
+class MinimalShell : public aura::client::StackingClient {
  public:
-  explicit MinimalAsh(const gfx::Size& default_window_size);
-  virtual ~MinimalAsh();
+  explicit MinimalShell(const gfx::Size& default_window_size);
+  virtual ~MinimalShell();
 
   // Overridden from client::StackingClient:
   virtual aura::Window* GetDefaultParent(aura::Window* context,
@@ -59,9 +59,9 @@
   scoped_ptr<aura::test::TestActivationClient> test_activation_client_;
   scoped_ptr<aura::client::FocusClient> focus_client_;
 
-  DISALLOW_COPY_AND_ASSIGN(MinimalAsh);
+  DISALLOW_COPY_AND_ASSIGN(MinimalShell);
 };
 
 }  // namespace content;
 
-#endif  // CONTENT_SHELL_MINIMAL_ASH_H_
+#endif  // CONTENT_SHELL_MINIMAL_SHELL_H_
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index e44865a..0175bfe 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -323,6 +323,12 @@
   contents->GetRenderViewHost()->Blur();
 }
 
+void Shell::WorkerCrashed(WebContents* source) {
+  if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+    return;
+  WebKitTestController::Get()->WorkerCrashed();
+}
+
 void Shell::Observe(int type,
                     const NotificationSource& source,
                     const NotificationDetails& details) {
diff --git a/content/shell/shell.h b/content/shell/shell.h
index 797256c..00fcdf9 100644
--- a/content/shell/shell.h
+++ b/content/shell/shell.h
@@ -28,7 +28,7 @@
 #elif defined(USE_AURA)
 #if defined(OS_CHROMEOS)
 namespace content {
-class MinimalAsh;
+class MinimalShell;
 }
 #endif
 namespace views {
@@ -145,6 +145,7 @@
   virtual void RendererUnresponsive(WebContents* source) OVERRIDE;
   virtual void ActivateContents(WebContents* contents) OVERRIDE;
   virtual void DeactivateContents(WebContents* contents) OVERRIDE;
+  virtual void WorkerCrashed(WebContents* source) OVERRIDE;
 
  private:
   enum UIControl {
@@ -256,7 +257,7 @@
   base::android::ScopedJavaGlobalRef<jobject> java_object_;
 #elif defined(USE_AURA)
 #if defined(OS_CHROMEOS)
-  static content::MinimalAsh* minimal_ash_;
+  static content::MinimalShell* minimal_shell_;
 #endif
   static views::ViewsDelegate* views_delegate_;
 
diff --git a/content/shell/shell_aura.cc b/content/shell/shell_aura.cc
index 9552f91..b7bf5d0 100644
--- a/content/shell/shell_aura.cc
+++ b/content/shell/shell_aura.cc
@@ -30,7 +30,7 @@
 
 #if defined(OS_CHROMEOS)
 #include "chromeos/dbus/dbus_thread_manager.h"
-#include "content/shell/minimal_ash.h"
+#include "content/shell/minimal_shell.h"
 #include "ui/aura/test/test_screen.h"
 #endif
 
@@ -273,7 +273,7 @@
 }  // namespace
 
 #if defined(OS_CHROMEOS)
-MinimalAsh* Shell::minimal_ash_ = NULL;
+MinimalShell* Shell::minimal_shell_ = NULL;
 #endif
 views::ViewsDelegate* Shell::views_delegate_ = NULL;
 
@@ -283,7 +283,7 @@
   chromeos::DBusThreadManager::Initialize();
   gfx::Screen::SetScreenInstance(
       gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create());
-  minimal_ash_ = new content::MinimalAsh(default_window_size);
+  minimal_shell_ = new content::MinimalShell(default_window_size);
 #else
   gfx::Screen::SetScreenInstance(
       gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen());
@@ -293,8 +293,8 @@
 
 void Shell::PlatformExit() {
 #if defined(OS_CHROMEOS)
-  if (minimal_ash_)
-    delete minimal_ash_;
+  if (minimal_shell_)
+    delete minimal_shell_;
 #endif
   if (views_delegate_)
     delete views_delegate_;
@@ -336,7 +336,7 @@
   window_widget_ =
       views::Widget::CreateWindowWithContextAndBounds(
           new ShellWindowDelegateView(this),
-          minimal_ash_->GetDefaultParent(NULL, NULL, gfx::Rect()),
+          minimal_shell_->GetDefaultParent(NULL, NULL, gfx::Rect()),
           gfx::Rect(0, 0, width, height));
 #else
   window_widget_ =
@@ -345,7 +345,7 @@
 #endif
 
   window_ = window_widget_->GetNativeWindow();
-  // Call ShowRootWindow on RootWindow created by MinimalAsh without
+  // Call ShowRootWindow on RootWindow created by MinimalShell without
   // which XWindow owned by RootWindow doesn't get mapped.
   window_->GetRootWindow()->ShowRootWindow();
   window_widget_->Show();
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc
index 281862f..58b966c 100644
--- a/content/shell/shell_browser_context.cc
+++ b/content/shell/shell_browser_context.cc
@@ -175,8 +175,13 @@
       int render_view_id,
       const GURL& requesting_frame,
       const MIDISysExPermissionCallback& callback) {
-  // Always reject requests for testing.
+  // Always reject requests for LayoutTests for now.
   // TODO(toyoshim): Make it programmable to improve test coverage.
+  if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
+    callback.Run(false);
+    return;
+  }
+  // TODO(toyoshim): Implement. http://crbug.com/257618 .
   callback.Run(false);
 }
 
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index da99f0f..851bceb 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -298,6 +298,12 @@
   LOG(WARNING) << "renderer unresponsive";
 }
 
+void WebKitTestController::WorkerCrashed() {
+  DCHECK(CalledOnValidThread());
+  printer_->AddErrorMessage("#CRASHED - worker");
+  DiscardMainWindow();
+}
+
 void WebKitTestController::OverrideWebkitPrefs(WebPreferences* prefs) {
   if (should_override_prefs_) {
     *prefs = prefs_;
diff --git a/content/shell/webkit_test_controller.h b/content/shell/webkit_test_controller.h
index c87e157..aa181df 100644
--- a/content/shell/webkit_test_controller.h
+++ b/content/shell/webkit_test_controller.h
@@ -116,6 +116,7 @@
 
   void SetTempPath(const base::FilePath& temp_path);
   void RendererUnresponsive();
+  void WorkerCrashed();
   void OverrideWebkitPrefs(WebPreferences* prefs);
   void OpenURL(const GURL& url);
   void TestFinishedInSecondaryWindow();
diff --git a/content/speech_recognition_error_java.target.darwin-arm.mk b/content/speech_recognition_error_java.target.darwin-arm.mk
index ac389b5..0263de1 100644
--- a/content/speech_recognition_error_java.target.darwin-arm.mk
+++ b/content/speech_recognition_error_java.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/speech_recognition_error_java.target.darwin-mips.mk b/content/speech_recognition_error_java.target.darwin-mips.mk
index f869c58..790e8b3 100644
--- a/content/speech_recognition_error_java.target.darwin-mips.mk
+++ b/content/speech_recognition_error_java.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/speech_recognition_error_java.target.darwin-x86.mk b/content/speech_recognition_error_java.target.darwin-x86.mk
index 7a250f9..1bf36c2 100644
--- a/content/speech_recognition_error_java.target.darwin-x86.mk
+++ b/content/speech_recognition_error_java.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/speech_recognition_error_java.target.linux-arm.mk b/content/speech_recognition_error_java.target.linux-arm.mk
index ac389b5..0263de1 100644
--- a/content/speech_recognition_error_java.target.linux-arm.mk
+++ b/content/speech_recognition_error_java.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/speech_recognition_error_java.target.linux-mips.mk b/content/speech_recognition_error_java.target.linux-mips.mk
index f869c58..790e8b3 100644
--- a/content/speech_recognition_error_java.target.linux-mips.mk
+++ b/content/speech_recognition_error_java.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/speech_recognition_error_java.target.linux-x86.mk b/content/speech_recognition_error_java.target.linux-x86.mk
index 7a250f9..1bf36c2 100644
--- a/content/speech_recognition_error_java.target.linux-x86.mk
+++ b/content/speech_recognition_error_java.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/content/test/data/download/octet-stream.abc b/content/test/data/download/octet-stream.abc
new file mode 100644
index 0000000..efdd590
--- /dev/null
+++ b/content/test/data/download/octet-stream.abc
@@ -0,0 +1 @@
+Octet stream data.
\ No newline at end of file
diff --git a/content/test/data/download/octet-stream.abc.mock-http-headers b/content/test/data/download/octet-stream.abc.mock-http-headers
new file mode 100644
index 0000000..37ae0ad
--- /dev/null
+++ b/content/test/data/download/octet-stream.abc.mock-http-headers
@@ -0,0 +1,2 @@
+HTTP/1.1 200 OK
+Content-Type: application/octet-stream
diff --git a/content/test/test_render_view_host_factory.cc b/content/test/test_render_view_host_factory.cc
index 47213aa..ca86f09 100644
--- a/content/test/test_render_view_host_factory.cc
+++ b/content/test/test_render_view_host_factory.cc
@@ -32,8 +32,7 @@
     RenderWidgetHostDelegate* widget_delegate,
     int routing_id,
     int main_frame_routing_id,
-    bool swapped_out,
-    SessionStorageNamespace* session_storage) {
+    bool swapped_out) {
   return new TestRenderViewHost(
       instance, delegate, widget_delegate, routing_id, main_frame_routing_id,
       swapped_out);
diff --git a/content/test/test_render_view_host_factory.h b/content/test/test_render_view_host_factory.h
index d194b2c..e93762f 100644
--- a/content/test/test_render_view_host_factory.h
+++ b/content/test/test_render_view_host_factory.h
@@ -33,8 +33,7 @@
       RenderWidgetHostDelegate* widget_delegate,
       int routing_id,
       int main_frame_routing_id,
-      bool swapped_out,
-      SessionStorageNamespace* session_storage) OVERRIDE;
+      bool swapped_out) OVERRIDE;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(TestRenderViewHostFactory);
diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc
index 4609861..d5c3c65 100644
--- a/content/test/webrtc_audio_device_test.cc
+++ b/content/test/webrtc_audio_device_test.cc
@@ -20,8 +20,8 @@
 #include "content/common/media/media_param_traits.h"
 #include "content/common/view_messages.h"
 #include "content/public/browser/browser_thread.h"
+#include "content/public/browser/resource_context.h"
 #include "content/public/common/content_paths.h"
-#include "content/public/test/mock_resource_context.h"
 #include "content/public/test/test_browser_thread.h"
 #include "content/renderer/media/audio_input_message_filter.h"
 #include "content/renderer/media/audio_message_filter.h"
diff --git a/content/test/webrtc_audio_device_test.h b/content/test/webrtc_audio_device_test.h
index 1663ad1..a640e5c 100644
--- a/content/test/webrtc_audio_device_test.h
+++ b/content/test/webrtc_audio_device_test.h
@@ -50,7 +50,6 @@
 class AudioRendererHost;
 class ContentRendererClient;
 class MediaStreamManager;
-class MockResourceContext;
 class RenderThreadImpl;
 class ResourceContext;
 class TestBrowserThread;
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc
index e02d172..ca03da4 100644
--- a/content/utility/utility_thread_impl.cc
+++ b/content/utility/utility_thread_impl.cc
@@ -52,6 +52,8 @@
 }
 
 void UtilityThreadImpl::Shutdown() {
+  ChildThread::Shutdown();
+
   if (!single_process_)
     WebKit::shutdown();
 }
diff --git a/content/worker/worker_thread.cc b/content/worker/worker_thread.cc
index c15b306..916b219 100644
--- a/content/worker/worker_thread.cc
+++ b/content/worker/worker_thread.cc
@@ -58,6 +58,8 @@
 }
 
 void WorkerThread::Shutdown() {
+  ChildThread::Shutdown();
+
   // Shutdown in reverse of the initialization order.
   channel()->RemoveFilter(indexed_db_message_filter_.get());
   indexed_db_message_filter_ = NULL;
diff --git a/courgette/courgette.gyp b/courgette/courgette.gyp
index f4d0365..d6d4c15 100644
--- a/courgette/courgette.gyp
+++ b/courgette/courgette.gyp
@@ -104,6 +104,7 @@
         'ensemble_unittest.cc',
         'run_all_unittests.cc',
         'streams_unittest.cc',
+        'typedrva_unittest.cc',
         'versioning_unittest.cc',
         'third_party/paged_array_unittest.cc'
       ],
diff --git a/courgette/disassembler.h b/courgette/disassembler.h
index 2de67fd..8f6deb1 100644
--- a/courgette/disassembler.h
+++ b/courgette/disassembler.h
@@ -67,6 +67,10 @@
     return *reinterpret_cast<const uint32*>(address);
   }
 
+  static uint16 Read16LittleEndian(const void* address) {
+    return *reinterpret_cast<const uint16*>(address);
+  }
+
   // Reduce the length of the image in memory. Does not actually free
   // (or realloc) any memory. Usually only called via ParseHeader()
   void ReduceLength(size_t reduced_length);
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index 91ccd45..1033fd2 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -10,6 +10,7 @@
 
 #include "base/basictypes.h"
 #include "base/logging.h"
+#include "base/memory/scoped_vector.h"
 
 #include "courgette/assembly_program.h"
 #include "courgette/courgette.h"
@@ -203,7 +204,7 @@
 }
 
 CheckBool DisassemblerElf32::RVAsToOffsets(std::vector<RVA>* rvas,
-                                              std::vector<size_t>* offsets) {
+                                           std::vector<size_t>* offsets) {
   offsets->clear();
 
   for (std::vector<RVA>::iterator rva = rvas->begin();
@@ -221,24 +222,39 @@
   return true;
 }
 
+CheckBool DisassemblerElf32::RVAsToOffsets(ScopedVector<TypedRVA>* rvas) {
+  for (ScopedVector<TypedRVA>::iterator rva = rvas->begin();
+       rva != rvas->end();
+       rva++) {
+
+    size_t offset;
+
+    if (!RVAToFileOffset((*rva)->rva(), &offset))
+      return false;
+
+    (*rva)->set_offset(offset);
+  }
+
+  return true;
+}
+
 CheckBool DisassemblerElf32::ParseFile(AssemblyProgram* program) {
   // Walk all the bytes in the file, whether or not in a section.
   uint32 file_offset = 0;
 
   std::vector<size_t> abs_offsets;
-  std::vector<size_t> rel_offsets;
 
   if (!RVAsToOffsets(&abs32_locations_, &abs_offsets))
     return false;
 
-  if (!RVAsToOffsets(&rel32_locations_, &rel_offsets))
+  if (!RVAsToOffsets(&rel32_locations_))
     return false;
 
   std::vector<size_t>::iterator current_abs_offset = abs_offsets.begin();
-  std::vector<size_t>::iterator current_rel_offset = rel_offsets.begin();
+  ScopedVector<TypedRVA>::iterator current_rel = rel32_locations_.begin();
 
   std::vector<size_t>::iterator end_abs_offset = abs_offsets.end();
-  std::vector<size_t>::iterator end_rel_offset = rel_offsets.end();
+  ScopedVector<TypedRVA>::iterator end_rel = rel32_locations_.end();
 
   for (int section_id = 0;
        section_id < SectionHeaderCount();
@@ -261,7 +277,7 @@
       case SHT_PROGBITS:
         if (!ParseProgbitsSection(section_header,
                                   &current_abs_offset, end_abs_offset,
-                                  &current_rel_offset, end_rel_offset,
+                                  &current_rel, end_rel,
                                   program))
           return false;
         file_offset = section_header->sh_offset + section_header->sh_size;
@@ -306,8 +322,8 @@
     const Elf32_Shdr *section_header,
     std::vector<size_t>::iterator* current_abs_offset,
     std::vector<size_t>::iterator end_abs_offset,
-    std::vector<size_t>::iterator* current_rel_offset,
-    std::vector<size_t>::iterator end_rel_offset,
+    ScopedVector<TypedRVA>::iterator* current_rel,
+    ScopedVector<TypedRVA>::iterator end_rel,
     AssemblyProgram* program) {
 
   // Walk all the bytes in the file, whether or not in a section.
@@ -325,9 +341,9 @@
         file_offset > **current_abs_offset)
       return false;
 
-    while (*current_rel_offset != end_rel_offset &&
-           file_offset > **current_rel_offset) {
-      (*current_rel_offset)++;
+    while (*current_rel != end_rel &&
+           file_offset > (**current_rel)->get_offset()) {
+      (*current_rel)++;
     }
 
     size_t next_relocation = section_end;
@@ -339,9 +355,9 @@
     // Rel offsets are heuristically derived, and might (incorrectly) overlap
     // an Abs value, or the end of the section, so +3 to make sure there is
     // room for the full 4 byte value.
-    if (*current_rel_offset != end_rel_offset &&
-        next_relocation > (**current_rel_offset + 3))
-      next_relocation = **current_rel_offset;
+    if (*current_rel != end_rel &&
+        next_relocation > ((**current_rel)->get_offset() + 3))
+      next_relocation = (**current_rel)->get_offset();
 
     if (next_relocation > file_offset) {
       if (!ParseSimpleRegion(file_offset, next_relocation, program))
@@ -364,20 +380,19 @@
       continue;
     }
 
-    if (*current_rel_offset != end_rel_offset &&
-        file_offset == **current_rel_offset) {
+    if (*current_rel != end_rel &&
+        file_offset == (**current_rel)->get_offset()) {
 
-      const uint8* p = OffsetToPointer(file_offset);
-      uint32 relative_target = Read32LittleEndian(p);
+      uint32 relative_target = (**current_rel)->relative_target();
       // This cast is for 64 bit systems, and is only safe because we
       // are working on 32 bit executables.
       RVA target_rva = (RVA)(origin + (file_offset - origin_offset) +
-                             4 + relative_target);
+                             relative_target);
 
       if (!program->EmitRel32(program->FindOrMakeRel32Label(target_rva)))
         return false;
       file_offset += sizeof(RVA);
-      (*current_rel_offset)++;
+      (*current_rel)++;
       continue;
     }
   }
@@ -482,7 +497,9 @@
       return false;
   }
 
-  std::sort(rel32_locations_.begin(), rel32_locations_.end());
+  std::sort(rel32_locations_.begin(),
+            rel32_locations_.end(),
+            TypedRVA::IsLessThan);
   return true;
 }
 
diff --git a/courgette/disassembler_elf_32.h b/courgette/disassembler_elf_32.h
index 3f63c43..b3f6e59 100644
--- a/courgette/disassembler_elf_32.h
+++ b/courgette/disassembler_elf_32.h
@@ -6,6 +6,7 @@
 #define COURGETTE_DISASSEMBLER_ELF_32_H_
 
 #include "base/basictypes.h"
+#include "base/memory/scoped_vector.h"
 #include "courgette/disassembler.h"
 #include "courgette/memory_allocator.h"
 #include "courgette/types_elf.h"
@@ -24,8 +25,52 @@
 // architecture's machine code.
 class DisassemblerElf32 : public Disassembler {
  public:
+  // Different instructions encode the target rva differently.  This
+  // class encapsulates this behavior.  public for use in unit tests.
+  class TypedRVA {
+   public:
+    explicit TypedRVA(RVA rva) : rva_(rva), offset_(-1) {
+    }
+
+    virtual ~TypedRVA() { };
+
+    RVA rva() {
+      return rva_;
+    }
+
+    RVA relative_target() {
+      return relative_target_;
+    }
+
+    void set_relative_target(RVA relative_target) {
+      relative_target_ = relative_target;
+    }
+
+    size_t get_offset() {
+      return offset_;
+    }
+
+    void set_offset(size_t offset) {
+      offset_ = offset;
+    }
+
+    virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer) = 0;
+
+    static bool IsLessThan(TypedRVA *a, TypedRVA *b) {
+      return a->rva() < b->rva();
+    }
+
+  private:
+    const RVA rva_;
+    RVA relative_target_;
+    size_t offset_;
+  };
+
+ public:
   explicit DisassemblerElf32(const void* start, size_t length);
 
+  virtual ~DisassemblerElf32() { };
+
   virtual ExecutableType kind() = 0;
 
   virtual e_machine_values ElfEM() = 0;
@@ -39,7 +84,7 @@
 
   // Public for unittests only
   std::vector<RVA> &Abs32Locations() { return abs32_locations_; }
-  std::vector<RVA> &Rel32Locations() { return rel32_locations_; }
+  ScopedVector<TypedRVA> &Rel32Locations() { return rel32_locations_; }
 
  protected:
 
@@ -111,6 +156,8 @@
   CheckBool RVAsToOffsets(std::vector<RVA>* rvas /*in*/,
                           std::vector<size_t>* offsets /*out*/);
 
+  CheckBool RVAsToOffsets(ScopedVector<TypedRVA>* rvas /*in and out*/);
+
   // Parsing Code used to really implement Disassemble
 
   CheckBool ParseFile(AssemblyProgram* target) WARN_UNUSED_RESULT;
@@ -121,8 +168,8 @@
       const Elf32_Shdr *section_header,
       std::vector<size_t>::iterator* current_abs_offset,
       std::vector<size_t>::iterator end_abs_offset,
-      std::vector<size_t>::iterator* current_rel_offset,
-      std::vector<size_t>::iterator end_rel_offset,
+      ScopedVector<TypedRVA>::iterator* current_rel,
+      ScopedVector<TypedRVA>::iterator end_rel,
       AssemblyProgram* program) WARN_UNUSED_RESULT;
   CheckBool ParseSimpleRegion(size_t start_file_offset,
                               size_t end_file_offset,
@@ -145,7 +192,7 @@
   const char *default_string_section_;
 
   std::vector<RVA> abs32_locations_;
-  std::vector<RVA> rel32_locations_;
+  ScopedVector<TypedRVA> rel32_locations_;
 
   DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32);
 };
diff --git a/courgette/disassembler_elf_32_arm.cc b/courgette/disassembler_elf_32_arm.cc
index f271020..6270c64 100644
--- a/courgette/disassembler_elf_32_arm.cc
+++ b/courgette/disassembler_elf_32_arm.cc
@@ -17,6 +17,45 @@
 
 namespace courgette {
 
+CheckBool DisassemblerElf32ARM::TypedRVAARM::ComputeRelativeTarget(
+    const uint8* op_pointer) {
+  uint32 temp = 0;
+
+  switch (type_) {
+    case ARM_OFF24:
+      // The offset is given by the lower 24-bits of the op, shifted
+      // left 2 bits, and sign extended.
+      temp = Read32LittleEndian(op_pointer);
+      temp = (temp & 0x00FFFFFF) << 2;
+      if (temp & 0x02000000)
+        temp |= 0xFC000000;
+      temp += 8;
+      break;
+    case ARM_OFF8:
+      // The offset is given by lower 8 bits of the op.  It is a 9-bit
+      // offset, shifted right one bit and signed extended.
+      temp = (Read16LittleEndian(op_pointer) & 0x00FF) << 1;
+      if (temp & 0x0100)
+        temp |= 0xFFFFFE00;
+      temp += 4;  // Offset from _next_ PC.
+      break;
+    case ARM_OFF11:
+      // The offset is given by lower 11 bits of the op, and is a
+      // 12-bit offset, shifted right one bit and sign extended.
+      temp = (Read16LittleEndian(op_pointer) & 0x07FF) << 1;
+      if (temp & 0x00000800)
+        temp |= 0xFFFFF000;
+      temp += 4;  // Offset from _next_ PC.
+      break;
+    default:
+      return false;
+  }
+
+  set_relative_target(temp);
+
+  return true;
+}
+
 DisassemblerElf32ARM::DisassemblerElf32ARM(const void* start, size_t length)
   : DisassemblerElf32(start, length) {
 }
diff --git a/courgette/disassembler_elf_32_arm.h b/courgette/disassembler_elf_32_arm.h
index dcbc46e..57e750e 100644
--- a/courgette/disassembler_elf_32_arm.h
+++ b/courgette/disassembler_elf_32_arm.h
@@ -14,8 +14,24 @@
 
 class AssemblyProgram;
 
+enum ARM_RVA {
+  ARM_OFF8,
+  ARM_OFF11,
+  ARM_OFF24,
+};
+
 class DisassemblerElf32ARM : public DisassemblerElf32 {
  public:
+  class TypedRVAARM : public TypedRVA {
+   public:
+    TypedRVAARM(ARM_RVA type, RVA rva) : TypedRVA(rva), type_(type) { }
+
+    virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer) OVERRIDE;
+
+   private:
+    ARM_RVA type_;
+  };
+
   explicit DisassemblerElf32ARM(const void* start, size_t length);
 
   virtual ExecutableType kind() { return EXE_ELF_32_ARM; }
diff --git a/courgette/disassembler_elf_32_x86.cc b/courgette/disassembler_elf_32_x86.cc
index 00bb650..bfd8e83 100644
--- a/courgette/disassembler_elf_32_x86.cc
+++ b/courgette/disassembler_elf_32_x86.cc
@@ -150,9 +150,14 @@
       }
     }
     if (rel32) {
-      RVA rel32_rva = static_cast<RVA>(rel32 - adjust_pointer_to_rva);
+      RVA rva = static_cast<RVA>(rel32 - adjust_pointer_to_rva);
+      TypedRVAX86* rel32_rva = new TypedRVAX86(rva);
 
-      RVA target_rva = rel32_rva + 4 + Read32LittleEndian(rel32);
+      if (!rel32_rva->ComputeRelativeTarget(rel32)) {
+        return false;
+      }
+
+      RVA target_rva = rel32_rva->rva() + rel32_rva->relative_target();
       // To be valid, rel32 target must be within image, and within this
       // section.
       if (IsValidRVA(target_rva)) {
diff --git a/courgette/disassembler_elf_32_x86.h b/courgette/disassembler_elf_32_x86.h
index 28de7cf..5e7cdff 100644
--- a/courgette/disassembler_elf_32_x86.h
+++ b/courgette/disassembler_elf_32_x86.h
@@ -16,6 +16,17 @@
 
 class DisassemblerElf32X86 : public DisassemblerElf32 {
  public:
+  class TypedRVAX86 : public TypedRVA {
+   public:
+    explicit TypedRVAX86(RVA rva) : TypedRVA(rva) {
+    }
+
+    virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer) OVERRIDE {
+      set_relative_target(Read32LittleEndian(op_pointer) + 4);
+      return true;
+    }
+  };
+
   explicit DisassemblerElf32X86(const void* start, size_t length);
 
   virtual ExecutableType kind() { return EXE_ELF_32_X86; }
diff --git a/courgette/disassembler_elf_32_x86_unittest.cc b/courgette/disassembler_elf_32_x86_unittest.cc
index 2624985..297ffcc 100644
--- a/courgette/disassembler_elf_32_x86_unittest.cc
+++ b/courgette/disassembler_elf_32_x86_unittest.cc
@@ -48,20 +48,31 @@
   // Prove that none of the rel32 RVAs overlap with abs32 RVAs
   std::set<courgette::RVA> abs(disassembler->Abs32Locations().begin(),
                                disassembler->Abs32Locations().end());
-  std::set<courgette::RVA> rel(disassembler->Rel32Locations().begin(),
-                               disassembler->Rel32Locations().end());
-  for (std::vector<courgette::RVA>::iterator rel32 =
-        disassembler->Rel32Locations().begin();
+  std::set<courgette::DisassemblerElf32::TypedRVA*>
+    rel(disassembler->Rel32Locations().begin(),
+        disassembler->Rel32Locations().end());
+  for (std::vector<courgette::DisassemblerElf32::TypedRVA*>::iterator
+         rel32 = disassembler->Rel32Locations().begin();
        rel32 !=  disassembler->Rel32Locations().end();
        rel32++) {
-    EXPECT_TRUE(abs.find(*rel32) == abs.end());
+    EXPECT_TRUE(abs.find((*rel32)->rva()) == abs.end());
   }
 
   for (std::vector<courgette::RVA>::iterator abs32 =
         disassembler->Abs32Locations().begin();
        abs32 !=  disassembler->Abs32Locations().end();
        abs32++) {
-    EXPECT_TRUE(rel.find(*abs32) == rel.end());
+    bool found = false;
+    for (std::vector<courgette::DisassemblerElf32::TypedRVA*>::iterator
+           rel32 = disassembler->Rel32Locations().begin();
+         rel32 !=  disassembler->Rel32Locations().end();
+         rel32++) {
+      if (*abs32 == (*rel32)->rva()) {
+        found = true;
+        break;
+      }
+    }
+    EXPECT_TRUE(!found);
   }
   delete program;
 }
diff --git a/courgette/typedrva_unittest.cc b/courgette/typedrva_unittest.cc
new file mode 100644
index 0000000..780c392
--- /dev/null
+++ b/courgette/typedrva_unittest.cc
@@ -0,0 +1,92 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "courgette/base_test_unittest.h"
+#include "courgette/disassembler_elf_32_arm.h"
+#include "courgette/disassembler_elf_32_x86.h"
+
+class TypedRVATest : public BaseTest {
+ public:
+  void TestRelativeTargetX86(courgette::RVA word, courgette::RVA expected)
+    const;
+
+  void TestRelativeTargetARM(courgette::ARM_RVA arm_rva,
+                             courgette::RVA rva,
+                             uint32 op,
+                             courgette::RVA expected) const;
+};
+
+void TypedRVATest::TestRelativeTargetX86(courgette::RVA word,
+                                         courgette::RVA expected) const {
+  courgette::DisassemblerElf32X86::TypedRVAX86* typed_rva
+    = new courgette::DisassemblerElf32X86::TypedRVAX86(0);
+  const uint8* op_pointer = reinterpret_cast<const uint8*>(&word);
+
+  EXPECT_TRUE(typed_rva->ComputeRelativeTarget(op_pointer));
+  EXPECT_EQ(typed_rva->relative_target(), expected);
+}
+
+uint32 Read32LittleEndian(const void* address) {
+  return *reinterpret_cast<const uint32*>(address);
+}
+
+void TypedRVATest::TestRelativeTargetARM(courgette::ARM_RVA arm_rva,
+                                         courgette::RVA rva,
+                                         uint32 op,
+                                         courgette::RVA expected) const {
+  courgette::DisassemblerElf32ARM::TypedRVAARM* typed_rva
+    = new courgette::DisassemblerElf32ARM::TypedRVAARM(arm_rva, 0);
+  uint8* op_pointer = reinterpret_cast<uint8*>(&op);
+
+  EXPECT_TRUE(typed_rva->ComputeRelativeTarget(op_pointer));
+  EXPECT_EQ(rva + typed_rva->relative_target(), expected);
+}
+
+TEST_F(TypedRVATest, TestX86) {
+  TestRelativeTargetX86(0x0, 0x4);
+}
+
+// ARM opcodes taken from and tested against the output of
+// "arm-linux-gnueabi-objdump -d daisy_3701.98.0/bin/ls"
+
+TEST_F(TypedRVATest, TestARM_OFF8_PREFETCH) {
+  TestRelativeTargetARM(courgette::ARM_OFF8, 0x0, 0x0, 0x4);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF8_FORWARDS) {
+  TestRelativeTargetARM(courgette::ARM_OFF8, 0x2bcc, 0xd00e, 0x2bec);
+  TestRelativeTargetARM(courgette::ARM_OFF8, 0x3752, 0xd910, 0x3776);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF8_BACKWARDS) {
+  TestRelativeTargetARM(courgette::ARM_OFF8, 0x3774, 0xd1f6, 0x3764);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF11_PREFETCH) {
+  TestRelativeTargetARM(courgette::ARM_OFF11, 0x0, 0x0, 0x4);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF11_FORWARDS) {
+  TestRelativeTargetARM(courgette::ARM_OFF11, 0x2bea, 0xe005, 0x2bf8);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF11_BACKWARDS) {
+  TestRelativeTargetARM(courgette::ARM_OFF11, 0x2f80, 0xe6cd, 0x2d1e);
+  TestRelativeTargetARM(courgette::ARM_OFF11, 0x3610, 0xe56a, 0x30e8);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF24_PREFETCH) {
+  TestRelativeTargetARM(courgette::ARM_OFF24, 0x0, 0x0, 0x8);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF24_FORWARDS) {
+  TestRelativeTargetARM(courgette::ARM_OFF24, 0x2384, 0x4af3613a, 0xffcda874);
+  TestRelativeTargetARM(courgette::ARM_OFF24, 0x23bc, 0x6af961b9, 0xffe5aaa8);
+  TestRelativeTargetARM(courgette::ARM_OFF24, 0x23d4, 0x2b006823, 0x1c468);
+}
+
+TEST_F(TypedRVATest, TestARM_OFF24_BACKWARDS) {
+  // TODO(paulgazz): find a real-world example of an ARM branch op
+  // that jumps backwards.
+}
diff --git a/crypto/crypto.target.darwin-arm.mk b/crypto/crypto.target.darwin-arm.mk
index 3a1dc2a..11e97da 100644
--- a/crypto/crypto.target.darwin-arm.mk
+++ b/crypto/crypto.target.darwin-arm.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/crypto/crypto.target.darwin-mips.mk b/crypto/crypto.target.darwin-mips.mk
index b5a164f..34d11d8 100644
--- a/crypto/crypto.target.darwin-mips.mk
+++ b/crypto/crypto.target.darwin-mips.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/crypto/crypto.target.darwin-x86.mk b/crypto/crypto.target.darwin-x86.mk
index 260838d..033038a 100644
--- a/crypto/crypto.target.darwin-x86.mk
+++ b/crypto/crypto.target.darwin-x86.mk
@@ -93,10 +93,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/crypto/crypto.target.linux-arm.mk b/crypto/crypto.target.linux-arm.mk
index 3a1dc2a..11e97da 100644
--- a/crypto/crypto.target.linux-arm.mk
+++ b/crypto/crypto.target.linux-arm.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/crypto/crypto.target.linux-mips.mk b/crypto/crypto.target.linux-mips.mk
index b5a164f..34d11d8 100644
--- a/crypto/crypto.target.linux-mips.mk
+++ b/crypto/crypto.target.linux-mips.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/crypto/crypto.target.linux-x86.mk b/crypto/crypto.target.linux-x86.mk
index 260838d..033038a 100644
--- a/crypto/crypto.target.linux-x86.mk
+++ b/crypto/crypto.target.linux-x86.mk
@@ -93,10 +93,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCRYPTO_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/extensions/common/constants.cc b/extensions/common/constants.cc
index f84386a..b739061 100644
--- a/extensions/common/constants.cc
+++ b/extensions/common/constants.cc
@@ -4,6 +4,8 @@
 
 #include "extensions/common/constants.h"
 
+#include "base/files/file_path.h"
+
 namespace extensions {
 
 const char kExtensionScheme[] = "chrome-extension";
@@ -19,4 +21,20 @@
 
 const char kInstallDirectoryName[] = "Extensions";
 
-} // namespace extensions
+const char kTempExtensionName[] = "CRX_INSTALL";
+
+const char kDecodedImagesFilename[] = "DECODED_IMAGES";
+
+const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS";
+
+const char kGeneratedBackgroundPageFilename[] =
+    "_generated_background_page.html";
+
+const char kModulesDir[] = "_modules";
+
+const base::FilePath::CharType kExtensionFileExtension[] =
+    FILE_PATH_LITERAL(".crx");
+const base::FilePath::CharType kExtensionKeyFileExtension[] =
+    FILE_PATH_LITERAL(".pem");
+
+}  // namespace extensions
diff --git a/extensions/common/constants.h b/extensions/common/constants.h
index aeb9e67..492ddbc 100644
--- a/extensions/common/constants.h
+++ b/extensions/common/constants.h
@@ -28,6 +28,30 @@
 // installed to.
 extern const char kInstallDirectoryName[];
 
+// The name of a temporary directory to install an extension into for
+// validation before finalizing install.
+extern const char kTempExtensionName[];
+
+// The file to write our decoded images to, relative to the extension_path.
+extern const char kDecodedImagesFilename[];
+
+// The file to write our decoded message catalogs to, relative to the
+// extension_path.
+extern const char kDecodedMessageCatalogsFilename[];
+
+// The filename to use for a background page generated from
+// background.scripts.
+extern const char kGeneratedBackgroundPageFilename[];
+
+// Path to imported modules.
+extern const char kModulesDir[];
+
+// The file extension (.crx) for extensions.
+extern const base::FilePath::CharType kExtensionFileExtension[];
+
+// The file extension (.pem) for private key files.
+extern const base::FilePath::CharType kExtensionKeyFileExtension[];
+
 }  // namespace extensions
 
 #endif  // EXTENSIONS_COMMON_CONSTANTS_H_
diff --git a/google_apis/gaia/DEPS b/google_apis/gaia/DEPS
index e88533d..f445dee 100644
--- a/google_apis/gaia/DEPS
+++ b/google_apis/gaia/DEPS
@@ -1,5 +1,5 @@
 specific_include_rules = {
   ".*_[a-z]*test\.cc": [
-    "+content/public/test/test_browser_thread.h",
+    "+content/public/test/test_browser_thread_bundle.h",
   ]
 }
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 6311a9b..74fed98 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -8,7 +8,6 @@
 #include <string>
 
 #include "base/json/json_reader.h"
-#include "base/message_loop/message_loop.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
 #include "google_apis/gaia/gaia_auth_consumer.h"
@@ -102,7 +101,7 @@
 }
 
 class GaiaAuthFetcherTest : public testing::Test {
- public:
+ protected:
   GaiaAuthFetcherTest()
       : client_login_source_(GaiaUrls::GetInstance()->client_login_url()),
         issue_auth_token_source_(
diff --git a/google_apis/gaia/gaia_oauth_client_unittest.cc b/google_apis/gaia/gaia_oauth_client_unittest.cc
index e84a698..cdeb483 100644
--- a/google_apis/gaia/gaia_oauth_client_unittest.cc
+++ b/google_apis/gaia/gaia_oauth_client_unittest.cc
@@ -7,7 +7,6 @@
 #include <string>
 #include <vector>
 
-#include "base/message_loop/message_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
 #include "google_apis/gaia/gaia_oauth_client.h"
@@ -155,8 +154,7 @@
 namespace gaia {
 
 class GaiaOAuthClientTest : public testing::Test {
- public:
-  GaiaOAuthClientTest() {}
+ protected:
   virtual void SetUp() OVERRIDE {
     client_info_.client_id = "test_client_id";
     client_info_.client_secret = "test_client_secret";
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
index a6dd621..6b12da3 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -7,8 +7,7 @@
 #include <string>
 
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "google_apis/gaia/oauth2_access_token_consumer.h"
@@ -25,7 +24,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-using content::BrowserThread;
 using net::ResponseCookies;
 using net::ScopedURLFetcherFactory;
 using net::TestURLFetcher;
@@ -84,9 +82,8 @@
 class OAuth2AccessTokenFetcherTest : public testing::Test {
  public:
   OAuth2AccessTokenFetcherTest()
-    : ui_thread_(BrowserThread::UI, &message_loop_),
-      request_context_getter_(new net::TestURLRequestContextGetter(
-          message_loop_.message_loop_proxy())),
+    : request_context_getter_(new net::TestURLRequestContextGetter(
+          base::MessageLoopProxy::current())),
       fetcher_(&consumer_, request_context_getter_) {
   }
 
@@ -112,8 +109,7 @@
   }
 
  protected:
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
+  content::TestBrowserThreadBundle thread_bundle_;
   MockUrlFetcherFactory factory_;
   MockOAuth2AccessTokenConsumer consumer_;
   scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_;
diff --git a/google_apis/gaia/oauth2_api_call_flow_unittest.cc b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
index 7d8d138..d56a613 100644
--- a/google_apis/gaia/oauth2_api_call_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
@@ -109,10 +109,6 @@
 }  // namespace
 
 class OAuth2ApiCallFlowTest : public testing::Test {
- public:
-  OAuth2ApiCallFlowTest() {}
-  virtual ~OAuth2ApiCallFlowTest() {}
-
  protected:
   void SetupAccessTokenFetcher(
       const std::string& rt, const std::vector<std::string>& scopes) {
diff --git a/google_apis/google_apis.target.darwin-arm.mk b/google_apis/google_apis.target.darwin-arm.mk
index 9b9f53b..289522d 100644
--- a/google_apis/google_apis.target.darwin-arm.mk
+++ b/google_apis/google_apis.target.darwin-arm.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/google_apis/google_apis.target.darwin-mips.mk b/google_apis/google_apis.target.darwin-mips.mk
index e0dcadc..d0c913b 100644
--- a/google_apis/google_apis.target.darwin-mips.mk
+++ b/google_apis/google_apis.target.darwin-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/google_apis/google_apis.target.darwin-x86.mk b/google_apis/google_apis.target.darwin-x86.mk
index 4991651..cf5e65e 100644
--- a/google_apis/google_apis.target.darwin-x86.mk
+++ b/google_apis/google_apis.target.darwin-x86.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/google_apis/google_apis.target.linux-arm.mk b/google_apis/google_apis.target.linux-arm.mk
index 9b9f53b..289522d 100644
--- a/google_apis/google_apis.target.linux-arm.mk
+++ b/google_apis/google_apis.target.linux-arm.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/google_apis/google_apis.target.linux-mips.mk b/google_apis/google_apis.target.linux-mips.mk
index e0dcadc..d0c913b 100644
--- a/google_apis/google_apis.target.linux-mips.mk
+++ b/google_apis/google_apis.target.linux-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/google_apis/google_apis.target.linux-x86.mk b/google_apis/google_apis.target.linux-x86.mk
index 4991651..cf5e65e 100644
--- a/google_apis/google_apis.target.linux-x86.mk
+++ b/google_apis/google_apis.target.linux-x86.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h
index 2568074..433242c 100644
--- a/gpu/GLES2/gl2extchromium.h
+++ b/gpu/GLES2/gl2extchromium.h
@@ -339,6 +339,9 @@
 #ifndef GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM
 #define GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM 0x84F5
 #endif
+#ifndef GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM
+#define GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM 0x84F6
+#endif
 #endif  /* GL_CHROMIUM_async_pixel_transfers */
 
 /* GL_CHROMIUM_copy_texture */
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 460ae72..6555da2 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -826,6 +826,7 @@
       'GL_COMMANDS_ISSUED_CHROMIUM',
       'GL_LATENCY_QUERY_CHROMIUM',
       'GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM',
+      'GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM',
     ],
   },
   'RenderBufferParameter': {
@@ -1908,7 +1909,8 @@
         'GLint x, GLint y, GLsizei width, GLsizei height, '
         'GLenumReadPixelFormat format, GLenumReadPixelType type, '
         'uint32 pixels_shm_id, uint32 pixels_shm_offset, '
-        'uint32 result_shm_id, uint32 result_shm_offset',
+        'uint32 result_shm_id, uint32 result_shm_offset, '
+        'GLboolean async',
     'result': ['uint32'],
     'defer_reads': True,
   },
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index 742c97e..8d2fd7d 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -923,12 +923,12 @@
   void ReadPixels(
       GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
       GLenum type, uint32 pixels_shm_id, uint32 pixels_shm_offset,
-      uint32 result_shm_id, uint32 result_shm_offset) {
+      uint32 result_shm_id, uint32 result_shm_offset, GLboolean async) {
     gles2::cmds::ReadPixels* c = GetCmdSpace<gles2::cmds::ReadPixels>();
     if (c) {
       c->Init(
           x, y, width, height, format, type, pixels_shm_id, pixels_shm_offset,
-          result_shm_id, result_shm_offset);
+          result_shm_id, result_shm_offset, async);
     }
   }
 
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 1bc3f0b..e13a1ec 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -2236,8 +2236,7 @@
     if (buffer && buffer->shm_id() != -1) {
       helper_->ReadPixels(xoffset, yoffset, width, height, format, type,
                           buffer->shm_id(), buffer->shm_offset(),
-                          0, 0);
-      buffer->set_transfer_ready_token(helper_->InsertToken());
+                          0, 0, true);
       CheckGLError();
     }
     return;
@@ -2269,7 +2268,8 @@
     helper_->ReadPixels(
         xoffset, yoffset, width, num_rows, format, type,
         buffer.shm_id(), buffer.offset(),
-        GetResultShmId(), GetResultShmOffset());
+        GetResultShmId(), GetResultShmOffset(),
+        false);
     WaitForCmd();
     if (*result != 0) {
       // when doing a y-flip we have to iterate through top-to-bottom chunks
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 7208425..bdbde8f 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -1438,11 +1438,12 @@
   Cmds expected;
   expected.read1.Init(
       0, 0, kWidth, kHeight / 2, kFormat, kType,
-      mem1.id, mem1.offset, result1.id, result1.offset);
+      mem1.id, mem1.offset, result1.id, result1.offset,
+      false);
   expected.set_token1.Init(GetNextToken());
   expected.read2.Init(
       0, kHeight / 2, kWidth, kHeight / 2, kFormat, kType,
-      mem2.id, mem2.offset, result2.id, result2.offset);
+      mem2.id, mem2.offset, result2.id, result2.offset, false);
   expected.set_token2.Init(GetNextToken());
   scoped_ptr<int8[]> buffer(new int8[kWidth * kHeight * kBytesPerPixel]);
 
@@ -1474,7 +1475,7 @@
   Cmds expected;
   expected.read.Init(
       0, 0, kWidth, kHeight, kFormat, kType,
-      mem1.id, mem1.offset, result1.id, result1.offset);
+      mem1.id, mem1.offset, result1.id, result1.offset, false);
   expected.set_token.Init(GetNextToken());
   scoped_ptr<int8[]> buffer(new int8[kWidth * kHeight * kBytesPerPixel]);
 
diff --git a/gpu/command_buffer/client/query_tracker.cc b/gpu/command_buffer/client/query_tracker.cc
index 7cdc7fd..35732bf 100644
--- a/gpu/command_buffer/client/query_tracker.cc
+++ b/gpu/command_buffer/client/query_tracker.cc
@@ -113,9 +113,7 @@
       gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset());
       break;
     case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM:
-      // tell service about id, shared memory and count
-      gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset());
-      break;
+    case GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM:
     default:
       // tell service about id, shared memory and count
       gl->helper()->BeginQueryEXT(target(), id(), shm_id(), shm_offset());
@@ -165,8 +163,7 @@
                              static_cast<uint64>(0xFFFFFFFFL));
           break;
         case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM:
-          result_ = info_.sync->result;
-          break;
+        case GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM:
         default:
           result_ = info_.sync->result;
           break;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index c84a363..11b9901 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -4887,7 +4887,7 @@
   void Init(
       GLint _x, GLint _y, GLsizei _width, GLsizei _height, GLenum _format,
       GLenum _type, uint32 _pixels_shm_id, uint32 _pixels_shm_offset,
-      uint32 _result_shm_id, uint32 _result_shm_offset) {
+      uint32 _result_shm_id, uint32 _result_shm_offset, GLboolean _async) {
     SetHeader();
     x = _x;
     y = _y;
@@ -4899,17 +4899,18 @@
     pixels_shm_offset = _pixels_shm_offset;
     result_shm_id = _result_shm_id;
     result_shm_offset = _result_shm_offset;
+    async = _async;
   }
 
   void* Set(
       void* cmd, GLint _x, GLint _y, GLsizei _width, GLsizei _height,
       GLenum _format, GLenum _type, uint32 _pixels_shm_id,
       uint32 _pixels_shm_offset, uint32 _result_shm_id,
-      uint32 _result_shm_offset) {
+      uint32 _result_shm_offset, GLboolean _async) {
     static_cast<ValueType*>(
         cmd)->Init(
             _x, _y, _width, _height, _format, _type, _pixels_shm_id,
-            _pixels_shm_offset, _result_shm_id, _result_shm_offset);
+            _pixels_shm_offset, _result_shm_id, _result_shm_offset, _async);
     return NextCmdAddress<ValueType>(cmd);
   }
 
@@ -4924,10 +4925,11 @@
   uint32 pixels_shm_offset;
   uint32 result_shm_id;
   uint32 result_shm_offset;
+  uint32 async;
 };
 
-COMPILE_ASSERT(sizeof(ReadPixels) == 44,
-               Sizeof_ReadPixels_is_not_44);
+COMPILE_ASSERT(sizeof(ReadPixels) == 48,
+               Sizeof_ReadPixels_is_not_48);
 COMPILE_ASSERT(offsetof(ReadPixels, header) == 0,
                OffsetOf_ReadPixels_header_not_0);
 COMPILE_ASSERT(offsetof(ReadPixels, x) == 4,
@@ -4950,6 +4952,8 @@
                OffsetOf_ReadPixels_result_shm_id_not_36);
 COMPILE_ASSERT(offsetof(ReadPixels, result_shm_offset) == 40,
                OffsetOf_ReadPixels_result_shm_offset_not_40);
+COMPILE_ASSERT(offsetof(ReadPixels, async) == 44,
+               OffsetOf_ReadPixels_async_not_44);
 
 struct ReleaseShaderCompiler {
   typedef ReleaseShaderCompiler ValueType;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index 87e426f..740e6cb 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -1803,7 +1803,8 @@
       static_cast<uint32>(17),
       static_cast<uint32>(18),
       static_cast<uint32>(19),
-      static_cast<uint32>(20));
+      static_cast<uint32>(20),
+      static_cast<GLboolean>(21));
   EXPECT_EQ(static_cast<uint32>(cmds::ReadPixels::kCmdId),
             cmd.header.command);
   EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
@@ -1817,6 +1818,7 @@
   EXPECT_EQ(static_cast<uint32>(18), cmd.pixels_shm_offset);
   EXPECT_EQ(static_cast<uint32>(19), cmd.result_shm_id);
   EXPECT_EQ(static_cast<uint32>(20), cmd.result_shm_offset);
+  EXPECT_EQ(static_cast<GLboolean>(21), cmd.async);
   CheckBytesWrittenMatchesExpectedSize(
       next_cmd, sizeof(cmd));
 }
diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
index c2fab6a..573aee9 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
@@ -228,7 +228,7 @@
   { 0x84F5, "GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM", },
   { 0x882A, "GL_DRAW_BUFFER5_NV", },
   { 0x80AA, "GL_SAMPLE_COVERAGE_VALUE", },
-  { 0x84F6, "GL_TEXTURE_BINDING_RECTANGLE_ARB", },
+  { 0x84F6, "GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM", },
   { 0x80AB, "GL_SAMPLE_COVERAGE_INVERT", },
   { 0x8FC4, "GL_SHADER_BINARY_VIV", },
   { 0x882B, "GL_DRAW_BUFFER6_NV", },
@@ -1080,6 +1080,8 @@
     { GL_LATENCY_QUERY_CHROMIUM, "GL_LATENCY_QUERY_CHROMIUM" },
     { GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM,
     "GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM" },
+    { GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM,
+    "GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM" },
   };
   return GLES2Util::GetQualifiedEnumString(
       string_table, arraysize(string_table), value);
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-arm.mk b/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
index 007c0c9..3b06936 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-mips.mk b/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
index a8edfaa..e444149 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-x86.mk b/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
index 332c186..9267d1f 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-arm.mk b/gpu/command_buffer/gles2_utils.target.linux-arm.mk
index 007c0c9..3b06936 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-arm.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-mips.mk b/gpu/command_buffer/gles2_utils.target.linux-mips.mk
index a8edfaa..e444149 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-mips.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-x86.mk b/gpu/command_buffer/gles2_utils.target.linux-x86.mk
index 332c186..9267d1f 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-x86.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DGLES2_UTILS_IMPLEMENTATION' \
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 81eeaba..1cd68f5 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -7,7 +7,6 @@
 #include <limits>
 
 #include "base/logging.h"
-#include "base/process_util.h"
 #include "base/debug/trace_event.h"
 #include "gpu/command_buffer/common/cmd_buffer_common.h"
 #include "gpu/command_buffer/common/command_buffer_shared.h"
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index f759bef..b0fb120 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -119,7 +119,8 @@
       enable_shader_name_hashing(false),
       enable_samplers(false),
       ext_draw_buffers(false),
-      ext_frag_depth(false) {
+      ext_frag_depth(false),
+      use_async_readpixels(false) {
 }
 
 FeatureInfo::Workarounds::Workarounds() :
@@ -642,6 +643,16 @@
     feature_flags_.ext_frag_depth = true;
   }
 
+  bool ui_gl_fence_works =
+      extensions.Contains("GL_NV_fence") ||
+      extensions.Contains("GL_ARB_sync");
+
+  if (ui_gl_fence_works &&
+      extensions.Contains("GL_ARB_pixel_buffer_object") &&
+      !workarounds_.disable_async_readpixels) {
+    feature_flags_.use_async_readpixels = true;
+  }
+
   if (!disallowed_features_.swap_buffer_complete_callback)
     AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
 
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index de52159..a9ccf64 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -48,6 +48,7 @@
     bool enable_samplers;
     bool ext_draw_buffers;
     bool ext_frag_depth;
+    bool use_async_readpixels;
   };
 
   struct Workarounds {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 3c49a73..1075b34 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -59,6 +59,7 @@
 #include "gpu/command_buffer/service/vertex_array_manager.h"
 #include "gpu/command_buffer/service/vertex_attrib_manager.h"
 #include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_fence.h"
 #include "ui/gl/gl_image.h"
 #include "ui/gl/gl_implementation.h"
 #include "ui/gl/gl_surface.h"
@@ -477,6 +478,19 @@
   DISALLOW_COPY_AND_ASSIGN(BackFramebuffer);
 };
 
+struct FenceCallback {
+  explicit FenceCallback()
+      : fence(gfx::GLFence::Create()) {
+    DCHECK(fence);
+  }
+  void AddCallback(base::Closure cb) {
+    callbacks.push_back(cb);
+  }
+  std::vector<base::Closure> callbacks;
+  scoped_ptr<gfx::GLFence> fence;
+};
+
+
 // }  // anonymous namespace.
 
 bool GLES2Decoder::GetServiceTextureId(uint32 client_texture_id,
@@ -587,6 +601,8 @@
   virtual bool HasMoreIdleWork() OVERRIDE;
   virtual void PerformIdleWork() OVERRIDE;
 
+  virtual void WaitForReadPixels(base::Closure callback) OVERRIDE;
+
   virtual void SetResizeCallback(
       const base::Callback<void(gfx::Size, float)>& callback) OVERRIDE;
 
@@ -1561,6 +1577,9 @@
            surface_->DeferDraws();
   }
 
+  void ProcessPendingReadPixels();
+  void FinishReadPixels(const cmds::ReadPixels& c, GLuint buffer);
+
   void ForceCompileShaderIfPending(Shader* shader);
 
   // Generate a member function prototype for each command in an automated and
@@ -1729,6 +1748,8 @@
 
   scoped_ptr<GPUTracer> gpu_tracer_;
 
+  std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_;
+
   DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl);
 };
 
@@ -2820,6 +2841,7 @@
 }
 
 void GLES2DecoderImpl::ProcessFinishedAsyncTransfers() {
+  ProcessPendingReadPixels();
   if (engine() && query_manager_.get())
     query_manager_->ProcessPendingTransferQueries();
 
@@ -3548,6 +3570,7 @@
 
 void GLES2DecoderImpl::DoFinish() {
   glFinish();
+  ProcessPendingReadPixels();
   ProcessPendingQueries();
 }
 
@@ -6762,6 +6785,96 @@
   return error::kNoError;
 }
 
+void GLES2DecoderImpl::FinishReadPixels(
+    const cmds::ReadPixels& c,
+    GLuint buffer) {
+  TRACE_EVENT0("gpu", "GLES2DecoderImpl::FinishReadPixels");
+  GLsizei width = c.width;
+  GLsizei height = c.height;
+  GLenum format = c.format;
+  GLenum type = c.type;
+  typedef cmds::ReadPixels::Result Result;
+  uint32 pixels_size;
+  Result* result = NULL;
+  if (c.result_shm_id != 0) {
+    result = GetSharedMemoryAs<Result*>(
+        c.result_shm_id, c.result_shm_offset, sizeof(*result));
+    if (!result) {
+      if (buffer != 0) {
+        glDeleteBuffersARB(1, &buffer);
+      }
+      return;
+    }
+  }
+  GLES2Util::ComputeImageDataSizes(
+      width, height, format, type, state_.pack_alignment, &pixels_size,
+      NULL, NULL);
+  void* pixels = GetSharedMemoryAs<void*>(
+      c.pixels_shm_id, c.pixels_shm_offset, pixels_size);
+  if (!pixels) {
+    if (buffer != 0) {
+      glDeleteBuffersARB(1, &buffer);
+    }
+    return;
+  }
+
+  if (buffer != 0) {
+    glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, buffer);
+    void* data = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
+    memcpy(pixels, data, pixels_size);
+    // GL_PIXEL_PACK_BUFFER_ARB is currently unused, so we don't
+    // have to restore the state.
+    glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
+    glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
+    glDeleteBuffersARB(1, &buffer);
+  }
+
+  if (result != NULL) {
+    *result = true;
+  }
+
+  GLenum read_format = GetBoundReadFrameBufferInternalFormat();
+  uint32 channels_exist = GLES2Util::GetChannelsForFormat(read_format);
+  if ((channels_exist & 0x0008) == 0 &&
+      workarounds().clear_alpha_in_readpixels) {
+    // Set the alpha to 255 because some drivers are buggy in this regard.
+    uint32 temp_size;
+
+    uint32 unpadded_row_size;
+    uint32 padded_row_size;
+    if (!GLES2Util::ComputeImageDataSizes(
+            width, 2, format, type, state_.pack_alignment, &temp_size,
+            &unpadded_row_size, &padded_row_size)) {
+      return;
+    }
+    // NOTE: Assumes the type is GL_UNSIGNED_BYTE which was true at the time
+    // of this implementation.
+    if (type != GL_UNSIGNED_BYTE) {
+      return;
+    }
+    switch (format) {
+      case GL_RGBA:
+      case GL_BGRA_EXT:
+      case GL_ALPHA: {
+        int offset = (format == GL_ALPHA) ? 0 : 3;
+        int step = (format == GL_ALPHA) ? 1 : 4;
+        uint8* dst = static_cast<uint8*>(pixels) + offset;
+        for (GLint yy = 0; yy < height; ++yy) {
+          uint8* end = dst + unpadded_row_size;
+          for (uint8* d = dst; d < end; d += step) {
+            *d = 255;
+          }
+          dst += padded_row_size;
+        }
+        break;
+      }
+      default:
+        break;
+    }
+  }
+}
+
+
 error::Error GLES2DecoderImpl::HandleReadPixels(
     uint32 immediate_data_size, const cmds::ReadPixels& c) {
   if (ShouldDeferReads())
@@ -6772,6 +6885,7 @@
   GLsizei height = c.height;
   GLenum format = c.format;
   GLenum type = c.type;
+  GLboolean async = c.async;
   if (width < 0 || height < 0) {
     LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glReadPixels", "dimensions < 0");
     return error::kNoError;
@@ -6871,6 +6985,25 @@
       dst += padded_row_size;
     }
   } else {
+    if (async && features().use_async_readpixels) {
+      GLuint buffer;
+      glGenBuffersARB(1, &buffer);
+      glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, buffer);
+      glBufferData(GL_PIXEL_PACK_BUFFER_ARB, pixels_size, NULL, GL_STREAM_READ);
+      GLenum error = glGetError();
+      if (error == GL_NO_ERROR) {
+        glReadPixels(x, y, width, height, format, type, 0);
+        pending_readpixel_fences_.push(linked_ptr<FenceCallback>(
+            new FenceCallback()));
+        WaitForReadPixels(base::Bind(
+            &GLES2DecoderImpl::FinishReadPixels,
+            base::internal::SupportsWeakPtrBase::StaticAsWeakPtr
+            <GLES2DecoderImpl>(this),
+            c, buffer));
+        glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
+        return error::kNoError;
+      }
+    }
     glReadPixels(x, y, width, height, format, type, pixels);
   }
   GLenum error = LOCAL_PEEK_GL_ERROR("glReadPixels");
@@ -6878,51 +7011,7 @@
     if (result != NULL) {
       *result = true;
     }
-
-    GLenum read_format = GetBoundReadFrameBufferInternalFormat();
-    uint32 channels_exist = GLES2Util::GetChannelsForFormat(read_format);
-    if ((channels_exist & 0x0008) == 0 &&
-        workarounds().clear_alpha_in_readpixels) {
-      // Set the alpha to 255 because some drivers are buggy in this regard.
-      uint32 temp_size;
-
-      uint32 unpadded_row_size;
-      uint32 padded_row_size;
-      if (!GLES2Util::ComputeImageDataSizes(
-          width, 2, format, type, state_.pack_alignment, &temp_size,
-          &unpadded_row_size, &padded_row_size)) {
-        LOCAL_SET_GL_ERROR(
-            GL_INVALID_VALUE, "glReadPixels", "dimensions out of range");
-        return error::kNoError;
-      }
-      // NOTE: Assumes the type is GL_UNSIGNED_BYTE which was true at the time
-      // of this implementation.
-      if (type != GL_UNSIGNED_BYTE) {
-        LOCAL_SET_GL_ERROR(
-            GL_INVALID_OPERATION, "glReadPixels",
-            "unsupported readPixel format");
-        return error::kNoError;
-      }
-      switch (format) {
-        case GL_RGBA:
-        case GL_BGRA_EXT:
-        case GL_ALPHA: {
-          int offset = (format == GL_ALPHA) ? 0 : 3;
-          int step = (format == GL_ALPHA) ? 1 : 4;
-          uint8* dst = static_cast<uint8*>(pixels) + offset;
-          for (GLint yy = 0; yy < height; ++yy) {
-            uint8* end = dst + unpadded_row_size;
-            for (uint8* d = dst; d < end; d += step) {
-              *d = 255;
-            }
-            dst += padded_row_size;
-          }
-          break;
-        }
-        default:
-          break;
-      }
-    }
+    FinishReadPixels(c, 0);
   }
 
   return error::kNoError;
@@ -9124,11 +9213,35 @@
   return query_manager_->HavePendingQueries();
 }
 
+// Note that if there are no pending readpixels right now,
+// this function will call the callback immediately.
+void GLES2DecoderImpl::WaitForReadPixels(base::Closure callback) {
+  if (features().use_async_readpixels && !pending_readpixel_fences_.empty()) {
+    pending_readpixel_fences_.back()->callbacks.push_back(callback);
+  } else {
+    callback.Run();
+  }
+}
+
+void GLES2DecoderImpl::ProcessPendingReadPixels() {
+  while (!pending_readpixel_fences_.empty() &&
+         pending_readpixel_fences_.front()->fence->HasCompleted()) {
+    std::vector<base::Closure> callbacks =
+        pending_readpixel_fences_.front()->callbacks;
+    pending_readpixel_fences_.pop();
+    for (size_t i = 0; i < callbacks.size(); i++) {
+      callbacks[i].Run();
+    }
+  }
+}
+
 bool GLES2DecoderImpl::HasMoreIdleWork() {
-  return async_pixel_transfer_manager_->NeedsProcessMorePendingTransfers();
+  return !pending_readpixel_fences_.empty() ||
+      async_pixel_transfer_manager_->NeedsProcessMorePendingTransfers();
 }
 
 void GLES2DecoderImpl::PerformIdleWork() {
+  ProcessPendingReadPixels();
   if (!async_pixel_transfer_manager_->NeedsProcessMorePendingTransfers())
     return;
   async_pixel_transfer_manager_->ProcessMorePendingTransfers();
@@ -9146,6 +9259,7 @@
     case GL_COMMANDS_ISSUED_CHROMIUM:
     case GL_LATENCY_QUERY_CHROMIUM:
     case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM:
+    case GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM:
     case GL_GET_ERROR_QUERY_CHROMIUM:
       break;
     default:
@@ -9158,6 +9272,8 @@
       break;
   }
 
+  // TODO(hubbe): Make it possible to have one query per type running at the
+  // same time.
   if (state_.current_query.get()) {
     LOCAL_SET_GL_ERROR(
         GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress");
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h
index 4f66a62..57445c7 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -213,6 +213,7 @@
   virtual void SetWaitSyncPointCallback(
       const WaitSyncPointCallback& callback) = 0;
 
+  virtual void WaitForReadPixels(base::Closure callback) = 0;
   virtual uint32 GetTextureUploadCount() = 0;
   virtual base::TimeDelta GetTotalTextureUploadTime() = 0;
   virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index 5fe0600..e6c497f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -102,6 +102,8 @@
                void(const ShaderCacheCallback& callback));
   MOCK_METHOD1(SetWaitSyncPointCallback,
                void(const WaitSyncPointCallback& callback));
+  MOCK_METHOD1(WaitForReadPixels,
+               void(base::Closure callback));
   MOCK_METHOD0(GetTextureUploadCount, uint32());
   MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta());
   MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta());
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 09ed184..b426286 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -2316,7 +2316,8 @@
   cmd.Init(in_read_x, in_read_y, in_read_width, in_read_height,
            kFormat, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
 
   GLint unpadded_row_size = emu.ComputeImageDataSize(in_read_width, 1);
@@ -2393,7 +2394,8 @@
   ReadPixels cmd;
   cmd.Init(0, 0, kWidth, kHeight, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   for (GLint yy = 0; yy < kHeight; ++yy) {
     EXPECT_TRUE(emu.CompareRowSegment(
@@ -2440,7 +2442,8 @@
   ReadPixels cmd;
   cmd.Init(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   for (GLint yy = 0; yy < kHeight; ++yy) {
     EXPECT_TRUE(emu.CompareRowSegment(
@@ -2477,34 +2480,41 @@
   ReadPixels cmd;
   cmd.Init(0, 0, -1, 1, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
   cmd.Init(0, 0, 1, -1, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
   cmd.Init(0, 0, 1, 1, GL_RGB, GL_INT,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
   cmd.Init(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE,
            kInvalidSharedMemoryId, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
   cmd.Init(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, kInvalidSharedMemoryOffset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
   cmd.Init(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           kInvalidSharedMemoryId, result_shm_offset);
+           kInvalidSharedMemoryId, result_shm_offset,
+           false);
   EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
   cmd.Init(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, kInvalidSharedMemoryOffset);
+           result_shm_id, kInvalidSharedMemoryOffset,
+           false);
   EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
 }
 
@@ -4932,7 +4942,8 @@
   ReadPixels cmd;
   cmd.Init(x, y, width, height, kFormat, GL_UNSIGNED_BYTE,
            pixels_shm_id, pixels_shm_offset,
-           result_shm_id, result_shm_offset);
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
 }
@@ -6664,8 +6675,9 @@
   uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(*result);
   ReadPixels cmd;
   cmd.Init(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE,
-         pixels_shm_id, pixels_shm_offset,
-         result_shm_id, result_shm_offset);
+           pixels_shm_id, pixels_shm_offset,
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_NO_ERROR, GetGLError());
 }
@@ -6724,8 +6736,9 @@
   uint32 pixels_shm_offset = kSharedMemoryOffset + sizeof(Result);
   ReadPixels cmd;
   cmd.Init(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE,
-         pixels_shm_id, pixels_shm_offset,
-         result_shm_id, result_shm_offset);
+           pixels_shm_id, pixels_shm_offset,
+           result_shm_id, result_shm_offset,
+           false);
   EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
   EXPECT_EQ(GL_NO_ERROR, GetGLError());
 }
diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
index 444cec3..b8194d9 100644
--- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
@@ -300,6 +300,7 @@
   GL_COMMANDS_ISSUED_CHROMIUM,
   GL_LATENCY_QUERY_CHROMIUM,
   GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM,
+  GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM,
 };
 
 static const GLenum valid_read_pixel_format_table[] = {
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index 4af0349..7566099 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -288,6 +288,62 @@
 CommandLatencyQuery::~CommandLatencyQuery() {
 }
 
+
+class AsyncReadPixelsCompletedQuery
+    : public QueryManager::Query,
+      public base::SupportsWeakPtr<AsyncReadPixelsCompletedQuery> {
+ public:
+  AsyncReadPixelsCompletedQuery(
+      QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
+
+  virtual bool Begin() OVERRIDE;
+  virtual bool End(uint32 submit_count) OVERRIDE;
+  virtual bool Process() OVERRIDE;
+  virtual void Destroy(bool have_context) OVERRIDE;
+
+ protected:
+  void Complete();
+  virtual ~AsyncReadPixelsCompletedQuery();
+};
+
+AsyncReadPixelsCompletedQuery::AsyncReadPixelsCompletedQuery(
+    QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
+    : Query(manager, target, shm_id, shm_offset) {
+}
+
+bool AsyncReadPixelsCompletedQuery::Begin() {
+  return true;
+}
+
+bool AsyncReadPixelsCompletedQuery::End(uint32 submit_count) {
+  if (!AddToPendingQueue(submit_count)) {
+    return false;
+  }
+  manager()->decoder()->WaitForReadPixels(
+      base::Bind(&AsyncReadPixelsCompletedQuery::Complete,
+                 AsWeakPtr()));
+
+  return true;
+}
+
+void AsyncReadPixelsCompletedQuery::Complete() {
+  MarkAsCompleted(1);
+}
+
+bool AsyncReadPixelsCompletedQuery::Process() {
+  return true;
+}
+
+void AsyncReadPixelsCompletedQuery::Destroy(bool /* have_context */) {
+  if (!IsDeleted()) {
+    MarkAsDeleted();
+  }
+}
+
+AsyncReadPixelsCompletedQuery::~AsyncReadPixelsCompletedQuery() {
+}
+
+
 class GetErrorQuery : public QueryManager::Query {
  public:
   GetErrorQuery(
@@ -379,6 +435,10 @@
       query = new AsyncPixelTransfersCompletedQuery(
           this, target, shm_id, shm_offset);
       break;
+    case GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM:
+      query = new AsyncReadPixelsCompletedQuery(
+          this, target, shm_id, shm_offset);
+      break;
     case GL_GET_ERROR_QUERY_CHROMIUM:
       query = new GetErrorQuery(this, target, shm_id, shm_offset);
       break;
diff --git a/gpu/command_buffer/service/safe_shared_memory_pool.cc b/gpu/command_buffer/service/safe_shared_memory_pool.cc
index 9496967..1489d5f 100644
--- a/gpu/command_buffer/service/safe_shared_memory_pool.cc
+++ b/gpu/command_buffer/service/safe_shared_memory_pool.cc
@@ -6,7 +6,7 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "build/build_config.h"
 
 using base::SharedMemory;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc
index 1419b4e..76443a1 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -8,8 +8,8 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
 #include "base/debug/trace_event.h"
+#include "base/process/process_handle.h"
 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
 
 using ::base::SharedMemory;
diff --git a/gpu/command_buffer/tests/gl_readback_unittests.cc b/gpu/command_buffer/tests/gl_readback_unittests.cc
index e725213..4ebb09a 100644
--- a/gpu/command_buffer/tests/gl_readback_unittests.cc
+++ b/gpu/command_buffer/tests/gl_readback_unittests.cc
@@ -6,6 +6,9 @@
 #include <GLES2/gl2ext.h>
 #include <GLES2/gl2extchromium.h>
 
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
 #include "gpu/command_buffer/tests/gl_manager.h"
 #include "gpu/command_buffer/tests/gl_test_utils.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -23,39 +26,29 @@
     gl_.Destroy();
   }
 
+  static void WaitForQueryCallback(int q, base::Closure cb) {
+    unsigned int done = 0;
+    glGetQueryObjectuivEXT(q, GL_QUERY_RESULT_AVAILABLE_EXT, &done);
+    if (done) {
+      cb.Run();
+    } else {
+      base::MessageLoop::current()->PostDelayedTask(
+          FROM_HERE,
+          base::Bind(&WaitForQueryCallback, q, cb),
+          base::TimeDelta::FromMilliseconds(3));
+    }
+  }
+
+  void WaitForQuery(int q) {
+    base::RunLoop run_loop;
+    WaitForQueryCallback(q, run_loop.QuitClosure());
+    run_loop.Run();
+  }
+
   GLManager gl_;
 };
 
 
-TEST_F(GLReadbackTest, ReadPixelsWithPBO) {
-  const GLint kBytesPerPixel = 4;
-  const GLint kWidth = 2;
-  const GLint kHeight = 2;
-
-  GLuint b;
-  glClearColor(0.0, 0.0, 1.0, 1.0);
-  glClear(GL_COLOR_BUFFER_BIT);
-  glGenBuffers(1, &b);
-  glBindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, b);
-  glBufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
-               kWidth * kHeight * kBytesPerPixel,
-               NULL,
-               GL_STREAM_READ);
-  glReadPixels(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-  unsigned char *data = static_cast<unsigned char *>(
-      glMapBufferCHROMIUM(
-          GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
-          GL_READ_ONLY));
-  EXPECT_TRUE(data);
-  EXPECT_EQ(data[0], 0);   // red
-  EXPECT_EQ(data[1], 0);   // green
-  EXPECT_EQ(data[2], 255); // blue
-  glUnmapBufferCHROMIUM(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM);
-  glBindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
-  glDeleteBuffers(1, &b);
-  GLTestHelper::CheckGLError("no errors", __LINE__);
-}
-
 TEST_F(GLReadbackTest, ReadPixelsWithPBOAndQuery) {
   const GLint kBytesPerPixel = 4;
   const GLint kWidth = 2;
@@ -71,14 +64,11 @@
                kWidth * kHeight * kBytesPerPixel,
                NULL,
                GL_STREAM_READ);
-  glBeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, q);
+  glBeginQueryEXT(GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM, q);
   glReadPixels(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-  glEndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
+  glEndQueryEXT(GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM);
   glFlush();
-  unsigned int done = 0;
-  while (!done) {
-    glGetQueryObjectuivEXT(q, GL_QUERY_RESULT_AVAILABLE_EXT, &done);
-  }
+  WaitForQuery(q);
 
   // TODO(hubbe): Check that glMapBufferCHROMIUM does not block here.
   unsigned char *data = static_cast<unsigned char *>(
diff --git a/gpu/command_buffer_client.target.darwin-arm.mk b/gpu/command_buffer_client.target.darwin-arm.mk
index 2ca8fa3..63b9da3 100644
--- a/gpu/command_buffer_client.target.darwin-arm.mk
+++ b/gpu/command_buffer_client.target.darwin-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_client.target.darwin-mips.mk b/gpu/command_buffer_client.target.darwin-mips.mk
index 40ba617..dcfe4fe 100644
--- a/gpu/command_buffer_client.target.darwin-mips.mk
+++ b/gpu/command_buffer_client.target.darwin-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_client.target.darwin-x86.mk b/gpu/command_buffer_client.target.darwin-x86.mk
index 045cf3e..cdb170a 100644
--- a/gpu/command_buffer_client.target.darwin-x86.mk
+++ b/gpu/command_buffer_client.target.darwin-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_client.target.linux-arm.mk b/gpu/command_buffer_client.target.linux-arm.mk
index 2ca8fa3..63b9da3 100644
--- a/gpu/command_buffer_client.target.linux-arm.mk
+++ b/gpu/command_buffer_client.target.linux-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_client.target.linux-mips.mk b/gpu/command_buffer_client.target.linux-mips.mk
index 40ba617..dcfe4fe 100644
--- a/gpu/command_buffer_client.target.linux-mips.mk
+++ b/gpu/command_buffer_client.target.linux-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_client.target.linux-x86.mk b/gpu/command_buffer_client.target.linux-x86.mk
index 045cf3e..cdb170a 100644
--- a/gpu/command_buffer_client.target.linux-x86.mk
+++ b/gpu/command_buffer_client.target.linux-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.darwin-arm.mk b/gpu/command_buffer_common.target.darwin-arm.mk
index bade3b8..50b0620 100644
--- a/gpu/command_buffer_common.target.darwin-arm.mk
+++ b/gpu/command_buffer_common.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.darwin-mips.mk b/gpu/command_buffer_common.target.darwin-mips.mk
index 894b0ea..9b430b8 100644
--- a/gpu/command_buffer_common.target.darwin-mips.mk
+++ b/gpu/command_buffer_common.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.darwin-x86.mk b/gpu/command_buffer_common.target.darwin-x86.mk
index 506d0a8..cf6fc1e 100644
--- a/gpu/command_buffer_common.target.darwin-x86.mk
+++ b/gpu/command_buffer_common.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.linux-arm.mk b/gpu/command_buffer_common.target.linux-arm.mk
index bade3b8..50b0620 100644
--- a/gpu/command_buffer_common.target.linux-arm.mk
+++ b/gpu/command_buffer_common.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.linux-mips.mk b/gpu/command_buffer_common.target.linux-mips.mk
index 894b0ea..9b430b8 100644
--- a/gpu/command_buffer_common.target.linux-mips.mk
+++ b/gpu/command_buffer_common.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_common.target.linux-x86.mk b/gpu/command_buffer_common.target.linux-x86.mk
index 506d0a8..cf6fc1e 100644
--- a/gpu/command_buffer_common.target.linux-x86.mk
+++ b/gpu/command_buffer_common.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/command_buffer_service.target.darwin-arm.mk b/gpu/command_buffer_service.target.darwin-arm.mk
index 37fec1a..43ef0e3 100644
--- a/gpu/command_buffer_service.target.darwin-arm.mk
+++ b/gpu/command_buffer_service.target.darwin-arm.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
@@ -214,10 +214,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
diff --git a/gpu/command_buffer_service.target.darwin-mips.mk b/gpu/command_buffer_service.target.darwin-mips.mk
index 7b04d31..07221a1 100644
--- a/gpu/command_buffer_service.target.darwin-mips.mk
+++ b/gpu/command_buffer_service.target.darwin-mips.mk
@@ -115,10 +115,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
diff --git a/gpu/command_buffer_service.target.darwin-x86.mk b/gpu/command_buffer_service.target.darwin-x86.mk
index c719ce4..f22b359 100644
--- a/gpu/command_buffer_service.target.darwin-x86.mk
+++ b/gpu/command_buffer_service.target.darwin-x86.mk
@@ -118,10 +118,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -218,10 +218,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/gpu/command_buffer_service.target.linux-arm.mk b/gpu/command_buffer_service.target.linux-arm.mk
index 37fec1a..43ef0e3 100644
--- a/gpu/command_buffer_service.target.linux-arm.mk
+++ b/gpu/command_buffer_service.target.linux-arm.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
@@ -214,10 +214,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
diff --git a/gpu/command_buffer_service.target.linux-mips.mk b/gpu/command_buffer_service.target.linux-mips.mk
index 7b04d31..07221a1 100644
--- a/gpu/command_buffer_service.target.linux-mips.mk
+++ b/gpu/command_buffer_service.target.linux-mips.mk
@@ -115,10 +115,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
diff --git a/gpu/command_buffer_service.target.linux-x86.mk b/gpu/command_buffer_service.target.linux-x86.mk
index c719ce4..f22b359 100644
--- a/gpu/command_buffer_service.target.linux-x86.mk
+++ b/gpu/command_buffer_service.target.linux-x86.mk
@@ -118,10 +118,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -218,10 +218,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 597fc32..76ea7d2 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -389,8 +389,7 @@
     {
       "id": 25,
       "cr_bugs": [152225],
-      "description":
-          "Intel OSX drivers prior to mountain lion crashes when using PBOs",
+      "description": "GL_ARB_sync doesn't work on OSX 10.7",
       "os": {
         "type": "macosx",
         "version": {
@@ -398,7 +397,6 @@
           "number": "10.8"
         }
       },
-      "vendor_id": "0x8086",
       "features": [
         "disable_async_readpixels"
       ]
diff --git a/gpu/disk_cache_proto.target.darwin-arm.mk b/gpu/disk_cache_proto.target.darwin-arm.mk
index 8e37a23..b180117 100644
--- a/gpu/disk_cache_proto.target.darwin-arm.mk
+++ b/gpu/disk_cache_proto.target.darwin-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/disk_cache_proto.target.darwin-mips.mk b/gpu/disk_cache_proto.target.darwin-mips.mk
index f91d003..d1ad67b 100644
--- a/gpu/disk_cache_proto.target.darwin-mips.mk
+++ b/gpu/disk_cache_proto.target.darwin-mips.mk
@@ -95,10 +95,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/disk_cache_proto.target.darwin-x86.mk b/gpu/disk_cache_proto.target.darwin-x86.mk
index 461f0ae..1136a32 100644
--- a/gpu/disk_cache_proto.target.darwin-x86.mk
+++ b/gpu/disk_cache_proto.target.darwin-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/disk_cache_proto.target.linux-arm.mk b/gpu/disk_cache_proto.target.linux-arm.mk
index 8e37a23..b180117 100644
--- a/gpu/disk_cache_proto.target.linux-arm.mk
+++ b/gpu/disk_cache_proto.target.linux-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -181,10 +181,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/disk_cache_proto.target.linux-mips.mk b/gpu/disk_cache_proto.target.linux-mips.mk
index f91d003..d1ad67b 100644
--- a/gpu/disk_cache_proto.target.linux-mips.mk
+++ b/gpu/disk_cache_proto.target.linux-mips.mk
@@ -95,10 +95,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/disk_cache_proto.target.linux-x86.mk b/gpu/disk_cache_proto.target.linux-x86.mk
index 461f0ae..1136a32 100644
--- a/gpu/disk_cache_proto.target.linux-x86.mk
+++ b/gpu/disk_cache_proto.target.linux-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -186,10 +186,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/gpu/gles2_c_lib.target.darwin-arm.mk b/gpu/gles2_c_lib.target.darwin-arm.mk
index 0180899..15f4c60 100644
--- a/gpu/gles2_c_lib.target.darwin-arm.mk
+++ b/gpu/gles2_c_lib.target.darwin-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_c_lib.target.darwin-mips.mk b/gpu/gles2_c_lib.target.darwin-mips.mk
index bf4f2b3..4927041 100644
--- a/gpu/gles2_c_lib.target.darwin-mips.mk
+++ b/gpu/gles2_c_lib.target.darwin-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_c_lib.target.darwin-x86.mk b/gpu/gles2_c_lib.target.darwin-x86.mk
index e3d573d..5b2647d 100644
--- a/gpu/gles2_c_lib.target.darwin-x86.mk
+++ b/gpu/gles2_c_lib.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_c_lib.target.linux-arm.mk b/gpu/gles2_c_lib.target.linux-arm.mk
index 0180899..15f4c60 100644
--- a/gpu/gles2_c_lib.target.linux-arm.mk
+++ b/gpu/gles2_c_lib.target.linux-arm.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_c_lib.target.linux-mips.mk b/gpu/gles2_c_lib.target.linux-mips.mk
index bf4f2b3..4927041 100644
--- a/gpu/gles2_c_lib.target.linux-mips.mk
+++ b/gpu/gles2_c_lib.target.linux-mips.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_c_lib.target.linux-x86.mk b/gpu/gles2_c_lib.target.linux-x86.mk
index e3d573d..5b2647d 100644
--- a/gpu/gles2_c_lib.target.linux-x86.mk
+++ b/gpu/gles2_c_lib.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_C_LIB_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-arm.mk b/gpu/gles2_cmd_helper.target.darwin-arm.mk
index 96c816a..5302dc1 100644
--- a/gpu/gles2_cmd_helper.target.darwin-arm.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-mips.mk b/gpu/gles2_cmd_helper.target.darwin-mips.mk
index 4618e90..2de05d8 100644
--- a/gpu/gles2_cmd_helper.target.darwin-mips.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -149,10 +149,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-x86.mk b/gpu/gles2_cmd_helper.target.darwin-x86.mk
index 95c02b6..b92583e 100644
--- a/gpu/gles2_cmd_helper.target.darwin-x86.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_cmd_helper.target.linux-arm.mk b/gpu/gles2_cmd_helper.target.linux-arm.mk
index 96c816a..5302dc1 100644
--- a/gpu/gles2_cmd_helper.target.linux-arm.mk
+++ b/gpu/gles2_cmd_helper.target.linux-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_cmd_helper.target.linux-mips.mk b/gpu/gles2_cmd_helper.target.linux-mips.mk
index 4618e90..2de05d8 100644
--- a/gpu/gles2_cmd_helper.target.linux-mips.mk
+++ b/gpu/gles2_cmd_helper.target.linux-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -149,10 +149,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_cmd_helper.target.linux-x86.mk b/gpu/gles2_cmd_helper.target.linux-x86.mk
index 95c02b6..b92583e 100644
--- a/gpu/gles2_cmd_helper.target.linux-x86.mk
+++ b/gpu/gles2_cmd_helper.target.linux-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gles2_implementation.target.darwin-arm.mk b/gpu/gles2_implementation.target.darwin-arm.mk
index db903a2..bdd8fe3 100644
--- a/gpu/gles2_implementation.target.darwin-arm.mk
+++ b/gpu/gles2_implementation.target.darwin-arm.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/gpu/gles2_implementation.target.darwin-mips.mk b/gpu/gles2_implementation.target.darwin-mips.mk
index 4677751..d932091 100644
--- a/gpu/gles2_implementation.target.darwin-mips.mk
+++ b/gpu/gles2_implementation.target.darwin-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/gpu/gles2_implementation.target.darwin-x86.mk b/gpu/gles2_implementation.target.darwin-x86.mk
index 0613a12..5d748fd 100644
--- a/gpu/gles2_implementation.target.darwin-x86.mk
+++ b/gpu/gles2_implementation.target.darwin-x86.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/gpu/gles2_implementation.target.linux-arm.mk b/gpu/gles2_implementation.target.linux-arm.mk
index db903a2..bdd8fe3 100644
--- a/gpu/gles2_implementation.target.linux-arm.mk
+++ b/gpu/gles2_implementation.target.linux-arm.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/gpu/gles2_implementation.target.linux-mips.mk b/gpu/gles2_implementation.target.linux-mips.mk
index 4677751..d932091 100644
--- a/gpu/gles2_implementation.target.linux-mips.mk
+++ b/gpu/gles2_implementation.target.linux-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/gpu/gles2_implementation.target.linux-x86.mk b/gpu/gles2_implementation.target.linux-x86.mk
index 0613a12..5d748fd 100644
--- a/gpu/gles2_implementation.target.linux-x86.mk
+++ b/gpu/gles2_implementation.target.linux-x86.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGLES2_IMPL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/gpu/gpu.target.darwin-arm.mk b/gpu/gpu.target.darwin-arm.mk
index 460d54e..1f9350b 100644
--- a/gpu/gpu.target.darwin-arm.mk
+++ b/gpu/gpu.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu.target.darwin-mips.mk b/gpu/gpu.target.darwin-mips.mk
index 5e540ef..fc3334c 100644
--- a/gpu/gpu.target.darwin-mips.mk
+++ b/gpu/gpu.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu.target.darwin-x86.mk b/gpu/gpu.target.darwin-x86.mk
index 25743ed..fb8df1f 100644
--- a/gpu/gpu.target.darwin-x86.mk
+++ b/gpu/gpu.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu.target.linux-arm.mk b/gpu/gpu.target.linux-arm.mk
index 460d54e..1f9350b 100644
--- a/gpu/gpu.target.linux-arm.mk
+++ b/gpu/gpu.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu.target.linux-mips.mk b/gpu/gpu.target.linux-mips.mk
index 5e540ef..fc3334c 100644
--- a/gpu/gpu.target.linux-mips.mk
+++ b/gpu/gpu.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu.target.linux-x86.mk b/gpu/gpu.target.linux-x86.mk
index 25743ed..fb8df1f 100644
--- a/gpu/gpu.target.linux-x86.mk
+++ b/gpu/gpu.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.darwin-arm.mk b/gpu/gpu_config.target.darwin-arm.mk
index 2cf311b..17d06d6 100644
--- a/gpu/gpu_config.target.darwin-arm.mk
+++ b/gpu/gpu_config.target.darwin-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.darwin-mips.mk b/gpu/gpu_config.target.darwin-mips.mk
index 0ef9bcf..909b0a2 100644
--- a/gpu/gpu_config.target.darwin-mips.mk
+++ b/gpu/gpu_config.target.darwin-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.darwin-x86.mk b/gpu/gpu_config.target.darwin-x86.mk
index 2b3ad73..b2abe4c 100644
--- a/gpu/gpu_config.target.darwin-x86.mk
+++ b/gpu/gpu_config.target.darwin-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -177,10 +177,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.linux-arm.mk b/gpu/gpu_config.target.linux-arm.mk
index 2cf311b..17d06d6 100644
--- a/gpu/gpu_config.target.linux-arm.mk
+++ b/gpu/gpu_config.target.linux-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.linux-mips.mk b/gpu/gpu_config.target.linux-mips.mk
index 0ef9bcf..909b0a2 100644
--- a/gpu/gpu_config.target.linux-mips.mk
+++ b/gpu/gpu_config.target.linux-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_config.target.linux-x86.mk b/gpu/gpu_config.target.linux-x86.mk
index 2b3ad73..b2abe4c 100644
--- a/gpu/gpu_config.target.linux-x86.mk
+++ b/gpu/gpu_config.target.linux-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -177,10 +177,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.darwin-arm.mk b/gpu/gpu_ipc.target.darwin-arm.mk
index c44b509..0ed2dbf 100644
--- a/gpu/gpu_ipc.target.darwin-arm.mk
+++ b/gpu/gpu_ipc.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.darwin-mips.mk b/gpu/gpu_ipc.target.darwin-mips.mk
index 940ad70..08880c0 100644
--- a/gpu/gpu_ipc.target.darwin-mips.mk
+++ b/gpu/gpu_ipc.target.darwin-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.darwin-x86.mk b/gpu/gpu_ipc.target.darwin-x86.mk
index dabf145..8827f57 100644
--- a/gpu/gpu_ipc.target.darwin-x86.mk
+++ b/gpu/gpu_ipc.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.linux-arm.mk b/gpu/gpu_ipc.target.linux-arm.mk
index c44b509..0ed2dbf 100644
--- a/gpu/gpu_ipc.target.linux-arm.mk
+++ b/gpu/gpu_ipc.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.linux-mips.mk b/gpu/gpu_ipc.target.linux-mips.mk
index 940ad70..08880c0 100644
--- a/gpu/gpu_ipc.target.linux-mips.mk
+++ b/gpu/gpu_ipc.target.linux-mips.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/gpu/gpu_ipc.target.linux-x86.mk b/gpu/gpu_ipc.target.linux-x86.mk
index dabf145..8827f57 100644
--- a/gpu/gpu_ipc.target.linux-x86.mk
+++ b/gpu/gpu_ipc.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ipc/ipc.target.darwin-arm.mk b/ipc/ipc.target.darwin-arm.mk
index 0354076..484674b 100644
--- a/ipc/ipc.target.darwin-arm.mk
+++ b/ipc/ipc.target.darwin-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc.target.darwin-mips.mk b/ipc/ipc.target.darwin-mips.mk
index 2296597..dcd34fc 100644
--- a/ipc/ipc.target.darwin-mips.mk
+++ b/ipc/ipc.target.darwin-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc.target.darwin-x86.mk b/ipc/ipc.target.darwin-x86.mk
index 38e3233..b38b0e3 100644
--- a/ipc/ipc.target.darwin-x86.mk
+++ b/ipc/ipc.target.darwin-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc.target.linux-arm.mk b/ipc/ipc.target.linux-arm.mk
index 0354076..484674b 100644
--- a/ipc/ipc.target.linux-arm.mk
+++ b/ipc/ipc.target.linux-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc.target.linux-mips.mk b/ipc/ipc.target.linux-mips.mk
index 2296597..dcd34fc 100644
--- a/ipc/ipc.target.linux-mips.mk
+++ b/ipc/ipc.target.linux-mips.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc.target.linux-x86.mk b/ipc/ipc.target.linux-x86.mk
index 38e3233..b38b0e3 100644
--- a/ipc/ipc.target.linux-x86.mk
+++ b/ipc/ipc.target.linux-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DIPC_IMPLEMENTATION' \
diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc
index 25899a3..a6ee14c 100644
--- a/ipc/ipc_channel.cc
+++ b/ipc/ipc_channel.cc
@@ -7,7 +7,6 @@
 #include <limits>
 
 #include "base/atomic_sequence_num.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/strings/stringprintf.h"
 
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index 35ead53..f65a62b 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -12,7 +12,7 @@
 #endif
 
 #include "base/compiler_specific.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_message.h"
 #include "ipc/ipc_sender.h"
diff --git a/ipc/ipc_channel_nacl.cc b/ipc/ipc_channel_nacl.cc
index 2c08e7e..860815e 100644
--- a/ipc/ipc_channel_nacl.cc
+++ b/ipc/ipc_channel_nacl.cc
@@ -13,7 +13,6 @@
 #include "base/bind.h"
 #include "base/logging.h"
 #include "base/message_loop/message_loop_proxy.h"
-#include "base/process_util.h"
 #include "base/synchronization/lock.h"
 #include "base/task_runner_util.h"
 #include "base/threading/simple_thread.h"
diff --git a/ipc/ipc_channel_nacl.h b/ipc/ipc_channel_nacl.h
index 1670658..7c8960f 100644
--- a/ipc/ipc_channel_nacl.h
+++ b/ipc/ipc_channel_nacl.h
@@ -11,7 +11,7 @@
 #include "base/memory/linked_ptr.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/threading/simple_thread.h"
 #include "ipc/ipc_channel.h"
 #include "ipc/ipc_channel_reader.h"
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index f685dc0..98a7cd8 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -29,7 +29,7 @@
 #include "base/memory/singleton.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/posix/global_descriptors.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/rand_util.h"
 #include "base/stl_util.h"
 #include "base/strings/string_util.h"
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index e7b775e..645a130 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -14,7 +14,7 @@
 #include <vector>
 
 #include "base/message_loop/message_loop.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/file_descriptor_set_posix.h"
 #include "ipc/ipc_channel_reader.h"
 
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index 06fa62c..66ddeb2 100644
--- a/ipc/ipc_channel_posix_unittest.cc
+++ b/ipc/ipc_channel_posix_unittest.cc
@@ -18,6 +18,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
 #include "base/posix/eintr_wrapper.h"
+#include "base/process/kill.h"
 #include "base/test/multiprocess_test.h"
 #include "base/test/test_timeouts.h"
 #include "ipc/ipc_listener.h"
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index dac7110..6d7cfe8 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -11,7 +11,7 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/pickle.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/rand_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc
index c99a963..65d8890 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -14,7 +14,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/threading/thread.h"
diff --git a/ipc/ipc_platform_file.h b/ipc/ipc_platform_file.h
index c628329..553c78c 100644
--- a/ipc/ipc_platform_file.h
+++ b/ipc/ipc_platform_file.h
@@ -7,7 +7,7 @@
 
 #include "base/basictypes.h"
 #include "base/platform_file.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_export.h"
 
 #if defined(OS_POSIX)
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index 1eb7696..30f02f7 100644
--- a/ipc/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -12,7 +12,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/run_loop.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/waitable_event.h"
diff --git a/ipc/ipc_test_base.cc b/ipc/ipc_test_base.cc
index a8ee64f..5e16e42 100644
--- a/ipc/ipc_test_base.cc
+++ b/ipc/ipc_test_base.cc
@@ -8,6 +8,7 @@
 
 #include "base/command_line.h"
 #include "base/debug/debug_on_start_win.h"
+#include "base/process/kill.h"
 #include "base/threading/thread.h"
 #include "base/time/time.h"
 #include "ipc/ipc_descriptors.h"
diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h
index 2ce2d76..5bd3e96 100644
--- a/ipc/ipc_test_base.h
+++ b/ipc/ipc_test_base.h
@@ -9,7 +9,7 @@
 
 #include "base/basictypes.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/test/multiprocess_test.h"
 #include "ipc/ipc_channel.h"
 #include "ipc/ipc_channel_proxy.h"
diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc
index f9502f9..2888607 100644
--- a/ipc/sync_socket_unittest.cc
+++ b/ipc/sync_socket_unittest.cc
@@ -10,7 +10,6 @@
 
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/threading/thread.h"
 #include "ipc/ipc_test_base.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/media/audio/audio_output_device_unittest.cc b/media/audio/audio_output_device_unittest.cc
index c17c0d6..96da77d 100644
--- a/media/audio/audio_output_device_unittest.cc
+++ b/media/audio/audio_output_device_unittest.cc
@@ -7,7 +7,7 @@
 #include "base/at_exit.h"
 #include "base/memory/shared_memory.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/sync_socket.h"
 #include "base/test/test_timeouts.h"
 #include "media/audio/audio_output_device.h"
diff --git a/media/audio/audio_power_monitor_unittest.cc b/media/audio/audio_power_monitor_unittest.cc
index baea139..938837d 100644
--- a/media/audio/audio_power_monitor_unittest.cc
+++ b/media/audio/audio_power_monitor_unittest.cc
@@ -82,6 +82,15 @@
   scoped_ptr<AudioBus> bus_;
 };
 
+// Value printer for TestScenario.  Required to prevent Valgrind "access to
+// uninitialized memory" errors (http://crbug.com/263315).
+::std::ostream& operator<<(::std::ostream& os, const TestScenario& ts) {
+  return os << "{" << ts.data().channels() << "-channel signal} --> {"
+            << ts.expected_power() << " dBFS, "
+            << (ts.expected_clipped() ? "clipped" : "not clipped")
+            << "}";
+}
+
 // An observer that receives power measurements.  Each power measurement should
 // should make progress towards the goal value.
 class MeasurementObserver {
diff --git a/media/audio/cras/audio_manager_cras.cc b/media/audio/cras/audio_manager_cras.cc
index e1a140e..73d689a 100644
--- a/media/audio/cras/audio_manager_cras.cc
+++ b/media/audio/cras/audio_manager_cras.cc
@@ -8,7 +8,6 @@
 #include "base/environment.h"
 #include "base/logging.h"
 #include "base/nix/xdg_util.h"
-#include "base/process_util.h"
 #include "base/stl_util.h"
 #include "media/audio/audio_util.h"
 #include "media/audio/cras/cras_input.h"
diff --git a/media/audio/cross_process_notification.h b/media/audio/cross_process_notification.h
index cae7435..16f2fc0 100644
--- a/media/audio/cross_process_notification.h
+++ b/media/audio/cross_process_notification.h
@@ -8,7 +8,7 @@
 #include <vector>
 
 #include "base/basictypes.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/threading/non_thread_safe.h"
 #include "media/base/media_export.h"
 
diff --git a/media/audio/cross_process_notification_unittest.cc b/media/audio/cross_process_notification_unittest.cc
index 2e7ce34..a272194 100644
--- a/media/audio/cross_process_notification_unittest.cc
+++ b/media/audio/cross_process_notification_unittest.cc
@@ -5,6 +5,7 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/memory/shared_memory.h"
+#include "base/process/kill.h"
 #include "base/stl_util.h"
 #include "base/test/multiprocess_test.h"
 #include "base/threading/platform_thread.h"
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
index 3115523..38253e2 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -6,10 +6,11 @@
 
 #include "base/command_line.h"
 #include "base/environment.h"
+#include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/metrics/histogram.h"
 #include "base/nix/xdg_util.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/stl_util.h"
 #include "media/audio/audio_output_dispatcher.h"
 #include "media/audio/audio_parameters.h"
diff --git a/media/audio/pulse/audio_manager_pulse.cc b/media/audio/pulse/audio_manager_pulse.cc
index 194c920..18effa6 100644
--- a/media/audio/pulse/audio_manager_pulse.cc
+++ b/media/audio/pulse/audio_manager_pulse.cc
@@ -9,7 +9,6 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/nix/xdg_util.h"
-#include "base/process_util.h"
 #include "base/stl_util.h"
 #include "media/audio/audio_parameters.h"
 #include "media/audio/audio_util.h"
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc
index 8ad7876..82dd4d4 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -17,7 +17,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "media/audio/audio_parameters.h"
diff --git a/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java b/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java
index 69a2561..e1b0e09 100644
--- a/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java
+++ b/media/base/android/java/src/org/chromium/media/MediaPlayerBridge.java
@@ -145,10 +145,6 @@
         getLocalPlayer().setOnVideoSizeChangedListener(listener);
     }
 
-    protected void setWakeMode(Context context, int mode) {
-        getLocalPlayer().setWakeMode(context, mode);
-    }
-
     private static class AllowedOperations {
         private final boolean mCanPause;
         private final boolean mCanSeekForward;
diff --git a/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java b/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java
index a612435..3c68589 100644
--- a/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java
+++ b/media/base/android/java/src/org/chromium/media/MediaPlayerListener.java
@@ -133,10 +133,6 @@
         mediaPlayerBridge.setOnPreparedListener(listener);
         mediaPlayerBridge.setOnSeekCompleteListener(listener);
         mediaPlayerBridge.setOnVideoSizeChangedListener(listener);
-        if (PackageManager.PERMISSION_GRANTED ==
-                context.checkCallingOrSelfPermission(permission.WAKE_LOCK)) {
-            mediaPlayerBridge.setWakeMode(context, android.os.PowerManager.FULL_WAKE_LOCK);
-        }
 
         AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
         am.requestAudioFocus(
diff --git a/media/base/android/media_codec_bridge.h b/media/base/android/media_codec_bridge.h
index 14694d6..d28d39d 100644
--- a/media/base/android/media_codec_bridge.h
+++ b/media/base/android/media_codec_bridge.h
@@ -140,7 +140,7 @@
                             const uint8* extra_data, size_t extra_data_size);
 };
 
-class VideoCodecBridge : public MediaCodecBridge {
+class MEDIA_EXPORT VideoCodecBridge : public MediaCodecBridge {
  public:
   // Returns an VideoCodecBridge instance if |codec| is supported, or a NULL
   // pointer otherwise.
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 349ebeb..82d2b5f 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -17,13 +17,14 @@
 #include "media/base/pipeline.h"
 #include "media/base/pipeline_status.h"
 #include "media/base/video_decoder_config.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 
 namespace media {
 
 // Proxies calls to a VideoDecodeAccelerator::Client from the calling thread to
 // the client's thread.
 //
-// TODO(scherkus): VDAClientProxy should hold onto GpuVideoDecoder::Factories
+// TODO(scherkus): VDAClientProxy should hold onto GpuVideoDecoderFactories
 // and take care of some of the work that GpuVideoDecoder does to minimize
 // thread hopping. See following for discussion:
 //
@@ -131,8 +132,6 @@
 // resources.
 enum { kMaxInFlightDecodes = 4 };
 
-GpuVideoDecoder::Factories::~Factories() {}
-
 // Size of shared-memory segments we allocate.  Since we reuse them we let them
 // be on the beefy side.
 static const size_t kSharedMemorySegmentBytes = 100 << 10;
@@ -160,7 +159,7 @@
 
 GpuVideoDecoder::GpuVideoDecoder(
     const scoped_refptr<base::MessageLoopProxy>& message_loop,
-    const scoped_refptr<Factories>& factories)
+    const scoped_refptr<GpuVideoDecoderFactories>& factories)
     : needs_bitstream_conversion_(false),
       gvd_loop_proxy_(message_loop),
       weak_factory_(this),
@@ -547,21 +546,24 @@
                 &natural_size);
   DCHECK(decoder_texture_target_);
 
-  scoped_refptr<VideoFrame> frame(
-      VideoFrame::WrapNativeTexture(
-          new VideoFrame::MailboxHolder(
-              pb.texture_mailbox(),
-              0,  // sync_point
-              BindToCurrentLoop(base::Bind(
-                  &GpuVideoDecoder::ReusePictureBuffer, weak_this_,
-                  picture.picture_buffer_id()))),
-          decoder_texture_target_,
-          pb.size(), visible_rect,
-          natural_size, timestamp,
-          base::Bind(&Factories::ReadPixels, factories_, pb.texture_id(),
-                     decoder_texture_target_,
-                     gfx::Size(visible_rect.width(), visible_rect.height())),
-          base::Closure()));
+  scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture(
+      new VideoFrame::MailboxHolder(
+          pb.texture_mailbox(),
+          0,  // sync_point
+          BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReusePictureBuffer,
+                                       weak_this_,
+                                       picture.picture_buffer_id()))),
+      decoder_texture_target_,
+      pb.size(),
+      visible_rect,
+      natural_size,
+      timestamp,
+      base::Bind(&GpuVideoDecoderFactories::ReadPixels,
+                 factories_,
+                 pb.texture_id(),
+                 decoder_texture_target_,
+                 gfx::Size(visible_rect.width(), visible_rect.height())),
+      base::Closure()));
   CHECK_GT(available_pictures_, 0);
   --available_pictures_;
   bool inserted =
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h
index f7e3f8f..01a8842 100644
--- a/media/filters/gpu_video_decoder.h
+++ b/media/filters/gpu_video_decoder.h
@@ -23,11 +23,10 @@
 class SharedMemory;
 }
 
-class SkBitmap;
-
 namespace media {
 
 class DecoderBuffer;
+class GpuVideoDecoderFactories;
 class VDAClientProxy;
 
 // GPU-accelerated video decoder implementation.  Relies on
@@ -37,48 +36,8 @@
     : public VideoDecoder,
       public VideoDecodeAccelerator::Client {
  public:
-  // Helper interface for specifying factories needed to instantiate a
-  // GpuVideoDecoder.
-  class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> {
-   public:
-    // Caller owns returned pointer.
-    virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
-        VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0;
-
-    // Allocate & delete native textures.
-    virtual uint32 CreateTextures(int32 count, const gfx::Size& size,
-                                  std::vector<uint32>* texture_ids,
-                                  std::vector<gpu::Mailbox>* texture_mailboxes,
-                                  uint32 texture_target) = 0;
-    virtual void DeleteTexture(uint32 texture_id) = 0;
-
-    virtual void WaitSyncPoint(uint32 sync_point) = 0;
-
-    // Read pixels from a native texture and store into |pixels| as RGBA.
-    virtual void ReadPixels(uint32 texture_id, uint32 texture_target,
-                            const gfx::Size& size, const SkBitmap& pixels) = 0;
-
-    // Allocate & return a shared memory segment.  Caller is responsible for
-    // Close()ing the returned pointer.
-    virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
-
-    // Returns the message loop the VideoDecodeAccelerator runs on.
-    virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
-
-    // Abort any outstanding factory operations and error any future
-    // attempts at factory operations
-    virtual void Abort() = 0;
-
-    // Returns true if Abort() has been called.
-    virtual bool IsAborted() = 0;
-
-   protected:
-    friend class base::RefCountedThreadSafe<Factories>;
-    virtual ~Factories();
-  };
-
   GpuVideoDecoder(const scoped_refptr<base::MessageLoopProxy>& message_loop,
-                  const scoped_refptr<Factories>& factories);
+                  const scoped_refptr<GpuVideoDecoderFactories>& factories);
 
   // VideoDecoder implementation.
   virtual void Initialize(const VideoDecoderConfig& config,
@@ -172,7 +131,7 @@
   // through).
   scoped_refptr<base::MessageLoopProxy> vda_loop_proxy_;
 
-  scoped_refptr<Factories> factories_;
+  scoped_refptr<GpuVideoDecoderFactories> factories_;
 
   // Proxies calls from |vda_| to |gvd_loop_proxy_| and used to safely detach
   // during shutdown.
diff --git a/media/filters/gpu_video_decoder_factories.cc b/media/filters/gpu_video_decoder_factories.cc
new file mode 100644
index 0000000..67d24ce
--- /dev/null
+++ b/media/filters/gpu_video_decoder_factories.cc
@@ -0,0 +1,11 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/filters/gpu_video_decoder_factories.h"
+
+namespace media {
+
+GpuVideoDecoderFactories::~GpuVideoDecoderFactories() {}
+
+}  // namespace media
diff --git a/media/filters/gpu_video_decoder_factories.h b/media/filters/gpu_video_decoder_factories.h
new file mode 100644
index 0000000..107e2de
--- /dev/null
+++ b/media/filters/gpu_video_decoder_factories.h
@@ -0,0 +1,67 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_
+#define MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_
+
+#include "base/memory/ref_counted.h"
+#include "media/video/video_decode_accelerator.h"
+
+namespace base {
+class MessageLoopProxy;
+class SharedMemory;
+}
+
+class SkBitmap;
+
+namespace media {
+
+// Helper interface for specifying factories needed to instantiate a hardware
+// video decoder.
+class MEDIA_EXPORT GpuVideoDecoderFactories
+    : public base::RefCountedThreadSafe<GpuVideoDecoderFactories> {
+ public:
+  // Caller owns returned pointer.
+  virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
+      VideoCodecProfile profile,
+      VideoDecodeAccelerator::Client* client) = 0;
+
+  // Allocate & delete native textures.
+  virtual uint32 CreateTextures(int32 count,
+                                const gfx::Size& size,
+                                std::vector<uint32>* texture_ids,
+                                std::vector<gpu::Mailbox>* texture_mailboxes,
+                                uint32 texture_target) = 0;
+  virtual void DeleteTexture(uint32 texture_id) = 0;
+
+  virtual void WaitSyncPoint(uint32 sync_point) = 0;
+
+  // Read pixels from a native texture and store into |pixels| as RGBA.
+  virtual void ReadPixels(uint32 texture_id,
+                          uint32 texture_target,
+                          const gfx::Size& size,
+                          const SkBitmap& pixels) = 0;
+
+  // Allocate & return a shared memory segment.  Caller is responsible for
+  // Close()ing the returned pointer.
+  virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
+
+  // Returns the message loop the VideoDecodeAccelerator runs on.
+  virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
+
+  // Abort any outstanding factory operations and error any future
+  // attempts at factory operations
+  virtual void Abort() = 0;
+
+  // Returns true if Abort() has been called.
+  virtual bool IsAborted() = 0;
+
+ protected:
+  friend class base::RefCountedThreadSafe<GpuVideoDecoderFactories>;
+  virtual ~GpuVideoDecoderFactories();
+};
+
+}  // namespace media
+
+#endif  // MEDIA_FILTERS_GPU_VIDEO_DECODER_FACTORIES_H_
diff --git a/media/filters/mock_gpu_video_decoder_factories.h b/media/filters/mock_gpu_video_decoder_factories.h
index 6a82244..e0ad274 100644
--- a/media/filters/mock_gpu_video_decoder_factories.h
+++ b/media/filters/mock_gpu_video_decoder_factories.h
@@ -6,7 +6,7 @@
 #define MEDIA_FILTERS_MOCK_GPU_VIDEO_DECODER_FACTORIES_H_
 
 #include "base/message_loop/message_loop_proxy.h"
-#include "media/filters/gpu_video_decoder.h"
+#include "media/filters/gpu_video_decoder_factories.h"
 #include "media/video/video_decode_accelerator.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "third_party/skia/include/core/SkBitmap.h"
@@ -20,7 +20,7 @@
 
 namespace media {
 
-class MockGpuVideoDecoderFactories : public GpuVideoDecoder::Factories {
+class MockGpuVideoDecoderFactories : public GpuVideoDecoderFactories {
  public:
   MockGpuVideoDecoderFactories();
   MOCK_METHOD2(CreateVideoDecodeAccelerator,
diff --git a/media/media.gyp b/media/media.gyp
index fb681f9..cb77036 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -350,6 +350,8 @@
         'filters/file_data_source.h',
         'filters/gpu_video_decoder.cc',
         'filters/gpu_video_decoder.h',
+        'filters/gpu_video_decoder_factories.cc',
+        'filters/gpu_video_decoder_factories.h',
         'filters/h264_to_annex_b_bitstream_converter.cc',
         'filters/h264_to_annex_b_bitstream_converter.h',
         'filters/in_memory_url_protocol.cc',
@@ -1219,12 +1221,12 @@
           'cflags': [
             '-mmmx',
           ],
-          'include_dirs': [
-            '..',
-          ],
           'defines': [
             'MEDIA_IMPLEMENTATION',
           ],
+          'include_dirs': [
+            '..',
+          ],
           'conditions': [
             # TODO(jschuh): Get MMX enabled on Win64. crbug.com/179657
             ['OS!="win" or target_arch=="ia32"', {
@@ -1240,12 +1242,12 @@
           'cflags': [
             '-msse',
           ],
-          'include_dirs': [
-            '..',
-          ],
           'defines': [
             'MEDIA_IMPLEMENTATION',
           ],
+          'include_dirs': [
+            '..',
+          ],
           'sources': [
             'base/simd/sinc_resampler_sse.cc',
           ],
@@ -1256,12 +1258,12 @@
           'cflags': [
             '-msse2',
           ],
-          'include_dirs': [
-            '..',
-          ],
           'defines': [
             'MEDIA_IMPLEMENTATION',
           ],
+          'include_dirs': [
+            '..',
+          ],
           'sources': [
             'base/simd/convert_rgb_to_yuv_sse2.cc',
             'base/simd/convert_rgb_to_yuv_ssse3.cc',
@@ -1274,12 +1276,12 @@
           'cflags': [
             '-msse',
           ],
-          'include_dirs': [
-            '..',
-          ],
           'defines': [
             'MEDIA_IMPLEMENTATION',
           ],
+          'include_dirs': [
+            '..',
+          ],
           'sources': [
             'base/simd/vector_math_sse.cc',
           ],
@@ -1517,6 +1519,9 @@
             '../url/url.gyp:url_lib',
             'media_android_jni_headers',
           ],
+          'defines': [
+            'MEDIA_IMPLEMENTATION',
+          ],
           'include_dirs': [
             '<(SHARED_INTERMEDIATE_DIR)/media',
           ],
diff --git a/media/media.target.darwin-arm.mk b/media/media.target.darwin-arm.mk
index f2ab9b2..0651b44 100644
--- a/media/media.target.darwin-arm.mk
+++ b/media/media.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -208,18 +210,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -243,8 +244,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -320,18 +321,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -356,8 +356,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -432,7 +432,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media.target.darwin-mips.mk b/media/media.target.darwin-mips.mk
index ad060a8..c6e7c1c 100644
--- a/media/media.target.darwin-mips.mk
+++ b/media/media.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -207,18 +209,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -242,8 +243,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -318,18 +319,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -354,8 +354,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -426,7 +426,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media.target.darwin-x86.mk b/media/media.target.darwin-x86.mk
index 46e05b4..49dd6b3 100644
--- a/media/media.target.darwin-x86.mk
+++ b/media/media.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -211,18 +213,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -245,8 +246,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -325,18 +326,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -360,8 +360,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -431,7 +431,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media.target.linux-arm.mk b/media/media.target.linux-arm.mk
index f2ab9b2..0651b44 100644
--- a/media/media.target.linux-arm.mk
+++ b/media/media.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -208,18 +210,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -243,8 +244,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -320,18 +321,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -356,8 +356,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -432,7 +432,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media.target.linux-mips.mk b/media/media.target.linux-mips.mk
index ad060a8..c6e7c1c 100644
--- a/media/media.target.linux-mips.mk
+++ b/media/media.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -207,18 +209,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -242,8 +243,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -318,18 +319,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -354,8 +354,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -426,7 +426,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media.target.linux-x86.mk b/media/media.target.linux-x86.mk
index 46e05b4..49dd6b3 100644
--- a/media/media.target.linux-x86.mk
+++ b/media/media.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,media_media_android_jni_headers_gyp)/media_android_jni_headers.stamp \
 	$(call intermediates-dir-for,GYP,media_video_capture_android_jni_headers_gyp)/video_capture_android_jni_headers.stamp
@@ -124,6 +125,7 @@
 	media/filters/decrypting_video_decoder.cc \
 	media/filters/file_data_source.cc \
 	media/filters/gpu_video_decoder.cc \
+	media/filters/gpu_video_decoder_factories.cc \
 	media/filters/h264_to_annex_b_bitstream_converter.cc \
 	media/filters/in_memory_url_protocol.cc \
 	media/filters/opus_audio_decoder.cc \
@@ -211,18 +213,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -245,8 +246,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -325,18 +326,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -360,8 +360,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -431,7 +431,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/media/media_android_jni_headers.target.darwin-arm.mk b/media/media_android_jni_headers.target.darwin-arm.mk
index df396ec..35313e8 100644
--- a/media/media_android_jni_headers.target.darwin-arm.mk
+++ b/media/media_android_jni_headers.target.darwin-arm.mk
@@ -134,10 +134,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_android_jni_headers.target.darwin-mips.mk b/media/media_android_jni_headers.target.darwin-mips.mk
index e739375..78e558a 100644
--- a/media/media_android_jni_headers.target.darwin-mips.mk
+++ b/media/media_android_jni_headers.target.darwin-mips.mk
@@ -133,10 +133,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -210,10 +210,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_android_jni_headers.target.darwin-x86.mk b/media/media_android_jni_headers.target.darwin-x86.mk
index 22611fa..a31e14e 100644
--- a/media/media_android_jni_headers.target.darwin-x86.mk
+++ b/media/media_android_jni_headers.target.darwin-x86.mk
@@ -136,10 +136,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,10 +217,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_android_jni_headers.target.linux-arm.mk b/media/media_android_jni_headers.target.linux-arm.mk
index df396ec..35313e8 100644
--- a/media/media_android_jni_headers.target.linux-arm.mk
+++ b/media/media_android_jni_headers.target.linux-arm.mk
@@ -134,10 +134,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_android_jni_headers.target.linux-mips.mk b/media/media_android_jni_headers.target.linux-mips.mk
index e739375..78e558a 100644
--- a/media/media_android_jni_headers.target.linux-mips.mk
+++ b/media/media_android_jni_headers.target.linux-mips.mk
@@ -133,10 +133,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -210,10 +210,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_android_jni_headers.target.linux-x86.mk b/media/media_android_jni_headers.target.linux-x86.mk
index 22611fa..a31e14e 100644
--- a/media/media_android_jni_headers.target.linux-x86.mk
+++ b/media/media_android_jni_headers.target.linux-x86.mk
@@ -136,10 +136,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,10 +217,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_asm.target.darwin-x86.mk b/media/media_asm.target.darwin-x86.mk
index 2a647a0..381f449 100644
--- a/media/media_asm.target.darwin-x86.mk
+++ b/media/media_asm.target.darwin-x86.mk
@@ -184,10 +184,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -265,10 +265,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_asm.target.linux-x86.mk b/media/media_asm.target.linux-x86.mk
index 2a647a0..381f449 100644
--- a/media/media_asm.target.linux-x86.mk
+++ b/media/media_asm.target.linux-x86.mk
@@ -184,10 +184,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -265,10 +265,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/media_mmx.target.darwin-x86.mk b/media/media_mmx.target.darwin-x86.mk
index f15ce9d..f667983 100644
--- a/media/media_mmx.target.darwin-x86.mk
+++ b/media/media_mmx.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/media_mmx.target.linux-x86.mk b/media/media_mmx.target.linux-x86.mk
index f15ce9d..f667983 100644
--- a/media/media_mmx.target.linux-x86.mk
+++ b/media/media_mmx.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/media_sse.target.darwin-x86.mk b/media/media_sse.target.darwin-x86.mk
index 8e434dc..49b557d 100644
--- a/media/media_sse.target.darwin-x86.mk
+++ b/media/media_sse.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/media_sse.target.linux-x86.mk b/media/media_sse.target.linux-x86.mk
index 8e434dc..49b557d 100644
--- a/media/media_sse.target.linux-x86.mk
+++ b/media/media_sse.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/media_sse2.target.darwin-x86.mk b/media/media_sse2.target.darwin-x86.mk
index 76dfdd8..50ff2eb 100644
--- a/media/media_sse2.target.darwin-x86.mk
+++ b/media/media_sse2.target.darwin-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/media_sse2.target.linux-x86.mk b/media/media_sse2.target.linux-x86.mk
index 76dfdd8..50ff2eb 100644
--- a/media/media_sse2.target.linux-x86.mk
+++ b/media/media_sse2.target.linux-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/player_android.target.darwin-arm.mk b/media/player_android.target.darwin-arm.mk
index dc28c0c..5f55bc3 100644
--- a/media/player_android.target.darwin-arm.mk
+++ b/media/player_android.target.darwin-arm.mk
@@ -79,10 +79,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -167,10 +168,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/player_android.target.darwin-mips.mk b/media/player_android.target.darwin-mips.mk
index 6284619..4fe58d0 100644
--- a/media/player_android.target.darwin-mips.mk
+++ b/media/player_android.target.darwin-mips.mk
@@ -78,10 +78,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +166,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/player_android.target.darwin-x86.mk b/media/player_android.target.darwin-x86.mk
index dc73ef5..19893df 100644
--- a/media/player_android.target.darwin-x86.mk
+++ b/media/player_android.target.darwin-x86.mk
@@ -81,10 +81,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -172,10 +173,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/player_android.target.linux-arm.mk b/media/player_android.target.linux-arm.mk
index dc28c0c..5f55bc3 100644
--- a/media/player_android.target.linux-arm.mk
+++ b/media/player_android.target.linux-arm.mk
@@ -79,10 +79,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -167,10 +168,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/player_android.target.linux-mips.mk b/media/player_android.target.linux-mips.mk
index 6284619..4fe58d0 100644
--- a/media/player_android.target.linux-mips.mk
+++ b/media/player_android.target.linux-mips.mk
@@ -78,10 +78,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +166,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/player_android.target.linux-x86.mk b/media/player_android.target.linux-x86.mk
index dc73ef5..19893df 100644
--- a/media/player_android.target.linux-x86.mk
+++ b/media/player_android.target.linux-x86.mk
@@ -81,10 +81,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -172,10 +173,11 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
+	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/shared_memory_support.target.darwin-arm.mk b/media/shared_memory_support.target.darwin-arm.mk
index 016fc56..c9d96f2 100644
--- a/media/shared_memory_support.target.darwin-arm.mk
+++ b/media/shared_memory_support.target.darwin-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support.target.darwin-mips.mk b/media/shared_memory_support.target.darwin-mips.mk
index 5d5910a..59f75a9 100644
--- a/media/shared_memory_support.target.darwin-mips.mk
+++ b/media/shared_memory_support.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support.target.darwin-x86.mk b/media/shared_memory_support.target.darwin-x86.mk
index afe5eed..97e5fb9 100644
--- a/media/shared_memory_support.target.darwin-x86.mk
+++ b/media/shared_memory_support.target.darwin-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support.target.linux-arm.mk b/media/shared_memory_support.target.linux-arm.mk
index 016fc56..c9d96f2 100644
--- a/media/shared_memory_support.target.linux-arm.mk
+++ b/media/shared_memory_support.target.linux-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support.target.linux-mips.mk b/media/shared_memory_support.target.linux-mips.mk
index 5d5910a..59f75a9 100644
--- a/media/shared_memory_support.target.linux-mips.mk
+++ b/media/shared_memory_support.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support.target.linux-x86.mk b/media/shared_memory_support.target.linux-x86.mk
index afe5eed..97e5fb9 100644
--- a/media/shared_memory_support.target.linux-x86.mk
+++ b/media/shared_memory_support.target.linux-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support_sse.target.darwin-x86.mk b/media/shared_memory_support_sse.target.darwin-x86.mk
index 4f121a5..72b2eff 100644
--- a/media/shared_memory_support_sse.target.darwin-x86.mk
+++ b/media/shared_memory_support_sse.target.darwin-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/shared_memory_support_sse.target.linux-x86.mk b/media/shared_memory_support_sse.target.linux-x86.mk
index 4f121a5..72b2eff 100644
--- a/media/shared_memory_support_sse.target.linux-x86.mk
+++ b/media/shared_memory_support_sse.target.linux-x86.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DMEDIA_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/media/video/encoded_video_source.h b/media/video/encoded_video_source.h
index e2ce201..f0c9a13 100644
--- a/media/video/encoded_video_source.h
+++ b/media/video/encoded_video_source.h
@@ -68,6 +68,9 @@
   // signaling successful change.
   virtual void TrySetBitstreamConfig(
       const RuntimeVideoEncodingParameters& params) = 0;
+
+  // RequestKeyFrame requests a key frame.
+  virtual void RequestKeyFrame() = 0;
 };
 
 }  // namespace media
diff --git a/media/video/video_encode_types.h b/media/video/video_encode_types.h
index 0372019..15effab 100644
--- a/media/video/video_encode_types.h
+++ b/media/video/video_encode_types.h
@@ -15,22 +15,24 @@
 namespace media {
 
 // Data to represent limitations for a particular encoder config.
+// The |max_bitrate| value is in bits per second.
 struct VideoEncodingConfig {
   VideoCodec codec_type;
   std::string codec_name;
   gfx::Size max_resolution;
-  int max_frames_per_second;
-  int max_bitrate;
+  uint32 max_frames_per_second;
+  uint32 max_bitrate;
 };
 
 typedef std::vector<VideoEncodingConfig> VideoEncodingCapabilities;
 
 // Encoding parameters that can be configured during streaming without removing
-// the bitstream first.
+// the bitstream first. The |target_bitrate| and |max_bitrate| values are in
+// bits per second.
 struct RuntimeVideoEncodingParameters {
-  int target_bitrate;
-  int max_bitrate;
-  int frames_per_second;
+  uint32 target_bitrate;
+  uint32 max_bitrate;
+  uint32 frames_per_second;
 };
 
 // Generic video encoding parameters to be configured during initialization
diff --git a/media/video_capture_android_jni_headers.target.darwin-arm.mk b/media/video_capture_android_jni_headers.target.darwin-arm.mk
index 83e004a..643c5ec 100644
--- a/media/video_capture_android_jni_headers.target.darwin-arm.mk
+++ b/media/video_capture_android_jni_headers.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/video_capture_android_jni_headers.target.darwin-mips.mk b/media/video_capture_android_jni_headers.target.darwin-mips.mk
index e8abd67..d02f39e 100644
--- a/media/video_capture_android_jni_headers.target.darwin-mips.mk
+++ b/media/video_capture_android_jni_headers.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/video_capture_android_jni_headers.target.darwin-x86.mk b/media/video_capture_android_jni_headers.target.darwin-x86.mk
index 4f8a557..481ac3e 100644
--- a/media/video_capture_android_jni_headers.target.darwin-x86.mk
+++ b/media/video_capture_android_jni_headers.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/video_capture_android_jni_headers.target.linux-arm.mk b/media/video_capture_android_jni_headers.target.linux-arm.mk
index 83e004a..643c5ec 100644
--- a/media/video_capture_android_jni_headers.target.linux-arm.mk
+++ b/media/video_capture_android_jni_headers.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/video_capture_android_jni_headers.target.linux-mips.mk b/media/video_capture_android_jni_headers.target.linux-mips.mk
index e8abd67..d02f39e 100644
--- a/media/video_capture_android_jni_headers.target.linux-mips.mk
+++ b/media/video_capture_android_jni_headers.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/media/video_capture_android_jni_headers.target.linux-x86.mk b/media/video_capture_android_jni_headers.target.linux-x86.mk
index 4f8a557..481ac3e 100644
--- a/media/video_capture_android_jni_headers.target.linux-x86.mk
+++ b/media/video_capture_android_jni_headers.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index a4ab579..190e5c3 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -61,30 +61,24 @@
 options = None
 
 
-def GetGlibcToolchain(arch):
+def GetGlibcToolchain(host_arch):
   tcdir = os.path.join(NACL_DIR, 'toolchain', '.tars')
-  tcname = 'toolchain_%s_%s.tar.bz2' % (getos.GetPlatform(), arch)
+  tcname = 'toolchain_%s_%s.tar.bz2' % (getos.GetPlatform(), host_arch)
   return os.path.join(tcdir, tcname)
 
 
-def GetNewlibToolchain(arch):
+def GetNewlibToolchain(host_arch):
   tcdir = os.path.join(NACL_DIR, 'toolchain', '.tars')
-  tcname = 'naclsdk_%s_%s.tgz' % (getos.GetPlatform(), arch)
+  tcname = 'naclsdk_%s_%s.tgz' % (getos.GetPlatform(), host_arch)
   return os.path.join(tcdir, tcname)
 
 
-def GetPNaClToolchain(arch):
+def GetPNaClToolchain(host_arch):
   tcdir = os.path.join(NACL_DIR, 'toolchain', '.tars')
-  tcname = 'naclsdk_pnacl_%s_%s.tgz' % (getos.GetPlatform(), arch)
+  tcname = 'naclsdk_pnacl_%s_%s.tgz' % (getos.GetPlatform(), host_arch)
   return os.path.join(tcdir, tcname)
 
 
-def GetArchName(arch, xarch=None):
-  if xarch:
-    return arch + '-' + str(xarch)
-  return arch
-
-
 def GetToolchainNaClInclude(tcname, tcpath, arch):
   if arch == 'x86':
     if tcname == 'pnacl':
@@ -96,17 +90,49 @@
     buildbot_common.ErrorExit('Unknown architecture: %s' % arch)
 
 
-def GetToolchainNaClLib(tcname, tcpath, arch, xarch):
-  if arch == 'x86':
-    if tcname == 'pnacl':
-      return os.path.join(tcpath, 'newlib', 'sdk', 'lib')
-    if str(xarch) == '32':
-      return os.path.join(tcpath, 'x86_64-nacl', 'lib32')
-    if str(xarch) == '64':
-      return os.path.join(tcpath, 'x86_64-nacl', 'lib')
-    if str(xarch) == 'arm':
-      return os.path.join(tcpath, 'arm-nacl', 'lib')
-  buildbot_common.ErrorExit('Unknown architecture: %s' % arch)
+def GetGypGenDir(xarch):
+  if xarch == 'arm':
+    build_dir = GYPBUILD_DIR + '-arm'
+  else:
+    build_dir = GYPBUILD_DIR
+  return os.path.join(OUT_DIR, build_dir, 'Release', 'gen')
+
+
+def GetGypBuiltLib(tcname, xarch=None):
+  if tcname == 'pnacl':
+    tcname = 'pnacl_newlib'
+  if not xarch:
+    xarch = ''
+  return os.path.join(GetGypGenDir(xarch), 'tc_' + tcname, 'lib' + xarch)
+
+
+def GetToolchainNaClLib(tcname, tcpath, xarch):
+  if tcname == 'pnacl':
+    return os.path.join(tcpath, 'newlib', 'sdk', 'lib')
+  if xarch == '32':
+    return os.path.join(tcpath, 'x86_64-nacl', 'lib32')
+  if xarch == '64':
+    return os.path.join(tcpath, 'x86_64-nacl', 'lib')
+  if xarch == 'arm':
+    return os.path.join(tcpath, 'arm-nacl', 'lib')
+
+
+def GetToolchainDirName(tcname, xarch):
+  if xarch != 'arm':
+    xarch = 'x86'
+  return '%s_%s_%s' % (getos.GetPlatform(), xarch, tcname)
+
+
+def GetGypToolchainLib(tcname, xarch):
+  tcpath = os.path.join(GetGypGenDir(xarch), 'sdk', 'toolchain',
+                        GetToolchainDirName(tcname, xarch))
+  return GetToolchainNaClLib(tcname, tcpath, xarch)
+
+
+def GetOutputToolchainLib(pepperdir, tcname, xarch):
+  tcpath = os.path.join(pepperdir, 'toolchain',
+                        GetToolchainDirName(tcname, xarch))
+  return GetToolchainNaClLib(tcname, tcpath, xarch)
 
 
 def GetPNaClNativeLib(tcpath, arch):
@@ -115,26 +141,6 @@
   return os.path.join(tcpath, 'lib-' + arch)
 
 
-def GetSconsArgs(tcpath, outdir, arch, xarch=None):
-  """Return list of scons build arguments to generate user libraries.
-
-  Only used for pnacl builds.
-  """
-  if getos.GetPlatform() == 'win':
-    scons = 'scons.bat'
-  else:
-    scons = './scons'
-  mode = '--mode=opt-host,nacl'
-  arch_name = GetArchName(arch, xarch)
-  plat = 'platform=' + arch_name
-  binarg = 'bindir=' + os.path.join(outdir, 'tools')
-  lib = 'libdir=' + GetToolchainNaClLib('pnacl', tcpath, arch, xarch)
-  args = [scons, mode, plat, binarg, lib, '-j10', 'install_lib', 'bitcode=1']
-
-  print "Building pnacl (%s): %s" % (arch, ' '.join(args))
-  return args
-
-
 def BuildStepDownloadToolchains():
   buildbot_common.BuildStep('Running download_toolchains.py')
   download_script = os.path.join('build', 'download_toolchains.py')
@@ -365,6 +371,17 @@
     'libppapi.a',
     'libppapi.so',
     'libppapi_stub.a',
+  ],
+  'pnacl': [
+    'libminidump_generator.a',
+    'libnacl.a',
+    'libnacl_dyncode.a',
+    'libnacl_exception.a',
+    'libnacl_list_mappings.a',
+    'libnosys.a',
+    'libppapi.a',
+    'libppapi_stub.a',
+    'libpthread.a',
   ]
 }
 
@@ -410,31 +427,23 @@
 
   InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files)
 
-  for tc in set(toolchains) & set(['newlib', 'glibc']):
-    for archname in ('arm', '32', '64'):
-      if tc == 'glibc' and archname == 'arm':
+  for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']):
+    if tc == 'pnacl':
+      xarches = (None,)
+    else:
+      xarches = ('arm', '32', '64')
+
+    for xarch in xarches:
+      if tc == 'glibc' and xarch == 'arm':
         continue
-      tc_dir = 'tc_' + tc
-      lib_dir = 'lib' + archname
-      if archname == 'arm':
-        build_dir = GYPBUILD_DIR + '-arm'
-        tcdir = '%s_arm_%s' % (platform, tc)
-      else:
-        build_dir = GYPBUILD_DIR
-        tcdir = '%s_x86_%s' % (platform, tc)
 
-      ninja_out_dir = os.path.join(OUT_DIR, build_dir, 'Release')
-      src_dir = os.path.join(ninja_out_dir, 'gen', tc_dir, lib_dir)
-      tcpath = os.path.join(pepperdir, 'toolchain', tcdir)
-      dst_dir = GetToolchainNaClLib(tc, tcpath, 'x86', archname)
-
+      src_dir = GetGypBuiltLib(tc, xarch)
+      dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch)
       InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc])
 
-      ninja_tcpath = os.path.join(ninja_out_dir, 'gen', 'sdk', 'toolchain',
-                      tcdir)
-      lib_dir = GetToolchainNaClLib(tc, ninja_tcpath, 'x86', archname)
-      buildbot_common.CopyFile(os.path.join(lib_dir, 'crt1.o'), dst_dir)
-
+      if tc != 'pnacl':
+        src_dir = GetGypToolchainLib(tc, xarch)
+        InstallFiles(src_dir, dst_dir, ['crt1.o'])
 
 
 def GypNinjaBuild_NaCl(rel_out_dir):
@@ -501,16 +510,6 @@
   targets = ['pnacl_irt_shim']
   GypNinjaBuild(target_arch, gyp_py, gyp_file, targets, out_dir, False)
 
-  gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl')
-  gyp_file = os.path.join(NACL_DIR, 'src', 'untrusted', 'minidump_generator',
-                          'minidump_generator.gyp')
-  targets = ['minidump_generator_lib']
-  GypNinjaBuild(target_arch, gyp_py, gyp_file, targets, out_dir, False)
-
-  gyp_file = os.path.join(NACL_DIR, 'src', 'untrusted', 'nacl', 'nacl.gyp')
-  targets = ['nacl_exception_lib']
-  GypNinjaBuild(target_arch, gyp_py, gyp_file, targets, out_dir, False)
-
 
 def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets,
                   out_dir, force_arm_gcc=True):
@@ -582,14 +581,6 @@
                        'arm')
 
   if 'pnacl' in toolchains:
-    # shell=True is needed on windows to enable searching of the PATH:
-    # http://bugs.python.org/issue8557
-    shell = platform == 'win'
-    buildbot_common.Run(
-        GetSconsArgs(pnacldir, pepperdir, 'x86', '32'),
-        cwd=NACL_DIR,
-        shell=shell)
-
     # NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
     for arch in ('ia32', 'arm'):
       # Fill in the latest native pnacl shim library from the chrome build.
@@ -610,25 +601,10 @@
             os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
             GetPNaClNativeLib(pnacldir, nacl_arch))
 
-        # TODO: should these next couple of bitcode libraries really be
-        # installed to the native library directory instead of bitcode
-        # library directory?
-        release_build_dir = os.path.join(OUT_DIR, build_dir, 'Release',
-                                         'gen', 'tc_pnacl_newlib', 'lib')
-        buildbot_common.CopyFile(
-            os.path.join(release_build_dir, 'libminidump_generator.a'),
-            GetPNaClNativeLib(pnacldir, nacl_arch))
-
-        buildbot_common.CopyFile(
-            os.path.join(release_build_dir, 'libnacl_exception.a'),
-            GetPNaClNativeLib(pnacldir, nacl_arch))
-
     InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
                        'newlib')
 
 
-
-
 def MakeDirectoryOrClobber(pepperdir, dirname, clobber):
   dirpath = os.path.join(pepperdir, dirname)
   if clobber:
diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list
index 11133cb..50710c5 100644
--- a/native_client_sdk/src/build_tools/sdk_files.list
+++ b/native_client_sdk/src/build_tools/sdk_files.list
@@ -1181,6 +1181,15 @@
 toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/include/pnacl.h
 toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/include/pthread.h
 toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/include/semaphore.h
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libminidump_generator.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libnacl.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libnacl_dyncode.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libnacl_exception.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libnacl_list_mappings.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libnosys.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libppapi.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libppapi_stub.a
+toolchain/${PLATFORM}_x86_pnacl/newlib/sdk/lib/libpthread.a
 tools/common.mk
 tools/compiler-wrapper.py
 tools/create_html.py
diff --git a/native_client_sdk/src/examples/common.js b/native_client_sdk/src/examples/common.js
index 1562924..0d355bf 100644
--- a/native_client_sdk/src/examples/common.js
+++ b/native_client_sdk/src/examples/common.js
@@ -14,6 +14,52 @@
 // code.
 var common = (function() {
 
+  function isHostToolchain(tool) {
+    return tool == 'win' || tool == 'linux' || tool == 'mac';
+  }
+
+  /**
+   * Return the mime type for NaCl plugin.
+   *
+   * @param {string} tool The name of the toolchain, e.g. "glibc", "newlib" etc.
+   * @param {bool} isRelease True if this is a release build.
+   * @return {string} The mime-type for the kind of NaCl plugin matching
+   * the given toolchain.
+   */
+  function mimeTypeForTool(tool, isRelease) {
+    // For NaCl modules use application/x-nacl.
+    var mimetype = 'application/x-nacl';
+    if (isHostToolchain(tool)) {
+      // For non-NaCl PPAPI plugins use the x-ppapi-debug/release
+      // mime type.
+      if (isRelease)
+        mimetype = 'application/x-ppapi-release';
+      else
+        mimetype = 'application/x-ppapi-debug';
+    } else if (tool == 'pnacl') {
+      mimetype = 'application/x-pnacl';
+    }
+    return mimetype;
+  }
+
+  /**
+   * Check if the browser supports NaCl plugins.
+   *
+   * @param {string} tool The name of the toolchain, e.g. "glibc", "newlib" etc.
+   * @return {bool} True if the browser supports the type of NaCl plugin
+   * produced by the given toolchain.
+   */
+  function browserSupportsNaCl(tool) {
+    // Assume host toolchains always work with the given browser.
+    // The below mime-type checking might not work with
+    // --register-pepper-plugins.
+    if (isHostToolchain(tool)) {
+      return true;
+    }
+    var mimetype = mimeTypeForTool(tool);
+    return navigator.mimeTypes[mimetype] !== undefined;
+  }
+
   /**
    * Create the Native Client <embed> element as a child of the DOM element
    * named "listener".
@@ -41,19 +87,7 @@
       }
     }
 
-    // For NaCL modules use application/x-nacl.
-    var mimetype = 'application/x-nacl';
-    var isHost = tool == 'win' || tool == 'linux' || tool == 'mac';
-    if (isHost) {
-      // For non-nacl PPAPI plugins use the x-ppapi-debug/release
-      // mime type.
-      if (path.toLowerCase().indexOf('release') != -1)
-        mimetype = 'application/x-ppapi-release';
-      else
-        mimetype = 'application/x-ppapi-debug';
-    } else if (tool == 'pnacl') {
-      mimetype = 'application/x-pnacl';
-    }
+    var mimetype = mimeTypeForTool(tool);
     moduleEl.setAttribute('type', mimetype);
 
     // The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
@@ -65,6 +99,7 @@
     listenerDiv.appendChild(moduleEl);
 
     // Host plugins don't send a moduleDidLoad message. We'll fake it here.
+    var isHost = isHostToolchain(tool);
     if (isHost) {
       window.setTimeout(function() {
         var evt = document.createEvent('Event');
@@ -258,7 +293,11 @@
     // status message indicating that the module is still loading.  Otherwise,
     // do not change the status message.
     updateStatus('Page loaded.');
-    if (common.naclModule == null) {
+    var isRelease = path.toLowerCase().indexOf('release') != -1;
+    if (!browserSupportsNaCl(tool, isRelease)) {
+      updateStatus(
+          'Browser does not support NaCl (' + tool + '), or NaCl is disabled');
+    } else if (common.naclModule == null) {
       updateStatus('Creating embed: ' + tool);
 
       // We use a non-zero sized embed to give Chrome space to place the bad
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_win.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_win.cc
index d991785..77b8b60 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_win.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_win.cc
@@ -15,6 +15,8 @@
 #include <sys/stat.h>
 #include "nacl_io/kernel_intercept.h"
 
+#include <windows.h>
+
 namespace {
 
 template <typename SrcStat, typename DstStat>
@@ -317,7 +319,7 @@
   ularge.HighPart = ft.dwHighDateTime;
 
   // Truncate to usec resolution.
-  return usecs = ularge.QuadPart / 10;
+  return ularge.QuadPart / 10;
 }
 
 // Do nothing for Windows, we replace the library at link time.
diff --git a/native_client_sdk/src/libraries/nacl_io/library.dsc b/native_client_sdk/src/libraries/nacl_io/library.dsc
index 6d65846..217a93d 100644
--- a/native_client_sdk/src/libraries/nacl_io/library.dsc
+++ b/native_client_sdk/src/libraries/nacl_io/library.dsc
@@ -1,5 +1,5 @@
 {
-  'TOOLS': ['newlib', 'glibc', 'pnacl'],
+  'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
   'SEARCH': [
     '.',
     'pepper'
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index 2647e4c..4c2f6d0 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -59,6 +59,9 @@
 //   }
 EVENT_TYPE(HOST_RESOLVER_IMPL_REQUEST)
 
+// This event is logged when IPv6 support is determined via IPv6 connect probe.
+EVENT_TYPE(HOST_RESOLVER_IMPL_IPV6_SUPPORTED)
+
 // This event is logged when a request is handled by a cache entry.
 EVENT_TYPE(HOST_RESOLVER_IMPL_CACHE_HIT)
 
@@ -569,6 +572,13 @@
 //   }
 EVENT_TYPE(UDP_CONNECT)
 
+// The local address of the UDP socket, retrieved via getsockname.
+// The following parameters are attached:
+//   {
+//     "address": <Local address bound to the socket>,
+//   }
+EVENT_TYPE(UDP_LOCAL_ADDRESS)
+
 // The specified number of bytes were transferred on the socket.
 // The following parameters are attached:
 //   {
@@ -1815,7 +1825,8 @@
 //                     the filename specified in the final URL>,
 //     "danger_type": <NOT_DANGEROUS, DANGEROUS_FILE, DANGEROUS_URL,
 //                     DANGEROUS_CONTENT, MAYBE_DANGEROUS_CONTENT,
-//                     UNCOMMON_CONTENT, USER_VALIDATED, DANGEROUS_HOST>,
+//                     UNCOMMON_CONTENT, USER_VALIDATED, DANGEROUS_HOST,
+//                     POTENTIALLY_UNWANTED>,
 //     "start_offset": <Where to start writing (defaults to 0)>,
 //     "has_user_gesture": <Whether or not we think the user initiated
 //                          the download>
diff --git a/net/cert/cert_database_mac.cc b/net/cert/cert_database_mac.cc
index e05af2e..7670196 100644
--- a/net/cert/cert_database_mac.cc
+++ b/net/cert/cert_database_mac.cc
@@ -10,7 +10,7 @@
 #include "base/mac/mac_logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/observer_list_threadsafe.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/single_thread_task_runner.h"
 #include "base/synchronization/lock.h"
 #include "crypto/mac_security_services_lock.h"
diff --git a/net/cert_verify_result_android_java.target.darwin-arm.mk b/net/cert_verify_result_android_java.target.darwin-arm.mk
index 73eb948..4b643a4 100644
--- a/net/cert_verify_result_android_java.target.darwin-arm.mk
+++ b/net/cert_verify_result_android_java.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/cert_verify_result_android_java.target.darwin-mips.mk b/net/cert_verify_result_android_java.target.darwin-mips.mk
index 94c18fc..cb05e74 100644
--- a/net/cert_verify_result_android_java.target.darwin-mips.mk
+++ b/net/cert_verify_result_android_java.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/cert_verify_result_android_java.target.darwin-x86.mk b/net/cert_verify_result_android_java.target.darwin-x86.mk
index b7af8ae..5e8ccee 100644
--- a/net/cert_verify_result_android_java.target.darwin-x86.mk
+++ b/net/cert_verify_result_android_java.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/cert_verify_result_android_java.target.linux-arm.mk b/net/cert_verify_result_android_java.target.linux-arm.mk
index 73eb948..4b643a4 100644
--- a/net/cert_verify_result_android_java.target.linux-arm.mk
+++ b/net/cert_verify_result_android_java.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/cert_verify_result_android_java.target.linux-mips.mk b/net/cert_verify_result_android_java.target.linux-mips.mk
index 94c18fc..cb05e74 100644
--- a/net/cert_verify_result_android_java.target.linux-mips.mk
+++ b/net/cert_verify_result_android_java.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/cert_verify_result_android_java.target.linux-x86.mk b/net/cert_verify_result_android_java.target.linux-x86.mk
index b7af8ae..5e8ccee 100644
--- a/net/cert_verify_result_android_java.target.linux-x86.mk
+++ b/net/cert_verify_result_android_java.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.darwin-arm.mk b/net/certificate_mime_types_java.target.darwin-arm.mk
index d9f4d13..40bad54 100644
--- a/net/certificate_mime_types_java.target.darwin-arm.mk
+++ b/net/certificate_mime_types_java.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.darwin-mips.mk b/net/certificate_mime_types_java.target.darwin-mips.mk
index 98d9bfa..b502614 100644
--- a/net/certificate_mime_types_java.target.darwin-mips.mk
+++ b/net/certificate_mime_types_java.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.darwin-x86.mk b/net/certificate_mime_types_java.target.darwin-x86.mk
index 6c0f897..453dbcc 100644
--- a/net/certificate_mime_types_java.target.darwin-x86.mk
+++ b/net/certificate_mime_types_java.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.linux-arm.mk b/net/certificate_mime_types_java.target.linux-arm.mk
index d9f4d13..40bad54 100644
--- a/net/certificate_mime_types_java.target.linux-arm.mk
+++ b/net/certificate_mime_types_java.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.linux-mips.mk b/net/certificate_mime_types_java.target.linux-mips.mk
index 98d9bfa..b502614 100644
--- a/net/certificate_mime_types_java.target.linux-mips.mk
+++ b/net/certificate_mime_types_java.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/certificate_mime_types_java.target.linux-x86.mk b/net/certificate_mime_types_java.target.linux-x86.mk
index 6c0f897..453dbcc 100644
--- a/net/certificate_mime_types_java.target.linux-x86.mk
+++ b/net/certificate_mime_types_java.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc
index 47cc825..9c3c5a6 100644
--- a/net/disk_cache/stress_cache.cc
+++ b/net/disk_cache/stress_cache.cc
@@ -25,7 +25,9 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index c86f963..92694af 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -171,13 +171,14 @@
 }
 
 // Attempts to connect a UDP socket to |dest|:80.
-bool IsGloballyReachable(const IPAddressNumber& dest) {
+bool IsGloballyReachable(const IPAddressNumber& dest,
+                         const BoundNetLog& net_log) {
   scoped_ptr<DatagramClientSocket> socket(
       ClientSocketFactory::GetDefaultFactory()->CreateDatagramClientSocket(
           DatagramSocket::DEFAULT_BIND,
           RandIntCallback(),
-          NULL,
-          NetLog::Source()));
+          net_log.net_log(),
+          net_log.source()));
   int rv = socket->Connect(IPEndPoint(dest, 80));
   if (rv != OK)
     return false;
@@ -1750,7 +1751,7 @@
 
   // Build a key that identifies the request in the cache and in the
   // outstanding jobs map.
-  Key key = GetEffectiveKeyForRequest(info);
+  Key key = GetEffectiveKeyForRequest(info, request_net_log);
 
   int rv = ResolveHelper(key, info, addresses, request_net_log);
   if (rv != ERR_DNS_CACHE_MISS) {
@@ -1838,7 +1839,7 @@
   // Update the net log and notify registered observers.
   LogStartRequest(source_net_log, request_net_log, info);
 
-  Key key = GetEffectiveKeyForRequest(info);
+  Key key = GetEffectiveKeyForRequest(info, request_net_log);
 
   int rv = ResolveHelper(key, info, addresses, request_net_log);
   LogFinishRequest(source_net_log, request_net_log, info, rv);
@@ -2014,7 +2015,7 @@
 }
 
 HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest(
-    const RequestInfo& info) const {
+    const RequestInfo& info, const BoundNetLog& net_log) const {
   HostResolverFlags effective_flags =
       info.host_resolver_flags() | additional_resolver_flags_;
   AddressFamily effective_address_family = info.address_family();
@@ -2028,7 +2029,9 @@
             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
       IPAddressNumber address(kIPv6Address,
                               kIPv6Address + arraysize(kIPv6Address));
-      bool rv6 = IsGloballyReachable(address);
+      bool rv6 = IsGloballyReachable(address, net_log);
+      if (rv6)
+        net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_IPV6_SUPPORTED);
 
       UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
                           base::TimeTicks::Now() - start_time);
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 468d80e..928d07a 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -192,7 +192,8 @@
   // Returns the (hostname, address_family) key to use for |info|, choosing an
   // "effective" address family by inheriting the resolver's default address
   // family when the request leaves it unspecified.
-  Key GetEffectiveKeyForRequest(const RequestInfo& info) const;
+  Key GetEffectiveKeyForRequest(const RequestInfo& info,
+                                const BoundNetLog& net_log) const;
 
   // Records the result in cache if cache is present.
   void CacheResult(const Key& key,
diff --git a/net/http_server.target.darwin-arm.mk b/net/http_server.target.darwin-arm.mk
index 20c5562..d6d2413 100644
--- a/net/http_server.target.darwin-arm.mk
+++ b/net/http_server.target.darwin-arm.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -72,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -155,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/net/http_server.target.darwin-mips.mk b/net/http_server.target.darwin-mips.mk
index ff057cc..e295bb8 100644
--- a/net/http_server.target.darwin-mips.mk
+++ b/net/http_server.target.darwin-mips.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -71,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -153,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/net/http_server.target.darwin-x86.mk b/net/http_server.target.darwin-x86.mk
index bc01a7b..51152a0 100644
--- a/net/http_server.target.darwin-x86.mk
+++ b/net/http_server.target.darwin-x86.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -74,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/http_server.target.linux-arm.mk b/net/http_server.target.linux-arm.mk
index 20c5562..d6d2413 100644
--- a/net/http_server.target.linux-arm.mk
+++ b/net/http_server.target.linux-arm.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -72,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -155,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/net/http_server.target.linux-mips.mk b/net/http_server.target.linux-mips.mk
index ff057cc..e295bb8 100644
--- a/net/http_server.target.linux-mips.mk
+++ b/net/http_server.target.linux-mips.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -71,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -153,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/net/http_server.target.linux-x86.mk b/net/http_server.target.linux-x86.mk
index bc01a7b..51152a0 100644
--- a/net/http_server.target.linux-x86.mk
+++ b/net/http_server.target.linux-x86.mk
@@ -26,6 +26,7 @@
 	net/server/http_connection.cc \
 	net/server/http_server.cc \
 	net/server/http_server_request_info.cc \
+	net/server/http_server_response_info.cc \
 	net/server/web_socket.cc
 
 
@@ -74,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net.gyp b/net/net.gyp
index 615e5be..68e4116 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -1475,8 +1475,9 @@
         '../testing/gtest.gyp:gtest',
         '../third_party/zlib/zlib.gyp:zlib',
         '../url/url.gyp:url_lib',
+        'http_server',
         'net',
-        'net_test_support',
+        'net_test_support'
       ],
       'sources': [
         'android/keystore_unittest.cc',
@@ -1747,6 +1748,7 @@
         'quic/quic_time_test.cc',
         'quic/quic_utils_test.cc',
         'quic/reliable_quic_stream_test.cc',
+        'server/http_server_response_info_unittest.cc',
         'socket/buffered_write_stream_socket_unittest.cc',
         'socket/client_socket_pool_base_unittest.cc',
         'socket/deterministic_socket_data_unittest.cc',
@@ -1843,6 +1845,36 @@
         'websockets/websocket_throttle_unittest.cc',
       ],
       'conditions': [
+        ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
+          'dependencies': [
+            'quic_library'
+          ],
+          'sources': [
+            'tools/flip_server/simple_buffer.cc',
+            'tools/flip_server/simple_buffer.h',
+            'tools/quic/end_to_end_test.cc',
+            'tools/quic/quic_client_session_test.cc',
+            'tools/quic/quic_dispatcher_test.cc',
+            'tools/quic/quic_epoll_clock_test.cc',
+            'tools/quic/quic_epoll_connection_helper_test.cc',
+            'tools/quic/quic_in_memory_cache_test.cc',
+            'tools/quic/quic_reliable_client_stream_test.cc',
+            'tools/quic/quic_reliable_server_stream_test.cc',
+            'tools/quic/quic_spdy_server_stream_test.cc',
+            'tools/quic/test_tools/http_message_test_utils.cc',
+            'tools/quic/test_tools/http_message_test_utils.h',
+            'tools/quic/test_tools/mock_epoll_server.cc',
+            'tools/quic/test_tools/mock_epoll_server.h',
+            'tools/quic/test_tools/quic_client_peer.cc',
+            'tools/quic/test_tools/quic_client_peer.h',
+            'tools/quic/test_tools/quic_epoll_connection_helper_peer.cc',
+            'tools/quic/test_tools/quic_epoll_connection_helper_peer.h',
+            'tools/quic/test_tools/quic_test_client.cc',
+            'tools/quic/test_tools/quic_test_client.h',
+            'tools/quic/test_tools/quic_test_utils.cc',
+            'tools/quic/test_tools/quic_test_utils.h',
+          ],
+        }],
         ['chromeos==1', {
           'sources!': [
             'base/network_change_notifier_linux_unittest.cc',
@@ -2298,6 +2330,8 @@
         'server/http_server.h',
         'server/http_server_request_info.cc',
         'server/http_server_request_info.h',
+        'server/http_server_response_info.cc',
+        'server/http_server_response_info.h',
         'server/web_socket.cc',
         'server/web_socket.h',
       ],
@@ -2686,87 +2720,6 @@
           'sources': [
             'tools/quic/quic_server_bin.cc',
           ],
-        },
-        {
-          'target_name': 'quic_unittests',
-          'type': '<(gtest_target_type)',
-          'dependencies': [
-            '../base/base.gyp:test_support_base',
-            '../crypto/crypto.gyp:crypto',
-            '../testing/gmock.gyp:gmock',
-            '../testing/gtest.gyp:gtest',
-            'net',
-            'net_test_support',
-            'quic_library',
-          ],
-          'sources': [
-            'quic/test_tools/quic_session_peer.cc',
-            'quic/test_tools/quic_session_peer.h',
-            'quic/test_tools/crypto_test_utils.cc',
-            'quic/test_tools/crypto_test_utils.h',
-            'quic/test_tools/crypto_test_utils_chromium.cc',
-            'quic/test_tools/crypto_test_utils_nss.cc',
-            'quic/test_tools/crypto_test_utils_openssl.cc',
-            'quic/test_tools/mock_clock.cc',
-            'quic/test_tools/mock_clock.h',
-            'quic/test_tools/mock_random.cc',
-            'quic/test_tools/mock_random.h',
-            'quic/test_tools/simple_quic_framer.cc',
-            'quic/test_tools/simple_quic_framer.h',
-            'quic/test_tools/quic_connection_peer.cc',
-            'quic/test_tools/quic_connection_peer.h',
-            'quic/test_tools/quic_framer_peer.cc',
-            'quic/test_tools/quic_framer_peer.h',
-            'quic/test_tools/quic_session_peer.cc',
-            'quic/test_tools/quic_session_peer.h',
-            'quic/test_tools/quic_test_utils.cc',
-            'quic/test_tools/quic_test_utils.h',
-            'quic/test_tools/reliable_quic_stream_peer.cc',
-            'quic/test_tools/reliable_quic_stream_peer.h',
-            'tools/flip_server/simple_buffer.cc',
-            'tools/flip_server/simple_buffer.h',
-            'tools/quic/end_to_end_test.cc',
-            'tools/quic/quic_client_session_test.cc',
-            'tools/quic/quic_dispatcher_test.cc',
-            'tools/quic/quic_epoll_clock_test.cc',
-            'tools/quic/quic_epoll_connection_helper_test.cc',
-            'tools/quic/quic_in_memory_cache_test.cc',
-            'tools/quic/quic_reliable_client_stream_test.cc',
-            'tools/quic/quic_reliable_server_stream_test.cc',
-            'tools/quic/quic_spdy_server_stream_test.cc',
-            'tools/quic/test_tools/http_message_test_utils.cc',
-            'tools/quic/test_tools/http_message_test_utils.h',
-            'tools/quic/test_tools/mock_epoll_server.cc',
-            'tools/quic/test_tools/mock_epoll_server.h',
-            'tools/quic/test_tools/quic_client_peer.cc',
-            'tools/quic/test_tools/quic_client_peer.h',
-            'tools/quic/test_tools/quic_epoll_connection_helper_peer.cc',
-            'tools/quic/test_tools/quic_epoll_connection_helper_peer.h',
-            'tools/quic/test_tools/quic_test_client.cc',
-            'tools/quic/test_tools/quic_test_client.h',
-            'tools/quic/test_tools/quic_test_utils.cc',
-            'tools/quic/test_tools/quic_test_utils.h',
-            'tools/quic/test_tools/run_all_unittests.cc',
-          ],
-	  'conditions': [
-	    [ 'use_glib == 1', {
-		'dependencies': [
-		  '../build/linux/system.gyp:ssl',
-		],
-	      },
-	    ],
-	    [ 'use_openssl==1', {
-		# When building for OpenSSL, we need to exclude NSS specific tests.
-		'sources!': [
-                  'quic/test_tools/crypto_test_utils_nss.cc',
-		],
-	      }, {  # else !use_openssl: remove the unneeded files
-		'sources!': [
-                  'quic/test_tools/crypto_test_utils_openssl.cc',
-		],
-	      },
-	    ],
-	  ],
         }
       ]
     }],
diff --git a/net/net.target.darwin-arm.mk b/net/net.target.darwin-arm.mk
index 4374651..80b79cc 100644
--- a/net/net.target.darwin-arm.mk
+++ b/net/net.target.darwin-arm.mk
@@ -487,10 +487,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
@@ -580,10 +580,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
diff --git a/net/net.target.darwin-mips.mk b/net/net.target.darwin-mips.mk
index d434cd4..aa3545c 100644
--- a/net/net.target.darwin-mips.mk
+++ b/net/net.target.darwin-mips.mk
@@ -486,10 +486,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
@@ -578,10 +578,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
diff --git a/net/net.target.darwin-x86.mk b/net/net.target.darwin-x86.mk
index 8b49e08..f297af5 100644
--- a/net/net.target.darwin-x86.mk
+++ b/net/net.target.darwin-x86.mk
@@ -489,10 +489,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DENABLE_BUILT_IN_DNS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -584,10 +584,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DENABLE_BUILT_IN_DNS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/net/net.target.linux-arm.mk b/net/net.target.linux-arm.mk
index 4374651..80b79cc 100644
--- a/net/net.target.linux-arm.mk
+++ b/net/net.target.linux-arm.mk
@@ -487,10 +487,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
@@ -580,10 +580,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
diff --git a/net/net.target.linux-mips.mk b/net/net.target.linux-mips.mk
index d434cd4..aa3545c 100644
--- a/net/net.target.linux-mips.mk
+++ b/net/net.target.linux-mips.mk
@@ -486,10 +486,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
@@ -578,10 +578,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DENABLE_BUILT_IN_DNS' \
diff --git a/net/net.target.linux-x86.mk b/net/net.target.linux-x86.mk
index 8b49e08..f297af5 100644
--- a/net/net.target.linux-x86.mk
+++ b/net/net.target.linux-x86.mk
@@ -489,10 +489,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DENABLE_BUILT_IN_DNS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -584,10 +584,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNET_IMPLEMENTATION' \
 	'-DENABLE_BUILT_IN_DNS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/net/net_errors_java.target.darwin-arm.mk b/net/net_errors_java.target.darwin-arm.mk
index 90650ea..cc81446 100644
--- a/net/net_errors_java.target.darwin-arm.mk
+++ b/net/net_errors_java.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_errors_java.target.darwin-mips.mk b/net/net_errors_java.target.darwin-mips.mk
index 14b2f79..c4ebaf2 100644
--- a/net/net_errors_java.target.darwin-mips.mk
+++ b/net/net_errors_java.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_errors_java.target.darwin-x86.mk b/net/net_errors_java.target.darwin-x86.mk
index 5f165a3..f2dba55 100644
--- a/net/net_errors_java.target.darwin-x86.mk
+++ b/net/net_errors_java.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_errors_java.target.linux-arm.mk b/net/net_errors_java.target.linux-arm.mk
index 90650ea..cc81446 100644
--- a/net/net_errors_java.target.linux-arm.mk
+++ b/net/net_errors_java.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_errors_java.target.linux-mips.mk b/net/net_errors_java.target.linux-mips.mk
index 14b2f79..c4ebaf2 100644
--- a/net/net_errors_java.target.linux-mips.mk
+++ b/net/net_errors_java.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_errors_java.target.linux-x86.mk b/net/net_errors_java.target.linux-x86.mk
index 5f165a3..f2dba55 100644
--- a/net/net_errors_java.target.linux-x86.mk
+++ b/net/net_errors_java.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.darwin-arm.mk b/net/net_jni_headers.target.darwin-arm.mk
index 48fcf7a..2b35f3b 100644
--- a/net/net_jni_headers.target.darwin-arm.mk
+++ b/net/net_jni_headers.target.darwin-arm.mk
@@ -134,10 +134,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.darwin-mips.mk b/net/net_jni_headers.target.darwin-mips.mk
index c1fe2a9..b77cfb9 100644
--- a/net/net_jni_headers.target.darwin-mips.mk
+++ b/net/net_jni_headers.target.darwin-mips.mk
@@ -133,10 +133,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -210,10 +210,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.darwin-x86.mk b/net/net_jni_headers.target.darwin-x86.mk
index 7d90317..b19acef 100644
--- a/net/net_jni_headers.target.darwin-x86.mk
+++ b/net/net_jni_headers.target.darwin-x86.mk
@@ -136,10 +136,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,10 +217,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.linux-arm.mk b/net/net_jni_headers.target.linux-arm.mk
index 48fcf7a..2b35f3b 100644
--- a/net/net_jni_headers.target.linux-arm.mk
+++ b/net/net_jni_headers.target.linux-arm.mk
@@ -134,10 +134,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -212,10 +212,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.linux-mips.mk b/net/net_jni_headers.target.linux-mips.mk
index c1fe2a9..b77cfb9 100644
--- a/net/net_jni_headers.target.linux-mips.mk
+++ b/net/net_jni_headers.target.linux-mips.mk
@@ -133,10 +133,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -210,10 +210,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/net_jni_headers.target.linux-x86.mk b/net/net_jni_headers.target.linux-x86.mk
index 7d90317..b19acef 100644
--- a/net/net_jni_headers.target.linux-x86.mk
+++ b/net/net_jni_headers.target.linux-x86.mk
@@ -136,10 +136,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -217,10 +217,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.darwin-arm.mk b/net/private_key_types_java.target.darwin-arm.mk
index 155a612..ca225d9 100644
--- a/net/private_key_types_java.target.darwin-arm.mk
+++ b/net/private_key_types_java.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.darwin-mips.mk b/net/private_key_types_java.target.darwin-mips.mk
index a72d279..ca724fd 100644
--- a/net/private_key_types_java.target.darwin-mips.mk
+++ b/net/private_key_types_java.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.darwin-x86.mk b/net/private_key_types_java.target.darwin-x86.mk
index 5c4991f..4b062e9 100644
--- a/net/private_key_types_java.target.darwin-x86.mk
+++ b/net/private_key_types_java.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.linux-arm.mk b/net/private_key_types_java.target.linux-arm.mk
index 155a612..ca225d9 100644
--- a/net/private_key_types_java.target.linux-arm.mk
+++ b/net/private_key_types_java.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.linux-mips.mk b/net/private_key_types_java.target.linux-mips.mk
index a72d279..ca724fd 100644
--- a/net/private_key_types_java.target.linux-mips.mk
+++ b/net/private_key_types_java.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/private_key_types_java.target.linux-x86.mk b/net/private_key_types_java.target.linux-x86.mk
index 5c4991f..4b062e9 100644
--- a/net/private_key_types_java.target.linux-x86.mk
+++ b/net/private_key_types_java.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/net/server/http_connection.cc b/net/server/http_connection.cc
index 66541fa..d964cb0 100644
--- a/net/server/http_connection.cc
+++ b/net/server/http_connection.cc
@@ -4,9 +4,8 @@
 
 #include "net/server/http_connection.h"
 
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
 #include "net/server/http_server.h"
+#include "net/server/http_server_response_info.h"
 #include "net/server/web_socket.h"
 #include "net/socket/stream_listen_socket.h"
 
@@ -26,22 +25,8 @@
   socket_->Send(bytes, len);
 }
 
-void HttpConnection::Send(HttpStatusCode status_code,
-                          const std::string& data,
-                          const std::string& content_type) {
-  if (!socket_.get())
-    return;
-
-  socket_->Send(base::StringPrintf(
-      "HTTP/1.1 %d %s\r\n"
-      "Content-Type:%s\r\n"
-      "Content-Length:%d\r\n"
-      "\r\n",
-      status_code,
-      GetHttpReasonPhrase(status_code),
-      content_type.c_str(),
-      static_cast<int>(data.length())));
-  socket_->Send(data);
+void HttpConnection::Send(const HttpServerResponseInfo& response) {
+  Send(response.Serialize());
 }
 
 HttpConnection::HttpConnection(HttpServer* server, StreamListenSocket* sock)
diff --git a/net/server/http_connection.h b/net/server/http_connection.h
index 488d528..b0e3766 100644
--- a/net/server/http_connection.h
+++ b/net/server/http_connection.h
@@ -15,6 +15,7 @@
 namespace net {
 
 class HttpServer;
+class HttpServerResponseInfo;
 class StreamListenSocket;
 class WebSocket;
 
@@ -24,9 +25,7 @@
 
   void Send(const std::string& data);
   void Send(const char* bytes, int len);
-  void Send(HttpStatusCode status_code,
-            const std::string& data,
-            const std::string& content_type);
+  void Send(const HttpServerResponseInfo& response);
 
   void Shift(int num_bytes);
 
diff --git a/net/server/http_server.cc b/net/server/http_server.cc
index b780739..3d54c40 100644
--- a/net/server/http_server.cc
+++ b/net/server/http_server.cc
@@ -13,6 +13,7 @@
 #include "build/build_config.h"
 #include "net/server/http_connection.h"
 #include "net/server/http_server_request_info.h"
+#include "net/server/http_server_response_info.h"
 #include "net/server/web_socket.h"
 #include "net/socket/tcp_listen_socket.h"
 
@@ -45,14 +46,21 @@
   connection->web_socket_->Send(data);
 }
 
+void HttpServer::SendResponse(int connection_id,
+                              const HttpServerResponseInfo& response) {
+  HttpConnection* connection = FindConnection(connection_id);
+  if (connection == NULL)
+    return;
+  connection->Send(response);
+}
+
 void HttpServer::Send(int connection_id,
                       HttpStatusCode status_code,
                       const std::string& data,
                       const std::string& content_type) {
-  HttpConnection* connection = FindConnection(connection_id);
-  if (connection == NULL)
-    return;
-  connection->Send(status_code, data, content_type);
+  HttpServerResponseInfo response(status_code);
+  response.SetBody(data, content_type);
+  SendResponse(connection_id, response);
 }
 
 void HttpServer::Send200(int connection_id,
@@ -62,11 +70,11 @@
 }
 
 void HttpServer::Send404(int connection_id) {
-  Send(connection_id, HTTP_NOT_FOUND, std::string(), "text/html");
+  SendResponse(connection_id, HttpServerResponseInfo::CreateFor404());
 }
 
 void HttpServer::Send500(int connection_id, const std::string& message) {
-  Send(connection_id, HTTP_INTERNAL_SERVER_ERROR, message, "text/html");
+  SendResponse(connection_id, HttpServerResponseInfo::CreateFor500(message));
 }
 
 void HttpServer::Close(int connection_id) {
diff --git a/net/server/http_server.h b/net/server/http_server.h
index b5ba037..f434575 100644
--- a/net/server/http_server.h
+++ b/net/server/http_server.h
@@ -17,6 +17,7 @@
 
 class HttpConnection;
 class HttpServerRequestInfo;
+class HttpServerResponseInfo;
 class IPEndPoint;
 class WebSocket;
 
@@ -46,6 +47,7 @@
   void AcceptWebSocket(int connection_id,
                        const HttpServerRequestInfo& request);
   void SendOverWebSocket(int connection_id, const std::string& data);
+  void SendResponse(int connection_id, const HttpServerResponseInfo& response);
   void Send(int connection_id,
             HttpStatusCode status_code,
             const std::string& data,
diff --git a/net/server/http_server_response_info.cc b/net/server/http_server_response_info.cc
new file mode 100644
index 0000000..e4c6043
--- /dev/null
+++ b/net/server/http_server_response_info.cc
@@ -0,0 +1,67 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/server/http_server_response_info.h"
+
+#include "base/format_macros.h"
+#include "base/strings/stringprintf.h"
+#include "net/http/http_request_headers.h"
+
+namespace net {
+
+HttpServerResponseInfo::HttpServerResponseInfo() : status_code_(HTTP_OK) {}
+
+HttpServerResponseInfo::HttpServerResponseInfo(HttpStatusCode status_code)
+    : status_code_(status_code) {}
+
+HttpServerResponseInfo::~HttpServerResponseInfo() {}
+
+// static
+HttpServerResponseInfo HttpServerResponseInfo::CreateFor404() {
+  HttpServerResponseInfo response(HTTP_NOT_FOUND);
+  response.SetBody(std::string(), "text/html");
+  return response;
+}
+
+// static
+HttpServerResponseInfo HttpServerResponseInfo::CreateFor500(
+    const std::string& body) {
+  HttpServerResponseInfo response(HTTP_INTERNAL_SERVER_ERROR);
+  response.SetBody(body, "text/html");
+  return response;
+}
+
+void HttpServerResponseInfo::AddHeader(const std::string& name,
+                                       const std::string& value) {
+  headers_.push_back(std::make_pair(name, value));
+}
+
+void HttpServerResponseInfo::SetBody(const std::string& body,
+                                     const std::string& content_type) {
+  DCHECK(body_.empty());
+  body_ = body;
+  AddHeader(HttpRequestHeaders::kContentLength,
+            base::StringPrintf("%" PRIuS, body.length()));
+  AddHeader(HttpRequestHeaders::kContentType, content_type);
+}
+
+std::string HttpServerResponseInfo::Serialize() const {
+  std::string response = base::StringPrintf(
+      "HTTP/1.1 %d %s\r\n", status_code_, GetHttpReasonPhrase(status_code_));
+  Headers::const_iterator header;
+  for (header = headers_.begin(); header != headers_.end(); ++header)
+    response += header->first + ":" + header->second + "\r\n";
+
+  return response + "\r\n" + body_;
+}
+
+HttpStatusCode HttpServerResponseInfo::status_code() const {
+  return status_code_;
+}
+
+const std::string& HttpServerResponseInfo::body() const {
+  return body_;
+}
+
+}  // namespace net
diff --git a/net/server/http_server_response_info.h b/net/server/http_server_response_info.h
new file mode 100644
index 0000000..d6cedaa
--- /dev/null
+++ b/net/server/http_server_response_info.h
@@ -0,0 +1,46 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
+#define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
+
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "net/http/http_status_code.h"
+
+namespace net {
+
+class HttpServerResponseInfo {
+ public:
+  // Creates a 200 OK HttpServerResponseInfo.
+  HttpServerResponseInfo();
+  explicit HttpServerResponseInfo(HttpStatusCode status_code);
+  ~HttpServerResponseInfo();
+
+  static HttpServerResponseInfo CreateFor404();
+  static HttpServerResponseInfo CreateFor500(const std::string& body);
+
+  void AddHeader(const std::string& name, const std::string& value);
+
+  // This also adds an appropriate Content-Length header.
+  void SetBody(const std::string& body, const std::string& content_type);
+
+  std::string Serialize() const;
+
+  HttpStatusCode status_code() const;
+  const std::string& body() const;
+
+ private:
+  typedef std::vector<std::pair<std::string, std::string> > Headers;
+
+  HttpStatusCode status_code_;
+  Headers headers_;
+  std::string body_;
+};
+
+}  // namespace net
+
+#endif  // NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
diff --git a/net/server/http_server_response_info_unittest.cc b/net/server/http_server_response_info_unittest.cc
new file mode 100644
index 0000000..f7b8e25
--- /dev/null
+++ b/net/server/http_server_response_info_unittest.cc
@@ -0,0 +1,51 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/http/http_status_code.h"
+#include "net/server/http_server_response_info.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+TEST(HttpServerResponseInfoTest, StatusLine) {
+  HttpServerResponseInfo response;
+  ASSERT_EQ(HTTP_OK, response.status_code());
+  ASSERT_EQ("HTTP/1.1 200 OK\r\n\r\n", response.Serialize());
+}
+
+TEST(HttpServerResponseInfoTest, Headers) {
+  HttpServerResponseInfo response;
+  response.AddHeader("A", "1");
+  response.AddHeader("A", "2");
+  ASSERT_EQ("HTTP/1.1 200 OK\r\nA:1\r\nA:2\r\n\r\n", response.Serialize());
+}
+
+TEST(HttpServerResponseInfoTest, Body) {
+  HttpServerResponseInfo response;
+  ASSERT_EQ(std::string(), response.body());
+  response.SetBody("body", "type");
+  ASSERT_EQ("body", response.body());
+  ASSERT_EQ(
+      "HTTP/1.1 200 OK\r\nContent-Length:4\r\nContent-Type:type\r\n\r\nbody",
+      response.Serialize());
+}
+
+TEST(HttpServerResponseInfoTest, CreateFor404) {
+  HttpServerResponseInfo response = HttpServerResponseInfo::CreateFor404();
+  ASSERT_EQ(
+      "HTTP/1.1 404 Not Found\r\n"
+      "Content-Length:0\r\nContent-Type:text/html\r\n\r\n",
+      response.Serialize());
+}
+
+TEST(HttpServerResponseInfoTest, CreateFor500) {
+  HttpServerResponseInfo response =
+      HttpServerResponseInfo::CreateFor500("mess");
+  ASSERT_EQ(
+      "HTTP/1.1 500 Internal Server Error\r\n"
+      "Content-Length:4\r\nContent-Type:text/html\r\n\r\nmess",
+      response.Serialize());
+}
+
+}  // namespace net
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
index df5b0ae..7461085 100644
--- a/net/server/web_socket.cc
+++ b/net/server/web_socket.cc
@@ -16,6 +16,7 @@
 #include "base/sys_byteorder.h"
 #include "net/server/http_connection.h"
 #include "net/server/http_server_request_info.h"
+#include "net/server/http_server_response_info.h"
 
 namespace net {
 
@@ -115,18 +116,16 @@
     std::string key2 = request.GetHeaderValue("Sec-WebSocket-Key2");
 
     if (key1.empty()) {
-      connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
-                       "Invalid request format. "
-                           "Sec-WebSocket-Key1 is empty or isn't specified.",
-                       "text/html");
+      connection->Send(HttpServerResponseInfo::CreateFor500(
+          "Invalid request format. Sec-WebSocket-Key1 is empty or isn't "
+          "specified."));
       return;
     }
 
     if (key2.empty()) {
-      connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
-                       "Invalid request format. "
-                           "Sec-WebSocket-Key2 is empty or isn't specified.",
-                       "text/html");
+      connection->Send(HttpServerResponseInfo::CreateFor500(
+          "Invalid request format. Sec-WebSocket-Key2 is empty or isn't "
+          "specified."));
       return;
     }
 
@@ -179,10 +178,9 @@
 
     std::string key = request.GetHeaderValue("Sec-WebSocket-Key");
     if (key.empty()) {
-      connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
-                       "Invalid request format. "
-                           "Sec-WebSocket-Key is empty or isn't specified.",
-                       "text/html");
+      connection->Send(HttpServerResponseInfo::CreateFor500(
+          "Invalid request format. Sec-WebSocket-Key is empty or isn't "
+          "specified."));
       return NULL;
     }
     return new WebSocketHybi17(connection, request, pos);
diff --git a/net/test/python_utils_unittest.cc b/net/test/python_utils_unittest.cc
index 55d6ead..04f11ec 100644
--- a/net/test/python_utils_unittest.cc
+++ b/net/test/python_utils_unittest.cc
@@ -8,7 +8,7 @@
 #include "base/environment.h"
 #include "base/files/file_path.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "net/test/python_utils.h"
diff --git a/net/test/spawned_test_server/local_test_server.cc b/net/test/spawned_test_server/local_test_server.cc
index 1531708..bf1b059 100644
--- a/net/test/spawned_test_server/local_test_server.cc
+++ b/net/test/spawned_test_server/local_test_server.cc
@@ -8,7 +8,7 @@
 #include "base/json/json_reader.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
 #include "net/base/host_port_pair.h"
diff --git a/net/test/spawned_test_server/local_test_server.h b/net/test/spawned_test_server/local_test_server.h
index 8f79b8f..cfd2eb3 100644
--- a/net/test/spawned_test_server/local_test_server.h
+++ b/net/test/spawned_test_server/local_test_server.h
@@ -8,7 +8,7 @@
 #include <string>
 
 #include "base/file_util.h"
-#include "base/process.h"
+#include "base/process/process_handle.h"
 #include "net/test/spawned_test_server/base_test_server.h"
 
 #if defined(OS_WIN)
diff --git a/net/test/spawned_test_server/local_test_server_posix.cc b/net/test/spawned_test_server/local_test_server_posix.cc
index ac98c3c..10c2d0f 100644
--- a/net/test/spawned_test_server/local_test_server_posix.cc
+++ b/net/test/spawned_test_server/local_test_server_posix.cc
@@ -11,7 +11,9 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_iterator.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/test/test_timeouts.h"
diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc
index 2db8334..fd26483 100644
--- a/net/test/spawned_test_server/local_test_server_win.cc
+++ b/net/test/spawned_test_server/local_test_server_win.cc
@@ -13,7 +13,7 @@
 #include "base/files/file_path.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc
index 6ebac5f..700e822 100644
--- a/net/tools/crash_cache/crash_cache.cc
+++ b/net/tools/crash_cache/crash_cache.cc
@@ -15,7 +15,9 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/net/tools/dump_cache/dump_cache.cc b/net/tools/dump_cache/dump_cache.cc
index c5aed52..dd423b7 100644
--- a/net/tools/dump_cache/dump_cache.cc
+++ b/net/tools/dump_cache/dump_cache.cc
@@ -10,7 +10,6 @@
 
 #include "base/at_exit.h"
 #include "base/command_line.h"
-#include "base/process_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
@@ -19,6 +18,7 @@
 #include "net/tools/dump_cache/simple_cache_dumper.h"
 
 #if defined(OS_WIN)
+#include "base/process/launch.h"
 #include "base/win/scoped_handle.h"
 #include "net/tools/dump_cache/upgrade_win.h"
 #endif
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index bb8c49e..23e9b56 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -220,7 +220,9 @@
   EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
 }
 
-TEST_F(EndToEndTest, SimpleRequestResponsev6) {
+// TODO(rch): figure out how to detect missing v6 supprt (like on the linux
+// try bots) and selectively disable this test.
+TEST_F(EndToEndTest, DISABLED_SimpleRequestResponsev6) {
   // TODO(rtenneti): Delete this when NSS is supported.
   if (!Aes128Gcm12Encrypter::IsSupported()) {
     LOG(INFO) << "AES GCM not supported. Test skipped.";
@@ -484,7 +486,8 @@
   EXPECT_EQ(QUIC_PACKET_FOR_NONEXISTENT_STREAM, client_->connection_error());
 }
 
-TEST_F(EndToEndTest, MultipleTermination) {
+// TODO(rch): this test seems to cause net_unittests timeouts :|
+TEST_F(EndToEndTest, DISABLED_MultipleTermination) {
   // TODO(rtenneti): Delete this when NSS is supported.
   if (!Aes128Gcm12Encrypter::IsSupported()) {
     LOG(INFO) << "AES GCM not supported. Test skipped.";
@@ -512,12 +515,24 @@
   // Override this to test the server handling buggy clients.
   ReliableQuicStreamPeer::SetWriteSideClosed(
       false, client_->GetOrCreateStream());
+
+#if !defined(WIN32) && defined(GTEST_HAS_DEATH_TEST)
+#if !defined(DCHECK_ALWAYS_ON)
   EXPECT_DEBUG_DEATH({
-    client_->SendData("eep", true);
-    client_->WaitForResponse();
-    EXPECT_EQ(QUIC_MULTIPLE_TERMINATION_OFFSETS, client_->stream_error());
-  },
-  "Check failed: !fin_buffered_");
+      client_->SendData("eep", true);
+      client_->WaitForResponse();
+      EXPECT_EQ(QUIC_MULTIPLE_TERMINATION_OFFSETS, client_->stream_error());
+    },
+    "Check failed: !fin_buffered_");
+#else
+  EXPECT_DEATH({
+      client_->SendData("eep", true);
+      client_->WaitForResponse();
+      EXPECT_EQ(QUIC_MULTIPLE_TERMINATION_OFFSETS, client_->stream_error());
+    },
+    "Check failed: !fin_buffered_");
+#endif
+#endif
 }
 
 TEST_F(EndToEndTest, Timeout) {
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 24a70d7..bb248c2 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -24,9 +24,9 @@
 
 const char kServerHostname[] = "www.example.com";
 
-class QuicClientSessionTest : public ::testing::Test {
+class ToolsQuicClientSessionTest : public ::testing::Test {
  protected:
-  QuicClientSessionTest()
+  ToolsQuicClientSessionTest()
       : guid_(1),
         connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)) {
     crypto_config_.SetDefaults();
@@ -48,7 +48,7 @@
   QuicCryptoClientConfig crypto_config_;
 };
 
-TEST_F(QuicClientSessionTest, CryptoConnect) {
+TEST_F(ToolsQuicClientSessionTest, CryptoConnect) {
   if (!Aes128Gcm12Encrypter::IsSupported()) {
     LOG(INFO) << "AES GCM not supported. Test skipped.";
     return;
@@ -56,7 +56,7 @@
   CompleteCryptoHandshake();
 }
 
-TEST_F(QuicClientSessionTest, DISABLED_MaxNumConnections) {
+TEST_F(ToolsQuicClientSessionTest, DISABLED_MaxNumConnections) {
   if (!Aes128Gcm12Encrypter::IsSupported()) {
     LOG(INFO) << "AES GCM not supported. Test skipped.";
     return;
@@ -76,7 +76,7 @@
   EXPECT_TRUE(stream);
 }
 
-TEST_F(QuicClientSessionTest, GoAwayReceived) {
+TEST_F(ToolsQuicClientSessionTest, GoAwayReceived) {
   if (!Aes128Gcm12Encrypter::IsSupported()) {
     LOG(INFO) << "AES GCM not supported. Test skipped.";
     return;
diff --git a/net/tools/quic/quic_epoll_connection_helper_test.cc b/net/tools/quic/quic_epoll_connection_helper_test.cc
index bfef189..519e2e8 100644
--- a/net/tools/quic/quic_epoll_connection_helper_test.cc
+++ b/net/tools/quic/quic_epoll_connection_helper_test.cc
@@ -73,9 +73,9 @@
   using QuicConnection::SendOrQueuePacket;
 };
 
-class QuicConnectionHelperTest : public ::testing::Test {
+class QuicEpollConnectionHelperTest : public ::testing::Test {
  protected:
-  QuicConnectionHelperTest()
+  QuicEpollConnectionHelperTest()
       : guid_(42),
         framer_(kQuicVersion1, QuicTime::Zero(), false),
         send_algorithm_(new testing::StrictMock<MockSendAlgorithm>),
@@ -118,7 +118,7 @@
   QuicStreamFrame frame1_;
 };
 
-TEST_F(QuicConnectionHelperTest, DISABLED_TestRetransmission) {
+TEST_F(QuicEpollConnectionHelperTest, DISABLED_TestRetransmission) {
   //FLAGS_fake_packet_loss_percentage = 100;
   const int64 kDefaultRetransmissionTimeMs = 500;
 
@@ -139,7 +139,7 @@
   EXPECT_EQ(2u, helper_->header()->packet_sequence_number);
 }
 
-TEST_F(QuicConnectionHelperTest, InitialTimeout) {
+TEST_F(QuicEpollConnectionHelperTest, InitialTimeout) {
   EXPECT_TRUE(connection_.connected());
 
   EXPECT_CALL(*send_algorithm_, SentPacket(_, 1, _, NOT_RETRANSMISSION));
@@ -149,7 +149,7 @@
   EXPECT_EQ(kDefaultInitialTimeoutSecs * 1000000, epoll_server_.NowInUsec());
 }
 
-TEST_F(QuicConnectionHelperTest, TimeoutAfterSend) {
+TEST_F(QuicEpollConnectionHelperTest, TimeoutAfterSend) {
   EXPECT_TRUE(connection_.connected());
   EXPECT_EQ(0, epoll_server_.NowInUsec());
 
@@ -176,7 +176,7 @@
   EXPECT_FALSE(connection_.connected());
 }
 
-TEST_F(QuicConnectionHelperTest, SendSchedulerDelayThenSend) {
+TEST_F(QuicEpollConnectionHelperTest, SendSchedulerDelayThenSend) {
   // Test that if we send a packet with a delay, it ends up queued.
   QuicPacket* packet = ConstructDataPacket(1, 0);
   EXPECT_CALL(
diff --git a/net/tools/quic/quic_in_memory_cache.cc b/net/tools/quic/quic_in_memory_cache.cc
index bc277c5..b840d79 100644
--- a/net/tools/quic/quic_in_memory_cache.cc
+++ b/net/tools/quic/quic_in_memory_cache.cc
@@ -131,6 +131,12 @@
 
   FilePath file = file_list.Next();
   while (!file.empty()) {
+    // Need to skip files in .svn directories
+    if (file.value().find("/.svn/") != std::string::npos) {
+      file = file_list.Next();
+      continue;
+    }
+
     BalsaHeaders request_headers, response_headers;
 
     string file_contents;
diff --git a/net/tools/quic/quic_socket_utils.cc b/net/tools/quic/quic_socket_utils.cc
index 329217a..e46b849 100644
--- a/net/tools/quic/quic_socket_utils.cc
+++ b/net/tools/quic/quic_socket_utils.cc
@@ -89,6 +89,7 @@
   hdr.msg_namelen = sizeof(sockaddr_storage);
   hdr.msg_iov = &iov;
   hdr.msg_iovlen = 1;
+  hdr.msg_flags = 0;
 
   struct cmsghdr *cmsg = (struct cmsghdr *) cbuf;
   cmsg->cmsg_len = arraysize(cbuf);
@@ -143,6 +144,7 @@
   hdr.msg_namelen = sizeof(raw_address);
   hdr.msg_iov = &iov;
   hdr.msg_iovlen = 1;
+  hdr.msg_flags  = 0;
 
   const int kSpaceForIp = CMSG_SPACE(sizeof(in6_pktinfo));
   char cbuf[kSpaceForIp];
diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc
index ec678ff..9d5337c 100644
--- a/net/tools/tld_cleanup/tld_cleanup.cc
+++ b/net/tools/tld_cleanup/tld_cleanup.cc
@@ -31,7 +31,7 @@
 #include "base/i18n/icu_util.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "net/tools/tld_cleanup/tld_cleanup_util.h"
 
 int main(int argc, const char* argv[]) {
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index 7785446..90c7da6 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -123,6 +123,8 @@
     if (!address->FromSockAddr(storage.addr, storage.addr_len))
       return ERR_FAILED;
     local_address_.reset(address.release());
+    net_log_.AddEvent(NetLog::TYPE_UDP_LOCAL_ADDRESS,
+                      CreateNetLogUDPConnectCallback(local_address_.get()));
   }
 
   *address = *local_address_;
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index 13fbe6c..1f0c337 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -240,6 +240,8 @@
     if (!address->FromSockAddr(storage.addr, storage.addr_len))
       return ERR_ADDRESS_INVALID;
     local_address_.reset(address.release());
+    net_log_.AddEvent(NetLog::TYPE_UDP_LOCAL_ADDRESS,
+                      CreateNetLogUDPConnectCallback(local_address_.get()));
   }
 
   *address = *local_address_;
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index 7d9000b..796b913 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -15,7 +15,6 @@
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 37e9cbb..d1b0cb4 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -20,7 +20,6 @@
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece.h"
 #include "base/strings/string_split.h"
diff --git a/ppapi/api/private/ppb_instance_private.idl b/ppapi/api/private/ppb_instance_private.idl
index 25fe5a2..2ba9df3 100644
--- a/ppapi/api/private/ppb_instance_private.idl
+++ b/ppapi/api/private/ppb_instance_private.idl
@@ -16,6 +16,23 @@
 };
 
 /**
+ * The <code>PP_ExternalPluginResult </code> enum contains result codes from
+ * launching an external plugin.
+ */
+[assert_size(4)]
+enum PP_ExternalPluginResult  {
+  /** Successful external plugin call */
+  PP_EXTERNAL_PLUGIN_OK = 0,
+  /** Unspecified external plugin error */
+  PP_EXTERNAL_PLUGIN_FAILED = 1,
+  /** Error creating the module */
+  PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2,
+  /** Error creating and initializing the instance */
+  PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3
+};
+
+
+/**
  * The PPB_Instance_Private interface contains functions available only to
  * trusted plugin instances.
  *
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl
index c420e74..9e4e898 100644
--- a/ppapi/api/private/ppb_nacl_private.idl
+++ b/ppapi/api/private/ppb_nacl_private.idl
@@ -8,23 +8,9 @@
 
 #inline c
 #include "ppapi/c/private/pp_file_handle.h"
+#include "ppapi/c/private/ppb_instance_private.h"
 #endinl
 
-/**
- * The <code>PP_NaClResult</code> enum contains NaCl result codes.
- */
-[assert_size(4)]
-enum PP_NaClResult {
-  /** Successful NaCl call */
-  PP_NACL_OK = 0,
-  /** Unspecified NaCl error */
-  PP_NACL_FAILED = 1,
-  /** Error creating the module */
-  PP_NACL_ERROR_MODULE = 2,
-  /** Error creating and initializing the instance */
-  PP_NACL_ERROR_INSTANCE = 3
-};
-
 /** NaCl-specific errors that should be reported to the user */
 enum PP_NaClError {
   /**
@@ -36,9 +22,9 @@
 
 /* PPB_NaCl_Private */
 interface PPB_NaCl_Private {
-  /* Launches NaCl's sel_ldr process.  Returns PP_NACL_OK on success and
-   * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure.
-   * The |enable_ppapi_dev| parameter controls whether GetInterface
+  /* Launches NaCl's sel_ldr process.  Returns PP_EXTERNAL_PLUGIN_OK on success
+   * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on
+   * failure. The |enable_ppapi_dev| parameter controls whether GetInterface
    * returns 'Dev' interfaces to the NaCl plugin.  The |uses_ppapi| flag
    * indicates that the nexe run by sel_ldr will use the PPAPI APIs.
    * This implies that LaunchSelLdr is run from the main thread.  If a nexe
@@ -50,24 +36,25 @@
    * The |enable_exception_handling| flag indicates whether or not the nexe
    * will be able to use hardware exception handling.
    */
-  PP_NaClResult LaunchSelLdr([in] PP_Instance instance,
-                             [in] str_t alleged_url,
-                             [in] PP_Bool uses_irt,
-                             [in] PP_Bool uses_ppapi,
-                             [in] PP_Bool enable_ppapi_dev,
-                             [in] PP_Bool enable_dyncode_syscalls,
-                             [in] PP_Bool enable_exception_handling,
-                             [out] mem_t imc_handle,
-                             [out] PP_Var error_message);
+  PP_ExternalPluginResult LaunchSelLdr([in] PP_Instance instance,
+                                       [in] str_t alleged_url,
+                                       [in] PP_Bool uses_irt,
+                                       [in] PP_Bool uses_ppapi,
+                                       [in] PP_Bool enable_ppapi_dev,
+                                       [in] PP_Bool enable_dyncode_syscalls,
+                                       [in] PP_Bool enable_exception_handling,
+                                       [out] mem_t imc_handle,
+                                       [out] PP_Var error_message);
 
   /* This function starts the IPC proxy so the nexe can communicate with the
-   * browser. Returns PP_NACL_OK on success, otherwise a result code indicating
-   * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with
-   * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be
-   * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be
-   * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC.
+   * browser. Returns PP_EXTERNAL_PLUGIN_OK on success, otherwise a result code
+   * indicating the failure. PP_EXTERNAL_PLUGIN_FAILED is returned if
+   * LaunchSelLdr wasn't called with the instance.
+   * PP_EXTERNAL_PLUGIN_ERROR_MODULE is returned if the module can't be
+   * initialized. PP_EXTERNAL_PLUGIN_ERROR_INSTANCE is returned if the instance
+   * can't be initialized.
    */
-  PP_NaClResult StartPpapiProxy(PP_Instance instance);
+  PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance);
 
   /* On POSIX systems, this function returns the file descriptor of
    * /dev/urandom.  On non-POSIX systems, this function returns 0.
@@ -146,8 +133,8 @@
   PP_Bool IsPnaclEnabled();
 
   /* Display a UI message to the user. */
-  PP_NaClResult ReportNaClError([in] PP_Instance instance,
-                                [in] PP_NaClError message_id);
+  PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance,
+                                          [in] PP_NaClError message_id);
 
   /* Opens a NaCl executable file in the application's extension directory
    * corresponding to the file URL and returns a file descriptor, or an invalid
diff --git a/ppapi/c/private/ppb_instance_private.h b/ppapi/c/private/ppb_instance_private.h
index 561374d..886613e 100644
--- a/ppapi/c/private/ppb_instance_private.h
+++ b/ppapi/c/private/ppb_instance_private.h
@@ -3,7 +3,7 @@
  * found in the LICENSE file.
  */
 
-/* From private/ppb_instance_private.idl modified Mon Oct  8 10:50:04 2012. */
+/* From private/ppb_instance_private.idl modified Tue Jul 23 13:19:04 2013. */
 
 #ifndef PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_
 #define PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_
@@ -26,6 +26,29 @@
 
 
 /**
+ * @addtogroup Enums
+ * @{
+ */
+/**
+ * The <code>PP_ExternalPluginResult </code> enum contains result codes from
+ * launching an external plugin.
+ */
+typedef enum {
+  /** Successful external plugin call */
+  PP_EXTERNAL_PLUGIN_OK = 0,
+  /** Unspecified external plugin error */
+  PP_EXTERNAL_PLUGIN_FAILED = 1,
+  /** Error creating the module */
+  PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2,
+  /** Error creating and initializing the instance */
+  PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3
+} PP_ExternalPluginResult;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ExternalPluginResult, 4);
+/**
+ * @}
+ */
+
+/**
  * @addtogroup Interfaces
  * @{
  */
diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h
index 9648831..bab26c5 100644
--- a/ppapi/c/private/ppb_nacl_private.h
+++ b/ppapi/c/private/ppb_nacl_private.h
@@ -3,7 +3,7 @@
  * found in the LICENSE file.
  */
 
-/* From private/ppb_nacl_private.idl modified Mon Jul 15 09:19:33 2013. */
+/* From private/ppb_nacl_private.idl modified Tue Jul 23 13:16:52 2013. */
 
 #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
 #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
@@ -14,6 +14,7 @@
 #include "ppapi/c/pp_macros.h"
 #include "ppapi/c/pp_stdint.h"
 #include "ppapi/c/pp_var.h"
+#include "ppapi/c/private/ppb_instance_private.h"
 
 #define PPB_NACL_PRIVATE_INTERFACE_1_0 "PPB_NaCl_Private;1.0"
 #define PPB_NACL_PRIVATE_INTERFACE PPB_NACL_PRIVATE_INTERFACE_1_0
@@ -25,26 +26,12 @@
 
 
 #include "ppapi/c/private/pp_file_handle.h"
+#include "ppapi/c/private/ppb_instance_private.h"
 
 /**
  * @addtogroup Enums
  * @{
  */
-/**
- * The <code>PP_NaClResult</code> enum contains NaCl result codes.
- */
-typedef enum {
-  /** Successful NaCl call */
-  PP_NACL_OK = 0,
-  /** Unspecified NaCl error */
-  PP_NACL_FAILED = 1,
-  /** Error creating the module */
-  PP_NACL_ERROR_MODULE = 2,
-  /** Error creating and initializing the instance */
-  PP_NACL_ERROR_INSTANCE = 3
-} PP_NaClResult;
-PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NaClResult, 4);
-
 /** NaCl-specific errors that should be reported to the user */
 typedef enum {
   /**
@@ -77,15 +64,15 @@
    * The |enable_exception_handling| flag indicates whether or not the nexe
    * will be able to use hardware exception handling.
    */
-  PP_NaClResult (*LaunchSelLdr)(PP_Instance instance,
-                                const char* alleged_url,
-                                PP_Bool uses_irt,
-                                PP_Bool uses_ppapi,
-                                PP_Bool enable_ppapi_dev,
-                                PP_Bool enable_dyncode_syscalls,
-                                PP_Bool enable_exception_handling,
-                                void* imc_handle,
-                                struct PP_Var* error_message);
+  PP_ExternalPluginResult (*LaunchSelLdr)(PP_Instance instance,
+                                          const char* alleged_url,
+                                          PP_Bool uses_irt,
+                                          PP_Bool uses_ppapi,
+                                          PP_Bool enable_ppapi_dev,
+                                          PP_Bool enable_dyncode_syscalls,
+                                          PP_Bool enable_exception_handling,
+                                          void* imc_handle,
+                                          struct PP_Var* error_message);
   /* This function starts the IPC proxy so the nexe can communicate with the
    * browser. Returns PP_NACL_OK on success, otherwise a result code indicating
    * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with
@@ -93,7 +80,7 @@
    * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be
    * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC.
    */
-  PP_NaClResult (*StartPpapiProxy)(PP_Instance instance);
+  PP_ExternalPluginResult (*StartPpapiProxy)(PP_Instance instance);
   /* On POSIX systems, this function returns the file descriptor of
    * /dev/urandom.  On non-POSIX systems, this function returns 0.
    */
@@ -162,8 +149,8 @@
    */
   PP_Bool (*IsPnaclEnabled)(void);
   /* Display a UI message to the user. */
-  PP_NaClResult (*ReportNaClError)(PP_Instance instance,
-                                   PP_NaClError message_id);
+  PP_ExternalPluginResult (*ReportNaClError)(PP_Instance instance,
+                                             PP_NaClError message_id);
   /* Opens a NaCl executable file in the application's extension directory
    * corresponding to the file URL and returns a file descriptor, or an invalid
    * handle on failure. |metadata| is left unchanged on failure.
diff --git a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
index 33e4f77..4fd620d 100644
--- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
+++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h
@@ -14,9 +14,9 @@
 
 #include "native_client/src/shared/imc/nacl_imc_c.h"
 #include "ppapi/c/pp_instance.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
+#include "ppapi/c/private/ppb_instance_private.h"
 
-typedef PP_NaClResult (*LaunchNaClProcessFunc)(
+typedef PP_ExternalPluginResult (*LaunchNaClProcessFunc)(
     PP_Instance instance,
     const char* alleged_url,
     PP_Bool uses_irt,
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 09a0724..3c54c26 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -482,8 +482,9 @@
                           "could not initialize module.");
     return false;
   }
-  PP_NaClResult ipc_result = nacl_interface_->StartPpapiProxy(pp_instance());
-  if (ipc_result == PP_NACL_OK) {
+  PP_ExternalPluginResult ipc_result =
+      nacl_interface_->StartPpapiProxy(pp_instance());
+  if (ipc_result == PP_EXTERNAL_PLUGIN_OK) {
     // Log the amound of time that has passed between the trusted plugin being
     // initialized and the untrusted plugin being initialized.  This is
     // (roughly) the cost of using NaCl, in terms of startup time.
@@ -491,13 +492,13 @@
         "NaCl.Perf.StartupTime.NaClOverhead",
         static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_)
             / NACL_MICROS_PER_MILLI);
-  } else if (ipc_result == PP_NACL_ERROR_MODULE) {
+  } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_MODULE) {
     NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: "
-            "Got PP_NACL_ERROR_MODULE\n");
+            "Got PP_EXTERNAL_PLUGIN_ERROR_MODULE\n");
     error_info->SetReport(ERROR_START_PROXY_MODULE,
                           "could not initialize module.");
     return false;
-  } else if (ipc_result == PP_NACL_ERROR_INSTANCE) {
+  } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_INSTANCE) {
     error_info->SetReport(ERROR_START_PROXY_INSTANCE,
                           "could not create instance.");
     return false;
diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
index bd68de5..2714eac 100644
--- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
+++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
@@ -38,7 +38,7 @@
                           PP_FromBool(enable_dyncode_syscalls),
                           PP_FromBool(enable_exception_handling),
                           &channel_,
-                          &var_error_message) != PP_NACL_OK) {
+                          &var_error_message) != PP_EXTERNAL_PLUGIN_OK) {
     pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message);
     if (var_error_message_cpp.is_string()) {
       *error_message = var_error_message_cpp.AsString();
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index ec358bf..d543664 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -2743,12 +2743,12 @@
 
 /* Begin wrapper methods for PPB_NaCl_Private_1_0 */
 
-static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message) {
+static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message) {
   const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
   return iface->LaunchSelLdr(instance, alleged_url, uses_irt, uses_ppapi, enable_ppapi_dev, enable_dyncode_syscalls, enable_exception_handling, imc_handle, error_message);
 }
 
-static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy(PP_Instance instance) {
+static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy(PP_Instance instance) {
   const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
   return iface->StartPpapiProxy(instance);
 }
@@ -2798,7 +2798,7 @@
   return iface->IsPnaclEnabled();
 }
 
-static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) {
+static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) {
   const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
   return iface->ReportNaClError(instance, message_id);
 }
@@ -4567,8 +4567,8 @@
 };
 
 struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = {
-    .LaunchSelLdr = (PP_NaClResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr,
-    .StartPpapiProxy = (PP_NaClResult (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy,
+    .LaunchSelLdr = (PP_ExternalPluginResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr,
+    .StartPpapiProxy = (PP_ExternalPluginResult (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy,
     .UrandomFD = (int32_t (*)(void))&Pnacl_M13_PPB_NaCl_Private_UrandomFD,
     .Are3DInterfacesDisabled = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_Are3DInterfacesDisabled,
     .BrokerDuplicateHandle = (int32_t (*)(PP_FileHandle source_handle, uint32_t process_id, PP_FileHandle* target_handle, uint32_t desired_access, uint32_t options))&Pnacl_M13_PPB_NaCl_Private_BrokerDuplicateHandle,
@@ -4578,7 +4578,7 @@
     .ReportTranslationFinished = (void (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_ReportTranslationFinished,
     .IsOffTheRecord = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_IsOffTheRecord,
     .IsPnaclEnabled = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_IsPnaclEnabled,
-    .ReportNaClError = (PP_NaClResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M13_PPB_NaCl_Private_ReportNaClError,
+    .ReportNaClError = (PP_ExternalPluginResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M13_PPB_NaCl_Private_ReportNaClError,
     .OpenNaClExecutable = (PP_FileHandle (*)(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi))&Pnacl_M13_PPB_NaCl_Private_OpenNaClExecutable
 };
 
diff --git a/ppapi/ppapi_c.target.darwin-arm.mk b/ppapi/ppapi_c.target.darwin-arm.mk
index b4b8c24..1ca820d 100644
--- a/ppapi/ppapi_c.target.darwin-arm.mk
+++ b/ppapi/ppapi_c.target.darwin-arm.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_c.target.darwin-mips.mk b/ppapi/ppapi_c.target.darwin-mips.mk
index 35e0981..12a949b 100644
--- a/ppapi/ppapi_c.target.darwin-mips.mk
+++ b/ppapi/ppapi_c.target.darwin-mips.mk
@@ -67,10 +67,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -144,10 +144,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_c.target.darwin-x86.mk b/ppapi/ppapi_c.target.darwin-x86.mk
index adee77e..d8d46e0 100644
--- a/ppapi/ppapi_c.target.darwin-x86.mk
+++ b/ppapi/ppapi_c.target.darwin-x86.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_c.target.linux-arm.mk b/ppapi/ppapi_c.target.linux-arm.mk
index b4b8c24..1ca820d 100644
--- a/ppapi/ppapi_c.target.linux-arm.mk
+++ b/ppapi/ppapi_c.target.linux-arm.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_c.target.linux-mips.mk b/ppapi/ppapi_c.target.linux-mips.mk
index 35e0981..12a949b 100644
--- a/ppapi/ppapi_c.target.linux-mips.mk
+++ b/ppapi/ppapi_c.target.linux-mips.mk
@@ -67,10 +67,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -144,10 +144,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_c.target.linux-x86.mk b/ppapi/ppapi_c.target.linux-x86.mk
index adee77e..d8d46e0 100644
--- a/ppapi/ppapi_c.target.linux-x86.mk
+++ b/ppapi/ppapi_c.target.linux-x86.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ppapi/ppapi_shared.target.darwin-arm.mk b/ppapi/ppapi_shared.target.darwin-arm.mk
index cb63c93..782e034 100644
--- a/ppapi/ppapi_shared.target.darwin-arm.mk
+++ b/ppapi/ppapi_shared.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -213,17 +214,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -247,8 +247,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -327,17 +327,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -362,8 +361,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -441,7 +440,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/ppapi_shared.target.darwin-mips.mk b/ppapi/ppapi_shared.target.darwin-mips.mk
index 2e14772..1ffb3f0 100644
--- a/ppapi/ppapi_shared.target.darwin-mips.mk
+++ b/ppapi/ppapi_shared.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -212,17 +213,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -246,8 +246,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -325,17 +325,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -360,8 +359,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -435,7 +434,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/ppapi_shared.target.darwin-x86.mk b/ppapi/ppapi_shared.target.darwin-x86.mk
index 59e29f2..e2b17c3 100644
--- a/ppapi/ppapi_shared.target.darwin-x86.mk
+++ b/ppapi/ppapi_shared.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -215,17 +216,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -249,8 +249,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -332,17 +332,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -367,8 +366,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -441,7 +440,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/ppapi_shared.target.linux-arm.mk b/ppapi/ppapi_shared.target.linux-arm.mk
index cb63c93..782e034 100644
--- a/ppapi/ppapi_shared.target.linux-arm.mk
+++ b/ppapi/ppapi_shared.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -213,17 +214,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -247,8 +247,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -327,17 +327,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -362,8 +361,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -441,7 +440,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/ppapi_shared.target.linux-mips.mk b/ppapi/ppapi_shared.target.linux-mips.mk
index 2e14772..1ffb3f0 100644
--- a/ppapi/ppapi_shared.target.linux-mips.mk
+++ b/ppapi/ppapi_shared.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -212,17 +213,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -246,8 +246,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -325,17 +325,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -360,8 +359,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -435,7 +434,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/ppapi_shared.target.linux-x86.mk b/ppapi/ppapi_shared.target.linux-x86.mk
index 59e29f2..e2b17c3 100644
--- a/ppapi/ppapi_shared.target.linux-x86.mk
+++ b/ppapi/ppapi_shared.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp
@@ -215,17 +216,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -249,8 +249,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -332,17 +332,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -367,8 +366,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -441,7 +440,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ppapi/proxy/connection.h b/ppapi/proxy/connection.h
index 5f99f06..13cbbc6 100644
--- a/ppapi/proxy/connection.h
+++ b/ppapi/proxy/connection.h
@@ -5,6 +5,8 @@
 #ifndef PPAPI_PROXY_CONNECTION_H_
 #define PPAPI_PROXY_CONNECTION_H_
 
+#include "ipc/ipc_message.h"
+
 namespace IPC {
 class Sender;
 }
@@ -15,15 +17,31 @@
 // This struct holds the channels that a resource uses to send message to the
 // browser and renderer.
 struct Connection {
-  Connection() : browser_sender(0), renderer_sender(0) {
+  Connection() : browser_sender(0),
+                 renderer_sender(0),
+                 in_process(false),
+                 browser_sender_routing_id(MSG_ROUTING_NONE) {
   }
   Connection(IPC::Sender* browser, IPC::Sender* renderer)
       : browser_sender(browser),
-        renderer_sender(renderer) {
+        renderer_sender(renderer),
+        in_process(false),
+        browser_sender_routing_id(MSG_ROUTING_NONE) {
+  }
+  Connection(IPC::Sender* browser, IPC::Sender* renderer, int routing_id)
+      : browser_sender(browser),
+        renderer_sender(renderer),
+        in_process(true),
+        browser_sender_routing_id(routing_id) {
   }
 
   IPC::Sender* browser_sender;
   IPC::Sender* renderer_sender;
+  bool in_process;
+  // We need to use a routing ID when a plugin is in-process, and messages are
+  // sent back from the browser to the renderer. This is so that messages are
+  // routed to the proper RenderViewImpl.
+  int browser_sender_routing_id;
 };
 
 }  // namespace proxy
diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc
index e13cac9..44c38bb 100644
--- a/printing/backend/print_backend_cups.cc
+++ b/printing/backend/print_backend_cups.cc
@@ -16,6 +16,7 @@
 #include <gcrypt.h>
 #endif
 
+#include "base/debug/leak_annotations.h"
 #include "base/file_util.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
@@ -80,8 +81,14 @@
                 << " in " << kGnuTlsFiles[i];
         continue;
       }
-      if ((*pgnutls_global_init)() != 0)
-        LOG(ERROR) << "gnutls_global_init() failed";
+      {
+        // GnuTLS has a genuine small memory leak that is easier to annotate
+        // than suppress. See http://crbug.com/176888#c7
+        // TODO(earthdok): remove this once the leak is fixed.
+        ANNOTATE_SCOPED_MEMORY_LEAK;
+        if ((*pgnutls_global_init)() != 0)
+          LOG(ERROR) << "gnutls_global_init() failed";
+      }
       return;
     }
     LOG(ERROR) << "Cannot find libgnutls";
diff --git a/printing/printing.target.darwin-arm.mk b/printing/printing.target.darwin-arm.mk
index 927c86d..c1c8eeb 100644
--- a/printing/printing.target.darwin-arm.mk
+++ b/printing/printing.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -60,7 +61,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/printing/printing.target.darwin-mips.mk b/printing/printing.target.darwin-mips.mk
index 694aa6e..646f83d 100644
--- a/printing/printing.target.darwin-mips.mk
+++ b/printing/printing.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -56,7 +57,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/printing/printing.target.darwin-x86.mk b/printing/printing.target.darwin-x86.mk
index 90da792..3af46d7 100644
--- a/printing/printing.target.darwin-x86.mk
+++ b/printing/printing.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -56,7 +57,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/printing/printing.target.linux-arm.mk b/printing/printing.target.linux-arm.mk
index 927c86d..c1c8eeb 100644
--- a/printing/printing.target.linux-arm.mk
+++ b/printing/printing.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -60,7 +61,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/printing/printing.target.linux-mips.mk b/printing/printing.target.linux-mips.mk
index 694aa6e..646f83d 100644
--- a/printing/printing.target.linux-mips.mk
+++ b/printing/printing.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -56,7 +57,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/printing/printing.target.linux-x86.mk b/printing/printing.target.linux-x86.mk
index 90da792..3af46d7 100644
--- a/printing/printing.target.linux-x86.mk
+++ b/printing/printing.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -56,7 +57,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/remoting/android/java/AndroidManifest.xml b/remoting/android/java/AndroidManifest.xml
index d4a7aa7..10bccfd 100644
--- a/remoting/android/java/AndroidManifest.xml
+++ b/remoting/android/java/AndroidManifest.xml
@@ -2,12 +2,11 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="org.chromium.chromoting"
         android:versionCode="1"
-        android:versionName="1.0">
+        android:versionName="0.01">
     <uses-sdk android:minSdkVersion="14"
             android:targetSdkVersion="14"/>
     <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
     <uses-permission android:name="android.permission.INTERNET"/>
-    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
     <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
     <application android:label="@string/app_name"
             android:icon="@drawable/chromoting128">
diff --git a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
index b7666b3..1d01510 100644
--- a/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
+++ b/remoting/android/java/src/org/chromium/chromoting/DesktopView.java
@@ -32,13 +32,20 @@
      * *Square* of the minimum displacement (in pixels) to be recognized as a scroll gesture.
      * Setting this to a lower value forces more frequent canvas redraws during scrolling.
      */
-    private static int MIN_SCROLL_DISTANCE = 8 * 8;
+    private static final int MIN_SCROLL_DISTANCE = 8 * 8;
 
     /**
      * Minimum change to the scaling factor to be recognized as a zoom gesture. Setting lower
      * values here will result in more frequent canvas redraws during zooming.
      */
-    private static double MIN_ZOOM_FACTOR = 0.05;
+    private static final double MIN_ZOOM_FACTOR = 0.05;
+
+    /*
+     * These constants must match those in the generated struct protoc::MouseEvent_MouseButton.
+     */
+    private static final int BUTTON_UNDEFINED = 0;
+    private static final int BUTTON_LEFT = 1;
+    private static final int BUTTON_RIGHT = 3;
 
     /** Specifies one dimension of an image. */
     private static enum Constraint {
@@ -63,6 +70,9 @@
     /** Whether the bottom edge of the image was visible on-screen during the last render. */
     private boolean mBottomUsedToBeOut;
 
+    private int mMouseButton;
+    private boolean mMousePressed;
+
     /** Whether the device has just been rotated, necessitating a canvas redraw. */
     private boolean mJustRotated;
 
@@ -81,6 +91,9 @@
         mRightUsedToBeOut = false;
         mBottomUsedToBeOut = false;
 
+        mMouseButton = BUTTON_UNDEFINED;
+        mMousePressed = false;
+
         mJustRotated = false;
     }
 
@@ -151,27 +164,37 @@
                 boolean rightEdgeOutOfBounds = bottomright[0] < mScreenWidth;
                 boolean bottomEdgeOutOfBounds = bottomright[1] < mScreenHeight;
 
+                // Prevent the user from scrolling past the left or right edge of the image.
                 if (leftEdgeOutOfBounds != rightEdgeOutOfBounds) {
                     if (leftEdgeOutOfBounds != mRightUsedToBeOut) {
+                        // Make the left edge of the image flush with the left screen edge.
                         values[Matrix.MTRANS_X] = 0;
                     }
                     else {
+                        // Make the right edge of the image flush with the right screen edge.
                         values[Matrix.MTRANS_X] += mScreenWidth - bottomright[0];
                     }
                 }
-                else {  // The view would oscillate if this were updated while scrolling off-screen.
+                else {
+                    // The else prevents this from being updated during the repositioning process,
+                    // in which case the view would begin to oscillate.
                     mRightUsedToBeOut = rightEdgeOutOfBounds;
                 }
 
+                // Prevent the user from scrolling past the top or bottom edge of the image.
                 if (topEdgeOutOfBounds != bottomEdgeOutOfBounds) {
                     if (topEdgeOutOfBounds != mBottomUsedToBeOut) {
+                        // Make the top edge of the image flush with the top screen edge.
                         values[Matrix.MTRANS_Y] = 0;
                     }
                     else {
+                        // Make the bottom edge of the image flush with the bottom screen edge.
                         values[Matrix.MTRANS_Y] += mScreenHeight - bottomright[1];
                     }
                 }
-                else {  // The view would oscillate if this were updated while scrolling off-screen.
+                else {
+                    // The else prevents this from being updated during the repositioning process,
+                    // in which case the view would begin to oscillate.
                     mBottomUsedToBeOut = bottomEdgeOutOfBounds;
                 }
 
@@ -224,13 +247,71 @@
         Log.i("deskview", "DesktopView.surfaceDestroyed(...)");
     }
 
+    /** Called when a mouse action is made. */
+    private void handleMouseMovement(float[] coordinates, int button, boolean pressed) {
+        // Coordinates are relative to the canvas, but we need image coordinates.
+        Matrix canvasToImage = new Matrix();
+        mTransform.invert(canvasToImage);
+        canvasToImage.mapPoints(coordinates);
+
+        // Coordinates are now relative to the image, so transmit them to the host.
+        JniInterface.mouseAction((int)coordinates[0], (int)coordinates[1], button, pressed);
+    }
+
     /**
      * Called whenever the user attempts to touch the canvas. Forwards such
      * events to the appropriate gesture detector until one accepts them.
      */
     @Override
     public boolean onTouchEvent(MotionEvent event) {
-        return mScroller.onTouchEvent(event) || mZoomer.onTouchEvent(event);
+        boolean handled = mScroller.onTouchEvent(event) || mZoomer.onTouchEvent(event);
+
+        if (event.getPointerCount()==1) {
+            float[] coordinates = {event.getRawX(), event.getY()};
+
+            switch (event.getActionMasked()) {
+                case MotionEvent.ACTION_DOWN:
+                    Log.i("mouse", "Found a finger");
+                    mMouseButton = BUTTON_UNDEFINED;
+                    mMousePressed = false;
+                    break;
+
+                case MotionEvent.ACTION_MOVE:
+                    Log.i("mouse", "Finger is dragging");
+                    if (mMouseButton == BUTTON_UNDEFINED) {
+                        Log.i("mouse", "\tStarting left click");
+                        mMouseButton = BUTTON_LEFT;
+                        mMousePressed = true;
+                    }
+                    break;
+
+                case MotionEvent.ACTION_UP:
+                    Log.i("mouse", "Lost the finger");
+                    if (mMouseButton == BUTTON_UNDEFINED) {
+                        // The user pressed and released without moving: do left click and release.
+                        Log.i("mouse", "\tStarting and finishing left click");
+                        handleMouseMovement(coordinates, BUTTON_LEFT, true);
+                        mMouseButton = BUTTON_LEFT;
+                        mMousePressed = false;
+                    }
+                    else if (mMousePressed) {
+                        Log.i("mouse", "\tReleasing the currently-pressed button");
+                        mMousePressed = false;
+                    }
+                    else {
+                        Log.w("mouse", "Button already in released state before gesture ended");
+                    }
+                    break;
+
+                default:
+                    return handled;
+            }
+            handleMouseMovement(coordinates, mMouseButton, mMousePressed);
+
+            return true;
+        }
+
+        return handled;
     }
 
     /** Responds to touch events filtered by the gesture detectors. */
@@ -272,6 +353,12 @@
             return true;
         }
 
+        /** Called whenever a gesture starts. Always accepts the gesture so it isn't ignored. */
+        @Override
+        public boolean onDown(MotionEvent e) {
+            return true;
+        }
+
         /**
          * Called when the user starts to zoom. Always accepts the zoom so that
          * onScale() can decide whether to respond to it.
@@ -281,12 +368,31 @@
             return true;
         }
 
-        /**
-         * Called when the user is done zooming. Defers to onScale()'s judgement.
-         */
+        /** Called when the user is done zooming. Defers to onScale()'s judgement. */
         @Override
         public void onScaleEnd(ScaleGestureDetector detector) {
             onScale(detector);
         }
+
+        /** Called when the user holds down on the screen. Starts a right-click. */
+        @Override
+        public void onLongPress(MotionEvent e) {
+            if (e.getPointerCount() > 1) {
+                return;
+            }
+
+            float[] coordinates = new float[] {e.getRawX(), e.getY()};
+
+            Log.i("mouse", "Finger held down");
+            if (mMousePressed) {
+                Log.i("mouse", "\tReleasing the currently-pressed button");
+                handleMouseMovement(coordinates, mMouseButton, false);
+            }
+
+            Log.i("mouse", "\tStarting right click");
+            mMouseButton = BUTTON_RIGHT;
+            mMousePressed = true;
+            handleMouseMovement(coordinates, mMouseButton, mMousePressed);
+        }
     }
 }
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
index 7e30a68..9d1b3ae 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -204,9 +204,21 @@
         return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Config.ARGB_8888);
     }
 
+    /** Moves the mouse cursor, possibly while clicking. */
+    public static void mouseAction(int x, int y, int whichButton, boolean buttonDown) {
+        if (!sConnected) {
+            return;
+        }
+
+        mouseActionNative(x, y, whichButton, buttonDown);
+    }
+
     /** Performs the native response to the user's PIN. */
     private static native void authenticationResponse(String pin);
 
     /** Schedules a redraw on the native graphics thread. */
     private static native void scheduleRedrawNative();
+
+    /** Passes mouse information to the native handling code. */
+    private static native void mouseActionNative(int x, int y, int whichButton, boolean buttonDown);
 }
diff --git a/remoting/base/breakpad_win.cc b/remoting/base/breakpad_win.cc
index 7c6af9a..2503078 100644
--- a/remoting/base/breakpad_win.cc
+++ b/remoting/base/breakpad_win.cc
@@ -20,7 +20,7 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/wrapped_window_proc.h"
 #include "breakpad/src/client/windows/handler/exception_handler.h"
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc
index 6c6f075..fcb4db3 100644
--- a/remoting/client/jni/chromoting_jni_instance.cc
+++ b/remoting/client/jni/chromoting_jni_instance.cc
@@ -75,14 +75,41 @@
       display_task_runner()->BelongsToCurrentThread()) {
     ChromotingJni::GetInstance()->display_task_runner()->PostTask(
         FROM_HERE,
-        base::Bind(&ChromotingJniInstance::RedrawDesktop,
-                   this));
+        base::Bind(&ChromotingJniInstance::RedrawDesktop, this));
     return;
   }
 
   ChromotingJni::GetInstance()->RedrawCanvas();
 }
 
+void ChromotingJniInstance::PerformMouseAction(
+    int x,
+    int y,
+    protocol::MouseEvent_MouseButton button,
+    bool buttonDown) {
+  if(!ChromotingJni::GetInstance()->
+      network_task_runner()->BelongsToCurrentThread()) {
+    ChromotingJni::GetInstance()->network_task_runner()->PostTask(
+        FROM_HERE,
+        base::Bind(&ChromotingJniInstance::PerformMouseAction,
+                   this,
+                   x,
+                   y,
+                   button,
+                   buttonDown));
+    return;
+  }
+
+  protocol::MouseEvent action;
+  action.set_x(x);
+  action.set_y(y);
+  action.set_button(button);
+  if (button != protocol::MouseEvent::BUTTON_UNDEFINED)
+    action.set_button_down(buttonDown);
+
+  connection_->input_stub()->InjectMouseEvent(action);
+}
+
 void ChromotingJniInstance::OnConnectionState(
     protocol::ConnectionToHost::State state,
     protocol::ErrorCode error) {
@@ -113,13 +140,11 @@
 }
 
 protocol::ClipboardStub* ChromotingJniInstance::GetClipboardStub() {
-  NOTIMPLEMENTED();
-  return NULL;
+  return this;
 }
 
 protocol::CursorShapeStub* ChromotingJniInstance::GetCursorShapeStub() {
-  NOTIMPLEMENTED();
-  return NULL;
+  return this;
 }
 
 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>
@@ -128,6 +153,16 @@
   return scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>();
 }
 
+void ChromotingJniInstance::InjectClipboardEvent(
+    const protocol::ClipboardEvent& event) {
+  NOTIMPLEMENTED();
+}
+
+void ChromotingJniInstance::SetCursorShape(
+    const protocol::CursorShapeInfo& shape) {
+  NOTIMPLEMENTED();
+}
+
 void ChromotingJniInstance::ConnectToHostOnDisplayThread() {
   DCHECK(ChromotingJni::GetInstance()->
       display_task_runner()->BelongsToCurrentThread());
diff --git a/remoting/client/jni/chromoting_jni_instance.h b/remoting/client/jni/chromoting_jni_instance.h
index 2374e24..1c113cf 100644
--- a/remoting/client/jni/chromoting_jni_instance.h
+++ b/remoting/client/jni/chromoting_jni_instance.h
@@ -19,13 +19,21 @@
 #include "remoting/client/jni/jni_frame_consumer.h"
 #include "remoting/jingle_glue/network_settings.h"
 #include "remoting/jingle_glue/xmpp_signal_strategy.h"
+#include "remoting/protocol/clipboard_stub.h"
 #include "remoting/protocol/connection_to_host.h"
+#include "remoting/protocol/cursor_shape_stub.h"
 
 namespace remoting {
+namespace protocol {
+  class ClipboardEvent;
+  class CursorShapeInfo;
+}  // namespace protocol
 
 // ClientUserInterface that indirectly makes and receives JNI calls.
 class ChromotingJniInstance
   : public ClientUserInterface,
+    public protocol::ClipboardStub,
+    public protocol::CursorShapeStub,
     public base::RefCountedThreadSafe<ChromotingJniInstance> {
  public:
   // Initiates a connection with the specified host. Call from the UI thread.
@@ -48,6 +56,13 @@
   // Schedules a redraw on the display thread. May be called from any thread.
   void RedrawDesktop();
 
+  // Moves the host's cursor to the specified coordinates, optionally with some
+  // mouse button depressed. If |button| is BUTTON_UNDEFINED, no click is made.
+  void PerformMouseAction(int x,
+                          int y,
+                          protocol::MouseEvent_MouseButton button,
+                          bool buttonDown);
+
   // ClientUserInterface implementation.
   virtual void OnConnectionState(
       protocol::ConnectionToHost::State state,
@@ -61,6 +76,13 @@
   virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>
       GetTokenFetcher(const std::string& host_public_key) OVERRIDE;
 
+  // CursorShapeStub implementation.
+  virtual void InjectClipboardEvent(
+      const protocol::ClipboardEvent& event) OVERRIDE;
+
+  // ClipboardStub implementation.
+  virtual void SetCursorShape(const protocol::CursorShapeInfo& shape) OVERRIDE;
+
  private:
   // This object is ref-counted, so it cleans itself up.
   virtual ~ChromotingJniInstance();
diff --git a/remoting/client/jni/jni_interface.cc b/remoting/client/jni/jni_interface.cc
index ad42cc7..f9859af 100644
--- a/remoting/client/jni/jni_interface.cc
+++ b/remoting/client/jni/jni_interface.cc
@@ -113,4 +113,18 @@
   remoting::ChromotingJni::GetInstance()->session()->RedrawDesktop();
 }
 
+JNIEXPORT void JNICALL JNI_IMPLEMENTATION(mouseActionNative)(
+    JNIEnv* env,
+    jobject that,
+    jint x,
+    jint y,
+    jint which_button,
+    jboolean button_down) {
+  remoting::ChromotingJni::GetInstance()->session()->PerformMouseAction(
+      x,
+      y,
+      static_cast<remoting::protocol::MouseEvent_MouseButton>(which_button),
+      button_down);
+}
+
 }  // extern "C"
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index edf2c1d..8be169c 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -294,7 +294,7 @@
     if (use_async_pin_dialog_) {
       config.fetch_secret_callback =
           base::Bind(&ChromotingInstance::FetchSecretFromDialog,
-                     this->AsWeakPtr());
+                     weak_factory_.GetWeakPtr());
     } else {
       std::string shared_secret;
       if (!data->GetString("sharedSecret", &shared_secret)) {
@@ -572,7 +572,7 @@
 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>
 ChromotingInstance::GetTokenFetcher(const std::string& host_public_key) {
   return scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher>(
-      new PepperTokenFetcher(this->AsWeakPtr(), host_public_key));
+      new PepperTokenFetcher(weak_factory_.GetWeakPtr(), host_public_key));
 }
 
 void ChromotingInstance::InjectClipboardEvent(
@@ -701,7 +701,8 @@
   // Setup the PepperSignalStrategy.
   signal_strategy_.reset(new PepperSignalStrategy(
       config.local_jid,
-      base::Bind(&ChromotingInstance::SendOutgoingIq, AsWeakPtr())));
+      base::Bind(&ChromotingInstance::SendOutgoingIq,
+                 weak_factory_.GetWeakPtr())));
 
   scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator(
       PepperPortAllocator::Create(this));
@@ -713,7 +714,8 @@
 
   // Start timer that periodically sends perf stats.
   plugin_task_runner_->PostDelayedTask(
-      FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
+      FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats,
+                            weak_factory_.GetWeakPtr()),
       base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
 }
 
@@ -874,7 +876,8 @@
   }
 
   plugin_task_runner_->PostDelayedTask(
-      FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
+      FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats,
+                            weak_factory_.GetWeakPtr()),
       base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
 
   scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h
index b98d922..d7fd448 100644
--- a/remoting/client/plugin/chromoting_instance.h
+++ b/remoting/client/plugin/chromoting_instance.h
@@ -71,8 +71,7 @@
       public ClientUserInterface,
       public protocol::ClipboardStub,
       public protocol::CursorShapeStub,
-      public pp::Instance,
-      public base::SupportsWeakPtr<ChromotingInstance> {
+      public pp::Instance {
  public:
   // Plugin API version. This should be incremented whenever the API
   // interface changes.
@@ -258,6 +257,7 @@
 
   base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher_;
 
+  // Weak reference to this instance, used for global logging and task posting.
   base::WeakPtrFactory<ChromotingInstance> weak_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromotingInstance);
diff --git a/remoting/host/clipboard_win.cc b/remoting/host/clipboard_win.cc
index c8c2b42..71cff1c 100644
--- a/remoting/host/clipboard_win.cc
+++ b/remoting/host/clipboard_win.cc
@@ -9,7 +9,6 @@
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/logging.h"
-#include "base/process_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/platform_thread.h"
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc
index c89c413..0dcf907 100644
--- a/remoting/host/continue_window_win.cc
+++ b/remoting/host/continue_window_win.cc
@@ -9,7 +9,7 @@
 #include "base/compiler_specific.h"
 #include "base/location.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/utf_string_conversions.h"
 #include "remoting/host/continue_window.h"
diff --git a/remoting/host/daemon_process.h b/remoting/host/daemon_process.h
index 0fbf020..9053e42 100644
--- a/remoting/host/daemon_process.h
+++ b/remoting/host/daemon_process.h
@@ -13,7 +13,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/observer_list.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_channel.h"
 #include "ipc/ipc_channel_proxy.h"
 #include "ipc/ipc_platform_file.h"
diff --git a/remoting/host/daemon_process_unittest.cc b/remoting/host/daemon_process_unittest.cc
index 1e49cf4..928b5b2 100644
--- a/remoting/host/daemon_process_unittest.cc
+++ b/remoting/host/daemon_process_unittest.cc
@@ -6,7 +6,7 @@
 #include "base/bind_helpers.h"
 #include "base/location.h"
 #include "base/memory/ref_counted.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_message.h"
 #include "ipc/ipc_message_macros.h"
 #include "ipc/ipc_platform_file.h"
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc
index 9b5e355..a365f3e 100644
--- a/remoting/host/daemon_process_win.cc
+++ b/remoting/host/daemon_process_win.cc
@@ -11,7 +11,7 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
diff --git a/remoting/host/desktop_session_connector.h b/remoting/host/desktop_session_connector.h
index dcf2b64..f0a2d75 100644
--- a/remoting/host/desktop_session_connector.h
+++ b/remoting/host/desktop_session_connector.h
@@ -6,7 +6,7 @@
 #define REMOTING_HOST_DESKTOP_SESSION_CONNECTOR_H_
 
 #include "base/basictypes.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "ipc/ipc_platform_file.h"
 
 namespace remoting {
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 0760317..9e52f8d 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -7,7 +7,7 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/platform_file.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/memory/shared_memory.h"
 #include "base/single_thread_task_runner.h"
 #include "ipc/ipc_channel_proxy.h"
diff --git a/remoting/host/desktop_session_proxy.h b/remoting/host/desktop_session_proxy.h
index ae8cc4d..b39ecbb 100644
--- a/remoting/host/desktop_session_proxy.h
+++ b/remoting/host/desktop_session_proxy.h
@@ -11,7 +11,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/sequenced_task_runner_helpers.h"
 #include "ipc/ipc_listener.h"
 #include "ipc/ipc_platform_file.h"
diff --git a/remoting/host/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc
index 172d9fb..f8845ca 100644
--- a/remoting/host/disconnect_window_win.cc
+++ b/remoting/host/disconnect_window_win.cc
@@ -6,7 +6,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/scoped_gdi_object.h"
diff --git a/remoting/host/ipc_desktop_environment.cc b/remoting/host/ipc_desktop_environment.cc
index c0eaec3..6ec6676 100644
--- a/remoting/host/ipc_desktop_environment.cc
+++ b/remoting/host/ipc_desktop_environment.cc
@@ -8,7 +8,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/logging.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/single_thread_task_runner.h"
 #include "ipc/ipc_sender.h"
 #include "remoting/host/audio_capturer.h"
diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc
index 6b8dc9f..d14a047 100644
--- a/remoting/host/ipc_desktop_environment_unittest.cc
+++ b/remoting/host/ipc_desktop_environment_unittest.cc
@@ -8,8 +8,8 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
+#include "base/process/process_handle.h"
 #include "base/run_loop.h"
 #include "ipc/ipc_channel.h"
 #include "ipc/ipc_channel_proxy.h"
diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h
index 9f8a867..a3d5bcd 100644
--- a/remoting/host/plugin/host_script_object.h
+++ b/remoting/host/plugin/host_script_object.h
@@ -242,10 +242,6 @@
   // success status.
   void InvokeBooleanCallback(const ScopedRefNPObject& callback, bool result);
 
-  // Callback handler for DaemonController::DeletePairedClients().
-  void InvokeDeletePairedClientsCallback(const ScopedRefNPObject& callback,
-                                         bool success);
-
   // Callback handler for DaemonController::GetConfig().
   void InvokeGetDaemonConfigCallback(const ScopedRefNPObject& callback,
                                      scoped_ptr<base::DictionaryValue> config);
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 28e380a..7b7d3e3 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -481,9 +481,12 @@
     return;
   }
 
-  // TODO(jamiewalch): Create a pairing registry here once all the code
-  // is committed.
-  scoped_refptr<remoting::protocol::PairingRegistry> pairing_registry = NULL;
+  scoped_refptr<protocol::PairingRegistry> pairing_registry = NULL;
+  scoped_ptr<protocol::PairingRegistry::Delegate> delegate(
+      CreatePairingRegistryDelegate(context_->file_task_runner()));
+  if (delegate) {
+    pairing_registry = new protocol::PairingRegistry(delegate.Pass());
+  }
 
   scoped_ptr<protocol::AuthenticatorFactory> factory;
 
diff --git a/remoting/host/setup/daemon_controller_linux.cc b/remoting/host/setup/daemon_controller_linux.cc
index c36c63b..1fb2598 100644
--- a/remoting/host/setup/daemon_controller_linux.cc
+++ b/remoting/host/setup/daemon_controller_linux.cc
@@ -16,7 +16,9 @@
 #include "base/json/json_writer.h"
 #include "base/logging.h"
 #include "base/md5.h"
-#include "base/process_util.h"
+#include "base/process/kill.h"
+#include "base/process/launch.h"
+#include "base/process/process_handle.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
diff --git a/remoting/host/setup/daemon_installer_win.cc b/remoting/host/setup/daemon_installer_win.cc
index 78f2ede..fc61b69 100644
--- a/remoting/host/setup/daemon_installer_win.cc
+++ b/remoting/host/setup/daemon_installer_win.cc
@@ -8,7 +8,7 @@
 
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string16.h"
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index 3911c2e..62d70c4 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -11,7 +11,7 @@
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/path_service.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "base/win/scoped_handle.h"
diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc
index 38f288e..e579c09 100644
--- a/remoting/host/win/launch_process_with_token.cc
+++ b/remoting/host/win/launch_process_with_token.cc
@@ -11,7 +11,6 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/scoped_native_library.h"
 #include "base/strings/string16.h"
diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc
index 9b0251b..dcdad94 100644
--- a/remoting/host/win/unprivileged_process_delegate.cc
+++ b/remoting/host/win/unprivileged_process_delegate.cc
@@ -12,7 +12,6 @@
 
 #include "base/command_line.h"
 #include "base/logging.h"
-#include "base/process_util.h"
 #include "base/rand_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/string16.h"
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index c649f90..fb52c13 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -2169,6 +2169,7 @@
           'webapp/host_setup_dialog.js',
           'webapp/main.html',
           'webapp/manifest.json',
+          'webapp/paired_client_manager.js',
           'webapp/remoting.js',
         ],
       },
diff --git a/remoting/resources/remoting_strings.grd b/remoting/resources/remoting_strings.grd
index 18c3625..3c69d18 100644
--- a/remoting/resources/remoting_strings.grd
+++ b/remoting/resources/remoting_strings.grd
@@ -624,6 +624,33 @@
       <message name="IDR_HOST_STARTED" desc="The message reported to the EventLog by Chromoting Host every time it is started.">
         Host started for user: <ph name="HOST_USERNAME">%1<ex>host@email.com</ex></ph>.
       </message>
+      <message desc="Link to allow a host's paired clients to be viewed or edited." name="IDR_HOME_DAEMON_MANAGE_PAIRINGS">
+        View/edit
+      </message>
+      <message desc="Link to delete a specific paired client." name="IDR_DELETE_PAIRED_CLIENT">
+        Delete
+      </message>
+      <message desc="Link to delete all paired clients." name="IDR_DELETE_ALL_PAIRED_CLIENTS">
+        Delete all
+      </message>
+      <message desc="Message displayed in the paired client manager dialog when all paired clients have been deleted." name="IDR_NO_PAIRED_CLIENTS">
+        All paired clients have been deleted.
+      </message>
+      <message desc="Message displayed when the current computer has been paired with one or more clients, allowing them to connect without needing a PIN." name="IDR_HOME_DAEMON_PAIRED_MESSAGE">
+        This computer is configured to allow one or more clients to connect without entering a PIN.
+      </message>
+      <message desc="Message displayed above the list of paired clients, explaining its purpose." name="IDR_PAIRED_CLIENTS_INTRODUCTION">
+        The following clients have been paired with this computer and can connect without supplying a PIN. You can revoke this permission at any time, either individually, or for all clients.
+      </message>
+      <message desc="Table header for the dates at which clients were paired." name="IDR_PAIRED_CLIENT_DATE">
+        Pairing date
+      </message>
+      <message desc="Table header for the names of paired clients." name="IDR_PAIRED_CLIENT_NAME">
+        Client
+      </message>
+      <message desc="Text shown while a background operation is in progress." name="IDR_WORKING">
+        Working…
+      </message>
     </messages>
   </release>
 </grit>
diff --git a/remoting/webapp/all_js_load.gtestjs b/remoting/webapp/all_js_load.gtestjs
index 7b29e03..61a8aa4 100644
--- a/remoting/webapp/all_js_load.gtestjs
+++ b/remoting/webapp/all_js_load.gtestjs
@@ -52,7 +52,6 @@
     'oauth2.js',
     'paired_client_manager.js',
     'plugin_settings.js',
-    'xhr_proxy.js',
     'remoting.js',
     'session_connector.js',
     'server_log_entry.js',
@@ -66,6 +65,7 @@
     'wcs_sandbox_content.js',
     'wcs_sandbox_container.js',
     'xhr.js',
+    'xhr_proxy.js',
   ],
 };
 
diff --git a/remoting/webapp/appsv2.patch b/remoting/webapp/appsv2.patch
index 3305207..a214d0c 100644
--- a/remoting/webapp/appsv2.patch
+++ b/remoting/webapp/appsv2.patch
@@ -121,7 +121,7 @@
    remoting.stats = new remoting.ConnectionStats(
        document.getElementById('statistics'));
    remoting.formatIq = new remoting.FormatIq();
-@@ -156,9 +151,6 @@ remoting.initHomeScreenUi = function () {
+@@ -11,9 +151,6 @@ remoting.initHomeScreenUi = function() {
    remoting.hostController = new remoting.HostController();
    document.getElementById('share-button').disabled = !isIT2MeSupported_();
    remoting.setMode(remoting.AppMode.HOME);
@@ -130,7 +130,7 @@
 -  }
    remoting.hostSetupDialog =
        new remoting.HostSetupDialog(remoting.hostController);
-   // Display the cached host list, then asynchronously update and re-display it.
+   var dialog = document.getElementById('paired-clients-list');
 diff --git a/remoting/webapp/xhr_proxy.js b/remoting/webapp/xhr_proxy.js
 index 4c45780..653b481 100644
 --- a/xhr_proxy.js
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js
index 8ecde77..3698186 100644
--- a/remoting/webapp/client_screen.js
+++ b/remoting/webapp/client_screen.js
@@ -357,8 +357,22 @@
       };
       remoting.HostSettings.save(clientSession.hostId, pairingInfo);
     };
-    // TODO(jamiewalch): Since we can't get a descriptive name for the local
-    // computer from Javascript, pass the empty string for now.
-    clientSession.requestPairing('', onPairingComplete);
+    // Use the platform name as a proxy for the local computer name.
+    // TODO(jamiewalch): Use a descriptive name for the local computer, for
+    // example, its Chrome Sync name.
+    var clientName = '';
+    if (navigator.platform.indexOf('Mac') != -1) {
+      clientName = 'Mac';
+    } else if (navigator.platform.indexOf('Win32') != -1) {
+      clientName = 'Windows';
+    } else if (navigator.userAgent.match(/\bCrOS\b/)) {
+      clientName = 'ChromeOS';
+    } else if (navigator.platform.indexOf('Linux') != -1) {
+      clientName = 'Linux';
+    } else {
+      console.log('Unrecognized client platform. Using navigator.platform.');
+      clientName = navigator.platform;
+    }
+    clientSession.requestPairing(clientName, onPairingComplete);
   }
 };
diff --git a/remoting/webapp/event_handlers.js b/remoting/webapp/event_handlers.js
index a481e19..47e6d53 100644
--- a/remoting/webapp/event_handlers.js
+++ b/remoting/webapp/event_handlers.js
@@ -85,7 +85,11 @@
       { event: 'click', id: 'host-config-done-dismiss', fn: goHome },
       { event: 'click', id: 'host-config-error-dismiss', fn: goHome },
       { event: 'click', id: 'token-refresh-error-ok', fn: goHome },
-      { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect }
+      { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect },
+      { event: 'click', id: 'open-paired-client-manager-dialog',
+        fn: remoting.setMode.bind(null,
+                                  remoting.AppMode.HOME_MANAGE_PAIRINGS) },
+      { event: 'click', id: 'close-paired-client-manager-dialog', fn: goHome }
   ];
 
   for (var i = 0; i < actions.length; ++i) {
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
index de1a0a9..f728a32 100644
--- a/remoting/webapp/host_controller.js
+++ b/remoting/webapp/host_controller.js
@@ -337,5 +337,42 @@
   });
 };
 
+/**
+ * Fetch the list of paired clients for this host.
+ *
+ * @param {function(Array.<remoting.PairedClient>):void} onDone
+ * @param {function(remoting.Error):void} onError
+ * @return {void}
+ */
+remoting.HostController.prototype.getPairedClients = function(onDone,
+                                                              onError) {
+  this.hostDispatcher_.getPairedClients(onDone, onError);
+};
+
+/**
+ * Delete a single paired client.
+ *
+ * @param {string} client The client id of the pairing to delete.
+ * @param {function():void} onDone Completion callback.
+ * @param {function(remoting.Error):void} onError Error callback.
+ * @return {void}
+ */
+remoting.HostController.prototype.deletePairedClient = function(
+    client, onDone, onError) {
+  this.hostDispatcher_.deletePairedClient(client, onDone, onError);
+};
+
+/**
+ * Delete all paired clients.
+ *
+ * @param {function():void} onDone Completion callback.
+ * @param {function(remoting.Error):void} onError Error callback.
+ * @return {void}
+ */
+remoting.HostController.prototype.clearPairedClients = function(
+    onDone, onError) {
+  this.hostDispatcher_.clearPairedClients(onDone, onError);
+};
+
 /** @type {remoting.HostController} */
 remoting.hostController = null;
diff --git a/remoting/webapp/host_dispatcher.js b/remoting/webapp/host_dispatcher.js
index 7b81c0e..02ca1ac 100644
--- a/remoting/webapp/host_dispatcher.js
+++ b/remoting/webapp/host_dispatcher.js
@@ -43,24 +43,28 @@
   /** @type {Array.<function()>} */
   this.pendingRequests_ = [];
 
-  /** @param {boolean} success */
-  var onNativeMessagingInit = function(success) {
-    if (success) {
-      console.log('Native Messaging supported.');
-      that.state_ = remoting.HostDispatcher.State.NATIVE_MESSAGING;
-    } else {
-      console.log('Native Messaging unsupported, falling back to NPAPI.');
-      that.npapiHost_ = createPluginCallback();
-      that.state_ = remoting.HostDispatcher.State.NPAPI;
-    }
-    // Send pending requests.
+  function sendPendingRequests() {
     for (var i = 0; i < that.pendingRequests_.length; i++) {
       that.pendingRequests_[i]();
     }
     that.pendingRequests_ = null;
-  };
+  }
 
-  this.nativeMessagingHost_.initialize(onNativeMessagingInit);
+  function onNativeMessagingInit() {
+    console.log('Native Messaging supported.');
+    that.state_ = remoting.HostDispatcher.State.NATIVE_MESSAGING;
+    sendPendingRequests();
+  }
+
+  function onNativeMessagingFailed(error) {
+    console.log('Native Messaging unsupported, falling back to NPAPI.');
+    that.npapiHost_ = createPluginCallback();
+    that.state_ = remoting.HostDispatcher.State.NPAPI;
+    sendPendingRequests();
+  }
+
+  this.nativeMessagingHost_.initialize(onNativeMessagingInit,
+                                       onNativeMessagingFailed);
 };
 
 /** @enum {number} */
@@ -71,22 +75,22 @@
 };
 
 /**
- * @param {function(string):void} callback
+ * @param {function(string):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getHostName = function(callback, onError) {
+remoting.HostDispatcher.prototype.getHostName = function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getHostName.bind(this, callback, onError));
+          this.getHostName.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getHostName(callback, onError);
+      this.nativeMessagingHost_.getHostName(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.getHostName(callback);
+        this.npapiHost_.getHostName(onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -97,23 +101,23 @@
 /**
  * @param {string} hostId
  * @param {string} pin
- * @param {function(string):void} callback
+ * @param {function(string):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getPinHash = function(hostId, pin, callback,
-                                                        onError) {
+remoting.HostDispatcher.prototype.getPinHash =
+    function(hostId, pin, onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getPinHash.bind(this, hostId, pin, callback, onError));
+          this.getPinHash.bind(this, hostId, pin, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getPinHash(hostId, pin, callback, onError);
+      this.nativeMessagingHost_.getPinHash(hostId, pin, onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.getPinHash(hostId, pin, callback);
+        this.npapiHost_.getPinHash(hostId, pin, onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -122,23 +126,22 @@
 };
 
 /**
- * @param {function(string, string):void} callback
+ * @param {function(string, string):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.generateKeyPair = function(callback,
-                                                             onError) {
+remoting.HostDispatcher.prototype.generateKeyPair = function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.generateKeyPair.bind(this, callback, onError));
+          this.generateKeyPair.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.generateKeyPair(callback, onError);
+      this.nativeMessagingHost_.generateKeyPair(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.generateKeyPair(callback);
+        this.npapiHost_.generateKeyPair(onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -148,24 +151,23 @@
 
 /**
  * @param {Object} config
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.updateDaemonConfig = function(config,
-                                                                callback,
-                                                                onError) {
+remoting.HostDispatcher.prototype.updateDaemonConfig =
+    function(config, onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.updateDaemonConfig.bind(this, config, callback, onError));
+          this.updateDaemonConfig.bind(this, config, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.updateDaemonConfig(config, callback, onError);
+      this.nativeMessagingHost_.updateDaemonConfig(config, onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.updateDaemonConfig(JSON.stringify(config), callback);
+        this.npapiHost_.updateDaemonConfig(JSON.stringify(config), onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -174,15 +176,14 @@
 };
 
 /**
- * @param {function(Object):void} callback
+ * @param {function(Object):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getDaemonConfig = function(callback,
-                                                             onError) {
+remoting.HostDispatcher.prototype.getDaemonConfig = function(onDone, onError) {
   /**
    * Converts the config string from the NPAPI plugin to an Object, to pass to
-   * |callback|.
+   * |onDone|.
    * @param {string} configStr
    * @return {void}
    */
@@ -191,17 +192,17 @@
     if (typeof(config) != 'object') {
       onError(remoting.Error.UNEXPECTED);
     } else {
-      callback(/** @type {Object} */ (config));
+      onDone(/** @type {Object} */ (config));
     }
   }
 
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getDaemonConfig.bind(this, callback, onError));
+          this.getDaemonConfig.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getDaemonConfig(callback, onError);
+      this.nativeMessagingHost_.getDaemonConfig(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
@@ -214,23 +215,22 @@
 };
 
 /**
- * @param {function(string):void} callback
+ * @param {function(string):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getDaemonVersion = function(callback,
-                                                              onError) {
+remoting.HostDispatcher.prototype.getDaemonVersion = function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getDaemonVersion.bind(this, callback, onError));
+          this.getDaemonVersion.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      callback(this.nativeMessagingHost_.getDaemonVersion());
+      onDone(this.nativeMessagingHost_.getDaemonVersion());
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.getDaemonVersion(callback);
+        this.npapiHost_.getDaemonVersion(onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -239,23 +239,23 @@
 };
 
 /**
- * @param {function(boolean, boolean, boolean):void} callback
+ * @param {function(boolean, boolean, boolean):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getUsageStatsConsent = function(callback,
-                                                                  onError) {
+remoting.HostDispatcher.prototype.getUsageStatsConsent =
+    function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getUsageStatsConsent.bind(this, callback, onError));
+          this.getUsageStatsConsent.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getUsageStatsConsent(callback, onError);
+      this.nativeMessagingHost_.getUsageStatsConsent(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.getUsageStatsConsent(callback);
+        this.npapiHost_.getUsageStatsConsent(onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -266,23 +266,23 @@
 /**
  * @param {Object} config
  * @param {boolean} consent
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.startDaemon = function(config, consent,
-                                                         callback, onError) {
+remoting.HostDispatcher.prototype.startDaemon =
+    function(config, consent, onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.startDaemon.bind(this, config, consent, callback, onError));
+          this.startDaemon.bind(this, config, consent, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.startDaemon(config, consent, callback, onError);
+      this.nativeMessagingHost_.startDaemon(config, consent, onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.startDaemon(JSON.stringify(config), consent, callback);
+        this.npapiHost_.startDaemon(JSON.stringify(config), consent, onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -291,21 +291,21 @@
 };
 
 /**
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.stopDaemon = function(callback, onError) {
+remoting.HostDispatcher.prototype.stopDaemon = function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
-      this.pendingRequests_.push(this.stopDaemon.bind(this, callback, onError));
+      this.pendingRequests_.push(this.stopDaemon.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.stopDaemon(callback, onError);
+      this.nativeMessagingHost_.stopDaemon(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.stopDaemon(callback);
+        this.npapiHost_.stopDaemon(onDone);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -314,18 +314,18 @@
 };
 
 /**
- * @param {function(remoting.HostController.State):void} callback
+ * @param {function(remoting.HostController.State):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getDaemonState = function(callback, onError) {
+remoting.HostDispatcher.prototype.getDaemonState = function(onDone, onError) {
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getDaemonState.bind(this, callback, onError));
+          this.getDaemonState.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getDaemonState(callback, onError);
+      this.nativeMessagingHost_.getDaemonState(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       // Call the callback directly, since NPAPI exposes the state directly as
@@ -334,22 +334,21 @@
       if (state === undefined) {
         onError(remoting.Error.MISSING_PLUGIN);
       } else {
-        callback(state);
+        onDone(state);
       }
       break;
   }
 };
 
 /**
- * @param {function(Array.<remoting.PairedClient>):void} callback
+ * @param {function(Array.<remoting.PairedClient>):void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
-remoting.HostDispatcher.prototype.getPairedClients = function(callback,
-                                                              onError) {
+remoting.HostDispatcher.prototype.getPairedClients = function(onDone, onError) {
   /**
    * Converts the JSON string from the NPAPI plugin to Array.<PairedClient>, to
-   * pass to |callback|.
+   * pass to |onDone|.
    * @param {string} pairedClientsJson
    * @return {void}
    */
@@ -357,7 +356,7 @@
     var pairedClients = remoting.PairedClient.convertToPairedClientArray(
         jsonParseSafe(pairedClientsJson));
     if (pairedClients != null) {
-      callback(pairedClients);
+      onDone(pairedClients);
     } else {
       onError(remoting.Error.UNEXPECTED);
     }
@@ -366,10 +365,10 @@
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
-          this.getPairedClients.bind(this, callback, onError));
+          this.getPairedClients.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.getPairedClients(callback, onError);
+      this.nativeMessagingHost_.getPairedClients(onDone, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
@@ -382,23 +381,43 @@
 };
 
 /**
- * @param {function(boolean):void} onDone
+ * The pairing API returns a boolean to indicate success or failure, but
+ * the JS API is defined in terms of onDone and onError callbacks. This
+ * function converts one to the other.
+ *
+ * @param {function():void} onDone Success callback.
+ * @param {function(remoting.Error):void} onError Error callback.
+ * @param {boolean} success True if the operation succeeded; false otherwise.
+ * @private
+ */
+remoting.HostDispatcher.runCallback_ = function(onDone, onError, success) {
+  if (success) {
+    onDone();
+  } else {
+    onError(remoting.Error.UNEXPECTED);
+  }
+};
+
+/**
+ * @param {function():void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
 remoting.HostDispatcher.prototype.clearPairedClients =
     function(onDone, onError) {
+  var callback =
+      remoting.HostDispatcher.runCallback_.bind(null, onDone, onError);
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
         this.clearPairedClients.bind(this, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.clearPairedClients(onDone, onError);
+      this.nativeMessagingHost_.clearPairedClients(callback, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.clearPairedClients(onDone);
+        this.npapiHost_.clearPairedClients(callback);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
@@ -408,23 +427,25 @@
 
 /**
  * @param {string} client
- * @param {function(boolean):void} onDone
+ * @param {function():void} onDone
  * @param {function(remoting.Error):void} onError
  * @return {void}
  */
 remoting.HostDispatcher.prototype.deletePairedClient =
     function(client, onDone, onError) {
+  var callback =
+      remoting.HostDispatcher.runCallback_.bind(null, onDone, onError);
   switch (this.state_) {
     case remoting.HostDispatcher.State.UNKNOWN:
       this.pendingRequests_.push(
         this.deletePairedClient.bind(this, client, onDone, onError));
       break;
     case remoting.HostDispatcher.State.NATIVE_MESSAGING:
-      this.nativeMessagingHost_.deletePairedClient(client, onDone, onError);
+      this.nativeMessagingHost_.deletePairedClient(client, callback, onError);
       break;
     case remoting.HostDispatcher.State.NPAPI:
       try {
-        this.npapiHost_.deletePairedClient(client, onDone);
+        this.npapiHost_.deletePairedClient(client, callback);
       } catch (err) {
         onError(remoting.Error.MISSING_PLUGIN);
       }
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js
index fd6372c..c6ce36a 100644
--- a/remoting/webapp/host_native_messaging.js
+++ b/remoting/webapp/host_native_messaging.js
@@ -39,15 +39,15 @@
  * Type used for entries of |pendingReplies_| list.
  *
  * @param {string} type Type of the originating request.
- * @param {?function(...):void} callback The callback, if any, to be triggered
+ * @param {?function(...):void} onDone The callback, if any, to be triggered
  *     on response. The actual parameters depend on the original request type.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @constructor
  */
-remoting.HostNativeMessaging.PendingReply = function(type, callback, onError) {
+remoting.HostNativeMessaging.PendingReply = function(type, onDone, onError) {
   this.type = type;
-  this.callback = callback;
+  this.onDone = onDone;
   this.onError = onError;
 };
 
@@ -56,14 +56,15 @@
  * 'hello' messages. If Native Messaging is not available or the host
  * process is not installed, this returns false to the callback.
  *
- * @param {function(boolean): void} onDone Called with the result of
- *     initialization.
+ * @param {function(): void} onDone Called after successful initialization.
+ * @param {function(remoting.Error): void} onError Called if initialization
+ *     failed.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.initialize = function(onDone) {
+remoting.HostNativeMessaging.prototype.initialize = function(onDone, onError) {
   if (!chrome.runtime.connectNative) {
     console.log('Native Messaging API not available');
-    onDone(false);
+    onError(remoting.Error.UNEXPECTED);
     return;
   }
 
@@ -73,7 +74,7 @@
   var majorVersion = navigator.appVersion.match('Chrome/(\\d+)\.')[1];
   if (!majorVersion || majorVersion <= 26) {
     console.log('Native Messaging not supported on this version of Chrome');
-    onDone(false);
+    onError(remoting.Error.UNEXPECTED);
     return;
   }
 
@@ -82,12 +83,12 @@
         'com.google.chrome.remote_desktop');
     this.port_.onMessage.addListener(this.onIncomingMessage_.bind(this));
     this.port_.onDisconnect.addListener(this.onDisconnect_.bind(this));
-    this.postMessage_({type: 'hello'}, onDone.bind(null, true),
-                      onDone.bind(null, false));
+    this.postMessage_({type: 'hello'}, onDone,
+                      onError.bind(null, remoting.Error.UNEXPECTED));
   } catch (err) {
     console.log('Native Messaging initialization failed: ',
                 /** @type {*} */ (err));
-    onDone(false);
+    onError(remoting.Error.UNEXPECTED);
     return;
   }
 };
@@ -147,25 +148,24 @@
 
 /**
  * Attaches a new ID to the supplied message, and posts it to the Native
- * Messaging port, adding |callback| to the list of pending replies.
+ * Messaging port, adding |onDone| to the list of pending replies.
  * |message| should have its 'type' field set, and any other fields set
  * depending on the message type.
  *
  * @param {{type: string}} message The message to post.
- * @param {?function(...):void} callback The callback, if any, to be triggered
+ * @param {?function(...):void} onDone The callback, if any, to be triggered
  *     on response.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  * @private
  */
-remoting.HostNativeMessaging.prototype.postMessage_ = function(message,
-                                                               callback,
-                                                               onError) {
+remoting.HostNativeMessaging.prototype.postMessage_ =
+    function(message, onDone, onError) {
   var id = this.nextId_++;
   message['id'] = id;
   this.pendingReplies_[id] = new remoting.HostNativeMessaging.PendingReply(
-    message.type + 'Response', callback, onError);
+    message.type + 'Response', onDone, onError);
   this.port_.postMessage(message);
 };
 
@@ -190,7 +190,7 @@
   }
   delete this.pendingReplies_[id];
 
-  var callback = reply.callback;
+  var onDone = reply.onDone;
   var onError = reply.onError;
 
   /** @type {string} */
@@ -212,7 +212,7 @@
       var version = message['version'];
       if (checkType_('version', version, 'string')) {
         this.version_ = version;
-        callback();
+        onDone();
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -222,7 +222,7 @@
       /** @type {*} */
       var hostname = message['hostname'];
       if (checkType_('hostname', hostname, 'string')) {
-        callback(hostname);
+        onDone(hostname);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -232,7 +232,7 @@
       /** @type {*} */
       var hash = message['hash'];
       if (checkType_('hash', hash, 'string')) {
-        callback(hash);
+        onDone(hash);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -245,7 +245,7 @@
       var publicKey = message['publicKey'];
       if (checkType_('privateKey', privateKey, 'string') &&
           checkType_('publicKey', publicKey, 'string')) {
-        callback(privateKey, publicKey);
+        onDone(privateKey, publicKey);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -254,7 +254,7 @@
     case 'updateDaemonConfigResponse':
       var result = asAsyncResult_(message['result']);
       if (result != null) {
-        callback(result);
+        onDone(result);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -264,7 +264,7 @@
       /** @type {*} */
       var config = message['config'];
       if (checkType_('config', config, 'object')) {
-        callback(config);
+        onDone(config);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -280,7 +280,7 @@
       if (checkType_('supported', supported, 'boolean') &&
           checkType_('allowed', allowed, 'boolean') &&
           checkType_('setByPolicy', setByPolicy, 'boolean')) {
-        callback(supported, allowed, setByPolicy);
+        onDone(supported, allowed, setByPolicy);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -290,7 +290,7 @@
     case 'stopDaemonResponse':
       var result = asAsyncResult_(message['result']);
       if (result != null) {
-        callback(result);
+        onDone(result);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -299,7 +299,7 @@
     case 'getDaemonStateResponse':
       var state = asHostState_(message['state']);
       if (state != null) {
-        callback(state);
+        onDone(state);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -309,7 +309,7 @@
       var pairedClients = remoting.PairedClient.convertToPairedClientArray(
           message['pairedClients']);
       if (pairedClients != null) {
-        callback(pairedClients);
+        onDone(pairedClients);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -320,7 +320,7 @@
       /** @type {boolean} */
       var success = message['result'];
       if (checkType_('success', success, 'boolean')) {
-        callback(success);
+        onDone(success);
       } else {
         onError(remoting.Error.UNEXPECTED);
       }
@@ -348,15 +348,15 @@
 }
 
 /**
- * @param {function(string):void} callback Callback to be called with the
+ * @param {function(string):void} onDone Callback to be called with the
  *     local hostname.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.getHostName = function(callback,
-                                                              onError) {
-  this.postMessage_({type: 'getHostName'}, callback, onError);
+remoting.HostNativeMessaging.prototype.getHostName =
+    function(onDone, onError) {
+  this.postMessage_({type: 'getHostName'}, onDone, onError);
 };
 
 /**
@@ -365,19 +365,18 @@
  *
  * @param {string} hostId The host ID.
  * @param {string} pin The PIN.
- * @param {function(string):void} callback Callback.
+ * @param {function(string):void} onDone Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.getPinHash = function(hostId, pin,
-                                                             callback,
-                                                             onError) {
+remoting.HostNativeMessaging.prototype.getPinHash =
+    function(hostId, pin, onDone, onError) {
   this.postMessage_({
       type: 'getPinHash',
       hostId: hostId,
       pin: pin
-  }, callback, onError);
+  }, onDone, onError);
 };
 
 /**
@@ -385,14 +384,14 @@
  * when the key is generated. The key is returned in format understood by the
  * host (PublicKeyInfo structure encoded with ASN.1 DER, and then BASE64).
  *
- * @param {function(string, string):void} callback Callback.
+ * @param {function(string, string):void} onDone Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.generateKeyPair = function(callback,
-                                                                  onError) {
-  this.postMessage_({type: 'generateKeyPair'}, callback, onError);
+remoting.HostNativeMessaging.prototype.generateKeyPair =
+    function(onDone, onError) {
+  this.postMessage_({type: 'generateKeyPair'}, onDone, onError);
 };
 
 /**
@@ -404,32 +403,32 @@
  * is called.
  *
  * @param {Object} config The new config parameters.
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  *     Callback to be called when finished.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
 remoting.HostNativeMessaging.prototype.updateDaemonConfig =
-    function(config, callback, onError) {
+    function(config, onDone, onError) {
   this.postMessage_({
       type: 'updateDaemonConfig',
       config: config
-  }, callback, onError);
+  }, onDone, onError);
 };
 
 /**
  * Loads daemon config. The config is passed as a JSON formatted string to the
  * callback.
  *
- * @param {function(Object):void} callback Callback.
+ * @param {function(Object):void} onDone Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.getDaemonConfig = function(callback,
-                                                                  onError) {
-  this.postMessage_({type: 'getDaemonConfig'}, callback, onError);
+remoting.HostNativeMessaging.prototype.getDaemonConfig =
+    function(onDone, onError) {
+  this.postMessage_({type: 'getDaemonConfig'}, onDone, onError);
 };
 
 /**
@@ -446,14 +445,14 @@
  * Get the user's consent to crash reporting. The consent flags are passed to
  * the callback as booleans: supported, allowed, set-by-policy.
  *
- * @param {function(boolean, boolean, boolean):void} callback Callback.
+ * @param {function(boolean, boolean, boolean):void} onDone Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
 remoting.HostNativeMessaging.prototype.getUsageStatsConsent =
-  function(callback, onError) {
-    this.postMessage_({type: 'getUsageStatsConsent'}, callback, onError);
+    function(onDone, onError) {
+  this.postMessage_({type: 'getUsageStatsConsent'}, onDone, onError);
 };
 
 /**
@@ -461,46 +460,46 @@
  *
  * @param {Object} config Host configuration.
  * @param {boolean} consent Consent to report crash dumps.
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  *     Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.startDaemon = function(
-  config, consent, callback, onError) {
+remoting.HostNativeMessaging.prototype.startDaemon =
+    function(config, consent, onDone, onError) {
   this.postMessage_({
       type: 'startDaemon',
       config: config,
       consent: consent
-  }, callback, onError);
+  }, onDone, onError);
 };
 
 /**
  * Stops the daemon process.
  *
- * @param {function(remoting.HostController.AsyncResult):void} callback
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
  *     Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.stopDaemon = function(callback,
-                                                             onError) {
-  this.postMessage_({type: 'stopDaemon'}, callback, onError);
+remoting.HostNativeMessaging.prototype.stopDaemon =
+    function(onDone, onError) {
+  this.postMessage_({type: 'stopDaemon'}, onDone, onError);
 };
 
 /**
  * Gets the installed/running state of the Host process.
  *
- * @param {function(remoting.HostController.State):void} callback Callback.
+ * @param {function(remoting.HostController.State):void} onDone Callback.
  * @param {function(remoting.Error):void} onError The callback to be triggered
  *     on error.
  * @return {void} Nothing.
  */
-remoting.HostNativeMessaging.prototype.getDaemonState = function(callback,
-                                                                 onError) {
-  this.postMessage_({type: 'getDaemonState'}, callback, onError);
+remoting.HostNativeMessaging.prototype.getDaemonState =
+    function(onDone, onError) {
+  this.postMessage_({type: 'getDaemonState'}, onDone, onError);
 }
 
 /**
diff --git a/remoting/webapp/main.css b/remoting/webapp/main.css
index 8faa94a..870796d 100644
--- a/remoting/webapp/main.css
+++ b/remoting/webapp/main.css
@@ -11,6 +11,11 @@
   margin: 0;
   padding: 0;
   border: 0;
+  font-weight: inherit;
+  font-style: inherit;
+  font-size: 100%;
+  font-family: inherit;
+  vertical-align: baseline;
 }
 
 body {
@@ -297,6 +302,10 @@
   margin-left: 5px;
 }
 
+.button-row span:first-child {
+  width: 100%;
+}
+
 .clickable {
   cursor: pointer;
 }
@@ -424,6 +433,10 @@
   padding-__MSG_@@bidi_start_edge__: 2px;
 }
 
+#paired-clients-list table {
+  width: 100%;
+}
+
 .message {
   margin-bottom: 24px;
 }
@@ -440,6 +453,10 @@
   vertical-align: middle;
 }
 
+thead {
+  font-weight: bold;
+}
+
 .host-online.clickable:hover,
 .host-online.clickable.child-focused {
   background-color: #f2f2f2;
diff --git a/remoting/webapp/main.html b/remoting/webapp/main.html
index 4a97637..c352452 100644
--- a/remoting/webapp/main.html
+++ b/remoting/webapp/main.html
@@ -206,10 +206,17 @@
               </button>
             </div> <!-- enabled -->
             <div data-daemon-state="enabled">
-              <span i18n-content="HOME_DAEMON_ACTIVE_MESSAGE"></span>
-              <a id="change-daemon-pin"
-                 href="#"
-                 i18n-content="HOME_DAEMON_CHANGE_PIN_LINK"></a>
+              <div>
+                <span i18n-content="HOME_DAEMON_ACTIVE_MESSAGE"></span>
+                <a id="change-daemon-pin"
+                   href="#"
+                   i18n-content="HOME_DAEMON_CHANGE_PIN_LINK"></a>
+              </div>
+              <div id="paired-client-manager-message" hidden>
+                <span i18n-content="HOME_DAEMON_PAIRED_MESSAGE"></span>
+                <a href="#"
+                   id="open-paired-client-manager-dialog"
+                   i18n-content="HOME_DAEMON_MANAGE_PAIRINGS"></a>
             </div>
           </div> <!-- daemon-control -->
           <div id="host-list-empty" hidden>
@@ -250,11 +257,11 @@
     </div> <!-- auth-dialog -->
 
     <div class="dialog-screen"
-         data-ui-mode="home.host home.client home.history home.confirm-host-delete home.host-setup home.token-refresh-failed"
+         data-ui-mode="home.host home.client home.history home.confirm-host-delete home.host-setup home.token-refresh-failed home.manage-pairings"
          hidden></div>
 
     <div class="dialog-container"
-         data-ui-mode="home.host home.client home.history home.confirm-host-delete home.host-setup home.token-refresh-failed"
+         data-ui-mode="home.host home.client home.history home.confirm-host-delete home.host-setup home.token-refresh-failed home.manage-pairings"
          hidden>
 
       <div class="box-spacer"></div>
@@ -661,6 +668,45 @@
         </div>
       </div> <!-- home.confirm-host-delete -->
 
+      <div id="paired-client-manager-dialog"
+           class="kd-modaldialog"
+           data-ui-mode="home.manage-pairings"
+           hidden>
+        <p i18n-content="PAIRED_CLIENTS_INTRODUCTION"
+           class="message">
+        </p>
+        <div id="paired-clients-list">
+          <table>
+            <thead>
+              <tr>
+                <td i18n-content="PAIRED_CLIENT_DATE"></td>
+                <td i18n-content="PAIRED_CLIENT_NAME"></td>
+              </tr>
+            </thead>
+            <tbody>
+            </tbody>
+          </table>
+          <p id="no-paired-clients">
+            <em i18n-content="NO_PAIRED_CLIENTS"></em>
+          </p>
+        </div> <!-- paired-clients-list -->
+        <p id="paired-client-manager-dialog-error"
+           class="error-state"
+           hidden>
+        </p>
+        <div class="button-row">
+          <span id="paired-client-manager-dialog-working"
+                class="waiting"
+                i18n-content="WORKING"
+                hidden></span>
+          <button id="delete-all-paired-clients"
+                  i18n-content="DELETE_ALL_PAIRED_CLIENTS">
+          <button id="close-paired-client-manager-dialog"
+                  i18n-content="CLOSE">
+          </button>
+        </div>
+      </div> <!-- home.manage-pairings -->
+
       <div class="box-spacer"></div>
 
     </div> <!-- dialog-container -->
diff --git a/remoting/webapp/paired_client_manager.js b/remoting/webapp/paired_client_manager.js
index 636716d..05d6fe9 100644
--- a/remoting/webapp/paired_client_manager.js
+++ b/remoting/webapp/paired_client_manager.js
@@ -2,6 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+/**
+ * @fileoverview
+ * Dialog for showing the list of clients that are paired with this host.
+ */
+
 'use strict';
 
 /** @suppress {duplicate} */
@@ -24,6 +29,50 @@
   this.clientId = /** @type {string} */ (pairedClient['clientId']);
   this.clientName = /** @type {string} */ (pairedClient['clientName']);
   this.createdTime = /** @type {number} */ (pairedClient['createdTime']);
+
+  /** @type {Element} */
+  this.tableRow = null;
+  /** @type {Element} */
+  this.deleteButton = null;
+};
+
+/**
+ * Create the DOM elements representing this client in the paired client
+ * manager dialog.
+ *
+ * @param {remoting.PairedClientManager} parent The paired client manager
+ *     dialog containing this row.
+ * @param {Element} tbody The <tbody> element to which to append the row.
+ */
+remoting.PairedClient.prototype.createDom = function(parent, tbody) {
+  this.tableRow = document.createElement('tr');
+  var td = document.createElement('td');
+  td.innerText = new Date(this.createdTime).toLocaleDateString();
+  this.tableRow.appendChild(td);
+  td = document.createElement('td');
+  td.innerText = this.clientName;
+  this.tableRow.appendChild(td);
+  td = document.createElement('td');
+  this.deleteButton = document.createElement('a');
+  this.deleteButton.href = '#';
+  this.deleteButton.innerText = chrome.i18n.getMessage(
+      /*i18n-content*/'DELETE_PAIRED_CLIENT');
+  this.deleteButton.addEventListener(
+      'click',
+      parent.deletePairedClient.bind(parent, this),
+      false);
+  td.appendChild(this.deleteButton);
+  this.tableRow.appendChild(td);
+  tbody.appendChild(this.tableRow);
+};
+
+/**
+ * Show or hide the "Delete" button for this row.
+ *
+ * @param {boolean} show True to show the button; false to hide it.
+ */
+remoting.PairedClient.prototype.showButton = function(show) {
+  this.deleteButton.hidden = !show;
 };
 
 /**
@@ -45,8 +94,7 @@
  */
 remoting.PairedClient.convertToPairedClientArray = function(pairedClients) {
   if (!(pairedClients instanceof Array)) {
-    console.error('pairedClients is not an Array: ' +
-                  pairedClients);
+    console.error('pairedClients is not an Array:', pairedClients);
     return null;
   }
 
@@ -62,3 +110,166 @@
   }
   return result;
 }
+
+/**
+ * @param {remoting.HostController} hostController
+ * @param {HTMLElement} listContainer HTML <div> to contain the list of paired
+ *     clients.
+ * @param {HTMLElement} message HTML <div> containing the message notifying
+ *     the user that clients are paired and containing the link to open the
+ *     dialog.
+ * @param {HTMLElement} deleteAllButton HTML <button> inititating the "delete
+ *     all" action.
+ * @param {HTMLElement} closeButton HTML <button> to close the dialog.
+ * @param {HTMLElement} noPairedClients HTML <div> containing a message shown
+ *     when all clients have been deleted.
+ * @param {HTMLElement} workingSpinner HTML element containing a spinner
+ *     graphic shown while a deletion is in progress.
+ * @param {HTMLElement} errorDiv HTML <div> containing an error message shown
+ *     if a delete operation fails.
+ * @constructor
+ */
+remoting.PairedClientManager = function(hostController, listContainer, message,
+                                        deleteAllButton, closeButton,
+                                        noPairedClients, workingSpinner,
+                                        errorDiv) {
+  /**
+   * @private
+   */
+  this.hostController_ = hostController;
+  /**
+   * @private
+   */
+  this.message_ = message;
+  /**
+   * @private
+   */
+  this.deleteAllButton_ = deleteAllButton;
+  /**
+   * @private
+   */
+  this.closeButton_ = closeButton;
+  /**
+   * @private
+   */
+  this.noPairedClients_ = noPairedClients;
+  /**
+   * @private
+   */
+  this.workingSpinner_ = workingSpinner;
+  /**
+   * @private
+   */
+  this.errorDiv_ = errorDiv;
+  /**
+   * @type {Element}
+   * @private
+   */
+  this.clientRows_ = listContainer.querySelector('tbody');
+  /**
+   * @type {Array.<remoting.PairedClient>}
+   */
+  this.pairedClients_ = [];
+
+  this.deleteAllButton_.addEventListener('click',
+                                         this.deleteAll_.bind(this),
+                                         false);
+};
+
+/**
+ * Populate the dialog with the list of paired clients and show or hide the
+ * message as appropriate.
+ *
+ * @param {*} pairedClients The list of paired clients as returned by the
+ *     native host component.
+ * @return {void} Nothing.
+ */
+remoting.PairedClientManager.prototype.setPairedClients =
+    function(pairedClients) {
+  // Reset table.
+  while (this.clientRows_.lastChild) {
+    this.clientRows_.removeChild(this.clientRows_.lastChild);
+  }
+
+  this.pairedClients_ =
+    remoting.PairedClient.convertToPairedClientArray(pairedClients);
+  for (var i = 0; i < this.pairedClients_.length; ++i) {
+    var client = this.pairedClients_[i];
+    client.createDom(this, this.clientRows_);
+  }
+
+  // Show or hide the "this computer has paired clients" message.
+  this.setWorking_(false)
+};
+
+/**
+ * Enter or leave "working" mode. This indicates to the user that a delete
+ * operation is in progress. All dialog UI is disabled until it completes.
+ *
+ * @param {boolean} working True to enter "working" mode; false to leave it.
+ * @private
+ */
+remoting.PairedClientManager.prototype.setWorking_ = function(working) {
+  var hasPairedClients = (this.pairedClients_.length != 0);
+  for (var i = 0; i < this.pairedClients_.length; ++i) {
+    this.pairedClients_[i].showButton(!working);
+  }
+  this.closeButton_.disabled = working;
+  this.workingSpinner_.hidden = !working;
+  this.errorDiv_.hidden = true;
+  this.message_.hidden = !hasPairedClients;
+  this.deleteAllButton_.disabled = working || !hasPairedClients;
+  this.noPairedClients_.hidden = hasPairedClients;
+};
+
+/**
+ * Error callback for delete operations.
+ *
+ * @param {remoting.Error} error The error message.
+ * @private
+ */
+remoting.PairedClientManager.prototype.onError_ = function(error) {
+  this.setWorking_(false);
+  l10n.localizeElementFromTag(this.errorDiv_, error);
+  this.errorDiv_.hidden = false;
+};
+
+/**
+ * Delete a single paired client.
+ *
+ * @param {remoting.PairedClient} client The pairing to delete.
+ */
+remoting.PairedClientManager.prototype.deletePairedClient = function(client) {
+  this.setWorking_(true);
+  this.hostController_.deletePairedClient(client.clientId,
+      this.setWorking_.bind(this, false),
+      this.onError_.bind(this));
+  this.clientRows_.removeChild(client.tableRow);
+  for (var i = 0; i < this.pairedClients_.length; ++i) {
+    if (this.pairedClients_[i] == client) {
+      this.pairedClients_.splice(i, 1);
+      break;
+    }
+  }
+};
+
+/**
+ * Delete all paired clients.
+ *
+ * @private
+ */
+remoting.PairedClientManager.prototype.deleteAll_ = function() {
+  this.setWorking_(true);
+  this.hostController_.clearPairedClients(
+      this.setWorking_.bind(this, false),
+      this.onError_.bind(this));
+
+  while (this.clientRows_.lastChild) {
+    this.clientRows_.removeChild(this.clientRows_.lastChild);
+  }
+  this.pairedClients_ = [];
+};
+
+
+/** @type {remoting.PairedClientManager} */
+remoting.pairedClientManager = null;
diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
index 8d97f73..50fe034 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -156,6 +156,17 @@
   }
   remoting.hostSetupDialog =
       new remoting.HostSetupDialog(remoting.hostController);
+  var dialog = document.getElementById('paired-clients-list');
+  var message = document.getElementById('paired-client-manager-message');
+  var deleteAll = document.getElementById('delete-all-paired-clients');
+  var close = document.getElementById('close-paired-client-manager-dialog');
+  var working = document.getElementById('paired-client-manager-dialog-working');
+  var error = document.getElementById('paired-client-manager-dialog-error');
+  var noPairedClients = document.getElementById('no-paired-clients');
+  remoting.pairedClientManager =
+      new remoting.PairedClientManager(remoting.hostController, dialog, message,
+                                       deleteAll, close, noPairedClients,
+                                       working, error);
   // Display the cached host list, then asynchronously update and re-display it.
   remoting.updateLocalHostState();
   remoting.hostList.refresh(remoting.updateLocalHostState);
@@ -163,7 +174,7 @@
 };
 
 /**
- * Fetches local host state and updates host list accordingly.
+ * Fetches local host state and updates the DOM accordingly.
  */
 remoting.updateLocalHostState = function() {
   /**
@@ -182,7 +193,19 @@
     remoting.hostList.display();
   };
 
+  /**
+   * @param {remoting.Error} error
+   */
+  var onError = function(error) {
+    console.error('Failed to get pairing status: ' + error);
+    remoting.pairedClientManager.setPairedClients([]);
+  }
+
   remoting.hostController.getLocalHostId(onHostId);
+  remoting.hostController.getPairedClients(
+      remoting.pairedClientManager.setPairedClients.bind(
+          remoting.pairedClientManager),
+      onError);
 };
 
 /**
diff --git a/remoting/webapp/ui_mode.js b/remoting/webapp/ui_mode.js
index 4587d83..966207f 100644
--- a/remoting/webapp/ui_mode.js
+++ b/remoting/webapp/ui_mode.js
@@ -47,6 +47,7 @@
       HOST_SETUP_PROCESSING: 'home.host-setup.processing',
       HOST_SETUP_DONE: 'home.host-setup.done',
       HOST_SETUP_ERROR: 'home.host-setup.error',
+    HOME_MANAGE_PAIRINGS: 'home.manage-pairings',
   IN_SESSION: 'in-session'
 };
 
diff --git a/rlz/win/lib/process_info.cc b/rlz/win/lib/process_info.cc
index 9c3c516..2511f54 100644
--- a/rlz/win/lib/process_info.cc
+++ b/rlz/win/lib/process_info.cc
@@ -12,7 +12,7 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/win/scoped_handle.h"
 #include "base/win/windows_version.h"
 #include "rlz/lib/assert.h"
diff --git a/rlz/win/lib/registry_util.cc b/rlz/win/lib/registry_util.cc
index 674661a..cb4a686 100644
--- a/rlz/win/lib/registry_util.cc
+++ b/rlz/win/lib/registry_util.cc
@@ -7,7 +7,7 @@
 
 #include "rlz/win/lib/registry_util.h"
 
-#include "base/process_util.h"
+#include "base/process/process_handle.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/win/registry.h"
 #include "base/win/windows_version.h"
diff --git a/sandbox/linux/services/broker_process.h b/sandbox/linux/services/broker_process.h
index b7bb239..901ae50 100644
--- a/sandbox/linux/services/broker_process.h
+++ b/sandbox/linux/services/broker_process.h
@@ -10,7 +10,7 @@
 
 #include "base/basictypes.h"
 #include "base/pickle.h"
-#include "base/process.h"
+#include "base/process/process.h"
 
 namespace sandbox {
 
diff --git a/sandbox/sandbox_services.target.darwin-arm.mk b/sandbox/sandbox_services.target.darwin-arm.mk
index e4a5b8b..ab80b25 100644
--- a/sandbox/sandbox_services.target.darwin-arm.mk
+++ b/sandbox/sandbox_services.target.darwin-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -150,10 +150,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services.target.darwin-mips.mk b/sandbox/sandbox_services.target.darwin-mips.mk
index 3849259..e158efa 100644
--- a/sandbox/sandbox_services.target.darwin-mips.mk
+++ b/sandbox/sandbox_services.target.darwin-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -148,10 +148,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services.target.darwin-x86.mk b/sandbox/sandbox_services.target.darwin-x86.mk
index cf5f3ed..e91cd06 100644
--- a/sandbox/sandbox_services.target.darwin-x86.mk
+++ b/sandbox/sandbox_services.target.darwin-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services.target.linux-arm.mk b/sandbox/sandbox_services.target.linux-arm.mk
index e4a5b8b..ab80b25 100644
--- a/sandbox/sandbox_services.target.linux-arm.mk
+++ b/sandbox/sandbox_services.target.linux-arm.mk
@@ -69,10 +69,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -150,10 +150,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services.target.linux-mips.mk b/sandbox/sandbox_services.target.linux-mips.mk
index 3849259..e158efa 100644
--- a/sandbox/sandbox_services.target.linux-mips.mk
+++ b/sandbox/sandbox_services.target.linux-mips.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -148,10 +148,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services.target.linux-x86.mk b/sandbox/sandbox_services.target.linux-x86.mk
index cf5f3ed..e91cd06 100644
--- a/sandbox/sandbox_services.target.linux-x86.mk
+++ b/sandbox/sandbox_services.target.linux-x86.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services_headers.target.darwin-arm.mk b/sandbox/sandbox_services_headers.target.darwin-arm.mk
index fe9a9d4..bf45355 100644
--- a/sandbox/sandbox_services_headers.target.darwin-arm.mk
+++ b/sandbox/sandbox_services_headers.target.darwin-arm.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -147,10 +147,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services_headers.target.darwin-x86.mk b/sandbox/sandbox_services_headers.target.darwin-x86.mk
index f921f2f..c4917ea 100644
--- a/sandbox/sandbox_services_headers.target.darwin-x86.mk
+++ b/sandbox/sandbox_services_headers.target.darwin-x86.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services_headers.target.linux-arm.mk b/sandbox/sandbox_services_headers.target.linux-arm.mk
index fe9a9d4..bf45355 100644
--- a/sandbox/sandbox_services_headers.target.linux-arm.mk
+++ b/sandbox/sandbox_services_headers.target.linux-arm.mk
@@ -68,10 +68,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -147,10 +147,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/sandbox_services_headers.target.linux-x86.mk b/sandbox/sandbox_services_headers.target.linux-x86.mk
index f921f2f..c4917ea 100644
--- a/sandbox/sandbox_services_headers.target.linux-x86.mk
+++ b/sandbox/sandbox_services_headers.target.linux-x86.mk
@@ -70,10 +70,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/seccomp_bpf.target.darwin-arm.mk b/sandbox/seccomp_bpf.target.darwin-arm.mk
index 9049b38..48365a1 100644
--- a/sandbox/seccomp_bpf.target.darwin-arm.mk
+++ b/sandbox/seccomp_bpf.target.darwin-arm.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/seccomp_bpf.target.darwin-x86.mk b/sandbox/seccomp_bpf.target.darwin-x86.mk
index cff1779..bd3b831 100644
--- a/sandbox/seccomp_bpf.target.darwin-x86.mk
+++ b/sandbox/seccomp_bpf.target.darwin-x86.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/seccomp_bpf.target.linux-arm.mk b/sandbox/seccomp_bpf.target.linux-arm.mk
index 9049b38..48365a1 100644
--- a/sandbox/seccomp_bpf.target.linux-arm.mk
+++ b/sandbox/seccomp_bpf.target.linux-arm.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/seccomp_bpf.target.linux-x86.mk b/sandbox/seccomp_bpf.target.linux-x86.mk
index cff1779..bd3b831 100644
--- a/sandbox/seccomp_bpf.target.linux-x86.mk
+++ b/sandbox/seccomp_bpf.target.linux-x86.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc
index 47ce776..a85b2bf 100644
--- a/sandbox/win/tests/common/controller.cc
+++ b/sandbox/win/tests/common/controller.cc
@@ -6,8 +6,7 @@
 
 #include <string>
 
-#include "base/process.h"
-#include "base/process_util.h"
+#include "base/process/process.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/win/windows_version.h"
 #include "sandbox/win/src/sandbox_factory.h"
diff --git a/sdch/sdch.target.darwin-arm.mk b/sdch/sdch.target.darwin-arm.mk
index b685fdd..48160bc 100644
--- a/sdch/sdch.target.darwin-arm.mk
+++ b/sdch/sdch.target.darwin-arm.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sdch/sdch.target.darwin-mips.mk b/sdch/sdch.target.darwin-mips.mk
index f7c2e9c..80ea2c1 100644
--- a/sdch/sdch.target.darwin-mips.mk
+++ b/sdch/sdch.target.darwin-mips.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sdch/sdch.target.darwin-x86.mk b/sdch/sdch.target.darwin-x86.mk
index c32fa7b..b5d7235 100644
--- a/sdch/sdch.target.darwin-x86.mk
+++ b/sdch/sdch.target.darwin-x86.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sdch/sdch.target.linux-arm.mk b/sdch/sdch.target.linux-arm.mk
index b685fdd..48160bc 100644
--- a/sdch/sdch.target.linux-arm.mk
+++ b/sdch/sdch.target.linux-arm.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sdch/sdch.target.linux-mips.mk b/sdch/sdch.target.linux-mips.mk
index f7c2e9c..80ea2c1 100644
--- a/sdch/sdch.target.linux-mips.mk
+++ b/sdch/sdch.target.linux-mips.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/sdch/sdch.target.linux-x86.mk b/sdch/sdch.target.linux-x86.mk
index c32fa7b..b5d7235 100644
--- a/sdch/sdch.target.linux-x86.mk
+++ b/sdch/sdch.target.linux-x86.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/skia/ext/SkMemory_new_handler.cpp b/skia/ext/SkMemory_new_handler.cpp
index 1799618..dbbc494 100644
--- a/skia/ext/SkMemory_new_handler.cpp
+++ b/skia/ext/SkMemory_new_handler.cpp
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <new>
 
-#include "base/process_util.h"
+#include "base/process/memory.h"
 
 #include "third_party/skia/include/core/SkTypes.h"
 #include "third_party/skia/include/core/SkThread.h"
diff --git a/skia/skia.gyp b/skia/skia.gyp
index 2432310..2f9e47a 100644
--- a/skia/skia.gyp
+++ b/skia/skia.gyp
@@ -3,871 +3,111 @@
 # found in the LICENSE file.
 
 {
-  'targets': [
-    {
-      'target_name': 'skia',
-      'type': '<(component)',
-      'variables': {
-        'conditions': [
-          ['OS== "ios"', {
-            'skia_support_gpu': 0,
-          }, {
-            'skia_support_gpu': 1,
-          }],
-        ],
-
-        'optimize': 'max',
-
-        # These two set the paths so we can include skia/gyp/core.gypi
-        'skia_src_path': '../third_party/skia/src',
-        'skia_include_path': '../third_party/skia/include',
-      },
-
-      'includes': [
-        '../third_party/skia/gyp/core.gypi',
-        '../third_party/skia/gyp/effects.gypi',
-      ],
-
-      'sources': [
-        # this should likely be moved into src/utils in skia
-        '../third_party/skia/src/core/SkFlate.cpp',
-        # We don't want to add this to Skia's core.gypi since it is
-        # Android only. Include it here and remove it for everyone
-        # but Android later.
-        '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
-
-        '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
-        #'../third_party/skia/src/images/bmpdecoderhelper.cpp',
-        #'../third_party/skia/src/images/bmpdecoderhelper.h',
-        #'../third_party/skia/src/images/SkFDStream.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_FactoryDefault.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_FactoryRegistrar.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_fpdfemb.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libbmp.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libgif.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libico.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libjpeg.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libpng.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_libpvjpeg.cpp',
-        #'../third_party/skia/src/images/SkImageDecoder_wbmp.cpp',
-        #'../third_party/skia/src/images/SkImageEncoder.cpp',
-        #'../third_party/skia/src/images/SkImageEncoder_Factory.cpp',
-        #'../third_party/skia/src/images/SkImageRef.cpp',
-        #'../third_party/skia/src/images/SkImageRefPool.cpp',
-        #'../third_party/skia/src/images/SkImageRefPool.h',
-        #'../third_party/skia/src/images/SkImageRef_GlobalPool.cpp',
-        #'../third_party/skia/src/images/SkMovie.cpp',
-        #'../third_party/skia/src/images/SkMovie_gif.cpp',
-        '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
-        '../third_party/skia/src/images/SkScaledBitmapSampler.h',
-
-        '../third_party/skia/src/opts/opts_check_SSE2.cpp',
-
-        '../third_party/skia/src/pdf/SkPDFCatalog.cpp',
-        '../third_party/skia/src/pdf/SkPDFCatalog.h',
-        '../third_party/skia/src/pdf/SkPDFDevice.cpp',
-        '../third_party/skia/src/pdf/SkPDFDocument.cpp',
-        '../third_party/skia/src/pdf/SkPDFFont.cpp',
-        '../third_party/skia/src/pdf/SkPDFFont.h',
-        '../third_party/skia/src/pdf/SkPDFFormXObject.cpp',
-        '../third_party/skia/src/pdf/SkPDFFormXObject.h',
-        '../third_party/skia/src/pdf/SkPDFGraphicState.cpp',
-        '../third_party/skia/src/pdf/SkPDFGraphicState.h',
-        '../third_party/skia/src/pdf/SkPDFImage.cpp',
-        '../third_party/skia/src/pdf/SkPDFImage.h',
-        '../third_party/skia/src/pdf/SkPDFImageStream.cpp',
-        '../third_party/skia/src/pdf/SkPDFImageStream.h',
-        '../third_party/skia/src/pdf/SkPDFPage.cpp',
-        '../third_party/skia/src/pdf/SkPDFPage.h',
-        '../third_party/skia/src/pdf/SkPDFShader.cpp',
-        '../third_party/skia/src/pdf/SkPDFShader.h',
-        '../third_party/skia/src/pdf/SkPDFStream.cpp',
-        '../third_party/skia/src/pdf/SkPDFStream.h',
-        '../third_party/skia/src/pdf/SkPDFTypes.cpp',
-        '../third_party/skia/src/pdf/SkPDFTypes.h',
-        '../third_party/skia/src/pdf/SkPDFUtils.cpp',
-        '../third_party/skia/src/pdf/SkPDFUtils.h',
-
-        #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_android.cpp',
-        #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_mac.cpp',
-        '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
-
-        '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
-        #'../third_party/skia/src/ports/SkFontHost_FONTPATH.cpp',
-        '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
-        '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
-        '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
-        '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
-        #'../third_party/skia/src/ports/SkFontHost_ascender.cpp',
-        #'../third_party/skia/src/ports/SkFontHost_linux.cpp',
-        '../third_party/skia/src/ports/SkFontHost_mac.cpp',
-        #'../third_party/skia/src/ports/SkFontHost_none.cpp',
-        '../third_party/skia/src/ports/SkFontHost_win.cpp',
-        '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
-        #'../third_party/skia/src/ports/SkImageDecoder_CG.cpp',
-        #'../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
-        #'../third_party/skia/src/ports/SkImageRef_ashmem.cpp',
-        #'../third_party/skia/src/ports/SkImageRef_ashmem.h',
-        #'../third_party/skia/src/ports/SkOSEvent_android.cpp',
-        #'../third_party/skia/src/ports/SkOSEvent_dummy.cpp',
-        '../third_party/skia/src/ports/SkOSFile_posix.cpp',
-        '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
-        '../third_party/skia/src/ports/SkOSFile_win.cpp', 
-        #'../third_party/skia/src/ports/SkThread_none.cpp',
-        '../third_party/skia/src/ports/SkThread_pthread.cpp',
-        '../third_party/skia/src/ports/SkTLS_pthread.cpp',
-        '../third_party/skia/src/ports/SkThread_win.cpp',
-        '../third_party/skia/src/ports/SkTLS_win.cpp',
-        '../third_party/skia/src/ports/SkTime_Unix.cpp',
-        #'../third_party/skia/src/ports/SkXMLParser_empty.cpp',
-        #'../third_party/skia/src/ports/SkXMLParser_expat.cpp',
-        #'../third_party/skia/src/ports/SkXMLParser_tinyxml.cpp',
-        #'../third_party/skia/src/ports/SkXMLPullParser_expat.cpp',
-
-        '../third_party/skia/src/sfnt/SkOTUtils.cpp',
-        '../third_party/skia/src/sfnt/SkOTUtils.h',
-
-        '../third_party/skia/include/utils/mac/SkCGUtils.h',
-        '../third_party/skia/include/utils/SkDeferredCanvas.h',
-        '../third_party/skia/include/utils/SkMatrix44.h',
-        '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
-        '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
-        '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
-        '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
-        '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
-        '../third_party/skia/src/utils/debugger/SkObjectParser.h',
-        '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
-        '../third_party/skia/src/utils/SkBase64.cpp',
-        '../third_party/skia/src/utils/SkBase64.h',
-        '../third_party/skia/src/utils/SkBitSet.cpp',
-        '../third_party/skia/src/utils/SkBitSet.h',
-        '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
-        '../third_party/skia/src/utils/SkMatrix44.cpp',
-        '../third_party/skia/src/utils/SkNullCanvas.cpp',
-        '../third_party/skia/include/utils/SkNWayCanvas.h',
-        '../third_party/skia/src/utils/SkNWayCanvas.cpp',
-        '../third_party/skia/src/utils/SkPictureUtils.cpp',
-        '../third_party/skia/src/utils/SkRTConf.cpp',
-        '../third_party/skia/include/utils/SkRTConf.h',
-        '../third_party/skia/include/pdf/SkPDFDevice.h',
-        '../third_party/skia/include/pdf/SkPDFDocument.h',
-
-        '../third_party/skia/include/ports/SkTypeface_win.h',
-
-        #'../third_party/skia/include/images/SkImageDecoder.h',
-        #'../third_party/skia/include/images/SkImageEncoder.h',
-        '../third_party/skia/include/images/SkImageRef.h',
-        '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
-        '../third_party/skia/include/images/SkMovie.h',
-        '../third_party/skia/include/images/SkPageFlipper.h',
-
-        '../third_party/skia/include/utils/SkNullCanvas.h',
-        '../third_party/skia/include/utils/SkPictureUtils.h',
-        'ext/analysis_canvas.cc',
-        'ext/analysis_canvas.h',
-        'ext/bitmap_platform_device.h',
-        'ext/bitmap_platform_device_android.cc',
-        'ext/bitmap_platform_device_android.h',
-        'ext/bitmap_platform_device_data.h',
-        'ext/bitmap_platform_device_linux.cc',
-        'ext/bitmap_platform_device_linux.h',
-        'ext/bitmap_platform_device_mac.cc',
-        'ext/bitmap_platform_device_mac.h',
-        'ext/bitmap_platform_device_win.cc',
-        'ext/bitmap_platform_device_win.h',
-        'ext/convolver.cc',
-        'ext/convolver.h',
-        'ext/google_logging.cc',
-        'ext/image_operations.cc',
-        'ext/image_operations.h',
-        'ext/lazy_pixel_ref.cc',
-        'ext/lazy_pixel_ref.h',
-        'ext/lazy_pixel_ref_utils.cc',
-        'ext/lazy_pixel_ref_utils.h',
-        'ext/SkThread_chrome.cc',
-        'ext/paint_simplifier.cc',
-        'ext/paint_simplifier.h',
-        'ext/platform_canvas.cc',
-        'ext/platform_canvas.h',
-        'ext/platform_device.cc',
-        'ext/platform_device.h',
-        'ext/platform_device_linux.cc',
-        'ext/platform_device_mac.cc',
-        'ext/platform_device_win.cc',
-        'ext/recursive_gaussian_convolution.cc',
-        'ext/recursive_gaussian_convolution.h',
-        'ext/refptr.h',
-        'ext/SkMemory_new_handler.cpp',
-        'ext/skia_trace_shim.h',
-        'ext/skia_utils_base.cc',
-        'ext/skia_utils_base.h',
-        'ext/skia_utils_ios.mm',
-        'ext/skia_utils_ios.h',
-        'ext/skia_utils_mac.mm',
-        'ext/skia_utils_mac.h',
-        'ext/skia_utils_win.cc',
-        'ext/skia_utils_win.h',
-        'ext/vector_canvas.cc',
-        'ext/vector_canvas.h',
-        'ext/vector_platform_device_emf_win.cc',
-        'ext/vector_platform_device_emf_win.h',
-        'ext/vector_platform_device_skia.cc',
-        'ext/vector_platform_device_skia.h',
-      ],
-      'include_dirs': [
-        '..',
-        'config',
-        '../third_party/skia/include/config',
-        '../third_party/skia/include/core',
-        '../third_party/skia/include/effects',
-        '../third_party/skia/include/images',
-        '../third_party/skia/include/lazy',
-        '../third_party/skia/include/pathops',
-        '../third_party/skia/include/pdf',
-        '../third_party/skia/include/pipe',
-        '../third_party/skia/include/ports',
-        '../third_party/skia/include/utils',
-        '../third_party/skia/src/core',
-        '../third_party/skia/src/image',
-        '../third_party/skia/src/sfnt',
-        '../third_party/skia/src/utils',
-        '../third_party/skia/src/lazy',
-      ],
-      'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],
-      'defines': [
-        #'SK_GAMMA_SRGB',
-        #'SK_GAMMA_APPLY_TO_A8',
-        'SK_BUILD_NO_IMAGE_ENCODE',
-        'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
-        'GR_STATIC_RECT_VB=1',
-        'GR_AGGRESSIVE_SHADER_OPTS=1',
-        'SK_DEFERRED_CANVAS_USES_GPIPE=1',
-        'SK_ENABLE_INST_COUNT=0',
-
-        # this flag can be removed entirely once this has baked for a while
-        'SK_ALLOW_OVER_32K_BITMAPS',
-
-        # skia uses static initializers to initialize the serialization logic
-        # of its "pictures" library. This is currently not used in chrome; if
-        # it ever gets used the processes that use it need to call
-        # SkGraphics::Init().
-        'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
-
-        # Disable this check because it is too strict for some Chromium-specific
-        # subclasses of SkPixelRef. See bug: crbug.com/171776.
-        'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
-
-        'IGNORE_ROT_AA_RECT_OPT',
-      ],
-      'sources!': [
-        '../third_party/skia/include/core/SkTypes.h',
-      ],
-      'conditions': [
-        ['skia_support_gpu != 0', {
+  'conditions': [
+    # In component mode (shared_lib), we build all of content as a single DLL.
+    # However, in the static mode, we need to build content as multiple targets
+    # in order to support the use case where a platform (e.g. Android) may
+    # already have a copy of skia as a system library.
+    ['component=="static_library"', {
+      'targets': [
+        {
+          'target_name': 'skia',
+          'type': 'none',
+          'dependencies': [
+            'skia_library',
+            'skia_chrome',
+          ],
+          'export_dependent_settings': [
+            'skia_library',
+            'skia_chrome',
+          ],
+        },
+        {
+          'target_name': 'skia_library',
+          'type': 'static_library',
           'includes': [
-            '../third_party/skia/gyp/gpu.gypi',
+            'skia_library.gypi',
+            'skia_common.gypi',
           ],
-          'sources': [
-            '<@(skgpu_sources)',
-          ],
-          'include_dirs': [
-            '../third_party/skia/include/gpu',
-            '../third_party/skia/include/gpu/gl',
-            '../third_party/skia/src/gpu',
-          ],
-        }, {  # skia_support_gpu == 0
-          'defines': [
-            'SK_SUPPORT_GPU=0',
-          ],
-        }],
-        #Settings for text blitting, chosen to approximate the system browser.
-        [ 'OS == "linux"', {
-          'defines': [
-            'SK_GAMMA_EXPONENT=1.2',
-            'SK_GAMMA_CONTRAST=0.2',
-          ],
-        }],
-        ['OS == "android"', {
-          'defines': [
-            'SK_GAMMA_APPLY_TO_A8',
-            'SK_GAMMA_EXPONENT=1.4',
-            'SK_GAMMA_CONTRAST=0.0',
-          ],
-        }],
-        ['OS == "win"', {
-          'defines': [
-            'SK_GAMMA_SRGB',
-            'SK_GAMMA_CONTRAST=0.5',
-          ],
-        }],
-        ['OS == "mac"', {
-          'defines': [
-            'SK_GAMMA_SRGB',
-            'SK_GAMMA_CONTRAST=0.0',
-          ],
-        }],
-
-        # For POSIX platforms, prefer the Mutex implementation provided by Skia
-        # since it does not generate static initializers.
-        [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
-          'defines+': [
-            'SK_USE_POSIX_THREADS',
-          ],
-          'direct_dependent_settings': {
-            'defines': [
-              'SK_USE_POSIX_THREADS',
-            ],
-          },
-          'sources!': [
-            'ext/SkThread_chrome.cc',
-          ],
-        }],
-        [ 'OS != "android"', {
-          'sources/': [
-            ['exclude', '_android\\.(cc|cpp)$'],
-          ],
-          'sources!': [
-            '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
-          ],
-          'defines': [
-            'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
-          ],
-        }],
-        [ 'OS != "ios"', {
-          'sources/': [
-            ['exclude', '_ios\\.(cc|cpp|mm?)$'],
-          ],
-          'dependencies': [
-            '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp:skia_webkit',
-          ],
-        }],
-        [ 'OS != "mac"', {
-          'sources/': [
-            ['exclude', '_mac\\.(cc|cpp|mm?)$'],
-            ['exclude', '/mac/']
-          ],
-        }],
-        [ 'OS != "win"', {
-          'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
-        }],
-        [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
-          'defines': [
-            '__ARM_HAVE_NEON',
-          ],
-        }],
-        [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
-          'defines': [
-            '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
-          ],
-        }],
-        [ 'OS == "android" and target_arch == "arm"', {
-          'sources': [
-            '../third_party/skia/src/core/SkUtilsArm.cpp',
-          ],
+        },
+        {
+          'target_name': 'skia_chrome',
+          'type': 'static_library',
           'includes': [
-            '../build/android/cpufeatures.gypi',
+            'skia_chrome.gypi',
+            'skia_common.gypi',
           ],
-        }],
-        [ 'target_arch == "arm" or target_arch == "mipsel"', {
-          'sources!': [
-            '../third_party/skia/src/opts/opts_check_SSE2.cpp'
-          ],
-        }],
-        [ 'use_glib == 1', {
-          'dependencies': [
-            '../build/linux/system.gyp:fontconfig',
-            '../build/linux/system.gyp:freetype2',
-            '../build/linux/system.gyp:pangocairo',
-            '../third_party/icu/icu.gyp:icuuc',
-          ],
-          'cflags': [
-            '-Wno-unused',
-            '-Wno-unused-function',
-          ],
-          'sources': [
-            '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
-            '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
-            '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
-          ],
-          'defines': [
-#            'SK_USE_COLOR_LUMINANCE',
-          ],
-        }],
-        [ 'use_glib == 0 and OS != "android"', {
-          'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
-          'sources!': [
-            '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
-            '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
-          ],
-        }],
-        [ 'toolkit_uses_gtk == 1', {
-          'dependencies': [
-            '../build/linux/system.gyp:gdk',
-          ],
-        }, {  # toolkit_uses_gtk == 0
-          'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ],
-        }],
-        [ 'OS == "android"', {
-          'sources': [
-            '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
-          ],
-          'sources/': [
-            ['exclude', '_linux\\.(cc|cpp)$'],
-          ],
-          'conditions': [
-            [ '_toolset == "target"', {
-              'defines': [
-                'HAVE_PTHREADS',
-                'OS_ANDROID',
-                'SK_BUILD_FOR_ANDROID',
-                # Android devices are typically more memory constrained, so
-                # use a smaller glyph cache.
-                'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)',
-                'USE_CHROMIUM_SKIA',
-              ],
-              'dependencies': [
-                '../third_party/expat/expat.gyp:expat',
-                '../third_party/freetype/freetype.gyp:ft2',
-                'skia_opts'
-              ],
-              'dependencies!': [
-                # Android doesn't use Skia's PDF generation, which is what uses
-                # sfntly.
-                '../third_party/sfntly/sfntly.gyp:sfntly',
-              ],
-              # This exports a hard dependency because it needs to run its
-              # symlink action in order to expose the skia header files.
-              'hard_dependency': 1,
-              'include_dirs': [
-                '../third_party/expat/files/lib',
-              ],
-              'sources/': [
-                ['include', 'ext/platform_device_linux\\.cc$'],
-                ['exclude', '../third_party/skia/src/pdf/'],
-              ],
-              'sources!': [
-                'ext/vector_platform_device_skia.cc',
-              ],
-            }],
-            [ '_toolset == "target" and android_webview_build == 0', {
-              'defines': [
-                'HAVE_ENDIAN_H',
-              ],
-            }],
-            [ '_toolset=="host" and host_os=="linux"', {
-              'sources': [
-                'ext/platform_device_linux.cc',
-              ],
-            }],
-          ],
-        }],
-        [ 'OS == "ios"', {
-          'defines': [
-            'SK_BUILD_FOR_IOS',
-            'SK_USE_MAC_CORE_TEXT',
-          ],
-          'include_dirs': [
-            '../third_party/skia/include/utils/ios',
-            '../third_party/skia/include/utils/mac',
-          ],
-          'link_settings': {
-            'libraries': [
-              '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
-            ],
-          },
-          'dependencies': [
-            'skia_opts_ios',
-          ],
-          'dependencies!': [
-            'skia_opts',
-            '../third_party/sfntly/sfntly.gyp:sfntly',
-          ],
-          'sources': [
-            # This file is used on both iOS and Mac, so it should be removed
-            #  from the ios and mac conditions and moved into the main sources
-            #  list.
-            '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
-          ],
-          'sources/': [
-            ['exclude', '/pdf/'],
-            ['exclude', '^ext/vector_platform_device_skia\\.'],
-            ['exclude', 'opts_check_SSE2\\.cpp$'],
-          ],
-        }],
-        [ 'OS == "mac"', {
-          'defines': [
-            'SK_BUILD_FOR_MAC',
-            'SK_USE_MAC_CORE_TEXT',
-#           'SK_USE_COLOR_LUMINANCE',
-          ],
-          'include_dirs': [
-            '../third_party/skia/include/utils/mac',
-          ],
-          'link_settings': {
-            'libraries': [
-              '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
-            ],
-          },
-          'sources': [
-            '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
-          ],
-        }],
-        [ 'OS == "win"', {
-          'sources!': [
-            '../third_party/skia/src/ports/SkOSFile_posix.cpp',
-            '../third_party/skia/src/ports/SkThread_pthread.cpp',
-            '../third_party/skia/src/ports/SkTLS_pthread.cpp',
-            '../third_party/skia/src/ports/SkTime_Unix.cpp',
-            'ext/SkThread_chrome.cc',
-          ],
-          'include_dirs': [
-            'config/win',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              'config/win',
-            ],
-          },
-        }],
-        ['component=="shared_library"', {
-          'defines': [
-            'GR_DLL=1',
-            'GR_IMPLEMENTATION=1',
-            'SKIA_DLL',
-            'SKIA_IMPLEMENTATION=1',
-          ],
-          'dependencies': [
-            '../base/base.gyp:base',
-          ],
-          'direct_dependent_settings': {
-            'defines': [
-              'GR_DLL',
-              'SKIA_DLL',
-            ],
-          },
-        }],
-        # TODO(scottmg): http://crbug.com/177306
-        ['clang==1', {
-          'xcode_settings': {
-            'WARNING_CFLAGS!': [
-              # Don't warn about string->bool used in asserts.
-              '-Wstring-conversion',
-            ],
-          },
-          'cflags!': [
-            '-Wstring-conversion',
-          ],
-        }],
-      ],
-      'dependencies': [
-        'skia_opts',
-        '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
-        '../third_party/sfntly/sfntly.gyp:sfntly',
-        '../third_party/zlib/zlib.gyp:zlib',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          'config',
-
-          #temporary until we can hide SkFontHost
-          '../third_party/skia/src/core',
-
-          '../third_party/skia/include/config',
-          '../third_party/skia/include/core',
-          '../third_party/skia/include/effects',
-          '../third_party/skia/include/pdf',
-          '../third_party/skia/include/gpu',
-          '../third_party/skia/include/gpu/gl',
-          '../third_party/skia/include/lazy',
-          '../third_party/skia/include/pathops',
-          '../third_party/skia/include/pipe',
-          '../third_party/skia/include/ports',
-          '../third_party/skia/include/utils',
-          'ext',
-        ],
-        'defines': [
-          'SK_BUILD_NO_IMAGE_ENCODE',
-          'SK_DEFERRED_CANVAS_USES_GPIPE=1',
-          'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
-          'GR_AGGRESSIVE_SHADER_OPTS=1',
-          'SK_ENABLE_INST_COUNT=0',
-        ],
-        'conditions': [
-          ['OS=="android"', {
-            'dependencies!': [
-              'skia_opts',
-              '../third_party/zlib/zlib.gyp:zlib',
-            ],
-            'defines': [
-              # Don't use non-NDK available stuff.
-              'SK_BUILD_FOR_ANDROID',
-            ],
-            'conditions': [
-              [ '_toolset == "target" and android_webview_build == 0', {
-                'defines': [
-                  'HAVE_ENDIAN_H',
-                ],
-              }],
-            ],
-          }],
-          ['OS=="mac"', {
-            'include_dirs': [
-              '../third_party/skia/include/utils/mac',
-            ],
-          }],
-        ],
-      },
-      'target_conditions': [
-        # Pull in specific Mac files for iOS (which have been filtered out
-        # by file name rules).
-        [ 'OS == "ios"', {
-          'sources/': [
-            ['include', 'SkFontHost_mac\\.cpp$',],
-            ['include', 'SkStream_mac\\.cpp$',],
-            ['include', 'SkCreateCGImageRef\\.cpp$',],
-          ],
-        }],
+        },
       ],
     },
-
-    # Due to an unfortunate intersection of lameness between gcc and gyp,
-    # we have to build the *_SSE2.cpp files in a separate target.  The
-    # gcc lameness is that, in order to compile SSE2 intrinsics code, it
-    # must be passed the -msse2 flag.  However, with this flag, it may
-    # emit SSE2 instructions even for scalar code, such as the CPUID
-    # test used to test for the presence of SSE2.  So that, and all other
-    # code must be compiled *without* -msse2.  The gyp lameness is that it
-    # does not allow file-specific CFLAGS, so we must create this extra
-    # target for those files to be compiled with -msse2.
-    #
-    # This is actually only a problem on 32-bit Linux (all Intel Macs have
-    # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
-    # SSE2 from instrinsics, which generating plain ol' 386 for everything
-    # else).  However, to keep the .gyp file simple and avoid platform-specific
-    # build breakage, we do this on all platforms.
-
-    # For about the same reason, we need to compile the ARM opts files
-    # separately as well.
+    {  # component != static_library
+      'targets': [
+        {
+          'target_name': 'skia',
+          'type': 'shared_library',
+          'includes': [
+            'skia_library.gypi',
+            'skia_chrome.gypi',
+            'skia_common.gypi',
+          ],
+          'defines': [
+            'SKIA_DLL',
+            'GR_DLL=1',
+            'GR_IMPLEMENTATION=1',
+            'SKIA_IMPLEMENTATION=1',
+          ],
+          'direct_dependent_settings': {
+            'defines': [
+              'SKIA_DLL',
+              'GR_DLL=1',
+            ],
+          },
+        },
+        {
+          'target_name': 'skia_library',
+          'type': 'none',
+        },
+        {
+          'target_name': 'skia_chrome',
+          'type': 'none',
+        },
+      ],
+    }],
+  ],
+  
+  # targets that are not dependent upon the component type
+  'targets': [
     {
-      'target_name': 'skia_opts',
+      'target_name': 'skia_chrome_opts',
       'type': 'static_library',
-      'variables': {
-        'optimize': 'max',
-      },
       'include_dirs': [
         '..',
         'config',
         '../third_party/skia/include/config',
         '../third_party/skia/include/core',
-        '../third_party/skia/include/effects',
-        '../third_party/skia/include/images',
-        '../third_party/skia/include/lazy',
-        '../third_party/skia/include/pathops',
-        '../third_party/skia/include/utils',
-        '../third_party/skia/src/core',
       ],
       'conditions': [
         [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
-           target_arch != "arm" and target_arch != "mipsel"', {
+            target_arch != "arm" and target_arch != "mipsel"', {
           'cflags': [
             '-msse2',
           ],
         }],
-        [ 'OS == "android"', {
-          'defines': [
-            'SK_BUILD_FOR_ANDROID',
-          ],
-        }],
         [ 'target_arch != "arm" and target_arch != "mipsel"', {
           'sources': [
-            '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
-            '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
-            '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
-            '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
-            '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp',
             'ext/convolver_SSE2.cc',
           ],
-          'conditions': [
-            # x86 Android doesn't support SSSE3 instructions.
-            [ 'OS != "android"', {
-              'dependencies': [
-                'skia_opts_ssse3',
-              ],
-            }],
-          ],
-        }],
-        [ 'target_arch == "arm"', {
-          'conditions': [
-            [ 'arm_version >= 7 and arm_neon == 1', {
-              'defines': [
-                '__ARM_HAVE_NEON',
-              ],
-            }],
-            [ 'arm_version >= 7 and arm_neon_optional == 1', {
-              'defines': [
-                '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
-              ],
-            }],
-            [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
-              'cflags': [
-                # The neon assembly contains conditional instructions which
-                # aren't enclosed in an IT block. The assembler complains
-                # without this option.
-                # See #86592.
-                '-Wa,-mimplicit-it=always',
-              ],
-              'dependencies': [
-                'skia_opts_neon',
-              ]
-           }],
-          ],
-          # The assembly uses the frame pointer register (r7 in Thumb/r11 in
-          # ARM), the compiler doesn't like that. Explicitly remove the
-          # -fno-omit-frame-pointer flag for Android, as that gets added to all
-          # targets via common.gypi.
-          'cflags!': [
-            '-fno-omit-frame-pointer',
-            '-marm',
-            '-mapcs-frame',
-          ],
-          'cflags': [
-            '-fomit-frame-pointer',
-          ],
-          'sources': [
-            '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
-          ],
-        }],
-        [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_neon_optional == 1))', {
-          'sources': [
-            '../third_party/skia/src/opts/memset.arm.S',
-          ],
-        }],
-        [ 'target_arch == "arm" and arm_version < 6', {
-          'sources': [
-            '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
-            '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
-          ],
-        }],
-        [ 'target_arch == "arm" and arm_version >= 6', {
-          'sources': [
-            '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
-            '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
-            '../third_party/skia/src/opts/opts_check_arm.cpp',
-          ],
         }],
         [ 'target_arch == "mipsel"',{
           'cflags': [
             '-fomit-frame-pointer',
           ],
           'sources': [
-            '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
-            '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
-            '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
             'ext/convolver_mips_dspr2.cc',
           ],
         }],
       ],
     },
-    # For the same lame reasons as what is done for skia_opts, we have to
-    # create another target specifically for SSSE3 code as we would not want
-    # to compile the SSE2 code with -mssse3 which would potentially allow
-    # gcc to generate SSSE3 code.
-    {
-      'target_name': 'skia_opts_ssse3',
-      'type': 'static_library',
-      'variables': {
-        'optimize': 'max',
-      },
-      'include_dirs': [
-        '..',
-        'config',
-        '../third_party/skia/include/config',
-        '../third_party/skia/include/core',
-        '../third_party/skia/include/pathops',
-        '../third_party/skia/src/core',
-      ],
-      'conditions': [
-        [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
-          'cflags': [
-            '-mssse3',
-          ],
-        }],
-        [ 'OS == "mac"', {
-          'xcode_settings': {
-            'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
-          },
-        }],
-        [ 'OS == "win"', {
-          'include_dirs': [
-            'config/win',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              'config/win',
-            ],
-          },
-        }],
-        [ 'target_arch != "arm" and target_arch != "mipsel"', {
-          'sources': [
-            '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
-          ],
-        }],
-      ],
-    },
-    # NEON code must be compiled with -mfpu=neon which also affects scalar
-    # code. To support dynamic NEON code paths, we need to build all
-    # NEON-specific sources in a separate static library. The situation
-    # is very similar to the SSSE3 one.
-    {
-      'target_name': 'skia_opts_neon',
-      'type': 'static_library',
-      'include_dirs': [
-        '..',
-        'config',
-        '../third_party/skia/include/config',
-        '../third_party/skia/include/core',
-        '../third_party/skia/src/core',
-        '../third_party/skia/src/opts',
-      ],
-      'cflags!': [
-        '-fno-omit-frame-pointer',
-        '-mfpu=vfp',  # remove them all, just in case.
-        '-mfpu=vfpv3',
-        '-mfpu=vfpv3-d16',
-      ],
-      'cflags': [
-        '-mfpu=neon',
-        '-fomit-frame-pointer',
-      ],
-      'ldflags': [
-        '-march=armv7-a',
-        '-Wl,--fix-cortex-a8',
-      ],
-      'conditions': [
-        ['arm_neon == 1', {
-          'defines': [
-            '__ARM_HAVE_NEON',
-          ],
-        }],
-        ['arm_neon_optional == 1', {
-          'defines': [
-            '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
-          ],
-        }],
-        ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', {
-          'sources': [
-            '../third_party/skia/src/opts/memset16_neon.S',
-            '../third_party/skia/src/opts/memset32_neon.S',
-            '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
-            '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
-            '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h',
-            '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h',
-            '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
-          ],
-        }],
-      ],
-    },
     {
       'target_name': 'image_operations_bench',
       'type': 'executable',
@@ -883,36 +123,4 @@
       ],
     },
   ],
-  'conditions': [
-    ['OS=="ios"', {
-      'targets': [
-        # The main skia_opts target does not currently work on iOS because the
-        # target architecture on iOS is determined at compile time rather than
-        # gyp time (simulator builds are x86, device builds are arm).  As a
-        # temporary measure, this is a separate opts target for iOS-only, using
-        # the _none.cpp files to avoid architecture-dependent implementations.
-        {
-          'target_name': 'skia_opts_ios',
-          'type': 'static_library',
-          'include_dirs': [
-            '..',
-            'config',
-            '../third_party/skia/include/config',
-            '../third_party/skia/include/core',
-            '../third_party/skia/include/effects',
-            '../third_party/skia/include/images',
-            '../third_party/skia/include/lazy',
-            '../third_party/skia/include/pathops',
-            '../third_party/skia/include/utils',
-            '../third_party/skia/src/core',
-          ],
-          'sources': [
-            '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
-            '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
-            '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
-          ],
-        },
-      ],
-    }],
-  ],
 }
diff --git a/skia/skia.target.darwin-arm.mk b/skia/skia.target.darwin-arm.mk
index 8145a1e..96515a8 100644
--- a/skia/skia.target.darwin-arm.mk
+++ b/skia/skia.target.darwin-arm.mk
@@ -2,707 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/core/SkUtilsArm.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	cpufeatures
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -711,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia.target.darwin-mips.mk b/skia/skia.target.darwin-mips.mk
index 5e2ef97..96515a8 100644
--- a/skia/skia.target.darwin-mips.mk
+++ b/skia/skia.target.darwin-mips.mk
@@ -2,699 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-EL \
-	-mhard-float \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-uninitialized \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-EL \
-	-mhard-float \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-uninitialized \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES :=
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -703,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia.target.darwin-x86.mk b/skia/skia.target.darwin-x86.mk
index e79c2bc..96515a8 100644
--- a/skia/skia.target.darwin-x86.mk
+++ b/skia/skia.target.darwin-x86.mk
@@ -2,704 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/opts/opts_check_SSE2.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer \
-	-fno-unwind-tables \
-	-fno-asynchronous-unwind-tables
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES :=
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -708,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia.target.linux-arm.mk b/skia/skia.target.linux-arm.mk
index 8145a1e..96515a8 100644
--- a/skia/skia.target.linux-arm.mk
+++ b/skia/skia.target.linux-arm.mk
@@ -2,707 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/core/SkUtilsArm.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	cpufeatures
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -711,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia.target.linux-mips.mk b/skia/skia.target.linux-mips.mk
index 5e2ef97..96515a8 100644
--- a/skia/skia.target.linux-mips.mk
+++ b/skia/skia.target.linux-mips.mk
@@ -2,699 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-EL \
-	-mhard-float \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-uninitialized \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-EL \
-	-mhard-float \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-uninitialized \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES :=
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -703,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia.target.linux-x86.mk b/skia/skia.target.linux-x86.mk
index e79c2bc..96515a8 100644
--- a/skia/skia.target.linux-x86.mk
+++ b/skia/skia.target.linux-x86.mk
@@ -2,704 +2,25 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE_CLASS := GYP
 LOCAL_MODULE := skia_skia_gyp
-LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_STEM := skia
+LOCAL_MODULE_SUFFIX := .stamp
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
-	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_chrome_gyp)/skia_skia_chrome_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/analysis_canvas.cpp: $(LOCAL_PATH)/skia/ext/analysis_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp: $(LOCAL_PATH)/skia/ext/bitmap_platform_device_android.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/convolver.cpp: $(LOCAL_PATH)/skia/ext/convolver.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/google_logging.cpp: $(LOCAL_PATH)/skia/ext/google_logging.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/image_operations.cpp: $(LOCAL_PATH)/skia/ext/image_operations.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp: $(LOCAL_PATH)/skia/ext/lazy_pixel_ref_utils.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/paint_simplifier.cpp: $(LOCAL_PATH)/skia/ext/paint_simplifier.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_canvas.cpp: $(LOCAL_PATH)/skia/ext/platform_canvas.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device.cpp: $(LOCAL_PATH)/skia/ext/platform_device.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/platform_device_linux.cpp: $(LOCAL_PATH)/skia/ext/platform_device_linux.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp: $(LOCAL_PATH)/skia/ext/recursive_gaussian_convolution.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/skia_utils_base.cpp: $(LOCAL_PATH)/skia/ext/skia_utils_base.cc
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/vector_canvas.cpp: $(LOCAL_PATH)/skia/ext/vector_canvas.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/analysis_canvas.cpp \
-	$(gyp_intermediate_dir)/bitmap_platform_device_android.cpp \
-	$(gyp_intermediate_dir)/convolver.cpp \
-	$(gyp_intermediate_dir)/google_logging.cpp \
-	$(gyp_intermediate_dir)/image_operations.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref.cpp \
-	$(gyp_intermediate_dir)/lazy_pixel_ref_utils.cpp \
-	$(gyp_intermediate_dir)/paint_simplifier.cpp \
-	$(gyp_intermediate_dir)/platform_canvas.cpp \
-	$(gyp_intermediate_dir)/platform_device.cpp \
-	$(gyp_intermediate_dir)/platform_device_linux.cpp \
-	$(gyp_intermediate_dir)/recursive_gaussian_convolution.cpp \
-	$(gyp_intermediate_dir)/skia_utils_base.cpp \
-	$(gyp_intermediate_dir)/vector_canvas.cpp
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
-
-LOCAL_SRC_FILES := \
-	third_party/skia/src/core/SkFlate.cpp \
-	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
-	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
-	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
-	third_party/skia/src/opts/opts_check_SSE2.cpp \
-	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
-	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
-	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
-	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
-	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
-	third_party/skia/src/ports/SkOSFile_posix.cpp \
-	third_party/skia/src/ports/SkOSFile_stdio.cpp \
-	third_party/skia/src/ports/SkThread_pthread.cpp \
-	third_party/skia/src/ports/SkTLS_pthread.cpp \
-	third_party/skia/src/ports/SkTime_Unix.cpp \
-	third_party/skia/src/sfnt/SkOTUtils.cpp \
-	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
-	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
-	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
-	third_party/skia/src/utils/SkBase64.cpp \
-	third_party/skia/src/utils/SkBitSet.cpp \
-	third_party/skia/src/utils/SkDeferredCanvas.cpp \
-	third_party/skia/src/utils/SkMatrix44.cpp \
-	third_party/skia/src/utils/SkNullCanvas.cpp \
-	third_party/skia/src/utils/SkNWayCanvas.cpp \
-	third_party/skia/src/utils/SkPictureUtils.cpp \
-	third_party/skia/src/utils/SkRTConf.cpp \
-	skia/ext/SkMemory_new_handler.cpp \
-	third_party/skia/src/core/Sk64.cpp \
-	third_party/skia/src/core/SkAAClip.cpp \
-	third_party/skia/src/core/SkAnnotation.cpp \
-	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
-	third_party/skia/src/core/SkAlphaRuns.cpp \
-	third_party/skia/src/core/SkBBoxHierarchy.cpp \
-	third_party/skia/src/core/SkBBoxRecord.cpp \
-	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
-	third_party/skia/src/core/SkBitmap.cpp \
-	third_party/skia/src/core/SkBitmapFilter.cpp \
-	third_party/skia/src/core/SkBitmapHeap.cpp \
-	third_party/skia/src/core/SkBitmapProcShader.cpp \
-	third_party/skia/src/core/SkBitmapProcState.cpp \
-	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
-	third_party/skia/src/core/SkBitmap_scroll.cpp \
-	third_party/skia/src/core/SkBlitMask_D32.cpp \
-	third_party/skia/src/core/SkBlitRow_D16.cpp \
-	third_party/skia/src/core/SkBlitRow_D32.cpp \
-	third_party/skia/src/core/SkBlitter.cpp \
-	third_party/skia/src/core/SkBlitter_A1.cpp \
-	third_party/skia/src/core/SkBlitter_A8.cpp \
-	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkBlitter_Sprite.cpp \
-	third_party/skia/src/core/SkBuffer.cpp \
-	third_party/skia/src/core/SkCanvas.cpp \
-	third_party/skia/src/core/SkChunkAlloc.cpp \
-	third_party/skia/src/core/SkClipStack.cpp \
-	third_party/skia/src/core/SkColor.cpp \
-	third_party/skia/src/core/SkColorFilter.cpp \
-	third_party/skia/src/core/SkColorTable.cpp \
-	third_party/skia/src/core/SkComposeShader.cpp \
-	third_party/skia/src/core/SkConfig8888.cpp \
-	third_party/skia/src/core/SkCordic.cpp \
-	third_party/skia/src/core/SkCubicClipper.cpp \
-	third_party/skia/src/core/SkData.cpp \
-	third_party/skia/src/core/SkDataTable.cpp \
-	third_party/skia/src/core/SkDebug.cpp \
-	third_party/skia/src/core/SkDeque.cpp \
-	third_party/skia/src/core/SkDevice.cpp \
-	third_party/skia/src/core/SkDeviceProfile.cpp \
-	third_party/skia/src/core/SkDither.cpp \
-	third_party/skia/src/core/SkDraw.cpp \
-	third_party/skia/src/core/SkDrawLooper.cpp \
-	third_party/skia/src/core/SkEdgeBuilder.cpp \
-	third_party/skia/src/core/SkEdgeClipper.cpp \
-	third_party/skia/src/core/SkEdge.cpp \
-	third_party/skia/src/core/SkError.cpp \
-	third_party/skia/src/core/SkFilterProc.cpp \
-	third_party/skia/src/core/SkFilterShader.cpp \
-	third_party/skia/src/core/SkFlattenable.cpp \
-	third_party/skia/src/core/SkFlattenableBuffers.cpp \
-	third_party/skia/src/core/SkFloat.cpp \
-	third_party/skia/src/core/SkFloatBits.cpp \
-	third_party/skia/src/core/SkFontHost.cpp \
-	third_party/skia/src/core/SkFontDescriptor.cpp \
-	third_party/skia/src/core/SkFontStream.cpp \
-	third_party/skia/src/core/SkGeometry.cpp \
-	third_party/skia/src/core/SkGlyphCache.cpp \
-	third_party/skia/src/core/SkGraphics.cpp \
-	third_party/skia/src/core/SkInstCnt.cpp \
-	third_party/skia/src/core/SkImageFilter.cpp \
-	third_party/skia/src/core/SkImageFilterUtils.cpp \
-	third_party/skia/src/core/SkLineClipper.cpp \
-	third_party/skia/src/core/SkMallocPixelRef.cpp \
-	third_party/skia/src/core/SkMask.cpp \
-	third_party/skia/src/core/SkMaskFilter.cpp \
-	third_party/skia/src/core/SkMaskGamma.cpp \
-	third_party/skia/src/core/SkMath.cpp \
-	third_party/skia/src/core/SkMatrix.cpp \
-	third_party/skia/src/core/SkMetaData.cpp \
-	third_party/skia/src/core/SkMipMap.cpp \
-	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
-	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
-	third_party/skia/src/core/SkPackBits.cpp \
-	third_party/skia/src/core/SkPaint.cpp \
-	third_party/skia/src/core/SkPaintPriv.cpp \
-	third_party/skia/src/core/SkPath.cpp \
-	third_party/skia/src/core/SkPathEffect.cpp \
-	third_party/skia/src/core/SkPathHeap.cpp \
-	third_party/skia/src/core/SkPathMeasure.cpp \
-	third_party/skia/src/core/SkPicture.cpp \
-	third_party/skia/src/core/SkPictureFlat.cpp \
-	third_party/skia/src/core/SkPicturePlayback.cpp \
-	third_party/skia/src/core/SkPictureRecord.cpp \
-	third_party/skia/src/core/SkPictureStateTree.cpp \
-	third_party/skia/src/core/SkPixelRef.cpp \
-	third_party/skia/src/core/SkPoint.cpp \
-	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
-	third_party/skia/src/core/SkPtrRecorder.cpp \
-	third_party/skia/src/core/SkQuadClipper.cpp \
-	third_party/skia/src/core/SkRasterClip.cpp \
-	third_party/skia/src/core/SkRasterizer.cpp \
-	third_party/skia/src/core/SkRect.cpp \
-	third_party/skia/src/core/SkRefCnt.cpp \
-	third_party/skia/src/core/SkRefDict.cpp \
-	third_party/skia/src/core/SkRegion.cpp \
-	third_party/skia/src/core/SkRegion_path.cpp \
-	third_party/skia/src/core/SkRRect.cpp \
-	third_party/skia/src/core/SkRTree.cpp \
-	third_party/skia/src/core/SkScalar.cpp \
-	third_party/skia/src/core/SkScalerContext.cpp \
-	third_party/skia/src/core/SkScan.cpp \
-	third_party/skia/src/core/SkScan_AntiPath.cpp \
-	third_party/skia/src/core/SkScan_Antihair.cpp \
-	third_party/skia/src/core/SkScan_Hairline.cpp \
-	third_party/skia/src/core/SkScan_Path.cpp \
-	third_party/skia/src/core/SkShader.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
-	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
-	third_party/skia/src/core/SkStream.cpp \
-	third_party/skia/src/core/SkString.cpp \
-	third_party/skia/src/core/SkStringUtils.cpp \
-	third_party/skia/src/core/SkStroke.cpp \
-	third_party/skia/src/core/SkStrokeRec.cpp \
-	third_party/skia/src/core/SkStrokerPriv.cpp \
-	third_party/skia/src/core/SkTileGrid.cpp \
-	third_party/skia/src/core/SkTileGridPicture.cpp \
-	third_party/skia/src/core/SkTLS.cpp \
-	third_party/skia/src/core/SkTSearch.cpp \
-	third_party/skia/src/core/SkTypeface.cpp \
-	third_party/skia/src/core/SkTypefaceCache.cpp \
-	third_party/skia/src/core/SkUnPreMultiply.cpp \
-	third_party/skia/src/core/SkUtils.cpp \
-	third_party/skia/src/core/SkWriter32.cpp \
-	third_party/skia/src/core/SkXfermode.cpp \
-	third_party/skia/src/doc/SkDocument.cpp \
-	third_party/skia/src/image/SkDataPixelRef.cpp \
-	third_party/skia/src/image/SkImage.cpp \
-	third_party/skia/src/image/SkImagePriv.cpp \
-	third_party/skia/src/image/SkImage_Codec.cpp \
-	third_party/skia/src/image/SkImage_Picture.cpp \
-	third_party/skia/src/image/SkImage_Raster.cpp \
-	third_party/skia/src/image/SkSurface.cpp \
-	third_party/skia/src/image/SkSurface_Picture.cpp \
-	third_party/skia/src/image/SkSurface_Raster.cpp \
-	third_party/skia/src/pipe/SkGPipeRead.cpp \
-	third_party/skia/src/pipe/SkGPipeWrite.cpp \
-	third_party/skia/src/lazy/SkBitmapFactory.cpp \
-	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
-	third_party/skia/src/lazy/SkLruImageCache.cpp \
-	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
-	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
-	third_party/skia/src/pathops/SkAddIntersections.cpp \
-	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
-	third_party/skia/src/pathops/SkDLineIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
-	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
-	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
-	third_party/skia/src/pathops/SkIntersections.cpp \
-	third_party/skia/src/pathops/SkOpAngle.cpp \
-	third_party/skia/src/pathops/SkOpContour.cpp \
-	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
-	third_party/skia/src/pathops/SkOpSegment.cpp \
-	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
-	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
-	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
-	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
-	third_party/skia/src/pathops/SkPathOpsLine.cpp \
-	third_party/skia/src/pathops/SkPathOpsOp.cpp \
-	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
-	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
-	third_party/skia/src/pathops/SkPathOpsRect.cpp \
-	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
-	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
-	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
-	third_party/skia/src/pathops/SkPathWriter.cpp \
-	third_party/skia/src/pathops/SkQuarticRoot.cpp \
-	third_party/skia/src/pathops/SkReduceOrder.cpp \
-	third_party/skia/src/effects/Sk1DPathEffect.cpp \
-	third_party/skia/src/effects/Sk2DPathEffect.cpp \
-	third_party/skia/src/effects/SkArithmeticMode.cpp \
-	third_party/skia/src/effects/SkAvoidXfermode.cpp \
-	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
-	third_party/skia/src/effects/SkBitmapSource.cpp \
-	third_party/skia/src/effects/SkBlendImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
-	third_party/skia/src/effects/SkBlurMask.cpp \
-	third_party/skia/src/effects/SkBlurImageFilter.cpp \
-	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
-	third_party/skia/src/effects/SkColorFilters.cpp \
-	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
-	third_party/skia/src/effects/SkColorMatrix.cpp \
-	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
-	third_party/skia/src/effects/SkCornerPathEffect.cpp \
-	third_party/skia/src/effects/SkDashPathEffect.cpp \
-	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
-	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
-	third_party/skia/src/effects/SkEmbossMask.cpp \
-	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
-	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
-	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
-	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
-	third_party/skia/src/effects/SkLayerRasterizer.cpp \
-	third_party/skia/src/effects/SkLerpXfermode.cpp \
-	third_party/skia/src/effects/SkLightingImageFilter.cpp \
-	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
-	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
-	third_party/skia/src/effects/SkMergeImageFilter.cpp \
-	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
-	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
-	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
-	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
-	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
-	third_party/skia/src/effects/SkPorterDuff.cpp \
-	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
-	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
-	third_party/skia/src/effects/SkTableColorFilter.cpp \
-	third_party/skia/src/effects/SkTableMaskFilter.cpp \
-	third_party/skia/src/effects/SkTestImageFilters.cpp \
-	third_party/skia/src/effects/SkTransparentShader.cpp \
-	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
-	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
-	third_party/skia/src/effects/gradients/SkClampRange.cpp \
-	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
-	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
-	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
-	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
-	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
-	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
-	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
-	third_party/skia/src/gpu/GrAARectRenderer.cpp \
-	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
-	third_party/skia/src/gpu/GrAllocPool.cpp \
-	third_party/skia/src/gpu/GrAtlas.cpp \
-	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
-	third_party/skia/src/gpu/GrCacheID.cpp \
-	third_party/skia/src/gpu/GrClipData.cpp \
-	third_party/skia/src/gpu/GrContext.cpp \
-	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
-	third_party/skia/src/gpu/GrDrawState.cpp \
-	third_party/skia/src/gpu/GrDrawTarget.cpp \
-	third_party/skia/src/gpu/GrEffect.cpp \
-	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
-	third_party/skia/src/gpu/GrClipMaskCache.cpp \
-	third_party/skia/src/gpu/GrClipMaskManager.cpp \
-	third_party/skia/src/gpu/GrGpu.cpp \
-	third_party/skia/src/gpu/GrGpuFactory.cpp \
-	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
-	third_party/skia/src/gpu/GrMemory.cpp \
-	third_party/skia/src/gpu/GrMemoryPool.cpp \
-	third_party/skia/src/gpu/GrOvalRenderer.cpp \
-	third_party/skia/src/gpu/GrPaint.cpp \
-	third_party/skia/src/gpu/GrPath.cpp \
-	third_party/skia/src/gpu/GrPathRendererChain.cpp \
-	third_party/skia/src/gpu/GrPathRenderer.cpp \
-	third_party/skia/src/gpu/GrPathUtils.cpp \
-	third_party/skia/src/gpu/GrRectanizer.cpp \
-	third_party/skia/src/gpu/GrRenderTarget.cpp \
-	third_party/skia/src/gpu/GrReducedClip.cpp \
-	third_party/skia/src/gpu/GrResource.cpp \
-	third_party/skia/src/gpu/GrResourceCache.cpp \
-	third_party/skia/src/gpu/GrStencil.cpp \
-	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
-	third_party/skia/src/gpu/GrStencilBuffer.cpp \
-	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
-	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
-	third_party/skia/src/gpu/GrSurface.cpp \
-	third_party/skia/src/gpu/GrTextContext.cpp \
-	third_party/skia/src/gpu/GrTextStrike.cpp \
-	third_party/skia/src/gpu/GrTexture.cpp \
-	third_party/skia/src/gpu/GrTextureAccess.cpp \
-	third_party/skia/src/gpu/gr_unittests.cpp \
-	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
-	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
-	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
-	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
-	third_party/skia/src/gpu/gl/GrGLContext.cpp \
-	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
-	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
-	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
-	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
-	third_party/skia/src/gpu/gl/GrGLPath.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
-	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
-	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
-	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
-	third_party/skia/src/gpu/gl/GrGLSL.cpp \
-	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
-	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
-	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
-	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
-	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
-	third_party/skia/src/gpu/SkGpuDevice.cpp \
-	third_party/skia/src/gpu/SkGr.cpp \
-	third_party/skia/src/gpu/SkGrFontScaler.cpp \
-	third_party/skia/src/gpu/SkGrPixelRef.cpp \
-	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
-	third_party/skia/src/image/SkImage_Gpu.cpp \
-	third_party/skia/src/image/SkSurface_Gpu.cpp \
-	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
-	third_party/skia/src/ports/SkFontHost_fontconfig.cpp
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer \
-	-fno-unwind-tables \
-	-fno-asynchronous-unwind-tables
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_STATIC_RECT_VB=1' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_ALLOW_OVER_32K_BITMAPS' \
-	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
-	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
-	'-DIGNORE_ROT_AA_RECT_OPT' \
-	'-DSK_GAMMA_APPLY_TO_A8' \
-	'-DSK_GAMMA_EXPONENT=1.4' \
-	'-DSK_GAMMA_CONTRAST=0.0' \
-	'-DHAVE_PTHREADS' \
-	'-DOS_ANDROID' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
-	'-DUSE_CHROMIUM_SKIA' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/src/image \
-	$(LOCAL_PATH)/third_party/skia/src/sfnt \
-	$(LOCAL_PATH)/third_party/skia/src/utils \
-	$(LOCAL_PATH)/third_party/skia/src/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/src/gpu \
-	$(LOCAL_PATH)/third_party/expat/files/lib \
-	$(LOCAL_PATH)/third_party/zlib \
-	$(PWD)/external/expat/lib \
-	$(LOCAL_PATH)/third_party/freetype/include \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
 ### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES :=
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
 gyp_all_modules: skia_skia_gyp
@@ -708,4 +29,12 @@
 .PHONY: skia
 skia: skia_skia_gyp
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/skia/skia_chrome.gypi b/skia/skia_chrome.gypi
new file mode 100644
index 0000000..d47fc10
--- /dev/null
+++ b/skia/skia_chrome.gypi
@@ -0,0 +1,130 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+# This gypi file contains all the Chrome-specific enhancements to Skia.
+# In component mode (shared_lib) it is folded into a single shared library with
+# the Skia files but in all other cases it is a separate library.
+{
+  'dependencies': [
+    'skia_library',
+    'skia_chrome_opts',
+    '../base/base.gyp:base',
+    '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+  ],
+
+  'direct_dependent_settings': {
+    'include_dirs': [
+      'ext',
+    ],
+  },
+
+  'include_dirs': [
+    '..',
+  ],
+
+  'sources': [
+    'ext/analysis_canvas.cc',
+    'ext/analysis_canvas.h',
+    'ext/bitmap_platform_device.h',
+    'ext/bitmap_platform_device_android.cc',
+    'ext/bitmap_platform_device_android.h',
+    'ext/bitmap_platform_device_data.h',
+    'ext/bitmap_platform_device_linux.cc',
+    'ext/bitmap_platform_device_linux.h',
+    'ext/bitmap_platform_device_mac.cc',
+    'ext/bitmap_platform_device_mac.h',
+    'ext/bitmap_platform_device_win.cc',
+    'ext/bitmap_platform_device_win.h',
+    'ext/convolver.cc',
+    'ext/convolver.h',
+    'ext/google_logging.cc',
+    'ext/image_operations.cc',
+    'ext/image_operations.h',
+    'ext/lazy_pixel_ref.cc',
+    'ext/lazy_pixel_ref.h',
+    'ext/lazy_pixel_ref_utils.cc',
+    'ext/lazy_pixel_ref_utils.h',
+    'ext/SkThread_chrome.cc',
+    'ext/paint_simplifier.cc',
+    'ext/paint_simplifier.h',
+    'ext/platform_canvas.cc',
+    'ext/platform_canvas.h',
+    'ext/platform_device.cc',
+    'ext/platform_device.h',
+    'ext/platform_device_linux.cc',
+    'ext/platform_device_mac.cc',
+    'ext/platform_device_win.cc',
+    'ext/recursive_gaussian_convolution.cc',
+    'ext/recursive_gaussian_convolution.h',
+    'ext/refptr.h',
+    'ext/SkMemory_new_handler.cpp',
+    'ext/skia_trace_shim.h',
+    'ext/skia_utils_base.cc',
+    'ext/skia_utils_base.h',
+    'ext/skia_utils_ios.mm',
+    'ext/skia_utils_ios.h',
+    'ext/skia_utils_mac.mm',
+    'ext/skia_utils_mac.h',
+    'ext/skia_utils_win.cc',
+    'ext/skia_utils_win.h',
+    'ext/vector_canvas.cc',
+    'ext/vector_canvas.h',
+    'ext/vector_platform_device_emf_win.cc',
+    'ext/vector_platform_device_emf_win.h',
+    'ext/vector_platform_device_skia.cc',
+    'ext/vector_platform_device_skia.h',
+  ],
+  
+  'conditions': [
+    # For POSIX platforms, prefer the Mutex implementation provided by Skia
+    # since it does not generate static initializers.
+    # TODO: should check if SK_USE_POSIX_THREADS is defined instead
+    [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
+      'sources!': [
+        'ext/SkThread_chrome.cc',
+      ],
+    }],
+    [ 'OS == "android"', {
+      'sources!': [
+        'ext/vector_platform_device_skia.cc',
+      ],
+    }],
+    ['OS == "ios"', {
+      'sources/': [
+        ['exclude', '^ext/vector_platform_device_skia\\.'],
+      ],
+      'dependencies!': [
+        'skia_chrome_opts',
+      ],
+    }],
+    [ 'OS == "win"', {
+      'sources!': [
+        'ext/SkThread_chrome.cc',
+      ],
+    }],
+    # TODO(scottmg): http://crbug.com/177306
+    ['clang==1', {
+      'xcode_settings': {
+        'WARNING_CFLAGS!': [
+          # Don't warn about string->bool used in asserts.
+          '-Wstring-conversion',
+        ],
+      },
+      'cflags!': [
+        '-Wstring-conversion',
+      ],
+    }],
+  ],
+
+  'target_conditions': [
+    # Pull in specific linux files for android (which have been filtered out
+    # by file name rules).
+    [ 'OS == "android"', {
+      'sources/': [
+        ['include', 'ext/platform_device_linux\\.cc$'],
+      ],
+    }],
+  ],
+}
diff --git a/webkit/glue/glue_common.target.darwin-arm.mk b/skia/skia_chrome.target.darwin-arm.mk
similarity index 76%
rename from webkit/glue/glue_common.target.darwin-arm.mk
rename to skia/skia_chrome.target.darwin-arm.mk
index 4bd571d..642ac3c 100644
--- a/webkit/glue/glue_common.target.darwin-arm.mk
+++ b/skia/skia_chrome.target.darwin-arm.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -76,20 +90,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,14 +112,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -121,14 +127,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -193,20 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,14 +213,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -238,14 +228,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -306,8 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -318,10 +299,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-mips.mk b/skia/skia_chrome.target.darwin-mips.mk
similarity index 76%
rename from webkit/glue/glue_common.target.darwin-mips.mk
rename to skia/skia_chrome.target.darwin-mips.mk
index d7739a4..2d87c8f 100644
--- a/webkit/glue/glue_common.target.darwin-mips.mk
+++ b/skia/skia_chrome.target.darwin-mips.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -76,20 +90,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,14 +112,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -121,14 +127,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -193,20 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,14 +213,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -238,14 +228,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -302,8 +284,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -314,10 +295,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-x86.mk b/skia/skia_chrome.target.darwin-x86.mk
similarity index 77%
rename from webkit/glue/glue_common.target.darwin-x86.mk
rename to skia/skia_chrome.target.darwin-x86.mk
index 4884fb7..b5e1d39 100644
--- a/webkit/glue/glue_common.target.darwin-x86.mk
+++ b/skia/skia_chrome.target.darwin-x86.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +92,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -103,14 +114,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -122,14 +129,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -197,19 +196,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -222,14 +218,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -241,14 +233,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -304,8 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -316,10 +299,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-arm.mk b/skia/skia_chrome.target.linux-arm.mk
similarity index 76%
copy from webkit/glue/glue_common.target.darwin-arm.mk
copy to skia/skia_chrome.target.linux-arm.mk
index 4bd571d..642ac3c 100644
--- a/webkit/glue/glue_common.target.darwin-arm.mk
+++ b/skia/skia_chrome.target.linux-arm.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -76,20 +90,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,14 +112,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -121,14 +127,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -193,20 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,14 +213,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -238,14 +228,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -306,8 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -318,10 +299,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-mips.mk b/skia/skia_chrome.target.linux-mips.mk
similarity index 76%
copy from webkit/glue/glue_common.target.darwin-mips.mk
copy to skia/skia_chrome.target.linux-mips.mk
index d7739a4..2d87c8f 100644
--- a/webkit/glue/glue_common.target.darwin-mips.mk
+++ b/skia/skia_chrome.target.linux-mips.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -76,20 +90,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,14 +112,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -121,14 +127,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -193,20 +191,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,14 +213,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -238,14 +228,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -302,8 +284,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -314,10 +295,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-x86.mk b/skia/skia_chrome.target.linux-x86.mk
similarity index 77%
copy from webkit/glue/glue_common.target.darwin-x86.mk
copy to skia/skia_chrome.target.linux-x86.mk
index 4884fb7..b5e1d39 100644
--- a/webkit/glue/glue_common.target.darwin-x86.mk
+++ b/skia/skia_chrome.target.linux-x86.mk
@@ -3,7 +3,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
@@ -11,10 +11,7 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -22,12 +19,29 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
 LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/SkMemory_new_handler.cc: $(LOCAL_PATH)/skia/ext/SkMemory_new_handler.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/SkMemory_new_handler.cc
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(LOCAL_PATH)/skia/ext
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/analysis_canvas.cc \
+	skia/ext/bitmap_platform_device_android.cc \
+	skia/ext/convolver.cc \
+	skia/ext/google_logging.cc \
+	skia/ext/image_operations.cc \
+	skia/ext/lazy_pixel_ref.cc \
+	skia/ext/lazy_pixel_ref_utils.cc \
+	skia/ext/paint_simplifier.cc \
+	skia/ext/platform_canvas.cc \
+	skia/ext/platform_device.cc \
+	skia/ext/platform_device_linux.cc \
+	skia/ext/recursive_gaussian_convolution.cc \
+	skia/ext/skia_utils_base.cc \
+	skia/ext/vector_canvas.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +92,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -103,14 +114,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -122,14 +129,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -197,19 +196,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -222,14 +218,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -241,14 +233,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/pipe \
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -304,8 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -316,10 +299,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome
+skia_chrome: skia_skia_chrome_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_media.target.darwin-arm.mk b/skia/skia_chrome_opts.target.darwin-arm.mk
similarity index 77%
rename from webkit/support/webkit_media.target.darwin-arm.mk
rename to skia/skia_chrome_opts.target.darwin-arm.mk
index 3a531eb..0e5830c 100644
--- a/webkit/support/webkit_media.target.darwin-arm.mk
+++ b/skia/skia_chrome_opts.target.darwin-arm.mk
@@ -3,16 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -57,8 +55,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -69,10 +66,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-mips.mk b/skia/skia_chrome_opts.target.darwin-mips.mk
similarity index 61%
copy from webkit/glue/glue_common.target.darwin-mips.mk
copy to skia/skia_chrome_opts.target.darwin-mips.mk
index d7739a4..736a60f 100644
--- a/webkit/glue/glue_common.target.darwin-mips.mk
+++ b/skia/skia_chrome_opts.target.darwin-mips.mk
@@ -3,18 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -27,7 +23,7 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/convolver_mips_dspr2.cc
 
 
 # Flags passed to both C and C++ files.
@@ -42,6 +38,7 @@
 	-fvisibility=hidden \
 	-pipe \
 	-fPIC \
+	-fomit-frame-pointer \
 	-Wno-format \
 	-EL \
 	-mhard-float \
@@ -76,20 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,33 +89,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -159,6 +123,7 @@
 	-fvisibility=hidden \
 	-pipe \
 	-fPIC \
+	-fomit-frame-pointer \
 	-Wno-format \
 	-EL \
 	-mhard-float \
@@ -193,20 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,33 +174,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -301,9 +233,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -314,10 +244,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-x86.mk b/skia/skia_chrome_opts.target.darwin-x86.mk
similarity index 61%
copy from webkit/glue/glue_common.target.darwin-x86.mk
copy to skia/skia_chrome_opts.target.darwin-x86.mk
index 4884fb7..5098eb8 100644
--- a/webkit/glue/glue_common.target.darwin-x86.mk
+++ b/skia/skia_chrome_opts.target.darwin-x86.mk
@@ -3,18 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -27,7 +23,7 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/convolver_SSE2.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -103,33 +90,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -197,19 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -222,33 +177,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -303,9 +235,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -316,10 +246,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_media.target.linux-arm.mk b/skia/skia_chrome_opts.target.linux-arm.mk
similarity index 77%
rename from webkit/support/webkit_media.target.linux-arm.mk
rename to skia/skia_chrome_opts.target.linux-arm.mk
index 3a531eb..0e5830c 100644
--- a/webkit/support/webkit_media.target.linux-arm.mk
+++ b/skia/skia_chrome_opts.target.linux-arm.mk
@@ -3,16 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -57,8 +55,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -69,10 +66,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.linux-mips.mk b/skia/skia_chrome_opts.target.linux-mips.mk
similarity index 61%
rename from webkit/glue/glue_common.target.linux-mips.mk
rename to skia/skia_chrome_opts.target.linux-mips.mk
index d7739a4..736a60f 100644
--- a/webkit/glue/glue_common.target.linux-mips.mk
+++ b/skia/skia_chrome_opts.target.linux-mips.mk
@@ -3,18 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -27,7 +23,7 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/convolver_mips_dspr2.cc
 
 
 # Flags passed to both C and C++ files.
@@ -42,6 +38,7 @@
 	-fvisibility=hidden \
 	-pipe \
 	-fPIC \
+	-fomit-frame-pointer \
 	-Wno-format \
 	-EL \
 	-mhard-float \
@@ -76,20 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -102,33 +89,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -159,6 +123,7 @@
 	-fvisibility=hidden \
 	-pipe \
 	-fPIC \
+	-fomit-frame-pointer \
 	-Wno-format \
 	-EL \
 	-mhard-float \
@@ -193,20 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -219,33 +174,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -301,9 +233,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -314,10 +244,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.darwin-x86.mk b/skia/skia_chrome_opts.target.linux-x86.mk
similarity index 61%
copy from webkit/glue/glue_common.target.darwin-x86.mk
copy to skia/skia_chrome_opts.target.linux-x86.mk
index 4884fb7..5098eb8 100644
--- a/webkit/glue/glue_common.target.darwin-x86.mk
+++ b/skia/skia_chrome_opts.target.linux-x86.mk
@@ -3,18 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
+LOCAL_MODULE := skia_skia_chrome_opts_gyp
 LOCAL_MODULE_SUFFIX := .a
 LOCAL_MODULE_TAGS := optional
 gyp_intermediate_dir := $(call local-intermediates-dir)
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
+GYP_TARGET_DEPENDENCIES :=
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -27,7 +23,7 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
+	skia/ext/convolver_SSE2.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -103,33 +90,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -197,19 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -222,33 +177,10 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -303,9 +235,7 @@
 
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
+LOCAL_STATIC_LIBRARIES :=
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
@@ -316,10 +246,10 @@
 
 # Add target alias to "gyp_all_modules" target.
 .PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
+gyp_all_modules: skia_skia_chrome_opts_gyp
 
 # Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
+.PHONY: skia_chrome_opts
+skia_chrome_opts: skia_skia_chrome_opts_gyp
 
 include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_common.gypi b/skia/skia_common.gypi
new file mode 100644
index 0000000..616ae5b
--- /dev/null
+++ b/skia/skia_common.gypi
@@ -0,0 +1,33 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This gypi file handles the removal of platform-specific files from the
+# Skia build.
+{
+  'conditions': [
+    [ 'OS != "android"', {
+      'sources/': [
+         ['exclude', '_android\\.(cc|cpp)$'],
+      ],
+    }],
+    [ 'OS != "ios"', {
+      'sources/': [
+         ['exclude', '_ios\\.(cc|cpp|mm?)$'],
+      ],
+    }],
+    [ 'OS != "mac"', {
+      'sources/': [
+        ['exclude', '_mac\\.(cc|cpp|mm?)$'],
+      ],
+    }],
+    [ 'OS != "win"', {
+      'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
+    }],
+    [ 'use_glib == 0', {
+      'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
+    }],
+  ],
+
+  'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800],
+}
diff --git a/skia/skia_library.gypi b/skia/skia_library.gypi
new file mode 100644
index 0000000..70fbf38
--- /dev/null
+++ b/skia/skia_library.gypi
@@ -0,0 +1,460 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+# This gypi file contains the Skia library.
+# In component mode (shared_lib) it is folded into a single shared library with
+# the Chrome-specific enhancements but in all other cases it is a separate lib.
+{
+  'dependencies': [
+    'skia_library_opts.gyp:skia_opts',
+    '../third_party/zlib/zlib.gyp:zlib',
+  ],
+
+  'variables': {
+    'variables': {
+      'conditions': [
+        ['OS== "ios"', {
+          'skia_support_gpu': 0,
+        }, {
+          'skia_support_gpu': 1,
+        }],
+        ['OS=="ios" or OS=="android"', {
+          'skia_support_pdf': 0,
+        }, {
+          'skia_support_pdf': 1,
+        }],
+      ],
+    },
+    'skia_support_gpu': '<(skia_support_gpu)',
+    'skia_support_pdf': '<(skia_support_pdf)',
+
+    # These two set the paths so we can include skia/gyp/core.gypi
+    'skia_src_path': '../third_party/skia/src',
+    'skia_include_path': '../third_party/skia/include',
+
+    # This list will contain all defines that also need to be exported to
+    # dependent components.
+    'skia_export_defines': [
+      'SK_ENABLE_INST_COUNT=0',
+      'SK_SUPPORT_GPU=<(skia_support_gpu)',
+      'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
+    ],
+    
+    'default_font_cache_limit': '(20*1024*1024)',
+
+    'conditions': [
+      ['OS== "android"', {
+        # Android devices are typically more memory constrained, so
+        # use a smaller glyph cache.
+        'default_font_cache_limit': '(8*1024*1024)',
+        'skia_export_defines': [
+          'SK_BUILD_FOR_ANDROID',
+          'USE_CHROMIUM_SKIA',
+        ],
+      }],
+    ],
+  },
+
+  'includes': [
+    '../third_party/skia/gyp/core.gypi',
+    '../third_party/skia/gyp/effects.gypi',
+  ],
+
+  'sources': [
+    # this should likely be moved into src/utils in skia
+    '../third_party/skia/src/core/SkFlate.cpp',
+    # We don't want to add this to Skia's core.gypi since it is
+    # Android only. Include it here and remove it for everyone
+    # but Android later.
+    '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
+
+    '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
+    '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
+    '../third_party/skia/src/images/SkScaledBitmapSampler.h',
+
+    '../third_party/skia/src/opts/opts_check_SSE2.cpp',
+
+    '../third_party/skia/src/pdf/SkPDFCatalog.cpp',
+    '../third_party/skia/src/pdf/SkPDFCatalog.h',
+    '../third_party/skia/src/pdf/SkPDFDevice.cpp',
+    '../third_party/skia/src/pdf/SkPDFDocument.cpp',
+    '../third_party/skia/src/pdf/SkPDFFont.cpp',
+    '../third_party/skia/src/pdf/SkPDFFont.h',
+    '../third_party/skia/src/pdf/SkPDFFormXObject.cpp',
+    '../third_party/skia/src/pdf/SkPDFFormXObject.h',
+    '../third_party/skia/src/pdf/SkPDFGraphicState.cpp',
+    '../third_party/skia/src/pdf/SkPDFGraphicState.h',
+    '../third_party/skia/src/pdf/SkPDFImage.cpp',
+    '../third_party/skia/src/pdf/SkPDFImage.h',
+    '../third_party/skia/src/pdf/SkPDFImageStream.cpp',
+    '../third_party/skia/src/pdf/SkPDFImageStream.h',
+    '../third_party/skia/src/pdf/SkPDFPage.cpp',
+    '../third_party/skia/src/pdf/SkPDFPage.h',
+    '../third_party/skia/src/pdf/SkPDFShader.cpp',
+    '../third_party/skia/src/pdf/SkPDFShader.h',
+    '../third_party/skia/src/pdf/SkPDFStream.cpp',
+    '../third_party/skia/src/pdf/SkPDFStream.h',
+    '../third_party/skia/src/pdf/SkPDFTypes.cpp',
+    '../third_party/skia/src/pdf/SkPDFTypes.h',
+    '../third_party/skia/src/pdf/SkPDFUtils.cpp',
+    '../third_party/skia/src/pdf/SkPDFUtils.h',
+
+    '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
+
+    '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
+    '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
+
+    '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
+    '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
+
+    '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
+    '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
+    '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
+    '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
+    '../third_party/skia/src/ports/SkFontHost_mac.cpp',
+    '../third_party/skia/src/ports/SkFontHost_win.cpp',
+    '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
+    '../third_party/skia/src/ports/SkOSFile_posix.cpp',
+    '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
+    '../third_party/skia/src/ports/SkOSFile_win.cpp',
+    '../third_party/skia/src/ports/SkThread_pthread.cpp',
+    '../third_party/skia/src/ports/SkThread_win.cpp',
+    '../third_party/skia/src/ports/SkTime_Unix.cpp',
+    '../third_party/skia/src/ports/SkTLS_pthread.cpp',
+    '../third_party/skia/src/ports/SkTLS_win.cpp',
+
+    '../third_party/skia/src/sfnt/SkOTUtils.cpp',
+    '../third_party/skia/src/sfnt/SkOTUtils.h',
+
+    '../third_party/skia/include/utils/mac/SkCGUtils.h',
+    '../third_party/skia/include/utils/SkDeferredCanvas.h',
+    '../third_party/skia/include/utils/SkMatrix44.h',
+    '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
+    '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
+    '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
+    '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
+    '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
+    '../third_party/skia/src/utils/debugger/SkObjectParser.h',
+    '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
+    '../third_party/skia/src/utils/SkBase64.cpp',
+    '../third_party/skia/src/utils/SkBase64.h',
+    '../third_party/skia/src/utils/SkBitSet.cpp',
+    '../third_party/skia/src/utils/SkBitSet.h',
+    '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
+    '../third_party/skia/src/utils/SkMatrix44.cpp',
+    '../third_party/skia/src/utils/SkNullCanvas.cpp',
+    '../third_party/skia/include/utils/SkNWayCanvas.h',
+    '../third_party/skia/src/utils/SkNWayCanvas.cpp',
+    '../third_party/skia/src/utils/SkPictureUtils.cpp',
+    '../third_party/skia/src/utils/SkRTConf.cpp',
+    '../third_party/skia/include/utils/SkRTConf.h',
+    '../third_party/skia/include/pdf/SkPDFDevice.h',
+    '../third_party/skia/include/pdf/SkPDFDocument.h',
+
+    '../third_party/skia/include/ports/SkTypeface_win.h',
+
+    '../third_party/skia/include/images/SkImageRef.h',
+    '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
+    '../third_party/skia/include/images/SkMovie.h',
+    '../third_party/skia/include/images/SkPageFlipper.h',
+
+    '../third_party/skia/include/utils/SkNullCanvas.h',
+    '../third_party/skia/include/utils/SkPictureUtils.h',
+  ],
+  'include_dirs': [
+    '..',
+    'config',
+    '../third_party/skia/include/config',
+    '../third_party/skia/include/core',
+    '../third_party/skia/include/effects',
+    '../third_party/skia/include/images',
+    '../third_party/skia/include/lazy',
+    '../third_party/skia/include/pathops',
+    '../third_party/skia/include/pdf',
+    '../third_party/skia/include/pipe',
+    '../third_party/skia/include/ports',
+    '../third_party/skia/include/utils',
+    '../third_party/skia/src/core',
+    '../third_party/skia/src/image',
+    '../third_party/skia/src/sfnt',
+    '../third_party/skia/src/utils',
+    '../third_party/skia/src/lazy',
+  ],
+  'conditions': [
+    ['skia_support_gpu != 0', {
+      'includes': [
+        '../third_party/skia/gyp/gpu.gypi',
+      ],
+      'sources': [
+        '<@(skgpu_sources)',
+      ],
+      'include_dirs': [
+        '../third_party/skia/include/gpu',
+        '../third_party/skia/include/gpu/gl',
+        '../third_party/skia/src/gpu',
+      ],
+    }],
+    ['skia_support_pdf == 0', {
+      'sources/': [
+        ['exclude', '../third_party/skia/src/pdf/']
+      ],
+    }],
+    ['skia_support_pdf == 1', {
+      'dependencies': [
+        '../third_party/sfntly/sfntly.gyp:sfntly',
+      ],
+    }],
+
+    #Settings for text blitting, chosen to approximate the system browser.
+    [ 'OS == "linux"', {
+      'defines': [
+        'SK_GAMMA_EXPONENT=1.2',
+        'SK_GAMMA_CONTRAST=0.2',
+      ],
+    }],
+    ['OS == "android"', {
+      'defines': [
+        'SK_GAMMA_APPLY_TO_A8',
+        'SK_GAMMA_EXPONENT=1.4',
+        'SK_GAMMA_CONTRAST=0.0',
+      ],
+    }],
+    ['OS == "win"', {
+      'defines': [
+        'SK_GAMMA_SRGB',
+        'SK_GAMMA_CONTRAST=0.5',
+      ],
+    }],
+    ['OS == "mac"', {
+      'defines': [
+        'SK_GAMMA_SRGB',
+        'SK_GAMMA_CONTRAST=0.0',
+      ],
+    }],
+
+    # For POSIX platforms, prefer the Mutex implementation provided by Skia
+    # since it does not generate static initializers.
+    [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
+      'defines+': [
+        'SK_USE_POSIX_THREADS',
+      ],
+      'direct_dependent_settings': {
+        'defines': [
+          'SK_USE_POSIX_THREADS',
+        ],
+      },
+    }],
+
+    [ 'OS != "android"', {
+      'sources!': [
+        '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
+      ],
+    }],
+    [ 'OS != "ios"', {
+      'dependencies': [
+        '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp:skia_webkit',
+      ],
+    }],
+    [ 'OS != "mac"', {
+      'sources/': [
+        ['exclude', '/mac/']
+      ],
+    }],
+    [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
+      'defines': [
+        '__ARM_HAVE_NEON',
+      ],
+    }],
+    [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
+      'defines': [
+        '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
+      ],
+    }],
+    [ 'OS == "android" and target_arch == "arm"', {
+      'sources': [
+        '../third_party/skia/src/core/SkUtilsArm.cpp',
+      ],
+      'includes': [
+        '../build/android/cpufeatures.gypi',
+      ],
+    }],
+    [ 'target_arch == "arm" or target_arch == "mipsel"', {
+      'sources!': [
+        '../third_party/skia/src/opts/opts_check_SSE2.cpp'
+      ],
+    }],
+    [ 'use_glib == 1', {
+      'dependencies': [
+        '../build/linux/system.gyp:fontconfig',
+        '../build/linux/system.gyp:freetype2',
+        '../build/linux/system.gyp:pangocairo',
+        '../third_party/icu/icu.gyp:icuuc',
+      ],
+      'cflags': [
+        '-Wno-unused',
+        '-Wno-unused-function',
+      ],
+    }],
+    [ 'use_glib == 0', {
+      'sources!': [
+        '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
+        '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
+      ],
+    }],
+    [ 'use_glib == 0 and OS != "android"', {
+      'sources!': [
+        '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
+        '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
+        '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
+
+      ],
+    }],
+    [ 'OS == "android"', {
+      'dependencies': [
+        '../third_party/expat/expat.gyp:expat',
+        '../third_party/freetype/freetype.gyp:ft2',
+      ],
+      # This exports a hard dependency because it needs to run its
+      # symlink action in order to expose the skia header files.
+      'hard_dependency': 1,
+      'include_dirs': [
+        '../third_party/expat/files/lib',
+      ],
+    }],
+    [ 'OS == "ios"', {
+      'defines': [
+        'SK_BUILD_FOR_IOS',
+        'SK_USE_MAC_CORE_TEXT',
+      ],
+      'include_dirs': [
+        '../third_party/skia/include/utils/ios',
+        '../third_party/skia/include/utils/mac',
+      ],
+      'link_settings': {
+        'libraries': [
+          '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
+        ],
+      },
+      'sources': [
+        # This file is used on both iOS and Mac, so it should be removed
+        #  from the ios and mac conditions and moved into the main sources
+        #  list.
+        '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
+      ],
+      'sources/': [
+        ['exclude', 'opts_check_SSE2\\.cpp$'],
+      ],
+      
+      # The main skia_opts target does not currently work on iOS because the
+      # target architecture on iOS is determined at compile time rather than
+      # gyp time (simulator builds are x86, device builds are arm).  As a
+      # temporary measure, this is a separate opts target for iOS-only, using
+      # the _none.cpp files to avoid architecture-dependent implementations.
+      'dependencies': [
+        'skia_library_opts.gyp:skia_opts_none',
+      ],
+      'dependencies!': [
+        'skia_library_opts.gyp:skia_opts',
+      ],
+    }],
+    [ 'OS == "mac"', {
+      'defines': [
+        'SK_BUILD_FOR_MAC',
+        'SK_USE_MAC_CORE_TEXT',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '../third_party/skia/include/utils/mac',
+        ],
+      },
+      'include_dirs': [
+        '../third_party/skia/include/utils/mac',
+      ],
+      'link_settings': {
+        'libraries': [
+          '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+        ],
+      },
+      'sources': [
+        '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
+      ],
+    }],
+    [ 'OS == "win"', {
+      'sources!': [
+        '../third_party/skia/src/ports/SkOSFile_posix.cpp',
+        '../third_party/skia/src/ports/SkThread_pthread.cpp',
+        '../third_party/skia/src/ports/SkTime_Unix.cpp',
+        '../third_party/skia/src/ports/SkTLS_pthread.cpp',
+      ],
+    }],
+    # TODO(scottmg): http://crbug.com/177306
+    ['clang==1', {
+      'xcode_settings': {
+        'WARNING_CFLAGS!': [
+          # Don't warn about string->bool used in asserts.
+          '-Wstring-conversion',
+        ],
+      },
+      'cflags!': [
+        '-Wstring-conversion',
+      ],
+    }],
+  ],
+  'target_conditions': [
+    # Pull in specific Mac files for iOS (which have been filtered out
+    # by file name rules).
+    [ 'OS == "ios"', {
+      'sources/': [
+        ['include', 'SkFontHost_mac\\.cpp$',],
+        ['include', 'SkStream_mac\\.cpp$',],
+        ['include', 'SkCreateCGImageRef\\.cpp$',],
+      ],
+    }],
+  ],
+
+  'defines': [
+    '<@(skia_export_defines)',
+
+    # this flag can be removed entirely once this has baked for a while
+    'SK_ALLOW_OVER_32K_BITMAPS',
+
+    # skia uses static initializers to initialize the serialization logic
+    # of its "pictures" library. This is currently not used in chrome; if
+    # it ever gets used the processes that use it need to call
+    # SkGraphics::Init().
+    'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
+
+    # Disable this check because it is too strict for some Chromium-specific
+    # subclasses of SkPixelRef. See bug: crbug.com/171776.
+    'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
+
+    'IGNORE_ROT_AA_RECT_OPT',
+
+    'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
+  ],
+
+  'direct_dependent_settings': {
+    'include_dirs': [
+      #temporary until we can hide SkFontHost
+      '../third_party/skia/src/core',
+
+      'config',
+      '../third_party/skia/include/config',
+      '../third_party/skia/include/core',
+      '../third_party/skia/include/effects',
+      '../third_party/skia/include/pdf',
+      '../third_party/skia/include/gpu',
+      '../third_party/skia/include/gpu/gl',
+      '../third_party/skia/include/lazy',
+      '../third_party/skia/include/pathops',
+      '../third_party/skia/include/pipe',
+      '../third_party/skia/include/ports',
+      '../third_party/skia/include/utils',
+    ],
+    'defines': [
+      '<@(skia_export_defines)',
+    ],
+  },
+}
diff --git a/skia/skia_library.target.darwin-arm.mk b/skia/skia_library.target.darwin-arm.mk
new file mode 100644
index 0000000..e124ec3
--- /dev/null
+++ b/skia/skia_library.target.darwin-arm.mk
@@ -0,0 +1,662 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
+	third_party/skia/src/core/SkUtilsArm.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES := \
+	cpufeatures
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library.target.darwin-mips.mk b/skia/skia_library.target.darwin-mips.mk
new file mode 100644
index 0000000..cfac58c
--- /dev/null
+++ b/skia/skia_library.target.darwin-mips.mk
@@ -0,0 +1,654 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library.target.darwin-x86.mk b/skia/skia_library.target.darwin-x86.mk
new file mode 100644
index 0000000..56a28a1
--- /dev/null
+++ b/skia/skia_library.target.darwin-x86.mk
@@ -0,0 +1,659 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/opts/opts_check_SSE2.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-fno-stack-protector \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-fno-stack-protector \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer \
+	-fno-unwind-tables \
+	-fno-asynchronous-unwind-tables
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library.target.linux-arm.mk b/skia/skia_library.target.linux-arm.mk
new file mode 100644
index 0000000..e124ec3
--- /dev/null
+++ b/skia/skia_library.target.linux-arm.mk
@@ -0,0 +1,662 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp \
+	third_party/skia/src/core/SkUtilsArm.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES := \
+	cpufeatures
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library.target.linux-mips.mk b/skia/skia_library.target.linux-mips.mk
new file mode 100644
index 0000000..cfac58c
--- /dev/null
+++ b/skia/skia_library.target.linux-mips.mk
@@ -0,0 +1,654 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library.target.linux-x86.mk b/skia/skia_library.target.linux-x86.mk
new file mode 100644
index 0000000..56a28a1
--- /dev/null
+++ b/skia/skia_library.target.linux-x86.mk
@@ -0,0 +1,659 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := skia_skia_library_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_WebKit_chromium_skia_webkit_gyp)/skia_webkit.stamp \
+	$(call intermediates-dir-for,GYP,third_party_expat_expat_gyp)/expat.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/skia/src/core/SkFlate.cpp \
+	third_party/skia/src/core/SkPaintOptionsAndroid.cpp \
+	third_party/skia/src/ports/SkImageDecoder_empty.cpp \
+	third_party/skia/src/images/SkScaledBitmapSampler.cpp \
+	third_party/skia/src/opts/opts_check_SSE2.cpp \
+	third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp \
+	third_party/skia/src/ports/SkFontConfigInterface_android.cpp \
+	third_party/skia/src/ports/SkFontHost_fontconfig.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType.cpp \
+	third_party/skia/src/ports/SkFontHost_FreeType_common.cpp \
+	third_party/skia/src/ports/SkFontConfigParser_android.cpp \
+	third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp \
+	third_party/skia/src/ports/SkOSFile_posix.cpp \
+	third_party/skia/src/ports/SkOSFile_stdio.cpp \
+	third_party/skia/src/ports/SkThread_pthread.cpp \
+	third_party/skia/src/ports/SkTime_Unix.cpp \
+	third_party/skia/src/ports/SkTLS_pthread.cpp \
+	third_party/skia/src/sfnt/SkOTUtils.cpp \
+	third_party/skia/src/utils/debugger/SkDebugCanvas.cpp \
+	third_party/skia/src/utils/debugger/SkDrawCommand.cpp \
+	third_party/skia/src/utils/debugger/SkObjectParser.cpp \
+	third_party/skia/src/utils/SkBase64.cpp \
+	third_party/skia/src/utils/SkBitSet.cpp \
+	third_party/skia/src/utils/SkDeferredCanvas.cpp \
+	third_party/skia/src/utils/SkMatrix44.cpp \
+	third_party/skia/src/utils/SkNullCanvas.cpp \
+	third_party/skia/src/utils/SkNWayCanvas.cpp \
+	third_party/skia/src/utils/SkPictureUtils.cpp \
+	third_party/skia/src/utils/SkRTConf.cpp \
+	third_party/skia/src/core/Sk64.cpp \
+	third_party/skia/src/core/SkAAClip.cpp \
+	third_party/skia/src/core/SkAnnotation.cpp \
+	third_party/skia/src/core/SkAdvancedTypefaceMetrics.cpp \
+	third_party/skia/src/core/SkAlphaRuns.cpp \
+	third_party/skia/src/core/SkBBoxHierarchy.cpp \
+	third_party/skia/src/core/SkBBoxRecord.cpp \
+	third_party/skia/src/core/SkBBoxHierarchyRecord.cpp \
+	third_party/skia/src/core/SkBitmap.cpp \
+	third_party/skia/src/core/SkBitmapFilter.cpp \
+	third_party/skia/src/core/SkBitmapHeap.cpp \
+	third_party/skia/src/core/SkBitmapProcShader.cpp \
+	third_party/skia/src/core/SkBitmapProcState.cpp \
+	third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp \
+	third_party/skia/src/core/SkBitmapScaler.cpp \
+	third_party/skia/src/core/SkBitmap_scroll.cpp \
+	third_party/skia/src/core/SkBlitMask_D32.cpp \
+	third_party/skia/src/core/SkBlitRow_D16.cpp \
+	third_party/skia/src/core/SkBlitRow_D32.cpp \
+	third_party/skia/src/core/SkBlitter.cpp \
+	third_party/skia/src/core/SkBlitter_A1.cpp \
+	third_party/skia/src/core/SkBlitter_A8.cpp \
+	third_party/skia/src/core/SkBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkBlitter_Sprite.cpp \
+	third_party/skia/src/core/SkBuffer.cpp \
+	third_party/skia/src/core/SkCanvas.cpp \
+	third_party/skia/src/core/SkChunkAlloc.cpp \
+	third_party/skia/src/core/SkClipStack.cpp \
+	third_party/skia/src/core/SkColor.cpp \
+	third_party/skia/src/core/SkColorFilter.cpp \
+	third_party/skia/src/core/SkColorTable.cpp \
+	third_party/skia/src/core/SkComposeShader.cpp \
+	third_party/skia/src/core/SkConfig8888.cpp \
+	third_party/skia/src/core/SkConvolver.cpp \
+	third_party/skia/src/core/SkCordic.cpp \
+	third_party/skia/src/core/SkCubicClipper.cpp \
+	third_party/skia/src/core/SkData.cpp \
+	third_party/skia/src/core/SkDataTable.cpp \
+	third_party/skia/src/core/SkDebug.cpp \
+	third_party/skia/src/core/SkDeque.cpp \
+	third_party/skia/src/core/SkDevice.cpp \
+	third_party/skia/src/core/SkDeviceProfile.cpp \
+	third_party/skia/src/core/SkDither.cpp \
+	third_party/skia/src/core/SkDraw.cpp \
+	third_party/skia/src/core/SkDrawLooper.cpp \
+	third_party/skia/src/core/SkEdgeBuilder.cpp \
+	third_party/skia/src/core/SkEdgeClipper.cpp \
+	third_party/skia/src/core/SkEdge.cpp \
+	third_party/skia/src/core/SkError.cpp \
+	third_party/skia/src/core/SkFilterProc.cpp \
+	third_party/skia/src/core/SkFilterShader.cpp \
+	third_party/skia/src/core/SkFlattenable.cpp \
+	third_party/skia/src/core/SkFlattenableBuffers.cpp \
+	third_party/skia/src/core/SkFloat.cpp \
+	third_party/skia/src/core/SkFloatBits.cpp \
+	third_party/skia/src/core/SkFontHost.cpp \
+	third_party/skia/src/core/SkFontDescriptor.cpp \
+	third_party/skia/src/core/SkFontStream.cpp \
+	third_party/skia/src/core/SkGeometry.cpp \
+	third_party/skia/src/core/SkGlyphCache.cpp \
+	third_party/skia/src/core/SkGraphics.cpp \
+	third_party/skia/src/core/SkInstCnt.cpp \
+	third_party/skia/src/core/SkImageFilter.cpp \
+	third_party/skia/src/core/SkImageFilterUtils.cpp \
+	third_party/skia/src/core/SkLineClipper.cpp \
+	third_party/skia/src/core/SkMallocPixelRef.cpp \
+	third_party/skia/src/core/SkMask.cpp \
+	third_party/skia/src/core/SkMaskFilter.cpp \
+	third_party/skia/src/core/SkMaskGamma.cpp \
+	third_party/skia/src/core/SkMath.cpp \
+	third_party/skia/src/core/SkMatrix.cpp \
+	third_party/skia/src/core/SkMetaData.cpp \
+	third_party/skia/src/core/SkMipMap.cpp \
+	third_party/skia/src/core/SkOrderedReadBuffer.cpp \
+	third_party/skia/src/core/SkOrderedWriteBuffer.cpp \
+	third_party/skia/src/core/SkPackBits.cpp \
+	third_party/skia/src/core/SkPaint.cpp \
+	third_party/skia/src/core/SkPaintPriv.cpp \
+	third_party/skia/src/core/SkPath.cpp \
+	third_party/skia/src/core/SkPathEffect.cpp \
+	third_party/skia/src/core/SkPathHeap.cpp \
+	third_party/skia/src/core/SkPathMeasure.cpp \
+	third_party/skia/src/core/SkPicture.cpp \
+	third_party/skia/src/core/SkPictureFlat.cpp \
+	third_party/skia/src/core/SkPicturePlayback.cpp \
+	third_party/skia/src/core/SkPictureRecord.cpp \
+	third_party/skia/src/core/SkPictureStateTree.cpp \
+	third_party/skia/src/core/SkPixelRef.cpp \
+	third_party/skia/src/core/SkPoint.cpp \
+	third_party/skia/src/core/SkProcSpriteBlitter.cpp \
+	third_party/skia/src/core/SkPtrRecorder.cpp \
+	third_party/skia/src/core/SkQuadClipper.cpp \
+	third_party/skia/src/core/SkRasterClip.cpp \
+	third_party/skia/src/core/SkRasterizer.cpp \
+	third_party/skia/src/core/SkRect.cpp \
+	third_party/skia/src/core/SkRefCnt.cpp \
+	third_party/skia/src/core/SkRefDict.cpp \
+	third_party/skia/src/core/SkRegion.cpp \
+	third_party/skia/src/core/SkRegion_path.cpp \
+	third_party/skia/src/core/SkRRect.cpp \
+	third_party/skia/src/core/SkRTree.cpp \
+	third_party/skia/src/core/SkScalar.cpp \
+	third_party/skia/src/core/SkScalerContext.cpp \
+	third_party/skia/src/core/SkScan.cpp \
+	third_party/skia/src/core/SkScan_AntiPath.cpp \
+	third_party/skia/src/core/SkScan_Antihair.cpp \
+	third_party/skia/src/core/SkScan_Hairline.cpp \
+	third_party/skia/src/core/SkScan_Path.cpp \
+	third_party/skia/src/core/SkShader.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp \
+	third_party/skia/src/core/SkSpriteBlitter_RGB16.cpp \
+	third_party/skia/src/core/SkStream.cpp \
+	third_party/skia/src/core/SkString.cpp \
+	third_party/skia/src/core/SkStringUtils.cpp \
+	third_party/skia/src/core/SkStroke.cpp \
+	third_party/skia/src/core/SkStrokeRec.cpp \
+	third_party/skia/src/core/SkStrokerPriv.cpp \
+	third_party/skia/src/core/SkTileGrid.cpp \
+	third_party/skia/src/core/SkTileGridPicture.cpp \
+	third_party/skia/src/core/SkTLS.cpp \
+	third_party/skia/src/core/SkTSearch.cpp \
+	third_party/skia/src/core/SkTypeface.cpp \
+	third_party/skia/src/core/SkTypefaceCache.cpp \
+	third_party/skia/src/core/SkUnPreMultiply.cpp \
+	third_party/skia/src/core/SkUtils.cpp \
+	third_party/skia/src/core/SkWriter32.cpp \
+	third_party/skia/src/core/SkXfermode.cpp \
+	third_party/skia/src/doc/SkDocument.cpp \
+	third_party/skia/src/image/SkDataPixelRef.cpp \
+	third_party/skia/src/image/SkImage.cpp \
+	third_party/skia/src/image/SkImagePriv.cpp \
+	third_party/skia/src/image/SkImage_Codec.cpp \
+	third_party/skia/src/image/SkImage_Picture.cpp \
+	third_party/skia/src/image/SkImage_Raster.cpp \
+	third_party/skia/src/image/SkSurface.cpp \
+	third_party/skia/src/image/SkSurface_Picture.cpp \
+	third_party/skia/src/image/SkSurface_Raster.cpp \
+	third_party/skia/src/pipe/SkGPipeRead.cpp \
+	third_party/skia/src/pipe/SkGPipeWrite.cpp \
+	third_party/skia/src/lazy/SkBitmapFactory.cpp \
+	third_party/skia/src/lazy/SkLazyPixelRef.cpp \
+	third_party/skia/src/lazy/SkLruImageCache.cpp \
+	third_party/skia/src/lazy/SkPurgeableMemoryBlock_common.cpp \
+	third_party/skia/src/lazy/SkPurgeableImageCache.cpp \
+	third_party/skia/src/pathops/SkAddIntersections.cpp \
+	third_party/skia/src/pathops/SkDCubicIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDCubicToQuads.cpp \
+	third_party/skia/src/pathops/SkDLineIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadImplicit.cpp \
+	third_party/skia/src/pathops/SkDQuadIntersection.cpp \
+	third_party/skia/src/pathops/SkDQuadLineIntersection.cpp \
+	third_party/skia/src/pathops/SkIntersections.cpp \
+	third_party/skia/src/pathops/SkOpAngle.cpp \
+	third_party/skia/src/pathops/SkOpContour.cpp \
+	third_party/skia/src/pathops/SkOpEdgeBuilder.cpp \
+	third_party/skia/src/pathops/SkOpSegment.cpp \
+	third_party/skia/src/pathops/SkPathOpsBounds.cpp \
+	third_party/skia/src/pathops/SkPathOpsCommon.cpp \
+	third_party/skia/src/pathops/SkPathOpsCubic.cpp \
+	third_party/skia/src/pathops/SkPathOpsDebug.cpp \
+	third_party/skia/src/pathops/SkPathOpsLine.cpp \
+	third_party/skia/src/pathops/SkPathOpsOp.cpp \
+	third_party/skia/src/pathops/SkPathOpsPoint.cpp \
+	third_party/skia/src/pathops/SkPathOpsQuad.cpp \
+	third_party/skia/src/pathops/SkPathOpsRect.cpp \
+	third_party/skia/src/pathops/SkPathOpsSimplify.cpp \
+	third_party/skia/src/pathops/SkPathOpsTriangle.cpp \
+	third_party/skia/src/pathops/SkPathOpsTypes.cpp \
+	third_party/skia/src/pathops/SkPathWriter.cpp \
+	third_party/skia/src/pathops/SkQuarticRoot.cpp \
+	third_party/skia/src/pathops/SkReduceOrder.cpp \
+	third_party/skia/src/effects/Sk1DPathEffect.cpp \
+	third_party/skia/src/effects/Sk2DPathEffect.cpp \
+	third_party/skia/src/effects/SkArithmeticMode.cpp \
+	third_party/skia/src/effects/SkAvoidXfermode.cpp \
+	third_party/skia/src/effects/SkBicubicImageFilter.cpp \
+	third_party/skia/src/effects/SkBitmapSource.cpp \
+	third_party/skia/src/effects/SkBlendImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurDrawLooper.cpp \
+	third_party/skia/src/effects/SkBlurMask.cpp \
+	third_party/skia/src/effects/SkBlurImageFilter.cpp \
+	third_party/skia/src/effects/SkBlurMaskFilter.cpp \
+	third_party/skia/src/effects/SkColorFilters.cpp \
+	third_party/skia/src/effects/SkColorFilterImageFilter.cpp \
+	third_party/skia/src/effects/SkColorMatrix.cpp \
+	third_party/skia/src/effects/SkColorMatrixFilter.cpp \
+	third_party/skia/src/effects/SkCornerPathEffect.cpp \
+	third_party/skia/src/effects/SkDashPathEffect.cpp \
+	third_party/skia/src/effects/SkDiscretePathEffect.cpp \
+	third_party/skia/src/effects/SkDisplacementMapEffect.cpp \
+	third_party/skia/src/effects/SkEmbossMask.cpp \
+	third_party/skia/src/effects/SkEmbossMaskFilter.cpp \
+	third_party/skia/src/effects/SkGpuBlurUtils.cpp \
+	third_party/skia/src/effects/SkKernel33MaskFilter.cpp \
+	third_party/skia/src/effects/SkLayerDrawLooper.cpp \
+	third_party/skia/src/effects/SkLayerRasterizer.cpp \
+	third_party/skia/src/effects/SkLerpXfermode.cpp \
+	third_party/skia/src/effects/SkLightingImageFilter.cpp \
+	third_party/skia/src/effects/SkMagnifierImageFilter.cpp \
+	third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp \
+	third_party/skia/src/effects/SkMergeImageFilter.cpp \
+	third_party/skia/src/effects/SkMorphologyImageFilter.cpp \
+	third_party/skia/src/effects/SkOffsetImageFilter.cpp \
+	third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp \
+	third_party/skia/src/effects/SkPerlinNoiseShader.cpp \
+	third_party/skia/src/effects/SkPixelXorXfermode.cpp \
+	third_party/skia/src/effects/SkPorterDuff.cpp \
+	third_party/skia/src/effects/SkRectShaderImageFilter.cpp \
+	third_party/skia/src/effects/SkStippleMaskFilter.cpp \
+	third_party/skia/src/effects/SkTableColorFilter.cpp \
+	third_party/skia/src/effects/SkTableMaskFilter.cpp \
+	third_party/skia/src/effects/SkTestImageFilters.cpp \
+	third_party/skia/src/effects/SkTransparentShader.cpp \
+	third_party/skia/src/effects/SkXfermodeImageFilter.cpp \
+	third_party/skia/src/effects/gradients/SkBitmapCache.cpp \
+	third_party/skia/src/effects/gradients/SkClampRange.cpp \
+	third_party/skia/src/effects/gradients/SkGradientShader.cpp \
+	third_party/skia/src/effects/gradients/SkLinearGradient.cpp \
+	third_party/skia/src/effects/gradients/SkRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp \
+	third_party/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp \
+	third_party/skia/src/effects/gradients/SkSweepGradient.cpp \
+	third_party/skia/src/gpu/GrAAHairLinePathRenderer.cpp \
+	third_party/skia/src/gpu/GrAAConvexPathRenderer.cpp \
+	third_party/skia/src/gpu/GrAARectRenderer.cpp \
+	third_party/skia/src/gpu/GrAddPathRenderers_default.cpp \
+	third_party/skia/src/gpu/GrAllocPool.cpp \
+	third_party/skia/src/gpu/GrAtlas.cpp \
+	third_party/skia/src/gpu/GrBufferAllocPool.cpp \
+	third_party/skia/src/gpu/GrCacheID.cpp \
+	third_party/skia/src/gpu/GrClipData.cpp \
+	third_party/skia/src/gpu/GrContext.cpp \
+	third_party/skia/src/gpu/GrDefaultPathRenderer.cpp \
+	third_party/skia/src/gpu/GrDrawState.cpp \
+	third_party/skia/src/gpu/GrDrawTarget.cpp \
+	third_party/skia/src/gpu/GrEffect.cpp \
+	third_party/skia/src/gpu/GrGeometryBuffer.cpp \
+	third_party/skia/src/gpu/GrClipMaskCache.cpp \
+	third_party/skia/src/gpu/GrClipMaskManager.cpp \
+	third_party/skia/src/gpu/GrGpu.cpp \
+	third_party/skia/src/gpu/GrGpuFactory.cpp \
+	third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp \
+	third_party/skia/src/gpu/GrMemory.cpp \
+	third_party/skia/src/gpu/GrMemoryPool.cpp \
+	third_party/skia/src/gpu/GrOvalRenderer.cpp \
+	third_party/skia/src/gpu/GrPaint.cpp \
+	third_party/skia/src/gpu/GrPath.cpp \
+	third_party/skia/src/gpu/GrPathRendererChain.cpp \
+	third_party/skia/src/gpu/GrPathRenderer.cpp \
+	third_party/skia/src/gpu/GrPathUtils.cpp \
+	third_party/skia/src/gpu/GrRectanizer.cpp \
+	third_party/skia/src/gpu/GrRenderTarget.cpp \
+	third_party/skia/src/gpu/GrReducedClip.cpp \
+	third_party/skia/src/gpu/GrResource.cpp \
+	third_party/skia/src/gpu/GrResourceCache.cpp \
+	third_party/skia/src/gpu/GrStencil.cpp \
+	third_party/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp \
+	third_party/skia/src/gpu/GrStencilBuffer.cpp \
+	third_party/skia/src/gpu/GrSWMaskHelper.cpp \
+	third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp \
+	third_party/skia/src/gpu/GrSurface.cpp \
+	third_party/skia/src/gpu/GrTextContext.cpp \
+	third_party/skia/src/gpu/GrTextStrike.cpp \
+	third_party/skia/src/gpu/GrTexture.cpp \
+	third_party/skia/src/gpu/GrTextureAccess.cpp \
+	third_party/skia/src/gpu/gr_unittests.cpp \
+	third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrConvolutionEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrSingleTextureEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureDomainEffect.cpp \
+	third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp \
+	third_party/skia/src/gpu/gl/GrGLBufferImpl.cpp \
+	third_party/skia/src/gpu/gl/GrGLCaps.cpp \
+	third_party/skia/src/gpu/gl/GrGLContext.cpp \
+	third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffect.cpp \
+	third_party/skia/src/gpu/gl/GrGLExtensions.cpp \
+	third_party/skia/src/gpu/gl/GrGLEffectMatrix.cpp \
+	third_party/skia/src/gpu/gl/GrGLIndexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLNoOpInterface.cpp \
+	third_party/skia/src/gpu/gl/GrGLPath.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgram.cpp \
+	third_party/skia/src/gpu/gl/GrGLProgramDesc.cpp \
+	third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp \
+	third_party/skia/src/gpu/gl/GrGLShaderBuilder.cpp \
+	third_party/skia/src/gpu/gl/GrGLSL.cpp \
+	third_party/skia/src/gpu/gl/GrGLStencilBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGLTexture.cpp \
+	third_party/skia/src/gpu/gl/GrGLUtil.cpp \
+	third_party/skia/src/gpu/gl/GrGLUniformManager.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexArray.cpp \
+	third_party/skia/src/gpu/gl/GrGLVertexBuffer.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL.cpp \
+	third_party/skia/src/gpu/gl/GrGpuGL_program.cpp \
+	third_party/skia/src/gpu/SkGpuDevice.cpp \
+	third_party/skia/src/gpu/SkGr.cpp \
+	third_party/skia/src/gpu/SkGrFontScaler.cpp \
+	third_party/skia/src/gpu/SkGrPixelRef.cpp \
+	third_party/skia/src/gpu/SkGrTexturePixelRef.cpp \
+	third_party/skia/src/image/SkImage_Gpu.cpp \
+	third_party/skia/src/image/SkSurface_Gpu.cpp \
+	third_party/skia/src/gpu/gl/SkGLContextHelper.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-fno-stack-protector \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-Wno-format \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-fno-stack-protector \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer \
+	-fno-unwind-tables \
+	-fno-asynchronous-unwind-tables
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DENABLE_GPU=1' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_ALLOW_OVER_32K_BITMAPS' \
+	'-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0' \
+	'-DSK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK' \
+	'-DIGNORE_ROT_AA_RECT_OPT' \
+	'-DSK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)' \
+	'-DSK_GAMMA_APPLY_TO_A8' \
+	'-DSK_GAMMA_EXPONENT=1.4' \
+	'-DSK_GAMMA_CONTRAST=0.0' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/include/config \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/images \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/image \
+	$(LOCAL_PATH)/third_party/skia/src/sfnt \
+	$(LOCAL_PATH)/third_party/skia/src/utils \
+	$(LOCAL_PATH)/third_party/skia/src/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
+	$(LOCAL_PATH)/third_party/skia/src/gpu \
+	$(LOCAL_PATH)/third_party/expat/files/lib \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(PWD)/external/expat/lib \
+	$(LOCAL_PATH)/third_party/freetype/include \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--gc-sections \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: skia_skia_library_gyp
+
+# Alias gyp target name.
+.PHONY: skia_library
+skia_library: skia_skia_library_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/skia/skia_library_opts.gyp b/skia/skia_library_opts.gyp
new file mode 100644
index 0000000..f598361
--- /dev/null
+++ b/skia/skia_library_opts.gyp
@@ -0,0 +1,247 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+# This gyp file contains the platform-specific optimizations for Skia
+{
+  'targets': [
+    # Due to an unfortunate intersection of lameness between gcc and gyp,
+    # we have to build the *_SSE2.cpp files in a separate target.  The
+    # gcc lameness is that, in order to compile SSE2 intrinsics code, it
+    # must be passed the -msse2 flag.  However, with this flag, it may
+    # emit SSE2 instructions even for scalar code, such as the CPUID
+    # test used to test for the presence of SSE2.  So that, and all other
+    # code must be compiled *without* -msse2.  The gyp lameness is that it
+    # does not allow file-specific CFLAGS, so we must create this extra
+    # target for those files to be compiled with -msse2.
+    #
+    # This is actually only a problem on 32-bit Linux (all Intel Macs have
+    # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
+    # SSE2 from instrinsics, which generating plain ol' 386 for everything
+    # else).  However, to keep the .gyp file simple and avoid platform-specific
+    # build breakage, we do this on all platforms.
+
+    # For about the same reason, we need to compile the ARM opts files
+    # separately as well.
+    {
+      'target_name': 'skia_opts',
+      'type': 'static_library',
+      'include_dirs': [
+        'config',
+        '../third_party/skia/include/config',
+        '../third_party/skia/include/core',
+        '../third_party/skia/src/core',
+        '../third_party/skia/src/opts',
+      ],
+      'conditions': [
+        [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
+           target_arch != "arm" and target_arch != "mipsel"', {
+          'cflags': [
+            '-msse2',
+          ],
+        }],
+        [ 'target_arch != "arm" and target_arch != "mipsel"', {
+          'sources': [
+            '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
+            '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
+            '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
+            '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
+            '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp',
+          ],
+          'conditions': [
+            # x86 Android doesn't support SSSE3 instructions.
+            [ 'OS != "android"', {
+              'dependencies': [
+                'skia_opts_ssse3',
+              ],
+            }],
+          ],
+        }],
+        [ 'target_arch == "arm"', {
+          'conditions': [
+            [ 'arm_version >= 7 and arm_neon == 1', {
+              'defines': [
+                '__ARM_HAVE_NEON',
+              ],
+            }],
+            [ 'arm_version >= 7 and arm_neon_optional == 1', {
+              'defines': [
+                '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
+              ],
+            }],
+            [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
+              'cflags': [
+                # The neon assembly contains conditional instructions which
+                # aren't enclosed in an IT block. The assembler complains
+                # without this option.
+                # See #86592.
+                '-Wa,-mimplicit-it=always',
+              ],
+              'dependencies': [
+                'skia_opts_neon',
+              ]
+           }],
+          ],
+          # The assembly uses the frame pointer register (r7 in Thumb/r11 in
+          # ARM), the compiler doesn't like that. Explicitly remove the
+          # -fno-omit-frame-pointer flag for Android, as that gets added to all
+          # targets via common.gypi.
+          'cflags!': [
+            '-fno-omit-frame-pointer',
+            '-marm',
+            '-mapcs-frame',
+          ],
+          'cflags': [
+            '-fomit-frame-pointer',
+          ],
+          'sources': [
+            '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
+          ],
+        }],
+        [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_neon_optional == 1))', {
+          'sources': [
+            '../third_party/skia/src/opts/memset.arm.S',
+          ],
+        }],
+        [ 'target_arch == "arm" and arm_version < 6', {
+          'sources': [
+            '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
+            '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
+          ],
+        }],
+        [ 'target_arch == "arm" and arm_version >= 6', {
+          'sources': [
+            '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
+            '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
+            '../third_party/skia/src/opts/opts_check_arm.cpp',
+          ],
+        }],
+        [ 'target_arch == "mipsel"',{
+          'cflags': [
+            '-fomit-frame-pointer',
+          ],
+          'sources': [
+            '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
+            '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
+            '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
+          ],
+        }],
+      ],
+    },
+    # For the same lame reasons as what is done for skia_opts, we have to
+    # create another target specifically for SSSE3 code as we would not want
+    # to compile the SSE2 code with -mssse3 which would potentially allow
+    # gcc to generate SSSE3 code.
+    {
+      'target_name': 'skia_opts_ssse3',
+      'type': 'static_library',
+      'include_dirs': [
+        '..',
+        'config',
+        '../third_party/skia/include/config',
+        '../third_party/skia/include/core',
+        '../third_party/skia/src/core',
+      ],
+      'conditions': [
+        [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
+          'cflags': [
+            '-mssse3',
+          ],
+        }],
+        [ 'OS == "mac"', {
+          'xcode_settings': {
+            'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
+          },
+        }],
+        [ 'OS == "win"', {
+          'include_dirs': [
+            'config/win',
+          ],
+          'direct_dependent_settings': {
+            'include_dirs': [
+              'config/win',
+            ],
+          },
+        }],
+        [ 'target_arch != "arm" and target_arch != "mipsel"', {
+          'sources': [
+            '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'skia_opts_none',
+      'type': 'static_library',
+      'include_dirs': [
+        '..',
+        'config',
+        '../third_party/skia/include/config',
+        '../third_party/skia/include/core',
+        '../third_party/skia/src/core',
+      ],
+      'sources': [
+        '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
+        '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
+        '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
+      ],
+    },
+  ],
+  'conditions': [
+    # NEON code must be compiled with -mfpu=neon which also affects scalar
+    # code. To support dynamic NEON code paths, we need to build all
+    # NEON-specific sources in a separate static library. The situation
+    # is very similar to the SSSE3 one.
+    ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', {
+      'targets': [
+        {
+          'target_name': 'skia_opts_neon',
+          'type': 'static_library',
+          'include_dirs': [
+            '..',
+            'config',
+            '../third_party/skia/include/core',
+            '../third_party/skia/src/core',
+            '../third_party/skia/src/opts',
+          ],
+          'cflags!': [
+            '-fno-omit-frame-pointer',
+            '-mfpu=vfp',  # remove them all, just in case.
+            '-mfpu=vfpv3',
+            '-mfpu=vfpv3-d16',
+          ],
+          'cflags': [
+            '-mfpu=neon',
+            '-fomit-frame-pointer',
+          ],
+          'ldflags': [
+            '-march=armv7-a',
+            '-Wl,--fix-cortex-a8',
+          ],
+          'sources': [
+            '../third_party/skia/src/opts/memset16_neon.S',
+            '../third_party/skia/src/opts/memset32_neon.S',
+            '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
+            '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
+            '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h',
+            '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h',
+            '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
+          ],
+          'conditions': [
+            ['arm_neon == 1', {
+              'defines': [
+                '__ARM_HAVE_NEON',
+              ],
+            }],
+            ['arm_neon_optional == 1', {
+              'defines': [
+                '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
+              ],
+            }],
+          ],
+        },
+      ],
+    }],
+  ],
+}
diff --git a/skia/skia_opts.target.darwin-arm.mk b/skia/skia_opts.target.darwin-arm.mk
index 73233b4..aca7c09 100644
--- a/skia/skia_opts.target.darwin-arm.mk
+++ b/skia/skia_opts.target.darwin-arm.mk
@@ -76,11 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -94,16 +93,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -170,11 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -188,16 +181,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts.target.darwin-mips.mk b/skia/skia_opts.target.darwin-mips.mk
index a095d2a..8b7204f 100644
--- a/skia/skia_opts.target.darwin-mips.mk
+++ b/skia/skia_opts.target.darwin-mips.mk
@@ -17,13 +17,9 @@
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/convolver_mips_dspr2.cpp: $(LOCAL_PATH)/skia/ext/convolver_mips_dspr2.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/convolver_mips_dspr2.cpp
+LOCAL_GENERATED_SOURCES :=
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
 	third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp \
@@ -78,11 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -95,16 +90,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -170,11 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -187,16 +176,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts.target.darwin-x86.mk b/skia/skia_opts.target.darwin-x86.mk
index ff32e2e..69be1ce 100644
--- a/skia/skia_opts.target.darwin-x86.mk
+++ b/skia/skia_opts.target.darwin-x86.mk
@@ -17,13 +17,9 @@
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/convolver_SSE2.cpp: $(LOCAL_PATH)/skia/ext/convolver_SSE2.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/convolver_SSE2.cpp
+LOCAL_GENERATED_SOURCES :=
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
 	third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp \
@@ -81,11 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -98,16 +93,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -175,11 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -192,16 +181,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts.target.linux-arm.mk b/skia/skia_opts.target.linux-arm.mk
index 73233b4..aca7c09 100644
--- a/skia/skia_opts.target.linux-arm.mk
+++ b/skia/skia_opts.target.linux-arm.mk
@@ -76,11 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -94,16 +93,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -170,11 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -188,16 +181,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts.target.linux-mips.mk b/skia/skia_opts.target.linux-mips.mk
index a095d2a..8b7204f 100644
--- a/skia/skia_opts.target.linux-mips.mk
+++ b/skia/skia_opts.target.linux-mips.mk
@@ -17,13 +17,9 @@
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/convolver_mips_dspr2.cpp: $(LOCAL_PATH)/skia/ext/convolver_mips_dspr2.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/convolver_mips_dspr2.cpp
+LOCAL_GENERATED_SOURCES :=
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
 	third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp \
@@ -78,11 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -95,16 +90,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -170,11 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -187,16 +176,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts.target.linux-x86.mk b/skia/skia_opts.target.linux-x86.mk
index ff32e2e..69be1ce 100644
--- a/skia/skia_opts.target.linux-x86.mk
+++ b/skia/skia_opts.target.linux-x86.mk
@@ -17,13 +17,9 @@
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-$(gyp_intermediate_dir)/convolver_SSE2.cpp: $(LOCAL_PATH)/skia/ext/convolver_SSE2.cc
-	mkdir -p $(@D); cp $< $@
-LOCAL_GENERATED_SOURCES := \
-	$(gyp_intermediate_dir)/convolver_SSE2.cpp
+LOCAL_GENERATED_SOURCES :=
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS := \
-	$(LOCAL_PATH)/skia/ext
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
 	third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp \
@@ -81,11 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -98,16 +93,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Debug := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -175,11 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_FOR_ANDROID' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -192,16 +181,11 @@
 
 # Include paths placed before CFLAGS/CPPFLAGS
 LOCAL_C_INCLUDES_Release := \
-	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/images \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/src/opts \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/skia/skia_opts_neon.target.darwin-arm.mk b/skia/skia_opts_neon.target.darwin-arm.mk
index 881b556..ebe2fbc 100644
--- a/skia/skia_opts_neon.target.darwin-arm.mk
+++ b/skia/skia_opts_neon.target.darwin-arm.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -96,7 +96,6 @@
 LOCAL_C_INCLUDES_Debug := \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/src/opts \
@@ -166,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -185,7 +184,6 @@
 LOCAL_C_INCLUDES_Release := \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/src/opts \
diff --git a/skia/skia_opts_neon.target.linux-arm.mk b/skia/skia_opts_neon.target.linux-arm.mk
index 881b556..ebe2fbc 100644
--- a/skia/skia_opts_neon.target.linux-arm.mk
+++ b/skia/skia_opts_neon.target.linux-arm.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -96,7 +96,6 @@
 LOCAL_C_INCLUDES_Debug := \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/src/opts \
@@ -166,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__ARM_HAVE_OPTIONAL_NEON_SUPPORT' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -185,7 +184,6 @@
 LOCAL_C_INCLUDES_Release := \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/src/opts \
diff --git a/skia/skia_test_expectations.txt b/skia/skia_test_expectations.txt
index 559db8c..98b9625 100644
--- a/skia/skia_test_expectations.txt
+++ b/skia/skia_test_expectations.txt
@@ -48,14 +48,7 @@
 #
 # START OVERRIDES HERE
 
-# r9928 fixed arc end capping but caused some minor image differences
-# in the following 6 layout tests  
-crbug.com/258850 svg/W3C-SVG-1.1/paths-data-10-t.svg [ ImageOnlyFailure ]
-crbug.com/258850 svg/W3C-SVG-1.1/struct-group-03-t.svg [ ImageOnlyFailure ]
-crbug.com/258850 svg/as-background-image/svg-as-background-6.html [ ImageOnlyFailure ]
-crbug.com/258850 svg/custom/marker-opacity.svg [ ImageOnlyFailure ]
-
-crbug.com/258850 svg/batik/text/smallFonts.svg [ ImageOnlyFailure ]
-crbug.com/258850 svg/batik/text/textFeatures.svg [ ImageOnlyFailure ]
+# Image scaling difference due to ongoing Skia image resizing changes
+crbug.com/263331 virtual/deferred/fast/images/webp-color-profile-lossy.html [ ImageOnlyFailure ]
 
 # END OVERRIDES HERE (this line ensures that the file is newline-terminated)
diff --git a/sql/connection.cc b/sql/connection.cc
index c10f5a7..3bc2545 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -272,8 +272,12 @@
     // TODO(paivanof@gmail.com): This should move to the beginning
     // of the function. http://crbug.com/136655.
     AssertIOAllowed();
-    // TODO(shess): Histogram for failure.
-    sqlite3_close(db_);
+
+    int rc = sqlite3_close(db_);
+    if (rc != SQLITE_OK) {
+      UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.CloseFailure", rc);
+      DLOG(FATAL) << "sqlite3_close failed: " << GetErrorMessage();
+    }
   }
   db_ = NULL;
 }
@@ -829,9 +833,13 @@
 
   int err = sqlite3_open(file_name.c_str(), &db_);
   if (err != SQLITE_OK) {
+    // Extended error codes cannot be enabled until a handle is
+    // available, fetch manually.
+    err = sqlite3_extended_errcode(db_);
+
     // Histogram failures specific to initial open for debugging
     // purposes.
-    UMA_HISTOGRAM_ENUMERATION("Sqlite.OpenFailure", err & 0xff, 50);
+    UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.OpenFailure", err);
 
     OnSqliteError(err, NULL);
     bool was_poisoned = poisoned_;
@@ -873,6 +881,14 @@
   // statements are run.
   sqlite3_db_config(db_, SQLITE_DBCONFIG_LOOKASIDE, NULL, 0, 0);
 
+  // Enable extended result codes to provide more color on I/O errors.
+  // Not having extended result codes is not a fatal problem, as
+  // Chromium code does not attempt to handle I/O errors anyhow.  The
+  // current implementation always returns SQLITE_OK, the DCHECK is to
+  // quickly notify someone if SQLite changes.
+  err = sqlite3_extended_result_codes(db_, 1);
+  DCHECK_EQ(err, SQLITE_OK) << "Could not enable extended result codes";
+
   // sqlite3_open() does not actually read the database file (unless a
   // hot journal is found).  Successfully executing this pragma on an
   // existing database requires a valid header on page 1.
@@ -881,15 +897,7 @@
   // be razed.
   err = ExecuteAndReturnErrorCode("PRAGMA auto_vacuum");
   if (err != SQLITE_OK)
-    UMA_HISTOGRAM_ENUMERATION("Sqlite.OpenProbeFailure", err & 0xff, 50);
-
-  // Enable extended result codes to provide more color on I/O errors.
-  // Not having extended result codes is not a fatal problem, as
-  // Chromium code does not attempt to handle I/O errors anyhow.  The
-  // current implementation always returns SQLITE_OK, the DCHECK is to
-  // quickly notify someone if SQLite changes.
-  err = sqlite3_extended_result_codes(db_, 1);
-  DCHECK_EQ(err, SQLITE_OK) << "Could not enable extended result codes";
+    UMA_HISTOGRAM_SPARSE_SLOWLY("Sqlite.OpenProbeFailure", err);
 
 #if defined(OS_IOS) && defined(USE_SYSTEM_SQLITE)
   // The version of SQLite shipped with iOS doesn't enable ICU, which includes
diff --git a/sql/sql.target.darwin-arm.mk b/sql/sql.target.darwin-arm.mk
index 484a63d..ea9f12e 100644
--- a/sql/sql.target.darwin-arm.mk
+++ b/sql/sql.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sql/sql.target.darwin-mips.mk b/sql/sql.target.darwin-mips.mk
index 26eb064..1de2ede 100644
--- a/sql/sql.target.darwin-mips.mk
+++ b/sql/sql.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sql/sql.target.darwin-x86.mk b/sql/sql.target.darwin-x86.mk
index ea2fcf2..83970d1 100644
--- a/sql/sql.target.darwin-x86.mk
+++ b/sql/sql.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sql/sql.target.linux-arm.mk b/sql/sql.target.linux-arm.mk
index 484a63d..ea9f12e 100644
--- a/sql/sql.target.linux-arm.mk
+++ b/sql/sql.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sql/sql.target.linux-mips.mk b/sql/sql.target.linux-mips.mk
index 26eb064..1de2ede 100644
--- a/sql/sql.target.linux-mips.mk
+++ b/sql/sql.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sql/sql.target.linux-x86.mk b/sql/sql.target.linux-x86.mk
index ea2fcf2..83970d1 100644
--- a/sql/sql.target.linux-x86.mk
+++ b/sql/sql.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSQL_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/sync/protocol/synced_notification_render.proto b/sync/protocol/synced_notification_render.proto
index 46d890f..5ee073e 100644
--- a/sync/protocol/synced_notification_render.proto
+++ b/sync/protocol/synced_notification_render.proto
@@ -36,6 +36,11 @@
   optional SyncedNotificationDestination default_destination = 3;
 
   repeated Target target = 4;
+
+  // Defines a repeated list of meta tags that provide some context on what
+  // this collapsed info is describing. Nothing about the display of this
+  // collapsed info is defined by the meta tags.
+  repeated string meta_tag = 5;
 }
 
 // Render information for the expanded (detail) view of a coalesced
@@ -45,6 +50,13 @@
 
   // Collapsed information for each notification in the coalesced group.
   repeated CollapsedInfo collapsed_info = 2;
+
+  // A set of targets for actions the user can take, or destinations the
+  // viewer can be taken to. These relate to the coalesced notification.
+  repeated Target target = 3;
+
+  // Enhanced context for the expanded view.
+  repeated string meta_tag = 4;
 }
 
 message SimpleCollapsedLayout {
@@ -60,6 +72,13 @@
 
   // Description - often the action that generated the notification.
   optional string description = 4;
+
+  // Media - one or more shared media items.
+  repeated Media media = 5;
+
+  // Annotation - often the annotation of the entity generating the
+  // notification.
+  optional string annotation = 6;
 }
 
 message SimpleExpandedLayout {
@@ -134,6 +153,10 @@
 
   // Optional label to aid accessibility.
   optional string accessibility_label= 5;
+
+  // Defines a repeated list of meta tags that provide some context on this
+  // action. Nothing about the display of this action is defined by the tags.
+  repeated string meta_tag = 6;
 }
 
 message SyncedNotificationImage {
diff --git a/sync/tools/testserver/run_sync_testserver.cc b/sync/tools/testserver/run_sync_testserver.cc
index 94a0d16..0089963 100644
--- a/sync/tools/testserver/run_sync_testserver.cc
+++ b/sync/tools/testserver/run_sync_testserver.cc
@@ -9,7 +9,7 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/test/test_timeouts.h"
 #include "net/test/python_utils.h"
diff --git a/testing/gtest_prod.target.darwin-arm.mk b/testing/gtest_prod.target.darwin-arm.mk
index 3b5d9dd..75b5865 100644
--- a/testing/gtest_prod.target.darwin-arm.mk
+++ b/testing/gtest_prod.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/testing/gtest_prod.target.darwin-mips.mk b/testing/gtest_prod.target.darwin-mips.mk
index f223dbd..0b0c2af 100644
--- a/testing/gtest_prod.target.darwin-mips.mk
+++ b/testing/gtest_prod.target.darwin-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/testing/gtest_prod.target.darwin-x86.mk b/testing/gtest_prod.target.darwin-x86.mk
index 61539b6..f290eff 100644
--- a/testing/gtest_prod.target.darwin-x86.mk
+++ b/testing/gtest_prod.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/testing/gtest_prod.target.linux-arm.mk b/testing/gtest_prod.target.linux-arm.mk
index 3b5d9dd..75b5865 100644
--- a/testing/gtest_prod.target.linux-arm.mk
+++ b/testing/gtest_prod.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/testing/gtest_prod.target.linux-mips.mk b/testing/gtest_prod.target.linux-mips.mk
index f223dbd..0b0c2af 100644
--- a/testing/gtest_prod.target.linux-mips.mk
+++ b/testing/gtest_prod.target.linux-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/testing/gtest_prod.target.linux-x86.mk b/testing/gtest_prod.target.linux-x86.mk
index 61539b6..f290eff 100644
--- a/testing/gtest_prod.target.linux-x86.mk
+++ b/testing/gtest_prod.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-arm.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-arm.mk
index 8e86468..2e745b8 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-arm.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-arm.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -187,10 +187,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-mips.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-mips.mk
index b5dce12..60f52b5 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-mips.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-mips.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -187,10 +187,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-x86.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-x86.mk
index 6faa01c..87fc840 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-x86.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.darwin-x86.mk
@@ -101,10 +101,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-arm.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-arm.mk
index 8e86468..2e745b8 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-arm.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-arm.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -187,10 +187,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-mips.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-mips.mk
index b5dce12..60f52b5 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-mips.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-mips.mk
@@ -99,10 +99,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -187,10 +187,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-x86.mk b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-x86.mk
index 6faa01c..87fc840 100644
--- a/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-x86.mk
+++ b/third_party/harfbuzz-ng/harfbuzz-ng.target.linux-x86.mk
@@ -101,10 +101,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_OT' \
 	'-DHAVE_ICU' \
 	'-DHB_NO_MT' \
diff --git a/third_party/hyphen/hyphen.target.darwin-arm.mk b/third_party/hyphen/hyphen.target.darwin-arm.mk
index 5133276..ec994c2 100644
--- a/third_party/hyphen/hyphen.target.darwin-arm.mk
+++ b/third_party/hyphen/hyphen.target.darwin-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/hyphen/hyphen.target.darwin-mips.mk b/third_party/hyphen/hyphen.target.darwin-mips.mk
index c7b47e9..c7a72cc 100644
--- a/third_party/hyphen/hyphen.target.darwin-mips.mk
+++ b/third_party/hyphen/hyphen.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/hyphen/hyphen.target.darwin-x86.mk b/third_party/hyphen/hyphen.target.darwin-x86.mk
index 8f24b2c..dde8f2a 100644
--- a/third_party/hyphen/hyphen.target.darwin-x86.mk
+++ b/third_party/hyphen/hyphen.target.darwin-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/hyphen/hyphen.target.linux-arm.mk b/third_party/hyphen/hyphen.target.linux-arm.mk
index 5133276..ec994c2 100644
--- a/third_party/hyphen/hyphen.target.linux-arm.mk
+++ b/third_party/hyphen/hyphen.target.linux-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/hyphen/hyphen.target.linux-mips.mk b/third_party/hyphen/hyphen.target.linux-mips.mk
index c7b47e9..c7a72cc 100644
--- a/third_party/hyphen/hyphen.target.linux-mips.mk
+++ b/third_party/hyphen/hyphen.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/hyphen/hyphen.target.linux-x86.mk b/third_party/hyphen/hyphen.target.linux-x86.mk
index 8f24b2c..dde8f2a 100644
--- a/third_party/hyphen/hyphen.target.linux-x86.mk
+++ b/third_party/hyphen/hyphen.target.linux-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.darwin-arm.mk b/third_party/iccjpeg/iccjpeg.target.darwin-arm.mk
index 3878c65..82d9625 100644
--- a/third_party/iccjpeg/iccjpeg.target.darwin-arm.mk
+++ b/third_party/iccjpeg/iccjpeg.target.darwin-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.darwin-mips.mk b/third_party/iccjpeg/iccjpeg.target.darwin-mips.mk
index 39e652f..8a5dfd1 100644
--- a/third_party/iccjpeg/iccjpeg.target.darwin-mips.mk
+++ b/third_party/iccjpeg/iccjpeg.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.darwin-x86.mk b/third_party/iccjpeg/iccjpeg.target.darwin-x86.mk
index b18c7dd..c94e995 100644
--- a/third_party/iccjpeg/iccjpeg.target.darwin-x86.mk
+++ b/third_party/iccjpeg/iccjpeg.target.darwin-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.linux-arm.mk b/third_party/iccjpeg/iccjpeg.target.linux-arm.mk
index 3878c65..82d9625 100644
--- a/third_party/iccjpeg/iccjpeg.target.linux-arm.mk
+++ b/third_party/iccjpeg/iccjpeg.target.linux-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.linux-mips.mk b/third_party/iccjpeg/iccjpeg.target.linux-mips.mk
index 39e652f..8a5dfd1 100644
--- a/third_party/iccjpeg/iccjpeg.target.linux-mips.mk
+++ b/third_party/iccjpeg/iccjpeg.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -154,10 +154,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/iccjpeg/iccjpeg.target.linux-x86.mk b/third_party/iccjpeg/iccjpeg.target.linux-x86.mk
index b18c7dd..c94e995 100644
--- a/third_party/iccjpeg/iccjpeg.target.linux-x86.mk
+++ b/third_party/iccjpeg/iccjpeg.target.linux-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_SYSTEM_LIBJPEG' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.darwin-arm.mk b/third_party/leveldatabase/leveldatabase.target.darwin-arm.mk
index bbba4c7..ae4f9fa 100644
--- a/third_party/leveldatabase/leveldatabase.target.darwin-arm.mk
+++ b/third_party/leveldatabase/leveldatabase.target.darwin-arm.mk
@@ -109,10 +109,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -196,10 +196,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.darwin-mips.mk b/third_party/leveldatabase/leveldatabase.target.darwin-mips.mk
index 787a33a..4a3edc1 100644
--- a/third_party/leveldatabase/leveldatabase.target.darwin-mips.mk
+++ b/third_party/leveldatabase/leveldatabase.target.darwin-mips.mk
@@ -109,10 +109,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -196,10 +196,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.darwin-x86.mk b/third_party/leveldatabase/leveldatabase.target.darwin-x86.mk
index e4afb13..47673f8 100644
--- a/third_party/leveldatabase/leveldatabase.target.darwin-x86.mk
+++ b/third_party/leveldatabase/leveldatabase.target.darwin-x86.mk
@@ -111,10 +111,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -201,10 +201,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.linux-arm.mk b/third_party/leveldatabase/leveldatabase.target.linux-arm.mk
index bbba4c7..ae4f9fa 100644
--- a/third_party/leveldatabase/leveldatabase.target.linux-arm.mk
+++ b/third_party/leveldatabase/leveldatabase.target.linux-arm.mk
@@ -109,10 +109,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -196,10 +196,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.linux-mips.mk b/third_party/leveldatabase/leveldatabase.target.linux-mips.mk
index 787a33a..4a3edc1 100644
--- a/third_party/leveldatabase/leveldatabase.target.linux-mips.mk
+++ b/third_party/leveldatabase/leveldatabase.target.linux-mips.mk
@@ -109,10 +109,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -196,10 +196,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/leveldatabase/leveldatabase.target.linux-x86.mk b/third_party/leveldatabase/leveldatabase.target.linux-x86.mk
index e4afb13..47673f8 100644
--- a/third_party/leveldatabase/leveldatabase.target.linux-x86.mk
+++ b/third_party/leveldatabase/leveldatabase.target.linux-x86.mk
@@ -111,10 +111,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -201,10 +201,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libevent/libevent.target.darwin-arm.mk b/third_party/libevent/libevent.target.darwin-arm.mk
index 1780910..6687649 100644
--- a/third_party/libevent/libevent.target.darwin-arm.mk
+++ b/third_party/libevent/libevent.target.darwin-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libevent/libevent.target.darwin-mips.mk b/third_party/libevent/libevent.target.darwin-mips.mk
index 5ec58eb..908f4ae 100644
--- a/third_party/libevent/libevent.target.darwin-mips.mk
+++ b/third_party/libevent/libevent.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libevent/libevent.target.darwin-x86.mk b/third_party/libevent/libevent.target.darwin-x86.mk
index 85e2d46..d8c8d65 100644
--- a/third_party/libevent/libevent.target.darwin-x86.mk
+++ b/third_party/libevent/libevent.target.darwin-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libevent/libevent.target.linux-arm.mk b/third_party/libevent/libevent.target.linux-arm.mk
index 1780910..6687649 100644
--- a/third_party/libevent/libevent.target.linux-arm.mk
+++ b/third_party/libevent/libevent.target.linux-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libevent/libevent.target.linux-mips.mk b/third_party/libevent/libevent.target.linux-mips.mk
index 5ec58eb..908f4ae 100644
--- a/third_party/libevent/libevent.target.linux-mips.mk
+++ b/third_party/libevent/libevent.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libevent/libevent.target.linux-x86.mk b/third_party/libevent/libevent.target.linux-x86.mk
index 85e2d46..d8c8d65 100644
--- a/third_party/libevent/libevent.target.linux-x86.mk
+++ b/third_party/libevent/libevent.target.linux-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle.target.darwin-arm.mk b/third_party/libjingle/libjingle.target.darwin-arm.mk
index 9b0f085..05a0ee7 100644
--- a/third_party/libjingle/libjingle.target.darwin-arm.mk
+++ b/third_party/libjingle/libjingle.target.darwin-arm.mk
@@ -204,10 +204,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
@@ -315,10 +315,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
diff --git a/third_party/libjingle/libjingle.target.darwin-mips.mk b/third_party/libjingle/libjingle.target.darwin-mips.mk
index a2a00ad..9dee31a 100644
--- a/third_party/libjingle/libjingle.target.darwin-mips.mk
+++ b/third_party/libjingle/libjingle.target.darwin-mips.mk
@@ -204,10 +204,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
@@ -315,10 +315,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
diff --git a/third_party/libjingle/libjingle.target.darwin-x86.mk b/third_party/libjingle/libjingle.target.darwin-x86.mk
index b77b523..a5702d9 100644
--- a/third_party/libjingle/libjingle.target.darwin-x86.mk
+++ b/third_party/libjingle/libjingle.target.darwin-x86.mk
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -319,10 +319,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle.target.linux-arm.mk b/third_party/libjingle/libjingle.target.linux-arm.mk
index 9b0f085..05a0ee7 100644
--- a/third_party/libjingle/libjingle.target.linux-arm.mk
+++ b/third_party/libjingle/libjingle.target.linux-arm.mk
@@ -204,10 +204,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
@@ -315,10 +315,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
diff --git a/third_party/libjingle/libjingle.target.linux-mips.mk b/third_party/libjingle/libjingle.target.linux-mips.mk
index a2a00ad..9dee31a 100644
--- a/third_party/libjingle/libjingle.target.linux-mips.mk
+++ b/third_party/libjingle/libjingle.target.linux-mips.mk
@@ -204,10 +204,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
@@ -315,10 +315,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
diff --git a/third_party/libjingle/libjingle.target.linux-x86.mk b/third_party/libjingle/libjingle.target.linux-x86.mk
index b77b523..a5702d9 100644
--- a/third_party/libjingle/libjingle.target.linux-x86.mk
+++ b/third_party/libjingle/libjingle.target.linux-x86.mk
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -319,10 +319,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DFEATURE_ENABLE_VOICEMAIL' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.darwin-arm.mk b/third_party/libjingle/libjingle_p2p_constants.target.darwin-arm.mk
index cee6a76..9dc3599 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.darwin-arm.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.darwin-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -199,10 +199,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.darwin-mips.mk b/third_party/libjingle/libjingle_p2p_constants.target.darwin-mips.mk
index bd63509..22ec86a 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.darwin-mips.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.darwin-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -199,10 +199,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.darwin-x86.mk b/third_party/libjingle/libjingle_p2p_constants.target.darwin-x86.mk
index 1694700..bebfda8 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.darwin-x86.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.darwin-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -203,10 +203,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.linux-arm.mk b/third_party/libjingle/libjingle_p2p_constants.target.linux-arm.mk
index cee6a76..9dc3599 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.linux-arm.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.linux-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -199,10 +199,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.linux-mips.mk b/third_party/libjingle/libjingle_p2p_constants.target.linux-mips.mk
index bd63509..22ec86a 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.linux-mips.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.linux-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -199,10 +199,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/libjingle/libjingle_p2p_constants.target.linux-x86.mk b/third_party/libjingle/libjingle_p2p_constants.target.linux-x86.mk
index 1694700..bebfda8 100644
--- a/third_party/libjingle/libjingle_p2p_constants.target.linux-x86.mk
+++ b/third_party/libjingle/libjingle_p2p_constants.target.linux-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -203,10 +203,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libphonenumber/libphonenumber.target.darwin-arm.mk b/third_party/libphonenumber/libphonenumber.target.darwin-arm.mk
index a10b322..cc12f05 100644
--- a/third_party/libphonenumber/libphonenumber.target.darwin-arm.mk
+++ b/third_party/libphonenumber/libphonenumber.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber.target.darwin-mips.mk b/third_party/libphonenumber/libphonenumber.target.darwin-mips.mk
index aa74acd..cbc0269 100644
--- a/third_party/libphonenumber/libphonenumber.target.darwin-mips.mk
+++ b/third_party/libphonenumber/libphonenumber.target.darwin-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber.target.darwin-x86.mk b/third_party/libphonenumber/libphonenumber.target.darwin-x86.mk
index 2ba480f..7892047 100644
--- a/third_party/libphonenumber/libphonenumber.target.darwin-x86.mk
+++ b/third_party/libphonenumber/libphonenumber.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber.target.linux-arm.mk b/third_party/libphonenumber/libphonenumber.target.linux-arm.mk
index a10b322..cc12f05 100644
--- a/third_party/libphonenumber/libphonenumber.target.linux-arm.mk
+++ b/third_party/libphonenumber/libphonenumber.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber.target.linux-mips.mk b/third_party/libphonenumber/libphonenumber.target.linux-mips.mk
index aa74acd..cbc0269 100644
--- a/third_party/libphonenumber/libphonenumber.target.linux-mips.mk
+++ b/third_party/libphonenumber/libphonenumber.target.linux-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber.target.linux-x86.mk b/third_party/libphonenumber/libphonenumber.target.linux-x86.mk
index 2ba480f..7892047 100644
--- a/third_party/libphonenumber/libphonenumber.target.linux-x86.mk
+++ b/third_party/libphonenumber/libphonenumber.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-arm.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-arm.mk
index 1dd5236..2fbd3a9 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-arm.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-arm.mk
@@ -138,10 +138,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-mips.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-mips.mk
index de0ac1a..c043544 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-mips.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-mips.mk
@@ -138,10 +138,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-x86.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-x86.mk
index 12b069e..4df2595 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-x86.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.darwin-x86.mk
@@ -140,10 +140,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -239,10 +239,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-arm.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-arm.mk
index 1dd5236..2fbd3a9 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-arm.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-arm.mk
@@ -138,10 +138,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-mips.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-mips.mk
index de0ac1a..c043544 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-mips.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-mips.mk
@@ -138,10 +138,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-x86.mk b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-x86.mk
index 12b069e..4df2595 100644
--- a/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-x86.mk
+++ b/third_party/libphonenumber/libphonenumber_without_metadata.target.linux-x86.mk
@@ -140,10 +140,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -239,10 +239,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/libpng/libpng.target.darwin-arm.mk b/third_party/libpng/libpng.target.darwin-arm.mk
index e36445b..f515fac 100644
--- a/third_party/libpng/libpng.target.darwin-arm.mk
+++ b/third_party/libpng/libpng.target.darwin-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libpng/libpng.target.darwin-mips.mk b/third_party/libpng/libpng.target.darwin-mips.mk
index 4f4a7db..6aeb593 100644
--- a/third_party/libpng/libpng.target.darwin-mips.mk
+++ b/third_party/libpng/libpng.target.darwin-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libpng/libpng.target.darwin-x86.mk b/third_party/libpng/libpng.target.darwin-x86.mk
index 4f8d445..3f6e819 100644
--- a/third_party/libpng/libpng.target.darwin-x86.mk
+++ b/third_party/libpng/libpng.target.darwin-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libpng/libpng.target.linux-arm.mk b/third_party/libpng/libpng.target.linux-arm.mk
index e36445b..f515fac 100644
--- a/third_party/libpng/libpng.target.linux-arm.mk
+++ b/third_party/libpng/libpng.target.linux-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libpng/libpng.target.linux-mips.mk b/third_party/libpng/libpng.target.linux-mips.mk
index 4f4a7db..6aeb593 100644
--- a/third_party/libpng/libpng.target.linux-mips.mk
+++ b/third_party/libpng/libpng.target.linux-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libpng/libpng.target.linux-x86.mk b/third_party/libpng/libpng.target.linux-x86.mk
index 4f8d445..3f6e819 100644
--- a/third_party/libpng/libpng.target.linux-x86.mk
+++ b/third_party/libpng/libpng.target.linux-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
 	'-DANDROID' \
diff --git a/third_party/libwebp/libwebp_dec.target.darwin-arm.mk b/third_party/libwebp/libwebp_dec.target.darwin-arm.mk
index 38e062c..5975362 100644
--- a/third_party/libwebp/libwebp_dec.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_dec.target.darwin-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dec.target.darwin-mips.mk b/third_party/libwebp/libwebp_dec.target.darwin-mips.mk
index db6a83b..4ac32ad 100644
--- a/third_party/libwebp/libwebp_dec.target.darwin-mips.mk
+++ b/third_party/libwebp/libwebp_dec.target.darwin-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dec.target.darwin-x86.mk b/third_party/libwebp/libwebp_dec.target.darwin-x86.mk
index e285a69..1a1009f 100644
--- a/third_party/libwebp/libwebp_dec.target.darwin-x86.mk
+++ b/third_party/libwebp/libwebp_dec.target.darwin-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dec.target.linux-arm.mk b/third_party/libwebp/libwebp_dec.target.linux-arm.mk
index 38e062c..5975362 100644
--- a/third_party/libwebp/libwebp_dec.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_dec.target.linux-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dec.target.linux-mips.mk b/third_party/libwebp/libwebp_dec.target.linux-mips.mk
index db6a83b..4ac32ad 100644
--- a/third_party/libwebp/libwebp_dec.target.linux-mips.mk
+++ b/third_party/libwebp/libwebp_dec.target.linux-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dec.target.linux-x86.mk b/third_party/libwebp/libwebp_dec.target.linux-x86.mk
index e285a69..1a1009f 100644
--- a/third_party/libwebp/libwebp_dec.target.linux-x86.mk
+++ b/third_party/libwebp/libwebp_dec.target.linux-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.darwin-arm.mk b/third_party/libwebp/libwebp_demux.target.darwin-arm.mk
index 6db06a7..e8b4026 100644
--- a/third_party/libwebp/libwebp_demux.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_demux.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.darwin-mips.mk b/third_party/libwebp/libwebp_demux.target.darwin-mips.mk
index c0dcf21..93d9f62 100644
--- a/third_party/libwebp/libwebp_demux.target.darwin-mips.mk
+++ b/third_party/libwebp/libwebp_demux.target.darwin-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.darwin-x86.mk b/third_party/libwebp/libwebp_demux.target.darwin-x86.mk
index cdcaa28..eac76d5 100644
--- a/third_party/libwebp/libwebp_demux.target.darwin-x86.mk
+++ b/third_party/libwebp/libwebp_demux.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.linux-arm.mk b/third_party/libwebp/libwebp_demux.target.linux-arm.mk
index 6db06a7..e8b4026 100644
--- a/third_party/libwebp/libwebp_demux.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_demux.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.linux-mips.mk b/third_party/libwebp/libwebp_demux.target.linux-mips.mk
index c0dcf21..93d9f62 100644
--- a/third_party/libwebp/libwebp_demux.target.linux-mips.mk
+++ b/third_party/libwebp/libwebp_demux.target.linux-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -152,10 +152,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_demux.target.linux-x86.mk b/third_party/libwebp/libwebp_demux.target.linux-x86.mk
index cdcaa28..eac76d5 100644
--- a/third_party/libwebp/libwebp_demux.target.linux-x86.mk
+++ b/third_party/libwebp/libwebp_demux.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.darwin-arm.mk b/third_party/libwebp/libwebp_dsp.target.darwin-arm.mk
index bae10f7..7912563 100644
--- a/third_party/libwebp/libwebp_dsp.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_dsp.target.darwin-arm.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.darwin-mips.mk b/third_party/libwebp/libwebp_dsp.target.darwin-mips.mk
index 43f7d4e..42685e5 100644
--- a/third_party/libwebp/libwebp_dsp.target.darwin-mips.mk
+++ b/third_party/libwebp/libwebp_dsp.target.darwin-mips.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.darwin-x86.mk b/third_party/libwebp/libwebp_dsp.target.darwin-x86.mk
index ad896da..80445d4 100644
--- a/third_party/libwebp/libwebp_dsp.target.darwin-x86.mk
+++ b/third_party/libwebp/libwebp_dsp.target.darwin-x86.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.linux-arm.mk b/third_party/libwebp/libwebp_dsp.target.linux-arm.mk
index bae10f7..7912563 100644
--- a/third_party/libwebp/libwebp_dsp.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_dsp.target.linux-arm.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.linux-mips.mk b/third_party/libwebp/libwebp_dsp.target.linux-mips.mk
index 43f7d4e..42685e5 100644
--- a/third_party/libwebp/libwebp_dsp.target.linux-mips.mk
+++ b/third_party/libwebp/libwebp_dsp.target.linux-mips.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp.target.linux-x86.mk b/third_party/libwebp/libwebp_dsp.target.linux-x86.mk
index ad896da..80445d4 100644
--- a/third_party/libwebp/libwebp_dsp.target.linux-x86.mk
+++ b/third_party/libwebp/libwebp_dsp.target.linux-x86.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -165,10 +165,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp_neon.target.darwin-arm.mk b/third_party/libwebp/libwebp_dsp_neon.target.darwin-arm.mk
index b450b87..a3695d5 100644
--- a/third_party/libwebp/libwebp_dsp_neon.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_dsp_neon.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_dsp_neon.target.linux-arm.mk b/third_party/libwebp/libwebp_dsp_neon.target.linux-arm.mk
index b450b87..a3695d5 100644
--- a/third_party/libwebp/libwebp_dsp_neon.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_dsp_neon.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.darwin-arm.mk b/third_party/libwebp/libwebp_enc.target.darwin-arm.mk
index 10cde58..9aa36d1 100644
--- a/third_party/libwebp/libwebp_enc.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_enc.target.darwin-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.darwin-mips.mk b/third_party/libwebp/libwebp_enc.target.darwin-mips.mk
index c69afde..52a9267 100644
--- a/third_party/libwebp/libwebp_enc.target.darwin-mips.mk
+++ b/third_party/libwebp/libwebp_enc.target.darwin-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.darwin-x86.mk b/third_party/libwebp/libwebp_enc.target.darwin-x86.mk
index 6b80b37..04855fd 100644
--- a/third_party/libwebp/libwebp_enc.target.darwin-x86.mk
+++ b/third_party/libwebp/libwebp_enc.target.darwin-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.linux-arm.mk b/third_party/libwebp/libwebp_enc.target.linux-arm.mk
index 10cde58..9aa36d1 100644
--- a/third_party/libwebp/libwebp_enc.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_enc.target.linux-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.linux-mips.mk b/third_party/libwebp/libwebp_enc.target.linux-mips.mk
index c69afde..52a9267 100644
--- a/third_party/libwebp/libwebp_enc.target.linux-mips.mk
+++ b/third_party/libwebp/libwebp_enc.target.linux-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_enc.target.linux-x86.mk b/third_party/libwebp/libwebp_enc.target.linux-x86.mk
index 6b80b37..04855fd 100644
--- a/third_party/libwebp/libwebp_enc.target.linux-x86.mk
+++ b/third_party/libwebp/libwebp_enc.target.linux-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -173,10 +173,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.darwin-arm.mk b/third_party/libwebp/libwebp_utils.target.darwin-arm.mk
index d7a2013..b6e3eba 100644
--- a/third_party/libwebp/libwebp_utils.target.darwin-arm.mk
+++ b/third_party/libwebp/libwebp_utils.target.darwin-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.darwin-mips.mk b/third_party/libwebp/libwebp_utils.target.darwin-mips.mk
index 70765ae..f4b42b3 100644
--- a/third_party/libwebp/libwebp_utils.target.darwin-mips.mk
+++ b/third_party/libwebp/libwebp_utils.target.darwin-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.darwin-x86.mk b/third_party/libwebp/libwebp_utils.target.darwin-x86.mk
index a6d0255..ea5f278 100644
--- a/third_party/libwebp/libwebp_utils.target.darwin-x86.mk
+++ b/third_party/libwebp/libwebp_utils.target.darwin-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.linux-arm.mk b/third_party/libwebp/libwebp_utils.target.linux-arm.mk
index d7a2013..b6e3eba 100644
--- a/third_party/libwebp/libwebp_utils.target.linux-arm.mk
+++ b/third_party/libwebp/libwebp_utils.target.linux-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.linux-mips.mk b/third_party/libwebp/libwebp_utils.target.linux-mips.mk
index 70765ae..f4b42b3 100644
--- a/third_party/libwebp/libwebp_utils.target.linux-mips.mk
+++ b/third_party/libwebp/libwebp_utils.target.linux-mips.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libwebp/libwebp_utils.target.linux-x86.mk b/third_party/libwebp/libwebp_utils.target.linux-x86.mk
index a6d0255..ea5f278 100644
--- a/third_party/libwebp/libwebp_utils.target.linux-x86.mk
+++ b/third_party/libwebp/libwebp_utils.target.linux-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -167,10 +167,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/libxml/libxml.target.darwin-arm.mk b/third_party/libxml/libxml.target.darwin-arm.mk
index b5f8185..3029ed5 100644
--- a/third_party/libxml/libxml.target.darwin-arm.mk
+++ b/third_party/libxml/libxml.target.darwin-arm.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxml/libxml.target.darwin-mips.mk b/third_party/libxml/libxml.target.darwin-mips.mk
index e7756dd..c291035 100644
--- a/third_party/libxml/libxml.target.darwin-mips.mk
+++ b/third_party/libxml/libxml.target.darwin-mips.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxml/libxml.target.darwin-x86.mk b/third_party/libxml/libxml.target.darwin-x86.mk
index c8858ba..731ac1d 100644
--- a/third_party/libxml/libxml.target.darwin-x86.mk
+++ b/third_party/libxml/libxml.target.darwin-x86.mk
@@ -118,10 +118,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -211,10 +211,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxml/libxml.target.linux-arm.mk b/third_party/libxml/libxml.target.linux-arm.mk
index b5f8185..3029ed5 100644
--- a/third_party/libxml/libxml.target.linux-arm.mk
+++ b/third_party/libxml/libxml.target.linux-arm.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxml/libxml.target.linux-mips.mk b/third_party/libxml/libxml.target.linux-mips.mk
index e7756dd..c291035 100644
--- a/third_party/libxml/libxml.target.linux-mips.mk
+++ b/third_party/libxml/libxml.target.linux-mips.mk
@@ -116,10 +116,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -206,10 +206,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxml/libxml.target.linux-x86.mk b/third_party/libxml/libxml.target.linux-x86.mk
index c8858ba..731ac1d 100644
--- a/third_party/libxml/libxml.target.linux-x86.mk
+++ b/third_party/libxml/libxml.target.linux-x86.mk
@@ -118,10 +118,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -211,10 +211,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXML_STATIC=' \
 	'-D_REENTRANT' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.darwin-arm.mk b/third_party/libxslt/libxslt.target.darwin-arm.mk
index 209947c..e3a3024 100644
--- a/third_party/libxslt/libxslt.target.darwin-arm.mk
+++ b/third_party/libxslt/libxslt.target.darwin-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.darwin-mips.mk b/third_party/libxslt/libxslt.target.darwin-mips.mk
index b3414af..8e63969 100644
--- a/third_party/libxslt/libxslt.target.darwin-mips.mk
+++ b/third_party/libxslt/libxslt.target.darwin-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.darwin-x86.mk b/third_party/libxslt/libxslt.target.darwin-x86.mk
index 103febd..ff80f8d 100644
--- a/third_party/libxslt/libxslt.target.darwin-x86.mk
+++ b/third_party/libxslt/libxslt.target.darwin-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -184,10 +184,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.linux-arm.mk b/third_party/libxslt/libxslt.target.linux-arm.mk
index 209947c..e3a3024 100644
--- a/third_party/libxslt/libxslt.target.linux-arm.mk
+++ b/third_party/libxslt/libxslt.target.linux-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.linux-mips.mk b/third_party/libxslt/libxslt.target.linux-mips.mk
index b3414af..8e63969 100644
--- a/third_party/libxslt/libxslt.target.linux-mips.mk
+++ b/third_party/libxslt/libxslt.target.linux-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/libxslt/libxslt.target.linux-x86.mk b/third_party/libxslt/libxslt.target.linux-x86.mk
index 103febd..ff80f8d 100644
--- a/third_party/libxslt/libxslt.target.linux-x86.mk
+++ b/third_party/libxslt/libxslt.target.linux-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -184,10 +184,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBXSLT_STATIC' \
 	'-DLIBXML_STATIC' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.darwin-arm.mk b/third_party/lzma_sdk/lzma_sdk.target.darwin-arm.mk
index 62b3de8..04a80fd 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.darwin-arm.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.darwin-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.darwin-mips.mk b/third_party/lzma_sdk/lzma_sdk.target.darwin-mips.mk
index 0d6b6f7..6688a3c 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.darwin-mips.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.darwin-mips.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.darwin-x86.mk b/third_party/lzma_sdk/lzma_sdk.target.darwin-x86.mk
index d36a03d..cdccded 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.darwin-x86.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.darwin-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.linux-arm.mk b/third_party/lzma_sdk/lzma_sdk.target.linux-arm.mk
index 62b3de8..04a80fd 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.linux-arm.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.linux-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.linux-mips.mk b/third_party/lzma_sdk/lzma_sdk.target.linux-mips.mk
index 0d6b6f7..6688a3c 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.linux-mips.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.linux-mips.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/lzma_sdk/lzma_sdk.target.linux-x86.mk b/third_party/lzma_sdk/lzma_sdk.target.linux-x86.mk
index d36a03d..cdccded 100644
--- a/third_party/lzma_sdk/lzma_sdk.target.linux-x86.mk
+++ b/third_party/lzma_sdk/lzma_sdk.target.linux-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D_7ZIP_ST' \
 	'-D_LZMA_PROB32' \
 	'-DANDROID' \
diff --git a/third_party/modp_b64/modp_b64.target.darwin-arm.mk b/third_party/modp_b64/modp_b64.target.darwin-arm.mk
index 68df24b..d8f07d9 100644
--- a/third_party/modp_b64/modp_b64.target.darwin-arm.mk
+++ b/third_party/modp_b64/modp_b64.target.darwin-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/modp_b64/modp_b64.target.darwin-mips.mk b/third_party/modp_b64/modp_b64.target.darwin-mips.mk
index 50c3423..7bd588e 100644
--- a/third_party/modp_b64/modp_b64.target.darwin-mips.mk
+++ b/third_party/modp_b64/modp_b64.target.darwin-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/modp_b64/modp_b64.target.darwin-x86.mk b/third_party/modp_b64/modp_b64.target.darwin-x86.mk
index e302411..ad6f2af 100644
--- a/third_party/modp_b64/modp_b64.target.darwin-x86.mk
+++ b/third_party/modp_b64/modp_b64.target.darwin-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/modp_b64/modp_b64.target.linux-arm.mk b/third_party/modp_b64/modp_b64.target.linux-arm.mk
index 68df24b..d8f07d9 100644
--- a/third_party/modp_b64/modp_b64.target.linux-arm.mk
+++ b/third_party/modp_b64/modp_b64.target.linux-arm.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/modp_b64/modp_b64.target.linux-mips.mk b/third_party/modp_b64/modp_b64.target.linux-mips.mk
index 50c3423..7bd588e 100644
--- a/third_party/modp_b64/modp_b64.target.linux-mips.mk
+++ b/third_party/modp_b64/modp_b64.target.linux-mips.mk
@@ -72,10 +72,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -153,10 +153,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/modp_b64/modp_b64.target.linux-x86.mk b/third_party/modp_b64/modp_b64.target.linux-x86.mk
index e302411..ad6f2af 100644
--- a/third_party/modp_b64/modp_b64.target.linux-x86.mk
+++ b/third_party/modp_b64/modp_b64.target.linux-x86.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.darwin-arm.mk b/third_party/npapi/npapi.target.darwin-arm.mk
index 2202a50..5ca1dfb 100644
--- a/third_party/npapi/npapi.target.darwin-arm.mk
+++ b/third_party/npapi/npapi.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.darwin-mips.mk b/third_party/npapi/npapi.target.darwin-mips.mk
index a028d70..bc72729 100644
--- a/third_party/npapi/npapi.target.darwin-mips.mk
+++ b/third_party/npapi/npapi.target.darwin-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.darwin-x86.mk b/third_party/npapi/npapi.target.darwin-x86.mk
index 6872315..cfc08dd 100644
--- a/third_party/npapi/npapi.target.darwin-x86.mk
+++ b/third_party/npapi/npapi.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.linux-arm.mk b/third_party/npapi/npapi.target.linux-arm.mk
index 2202a50..5ca1dfb 100644
--- a/third_party/npapi/npapi.target.linux-arm.mk
+++ b/third_party/npapi/npapi.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.linux-mips.mk b/third_party/npapi/npapi.target.linux-mips.mk
index a028d70..bc72729 100644
--- a/third_party/npapi/npapi.target.linux-mips.mk
+++ b/third_party/npapi/npapi.target.linux-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/npapi/npapi.target.linux-x86.mk b/third_party/npapi/npapi.target.linux-x86.mk
index 6872315..cfc08dd 100644
--- a/third_party/npapi/npapi.target.linux-x86.mk
+++ b/third_party/npapi/npapi.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/opus/opus.target.darwin-arm.mk b/third_party/opus/opus.target.darwin-arm.mk
index 32afd45..1e35405 100644
--- a/third_party/opus/opus.target.darwin-arm.mk
+++ b/third_party/opus/opus.target.darwin-arm.mk
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/opus/opus.target.darwin-mips.mk b/third_party/opus/opus.target.darwin-mips.mk
index 8ad19ed..85804e7 100644
--- a/third_party/opus/opus.target.darwin-mips.mk
+++ b/third_party/opus/opus.target.darwin-mips.mk
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/opus/opus.target.darwin-x86.mk b/third_party/opus/opus.target.darwin-x86.mk
index ffda2d1..e2ad588 100644
--- a/third_party/opus/opus.target.darwin-x86.mk
+++ b/third_party/opus/opus.target.darwin-x86.mk
@@ -194,10 +194,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -287,10 +287,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/opus/opus.target.linux-arm.mk b/third_party/opus/opus.target.linux-arm.mk
index 32afd45..1e35405 100644
--- a/third_party/opus/opus.target.linux-arm.mk
+++ b/third_party/opus/opus.target.linux-arm.mk
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/opus/opus.target.linux-mips.mk b/third_party/opus/opus.target.linux-mips.mk
index 8ad19ed..85804e7 100644
--- a/third_party/opus/opus.target.linux-mips.mk
+++ b/third_party/opus/opus.target.linux-mips.mk
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -282,10 +282,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/opus/opus.target.linux-x86.mk b/third_party/opus/opus.target.linux-x86.mk
index ffda2d1..e2ad588 100644
--- a/third_party/opus/opus.target.linux-x86.mk
+++ b/third_party/opus/opus.target.linux-x86.mk
@@ -194,10 +194,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
@@ -287,10 +287,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DOPUS_BUILD' \
 	'-DOPUS_EXPORT=' \
 	'-DHAVE_LRINT' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-arm.mk b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-arm.mk
index 9b1369d..f29686a 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-arm.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -141,10 +141,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-mips.mk b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-mips.mk
index f071154..1ef7fc0 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-mips.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-mips.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -143,10 +143,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-x86.mk b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-x86.mk
index 9ebb4d8..c542ad0 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.darwin-x86.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -143,10 +143,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.linux-arm.mk b/third_party/protobuf/protobuf_full_do_not_use.host.linux-arm.mk
index 9a6106c..4fa32d2 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.linux-arm.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.linux-arm.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -141,10 +141,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.linux-mips.mk b/third_party/protobuf/protobuf_full_do_not_use.host.linux-mips.mk
index eccbf39..c8047bb 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.linux-mips.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.linux-mips.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -143,10 +143,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_full_do_not_use.host.linux-x86.mk b/third_party/protobuf/protobuf_full_do_not_use.host.linux-x86.mk
index 1a74960..1562026 100644
--- a/third_party/protobuf/protobuf_full_do_not_use.host.linux-x86.mk
+++ b/third_party/protobuf/protobuf_full_do_not_use.host.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -143,10 +143,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protobuf_lite.target.darwin-arm.mk b/third_party/protobuf/protobuf_lite.target.darwin-arm.mk
index 452c2ea..d3ef680 100644
--- a/third_party/protobuf/protobuf_lite.target.darwin-arm.mk
+++ b/third_party/protobuf/protobuf_lite.target.darwin-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protobuf_lite.target.darwin-mips.mk b/third_party/protobuf/protobuf_lite.target.darwin-mips.mk
index 15e41e4..43c7f11 100644
--- a/third_party/protobuf/protobuf_lite.target.darwin-mips.mk
+++ b/third_party/protobuf/protobuf_lite.target.darwin-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protobuf_lite.target.darwin-x86.mk b/third_party/protobuf/protobuf_lite.target.darwin-x86.mk
index ba30ef2..28a76e3 100644
--- a/third_party/protobuf/protobuf_lite.target.darwin-x86.mk
+++ b/third_party/protobuf/protobuf_lite.target.darwin-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protobuf_lite.target.linux-arm.mk b/third_party/protobuf/protobuf_lite.target.linux-arm.mk
index 452c2ea..d3ef680 100644
--- a/third_party/protobuf/protobuf_lite.target.linux-arm.mk
+++ b/third_party/protobuf/protobuf_lite.target.linux-arm.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protobuf_lite.target.linux-mips.mk b/third_party/protobuf/protobuf_lite.target.linux-mips.mk
index 15e41e4..43c7f11 100644
--- a/third_party/protobuf/protobuf_lite.target.linux-mips.mk
+++ b/third_party/protobuf/protobuf_lite.target.linux-mips.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -170,10 +170,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protobuf_lite.target.linux-x86.mk b/third_party/protobuf/protobuf_lite.target.linux-x86.mk
index ba30ef2..28a76e3 100644
--- a/third_party/protobuf/protobuf_lite.target.linux-x86.mk
+++ b/third_party/protobuf/protobuf_lite.target.linux-x86.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
@@ -175,10 +175,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DLIBPROTOBUF_EXPORTS' \
 	'-DPROTOBUF_USE_DLLS' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
diff --git a/third_party/protobuf/protoc.host.darwin-arm.mk b/third_party/protobuf/protoc.host.darwin-arm.mk
index 4d9e98a..0742e10 100644
--- a/third_party/protobuf/protoc.host.darwin-arm.mk
+++ b/third_party/protobuf/protoc.host.darwin-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -144,10 +144,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protoc.host.darwin-mips.mk b/third_party/protobuf/protoc.host.darwin-mips.mk
index 2e5bb65..41202b7 100644
--- a/third_party/protobuf/protoc.host.darwin-mips.mk
+++ b/third_party/protobuf/protoc.host.darwin-mips.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protoc.host.darwin-x86.mk b/third_party/protobuf/protoc.host.darwin-x86.mk
index 22d55c8..9f50ccd 100644
--- a/third_party/protobuf/protoc.host.darwin-x86.mk
+++ b/third_party/protobuf/protoc.host.darwin-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protoc.host.linux-arm.mk b/third_party/protobuf/protoc.host.linux-arm.mk
index bebb9f5..09c737e 100644
--- a/third_party/protobuf/protoc.host.linux-arm.mk
+++ b/third_party/protobuf/protoc.host.linux-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -144,10 +144,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protoc.host.linux-mips.mk b/third_party/protobuf/protoc.host.linux-mips.mk
index ebd1f1d..585072b 100644
--- a/third_party/protobuf/protoc.host.linux-mips.mk
+++ b/third_party/protobuf/protoc.host.linux-mips.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/protobuf/protoc.host.linux-x86.mk b/third_party/protobuf/protoc.host.linux-x86.mk
index 075e7b2..be6b34f 100644
--- a/third_party/protobuf/protoc.host.linux-x86.mk
+++ b/third_party/protobuf/protoc.host.linux-x86.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
@@ -146,10 +146,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGOOGLE_PROTOBUF_NO_RTTI' \
 	'-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' \
 	'-DNDEBUG' \
diff --git a/third_party/qcms/qcms.target.darwin-arm.mk b/third_party/qcms/qcms.target.darwin-arm.mk
index cfa7104..9ec3fb7 100644
--- a/third_party/qcms/qcms.target.darwin-arm.mk
+++ b/third_party/qcms/qcms.target.darwin-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/qcms/qcms.target.darwin-mips.mk b/third_party/qcms/qcms.target.darwin-mips.mk
index 9138136..44a928b 100644
--- a/third_party/qcms/qcms.target.darwin-mips.mk
+++ b/third_party/qcms/qcms.target.darwin-mips.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/qcms/qcms.target.darwin-x86.mk b/third_party/qcms/qcms.target.darwin-x86.mk
index 512f35b..97a98dd 100644
--- a/third_party/qcms/qcms.target.darwin-x86.mk
+++ b/third_party/qcms/qcms.target.darwin-x86.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSSE2_ENABLE' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSSE2_ENABLE' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/qcms/qcms.target.linux-arm.mk b/third_party/qcms/qcms.target.linux-arm.mk
index cfa7104..9ec3fb7 100644
--- a/third_party/qcms/qcms.target.linux-arm.mk
+++ b/third_party/qcms/qcms.target.linux-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/qcms/qcms.target.linux-mips.mk b/third_party/qcms/qcms.target.linux-mips.mk
index 9138136..44a928b 100644
--- a/third_party/qcms/qcms.target.linux-mips.mk
+++ b/third_party/qcms/qcms.target.linux-mips.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -155,10 +155,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/qcms/qcms.target.linux-x86.mk b/third_party/qcms/qcms.target.linux-x86.mk
index 512f35b..97a98dd 100644
--- a/third_party/qcms/qcms.target.linux-x86.mk
+++ b/third_party/qcms/qcms.target.linux-x86.mk
@@ -79,10 +79,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSSE2_ENABLE' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -163,10 +163,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSSE2_ENABLE' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/re2/re2.target.darwin-arm.mk b/third_party/re2/re2.target.darwin-arm.mk
index fbe4e8e..9c7636d 100644
--- a/third_party/re2/re2.target.darwin-arm.mk
+++ b/third_party/re2/re2.target.darwin-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/re2/re2.target.darwin-mips.mk b/third_party/re2/re2.target.darwin-mips.mk
index 243e9b3..0f9e70f 100644
--- a/third_party/re2/re2.target.darwin-mips.mk
+++ b/third_party/re2/re2.target.darwin-mips.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/re2/re2.target.darwin-x86.mk b/third_party/re2/re2.target.darwin-x86.mk
index 54b5aa7..842d1fd 100644
--- a/third_party/re2/re2.target.darwin-x86.mk
+++ b/third_party/re2/re2.target.darwin-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -183,10 +183,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/re2/re2.target.linux-arm.mk b/third_party/re2/re2.target.linux-arm.mk
index fbe4e8e..9c7636d 100644
--- a/third_party/re2/re2.target.linux-arm.mk
+++ b/third_party/re2/re2.target.linux-arm.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/re2/re2.target.linux-mips.mk b/third_party/re2/re2.target.linux-mips.mk
index 243e9b3..0f9e70f 100644
--- a/third_party/re2/re2.target.linux-mips.mk
+++ b/third_party/re2/re2.target.linux-mips.mk
@@ -96,10 +96,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -178,10 +178,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/re2/re2.target.linux-x86.mk b/third_party/re2/re2.target.linux-x86.mk
index 54b5aa7..842d1fd 100644
--- a/third_party/re2/re2.target.linux-x86.mk
+++ b/third_party/re2/re2.target.linux-x86.mk
@@ -98,10 +98,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -183,10 +183,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.darwin-arm.mk b/third_party/smhasher/cityhash.target.darwin-arm.mk
index 2f7a896..58380e9 100644
--- a/third_party/smhasher/cityhash.target.darwin-arm.mk
+++ b/third_party/smhasher/cityhash.target.darwin-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.darwin-mips.mk b/third_party/smhasher/cityhash.target.darwin-mips.mk
index 4b4faee..37ce0ef 100644
--- a/third_party/smhasher/cityhash.target.darwin-mips.mk
+++ b/third_party/smhasher/cityhash.target.darwin-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.darwin-x86.mk b/third_party/smhasher/cityhash.target.darwin-x86.mk
index d78db1d..ca08ca8 100644
--- a/third_party/smhasher/cityhash.target.darwin-x86.mk
+++ b/third_party/smhasher/cityhash.target.darwin-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.linux-arm.mk b/third_party/smhasher/cityhash.target.linux-arm.mk
index 2f7a896..58380e9 100644
--- a/third_party/smhasher/cityhash.target.linux-arm.mk
+++ b/third_party/smhasher/cityhash.target.linux-arm.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.linux-mips.mk b/third_party/smhasher/cityhash.target.linux-mips.mk
index 4b4faee..37ce0ef 100644
--- a/third_party/smhasher/cityhash.target.linux-mips.mk
+++ b/third_party/smhasher/cityhash.target.linux-mips.mk
@@ -71,10 +71,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -151,10 +151,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/smhasher/cityhash.target.linux-x86.mk b/third_party/smhasher/cityhash.target.linux-x86.mk
index d78db1d..ca08ca8 100644
--- a/third_party/smhasher/cityhash.target.linux-x86.mk
+++ b/third_party/smhasher/cityhash.target.linux-x86.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/sqlite/sqlite.target.darwin-arm.mk b/third_party/sqlite/sqlite.target.darwin-arm.mk
index d4512f4..a2ae57c 100644
--- a/third_party/sqlite/sqlite.target.darwin-arm.mk
+++ b/third_party/sqlite/sqlite.target.darwin-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/sqlite/sqlite.target.darwin-mips.mk b/third_party/sqlite/sqlite.target.darwin-mips.mk
index c33e5a3..ea967f8 100644
--- a/third_party/sqlite/sqlite.target.darwin-mips.mk
+++ b/third_party/sqlite/sqlite.target.darwin-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/sqlite/sqlite.target.darwin-x86.mk b/third_party/sqlite/sqlite.target.darwin-x86.mk
index 4498353..e65d1d0 100644
--- a/third_party/sqlite/sqlite.target.darwin-x86.mk
+++ b/third_party/sqlite/sqlite.target.darwin-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -197,10 +197,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/sqlite/sqlite.target.linux-arm.mk b/third_party/sqlite/sqlite.target.linux-arm.mk
index d4512f4..a2ae57c 100644
--- a/third_party/sqlite/sqlite.target.linux-arm.mk
+++ b/third_party/sqlite/sqlite.target.linux-arm.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/sqlite/sqlite.target.linux-mips.mk b/third_party/sqlite/sqlite.target.linux-mips.mk
index c33e5a3..ea967f8 100644
--- a/third_party/sqlite/sqlite.target.linux-mips.mk
+++ b/third_party/sqlite/sqlite.target.linux-mips.mk
@@ -89,10 +89,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -192,10 +192,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/sqlite/sqlite.target.linux-x86.mk b/third_party/sqlite/sqlite.target.linux-x86.mk
index 4498353..e65d1d0 100644
--- a/third_party/sqlite/sqlite.target.linux-x86.mk
+++ b/third_party/sqlite/sqlite.target.linux-x86.mk
@@ -91,10 +91,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
@@ -197,10 +197,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_USLEEP=1' \
 	'-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576' \
 	'-DSQLITE_DEFAULT_AUTOVACUUM=1' \
diff --git a/third_party/yasm/config_sources.host.darwin-x86.mk b/third_party/yasm/config_sources.host.darwin-x86.mk
index 32d65ab..e95d6f6 100644
--- a/third_party/yasm/config_sources.host.darwin-x86.mk
+++ b/third_party/yasm/config_sources.host.darwin-x86.mk
@@ -55,10 +55,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -107,10 +107,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/config_sources.host.linux-x86.mk b/third_party/yasm/config_sources.host.linux-x86.mk
index 32d65ab..e95d6f6 100644
--- a/third_party/yasm/config_sources.host.linux-x86.mk
+++ b/third_party/yasm/config_sources.host.linux-x86.mk
@@ -55,10 +55,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -107,10 +107,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/generate_files.host.darwin-x86.mk b/third_party/yasm/generate_files.host.darwin-x86.mk
index 5734551..a75edde 100644
--- a/third_party/yasm/generate_files.host.darwin-x86.mk
+++ b/third_party/yasm/generate_files.host.darwin-x86.mk
@@ -112,10 +112,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/generate_files.host.linux-x86.mk b/third_party/yasm/generate_files.host.linux-x86.mk
index 5734551..a75edde 100644
--- a/third_party/yasm/generate_files.host.linux-x86.mk
+++ b/third_party/yasm/generate_files.host.linux-x86.mk
@@ -112,10 +112,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genmacro.host.darwin-x86.mk b/third_party/yasm/genmacro.host.darwin-x86.mk
index ca3bb55..3fc100d 100644
--- a/third_party/yasm/genmacro.host.darwin-x86.mk
+++ b/third_party/yasm/genmacro.host.darwin-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genmacro.host.linux-x86.mk b/third_party/yasm/genmacro.host.linux-x86.mk
index 60f944d..8f2107f 100644
--- a/third_party/yasm/genmacro.host.linux-x86.mk
+++ b/third_party/yasm/genmacro.host.linux-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genmodule.host.darwin-x86.mk b/third_party/yasm/genmodule.host.darwin-x86.mk
index fde54cd..4a96aa2 100644
--- a/third_party/yasm/genmodule.host.darwin-x86.mk
+++ b/third_party/yasm/genmodule.host.darwin-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genmodule.host.linux-x86.mk b/third_party/yasm/genmodule.host.linux-x86.mk
index 51978eb..3b5830a 100644
--- a/third_party/yasm/genmodule.host.linux-x86.mk
+++ b/third_party/yasm/genmodule.host.linux-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genperf.host.darwin-x86.mk b/third_party/yasm/genperf.host.darwin-x86.mk
index 1800664..7af3c4e 100644
--- a/third_party/yasm/genperf.host.darwin-x86.mk
+++ b/third_party/yasm/genperf.host.darwin-x86.mk
@@ -60,10 +60,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -115,10 +115,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genperf.host.linux-x86.mk b/third_party/yasm/genperf.host.linux-x86.mk
index c19de2d..bcdc5de 100644
--- a/third_party/yasm/genperf.host.linux-x86.mk
+++ b/third_party/yasm/genperf.host.linux-x86.mk
@@ -60,10 +60,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -115,10 +115,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genperf_libs.host.darwin-x86.mk b/third_party/yasm/genperf_libs.host.darwin-x86.mk
index c6c5f62..056afa8 100644
--- a/third_party/yasm/genperf_libs.host.darwin-x86.mk
+++ b/third_party/yasm/genperf_libs.host.darwin-x86.mk
@@ -61,10 +61,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
@@ -119,10 +119,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
diff --git a/third_party/yasm/genperf_libs.host.linux-x86.mk b/third_party/yasm/genperf_libs.host.linux-x86.mk
index 7ee18d0..5036b50 100644
--- a/third_party/yasm/genperf_libs.host.linux-x86.mk
+++ b/third_party/yasm/genperf_libs.host.linux-x86.mk
@@ -61,10 +61,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
@@ -119,10 +119,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
diff --git a/third_party/yasm/genstring.host.darwin-x86.mk b/third_party/yasm/genstring.host.darwin-x86.mk
index 4e084ed..050febb 100644
--- a/third_party/yasm/genstring.host.darwin-x86.mk
+++ b/third_party/yasm/genstring.host.darwin-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genstring.host.linux-x86.mk b/third_party/yasm/genstring.host.linux-x86.mk
index e9ad02c..b3e8699 100644
--- a/third_party/yasm/genstring.host.linux-x86.mk
+++ b/third_party/yasm/genstring.host.linux-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genversion.host.darwin-x86.mk b/third_party/yasm/genversion.host.darwin-x86.mk
index 9751687..7b20e1b 100644
--- a/third_party/yasm/genversion.host.darwin-x86.mk
+++ b/third_party/yasm/genversion.host.darwin-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/genversion.host.linux-x86.mk b/third_party/yasm/genversion.host.linux-x86.mk
index 24dd3e9..b78d687 100644
--- a/third_party/yasm/genversion.host.linux-x86.mk
+++ b/third_party/yasm/genversion.host.linux-x86.mk
@@ -58,10 +58,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -113,10 +113,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/re2c.host.darwin-x86.mk b/third_party/yasm/re2c.host.darwin-x86.mk
index 8f21bab..32e6020 100644
--- a/third_party/yasm/re2c.host.darwin-x86.mk
+++ b/third_party/yasm/re2c.host.darwin-x86.mk
@@ -66,10 +66,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -121,10 +121,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/re2c.host.linux-x86.mk b/third_party/yasm/re2c.host.linux-x86.mk
index 0d1fad6..5007e39 100644
--- a/third_party/yasm/re2c.host.linux-x86.mk
+++ b/third_party/yasm/re2c.host.linux-x86.mk
@@ -66,10 +66,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
 	'-D_DEBUG'
@@ -121,10 +121,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
diff --git a/third_party/yasm/yasm.host.darwin-x86.mk b/third_party/yasm/yasm.host.darwin-x86.mk
index 7239473..b192683 100644
--- a/third_party/yasm/yasm.host.darwin-x86.mk
+++ b/third_party/yasm/yasm.host.darwin-x86.mk
@@ -274,10 +274,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
@@ -334,10 +334,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
diff --git a/third_party/yasm/yasm.host.linux-x86.mk b/third_party/yasm/yasm.host.linux-x86.mk
index 7804dd5..7549cf5 100644
--- a/third_party/yasm/yasm.host.linux-x86.mk
+++ b/third_party/yasm/yasm.host.linux-x86.mk
@@ -274,10 +274,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
 	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
@@ -334,10 +334,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DHAVE_CONFIG_H' \
 	'-DNDEBUG' \
 	'-DNVALGRIND' \
diff --git a/third_party/zlib/minizip.target.darwin-arm.mk b/third_party/zlib/minizip.target.darwin-arm.mk
index d0dc0b8..8055030 100644
--- a/third_party/zlib/minizip.target.darwin-arm.mk
+++ b/third_party/zlib/minizip.target.darwin-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/minizip.target.darwin-mips.mk b/third_party/zlib/minizip.target.darwin-mips.mk
index 3d56c9b..fc747c5 100644
--- a/third_party/zlib/minizip.target.darwin-mips.mk
+++ b/third_party/zlib/minizip.target.darwin-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/minizip.target.darwin-x86.mk b/third_party/zlib/minizip.target.darwin-x86.mk
index dd47fcb..ef7dc49 100644
--- a/third_party/zlib/minizip.target.darwin-x86.mk
+++ b/third_party/zlib/minizip.target.darwin-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/minizip.target.linux-arm.mk b/third_party/zlib/minizip.target.linux-arm.mk
index d0dc0b8..8055030 100644
--- a/third_party/zlib/minizip.target.linux-arm.mk
+++ b/third_party/zlib/minizip.target.linux-arm.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/minizip.target.linux-mips.mk b/third_party/zlib/minizip.target.linux-mips.mk
index 3d56c9b..fc747c5 100644
--- a/third_party/zlib/minizip.target.linux-mips.mk
+++ b/third_party/zlib/minizip.target.linux-mips.mk
@@ -73,10 +73,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,10 +156,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/minizip.target.linux-x86.mk b/third_party/zlib/minizip.target.linux-x86.mk
index dd47fcb..ef7dc49 100644
--- a/third_party/zlib/minizip.target.linux-x86.mk
+++ b/third_party/zlib/minizip.target.linux-x86.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -161,10 +161,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUSE_FILE32API' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/third_party/zlib/zip.target.darwin-arm.mk b/third_party/zlib/zip.target.darwin-arm.mk
index 8c46896..e09b30f 100644
--- a/third_party/zlib/zip.target.darwin-arm.mk
+++ b/third_party/zlib/zip.target.darwin-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zip.target.darwin-mips.mk b/third_party/zlib/zip.target.darwin-mips.mk
index 2c6ec81..ed582e2 100644
--- a/third_party/zlib/zip.target.darwin-mips.mk
+++ b/third_party/zlib/zip.target.darwin-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zip.target.darwin-x86.mk b/third_party/zlib/zip.target.darwin-x86.mk
index cf1489b..9486a31 100644
--- a/third_party/zlib/zip.target.darwin-x86.mk
+++ b/third_party/zlib/zip.target.darwin-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zip.target.linux-arm.mk b/third_party/zlib/zip.target.linux-arm.mk
index 8c46896..e09b30f 100644
--- a/third_party/zlib/zip.target.linux-arm.mk
+++ b/third_party/zlib/zip.target.linux-arm.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zip.target.linux-mips.mk b/third_party/zlib/zip.target.linux-mips.mk
index 2c6ec81..ed582e2 100644
--- a/third_party/zlib/zip.target.linux-mips.mk
+++ b/third_party/zlib/zip.target.linux-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zip.target.linux-x86.mk b/third_party/zlib/zip.target.linux-x86.mk
index cf1489b..9486a31 100644
--- a/third_party/zlib/zip.target.linux-x86.mk
+++ b/third_party/zlib/zip.target.linux-x86.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.darwin-arm.mk b/third_party/zlib/zlib.target.darwin-arm.mk
index 4ef94f0..71a9071 100644
--- a/third_party/zlib/zlib.target.darwin-arm.mk
+++ b/third_party/zlib/zlib.target.darwin-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.darwin-mips.mk b/third_party/zlib/zlib.target.darwin-mips.mk
index d5847e0..e08d138 100644
--- a/third_party/zlib/zlib.target.darwin-mips.mk
+++ b/third_party/zlib/zlib.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.darwin-x86.mk b/third_party/zlib/zlib.target.darwin-x86.mk
index 4f1e788..9fe9374 100644
--- a/third_party/zlib/zlib.target.darwin-x86.mk
+++ b/third_party/zlib/zlib.target.darwin-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.linux-arm.mk b/third_party/zlib/zlib.target.linux-arm.mk
index 4ef94f0..71a9071 100644
--- a/third_party/zlib/zlib.target.linux-arm.mk
+++ b/third_party/zlib/zlib.target.linux-arm.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.linux-mips.mk b/third_party/zlib/zlib.target.linux-mips.mk
index d5847e0..e08d138 100644
--- a/third_party/zlib/zlib.target.linux-mips.mk
+++ b/third_party/zlib/zlib.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/third_party/zlib/zlib.target.linux-x86.mk b/third_party/zlib/zlib.target.linux-x86.mk
index 4f1e788..9fe9374 100644
--- a/third_party/zlib/zlib.target.linux-x86.mk
+++ b/third_party/zlib/zlib.target.linux-x86.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
 	'-DUSE_STLPORT=1' \
diff --git a/tools/android/memdump/memdump.cc b/tools/android/memdump/memdump.cc
index 21ef291..26035b2 100644
--- a/tools/android/memdump/memdump.cc
+++ b/tools/android/memdump/memdump.cc
@@ -16,6 +16,7 @@
 #include <utility>
 #include <vector>
 
+#include "base/base64.h"
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/bind_helpers.h"
@@ -30,6 +31,29 @@
 
 namespace {
 
+class BitSet {
+ public:
+  void resize(size_t nbits) {
+    data_.resize((nbits + 7) / 8);
+  }
+
+  void set(uint32 bit) {
+    const uint32 byte_idx = bit / 8;
+    CHECK(byte_idx < data_.size());
+    data_[byte_idx] |= (1 << (bit & 7));
+  }
+
+  std::string AsB64String() const {
+    std::string bits(&data_[0], data_.size());
+    std::string b64_string;
+    base::Base64Encode(bits, &b64_string);
+    return b64_string;
+  }
+
+ private:
+  std::vector<char> data_;
+};
+
 // An entry in /proc/<pid>/pagemap.
 struct PageMapEntry {
   uint64 page_frame_number : 55;
@@ -49,6 +73,7 @@
   std::string flags;
   uint start_address;
   uint end_address;
+  uint offset;
   int private_count;
   int unevictable_private_count;
   int other_shared_count;
@@ -57,6 +82,9 @@
   // (only among the processes that are being analyzed).
   std::vector<int> app_shared_counts;
   std::vector<PageInfo> committed_pages;
+  // committed_pages_bits is a bitset reflecting the present bit for all the
+  // virtual pages of the mapping.
+  BitSet committed_pages_bits;
 };
 
 struct ProcessMemory {
@@ -114,6 +142,11 @@
   if (tokens->at(1).size() != strlen("rwxp"))
     return false;
   memory_map->flags.swap(tokens->at(1));
+  if (!base::HexStringToUInt64(tokens->at(2), &tmp))
+    return false;
+  memory_map->offset = static_cast<uint>(tmp);
+  memory_map->committed_pages_bits.resize(
+      (memory_map->end_address - memory_map->start_address) / PAGE_SIZE);
   const int map_name_index = 5;
   if (tokens->size() >= map_name_index + 1) {
     for (std::vector<std::string>::const_iterator it =
@@ -167,9 +200,11 @@
 // provided memory map.
 bool GetPagesForMemoryMap(int pagemap_fd,
                           const MemoryMap& memory_map,
-                          std::vector<PageInfo>* committed_pages) {
-  for (uint addr = memory_map.start_address; addr < memory_map.end_address;
-       addr += PAGE_SIZE) {
+                          std::vector<PageInfo>* committed_pages,
+                          BitSet* committed_pages_bits) {
+  for (uint addr = memory_map.start_address, page_index = 0;
+       addr < memory_map.end_address;
+       addr += PAGE_SIZE, ++page_index) {
     DCHECK_EQ(0, addr % PAGE_SIZE);
     PageMapEntry page_map_entry = {};
     COMPILE_ASSERT(sizeof(PageMapEntry) == sizeof(uint64), unexpected_size);
@@ -182,6 +217,7 @@
       PageInfo page_info = {};
       page_info.page_frame_number = page_map_entry.page_frame_number;
       committed_pages->push_back(page_info);
+      committed_pages_bits->set(page_index);
     }
   }
   return true;
@@ -387,6 +423,40 @@
   }
 }
 
+void DumpProcessesMemoryMapsInExtendedFormat(
+    const std::vector<ProcessMemory>& processes_memory) {
+  std::string buf;
+  std::string app_shared_buf;
+  for (std::vector<ProcessMemory>::const_iterator it = processes_memory.begin();
+       it != processes_memory.end(); ++it) {
+    const ProcessMemory& process_memory = *it;
+    std::cout << "[ PID=" << process_memory.pid << "]" << '\n';
+    const std::vector<MemoryMap>& memory_maps = process_memory.memory_maps;
+    for (std::vector<MemoryMap>::const_iterator it = memory_maps.begin();
+         it != memory_maps.end(); ++it) {
+      const MemoryMap& memory_map = *it;
+      app_shared_buf.clear();
+      AppendAppSharedField(memory_map.app_shared_counts, &app_shared_buf);
+      base::SStringPrintf(
+          &buf,
+          "%x-%x %s %x private_unevictable=%d private=%d shared_app=%s "
+          "shared_other_unevictable=%d shared_other=%d \"%s\" [%s]\n",
+          memory_map.start_address,
+          memory_map.end_address,
+          memory_map.flags.c_str(),
+          memory_map.offset,
+          memory_map.unevictable_private_count * PAGE_SIZE,
+          memory_map.private_count * PAGE_SIZE,
+          app_shared_buf.c_str(),
+          memory_map.unevictable_other_shared_count * PAGE_SIZE,
+          memory_map.other_shared_count * PAGE_SIZE,
+          memory_map.name.c_str(),
+          memory_map.committed_pages_bits.AsB64String().c_str());
+      std::cout << buf;
+    }
+  }
+}
+
 bool CollectProcessMemoryInformation(int page_count_fd,
                                      int page_flags_fd,
                                      ProcessMemory* process_memory) {
@@ -404,7 +474,8 @@
   for (std::vector<MemoryMap>::iterator it = process_maps->begin();
        it != process_maps->end(); ++it) {
     std::vector<PageInfo>* const committed_pages = &it->committed_pages;
-    GetPagesForMemoryMap(pagemap_fd, *it, committed_pages);
+    BitSet* const pages_bits = &it->committed_pages_bits;
+    GetPagesForMemoryMap(pagemap_fd, *it, committed_pages, pages_bits);
     SetPagesInfo(page_count_fd, page_flags_fd, committed_pages);
   }
   return true;
@@ -420,17 +491,17 @@
 }  // namespace
 
 int main(int argc, char** argv) {
-  bool short_output = false;
   if (argc == 1) {
-    LOG(ERROR) << "Usage: " << argv[0] << " [-a] <PID1>... <PIDN>";
+    LOG(ERROR) << "Usage: " << argv[0] << " [-a|-x] <PID1>... <PIDN>";
     return EXIT_FAILURE;
   }
-  if (!strncmp(argv[1], "-a", 2)) {
+  const bool short_output = !strncmp(argv[1], "-a", 2);
+  const bool extended_output = !strncmp(argv[1], "-x", 2);
+  if (short_output || extended_output) {
     if (argc == 2) {
-      LOG(ERROR) << "Usage: " << argv[0] << " [-a] <PID1>... <PIDN>";
+      LOG(ERROR) << "Usage: " << argv[0] << " [-a|-x] <PID1>... <PIDN>";
       return EXIT_FAILURE;
     }
-    short_output = true;
     ++argv;
   }
   std::vector<pid_t> pids;
@@ -476,6 +547,8 @@
   ClassifyPages(&processes_memory);
   if (short_output)
     DumpProcessesMemoryMapsInShortFormat(processes_memory);
+  else if (extended_output)
+    DumpProcessesMemoryMapsInExtendedFormat(processes_memory);
   else
     DumpProcessesMemoryMaps(processes_memory);
   return EXIT_SUCCESS;
diff --git a/tools/android/memdump/memsymbols.py b/tools/android/memdump/memsymbols.py
new file mode 100755
index 0000000..3721963
--- /dev/null
+++ b/tools/android/memdump/memsymbols.py
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import base64
+import os
+import sys
+import re
+
+from optparse import OptionParser
+
+"""Extracts the list of resident symbols of a library loaded in a process.
+
+This scripts combines the extended output of memdump for a given process
+(obtained through memdump -x PID) and the symbol table of a .so loaded in that
+process (obtained through nm -C lib-with-symbols.so), filtering out only those
+symbols that, at the time of the snapshot, were resident in memory (that are,
+the symbols which start address belongs to a mapped page of the .so which was
+resident at the time of the snapshot).
+The aim is to perform a "code coverage"-like profiling of a binary, intersecting
+run-time information (list of resident pages) and debug symbols.
+"""
+
+_PAGE_SIZE = 4096
+
+
+def _TestBit(word, bit):
+  assert(bit >= 0 and bit < 8)
+  return not not ((word >> bit) & 1)
+
+
+def _HexAddr(addr):
+  return hex(addr)[2:].zfill(8)
+
+
+def _GetResidentPagesSet(memdump_contents, lib_name, verbose):
+  """Parses the memdump output and extracts the resident page set for lib_name.
+  Args:
+    memdump_contents: Array of strings (lines) of a memdump output.
+    lib_name: A string containing the name of the library.so to be matched.
+    verbose: Print a verbose header for each mapping matched.
+
+  Returns:
+    A set of resident pages (the key is the page index) for all the
+    mappings matching .*lib_name.
+  """
+  resident_pages = set()
+  MAP_RX = re.compile(
+      r'^([0-9a-f]+)-([0-9a-f]+) ([\w-]+) ([0-9a-f]+) .* "(.*)" \[(.*)\]$')
+  for line in memdump_contents:
+    line = line.rstrip('\r\n')
+    if line.startswith('[ PID'):
+      continue
+
+    r = MAP_RX.match(line)
+    if not r:
+      sys.stderr.write('Skipping %s from %s\n' % (line, memdump_file))
+      continue
+
+    map_start = int(r.group(1), 16)
+    map_end = int(r.group(2), 16)
+    prot = r.group(3)
+    offset = int(r.group(4), 16)
+    assert(offset % _PAGE_SIZE == 0)
+    lib = r.group(5)
+    enc_bitmap = r.group(6)
+
+    if not lib.endswith(lib_name):
+      continue
+
+    bitmap = base64.b64decode(enc_bitmap)
+    map_pages_count = (map_end - map_start + 1) / _PAGE_SIZE
+    bitmap_pages_count = len(bitmap) * 8
+
+    if verbose:
+      print 'Found %s: mapped %d pages in mode %s @ offset %s.' % (
+            lib, map_pages_count, prot, _HexAddr(offset))
+      print ' Map range in the process VA: [%s - %s]. Len: %s' % (
+          _HexAddr(map_start),
+          _HexAddr(map_end),
+          _HexAddr(map_pages_count * _PAGE_SIZE))
+      print ' Corresponding addresses in the binary: [%s - %s]. Len: %s' % (
+          _HexAddr(offset),
+          _HexAddr(offset + map_end - map_start),
+          _HexAddr(map_pages_count * _PAGE_SIZE))
+      print ' Bitmap: %d pages' % bitmap_pages_count
+      print ''
+
+    assert(bitmap_pages_count >= map_pages_count)
+    for i in xrange(map_pages_count):
+      bitmap_idx = i / 8
+      bitmap_off = i % 8
+      if (bitmap_idx < len(bitmap) and
+          _TestBit(ord(bitmap[bitmap_idx]), bitmap_off)):
+        resident_pages.add(offset / _PAGE_SIZE + i)
+  return resident_pages
+
+
+def main(argv):
+  NM_RX = re.compile(r'^([0-9a-f]+)\s+.*$')
+
+  parser = OptionParser()
+  parser.add_option("-r", "--reverse",
+                    action="store_true", dest="reverse", default=False,
+                    help="Print out non present symbols")
+  parser.add_option("-v", "--verbose",
+                    action="store_true", dest="verbose", default=False,
+                    help="Print out verbose debug information.")
+
+  (options, args) = parser.parse_args()
+
+  if len(args) != 3:
+    print 'Usage: %s [-v] memdump.file nm.file library.so' % (
+        os.path.basename(argv[0]))
+    return 1
+
+  memdump_file = args[0]
+  nm_file = args[1]
+  lib_name = args[2]
+
+  if memdump_file == '-':
+    memdump_contents = sys.stdin.readlines()
+  else:
+    memdump_contents = open(memdump_file, 'r').readlines()
+  resident_pages = _GetResidentPagesSet(memdump_contents,
+                                        lib_name,
+                                        options.verbose)
+
+  # Process the nm symbol table, filtering out the resident symbols.
+  nm_fh = open(nm_file, 'r')
+  for line in nm_fh:
+    line = line.rstrip('\r\n')
+    # Skip undefined symbols (lines with no address).
+    if line.startswith(' '):
+      continue
+
+    r = NM_RX.match(line)
+    if not r:
+      sys.stderr.write('Skipping %s from %s\n' % (line, nm_file))
+      continue
+
+    sym_addr = int(r.group(1), 16)
+    sym_page = sym_addr / _PAGE_SIZE
+    last_sym_matched = (sym_page in resident_pages)
+    if (sym_page in resident_pages) != options.reverse:
+      print line
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
diff --git a/tools/heapcheck/chrome_tests.py b/tools/heapcheck/chrome_tests.py
index 3f7d951..5d1e9d9 100755
--- a/tools/heapcheck/chrome_tests.py
+++ b/tools/heapcheck/chrome_tests.py
@@ -84,6 +84,8 @@
       "base": self.TestBase,            "base_unittests": self.TestBase,
       "browser": self.TestBrowser,      "browser_tests": self.TestBrowser,
       "chromeos": self.TestChromeOS,    "chromeos_unittests": self.TestChromeOS,
+      "components": self.TestComponents,
+      "components_unittests": self.TestComponents,
       "compositor": self.TestCompositor,
       "compositor_unittests": self.TestCompositor,
       "content": self.TestContent,      "content_unittests": self.TestContent,
@@ -252,6 +254,7 @@
       os.putenv("LD_LIBRARY_PATH", self._options.build_dir)
     return heapcheck_test.RunTool(cmd, supp, module)
 
+  # TODO(glider): it's an overkill to define a method for each simple test.
   def TestAppList(self):
     return self.SimpleTest("app_list", "app_list_unittests")
 
@@ -270,6 +273,9 @@
   def TestChromeOS(self):
     return self.SimpleTest("chromeos", "chromeos_unittests")
 
+  def TestComponents(self):
+    return self.SimpleTest("components", "components_unittests")
+
   def TestCompositor(self):
     return self.SimpleTest("compositor", "compositor_unittests")
 
diff --git a/tools/heapcheck/heapcheck_test.py b/tools/heapcheck/heapcheck_test.py
index f9c2e08..6987624 100644
--- a/tools/heapcheck/heapcheck_test.py
+++ b/tools/heapcheck/heapcheck_test.py
@@ -19,6 +19,9 @@
   SANITY_TEST_SUPPRESSION = "Heapcheck sanity test"
   LEAK_REPORT_RE = re.compile(
      'Leak of ([0-9]*) bytes in ([0-9]*) objects allocated from:')
+  # Workaround for http://crbug.com/132867, see below.
+  HOOKED_ALLOCATOR_RE = re.compile(
+     'Hooked allocator frame not found, returning empty trace')
   STACK_LINE_RE = re.compile('\s*@\s*(?:0x)?[0-9a-fA-F]+\s*([^\n]*)')
   BORING_CALLERS = common.BoringCallers(mangled=False, use_re_wildcards=True)
 
@@ -91,6 +94,7 @@
     # Statistics grouped by suppression description:
     # [hit count, bytes, objects].
     used_suppressions = {}
+    hooked_allocator_line_encountered = False
     for line in log_lines:
       line = line.rstrip()  # remove the trailing \n
       match = self.STACK_LINE_RE.match(line)
@@ -165,7 +169,11 @@
         if match:
           cur_leak_signature = map(int, match.groups())
         else:
-          print line
+          match = self.HOOKED_ALLOCATOR_RE.match(line)
+          if match:
+            hooked_allocator_line_encountered = True
+          else:
+            print line
     # Print the list of suppressions used.
     is_sane = False
     if used_suppressions:
@@ -189,6 +197,10 @@
         for line in histo[count]:
           print line
       print '-----------------------------------------------------'
+    if hooked_allocator_line_encountered:
+      print ('WARNING: Workaround for http://crbug.com/132867 (tons of '
+             '"Hooked allocator frame not found, returning empty trace") '
+             'in effect.')
     if check_sanity and not is_sane:
       logging.error("Sanity check failed")
       return 2
diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc
index ff6269e..cb1937f 100644
--- a/tools/imagediff/image_diff.cc
+++ b/tools/imagediff/image_diff.cc
@@ -19,7 +19,7 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
+#include "base/process/memory.h"
 #include "base/safe_numerics.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/tools/lsan/suppressions.txt b/tools/lsan/suppressions.txt
index e59141a..998ca50 100644
--- a/tools/lsan/suppressions.txt
+++ b/tools/lsan/suppressions.txt
@@ -1,17 +1,42 @@
-# False positives in libfontconfig. http://crbug.com/39050
-leak:*libfontconfig*
-
 # HeapCheck sanity test
 leak:base::ToolsSanityTest_MemoryLeak_Test::TestBody
 
+# False positives in libfontconfig. http://crbug.com/39050
+leak:libfontconfig
+
 # V8 leak, expect 1024 bytes leaked per process. http://crbug.com/99304
 leak:v8::internal::V8::Initialize
 
+# V8 GC issue which comes up in lots of tests. http://crbug.com/169678
+leak:v8::internal::SlotsBufferAllocator::AllocateBuffer
+
 # V8 GC issues in ProxyResolver tests, probably harmless. http://crbug.com/67378
 leak:net::ProxyResolverV8::SetPacScript
 leak:net::(anonymous namespace)::ProxyResolverV8WithMockBindings::SetPacScriptFromDisk
 leak:net::(anonymous namespace)::InitResolver
 
 # NSS leaks. http://crbug.com/51988
-leak:net::NSSCertDatabase::*
+leak:net::NSSCertDatabase::
 leak:crypto::ScopedTestNSSDB::ScopedTestNSSDB
+# The two suppressions above will not fire when the fast stack unwinder is used,
+# because it can't unwind through libnssutil. Just suppress it for the time being.
+leak:libnssutil
+
+## Global singleton instance of SkFontConfigDirect in Skia. http://crbug.com/186086
+#leak:SkFontConfigInterfaceDirect::SkFontConfigInterfaceDirect
+
+# Skia leaks. http://crbug.com/189170
+leak:SkFontHost::CreateTypeface
+
+# Angle leaks. http://crbug.com/181691
+leak:InitializeGlobalParseContext
+leak:InitializeGlobalPools
+
+# Skia leaks GrGpuGL::ProgramCache::Entry. http://crbug.com/262934
+leak:GrGpuGL::flushGraphicsState
+
+# Small test-only leak in ppapi_unittests. http://crbug.com/258113
+leak:ppapi::proxy::PPP_Instance_Private_ProxyTest_PPPInstancePrivate_Test
+
+# Leak in unit_tests http://crbug.com/155530
+leak:PermissionQueueControllerTests_OneObservationPerInfoBarCancelled_Test
diff --git a/tools/metrics/actions/chromeactions.txt b/tools/metrics/actions/chromeactions.txt
index 83447cd..f8c62b7 100644
--- a/tools/metrics/actions/chromeactions.txt
+++ b/tools/metrics/actions/chromeactions.txt
@@ -1189,7 +1189,7 @@
 0xbdc9ec125e7a3ade	NewWindow
 0xa86d43452b05bf72	Notifications.ShowMessageCenter
 0xa72c673a1f44d11f	OmniboxDestinationURLIsSearchOnDSP
-0xa04047593128ff2a	OmniboxDestinationURLMatchesDefaultSearchProvider
+0x6048dbd4f2f2ca50	OmniboxDestinationURLMatchesDefaultSearchProvider
 0x268376698078c71b	OmniboxInputInProgress
 0xe7ff15c3f1043a26	Omnibox_DragString
 0x1a18c36c737ec22b	Omnibox_DragURL
@@ -1505,6 +1505,7 @@
 0x0d1d6961dd313b79	ShowAppMenu
 0x9be2b265107318b8	ShowApplications
 0x853927a304493ac7	ShowAsTab
+0x2c5584a8586dc1ab	ShowBluetoothSettingsPage
 0x1b93c35c19ff3600	ShowBookmarkManager
 0xd1a227df4f361dbb	ShowBookmarks
 0x1afb02b1f90b177e	ShowBookmarksBar
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 3b58faa..e428ca6 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -4073,6 +4073,10 @@
 </histogram>
 
 <histogram name="InstantExtended.PercentageMatchQuerytoQuery" units="%">
+  <obsolete>
+    Deprecated 2013-07. Please see
+    InstantExtended.PercentageMatchV2_QuerytoQuery instead.
+  </obsolete>
   <summary>
     Records the number of matching characters at the start of the user's text as
     a percentage of average length between the old and new text when the user
@@ -4081,6 +4085,10 @@
 </histogram>
 
 <histogram name="InstantExtended.PercentageMatchQuerytoURL" units="%">
+  <obsolete>
+    Deprecated 2013-07. Please see InstantExtended.PercentageMatchV2_QuerytoURL
+    instead.
+  </obsolete>
   <summary>
     Records the number of matching characters at the start of the user's text as
     a percentage of average length between the old and new text when the user
@@ -4090,6 +4098,10 @@
 </histogram>
 
 <histogram name="InstantExtended.PercentageMatchURLtoQuery" units="%">
+  <obsolete>
+    Deprecated 2013-07. Please see InstantExtended.PercentageMatchV2_URLtoQuery
+    instead.
+  </obsolete>
   <summary>
     Records the number of matching characters at the start of the user's text as
     a percentage of average length between the old and new text when the user
@@ -4098,6 +4110,43 @@
 </histogram>
 
 <histogram name="InstantExtended.PercentageMatchURLtoURL" units="%">
+  <obsolete>
+    Deprecated 2013-07. Please see InstantExtended.PercentageMatchV2_URLtoURL
+    instead.
+  </obsolete>
+  <summary>
+    Records the number of matching characters at the start of the user's text as
+    a percentage of average length between the old and new text when the user
+    navigates from a url to another url.
+  </summary>
+</histogram>
+
+<histogram name="InstantExtended.PercentageMatchV2_QuerytoQuery" units="%">
+  <summary>
+    Records the number of matching characters at the start of the user's text as
+    a percentage of average length between the old and new text when the user
+    navigates from a search query to another search query.
+  </summary>
+</histogram>
+
+<histogram name="InstantExtended.PercentageMatchV2_QuerytoURL" units="%">
+  <summary>
+    Records the number of matching characters at the start of the user's text as
+    a percentage of average length between the old and new text when the user
+    navigates from a search query to a url. Example: Accidental search for
+    google.con, then navigation to google.com.
+  </summary>
+</histogram>
+
+<histogram name="InstantExtended.PercentageMatchV2_URLtoQuery" units="%">
+  <summary>
+    Records the number of matching characters at the start of the user's text as
+    a percentage of average length between the old and new text when the user
+    navigates from a url to a search query.
+  </summary>
+</histogram>
+
+<histogram name="InstantExtended.PercentageMatchV2_URLtoURL" units="%">
   <summary>
     Records the number of matching characters at the start of the user's text as
     a percentage of average length between the old and new text when the user
@@ -13030,6 +13079,10 @@
   <summary>Error codes returned by sqlite for the appcache db.</summary>
 </histogram>
 
+<histogram name="Sqlite.CloseFailure" enum="SqliteErrorCode">
+  <summary>Error which prevented database close.</summary>
+</histogram>
+
 <histogram name="Sqlite.Cookie.Error" enum="SqliteErrorCode">
   <summary>Error codes returned by sqlite the cookie db.</summary>
 </histogram>
@@ -13063,6 +13116,14 @@
   <summary>Error codes returned by sqlite for the history db.</summary>
 </histogram>
 
+<histogram name="Sqlite.OpenFailure" enum="SqliteErrorCode">
+  <summary>Error which prevented database open.</summary>
+</histogram>
+
+<histogram name="Sqlite.OpenProbeFailure" enum="SqliteErrorCode">
+  <summary>Error from first read of the database.</summary>
+</histogram>
+
 <histogram name="Sqlite.Quota.Error" enum="SqliteErrorCode">
   <summary>Error codes returned by sqlite for the quota db.</summary>
 </histogram>
@@ -15468,6 +15529,7 @@
   <int value="5" label="UNCOMMON_CONTENT"/>
   <int value="6" label="USER_VALIDATED"/>
   <int value="7" label="DANGEROUS_HOST"/>
+  <int value="8" label="POTENTIALLY_UNWANTED"/>
 </enum>
 
 <enum name="DownloadSavePackageEvent" type="int">
@@ -16634,6 +16696,7 @@
   <int value="506" label="SYSTEM_CPU_GETINFO"/>
   <int value="507" label="SYSTEM_DISPLAY_GETINFO"/>
   <int value="508" label="SYSTEM_DISPLAY_SETDISPLAYPROPERTIES"/>
+  <int value="509" label="SYSTEM_MEMORY_GETINFO"/>
 </enum>
 
 <enum name="ExtensionInstallCause" type="int">
diff --git a/tools/perf/benchmarks/dom_perf.py b/tools/perf/benchmarks/dom_perf.py
index 11a2c5d..3bc5209 100644
--- a/tools/perf/benchmarks/dom_perf.py
+++ b/tools/perf/benchmarks/dom_perf.py
@@ -55,7 +55,7 @@
     finally:
       tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"')
 
-  def DidRunPageSet(self, tab, results):
+  def DidRunTest(self, tab, results):
     # Now give the geometric mean as the total for the combined runs.
     scores = []
     for result in results.page_results:
diff --git a/tools/perf/benchmarks/memory.py b/tools/perf/benchmarks/memory.py
index 6837b59..05f3e6a 100644
--- a/tools/perf/benchmarks/memory.py
+++ b/tools/perf/benchmarks/memory.py
@@ -6,11 +6,11 @@
 from measurements import memory
 
 
-class Memory(test.Test):
+class MemoryTop25(test.Test):
   test = memory.Memory
   page_set = 'page_sets/top_25.json'
 
 
-class Reload(test.Test):
+class Reload2012Q3(test.Test):
   test = memory.Memory
   page_set = 'page_sets/2012Q3.json'
diff --git a/tools/perf/measurements/blink_perf.py b/tools/perf/measurements/blink_perf.py
index c9c5af9..39ed0a2 100644
--- a/tools/perf/measurements/blink_perf.py
+++ b/tools/perf/measurements/blink_perf.py
@@ -27,17 +27,17 @@
                                    'file://' + path.replace('\\', '/')})
 
   def _AddDir(dir_path, skipped):
-    for path in os.listdir(dir_path):
-      if path == 'resources':
+    for candidate_path in os.listdir(dir_path):
+      if candidate_path == 'resources':
         continue
-      path = os.path.join(dir_path, path)
-      if path.startswith(tuple([os.path.join(path, s)
-                                for s in skipped])):
+      candidate_path = os.path.join(dir_path, candidate_path)
+      if candidate_path.startswith(tuple([os.path.join(path, s)
+                                          for s in skipped])):
         continue
-      if os.path.isdir(path):
-        _AddDir(path, skipped)
+      if os.path.isdir(candidate_path):
+        _AddDir(candidate_path, skipped)
       else:
-        _AddPage(path)
+        _AddPage(candidate_path)
 
   if os.path.isdir(path):
     skipped = []
diff --git a/tools/perf/measurements/loading_measurement_analyzer.py b/tools/perf/measurements/loading_measurement_analyzer.py
index eae2173..395b61d 100755
--- a/tools/perf/measurements/loading_measurement_analyzer.py
+++ b/tools/perf/measurements/loading_measurement_analyzer.py
@@ -9,7 +9,7 @@
 $ tools/perf/run_measurement --browser=release \
     --output-format=csv --output=/path/to/loading_measurement_output.csv \
     loading_measurement tools/perf/page_sets/top_1m.json
-$ tools/perf/perf_tools/loading_measurement_analyzer.py \
+$ tools/perf/measurements/loading_measurement_analyzer.py \
     --num-slowest-urls=100 --rank-csv-file=/path/to/top-1m.csv \
     /path/to/loading_measurement_output.csv
 """
@@ -29,6 +29,9 @@
     self.totals = collections.defaultdict(list)
     self.maxes = collections.defaultdict(list)
     self.avgs = collections.defaultdict(list)
+    self.load_times = []
+    self.cpu_times = []
+    self.network_percents = []
     self.num_rows_parsed = 0
     self.num_slowest_urls = options.num_slowest_urls
     if options.rank_csv_file:
@@ -42,17 +45,30 @@
         if (options.rank_limit and
             self._GetRank(row['url']) > options.rank_limit):
           continue
+        cpu_time = 0
+        load_time = float(row['load_time (ms)'])
+        if load_time < 0:
+          print 'Skipping %s due to negative load time' % row['url']
+          continue
         for key, value in row.iteritems():
-          if key in ('url', 'dom_content_loaded_time (ms)', 'load_time (ms)'):
+          if key in ('url', 'load_time (ms)', 'dom_content_loaded_time (ms)'):
             continue
-          if not value:
+          if not value or value == '-':
             continue
+          value = float(value)
           if '_avg' in key:
-            self.avgs[key].append((float(value), row['url']))
+            self.avgs[key].append((value, row['url']))
           elif '_max' in key:
-            self.maxes[key].append((float(value), row['url']))
+            self.maxes[key].append((value, row['url']))
           else:
-            self.totals[key].append((float(value), row['url']))
+            self.totals[key].append((value, row['url']))
+            cpu_time += value
+        self.load_times.append((load_time, row['url']))
+        self.cpu_times.append((cpu_time, row['url']))
+        if options.show_network:
+          network_time = load_time - cpu_time
+          self.totals['Network (ms)'].append((network_time, row['url']))
+          self.network_percents.append((network_time / load_time, row['url']))
         self.num_rows_parsed += 1
         if options.max_rows and self.num_rows_parsed == int(options.max_rows):
           break
@@ -73,23 +89,30 @@
     sum_totals = {}
     for key, values in self.totals.iteritems():
       sum_totals[key] = sum([v[0] for v in values])
-    total_time = sum(sum_totals.values())
+    total_cpu_time = sum([v[0] for v in self.cpu_times])
+    total_page_load_time = sum([v[0] for v in self.load_times])
 
     print
     print 'Total URLs: ', self.num_rows_parsed
-    print 'Total time: %ds' % int(round(total_time / 1000))
+    print 'Total CPU time: %ds' % int(round(total_cpu_time / 1000))
+    print 'Total page load time: %ds' % int(round(total_page_load_time / 1000))
+    print 'Average CPU time: %dms' % int(round(
+        total_cpu_time / self.num_rows_parsed))
+    print 'Average page load time: %dms' % int(round(
+        total_page_load_time / self.num_rows_parsed))
     print
     for key, value in sorted(sum_totals.iteritems(), reverse=True,
                              key=lambda i: i[1]):
       output_key = '%30s: ' % key.replace(' (ms)', '')
       output_value = '%10ds ' % (value / 1000)
-      output_percent = '%.1f%%' % (100 * value / total_time)
+      output_percent = '%.1f%%' % (100 * value / total_page_load_time)
       print output_key, output_value, output_percent
 
     if not self.num_slowest_urls:
       return
 
-    for key, values in self.totals.iteritems():
+    for key, values in sorted(self.totals.iteritems(), reverse=True,
+                              key=lambda i: sum_totals[i[0]]):
       print
       print 'Top %d slowest %s:' % (self.num_slowest_urls,
                                     key.replace(' (ms)', ''))
@@ -97,6 +120,15 @@
       for value, url in slowest:
         print '\t', '%dms\t' % value, url, '(#%s)' % self._GetRank(url)
 
+    if self.network_percents:
+      print
+      print 'Top %d highest network to CPU time ratios:' % self.num_slowest_urls
+      for percent, url in sorted(
+          self.network_percents, reverse=True)[:self.num_slowest_urls]:
+        percent *= 100
+        print '\t', '%.1f%%' % percent, url, '(#%s)' % self._GetRank(url)
+
+
 def main(argv):
   prog_desc = 'Parses CSV output from the loading_measurement'
   parser = optparse.OptionParser(usage=('%prog [options]' + '\n\n' + prog_desc))
@@ -108,6 +140,8 @@
   parser.add_option('--rank-csv-file', help='A CSV file of <rank,url>')
   parser.add_option('--rank-limit', type='int',
                     help='Only process pages higher than this rank')
+  parser.add_option('--show-network', action='store_true',
+                    help='Whether to display Network as a category')
 
   options, args = parser.parse_args(argv[1:])
 
diff --git a/tools/perf/measurements/loading_profile.py b/tools/perf/measurements/loading_profile.py
new file mode 100644
index 0000000..012f80e
--- /dev/null
+++ b/tools/perf/measurements/loading_profile.py
@@ -0,0 +1,62 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import tempfile
+
+from telemetry.core import util
+from telemetry.core.platform.profiler import perf_profiler
+from telemetry.page import page_measurement
+
+class LoadingProfile(page_measurement.PageMeasurement):
+  def __init__(self):
+    super(LoadingProfile, self).__init__(discard_first_result=True)
+
+  @property
+  def results_are_the_same_on_every_page(self):
+    return False
+
+  def AddCommandLineOptions(self, parser):
+    # In order to change the default of an option, we must remove and re-add it.
+    page_repeat_option = parser.get_option('--page-repeat')
+    page_repeat_option.default = 2
+    parser.remove_option('--page-repeat')
+    parser.add_option(page_repeat_option)
+
+  def CustomizeBrowserOptions(self, options):
+    options.AppendExtraBrowserArg('--no-sandbox')
+
+  def WillNavigateToPage(self, page, tab):
+    tab.browser.StartProfiling(perf_profiler.PerfProfiler.name(),
+                               os.path.join(tempfile.mkdtemp(),
+                                            page.url_as_file_safe_name))
+
+  def MeasurePage(self, page, tab, results):
+    # In current telemetry tests, all tests wait for DocumentComplete state,
+    # but we need to wait for the load event.
+    def IsLoaded():
+      return bool(tab.EvaluateJavaScript('performance.timing.loadEventStart'))
+    util.WaitFor(IsLoaded, 300)
+
+    profile_files = tab.browser.StopProfiling()
+
+    load_timings = tab.EvaluateJavaScript('window.performance.timing')
+    load_time_ms = (
+      float(load_timings['loadEventStart']) -
+      load_timings['navigationStart'])
+    dom_content_loaded_time_ms = (
+      float(load_timings['domContentLoadedEventStart']) -
+      load_timings['navigationStart'])
+    results.Add('load_time', 'ms', load_time_ms)
+    results.Add('dom_content_loaded_time', 'ms',
+                dom_content_loaded_time_ms)
+
+    profile_file = None
+    for profile_file in profile_files:
+      if 'renderer' in profile_file:
+        break
+
+    for function, period in perf_profiler.PerfProfiler.GetTopSamples(
+        profile_file, 10).iteritems():
+      results.Add(function.replace('.', '_'), 'period', period)
diff --git a/tools/perf/measurements/page_cycler.py b/tools/perf/measurements/page_cycler.py
index 811d87d..46ef187 100644
--- a/tools/perf/measurements/page_cycler.py
+++ b/tools/perf/measurements/page_cycler.py
@@ -125,6 +125,6 @@
                 int(float(tab.EvaluateJavaScript('__pc_load_time'))),
                 chart_name='times')
 
-  def DidRunPageSet(self, tab, results):
+  def DidRunTest(self, tab, results):
     self._memory_metrics.StopAndGetResults(tab.browser, results)
     self.MeasureIO(tab, results)
diff --git a/tools/perf/perf_tools/media_metrics.js b/tools/perf/perf_tools/media_metrics.js
index 8b0938b..0bbec91 100644
--- a/tools/perf/perf_tools/media_metrics.js
+++ b/tools/perf/perf_tools/media_metrics.js
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -13,10 +13,6 @@
     this.metrics = {};
     this.id = '';
     this.element = element;
-    // Listen to when a Telemetry 'Play' action gets called.
-    // TODO(shadi): Add event listeners for other media actions here.
-    if (this.element)
-      this.element.addEventListener('willPlay', this.onWillPlay, false);
   }
 
   MediaMetricBase.prototype.getMetrics = function() {
@@ -30,10 +26,6 @@
     };
   };
 
-  MediaMetricBase.prototype.onWillPlay = function() {
-    this.playbackTimer = new Timer();
-  };
-
   function HTMLMediaMetric(element) {
     MediaMetricBase.prototype.constructor.call(this, element);
     // Set the basic event handlers for HTML5 media element.
@@ -54,10 +46,19 @@
         metric.onEnded(e);
       });
     this.setID();
+
+    // Listen to when a Telemetry actions gets called.
+    this.element.addEventListener('willPlay', function (e) {
+        metric.onWillPlay(e);
+      }, false);
+    this.element.addEventListener('willSeek', function (e) {
+        metric.onWillSeek(e);
+      }, false);
   }
 
   HTMLMediaMetric.prototype = new MediaMetricBase();
   HTMLMediaMetric.prototype.constructor = HTMLMediaMetric;
+
   HTMLMediaMetric.prototype.setID = function() {
     if (this.element.src)
       this.id = this.element.src.substring(this.element.src.lastIndexOf("/")+1);
@@ -67,6 +68,39 @@
       this.id = 'media_' + window.__globalCounter++;
   };
 
+  HTMLMediaMetric.prototype.onWillPlay = function(e) {
+    this.playbackTimer = new Timer();
+  };
+
+  HTMLMediaMetric.prototype.onWillSeek = function(e) {
+    var seekLabel = '';
+    if (e.seekLabel)
+      seekLabel = '_' + e.seekLabel;
+    var metric = this;
+    var onSeeked = function(e) {
+        metric.appendMetric('seek' + seekLabel, metric.seekTimer.stop())
+        e.target.removeEventListener('seeked', onSeeked);
+      };
+    this.seekTimer = new Timer();
+    this.element.addEventListener('seeked', onSeeked);
+  };
+
+  HTMLMediaMetric.prototype.appendMetric = function(metric, value) {
+    if (!this.metrics[metric])
+      this.metrics[metric] = [];
+    this.metrics[metric].push(value);
+  }
+
+  HTMLMediaMetric.prototype.onPlaying = function(event) {
+    // Playing event can fire more than once if seeking.
+    if (!this.metrics['time_to_play'])
+      this.metrics['time_to_play'] = this.playbackTimer.stop();
+  };
+
+  HTMLMediaMetric.prototype.onEnded = function(event) {
+    this.metrics['playback_time'] = this.playbackTimer.stop();
+  };
+
   HTMLMediaMetric.prototype.getMetrics = function() {
     this.metrics['decoded_frame_count'] = this.element.webkitDecodedFrameCount;
     this.metrics['dropped_frame_count'] = this.element.webkitDroppedFrameCount;
@@ -77,16 +111,6 @@
     return this.metrics;
   };
 
-  HTMLMediaMetric.prototype.onPlaying = function(event) {
-    // Playing event can fire more than once if seeking.
-    if (!this.metrics['time_to_play'])
-      this.metrics['time_to_play'] = this.playbackTimer.stop();
-  };
-
-  HTMLMediaMetric.prototype.onEnded = function(event) {
-    this.metrics['playback_time'] = this.playbackTimer.stop();
-  };
-
   function MediaMetric(element) {
     if (element instanceof HTMLMediaElement)
       return new HTMLMediaMetric(element);
diff --git a/tools/perf/perf_tools/media_metrics.py b/tools/perf/perf_tools/media_metrics.py
index 6f85a9a..0d84727 100644
--- a/tools/perf/perf_tools/media_metrics.py
+++ b/tools/perf/perf_tools/media_metrics.py
@@ -1,4 +1,4 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
@@ -29,9 +29,9 @@
     """Reports all recorded metrics as Telemetry perf results."""
     media_metrics = self.tab.EvaluateJavaScript('window.__getAllMetrics()')
     for media_metric in media_metrics:
-      self.AddResultForMediaElement(media_metric, results)
+      self.AddResultsForMediaElement(media_metric, results)
 
-  def AddResultForMediaElement(self, media_metric, results):
+  def AddResultsForMediaElement(self, media_metric, results):
     """Reports metrics for one media element.
 
     Media metrics contain an ID identifying the media element and values:
@@ -44,20 +44,22 @@
       }
     }
     """
-    def AddResult(metric, unit):
+    def AddResults(metric, unit):
       metrics = media_metric['metrics']
-      if metric in metrics:
-        results.Add(trace, unit, str(metrics[metric]), chart_name=metric,
-                    data_type='default')
+      for m in metrics:
+        if m.startswith(metric):
+          special_label = m[len(metric):]
+          results.Add(trace + special_label, unit, str(metrics[m]),
+                      chart_name=metric, data_type='default')
 
     trace = media_metric['id']
     if not trace:
       logging.error('Metrics ID is missing in results.')
       return
-
-    AddResult('time_to_play', 'sec')
-    AddResult('playback_time', 'sec')
-    AddResult('decoded_audio_bytes', 'bytes')
-    AddResult('decoded_video_bytes', 'bytes')
-    AddResult('decoded_frame_count', 'frames')
-    AddResult('dropped_frame_count', 'frames')
+    AddResults('decoded_audio_bytes', 'bytes')
+    AddResults('decoded_video_bytes', 'bytes')
+    AddResults('decoded_frame_count', 'frames')
+    AddResults('dropped_frame_count', 'frames')
+    AddResults('playback_time', 'sec')
+    AddResults('seek', 'sec')
+    AddResults('time_to_play', 'sec')
diff --git a/tools/perf_expectations/perf_expectations.json b/tools/perf_expectations/perf_expectations.json
index fa375ae..0c03b50 100644
--- a/tools/perf_expectations/perf_expectations.json
+++ b/tools/perf_expectations/perf_expectations.json
@@ -2,7 +2,7 @@
  "linux-release-64/sizes/chrome-data/data": {"reva": 203454, "revb": 203474, "type": "absolute", "better": "lower", "improve": 3570183, "regress": 3946094, "sha1": "b0d5e0fc"},
  "linux-release-64/sizes/chrome-si/initializers": {"reva": 196313, "revb": 196318, "type": "absolute", "better": "lower", "improve": 34, "regress": 34, "tolerance": 0, "sha1": "cd47eda1"},
  "linux-release-64/sizes/chrome-text/text": {"reva": 203454, "revb": 203474, "type": "absolute", "better": "lower", "improve": 94012670, "regress": 103908994, "sha1": "a8dc15a3"},
- "linux-release-64/sizes/chrome.pak/chrome.pak": {"reva": 198656, "revb": 198664, "type": "absolute", "better": "lower", "improve": 4078952, "regress": 4508316, "sha1": "f27082e0"},
+ "linux-release-64/sizes/chrome.pak/chrome.pak": {"reva": 213231, "revb": 213240, "type": "absolute", "better": "lower", "improve": 4341123, "regress": 4798085, "sha1": "6ac89446"},
  "linux-release-64/sizes/chrome/chrome": {"reva": 203454, "revb": 203474, "type": "absolute", "better": "lower", "improve": 128793270, "regress": 142351155, "sha1": "193926f5"},
  "linux-release-64/sizes/nacl_helper-bss/bss": {"reva": 193069, "revb": 193093, "type": "absolute", "better": "lower", "improve": 200024, "regress": 221080, "sha1": "5dfae63b"},
  "linux-release-64/sizes/nacl_helper-data/data": {"reva": 195191, "revb": 203172, "type": "absolute", "better": "lower", "improve": 22942, "regress": 26878, "sha1": "6d52a881"},
@@ -368,7 +368,7 @@
  "linux-release/sizes/chrome-si/initializers": {"reva": 196188, "revb": 197308, "type": "absolute", "better": "lower", "improve": 35, "regress": 35, "tolerance": 0, "sha1": "86b46a4e"},
  "linux-release/sizes/chrome-text/text": {"reva": 203454, "revb": 203474, "type": "absolute", "better": "lower", "improve": 79833368, "regress": 88237335, "sha1": "e1b38def"},
  "linux-release/sizes/chrome-textrel/textrel": {"reva": 135570, "revb": 135664, "type": "absolute", "better": "lower", "improve": 0, "regress": 0, "sha1": "832078e7"},
- "linux-release/sizes/chrome.pak/chrome.pak": {"reva": 198656, "revb": 198664, "type": "absolute", "better": "lower", "improve": 4078952, "regress": 4508316, "sha1": "f9935a36"},
+ "linux-release/sizes/chrome.pak/chrome.pak": {"reva": 213231, "revb": 213240, "type": "absolute", "better": "lower", "improve": 4279298, "regress": 4729752, "sha1": "8c0306cc"},
  "linux-release/sizes/chrome/chrome": {"reva": 203454, "revb": 203474, "type": "absolute", "better": "lower", "improve": 108516653, "regress": 119939890, "sha1": "a6649863"},
  "linux-release/sizes/libffmpegsumo.so-textrel/textrel": {"reva": 200467, "revb": 203456, "type": "absolute", "better": "lower", "improve": 1075, "regress": 1189, "sha1": "a10d4ea4"},
  "linux-release/sizes/nacl_helper-bss/bss": {"reva": 193069, "revb": 193093, "type": "absolute", "better": "lower", "improve": 100506, "regress": 111086, "sha1": "805988e3"},
@@ -739,7 +739,7 @@
  "win-release/media_tests_av_perf/ttp/Wifi_roller.webm": {"reva": 175328, "revb": 176157, "type": "absolute", "better": "lower", "improve": 906.775, "regress": 1184.925, "sha1": "d49e638f"},
  "xp-release/sizes/chrome.dll/chrome.dll": {"reva": 203454, "revb": 203508, "type": "absolute", "better": "lower", "improve": 55459814, "regress": 61312205, "sha1": "b01d47d9"},
  "xp-release/sizes/chrome.exe/chrome.exe": {"reva": 183841, "revb": 184954, "type": "absolute", "better": "lower", "improve": 720358, "regress": 796186, "sha1": "b5aa4523"},
- "xp-release/sizes/mini_installer.exe/mini_installer.exe": {"reva": 183841, "revb": 184954, "type": "absolute", "better": "lower", "improve": 26480102, "regress": 29465319, "sha1": "7d9a453f"},
+ "xp-release/sizes/mini_installer.exe/mini_installer.exe": {"reva": 212973, "revb": 213132, "type": "absolute", "better": "lower", "improve": 28051174, "regress": 31094247, "sha1": "303dac45"},
  "xp-release/sizes/npchrome_frame.dll/npchrome_frame.dll": {"reva": 212047, "revb": 212054, "type": "absolute", "better": "lower", "improve": 2722380, "regress": 3008948, "sha1": "6d412793"},
  "xp-release/sizes/setup.exe/setup.exe": {"reva": 183841, "revb": 184954, "type": "absolute", "better": "lower", "improve": 1080780, "regress": 1195085, "sha1": "c56e884e"},
  "load": true
diff --git a/tools/telemetry/docs/telemetry.core.browser.html b/tools/telemetry/docs/telemetry.core.browser.html
index 7bfb567..78dfc77 100644
--- a/tools/telemetry/docs/telemetry.core.browser.html
+++ b/tools/telemetry/docs/telemetry.core.browser.html
@@ -64,18 +64,20 @@
 <td width="100%">Methods defined here:<br>
 <dl><dt><a name="Browser-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&nbsp;this&nbsp;browser.</tt></dd></dl>
 
+<dl><dt><a name="Browser-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="Browser-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="Browser-GetTraceResultAndReset"><strong>GetTraceResultAndReset</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;result&nbsp;of&nbsp;the&nbsp;trace,&nbsp;as&nbsp;TraceResult&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>
 
 <dl><dt><a name="Browser-SetHTTPServerDirectories"><strong>SetHTTPServerDirectories</strong></a>(self, paths)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;HTTP&nbsp;server&nbsp;was&nbsp;started,&nbsp;False&nbsp;otherwise.</tt></dd></dl>
 
-<dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</strong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False</font>)</dt></dl>
+<dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</strong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False</font>, make_javascript_deterministic<font color="#909090">=True</font>)</dt></dl>
 
 <dl><dt><a name="Browser-StartProfiling"><strong>StartProfiling</strong></a>(self, options, base_output_file)</dt><dd><tt>Starts&nbsp;profiling&nbsp;using&nbsp;|options|.profiler_tool.&nbsp;Results&nbsp;are&nbsp;saved&nbsp;to<br>
 |base_output_file|.&lt;process_name&gt;.</tt></dd></dl>
 
-<dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=10</font>)</dt></dl>
 
 <dl><dt><a name="Browser-StopProfiling"><strong>StopProfiling</strong></a>(self)</dt><dd><tt>Stops&nbsp;all&nbsp;active&nbsp;profilers&nbsp;and&nbsp;saves&nbsp;their&nbsp;results.</tt></dd></dl>
 
diff --git a/tools/telemetry/docs/telemetry.core.chrome.adb_commands.html b/tools/telemetry/docs/telemetry.core.chrome.adb_commands.html
index 8b043a9..7203e42 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.adb_commands.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.adb_commands.html
@@ -115,6 +115,8 @@
 
 <dl><dt><a name="AdbCommands-__init__"><strong>__init__</strong></a>(self, device)</dt></dl>
 
+<dl><dt><a name="AdbCommands-device"><strong>device</strong></a>(self)</dt></dl>
+
 <hr>
 Data descriptors defined here:<br>
 <dl><dt><strong>__dict__</strong></dt>
@@ -136,6 +138,12 @@
 <dl><dt><a name="Forwarder-__init__"><strong>__init__</strong></a>(self, adb, *port_pairs)</dt></dl>
 
 <hr>
+Static methods defined here:<br>
+<dl><dt><a name="Forwarder-KillDevice"><strong>KillDevice</strong></a>(adb)</dt></dl>
+
+<dl><dt><a name="Forwarder-KillHost"><strong>KillHost</strong></a>()</dt></dl>
+
+<hr>
 Data descriptors defined here:<br>
 <dl><dt><strong>__dict__</strong></dt>
 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.android_browser_backend.html b/tools/telemetry/docs/telemetry.core.chrome.android_browser_backend.html
index c521930..f1cd499 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.android_browser_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.android_browser_backend.html
@@ -26,8 +26,8 @@
 <a href="os.html">os</a><br>
 <a href="subprocess.html">subprocess</a><br>
 </td><td width="25%" valign=top><a href="sys.html">sys</a><br>
-<a href="tempfile.html">tempfile</a><br>
 <a href="time.html">time</a><br>
+<a href="telemetry.core.util.html">telemetry.core.util</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -81,6 +81,8 @@
 
 <dl><dt><a name="AndroidBrowserBackend-GetRemotePort"><strong>GetRemotePort</strong></a>(self, local_port)</dt></dl>
 
+<dl><dt><a name="AndroidBrowserBackend-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="AndroidBrowserBackend-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="AndroidBrowserBackend-IsBrowserRunning"><strong>IsBrowserRunning</strong></a>(self)</dt></dl>
@@ -105,7 +107,7 @@
 
 <dl><dt><a name="AndroidBrowserBackend-SetBrowser"><strong>SetBrowser</strong></a>(self, browser)</dt></dl>
 
-<dl><dt><a name="AndroidBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
+<dl><dt><a name="AndroidBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=60</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
 comma&nbsp;separated&nbsp;categories&nbsp;that&nbsp;will&nbsp;be&nbsp;traced&nbsp;instead&nbsp;of&nbsp;the<br>
 default&nbsp;category&nbsp;set.&nbsp;&nbsp;Example:&nbsp;use<br>
 "webkit,cc,disabled-by-default-cc.debug"&nbsp;to&nbsp;trace&nbsp;only&nbsp;those&nbsp;three<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.android_browser_finder.html b/tools/telemetry/docs/telemetry.core.chrome.android_browser_finder.html
index ab44cb9..188c5a8 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.android_browser_finder.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.android_browser_finder.html
@@ -86,7 +86,7 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
     
 <tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl><dt><a name="-FindAllAvailableBrowsers"><strong>FindAllAvailableBrowsers</strong></a>(options, logging<font color="#909090">=&lt;module 'logging' from '/usr/lib/python2.7/logging/__init__.pyc'&gt;</font>)</dt><dd><tt>Finds&nbsp;all&nbsp;the&nbsp;desktop&nbsp;browsers&nbsp;available&nbsp;on&nbsp;this&nbsp;machine.</tt></dd></dl>
+<td width="100%"><dl><dt><a name="-FindAllAvailableBrowsers"><strong>FindAllAvailableBrowsers</strong></a>(options, logging<font color="#909090">=&lt;module 'logging' from '/System/Library/Framewor...Versions/2.7/lib/python2.7/logging/__init__.pyc'&gt;</font>)</dt><dd><tt>Finds&nbsp;all&nbsp;the&nbsp;desktop&nbsp;browsers&nbsp;available&nbsp;on&nbsp;this&nbsp;machine.</tt></dd></dl>
 </td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#55aa55">
diff --git a/tools/telemetry/docs/telemetry.core.chrome.browser_backend.html b/tools/telemetry/docs/telemetry.core.chrome.browser_backend.html
index 8c39337..0dc4879 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.browser_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.browser_backend.html
@@ -23,17 +23,18 @@
 <a href="telemetry.core.chrome.extension_dict_backend.html">telemetry.core.chrome.extension_dict_backend</a><br>
 <a href="httplib.html">httplib</a><br>
 <a href="json.html">json</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.chrome.misc_web_contents_backend.html">telemetry.core.chrome.misc_web_contents_backend</a><br>
-<a href="telemetry.unittest.options_for_unittests.html">telemetry.unittest.options_for_unittests</a><br>
+<a href="telemetry.core.chrome.misc_web_contents_backend.html">telemetry.core.chrome.misc_web_contents_backend</a><br>
+</td><td width="25%" valign=top><a href="telemetry.unittest.options_for_unittests.html">telemetry.unittest.options_for_unittests</a><br>
 <a href="re.html">re</a><br>
 <a href="socket.html">socket</a><br>
-</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+<a href="sys.html">sys</a><br>
 <a href="telemetry.core.chrome.tab_list_backend.html">telemetry.core.chrome.tab_list_backend</a><br>
-<a href="telemetry.core.chrome.tracing_backend.html">telemetry.core.chrome.tracing_backend</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.chrome.tracing_backend.html">telemetry.core.chrome.tracing_backend</a><br>
 <a href="urllib2.html">urllib2</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.user_agent.html">telemetry.core.user_agent</a><br>
+<a href="telemetry.core.user_agent.html">telemetry.core.user_agent</a><br>
 <a href="telemetry.core.util.html">telemetry.core.util</a><br>
-<a href="telemetry.core.wpr_modes.html">telemetry.core.wpr_modes</a><br>
+<a href="telemetry.core.web_contents.html">telemetry.core.web_contents</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.wpr_modes.html">telemetry.core.wpr_modes</a><br>
 <a href="telemetry.core.wpr_server.html">telemetry.core.wpr_server</a><br>
 </td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
@@ -78,6 +79,8 @@
 
 <dl><dt><a name="BrowserBackend-GetRemotePort"><strong>GetRemotePort</strong></a>(self, _)</dt></dl>
 
+<dl><dt><a name="BrowserBackend-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="BrowserBackend-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="BrowserBackend-GetTraceResultAndReset"><strong>GetTraceResultAndReset</strong></a>(self)</dt></dl>
@@ -88,7 +91,7 @@
 
 <dl><dt><a name="BrowserBackend-SetBrowser"><strong>SetBrowser</strong></a>(self, browser)</dt></dl>
 
-<dl><dt><a name="BrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
+<dl><dt><a name="BrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=60</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
 comma&nbsp;separated&nbsp;categories&nbsp;that&nbsp;will&nbsp;be&nbsp;traced&nbsp;instead&nbsp;of&nbsp;the<br>
 default&nbsp;category&nbsp;set.&nbsp;&nbsp;Example:&nbsp;use<br>
 "webkit,cc,disabled-by-default-cc.debug"&nbsp;to&nbsp;trace&nbsp;only&nbsp;those&nbsp;three<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.cros_browser_backend.html b/tools/telemetry/docs/telemetry.core.chrome.cros_browser_backend.html
index f8ede9d..77f729c 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.cros_browser_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.cros_browser_backend.html
@@ -20,13 +20,12 @@
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.chrome.browser_backend.html">telemetry.core.chrome.browser_backend</a><br>
-<a href="telemetry.core.chrome.cros_util.html">telemetry.core.chrome.cros_util</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
-<a href="logging.html">logging</a><br>
-</td><td width="25%" valign=top><a href="os.html">os</a><br>
-<a href="subprocess.html">subprocess</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br>
-</td></tr></table></td></tr></table><p>
+<a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
+</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
+<a href="os.html">os</a><br>
+</td><td width="25%" valign=top><a href="subprocess.html">subprocess</a><br>
+<a href="telemetry.core.util.html">telemetry.core.util</a><br>
+</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
 <td colspan=3 valign=bottom>&nbsp;<br>
@@ -69,6 +68,8 @@
 
 <dl><dt><a name="CrOSBrowserBackend-GetRemotePort"><strong>GetRemotePort</strong></a>(self, _)</dt></dl>
 
+<dl><dt><a name="CrOSBrowserBackend-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="CrOSBrowserBackend-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="CrOSBrowserBackend-IsBrowserRunning"><strong>IsBrowserRunning</strong></a>(self)</dt></dl>
@@ -81,6 +82,8 @@
 Data descriptors defined here:<br>
 <dl><dt><strong>hwid</strong></dt>
 </dl>
+<dl><dt><strong>oobe</strong></dt>
+</dl>
 <dl><dt><strong>pid</strong></dt>
 <dd><tt>Locates&nbsp;the&nbsp;pid&nbsp;of&nbsp;the&nbsp;main&nbsp;chrome&nbsp;browser&nbsp;process.<br>
 &nbsp;<br>
@@ -107,7 +110,7 @@
 
 <dl><dt><a name="CrOSBrowserBackend-SetBrowser"><strong>SetBrowser</strong></a>(self, browser)</dt></dl>
 
-<dl><dt><a name="CrOSBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
+<dl><dt><a name="CrOSBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=60</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
 comma&nbsp;separated&nbsp;categories&nbsp;that&nbsp;will&nbsp;be&nbsp;traced&nbsp;instead&nbsp;of&nbsp;the<br>
 default&nbsp;category&nbsp;set.&nbsp;&nbsp;Example:&nbsp;use<br>
 "webkit,cc,disabled-by-default-cc.debug"&nbsp;to&nbsp;trace&nbsp;only&nbsp;those&nbsp;three<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.cros_browser_finder.html b/tools/telemetry/docs/telemetry.core.chrome.cros_browser_finder.html
index bfe4478..6533776 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.cros_browser_finder.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.cros_browser_finder.html
@@ -19,14 +19,12 @@
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.browser.html">telemetry.core.browser</a><br>
 <a href="telemetry.core.chrome.cros_browser_backend.html">telemetry.core.chrome.cros_browser_backend</a><br>
-<a href="telemetry.core.chrome.cros_interface.html">telemetry.core.chrome.cros_interface</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.platform.cros_platform_backend.html">telemetry.core.platform.cros_platform_backend</a><br>
-<a href="logging.html">logging</a><br>
-<a href="os.html">os</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.possible_browser.html">telemetry.core.possible_browser</a><br>
-<a href="telemetry.core.profile_types.html">telemetry.core.profile_types</a><br>
-<a href="sys.html">sys</a><br>
-</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
+</td><td width="25%" valign=top><a href="telemetry.core.chrome.cros_interface.html">telemetry.core.chrome.cros_interface</a><br>
+<a href="telemetry.core.platform.cros_platform_backend.html">telemetry.core.platform.cros_platform_backend</a><br>
+</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
+<a href="telemetry.core.possible_browser.html">telemetry.core.possible_browser</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.profile_types.html">telemetry.core.profile_types</a><br>
+</td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
 <td colspan=3 valign=bottom>&nbsp;<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.cros_interface.html b/tools/telemetry/docs/telemetry.core.chrome.cros_interface.html
index 00657e3..205da41 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.cros_interface.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.cros_interface.html
@@ -21,7 +21,8 @@
 <a href="os.html">os</a><br>
 </td><td width="25%" valign=top><a href="re.html">re</a><br>
 <a href="subprocess.html">subprocess</a><br>
-</td><td width="25%" valign=top><a href="tempfile.html">tempfile</a><br>
+</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+<a href="tempfile.html">tempfile</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -234,6 +235,7 @@
 &nbsp;&nbsp;Captures&nbsp;and&nbsp;returns&nbsp;the&nbsp;command's&nbsp;stdout.<br>
 &nbsp;&nbsp;Prints&nbsp;the&nbsp;command's&nbsp;stderr&nbsp;to&nbsp;logger&nbsp;(which&nbsp;defaults&nbsp;to&nbsp;stdout).</tt></dd></dl>
  <dl><dt><a name="-HasSSH"><strong>HasSSH</strong></a>()</dt></dl>
+ <dl><dt><a name="-IsRunningOnCrosDevice"><strong>IsRunningOnCrosDevice</strong></a>()</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;we're&nbsp;on&nbsp;a&nbsp;ChromeOS&nbsp;device.</tt></dd></dl>
  <dl><dt><a name="-RunCmd"><strong>RunCmd</strong></a>(args, cwd<font color="#909090">=None</font>, quiet<font color="#909090">=False</font>)</dt><dd><tt>Opens&nbsp;a&nbsp;subprocess&nbsp;to&nbsp;execute&nbsp;a&nbsp;program&nbsp;and&nbsp;returns&nbsp;its&nbsp;return&nbsp;value.<br>
 &nbsp;<br>
 Args:<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.cros_util.html b/tools/telemetry/docs/telemetry.core.chrome.cros_util.html
deleted file mode 100644
index e58a97c..0000000
--- a/tools/telemetry/docs/telemetry.core.chrome.cros_util.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.chrome.cros_util</title>
-</head><body bgcolor="#f0f0f8">
-
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
-<tr bgcolor="#7799ee">
-<td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.chrome.html"><font color="#ffffff">chrome</font></a>.cros_util</strong></big></big></font></td
-><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/chrome/cros_util.py">telemetry/core/chrome/cros_util.py</a></font></td></tr></table>
-    <p><tt>#&nbsp;Copyright&nbsp;(c)&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
-#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
-#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
-<p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#aa55cc">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br>
-</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#eeaa77">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl><dt><a name="-NavigateGuestLogin"><strong>NavigateGuestLogin</strong></a>(browser_backend, cri)</dt><dd><tt>Navigates&nbsp;through&nbsp;oobe&nbsp;login&nbsp;screen&nbsp;as&nbsp;guest</tt></dd></dl>
- <dl><dt><a name="-NavigateLogin"><strong>NavigateLogin</strong></a>(browser_backend, cri)</dt><dd><tt>Navigates&nbsp;through&nbsp;oobe&nbsp;login&nbsp;screen</tt></dd></dl>
- <dl><dt><a name="-WaitForAccountPicker"><strong>WaitForAccountPicker</strong></a>(oobe)</dt><dd><tt>Waits&nbsp;for&nbsp;the&nbsp;oobe&nbsp;screen&nbsp;to&nbsp;be&nbsp;in&nbsp;the&nbsp;account&nbsp;picker&nbsp;state.</tt></dd></dl>
- <dl><dt><a name="-WaitForGuestFsMounted"><strong>WaitForGuestFsMounted</strong></a>(cri)</dt><dd><tt>Waits&nbsp;for&nbsp;/home/chronos/user&nbsp;to&nbsp;be&nbsp;mounted&nbsp;as&nbsp;guestfs</tt></dd></dl>
-</td></tr></table>
-</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html
index 87dc3de..5f2b6ae 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html
@@ -65,6 +65,8 @@
 
 <dl><dt><a name="DesktopBrowserBackend-GetBrowserStartupArgs"><strong>GetBrowserStartupArgs</strong></a>(self)</dt></dl>
 
+<dl><dt><a name="DesktopBrowserBackend-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="DesktopBrowserBackend-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="DesktopBrowserBackend-IsBrowserRunning"><strong>IsBrowserRunning</strong></a>(self)</dt></dl>
@@ -93,7 +95,7 @@
 
 <dl><dt><a name="DesktopBrowserBackend-SetBrowser"><strong>SetBrowser</strong></a>(self, browser)</dt></dl>
 
-<dl><dt><a name="DesktopBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
+<dl><dt><a name="DesktopBrowserBackend-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=60</font>)</dt><dd><tt>custom_categories&nbsp;is&nbsp;an&nbsp;optional&nbsp;string&nbsp;containing&nbsp;a&nbsp;list&nbsp;of<br>
 comma&nbsp;separated&nbsp;categories&nbsp;that&nbsp;will&nbsp;be&nbsp;traced&nbsp;instead&nbsp;of&nbsp;the<br>
 default&nbsp;category&nbsp;set.&nbsp;&nbsp;Example:&nbsp;use<br>
 "webkit,cc,disabled-by-default-cc.debug"&nbsp;to&nbsp;trace&nbsp;only&nbsp;those&nbsp;three<br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html
index 6069080..a7a62d7 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html
@@ -18,17 +18,18 @@
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.browser.html">telemetry.core.browser</a><br>
+<a href="telemetry.core.chrome.cros_interface.html">telemetry.core.chrome.cros_interface</a><br>
 <a href="telemetry.core.chrome.desktop_browser_backend.html">telemetry.core.chrome.desktop_browser_backend</a><br>
 <a href="telemetry.core.platform.linux_platform_backend.html">telemetry.core.platform.linux_platform_backend</a><br>
 </td><td width="25%" valign=top><a href="logging.html">logging</a><br>
 <a href="telemetry.core.platform.mac_platform_backend.html">telemetry.core.platform.mac_platform_backend</a><br>
 <a href="os.html">os</a><br>
-</td><td width="25%" valign=top><a href="platform.html">platform</a><br>
-<a href="telemetry.core.possible_browser.html">telemetry.core.possible_browser</a><br>
+<a href="platform.html">platform</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.possible_browser.html">telemetry.core.possible_browser</a><br>
 <a href="telemetry.core.profile_types.html">telemetry.core.profile_types</a><br>
-</td><td width="25%" valign=top><a href="subprocess.html">subprocess</a><br>
+<a href="subprocess.html">subprocess</a><br>
 <a href="sys.html">sys</a><br>
-<a href="telemetry.core.platform.win_platform_backend.html">telemetry.core.platform.win_platform_backend</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.platform.win_platform_backend.html">telemetry.core.platform.win_platform_backend</a><br>
 </td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
diff --git a/tools/telemetry/docs/telemetry.core.chrome.html b/tools/telemetry/docs/telemetry.core.chrome.html
index b947b5f..fc38ab2 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.html
@@ -29,9 +29,8 @@
 <a href="telemetry.core.chrome.cros_browser_finder_unittest.html">cros_browser_finder_unittest</a><br>
 <a href="telemetry.core.chrome.cros_interface.html">cros_interface</a><br>
 <a href="telemetry.core.chrome.cros_interface_unittest.html">cros_interface_unittest</a><br>
-<a href="telemetry.core.chrome.cros_util.html">cros_util</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.chrome.crx_id.html">crx_id</a><br>
-<a href="telemetry.core.chrome.desktop_browser_backend.html">desktop_browser_backend</a><br>
+<a href="telemetry.core.chrome.crx_id.html">crx_id</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.chrome.desktop_browser_backend.html">desktop_browser_backend</a><br>
 <a href="telemetry.core.chrome.desktop_browser_finder.html">desktop_browser_finder</a><br>
 <a href="telemetry.core.chrome.desktop_browser_finder_unittest.html">desktop_browser_finder_unittest</a><br>
 <a href="telemetry.core.chrome.extension_dict_backend.html">extension_dict_backend</a><br>
@@ -41,8 +40,8 @@
 <a href="telemetry.core.chrome.form_based_credentials_backend_unittest_base.html">form_based_credentials_backend_unittest_base</a><br>
 <a href="telemetry.core.chrome.google_credentials_backend.html">google_credentials_backend</a><br>
 <a href="telemetry.core.chrome.google_credentials_backend_unittest.html">google_credentials_backend_unittest</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.chrome.inspector_backend.html">inspector_backend</a><br>
-<a href="telemetry.core.chrome.inspector_console.html">inspector_console</a><br>
+<a href="telemetry.core.chrome.inspector_backend.html">inspector_backend</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.chrome.inspector_console.html">inspector_console</a><br>
 <a href="telemetry.core.chrome.inspector_console_unittest.html">inspector_console_unittest</a><br>
 <a href="telemetry.core.chrome.inspector_memory.html">inspector_memory</a><br>
 <a href="telemetry.core.chrome.inspector_memory_unittest.html">inspector_memory_unittest</a><br>
@@ -52,8 +51,8 @@
 <a href="telemetry.core.chrome.inspector_runtime.html">inspector_runtime</a><br>
 <a href="telemetry.core.chrome.inspector_runtime_unittest.html">inspector_runtime_unittest</a><br>
 <a href="telemetry.core.chrome.inspector_timeline.html">inspector_timeline</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.chrome.inspector_timeline_unittest.html">inspector_timeline_unittest</a><br>
-<a href="telemetry.core.chrome.misc_web_contents_backend.html">misc_web_contents_backend</a><br>
+<a href="telemetry.core.chrome.inspector_timeline_unittest.html">inspector_timeline_unittest</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.chrome.misc_web_contents_backend.html">misc_web_contents_backend</a><br>
 <a href="telemetry.core.chrome.png_bitmap.html">png_bitmap</a><br>
 <a href="telemetry.core.chrome.png_bitmap_unittest.html">png_bitmap_unittest</a><br>
 <a href="telemetry.core.chrome.tab_list_backend.html">tab_list_backend</a><br>
diff --git a/tools/telemetry/docs/telemetry.core.chrome.tab_list_backend.html b/tools/telemetry/docs/telemetry.core.chrome.tab_list_backend.html
index 6e1ebcb..67df8f2 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.tab_list_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.tab_list_backend.html
@@ -55,7 +55,7 @@
 
 <dl><dt><a name="TabListBackend-CloseTab"><strong>CloseTab</strong></a>(self, debugger_url, timeout<font color="#909090">=None</font>)</dt></dl>
 
-<dl><dt><a name="TabListBackend-DoesDebuggerUrlExist"><strong>DoesDebuggerUrlExist</strong></a>(self, url)</dt></dl>
+<dl><dt><a name="TabListBackend-DoesDebuggerUrlExist"><strong>DoesDebuggerUrlExist</strong></a>(self, debugger_url)</dt></dl>
 
 <dl><dt><a name="TabListBackend-Get"><strong>Get</strong></a>(self, index, ret)</dt><dd><tt>Returns&nbsp;self[index]&nbsp;if&nbsp;it&nbsp;exists,&nbsp;or&nbsp;ret&nbsp;if&nbsp;index&nbsp;is&nbsp;out&nbsp;of&nbsp;bounds.</tt></dd></dl>
 
diff --git a/tools/telemetry/docs/telemetry.core.chrome.tracing_backend.html b/tools/telemetry/docs/telemetry.core.chrome.tracing_backend.html
index 9328777..e1e7a7f 100644
--- a/tools/telemetry/docs/telemetry.core.chrome.tracing_backend.html
+++ b/tools/telemetry/docs/telemetry.core.chrome.tracing_backend.html
@@ -80,7 +80,7 @@
     
 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%">Methods defined here:<br>
-<dl><dt><a name="TracingBackend-BeginTracing"><strong>BeginTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="TracingBackend-BeginTracing"><strong>BeginTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=10</font>)</dt></dl>
 
 <dl><dt><a name="TracingBackend-Close"><strong>Close</strong></a>(self)</dt></dl>
 
diff --git a/tools/telemetry/docs/telemetry.core.memory_cache_http_server.html b/tools/telemetry/docs/telemetry.core.memory_cache_http_server.html
index c4991c4..de53df5 100644
--- a/tools/telemetry/docs/telemetry.core.memory_cache_http_server.html
+++ b/tools/telemetry/docs/telemetry.core.memory_cache_http_server.html
@@ -22,10 +22,11 @@
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="BaseHTTPServer.html">BaseHTTPServer</a><br>
 <a href="SimpleHTTPServer.html">SimpleHTTPServer</a><br>
 </td><td width="25%" valign=top><a href="SocketServer.html">SocketServer</a><br>
+<a href="StringIO.html">StringIO</a><br>
+</td><td width="25%" valign=top><a href="gzip.html">gzip</a><br>
 <a href="mimetypes.html">mimetypes</a><br>
 </td><td width="25%" valign=top><a href="os.html">os</a><br>
 <a href="sys.html">sys</a><br>
-</td><td width="25%" valign=top><a href="zlib.html">zlib</a><br>
 </td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -94,9 +95,6 @@
 
 <hr>
 Data descriptors defined here:<br>
-<dl><dt><strong>__dict__</strong></dt>
-<dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd>
-</dl>
 <dl><dt><strong>from_byte</strong></dt>
 <dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;0</tt></dd>
 </dl>
@@ -233,7 +231,7 @@
 
 <hr>
 Data and other attributes inherited from <a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a>:<br>
-<dl><dt><strong>extensions_map</strong> = {'': 'application/octet-stream', '.%': 'application/x-trash', '.323': 'text/h323', '.3gp': 'video/3gpp', '.7z': 'application/x-7z-compressed', '.a': 'application/octet-stream', '.abw': 'application/x-abiword', '.ai': 'application/postscript', '.aif': 'audio/x-aiff', '.aifc': 'audio/x-aiff', ...}</dl>
+<dl><dt><strong>extensions_map</strong> = {'': 'application/octet-stream', '.123': 'application/vnd.lotus-1-2-3', '.3dml': 'text/vnd.in3d.3dml', '.3g2': 'video/3gpp2', '.3gp': 'video/3gpp', '.7z': 'application/x-7z-compressed', '.a': 'application/octet-stream', '.aab': 'application/x-authorware-bin', '.aac': 'audio/x-aac', '.aam': 'application/x-authorware-map', ...}</dl>
 
 <dl><dt><strong>server_version</strong> = 'SimpleHTTP/0.6'</dl>
 
@@ -329,7 +327,7 @@
 
 <dl><dt><strong>responses</strong> = {100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), ...}</dl>
 
-<dl><dt><strong>sys_version</strong> = 'Python/2.7.3'</dl>
+<dl><dt><strong>sys_version</strong> = 'Python/2.7.2'</dl>
 
 <dl><dt><strong>weekdayname</strong> = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']</dl>
 
@@ -497,9 +495,6 @@
 
 <hr>
 Data descriptors defined here:<br>
-<dl><dt><strong>__dict__</strong></dt>
-<dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd>
-</dl>
 <dl><dt><strong>byte_range</strong></dt>
 <dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;1</tt></dd>
 </dl>
diff --git a/tools/telemetry/docs/telemetry.core.platform.profiler.html b/tools/telemetry/docs/telemetry.core.platform.profiler.html
index 0c4aee3..706c5e0 100644
--- a/tools/telemetry/docs/telemetry.core.platform.profiler.html
+++ b/tools/telemetry/docs/telemetry.core.platform.profiler.html
@@ -25,7 +25,8 @@
 <a href="telemetry.core.platform.profiler.profiler_finder.html">profiler_finder</a><br>
 </td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.sample_profiler.html">sample_profiler</a><br>
 <a href="telemetry.core.platform.profiler.tcmalloc_heap_profiler.html">tcmalloc_heap_profiler</a><br>
-</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
+</td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.trace_profiler.html">trace_profiler</a><br>
+</td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
 <td colspan=3 valign=bottom>&nbsp;<br>
diff --git a/tools/telemetry/docs/telemetry.core.platform.profiler.profiler_finder.html b/tools/telemetry/docs/telemetry.core.platform.profiler.profiler_finder.html
index 38a7f20..f1c64cb 100644
--- a/tools/telemetry/docs/telemetry.core.platform.profiler.profiler_finder.html
+++ b/tools/telemetry/docs/telemetry.core.platform.profiler.profiler_finder.html
@@ -24,6 +24,7 @@
 </td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.perf_profiler.html">telemetry.core.platform.profiler.perf_profiler</a><br>
 <a href="telemetry.core.platform.profiler.sample_profiler.html">telemetry.core.platform.profiler.sample_profiler</a><br>
 </td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.tcmalloc_heap_profiler.html">telemetry.core.platform.profiler.tcmalloc_heap_profiler</a><br>
+<a href="telemetry.core.platform.profiler.trace_profiler.html">telemetry.core.platform.profiler.trace_profiler</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#eeaa77">
diff --git a/tools/telemetry/docs/telemetry.core.platform.profiler.trace_profiler.html b/tools/telemetry/docs/telemetry.core.platform.profiler.trace_profiler.html
new file mode 100644
index 0000000..e76e114
--- /dev/null
+++ b/tools/telemetry/docs/telemetry.core.platform.profiler.trace_profiler.html
@@ -0,0 +1,72 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Python: module telemetry.core.platform.profiler.trace_profiler</title>
+</head><body bgcolor="#f0f0f8">
+
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
+<tr bgcolor="#7799ee">
+<td valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.platform.html"><font color="#ffffff">platform</font></a>.<a href="telemetry.core.platform.profiler.html"><font color="#ffffff">profiler</font></a>.trace_profiler</strong></big></big></font></td
+><td align=right valign=bottom
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/platform/profiler/trace_profiler.py">telemetry/core/platform/profiler/trace_profiler.py</a></font></td></tr></table>
+    <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
+#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
+#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
+<p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#aa55cc">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="codecs.html">codecs</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.platform.profiler.html">telemetry.core.platform.profiler</a><br>
+</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ee77aa">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl>
+<dt><font face="helvetica, arial"><a href="telemetry.core.platform.profiler.html#Profiler">telemetry.core.platform.profiler.Profiler</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
+</font></dt><dd>
+<dl>
+<dt><font face="helvetica, arial"><a href="telemetry.core.platform.profiler.trace_profiler.html#TraceProfiler">TraceProfiler</a>
+</font></dt></dl>
+</dd>
+</dl>
+ <p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ffc8d8">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#000000" face="helvetica, arial"><a name="TraceProfiler">class <strong>TraceProfiler</strong></a>(<a href="telemetry.core.platform.profiler.html#Profiler">telemetry.core.platform.profiler.Profiler</a>)</font></td></tr>
+    
+<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl><dt>Method resolution order:</dt>
+<dd><a href="telemetry.core.platform.profiler.trace_profiler.html#TraceProfiler">TraceProfiler</a></dd>
+<dd><a href="telemetry.core.platform.profiler.html#Profiler">telemetry.core.platform.profiler.Profiler</a></dd>
+<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
+</dl>
+<hr>
+Methods defined here:<br>
+<dl><dt><a name="TraceProfiler-CollectProfile"><strong>CollectProfile</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="TraceProfiler-__init__"><strong>__init__</strong></a>(self, browser_backend, platform_backend, output_path)</dt></dl>
+
+<hr>
+Class methods defined here:<br>
+<dl><dt><a name="TraceProfiler-is_supported"><strong>is_supported</strong></a>(cls, options)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt></dl>
+
+<dl><dt><a name="TraceProfiler-name"><strong>name</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt></dl>
+
+<hr>
+Data descriptors inherited from <a href="telemetry.core.platform.profiler.html#Profiler">telemetry.core.platform.profiler.Profiler</a>:<br>
+<dl><dt><strong>__dict__</strong></dt>
+<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+<dl><dt><strong>__weakref__</strong></dt>
+<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+</td></tr></table></td></tr></table>
+</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.async_slice.html b/tools/telemetry/docs/telemetry.core.timeline.async_slice.html
similarity index 62%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.async_slice.html
rename to tools/telemetry/docs/telemetry.core.timeline.async_slice.html
index 548ef05..ab97bb0 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.async_slice.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.async_slice.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.async_slice</title>
+<html><head><title>Python: module telemetry.core.timeline.async_slice</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.async_slice</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.async_slice</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/async_slice.py">telemetry/core/timeline/tracing/async_slice.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/async_slice.py">telemetry/core/timeline/async_slice.py</a></font></td></tr></table>
     <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
@@ -19,7 +19,7 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.slice.html">telemetry.core.timeline.tracing.slice</a><br>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event.html">telemetry.core.timeline.event</a><br>
 </td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -28,10 +28,10 @@
     
 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.slice.html#Slice">telemetry.core.timeline.tracing.slice.Slice</a>(<a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>)
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.async_slice.html#AsyncSlice">AsyncSlice</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.async_slice.html#AsyncSlice">AsyncSlice</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -39,7 +39,7 @@
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ffc8d8">
 <td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="AsyncSlice">class <strong>AsyncSlice</strong></a>(<a href="telemetry.core.timeline.tracing.slice.html#Slice">telemetry.core.timeline.tracing.slice.Slice</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="AsyncSlice">class <strong>AsyncSlice</strong></a>(<a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>)</font></td></tr>
     
 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
 <td colspan=2><tt>A&nbsp;<a href="#AsyncSlice">AsyncSlice</a>&nbsp;represents&nbsp;an&nbsp;interval&nbsp;of&nbsp;time&nbsp;during&nbsp;which&nbsp;an<br>
@@ -47,8 +47,7 @@
 itself&nbsp;and&nbsp;so&nbsp;is&nbsp;only&nbsp;associated&nbsp;with&nbsp;Threads&nbsp;at&nbsp;its&nbsp;start&nbsp;and&nbsp;end&nbsp;point.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.async_slice.html#AsyncSlice">AsyncSlice</a></dd>
-<dd><a href="telemetry.core.timeline.tracing.slice.html#Slice">telemetry.core.timeline.tracing.slice.Slice</a></dd>
+<dd><a href="telemetry.core.timeline.async_slice.html#AsyncSlice">AsyncSlice</a></dd>
 <dd><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
@@ -56,27 +55,12 @@
 Methods defined here:<br>
 <dl><dt><a name="AsyncSlice-AddSubSlice"><strong>AddSubSlice</strong></a>(self, sub_slice)</dt></dl>
 
+<dl><dt><a name="AsyncSlice-IterEventsInThisContainerRecrusively"><strong>IterEventsInThisContainerRecrusively</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="AsyncSlice-__init__"><strong>__init__</strong></a>(self, category, name, timestamp, args<font color="#909090">=None</font>, parent<font color="#909090">=None</font>)</dt></dl>
 
 <hr>
-Methods inherited from <a href="telemetry.core.timeline.tracing.slice.html#Slice">telemetry.core.timeline.tracing.slice.Slice</a>:<br>
-<dl><dt><a name="AsyncSlice-GetAllSubSlices"><strong>GetAllSubSlices</strong></a>(self)</dt></dl>
-
-<hr>
-Data descriptors inherited from <a href="telemetry.core.timeline.tracing.slice.html#Slice">telemetry.core.timeline.tracing.slice.Slice</a>:<br>
-<dl><dt><strong>sub_slices</strong></dt>
-</dl>
-<hr>
 Methods inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
-<dl><dt><a name="AsyncSlice-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="AsyncSlice-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="AsyncSlice-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt><dd><tt>Updates&nbsp;the&nbsp;start&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;minimum&nbsp;start&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events&nbsp;and&nbsp;the&nbsp;end&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;maximum&nbsp;end&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events.</tt></dd></dl>
-
 <dl><dt><a name="AsyncSlice-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
 
 <hr>
@@ -89,8 +73,5 @@
 </dl>
 <dl><dt><strong>end</strong></dt>
 </dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html b/tools/telemetry/docs/telemetry.core.timeline.bounds.html
similarity index 60%
copy from tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html
copy to tools/telemetry/docs/telemetry.core.timeline.bounds.html
index c4bbf1a..acfa427 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.bounds.html
@@ -1,15 +1,15 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.counter</title>
+<html><head><title>Python: module telemetry.core.timeline.bounds</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.counter</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.bounds</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/counter.py">telemetry/core/timeline/tracing/counter.py</a></font></td></tr></table>
-    <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/bounds.py">telemetry/core/timeline/bounds.py</a></font></td></tr></table>
+    <p><tt>#&nbsp;Copyright&nbsp;(c)&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
 <p>
@@ -23,7 +23,7 @@
 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.counter.html#Counter">Counter</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.bounds.html#Bounds">Bounds</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -31,15 +31,23 @@
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ffc8d8">
 <td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="Counter">class <strong>Counter</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="Bounds">class <strong>Bounds</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
     
 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
-<td colspan=2><tt>Stores&nbsp;all&nbsp;the&nbsp;samples&nbsp;for&nbsp;a&nbsp;given&nbsp;counter.<br>&nbsp;</tt></td></tr>
+<td colspan=2><tt>Represents&nbsp;a&nbsp;min-max&nbsp;bounds.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%">Methods defined here:<br>
-<dl><dt><a name="Counter-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt></dl>
+<dl><dt><a name="Bounds-AddBounds"><strong>AddBounds</strong></a>(self, bounds)</dt></dl>
 
-<dl><dt><a name="Counter-__init__"><strong>__init__</strong></a>(self, parent, category, name)</dt></dl>
+<dl><dt><a name="Bounds-AddValue"><strong>AddValue</strong></a>(self, value)</dt></dl>
+
+<dl><dt><a name="Bounds-Reset"><strong>Reset</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Bounds-__init__"><strong>__init__</strong></a>(self)</dt></dl>
+
+<hr>
+Static methods defined here:<br>
+<dl><dt><a name="Bounds-CompareByMinTimes"><strong>CompareByMinTimes</strong></a>(a, b)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
@@ -49,13 +57,15 @@
 <dl><dt><strong>__weakref__</strong></dt>
 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
-<dl><dt><strong>max_timestamp</strong></dt>
+<dl><dt><strong>bounds</strong></dt>
 </dl>
-<dl><dt><strong>min_timestamp</strong></dt>
+<dl><dt><strong>center</strong></dt>
 </dl>
-<dl><dt><strong>num_samples</strong></dt>
+<dl><dt><strong>is_empty</strong></dt>
 </dl>
-<dl><dt><strong>num_series</strong></dt>
+<dl><dt><strong>max</strong></dt>
+</dl>
+<dl><dt><strong>min</strong></dt>
 </dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.counter.html b/tools/telemetry/docs/telemetry.core.timeline.counter.html
new file mode 100644
index 0000000..a1d19ac
--- /dev/null
+++ b/tools/telemetry/docs/telemetry.core.timeline.counter.html
@@ -0,0 +1,113 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Python: module telemetry.core.timeline.counter</title>
+</head><body bgcolor="#f0f0f8">
+
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
+<tr bgcolor="#7799ee">
+<td valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.counter</strong></big></big></font></td
+><td align=right valign=bottom
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/counter.py">telemetry/core/timeline/counter.py</a></font></td></tr></table>
+    <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
+#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
+#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
+<p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#aa55cc">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event_container.html">telemetry.core.timeline.event_container</a><br>
+</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ee77aa">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl>
+<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
+</font></dt><dd>
+<dl>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.counter.html#CounterSample">CounterSample</a>
+</font></dt></dl>
+</dd>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
+</font></dt><dd>
+<dl>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.counter.html#Counter">Counter</a>
+</font></dt></dl>
+</dd>
+</dl>
+ <p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ffc8d8">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#000000" face="helvetica, arial"><a name="Counter">class <strong>Counter</strong></a>(<a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>)</font></td></tr>
+    
+<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
+<td colspan=2><tt>Stores&nbsp;all&nbsp;the&nbsp;samples&nbsp;for&nbsp;a&nbsp;given&nbsp;counter.<br>&nbsp;</tt></td></tr>
+<tr><td>&nbsp;</td>
+<td width="100%"><dl><dt>Method resolution order:</dt>
+<dd><a href="telemetry.core.timeline.counter.html#Counter">Counter</a></dd>
+<dd><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a></dd>
+<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
+</dl>
+<hr>
+Methods defined here:<br>
+<dl><dt><a name="Counter-FinalizeImport"><strong>FinalizeImport</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Counter-IterChildContainers"><strong>IterChildContainers</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Counter-IterEventsInThisContainer"><strong>IterEventsInThisContainer</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Counter-__init__"><strong>__init__</strong></a>(self, parent, category, name)</dt></dl>
+
+<hr>
+Data descriptors defined here:<br>
+<dl><dt><strong>num_samples</strong></dt>
+</dl>
+<dl><dt><strong>num_series</strong></dt>
+</dl>
+<hr>
+Data descriptors inherited from <a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>:<br>
+<dl><dt><strong>__dict__</strong></dt>
+<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+<dl><dt><strong>__weakref__</strong></dt>
+<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+</td></tr></table> <p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ffc8d8">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#000000" face="helvetica, arial"><a name="CounterSample">class <strong>CounterSample</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
+    
+<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
+<td colspan=2><tt>#&nbsp;Doesnt'&nbsp;inherit&nbsp;from&nbsp;TimelineEvent&nbsp;because&nbsp;its&nbsp;only&nbsp;a&nbsp;temporary&nbsp;wrapper&nbsp;of&nbsp;a<br>
+#&nbsp;counter&nbsp;sample&nbsp;into&nbsp;an&nbsp;event.&nbsp;During&nbsp;stable&nbsp;operation,&nbsp;the&nbsp;samples&nbsp;are&nbsp;stored<br>
+#&nbsp;a&nbsp;dense&nbsp;array&nbsp;of&nbsp;values&nbsp;rather&nbsp;than&nbsp;in&nbsp;the&nbsp;long-form&nbsp;done&nbsp;by&nbsp;an&nbsp;Event.<br>&nbsp;</tt></td></tr>
+<tr><td>&nbsp;</td>
+<td width="100%">Methods defined here:<br>
+<dl><dt><a name="CounterSample-__init__"><strong>__init__</strong></a>(self, counter, sample_index)</dt></dl>
+
+<hr>
+Data descriptors defined here:<br>
+<dl><dt><strong>__dict__</strong></dt>
+<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+<dl><dt><strong>__weakref__</strong></dt>
+<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+<dl><dt><strong>duration</strong></dt>
+</dl>
+<dl><dt><strong>end</strong></dt>
+</dl>
+<dl><dt><strong>name</strong></dt>
+</dl>
+<dl><dt><strong>start</strong></dt>
+</dl>
+</td></tr></table></td></tr></table>
+</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.event.html b/tools/telemetry/docs/telemetry.core.timeline.event.html
index f872d98..c5a35d6 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.event.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.event.html
@@ -37,16 +37,7 @@
 <td colspan=2><tt>Represents&nbsp;a&nbsp;timeline&nbsp;event.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%">Methods defined here:<br>
-<dl><dt><a name="TimelineEvent-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="TimelineEvent-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="TimelineEvent-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt><dd><tt>Updates&nbsp;the&nbsp;start&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;minimum&nbsp;start&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events&nbsp;and&nbsp;the&nbsp;end&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;maximum&nbsp;end&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="TimelineEvent-__init__"><strong>__init__</strong></a>(self, name, start, duration, args<font color="#909090">=None</font>, parent<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="TimelineEvent-__init__"><strong>__init__</strong></a>(self, category, name, start, duration, args<font color="#909090">=None</font>, parent<font color="#909090">=None</font>)</dt></dl>
 
 <dl><dt><a name="TimelineEvent-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
 
@@ -60,8 +51,5 @@
 </dl>
 <dl><dt><strong>end</strong></dt>
 </dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html b/tools/telemetry/docs/telemetry.core.timeline.event_container.html
similarity index 62%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html
rename to tools/telemetry/docs/telemetry.core.timeline.event_container.html
index c4bbf1a..a22803f 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.counter.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.event_container.html
@@ -1,15 +1,15 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.counter</title>
+<html><head><title>Python: module telemetry.core.timeline.event_container</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.counter</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.event_container</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/counter.py">telemetry/core/timeline/tracing/counter.py</a></font></td></tr></table>
-    <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/event_container.py">telemetry/core/timeline/event_container.py</a></font></td></tr></table>
+    <p><tt>#&nbsp;Copyright&nbsp;(c)&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
 <p>
@@ -23,7 +23,7 @@
 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.counter.html#Counter">Counter</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">TimelineEventContainer</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -31,15 +31,17 @@
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ffc8d8">
 <td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="Counter">class <strong>Counter</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="TimelineEventContainer">class <strong>TimelineEventContainer</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
     
 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
-<td colspan=2><tt>Stores&nbsp;all&nbsp;the&nbsp;samples&nbsp;for&nbsp;a&nbsp;given&nbsp;counter.<br>&nbsp;</tt></td></tr>
+<td colspan=2><tt>Represents&nbsp;a&nbsp;container&nbsp;for&nbsp;events.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%">Methods defined here:<br>
-<dl><dt><a name="Counter-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt></dl>
+<dl><dt><a name="TimelineEventContainer-IterChildContainers"><strong>IterChildContainers</strong></a>(self)</dt></dl>
 
-<dl><dt><a name="Counter-__init__"><strong>__init__</strong></a>(self, parent, category, name)</dt></dl>
+<dl><dt><a name="TimelineEventContainer-IterEventsInThisContainer"><strong>IterEventsInThisContainer</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="TimelineEventContainer-__init__"><strong>__init__</strong></a>(self, name, parent)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
@@ -49,13 +51,5 @@
 <dl><dt><strong>__weakref__</strong></dt>
 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
-<dl><dt><strong>max_timestamp</strong></dt>
-</dl>
-<dl><dt><strong>min_timestamp</strong></dt>
-</dl>
-<dl><dt><strong>num_samples</strong></dt>
-</dl>
-<dl><dt><strong>num_series</strong></dt>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.html b/tools/telemetry/docs/telemetry.core.timeline.html
index 70e203c..fa5ba53 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.html
@@ -17,13 +17,23 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event.html">event</a><br>
-<a href="telemetry.core.timeline.event_unittest.html">event_unittest</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.importer.html">importer</a><br>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.async_slice.html">async_slice</a><br>
+<a href="telemetry.core.timeline.bounds.html">bounds</a><br>
+<a href="telemetry.core.timeline.counter.html">counter</a><br>
+<a href="telemetry.core.timeline.event.html">event</a><br>
+<a href="telemetry.core.timeline.event_container.html">event_container</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.event_unittest.html">event_unittest</a><br>
+<a href="telemetry.core.timeline.importer.html">importer</a><br>
 <a href="telemetry.core.timeline.inspector_importer.html">inspector_importer</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.inspector_importer_unittest.html">inspector_importer_unittest</a><br>
+<a href="telemetry.core.timeline.inspector_importer_unittest.html">inspector_importer_unittest</a><br>
 <a href="telemetry.core.timeline.model.html">model</a><br>
 </td><td width="25%" valign=top><a href="telemetry.core.timeline.model_unittest.html">model_unittest</a><br>
-<a href="telemetry.core.timeline.tracing.html"><strong>tracing</strong>&nbsp;(package)</a><br>
+<a href="telemetry.core.timeline.process.html">process</a><br>
+<a href="telemetry.core.timeline.sample.html">sample</a><br>
+<a href="telemetry.core.timeline.slice.html">slice</a><br>
+<a href="telemetry.core.timeline.slice_unittest.html">slice_unittest</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.thread.html">thread</a><br>
+<a href="telemetry.core.timeline.trace_event_importer.html">trace_event_importer</a><br>
+<a href="telemetry.core.timeline.trace_event_importer_unittest.html">trace_event_importer_unittest</a><br>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.inspector_importer.html b/tools/telemetry/docs/telemetry.core.timeline.inspector_importer.html
index f8d78fe..8785ec1 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.inspector_importer.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.inspector_importer.html
@@ -18,7 +18,7 @@
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.importer.html">telemetry.core.timeline.importer</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.event.html">telemetry.core.timeline.event</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.thread.html">telemetry.core.timeline.thread</a><br>
 </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -56,6 +56,8 @@
 
 <hr>
 Static methods defined here:<br>
+<dl><dt><a name="InspectorTimelineImporter-AddRawEventToThreadRecursive"><strong>AddRawEventToThreadRecursive</strong></a>(thread, raw_inspector_event)</dt></dl>
+
 <dl><dt><a name="InspectorTimelineImporter-CanImport"><strong>CanImport</strong></a>(event_data)</dt><dd><tt>Checks&nbsp;if&nbsp;event_data&nbsp;is&nbsp;from&nbsp;the&nbsp;inspector&nbsp;timeline.&nbsp;We&nbsp;assume<br>
 that&nbsp;if&nbsp;the&nbsp;first&nbsp;event&nbsp;is&nbsp;a&nbsp;valid&nbsp;inspector&nbsp;event,&nbsp;we&nbsp;can&nbsp;import&nbsp;the<br>
 entire&nbsp;list.</tt></dd></dl>
diff --git a/tools/telemetry/docs/telemetry.core.timeline.model.html b/tools/telemetry/docs/telemetry.core.timeline.model.html
index 34112f7..f9bf748 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.model.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.model.html
@@ -20,9 +20,11 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.inspector_importer.html">telemetry.core.timeline.inspector_importer</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.trace_event_importer.html">telemetry.core.timeline.tracing.trace_event_importer</a><br>
-</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.bounds.html">telemetry.core.timeline.bounds</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.inspector_importer.html">telemetry.core.timeline.inspector_importer</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.trace_event_importer.html">telemetry.core.timeline.trace_event_importer</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.process.html">telemetry.core.timeline.process</a><br>
+</td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
 <td colspan=3 valign=bottom>&nbsp;<br>
@@ -45,18 +47,22 @@
     
 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%">Methods defined here:<br>
-<dl><dt><a name="TimelineModel-AddEvent"><strong>AddEvent</strong></a>(self, event)</dt></dl>
-
-<dl><dt><a name="TimelineModel-DidFinishRecording"><strong>DidFinishRecording</strong></a>(self)</dt></dl>
+<dl><dt><a name="TimelineModel-GetAllContainers"><strong>GetAllContainers</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="TimelineModel-GetAllEvents"><strong>GetAllEvents</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="TimelineModel-GetAllEventsOfName"><strong>GetAllEventsOfName</strong></a>(self, name)</dt></dl>
 
-<dl><dt><a name="TimelineModel-GetRootEvents"><strong>GetRootEvents</strong></a>(self)</dt></dl>
+<dl><dt><a name="TimelineModel-GetAllProcesses"><strong>GetAllProcesses</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="TimelineModel-GetAllThreads"><strong>GetAllThreads</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="TimelineModel-GetOrCreateProcess"><strong>GetOrCreateProcess</strong></a>(self, pid)</dt></dl>
 
 <dl><dt><a name="TimelineModel-ImportTraces"><strong>ImportTraces</strong></a>(self, traces, shift_world_to_zero<font color="#909090">=True</font>)</dt></dl>
 
+<dl><dt><a name="TimelineModel-IterAllEvents"><strong>IterAllEvents</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="TimelineModel-ShiftWorldToZero"><strong>ShiftWorldToZero</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="TimelineModel-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt></dl>
@@ -71,9 +77,9 @@
 <dl><dt><strong>__weakref__</strong></dt>
 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
-<dl><dt><strong>max_timestamp</strong></dt>
+<dl><dt><strong>bounds</strong></dt>
 </dl>
-<dl><dt><strong>min_timestamp</strong></dt>
+<dl><dt><strong>processes</strong></dt>
 </dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.process.html b/tools/telemetry/docs/telemetry.core.timeline.process.html
similarity index 62%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.process.html
rename to tools/telemetry/docs/telemetry.core.timeline.process.html
index 7cabb81..e834fd0 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.process.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.process.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.process</title>
+<html><head><title>Python: module telemetry.core.timeline.process</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.process</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.process</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/process.py">telemetry/core/timeline/tracing/process.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/process.py">telemetry/core/timeline/process.py</a></font></td></tr></table>
     <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
@@ -19,9 +19,9 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event.html">telemetry.core.timeline.event</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.counter.html">telemetry.core.timeline.tracing.counter</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.thread.html">telemetry.core.timeline.tracing.thread</a><br>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event_container.html">telemetry.core.timeline.event_container</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.counter.html">telemetry.core.timeline.counter</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.thread.html">telemetry.core.timeline.thread</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -30,10 +30,10 @@
     
 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.process.html#Process">Process</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.process.html#Process">Process</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -41,18 +41,20 @@
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ffc8d8">
 <td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="Process">class <strong>Process</strong></a>(<a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="Process">class <strong>Process</strong></a>(<a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>)</font></td></tr>
     
 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
 <td colspan=2><tt>The&nbsp;<a href="#Process">Process</a>&nbsp;represents&nbsp;a&nbsp;single&nbsp;userland&nbsp;process&nbsp;in&nbsp;the&nbsp;trace.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.process.html#Process">Process</a></dd>
-<dd><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a></dd>
+<dd><a href="telemetry.core.timeline.process.html#Process">Process</a></dd>
+<dd><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
 <hr>
 Methods defined here:<br>
+<dl><dt><a name="Process-AutoCloseOpenSlices"><strong>AutoCloseOpenSlices</strong></a>(self, max_timestamp)</dt></dl>
+
 <dl><dt><a name="Process-FinalizeImport"><strong>FinalizeImport</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="Process-GetCounter"><strong>GetCounter</strong></a>(self, category, name)</dt></dl>
@@ -61,11 +63,11 @@
 
 <dl><dt><a name="Process-GetOrCreateThread"><strong>GetOrCreateThread</strong></a>(self, tid)</dt></dl>
 
-<dl><dt><a name="Process-GetThreadWithId"><strong>GetThreadWithId</strong></a>(self, tid)</dt></dl>
+<dl><dt><a name="Process-IterChildContainers"><strong>IterChildContainers</strong></a>(self)</dt></dl>
 
-<dl><dt><a name="Process-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt></dl>
+<dl><dt><a name="Process-IterEventsInThisContainer"><strong>IterEventsInThisContainer</strong></a>(self)</dt></dl>
 
-<dl><dt><a name="Process-__init__"><strong>__init__</strong></a>(self, pid)</dt></dl>
+<dl><dt><a name="Process-__init__"><strong>__init__</strong></a>(self, parent, pid)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
@@ -74,26 +76,12 @@
 <dl><dt><strong>threads</strong></dt>
 </dl>
 <hr>
-Methods inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
-<dl><dt><a name="Process-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="Process-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="Process-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
-
-<hr>
-Data descriptors inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
+Data descriptors inherited from <a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>:<br>
 <dl><dt><strong>__dict__</strong></dt>
 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
 <dl><dt><strong>__weakref__</strong></dt>
 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
-<dl><dt><strong>end</strong></dt>
-</dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.sample.html b/tools/telemetry/docs/telemetry.core.timeline.sample.html
similarity index 74%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.sample.html
rename to tools/telemetry/docs/telemetry.core.timeline.sample.html
index f48d15b..82e93fd 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.sample.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.sample.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.sample</title>
+<html><head><title>Python: module telemetry.core.timeline.sample</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.sample</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.sample</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/sample.py">telemetry/core/timeline/tracing/sample.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/sample.py">telemetry/core/timeline/sample.py</a></font></td></tr></table>
     <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
@@ -31,7 +31,7 @@
 <dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.sample.html#Sample">Sample</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.sample.html#Sample">Sample</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -51,7 +51,7 @@
 All&nbsp;time&nbsp;units&nbsp;are&nbsp;stored&nbsp;in&nbsp;milliseconds.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.sample.html#Sample">Sample</a></dd>
+<dd><a href="telemetry.core.timeline.sample.html#Sample">Sample</a></dd>
 <dd><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
@@ -61,15 +61,6 @@
 
 <hr>
 Methods inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
-<dl><dt><a name="Sample-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="Sample-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="Sample-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt><dd><tt>Updates&nbsp;the&nbsp;start&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;minimum&nbsp;start&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events&nbsp;and&nbsp;the&nbsp;end&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;maximum&nbsp;end&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events.</tt></dd></dl>
-
 <dl><dt><a name="Sample-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
 
 <hr>
@@ -82,8 +73,5 @@
 </dl>
 <dl><dt><strong>end</strong></dt>
 </dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.slice.html b/tools/telemetry/docs/telemetry.core.timeline.slice.html
similarity index 76%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.slice.html
rename to tools/telemetry/docs/telemetry.core.timeline.slice.html
index 2e91824..9239b5d 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.slice.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.slice.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.slice</title>
+<html><head><title>Python: module telemetry.core.timeline.slice</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.slice</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.slice</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/slice.py">telemetry/core/timeline/tracing/slice.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/slice.py">telemetry/core/timeline/slice.py</a></font></td></tr></table>
     <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
@@ -31,7 +31,7 @@
 <dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.slice.html#Slice">Slice</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.slice.html#Slice">Slice</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -51,7 +51,7 @@
 All&nbsp;time&nbsp;units&nbsp;are&nbsp;stored&nbsp;in&nbsp;milliseconds.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.slice.html#Slice">Slice</a></dd>
+<dd><a href="telemetry.core.timeline.slice.html#Slice">Slice</a></dd>
 <dd><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
@@ -61,23 +61,19 @@
 
 <dl><dt><a name="Slice-GetAllSubSlices"><strong>GetAllSubSlices</strong></a>(self)</dt></dl>
 
-<dl><dt><a name="Slice-__init__"><strong>__init__</strong></a>(self, category, name, timestamp, args<font color="#909090">=None</font>, parent<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="Slice-GetAllSubSlicesOfName"><strong>GetAllSubSlicesOfName</strong></a>(self, name)</dt></dl>
+
+<dl><dt><a name="Slice-IterEventsInThisContainerRecrusively"><strong>IterEventsInThisContainerRecrusively</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Slice-__init__"><strong>__init__</strong></a>(self, category, name, timestamp, args<font color="#909090">=None</font>, parent<font color="#909090">=None</font>, duration<font color="#909090">=0</font>)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
-<dl><dt><strong>sub_slices</strong></dt>
+<dl><dt><strong>self_time</strong></dt>
+<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
 </dl>
 <hr>
 Methods inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
-<dl><dt><a name="Slice-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="Slice-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="Slice-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt><dd><tt>Updates&nbsp;the&nbsp;start&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;minimum&nbsp;start&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events&nbsp;and&nbsp;the&nbsp;end&nbsp;time&nbsp;to&nbsp;be&nbsp;the&nbsp;maximum&nbsp;end&nbsp;time&nbsp;of&nbsp;all<br>
-child&nbsp;events.</tt></dd></dl>
-
 <dl><dt><a name="Slice-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
 
 <hr>
@@ -90,8 +86,5 @@
 </dl>
 <dl><dt><strong>end</strong></dt>
 </dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.thread.html b/tools/telemetry/docs/telemetry.core.timeline.thread.html
similarity index 71%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.thread.html
rename to tools/telemetry/docs/telemetry.core.timeline.thread.html
index 8fe688d..081f2ee 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.thread.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.thread.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.thread</title>
+<html><head><title>Python: module telemetry.core.timeline.thread</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.thread</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.thread</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/thread.py">telemetry/core/timeline/tracing/thread.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/thread.py">telemetry/core/timeline/thread.py</a></font></td></tr></table>
     <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
@@ -19,9 +19,9 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event.html">telemetry.core.timeline.event</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.sample.html">telemetry.core.timeline.tracing.sample</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.slice.html">telemetry.core.timeline.tracing.slice</a><br>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.event_container.html">telemetry.core.timeline.event_container</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.sample.html">telemetry.core.timeline.sample</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.slice.html">telemetry.core.timeline.slice</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -30,10 +30,10 @@
     
 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.thread.html#Thread">Thread</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.thread.html#Thread">Thread</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -41,7 +41,7 @@
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ffc8d8">
 <td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#000000" face="helvetica, arial"><a name="Thread">class <strong>Thread</strong></a>(<a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="Thread">class <strong>Thread</strong></a>(<a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>)</font></td></tr>
     
 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
 <td colspan=2><tt>A&nbsp;<a href="#Thread">Thread</a>&nbsp;stores&nbsp;all&nbsp;the&nbsp;trace&nbsp;events&nbsp;collected&nbsp;for&nbsp;a&nbsp;particular<br>
@@ -50,8 +50,8 @@
 The&nbsp;asynchronous&nbsp;slices&nbsp;are&nbsp;stored&nbsp;in&nbsp;an&nbsp;AsyncSliceGroup&nbsp;object.<br>&nbsp;</tt></td></tr>
 <tr><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.thread.html#Thread">Thread</a></dd>
-<dd><a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a></dd>
+<dd><a href="telemetry.core.timeline.thread.html#Thread">Thread</a></dd>
+<dd><a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
 <hr>
@@ -60,7 +60,7 @@
 
 <dl><dt><a name="Thread-AddSample"><strong>AddSample</strong></a>(self, category, name, timestamp, args<font color="#909090">=None</font>)</dt></dl>
 
-<dl><dt><a name="Thread-AutoCloseOpenSlices"><strong>AutoCloseOpenSlices</strong></a>(self, max_timestamp<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="Thread-AutoCloseOpenSlices"><strong>AutoCloseOpenSlices</strong></a>(self, max_timestamp)</dt></dl>
 
 <dl><dt><a name="Thread-BeginSlice"><strong>BeginSlice</strong></a>(self, category, name, timestamp, args<font color="#909090">=None</font>)</dt><dd><tt>Opens&nbsp;a&nbsp;new&nbsp;slice&nbsp;for&nbsp;the&nbsp;thread.<br>
 Calls&nbsp;to&nbsp;beginSlice&nbsp;and&nbsp;endSlice&nbsp;must&nbsp;be&nbsp;made&nbsp;with<br>
@@ -84,43 +84,35 @@
 
 <dl><dt><a name="Thread-IsTimestampValidForBeginOrEnd"><strong>IsTimestampValidForBeginOrEnd</strong></a>(self, timestamp)</dt></dl>
 
-<dl><dt><a name="Thread-PushSlice"><strong>PushSlice</strong></a>(self, new_slice)</dt></dl>
+<dl><dt><a name="Thread-IterAllSlices"><strong>IterAllSlices</strong></a>(self)</dt></dl>
 
-<dl><dt><a name="Thread-UpdateBounds"><strong>UpdateBounds</strong></a>(self)</dt></dl>
+<dl><dt><a name="Thread-IterChildContainers"><strong>IterChildContainers</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Thread-IterEventsInThisContainer"><strong>IterEventsInThisContainer</strong></a>(self)</dt></dl>
+
+<dl><dt><a name="Thread-PushSlice"><strong>PushSlice</strong></a>(self, new_slice)</dt></dl>
 
 <dl><dt><a name="Thread-__init__"><strong>__init__</strong></a>(self, process, tid)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
+<dl><dt><strong>all_slices</strong></dt>
+</dl>
 <dl><dt><strong>async_slices</strong></dt>
 </dl>
 <dl><dt><strong>open_slice_count</strong></dt>
 </dl>
 <dl><dt><strong>samples</strong></dt>
 </dl>
-<dl><dt><strong>slices</strong></dt>
+<dl><dt><strong>toplevel_slices</strong></dt>
 </dl>
 <hr>
-Methods inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
-<dl><dt><a name="Thread-GetAllChildrenRecursive"><strong>GetAllChildrenRecursive</strong></a>(self, include_self<font color="#909090">=False</font>)</dt></dl>
-
-<dl><dt><a name="Thread-ShiftTimestampsForward"><strong>ShiftTimestampsForward</strong></a>(self, delta_time)</dt><dd><tt>Shifts&nbsp;start&nbsp;time&nbsp;of&nbsp;event&nbsp;by&nbsp;delta_time&nbsp;and&nbsp;also<br>
-recursively&nbsp;shifts&nbsp;child&nbsp;events.</tt></dd></dl>
-
-<dl><dt><a name="Thread-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
-
-<hr>
-Data descriptors inherited from <a href="telemetry.core.timeline.event.html#TimelineEvent">telemetry.core.timeline.event.TimelineEvent</a>:<br>
+Data descriptors inherited from <a href="telemetry.core.timeline.event_container.html#TimelineEventContainer">telemetry.core.timeline.event_container.TimelineEventContainer</a>:<br>
 <dl><dt><strong>__dict__</strong></dt>
 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
 <dl><dt><strong>__weakref__</strong></dt>
 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
 </dl>
-<dl><dt><strong>end</strong></dt>
-</dl>
-<dl><dt><strong>self_time</strong></dt>
-<dd><tt>Time&nbsp;spent&nbsp;in&nbsp;this&nbsp;function&nbsp;less&nbsp;any&nbsp;time&nbsp;spent&nbsp;in&nbsp;child&nbsp;events.</tt></dd>
-</dl>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.trace_event_importer.html b/tools/telemetry/docs/telemetry.core.timeline.trace_event_importer.html
similarity index 83%
rename from tools/telemetry/docs/telemetry.core.timeline.tracing.trace_event_importer.html
rename to tools/telemetry/docs/telemetry.core.timeline.trace_event_importer.html
index e519498..6f005aa 100644
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.trace_event_importer.html
+++ b/tools/telemetry/docs/telemetry.core.timeline.trace_event_importer.html
@@ -1,14 +1,14 @@
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: module telemetry.core.timeline.tracing.trace_event_importer</title>
+<html><head><title>Python: module telemetry.core.timeline.trace_event_importer</title>
 </head><body bgcolor="#f0f0f8">
 
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
 <tr bgcolor="#7799ee">
 <td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.<a href="telemetry.core.timeline.tracing.html"><font color="#ffffff">tracing</font></a>.trace_event_importer</strong></big></big></font></td
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.trace_event_importer</strong></big></big></font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/trace_event_importer.py">telemetry/core/timeline/tracing/trace_event_importer.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/trace_event_importer.py">telemetry/core/timeline/trace_event_importer.py</a></font></td></tr></table>
     <p><tt>TraceEventImporter&nbsp;imports&nbsp;TraceEvent-formatted&nbsp;data<br>
 into&nbsp;the&nbsp;provided&nbsp;model.<br>
 This&nbsp;is&nbsp;a&nbsp;port&nbsp;of&nbsp;the&nbsp;trace&nbsp;event&nbsp;importer&nbsp;from<br>
@@ -24,8 +24,7 @@
 <a href="telemetry.core.timeline.importer.html">telemetry.core.timeline.importer</a><br>
 </td><td width="25%" valign=top><a href="json.html">json</a><br>
 <a href="re.html">re</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.async_slice.html">telemetry.core.timeline.tracing.async_slice</a><br>
-<a href="telemetry.core.timeline.tracing.process.html">telemetry.core.timeline.tracing.process</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.timeline.async_slice.html">telemetry.core.timeline.async_slice</a><br>
 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
@@ -37,7 +36,7 @@
 <dt><font face="helvetica, arial"><a href="telemetry.core.timeline.importer.html#TimelineImporter">telemetry.core.timeline.importer.TimelineImporter</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
 </font></dt><dd>
 <dl>
-<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.tracing.trace_event_importer.html#TraceEventTimelineImporter">TraceEventTimelineImporter</a>
+<dt><font face="helvetica, arial"><a href="telemetry.core.timeline.trace_event_importer.html#TraceEventTimelineImporter">TraceEventTimelineImporter</a>
 </font></dt></dl>
 </dd>
 </dl>
@@ -49,7 +48,7 @@
     
 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="telemetry.core.timeline.tracing.trace_event_importer.html#TraceEventTimelineImporter">TraceEventTimelineImporter</a></dd>
+<dd><a href="telemetry.core.timeline.trace_event_importer.html#TraceEventTimelineImporter">TraceEventTimelineImporter</a></dd>
 <dd><a href="telemetry.core.timeline.importer.html#TimelineImporter">telemetry.core.timeline.importer.TimelineImporter</a></dd>
 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
 </dl>
diff --git a/tools/telemetry/docs/telemetry.core.timeline.tracing.html b/tools/telemetry/docs/telemetry.core.timeline.tracing.html
deleted file mode 100644
index 2e00fff..0000000
--- a/tools/telemetry/docs/telemetry.core.timeline.tracing.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html><head><title>Python: package telemetry.core.timeline.tracing</title>
-</head><body bgcolor="#f0f0f8">
-
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
-<tr bgcolor="#7799ee">
-<td valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.<a href="telemetry.core.timeline.html"><font color="#ffffff">timeline</font></a>.tracing</strong></big></big></font></td
-><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/timeline/tracing/__init__.py">telemetry/core/timeline/tracing/__init__.py</a></font></td></tr></table>
-    <p><tt>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
-#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
-#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
-<p>
-<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
-<tr bgcolor="#aa55cc">
-<td colspan=3 valign=bottom>&nbsp;<br>
-<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
-    
-<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.async_slice.html">async_slice</a><br>
-<a href="telemetry.core.timeline.tracing.counter.html">counter</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.process.html">process</a><br>
-<a href="telemetry.core.timeline.tracing.sample.html">sample</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.slice.html">slice</a><br>
-<a href="telemetry.core.timeline.tracing.thread.html">thread</a><br>
-</td><td width="25%" valign=top><a href="telemetry.core.timeline.tracing.trace_event_importer.html">trace_event_importer</a><br>
-<a href="telemetry.core.timeline.tracing.trace_event_importer_unittest.html">trace_event_importer_unittest</a><br>
-</td></tr></table></td></tr></table>
-</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.user_agent.html b/tools/telemetry/docs/telemetry.core.user_agent.html
index 02f4bb9..22e359f 100644
--- a/tools/telemetry/docs/telemetry.core.user_agent.html
+++ b/tools/telemetry/docs/telemetry.core.user_agent.html
@@ -29,5 +29,5 @@
 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
     
 <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><strong>UA_TYPE_MAPPING</strong> = {'desktop': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) A...TML, like Gecko) Chrome/25.0.1364.2 Safari/537.22', 'mobile': 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus ... Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19', 'tablet': 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus ...L, like Gecko) Chrome/18.0.1025.133 Safari/535.19'}</td></tr></table>
+<td width="100%"><strong>UA_TYPE_MAPPING</strong> = {'desktop': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) A...L, like Gecko) Chrome/27.0.1453.111 Safari/537.22', 'mobile': 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus ... Gecko) Chrome/27.0.1453.111 Mobile Safari/535.19', 'tablet': 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus ...L, like Gecko) Chrome/27.0.1453.111 Safari/535.19'}</td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.core.wpr_server.html b/tools/telemetry/docs/telemetry.core.wpr_server.html
index 14476eb..4cfd8ca 100644
--- a/tools/telemetry/docs/telemetry.core.wpr_server.html
+++ b/tools/telemetry/docs/telemetry.core.wpr_server.html
@@ -52,7 +52,7 @@
 
 <dl><dt><a name="ReplayServer-__exit__"><strong>__exit__</strong></a>(self, *args)</dt></dl>
 
-<dl><dt><a name="ReplayServer-__init__"><strong>__init__</strong></a>(self, browser_backend, path, is_record_mode, is_append_mode, webpagereplay_host, webpagereplay_local_http_port, webpagereplay_local_https_port, webpagereplay_remote_http_port, webpagereplay_remote_https_port)</dt></dl>
+<dl><dt><a name="ReplayServer-__init__"><strong>__init__</strong></a>(self, browser_backend, path, is_record_mode, is_append_mode, make_javascript_deterministic, webpagereplay_host, webpagereplay_local_http_port, webpagereplay_local_https_port, webpagereplay_remote_http_port, webpagereplay_remote_https_port)</dt></dl>
 
 <hr>
 Data descriptors defined here:<br>
diff --git a/tools/telemetry/docs/telemetry.html b/tools/telemetry/docs/telemetry.html
index 127eb86..5b75b23 100644
--- a/tools/telemetry/docs/telemetry.html
+++ b/tools/telemetry/docs/telemetry.html
@@ -75,18 +75,20 @@
 <td width="100%">Methods defined here:<br>
 <dl><dt><a name="Browser-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&nbsp;this&nbsp;browser.</tt></dd></dl>
 
+<dl><dt><a name="Browser-GetStackTrace"><strong>GetStackTrace</strong></a>(self)</dt></dl>
+
 <dl><dt><a name="Browser-GetStandardOutput"><strong>GetStandardOutput</strong></a>(self)</dt></dl>
 
 <dl><dt><a name="Browser-GetTraceResultAndReset"><strong>GetTraceResultAndReset</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;result&nbsp;of&nbsp;the&nbsp;trace,&nbsp;as&nbsp;TraceResult&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>
 
 <dl><dt><a name="Browser-SetHTTPServerDirectories"><strong>SetHTTPServerDirectories</strong></a>(self, paths)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;HTTP&nbsp;server&nbsp;was&nbsp;started,&nbsp;False&nbsp;otherwise.</tt></dd></dl>
 
-<dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</strong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False</font>)</dt></dl>
+<dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</strong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False</font>, make_javascript_deterministic<font color="#909090">=True</font>)</dt></dl>
 
 <dl><dt><a name="Browser-StartProfiling"><strong>StartProfiling</strong></a>(self, options, base_output_file)</dt><dd><tt>Starts&nbsp;profiling&nbsp;using&nbsp;|options|.profiler_tool.&nbsp;Results&nbsp;are&nbsp;saved&nbsp;to<br>
 |base_output_file|.&lt;process_name&gt;.</tt></dd></dl>
 
-<dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>)</dt></dl>
+<dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, custom_categories<font color="#909090">=None</font>, timeout<font color="#909090">=10</font>)</dt></dl>
 
 <dl><dt><a name="Browser-StopProfiling"><strong>StopProfiling</strong></a>(self)</dt><dd><tt>Stops&nbsp;all&nbsp;active&nbsp;profilers&nbsp;and&nbsp;saves&nbsp;their&nbsp;results.</tt></dd></dl>
 
diff --git a/tools/telemetry/docs/telemetry.page.actions.html b/tools/telemetry/docs/telemetry.page.actions.html
index a9733e2..ae1c953 100644
--- a/tools/telemetry/docs/telemetry.page.actions.html
+++ b/tools/telemetry/docs/telemetry.page.actions.html
@@ -22,10 +22,12 @@
 <a href="telemetry.page.actions.click_element_unittest.html">click_element_unittest</a><br>
 </td><td width="25%" valign=top><a href="telemetry.page.actions.js_collect_garbage.html">js_collect_garbage</a><br>
 <a href="telemetry.page.actions.page_action.html">page_action</a><br>
+<a href="telemetry.page.actions.play.html">play</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.actions.play_unittest.html">play_unittest</a><br>
 <a href="telemetry.page.actions.reload.html">reload</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.actions.scroll.html">scroll</a><br>
-<a href="telemetry.page.actions.scroll_unittest.html">scroll_unittest</a><br>
+<a href="telemetry.page.actions.scroll.html">scroll</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.actions.scroll_unittest.html">scroll_unittest</a><br>
 <a href="telemetry.page.actions.wait.html">wait</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.actions.wait_unittest.html">wait_unittest</a><br>
+<a href="telemetry.page.actions.wait_unittest.html">wait_unittest</a><br>
 </td></tr></table></td></tr></table>
 </body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.page.actions.play.html b/tools/telemetry/docs/telemetry.page.actions.play.html
new file mode 100644
index 0000000..88ece24
--- /dev/null
+++ b/tools/telemetry/docs/telemetry.page.actions.play.html
@@ -0,0 +1,107 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Python: module telemetry.page.actions.play</title>
+</head><body bgcolor="#f0f0f8">
+
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
+<tr bgcolor="#7799ee">
+<td valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.page.html"><font color="#ffffff">page</font></a>.<a href="telemetry.page.actions.html"><font color="#ffffff">actions</font></a>.play</strong></big></big></font></td
+><td align=right valign=bottom
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/actions/play.py">telemetry/page/actions/play.py</a></font></td></tr></table>
+    <p><tt>A&nbsp;Telemetry&nbsp;page_action&nbsp;that&nbsp;performs&nbsp;the&nbsp;"play"&nbsp;action&nbsp;on&nbsp;media&nbsp;elements.<br>
+&nbsp;<br>
+Media&nbsp;elements&nbsp;can&nbsp;be&nbsp;specified&nbsp;by&nbsp;a&nbsp;selector&nbsp;attribute.&nbsp;If&nbsp;no&nbsp;selector&nbsp;is<br>
+defined&nbsp;then&nbsp;then&nbsp;the&nbsp;action&nbsp;attempts&nbsp;to&nbsp;play&nbsp;the&nbsp;first&nbsp;video&nbsp;element&nbsp;or&nbsp;audio<br>
+element&nbsp;on&nbsp;the&nbsp;page.&nbsp;A&nbsp;selector&nbsp;can&nbsp;also&nbsp;be&nbsp;'all'&nbsp;to&nbsp;play&nbsp;all&nbsp;media&nbsp;elements.<br>
+&nbsp;<br>
+Other&nbsp;attributes&nbsp;to&nbsp;use&nbsp;are:&nbsp;wait_for_playing&nbsp;and&nbsp;wait_for_ended,&nbsp;which&nbsp;forces<br>
+the&nbsp;action&nbsp;to&nbsp;wait&nbsp;until&nbsp;playing&nbsp;and&nbsp;ended&nbsp;events&nbsp;get&nbsp;fired&nbsp;respectively.</tt></p>
+<p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#aa55cc">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
+</td><td width="25%" valign=top><a href="os.html">os</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.actions.page_action.html">telemetry.page.actions.page_action</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br>
+</td></tr></table></td></tr></table><p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ee77aa">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl>
+<dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
+</font></dt><dd>
+<dl>
+<dt><font face="helvetica, arial"><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a>
+</font></dt></dl>
+</dd>
+</dl>
+ <p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#ffc8d8">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#000000" face="helvetica, arial"><a name="PlayAction">class <strong>PlayAction</strong></a>(<a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>)</font></td></tr>
+    
+<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl><dt>Method resolution order:</dt>
+<dd><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a></dd>
+<dd><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a></dd>
+<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
+</dl>
+<hr>
+Methods defined here:<br>
+<dl><dt><a name="PlayAction-HasEventCompleted"><strong>HasEventCompleted</strong></a>(self, tab, selector, event_name)</dt></dl>
+
+<dl><dt><a name="PlayAction-RunAction"><strong>RunAction</strong></a>(self, page, tab, previous_action)</dt></dl>
+
+<dl><dt><a name="PlayAction-WaitForEvent"><strong>WaitForEvent</strong></a>(self, tab, selector, event_name, timeout)</dt><dd><tt>Halts&nbsp;play&nbsp;action&nbsp;until&nbsp;the&nbsp;selector's&nbsp;event&nbsp;is&nbsp;fired.</tt></dd></dl>
+
+<dl><dt><a name="PlayAction-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab)</dt><dd><tt>Load&nbsp;the&nbsp;media&nbsp;metrics&nbsp;JS&nbsp;code&nbsp;prior&nbsp;to&nbsp;running&nbsp;the&nbsp;action.</tt></dd></dl>
+
+<dl><dt><a name="PlayAction-__init__"><strong>__init__</strong></a>(self, attributes<font color="#909090">=None</font>)</dt></dl>
+
+<hr>
+Methods inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br>
+<dl><dt><a name="PlayAction-BindMeasurementJavaScript"><strong>BindMeasurementJavaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let&nbsp;this&nbsp;action&nbsp;determine&nbsp;when&nbsp;measurements&nbsp;should&nbsp;start&nbsp;and&nbsp;stop.<br>
+&nbsp;<br>
+A&nbsp;measurement&nbsp;can&nbsp;call&nbsp;this&nbsp;method&nbsp;to&nbsp;provide&nbsp;the&nbsp;action<br>
+with&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;and&nbsp;stops&nbsp;measurements.&nbsp;The&nbsp;action<br>
+determines&nbsp;when&nbsp;to&nbsp;execute&nbsp;the&nbsp;provided&nbsp;JavaScript&nbsp;code,&nbsp;for&nbsp;more&nbsp;accurate<br>
+timings.<br>
+&nbsp;<br>
+Args:<br>
+&nbsp;&nbsp;tab:&nbsp;The&nbsp;tab&nbsp;to&nbsp;do&nbsp;everything&nbsp;on.<br>
+&nbsp;&nbsp;start_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;measurements.<br>
+&nbsp;&nbsp;stop_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;stops&nbsp;measurements.</tt></dd></dl>
+
+<dl><dt><a name="PlayAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</dt><dd><tt>If&nbsp;this&nbsp;class&nbsp;implements&nbsp;BindMeasurementJavaScript,&nbsp;override&nbsp;CanBeBound<br>
+to&nbsp;return&nbsp;True&nbsp;so&nbsp;that&nbsp;a&nbsp;test&nbsp;knows&nbsp;it&nbsp;can&nbsp;bind&nbsp;measurements.</tt></dd></dl>
+
+<dl><dt><a name="PlayAction-CleanUp"><strong>CleanUp</strong></a>(self, page, tab)</dt></dl>
+
+<dl><dt><a name="PlayAction-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt><dd><tt>Override&nbsp;to&nbsp;add&nbsp;action-specific&nbsp;options&nbsp;to&nbsp;the&nbsp;BrowserOptions<br>
+object.</tt></dd></dl>
+
+<dl><dt><a name="PlayAction-RunsPreviousAction"><strong>RunsPreviousAction</strong></a>(self)</dt><dd><tt>Some&nbsp;actions&nbsp;require&nbsp;some&nbsp;initialization&nbsp;to&nbsp;be&nbsp;performed&nbsp;before&nbsp;the<br>
+previous&nbsp;action.&nbsp;For&nbsp;example,&nbsp;wait&nbsp;for&nbsp;href&nbsp;change&nbsp;needs&nbsp;to&nbsp;record&nbsp;the&nbsp;old<br>
+href&nbsp;before&nbsp;the&nbsp;previous&nbsp;action&nbsp;changes&nbsp;it.&nbsp;Therefore,&nbsp;we&nbsp;allow&nbsp;actions&nbsp;to<br>
+run&nbsp;the&nbsp;previous&nbsp;action.&nbsp;An&nbsp;action&nbsp;that&nbsp;does&nbsp;this&nbsp;should&nbsp;override&nbsp;this&nbsp;to<br>
+return&nbsp;True&nbsp;in&nbsp;order&nbsp;to&nbsp;prevent&nbsp;the&nbsp;previous&nbsp;action&nbsp;from&nbsp;being&nbsp;run&nbsp;twice.</tt></dd></dl>
+
+<hr>
+Data descriptors inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br>
+<dl><dt><strong>__dict__</strong></dt>
+<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+<dl><dt><strong>__weakref__</strong></dt>
+<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
+</dl>
+</td></tr></table></td></tr></table>
+</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.page.cloud_storage.html b/tools/telemetry/docs/telemetry.page.cloud_storage.html
new file mode 100644
index 0000000..153583d
--- /dev/null
+++ b/tools/telemetry/docs/telemetry.page.cloud_storage.html
@@ -0,0 +1,40 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Python: module telemetry.page.cloud_storage</title>
+</head><body bgcolor="#f0f0f8">
+
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
+<tr bgcolor="#7799ee">
+<td valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.page.html"><font color="#ffffff">page</font></a>.cloud_storage</strong></big></big></font></td
+><td align=right valign=bottom
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/cloud_storage.py">telemetry/page/cloud_storage.py</a></font></td></tr></table>
+    <p><tt>Wrappers&nbsp;for&nbsp;gsutil,&nbsp;for&nbsp;basic&nbsp;interaction&nbsp;with&nbsp;Google&nbsp;Cloud&nbsp;Storage.</tt></p>
+<p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#aa55cc">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="cStringIO.html">cStringIO</a><br>
+<a href="logging.html">logging</a><br>
+</td><td width="25%" valign=top><a href="os.html">os</a><br>
+<a href="subprocess.html">subprocess</a><br>
+</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+<a href="tarfile.html">tarfile</a><br>
+</td><td width="25%" valign=top><a href="urllib2.html">urllib2</a><br>
+<a href="telemetry.core.util.html">telemetry.core.util</a><br>
+</td></tr></table></td></tr></table><p>
+<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
+<tr bgcolor="#eeaa77">
+<td colspan=3 valign=bottom>&nbsp;<br>
+<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
+    
+<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+<td width="100%"><dl><dt><a name="-Delete"><strong>Delete</strong></a>(bucket, remote_path)</dt></dl>
+ <dl><dt><a name="-Get"><strong>Get</strong></a>(bucket, remote_path, local_path)</dt></dl>
+ <dl><dt><a name="-Insert"><strong>Insert</strong></a>(bucket, remote_path, local_path)</dt></dl>
+ <dl><dt><a name="-List"><strong>List</strong></a>(bucket)</dt></dl>
+</td></tr></table>
+</body></html>
\ No newline at end of file
diff --git a/tools/telemetry/docs/telemetry.page.html b/tools/telemetry/docs/telemetry.page.html
index 04fdf52..28b1343 100644
--- a/tools/telemetry/docs/telemetry.page.html
+++ b/tools/telemetry/docs/telemetry.page.html
@@ -24,26 +24,27 @@
 <a href="telemetry.page.block_page_measurement_results_unittest.html">block_page_measurement_results_unittest</a><br>
 <a href="telemetry.page.buildbot_page_measurement_results.html">buildbot_page_measurement_results</a><br>
 <a href="telemetry.page.buildbot_page_measurement_results_unittest.html">buildbot_page_measurement_results_unittest</a><br>
+<a href="telemetry.page.cloud_storage.html">cloud_storage</a><br>
 <a href="telemetry.page.csv_page_measurement_results.html">csv_page_measurement_results</a><br>
 <a href="telemetry.page.csv_page_measurement_results_unittest.html">csv_page_measurement_results_unittest</a><br>
-<a href="telemetry.page.gtest_test_results.html">gtest_test_results</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.page.html">page</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.gtest_test_results.html">gtest_test_results</a><br>
+<a href="telemetry.page.page.html">page</a><br>
 <a href="telemetry.page.page_filter.html">page_filter</a><br>
 <a href="telemetry.page.page_measurement.html">page_measurement</a><br>
 <a href="telemetry.page.page_measurement_results.html">page_measurement_results</a><br>
 <a href="telemetry.page.page_measurement_results_unittest.html">page_measurement_results_unittest</a><br>
 <a href="telemetry.page.page_measurement_runner.html">page_measurement_runner</a><br>
 <a href="telemetry.page.page_measurement_unittest.html">page_measurement_unittest</a><br>
-<a href="telemetry.page.page_measurement_unittest_base.html">page_measurement_unittest_base</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.page_measurement_value.html">page_measurement_value</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.page_measurement_unittest_base.html">page_measurement_unittest_base</a><br>
+<a href="telemetry.page.page_measurement_value.html">page_measurement_value</a><br>
 <a href="telemetry.page.page_runner.html">page_runner</a><br>
 <a href="telemetry.page.page_runner_unittest.html">page_runner_unittest</a><br>
 <a href="telemetry.page.page_set.html">page_set</a><br>
 <a href="telemetry.page.page_set_archive_info.html">page_set_archive_info</a><br>
 <a href="telemetry.page.page_set_archive_info_unittest.html">page_set_archive_info_unittest</a><br>
 <a href="telemetry.page.page_set_unittest.html">page_set_unittest</a><br>
-<a href="telemetry.page.page_test.html">page_test</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.page_test_results.html">page_test_results</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.page_test.html">page_test</a><br>
+<a href="telemetry.page.page_test_results.html">page_test_results</a><br>
 <a href="telemetry.page.page_test_runner.html">page_test_runner</a><br>
 <a href="telemetry.page.page_test_unittest.html">page_test_unittest</a><br>
 <a href="telemetry.page.page_unittest.html">page_unittest</a><br>
diff --git a/tools/telemetry/docs/telemetry.page.page_runner.html b/tools/telemetry/docs/telemetry.page.page_runner.html
index 8863dc7..7bcba13 100644
--- a/tools/telemetry/docs/telemetry.page.page_runner.html
+++ b/tools/telemetry/docs/telemetry.page.page_runner.html
@@ -20,15 +20,15 @@
     
 <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.browser_finder.html">telemetry.core.browser_finder</a><br>
-<a href="codecs.html">codecs</a><br>
 <a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
 <a href="glob.html">glob</a><br>
-</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
-<a href="os.html">os</a><br>
+<a href="logging.html">logging</a><br>
+</td><td width="25%" valign=top><a href="os.html">os</a><br>
 <a href="telemetry.page.page_filter.html">telemetry.page.page_filter</a><br>
 <a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br>
-</td><td width="25%" valign=top><a href="random.html">random</a><br>
-<a href="sys.html">sys</a><br>
+<a href="random.html">random</a><br>
+</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+<a href="tempfile.html">tempfile</a><br>
 <a href="time.html">time</a><br>
 <a href="traceback.html">traceback</a><br>
 </td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
diff --git a/tools/telemetry/docs/telemetry.page.record_wpr.html b/tools/telemetry/docs/telemetry.page.record_wpr.html
index fa49426..a82922f 100644
--- a/tools/telemetry/docs/telemetry.page.record_wpr.html
+++ b/tools/telemetry/docs/telemetry.page.record_wpr.html
@@ -22,15 +22,16 @@
 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.browser_options.html">telemetry.core.browser_options</a><br>
 <a href="telemetry.core.discover.html">telemetry.core.discover</a><br>
 <a href="logging.html">logging</a><br>
-</td><td width="25%" valign=top><a href="os.html">os</a><br>
-<a href="telemetry.page.page_measurement.html">telemetry.page.page_measurement</a><br>
+<a href="os.html">os</a><br>
+</td><td width="25%" valign=top><a href="telemetry.page.page_measurement.html">telemetry.page.page_measurement</a><br>
 <a href="telemetry.page.page_runner.html">telemetry.page.page_runner</a><br>
-</td><td width="25%" valign=top><a href="telemetry.page.page_set.html">telemetry.page.page_set</a><br>
+<a href="telemetry.page.page_set.html">telemetry.page.page_set</a><br>
 <a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br>
-<a href="sys.html">sys</a><br>
-</td><td width="25%" valign=top><a href="tempfile.html">tempfile</a><br>
+</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
+<a href="tempfile.html">tempfile</a><br>
+<a href="telemetry.test.html">telemetry.test</a><br>
 <a href="time.html">time</a><br>
-<a href="telemetry.core.wpr_modes.html">telemetry.core.wpr_modes</a><br>
+</td><td width="25%" valign=top><a href="telemetry.core.wpr_modes.html">telemetry.core.wpr_modes</a><br>
 </td></tr></table></td></tr></table><p>
 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
 <tr bgcolor="#ee77aa">
diff --git a/tools/telemetry/telemetry/core/browser.py b/tools/telemetry/telemetry/core/browser.py
index c604cae..c2a7037 100644
--- a/tools/telemetry/telemetry/core/browser.py
+++ b/tools/telemetry/telemetry/core/browser.py
@@ -192,26 +192,32 @@
     del result['ProcessCount']
     return result
 
-  def StartProfiling(self, options, base_output_file):
-    """Starts profiling using |options|.profiler_tool. Results are saved to
+  def StartProfiling(self, profiler_name, base_output_file):
+    """Starts profiling using |profiler_name|. Results are saved to
     |base_output_file|.<process_name>."""
     assert not self._active_profilers
 
-    profiler_class = profiler_finder.FindProfiler(options.profiler)
+    profiler_class = profiler_finder.FindProfiler(profiler_name)
 
-    if not profiler_class.is_supported(options):
+    if not profiler_class.is_supported(self._browser_backend.options):
       raise Exception('The %s profiler is not '
-                      'supported on this platform.' % options.profiler_tool)
+                      'supported on this platform.' % profiler_name)
 
     self._active_profilers.append(
         profiler_class(self._browser_backend, self._platform_backend,
             base_output_file))
 
   def StopProfiling(self):
-    """Stops all active profilers and saves their results."""
+    """Stops all active profilers and saves their results.
+
+    Returns:
+      A list of filenames produced by the profiler.
+    """
+    output_files = []
     for profiler in self._active_profilers:
-      profiler.CollectProfile()
+      output_files.extend(profiler.CollectProfile())
     self._active_profilers = []
+    return output_files
 
   def StartTracing(self, custom_categories=None, timeout=10):
     return self._browser_backend.StartTracing(custom_categories, timeout)
diff --git a/tools/telemetry/telemetry/core/browser_options.py b/tools/telemetry/telemetry/core/browser_options.py
index 5c8f6e5..ef6e03b 100644
--- a/tools/telemetry/telemetry/core/browser_options.py
+++ b/tools/telemetry/telemetry/core/browser_options.py
@@ -1,14 +1,16 @@
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
-import optparse
-import sys
-import shlex
-import logging
+
 import copy
+import logging
+import optparse
+import shlex
+import sys
 
 from telemetry.core import browser_finder
 from telemetry.core import profile_types
+from telemetry.core import repeat_options
 from telemetry.core import wpr_modes
 from telemetry.core.platform.profiler import profiler_finder
 
@@ -47,6 +49,8 @@
 
     self.no_proxy_server = False
 
+    self.repeat_options = repeat_options.RepeatOptions()
+
   def Copy(self):
     return copy.deepcopy(self)
 
@@ -111,12 +115,6 @@
 
     # Page set options
     group = optparse.OptionGroup(parser, 'Page set options')
-    group.add_option('--page-repeat', dest='page_repeat', default=1,
-        help='Number of times to repeat each individual ' +
-        'page in the pageset before proceeding.')
-    group.add_option('--pageset-repeat', dest='pageset_repeat', default=1,
-        help='Number of times to repeat the entire pageset ' +
-        'before finishing.')
     group.add_option('--pageset-shuffle', action='store_true',
         dest='pageset_shuffle',
         help='Shuffle the order of pages within a pageset.')
@@ -159,6 +157,9 @@
         'This option prevents Telemetry from tweaking such platform settings.')
     parser.add_option_group(group)
 
+    # Repeat options
+    repeat_options.RepeatOptions.AddCommandLineOptions(parser)
+
     real_parse = parser.parse_args
     def ParseArgs(args=None):
       defaults = parser.get_default_values()
@@ -202,6 +203,10 @@
         delattr(self, 'extra_wpr_args_as_string')
       if self.profile_type == 'default':
         self.dont_override_profile = True
+
+      # Parse repeat options
+      self.repeat_options.UpdateFromParseResults(self, parser)
+
       self.profile_dir = profile_types.GetProfileDir(self.profile_type)
       return ret
     parser.parse_args = ParseArgs
diff --git a/tools/telemetry/telemetry/core/chrome/tracing_backend.py b/tools/telemetry/telemetry/core/chrome/tracing_backend.py
index 644544c..2df0f6b 100644
--- a/tools/telemetry/telemetry/core/chrome/tracing_backend.py
+++ b/tools/telemetry/telemetry/core/chrome/tracing_backend.py
@@ -43,7 +43,9 @@
   def AsTimelineModel(self):
     f = cStringIO.StringIO()
     self.Serialize(f)
-    return model.TimelineModel(event_data=f.getvalue())
+    return model.TimelineModel(
+      event_data=f.getvalue(),
+      shift_world_to_zero=False)
 
 class TracingBackend(object):
   def __init__(self, devtools_port):
diff --git a/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
index ab4c918..58cea8a 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py
@@ -3,6 +3,8 @@
 # found in the LICENSE file.
 
 import logging
+import os
+import re
 import signal
 import subprocess
 import sys
@@ -40,6 +42,7 @@
       self._tmp_output_file.close()
     print 'To view the profile, run:'
     print '  perf report -i %s' % self._output_file
+    return self._output_file
 
   def _GetStdOut(self):
     self._tmp_output_file.flush()
@@ -79,5 +82,33 @@
       return False
 
   def CollectProfile(self):
+    output_files = []
     for single_process in self._process_profilers:
-      single_process.CollectProfile()
+      output_files.append(single_process.CollectProfile())
+    return output_files
+
+  @classmethod
+  def GetTopSamples(cls, file_name, number):
+    """Parses the perf generated profile in |file_name| and returns a
+    {function: period} dict of the |number| hottests functions.
+    """
+    assert os.path.exists(file_name)
+    report = subprocess.Popen(
+        ['perf', 'report', '--show-total-period', '-U', '-t', '^', '-i',
+         file_name],
+        stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0]
+    period_by_function = {}
+    for line in report.split('\n'):
+      if not line or line.startswith('#'):
+        continue
+      fields = line.split('^')
+      if len(fields) != 5:
+        continue
+      period = int(fields[1])
+      function = fields[4].partition(' ')[2]
+      function = re.sub('<.*>', '', function)  # Strip template params.
+      function = re.sub('[(].*[)]', '', function)  # Strip function params.
+      period_by_function[function] = period
+      if len(period_by_function) == number:
+        break
+    return period_by_function
diff --git a/tools/telemetry/telemetry/core/platform/profiler/perf_profiler_unittest.py b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler_unittest.py
new file mode 100644
index 0000000..8ca407f
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/profiler/perf_profiler_unittest.py
@@ -0,0 +1,31 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+import logging
+import unittest
+
+from telemetry.core.platform.profiler import perf_profiler
+from telemetry.unittest import options_for_unittests
+
+class TestPerfProfiler(unittest.TestCase):
+  def testPerfProfiler(self):
+    options = options_for_unittests.GetCopy()
+    if not perf_profiler.PerfProfiler.is_supported(options):
+      logging.warning('PerfProfiler is not supported. Skipping test')
+      return
+
+    profile_file = os.path.join(os.path.dirname(__file__),
+                                'testdata', 'perf.profile')
+    self.assertEqual(perf_profiler.PerfProfiler.GetTopSamples(profile_file, 10),
+        { 'v8::internal::StaticMarkingVisitor::MarkMapContents': 63615201,
+          'v8::internal::RelocIterator::next': 38271931,
+          'v8::internal::LAllocator::MeetConstraintsBetween': 42913933,
+          'v8::internal::FlexibleBodyVisitor::Visit': 31909537,
+          'v8::internal::LiveRange::CreateAssignedOperand': 42913933,
+          'void v8::internal::RelocInfo::Visit': 96878864,
+          'WebCore::HTMLTokenizer::nextToken': 48240439,
+          'v8::internal::Scanner::ScanIdentifierOrKeyword': 46054550,
+          'sk_memset32_SSE2': 45121317,
+          'v8::internal::HeapObject::Size': 39786862
+          })
diff --git a/tools/telemetry/telemetry/core/platform/profiler/profiler_finder.py b/tools/telemetry/telemetry/core/platform/profiler/profiler_finder.py
index 25f5659..bffdbfa 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/profiler_finder.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/profiler_finder.py
@@ -2,29 +2,25 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-from telemetry.core.platform.profiler import iprofiler_profiler
-from telemetry.core.platform.profiler import java_heap_profiler
-from telemetry.core.platform.profiler import perf_profiler
-from telemetry.core.platform.profiler import sample_profiler
-from telemetry.core.platform.profiler import tcmalloc_heap_profiler
-from telemetry.core.platform.profiler import trace_profiler
+import os
 
-_PROFILERS = [
-    iprofiler_profiler.IprofilerProfiler,
-    java_heap_profiler.JavaHeapProfiler,
-    perf_profiler.PerfProfiler,
-    sample_profiler.SampleProfiler,
-    tcmalloc_heap_profiler.TCMallocHeapProfiler,
-    trace_profiler.TraceProfiler,
-]
+from telemetry.core import discover
+from telemetry.core import util
+from telemetry.core.platform import profiler
+
+
+def _DiscoverProfilers():
+  profiler_dir = os.path.dirname(__file__)
+  return discover.DiscoverClasses(profiler_dir, util.GetTelemetryDir(),
+                                  profiler.Profiler).values()
 
 
 def FindProfiler(name):
-  for profiler in _PROFILERS:
-    if profiler.name() == name:
-      return profiler
+  for p in _DiscoverProfilers():
+    if p.name() == name:
+      return p
   return None
 
 
 def GetAllAvailableProfilers():
-  return [p.name() for p in _PROFILERS]
+  return [p.name() for p in _DiscoverProfilers()]
diff --git a/tools/telemetry/telemetry/core/platform/profiler/testdata/perf.profile b/tools/telemetry/telemetry/core/platform/profiler/testdata/perf.profile
new file mode 100644
index 0000000..db955dd
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/profiler/testdata/perf.profile
Binary files differ
diff --git a/tools/telemetry/telemetry/core/repeat_options.py b/tools/telemetry/telemetry/core/repeat_options.py
new file mode 100644
index 0000000..7eae254
--- /dev/null
+++ b/tools/telemetry/telemetry/core/repeat_options.py
@@ -0,0 +1,61 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import optparse
+import re
+
+
+class RepeatOptions(object):
+  def __init__(self, page_repeat_secs=None, pageset_repeat_secs=None,
+               page_repeat_iters=None, pageset_repeat_iters=None):
+    self.page_repeat_secs = page_repeat_secs
+    self.pageset_repeat_secs = pageset_repeat_secs
+    self.page_repeat_iters = page_repeat_iters
+    self.pageset_repeat_iters = pageset_repeat_iters
+
+  def __deepcopy__(self, _):
+    return RepeatOptions(self.page_repeat_secs, self.pageset_repeat_secs,
+                         self.page_repeat_iters, self.pageset_repeat_iters)
+
+  @staticmethod
+  def AddCommandLineOptions(parser):
+    group = optparse.OptionGroup(parser, 'Repeat options')
+    group.add_option('--page-repeat', dest='page_repeat', default='1',
+                     help='Number of iterations or length of time to repeat '
+                     'each individual page in the pageset before proceeding.  '
+                     'Append an \'s\' to specify length of time in seconds. '
+                     'e.g., \'10\' to repeat for 10 iterations, or \'30s\' to '
+                     'repeat for 30 seconds.')
+    group.add_option('--pageset-repeat', dest='pageset_repeat', default='1',
+                     help='Number of iterations or length of time to repeat '
+                     'the entire pageset before finishing.  Append an \'s\' '
+                     'to specify length of time in seconds. e.g., \'10\' to '
+                     'repeat for 10 iterations, or \'30s\' to repeat for 30 '
+                     'seconds.')
+    parser.add_option_group(group)
+
+  def _ParseRepeatOption(self, browser_options, input_str, parser):
+    match = re.match('([0-9]+)([sS]?)$', getattr(browser_options,
+                                                 input_str, ''))
+    if match:
+      if match.group(2):
+        setattr(self, input_str + '_secs', float(match.group(1)))
+        # Set _iters to the default value
+        setattr(self, input_str + '_iters', 1)
+      else:
+        setattr(self, input_str + '_iters', int(match.group(1)))
+      delattr(browser_options, input_str)
+    else:
+      parser.error('Usage: --%s only accepts an int '
+                   'followed by only an \'s\' if using time. '
+                   'e.g. \'10\' or \'10s\'\n' % input_str.replace('_','-'))
+
+  def UpdateFromParseResults(self, browser_options, parser):
+    self._ParseRepeatOption(browser_options, 'page_repeat', parser)
+    self._ParseRepeatOption(browser_options, 'pageset_repeat', parser)
+
+  def IsRepeating(self):
+    """Returns True if we will be repeating pages or pagesets."""
+    return (self.page_repeat_iters != 1 or self.pageset_repeat_iters != 1 or
+            self.page_repeat_secs or self.pageset_repeat_secs)
\ No newline at end of file
diff --git a/tools/telemetry/telemetry/core/timeline/async_slice.py b/tools/telemetry/telemetry/core/timeline/async_slice.py
new file mode 100644
index 0000000..140eadc
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/async_slice.py
@@ -0,0 +1,28 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import telemetry.core.timeline.event as event
+
+class AsyncSlice(event.TimelineEvent):
+  ''' A AsyncSlice represents an interval of time during which an
+  asynchronous operation is in progress. An AsyncSlice consumes no CPU time
+  itself and so is only associated with Threads at its start and end point.
+  '''
+  def __init__(self, category, name, timestamp, args=None):
+    super(AsyncSlice, self).__init__(
+        category, name, timestamp, duration=0, args=args)
+    self.parent_slice = None
+    self.start_thread = None
+    self.end_thread = None
+    self.sub_slices = []
+    self.id = None
+
+  def AddSubSlice(self, sub_slice):
+    assert sub_slice.parent_slice == self
+    self.sub_slices.append(sub_slice)
+
+
+  def IterEventsInThisContainerRecrusively(self):
+    for sub_slice in self.sub_slices:
+      yield sub_slice
diff --git a/tools/telemetry/telemetry/core/timeline/bounds.py b/tools/telemetry/telemetry/core/timeline/bounds.py
new file mode 100644
index 0000000..26f2301
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/bounds.py
@@ -0,0 +1,71 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class Bounds(object):
+  """Represents a min-max bounds."""
+  def __init__(self):
+    self.is_empty_ = True
+    self.min_ = None
+    self.max_ = None
+
+  @property
+  def is_empty(self):
+    return self.is_empty_
+
+  @property
+  def min(self):
+    if self.is_empty_:
+      return None
+    return self.min_
+
+  @property
+  def max(self):
+    if self.is_empty_:
+      return None
+    return self.max_
+
+  @property
+  def bounds(self):
+    if self.is_empty_:
+      return None
+    return self.max_ - self.min_
+
+  @property
+  def center(self):
+    return (self.min_ + self.max_) * 0.5
+
+
+  def Reset(self):
+    self.is_empty_ = True
+    self.min_ = None
+    self.max_ = None
+
+  def AddBounds(self, bounds):
+    if bounds.isEmpty:
+      return
+    self.AddValue(bounds.min_)
+    self.AddValue(bounds.max_)
+
+  def AddValue(self, value):
+    if self.is_empty_:
+      self.max_ = value
+      self.min_ = value
+      self.is_empty_ = False
+      return
+
+    self.max_ = max(self.max_, value)
+    self.min_ = min(self.min_, value)
+
+  @staticmethod
+  def CompareByMinTimes(a, b):
+    if not a.is_empty and not b.is_empty:
+      return a.min_ - b.min_
+
+    if a.is_empty and not b.is_empty:
+      return -1
+
+    if not a.is_empty and b.is_empty:
+      return 1
+
+    return 0
diff --git a/tools/telemetry/telemetry/core/timeline/counter.py b/tools/telemetry/telemetry/core/timeline/counter.py
new file mode 100644
index 0000000..f21f516
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/counter.py
@@ -0,0 +1,82 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import telemetry.core.timeline.event_container as event_container
+
+# Doesn't inherit from TimelineEvent because its only a temporary wrapper of a
+# counter sample into an event. During stable operation, the samples are stored
+# a dense array of values rather than in the long-form done by an Event.
+class CounterSample(object):
+  def __init__(self, counter, sample_index):
+    self._counter = counter
+    self._sample_index = sample_index
+
+  @property
+  def name(self):
+    return None
+
+  @property
+  def start(self):
+    return self._counter.timestamps[self._sample_index]
+
+  @start.setter
+  def start(self, start):
+    self._counter.timestamps[self._sample_index] = start
+
+  @property
+  def duration(self):
+    return 0
+
+  @property
+  def end(self):
+    return self.start
+
+
+class Counter(event_container.TimelineEventContainer):
+  """ Stores all the samples for a given counter.
+  """
+  def __init__(self, parent, category, name):
+    super(Counter, self).__init__(name, parent)
+    self.category = category
+    self.full_name  = category + '.' + name
+    self.samples = []
+    self.timestamps = []
+    self.series_names = []
+    self.totals = []
+    self.max_total = 0
+
+  def IterChildContainers(self):
+    return iter([])
+
+  def IterEventsInThisContainer(self):
+    for i in range(len(self.timestamps)):
+      yield CounterSample(self, i)
+
+  @property
+  def num_series(self):
+    return len(self.series_names)
+
+  @property
+  def num_samples(self):
+    return len(self.timestamps)
+
+  def FinalizeImport(self):
+    if self.num_series * self.num_samples != len(self.samples):
+      raise ValueError(
+          'Length of samples must be a multiple of length of timestamps.')
+
+    self.totals = []
+    self.max_total = 0
+    if not len(self.samples):
+      return
+
+    max_total = None
+    for i in xrange(self.num_samples):
+      total = 0
+      for j in xrange(self.num_series):
+        total += self.samples[i * self.num_series + j]
+        self.totals.append(total)
+      if max_total is None or total > max_total:
+        max_total = total
+    self.max_total = max_total
diff --git a/tools/telemetry/telemetry/core/timeline/event.py b/tools/telemetry/telemetry/core/timeline/event.py
index 6b8d8db..8b9db4c 100644
--- a/tools/telemetry/telemetry/core/timeline/event.py
+++ b/tools/telemetry/telemetry/core/timeline/event.py
@@ -4,25 +4,17 @@
 
 class TimelineEvent(object):
   """Represents a timeline event."""
-  def __init__(self, name, start, duration, args=None, parent=None):
+  def __init__(self, category, name, start, duration, args=None):
+    self.category = category
     self.name = name
     self.start = start
     self.duration = duration
-    self.children = []
-    self.parent = parent
     self.args = args
 
   @property
   def end(self):
     return self.start + self.duration
 
-  @property
-  def self_time(self):
-    """Time spent in this function less any time spent in child events."""
-    child_total = sum(
-      [e.duration for e in self.children])
-    return self.duration - child_total
-
   def __repr__(self):
     if self.args:
       args_str = ', ' + repr(self.args)
@@ -34,39 +26,3 @@
       self.start,
       self.duration,
       args_str)
-
-  @staticmethod
-  def _GetAllChildrenRecursive(events, item):
-    events.append(item)
-    for child in item.children:
-      TimelineEvent._GetAllChildrenRecursive(events, child)
-
-  def GetAllChildrenRecursive(self, include_self=False):
-    events = []
-    TimelineEvent._GetAllChildrenRecursive(events, self)
-    if not include_self:
-      del events[0]
-    return events
-
-  def ShiftTimestampsForward(self, delta_time):
-    """ Shifts start time of event by delta_time and also
-    recursively shifts child events.
-    """
-    for event in self.children:
-      event.ShiftTimestampsForward(delta_time)
-    self.start += delta_time
-
-  def UpdateBounds(self):
-    """ Updates the start time to be the minimum start time of all
-    child events and the end time to be the maximum end time of all
-    child events.
-    """
-    if not len(self.children):
-      return
-
-    for event in self.children:
-      event.UpdateBounds()
-
-    self.start = min(self.children, key=lambda e: e.start).start
-    end_timestamp = max(self.children, key=lambda e: e.end).end
-    self.duration = end_timestamp - self.start
diff --git a/tools/telemetry/telemetry/core/timeline/event_container.py b/tools/telemetry/telemetry/core/timeline/event_container.py
new file mode 100644
index 0000000..d84cb29
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/event_container.py
@@ -0,0 +1,15 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class TimelineEventContainer(object):
+  """Represents a container for events."""
+  def __init__(self, name, parent):
+    self.parent = parent
+    self.name = name
+
+  def IterChildContainers(self):
+    raise NotImplementedError()
+
+  def IterEventsInThisContainer(self):
+    raise NotImplementedError()
diff --git a/tools/telemetry/telemetry/core/timeline/event_unittest.py b/tools/telemetry/telemetry/core/timeline/event_unittest.py
index 7c965f0..2c80c32 100644
--- a/tools/telemetry/telemetry/core/timeline/event_unittest.py
+++ b/tools/telemetry/telemetry/core/timeline/event_unittest.py
@@ -4,24 +4,5 @@
 
 import unittest
 
-from telemetry.core.timeline import event
-
 class TimelineEventTest(unittest.TestCase):
-  def testChildrenLogic(self):
-    # [      top          ]
-    #   [ a  ]    [  b  ]
-    #    [x]
-    top = event.TimelineEvent('top', 0, 10)
-    a = event.TimelineEvent('a', 1, 2)
-    x = event.TimelineEvent('x', 1.5, 0.25)
-    b = event.TimelineEvent('b', 5, 2)
-    top.children.extend([a, b])
-    a.children.append(x)
-
-    all_children = top.GetAllChildrenRecursive(include_self=True)
-    self.assertEquals([top, a, x, b], all_children)
-
-    self.assertEquals(x.self_time, 0.25)
-    self.assertEquals(a.self_time, 1.75) # 2 - 0.25
-    self.assertEquals(top.self_time, 6) # 10 - 2 -2
-
+  pass
diff --git a/tools/telemetry/telemetry/core/timeline/inspector_importer.py b/tools/telemetry/telemetry/core/timeline/inspector_importer.py
index ed9dad9..fa468cb 100644
--- a/tools/telemetry/telemetry/core/timeline/inspector_importer.py
+++ b/tools/telemetry/telemetry/core/timeline/inspector_importer.py
@@ -4,7 +4,7 @@
 '''Imports event data obtained from the inspector's timeline.'''
 
 from telemetry.core.timeline import importer
-import telemetry.core.timeline.event as timeline_event
+import telemetry.core.timeline.thread as timeline_thread
 
 class InspectorTimelineImporter(importer.TimelineImporter):
   def __init__(self, model, event_data):
@@ -22,34 +22,18 @@
     return False
 
   def ImportEvents(self):
+    render_process = self._model.GetOrCreateProcess(0)
+    render_thread = render_process.GetOrCreateThread(0)
     for raw_event in self._event_data:
-      event = self.RawEventToTimelineEvent(raw_event)
-      if event:
-        self._model.AddEvent(event)
+      InspectorTimelineImporter.AddRawEventToThreadRecursive(
+          render_thread, raw_event)
 
   def FinalizeImport(self):
     pass
 
   @staticmethod
-  def RawEventToTimelineEvent(raw_inspector_event):
-    """Converts raw_inspector_event to TimelineEvent."""
-    return InspectorTimelineImporter._RawEventToTimelineEventRecursive(
-      None, raw_inspector_event)
-
-  @staticmethod
-  def _RawEventToTimelineEventRecursive(
-    parent_for_created_events, raw_inspector_event):
-    """
-    Creates a new TimelineEvent for the raw_inspector_event, if possible, adding
-    it to the provided parent_for_created_events.
-
-    It then recurses on any child events found inside, building a tree of
-    TimelineEvents.
-
-    Returns the root of the created tree, or None.
-    """
-    # Create a TimelineEvent for this raw_inspector_event if possible. Only
-    # events with start-time and end-time get imported.
+  def AddRawEventToThreadRecursive(thread, raw_inspector_event):
+    did_begin_slice = False
     if ('startTime' in raw_inspector_event and
         'endTime' in raw_inspector_event):
       args = {}
@@ -59,24 +43,27 @@
         args[x] = raw_inspector_event[x]
       if len(args) == 0:
         args = None
-      newly_created_event = timeline_event.TimelineEvent(
-        name=raw_inspector_event['type'],
-        start=raw_inspector_event['startTime'],
-        duration=(raw_inspector_event['endTime'] -
-                     raw_inspector_event['startTime']),
-        args=args,
-        parent=parent_for_created_events)
-      if parent_for_created_events:
-        parent_for_created_events.children.append(newly_created_event)
-    else:
-      newly_created_event = None
+      thread.BeginSlice('inspector',
+                        raw_inspector_event['type'],
+                        raw_inspector_event['startTime'],
+                        args)
+      did_begin_slice = True
 
-    # Process any children events, creating TimelineEvents for them as well.
-    if newly_created_event:
-      parent_for_children = newly_created_event
-    else:
-      parent_for_children = parent_for_created_events
     for child in raw_inspector_event.get('children', []):
-      InspectorTimelineImporter._RawEventToTimelineEventRecursive(
-        parent_for_children, child)
-    return newly_created_event
+      InspectorTimelineImporter.AddRawEventToThreadRecursive(
+          thread, child)
+
+    if did_begin_slice:
+      thread.EndSlice(raw_inspector_event['endTime'])
+
+  @staticmethod
+  def RawEventToTimelineEvent(raw_inspector_event):
+    """Converts raw_inspector_event to TimelineEvent."""
+    thread = timeline_thread.Thread(None, 0)
+    InspectorTimelineImporter.AddRawEventToThreadRecursive(
+        thread, raw_inspector_event)
+    thread.FinalizeImport()
+    assert len(thread.toplevel_slices) <= 1
+    if len(thread.toplevel_slices) == 0:
+      return None
+    return thread.toplevel_slices[0]
diff --git a/tools/telemetry/telemetry/core/timeline/inspector_importer_unittest.py b/tools/telemetry/telemetry/core/timeline/inspector_importer_unittest.py
index 1f44f51..4a19f2e 100644
--- a/tools/telemetry/telemetry/core/timeline/inspector_importer_unittest.py
+++ b/tools/telemetry/telemetry/core/timeline/inspector_importer_unittest.py
@@ -50,7 +50,7 @@
         .RawEventToTimelineEvent(_SAMPLE_MESSAGE))
     self.assertTrue(root_event)
     decode_image_event = [
-      child for child in root_event.GetAllChildrenRecursive()
+      child for child in root_event.IterEventsInThisContainerRecrusively()
       if child.name == 'DecodeImage'][0]
     self.assertEquals(decode_image_event.args['data']['imageType'], 'PNG')
     self.assertTrue(decode_image_event.duration > 0)
@@ -66,7 +66,7 @@
     self.assertEquals(1, event.start)
     self.assertEquals(3, event.end)
     self.assertEquals(2, event.duration)
-    self.assertEquals([], event.children)
+    self.assertEquals([], event.sub_slices)
 
   def testParsingWithArgs(self):
     raw_event = {'type': 'Foo',
@@ -80,7 +80,7 @@
     self.assertEquals(1, event.start)
     self.assertEquals(3, event.end)
     self.assertEquals(2, event.duration)
-    self.assertEquals([], event.children)
+    self.assertEquals([], event.sub_slices)
     self.assertEquals(7, event.args['foo'])
     self.assertEquals(1, event.args['bar']['x'])
 
diff --git a/tools/telemetry/telemetry/core/timeline/model.py b/tools/telemetry/telemetry/core/timeline/model.py
index 1231af1..47606a9 100644
--- a/tools/telemetry/telemetry/core/timeline/model.py
+++ b/tools/telemetry/telemetry/core/timeline/model.py
@@ -7,9 +7,13 @@
 https://code.google.com/p/trace-viewer/
 '''
 
+import telemetry.core.timeline.process as tracing_process
+
 # Register importers for data
 from telemetry.core.timeline import inspector_importer
-from telemetry.core.timeline.tracing import trace_event_importer
+from telemetry.core.timeline import bounds
+from telemetry.core.timeline import trace_event_importer
+
 _IMPORTERS = [
     inspector_importer.InspectorTimelineImporter,
     trace_event_importer.TraceEventTimelineImporter
@@ -17,38 +21,22 @@
 
 class TimelineModel(object):
   def __init__(self, event_data=None, shift_world_to_zero=True):
-    self._root_events = []
-    self._all_events = []
+    self._bounds = bounds.Bounds()
+    self._processes = {}
     self._frozen = False
     self.import_errors = []
     self.metadata = []
-    self._bounds = None
 
     if event_data is not None:
       self.ImportTraces([event_data], shift_world_to_zero=shift_world_to_zero)
 
   @property
-  def min_timestamp(self):
-    if self._bounds is None:
-      self.UpdateBounds()
-    return self._bounds[0]
+  def bounds(self):
+    return self._bounds
 
   @property
-  def max_timestamp(self):
-    if self._bounds is None:
-      self.UpdateBounds()
-    return self._bounds[1]
-
-  def AddEvent(self, event):
-    if self._frozen:
-      raise Exception("Cannot add events once recording is done")
-    self._root_events.append(event)
-
-  def DidFinishRecording(self):
-    for event in self._root_events:
-      self._all_events.extend(
-        event.GetAllChildrenRecursive(include_self=True))
-    self._frozen = True
+  def processes(self):
+    return self._processes
 
   def ImportTraces(self, traces, shift_world_to_zero=True):
     if self._frozen:
@@ -64,44 +52,71 @@
       # TODO: catch exceptions here and add it to error list
       importer.ImportEvents()
 
+    self.UpdateBounds()
+    if not self.bounds.is_empty:
+      for process in self._processes.itervalues():
+        process.AutoCloseOpenSlices(self.bounds.max)
+
     for importer in importers:
       importer.FinalizeImport()
 
     if shift_world_to_zero:
       self.ShiftWorldToZero()
+    self.UpdateBounds()
 
     # Because of FinalizeImport, it would probably be a good idea
     # to prevent the timeline from from being modified.
-    self.DidFinishRecording()
+    self._frozen = True
 
   def ShiftWorldToZero(self):
-    if not len(self._root_events):
-      return
     self.UpdateBounds()
-    delta = min(self._root_events, key=lambda e: e.start).start
-    for event in self._root_events:
-      event.ShiftTimestampsForward(-delta)
+    if self._bounds.is_empty:
+      return
+    shift_amount = -self._bounds.min
+    for event in self.IterAllEvents():
+      event.start += shift_amount
 
   def UpdateBounds(self):
-    if not len(self._root_events):
-      self._bounds = (0, 0)
-      return
+    self._bounds.Reset()
+    for event in self.IterAllEvents():
+      self._bounds.AddValue(event.start)
+      self._bounds.AddValue(event.end)
 
-    for e in self._root_events:
-      e.UpdateBounds()
+  def GetAllContainers(self):
+    containers = []
+    def Iter(container):
+      containers.append(container)
+      for container in container.IterChildContainers():
+        Iter(container)
+    for process in self._processes.itervalues():
+      Iter(process)
+    return containers
 
-    first_event = min(self._root_events, key=lambda e: e.start)
-    last_event = max(self._root_events, key=lambda e: e.end)
-    self._bounds = (first_event.start, last_event.end)
+  def IterAllEvents(self):
+    for container in self.GetAllContainers():
+      for event in container.IterEventsInThisContainer():
+        yield event
 
-  def GetRootEvents(self):
-    return self._root_events
+  def GetAllProcesses(self):
+    return self._processes.values()
+
+  def GetAllThreads(self):
+    threads = []
+    for process in self._processes.values():
+      threads.extend(process.threads.values())
+    return threads
 
   def GetAllEvents(self):
-    return self._all_events
+    return list(self.IterAllEvents())
 
   def GetAllEventsOfName(self, name):
-    return [e for e in self._all_events if e.name == name]
+    return [e for e in self.IterAllEvents() if e.name == name]
+
+  def GetOrCreateProcess(self, pid):
+    if pid not in self._processes:
+      assert not self._frozen
+      self._processes[pid] = tracing_process.Process(self, pid)
+    return self._processes[pid]
 
   def _CreateImporter(self, event_data):
     for importer_class in _IMPORTERS:
diff --git a/tools/telemetry/telemetry/core/timeline/model_unittest.py b/tools/telemetry/telemetry/core/timeline/model_unittest.py
index 25fd0d3..e5a406d 100644
--- a/tools/telemetry/telemetry/core/timeline/model_unittest.py
+++ b/tools/telemetry/telemetry/core/timeline/model_unittest.py
@@ -4,15 +4,5 @@
 
 import unittest
 
-from telemetry.core.timeline.event import TimelineEvent
-from telemetry.core.timeline.model import TimelineModel
-
 class TimelineModelUnittest(unittest.TestCase):
-  def testTimelineEventsOfType(self):
-    timeline_model = TimelineModel()
-    a = TimelineEvent('a', 0, 10)
-    b = TimelineEvent('b', 11, 10)
-    timeline_model.AddEvent(a)
-    timeline_model.AddEvent(b)
-    timeline_model.DidFinishRecording()
-    self.assertEquals(1, len(timeline_model.GetAllEventsOfName('a')))
+  pass
diff --git a/tools/telemetry/telemetry/core/timeline/process.py b/tools/telemetry/telemetry/core/timeline/process.py
new file mode 100644
index 0000000..5a26619
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/process.py
@@ -0,0 +1,67 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import telemetry.core.timeline.event_container as event_container
+import telemetry.core.timeline.counter as tracing_counter
+import telemetry.core.timeline.thread as tracing_thread
+
+class Process(event_container.TimelineEventContainer):
+  ''' The Process represents a single userland process in the trace.
+  '''
+  def __init__(self, parent, pid):
+    super(Process, self).__init__('process %s' % pid, parent)
+    self.pid = pid
+    self._threads = {}
+    self._counters = {}
+
+  @property
+  def threads(self):
+    return self._threads
+
+  @property
+  def counters(self):
+    return self._counters
+
+  def IterChildContainers(self):
+    for thread in self._threads.itervalues():
+      yield thread
+    for counter in self._counters.itervalues():
+      yield counter
+
+  def IterEventsInThisContainer(self):
+    return
+    yield # pylint: disable=W0101
+
+  def GetOrCreateThread(self, tid):
+    thread = self.threads.get(tid, None)
+    if thread:
+      return thread
+    thread = tracing_thread.Thread(self, tid)
+    self._threads[tid] = thread
+    return thread
+
+  def GetCounter(self, category, name):
+    counter_id = category + '.' + name
+    if counter_id in self.counters:
+      return self.counters[counter_id]
+    raise ValueError(
+        'Counter %s not found in process with id %s.' % (counter_id,
+                                                         self.pid))
+  def GetOrCreateCounter(self, category, name):
+    try:
+      return self.GetCounter(category, name)
+    except ValueError:
+      ctr = tracing_counter.Counter(self, category, name)
+      self._counters[ctr.full_name] = ctr
+      return ctr
+
+  def AutoCloseOpenSlices(self, max_timestamp):
+    for thread in self._threads.itervalues():
+      thread.AutoCloseOpenSlices(max_timestamp)
+
+  def FinalizeImport(self):
+    for thread in self._threads.itervalues():
+      thread.FinalizeImport()
+    for counter in self._counters.itervalues():
+      counter.FinalizeImport()
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/sample.py b/tools/telemetry/telemetry/core/timeline/sample.py
similarity index 77%
rename from tools/telemetry/telemetry/core/timeline/tracing/sample.py
rename to tools/telemetry/telemetry/core/timeline/sample.py
index 5f7f672..36a3ab4 100644
--- a/tools/telemetry/telemetry/core/timeline/tracing/sample.py
+++ b/tools/telemetry/telemetry/core/timeline/sample.py
@@ -13,7 +13,7 @@
 
   All time units are stored in milliseconds.
   '''
-  def __init__(self, category, name, timestamp, args=None, parent=None):
+  def __init__(self, parent_thread, category, name, timestamp, args=None):
     super(Sample, self).__init__(
-        name, timestamp, 0, args=args, parent=parent)
-    self.category = category
+        category, name, timestamp, 0, args=args)
+    self.parent_thread = parent_thread
diff --git a/tools/telemetry/telemetry/core/timeline/slice.py b/tools/telemetry/telemetry/core/timeline/slice.py
new file mode 100644
index 0000000..5ce2b28
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/slice.py
@@ -0,0 +1,52 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import telemetry.core.timeline.event as timeline_event
+
+class Slice(timeline_event.TimelineEvent):
+  """A Slice represents an interval of time plus parameters associated
+  with that interval.
+
+  NOTE: The Sample class implements the same interface as
+  Slice. These must be kept in sync.
+
+  All time units are stored in milliseconds.
+  """
+  def __init__(self, parent_thread, category, name, timestamp,
+               args=None, duration=0):
+    super(Slice, self).__init__(
+        category, name, timestamp, duration, args=args)
+    self.parent_thread = parent_thread
+    self.parent_slice = None
+    self.sub_slices = []
+    self.did_not_finish = False
+
+  def AddSubSlice(self, sub_slice):
+    assert sub_slice.parent_slice == self
+    self.sub_slices.append(sub_slice)
+
+  def IterEventsInThisContainerRecrusively(self):
+    for sub_slice in self.sub_slices:
+      yield sub_slice
+      for sub_sub in sub_slice.IterEventsInThisContainerRecrusively():
+        yield sub_sub
+
+  @property
+  def self_time(self):
+    """Time spent in this function less any time spent in child events."""
+    child_total = sum(
+      [e.duration for e in self.sub_slices])
+    return self.duration - child_total
+
+  def _GetSubSlicesRecursive(self):
+    for sub_slice in self.sub_slices:
+      for s in sub_slice.GetAllSubSlices():
+        yield s
+      yield sub_slice
+
+  def GetAllSubSlices(self):
+    return list(self._GetSubSlicesRecursive())
+
+  def GetAllSubSlicesOfName(self, name):
+    return [e for e in self.GetAllSubSlices() if e.name == name]
diff --git a/tools/telemetry/telemetry/core/timeline/slice_unittest.py b/tools/telemetry/telemetry/core/timeline/slice_unittest.py
new file mode 100644
index 0000000..e2d6b82
--- /dev/null
+++ b/tools/telemetry/telemetry/core/timeline/slice_unittest.py
@@ -0,0 +1,26 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+from telemetry.core.timeline.slice import Slice
+
+class SliceTest(unittest.TestCase):
+  def testChildrenLogic(self):
+    # [      top          ]
+    #   [ a  ]    [  b  ]
+    #    [x]
+    top = Slice(None, 'cat', 'top', 0, duration=10)
+    a = Slice(None, 'cat', 'a', 1, duration=2)
+    x = Slice(None, 'cat', 'x', 1.5, duration=0.25)
+    b = Slice(None, 'cat', 'b', 5, duration=2)
+    top.sub_slices.extend([a, b])
+    a.sub_slices.append(x)
+
+    all_children = list(top.IterEventsInThisContainerRecrusively())
+    self.assertEquals([a, x, b], all_children)
+
+    self.assertEquals(x.self_time, 0.25)
+    self.assertEquals(a.self_time, 1.75) # 2 - 0.25
+    self.assertEquals(top.self_time, 6) # 10 - 2 -2
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/thread.py b/tools/telemetry/telemetry/core/timeline/thread.py
similarity index 73%
rename from tools/telemetry/telemetry/core/timeline/tracing/thread.py
rename to tools/telemetry/telemetry/core/timeline/thread.py
index 8bb184a..180532c 100644
--- a/tools/telemetry/telemetry/core/timeline/tracing/thread.py
+++ b/tools/telemetry/telemetry/core/timeline/thread.py
@@ -1,54 +1,82 @@
 # Copyright 2013 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
+import itertools
 
-import telemetry.core.timeline.event as timeline_event
-import telemetry.core.timeline.tracing.sample as tracing_sample
-import telemetry.core.timeline.tracing.slice as tracing_slice
+import telemetry.core.timeline.event_container as event_container
+import telemetry.core.timeline.sample as tracing_sample
+import telemetry.core.timeline.slice as tracing_slice
 
-class Thread(timeline_event.TimelineEvent):
+class Thread(event_container.TimelineEventContainer):
   ''' A Thread stores all the trace events collected for a particular
   thread. We organize the synchronous slices on a thread by "subrows," where
   subrow 0 has all the root slices, subrow 1 those nested 1 deep, and so on.
   The asynchronous slices are stored in an AsyncSliceGroup object.
   '''
   def __init__(self, process, tid):
-    super(Thread, self).__init__('thread %s' % tid, 0, 0, parent=process)
+    super(Thread, self).__init__('thread %s' % tid, parent=process)
     self.tid = tid
-    self._open_slices = []
     self._async_slices = []
     self._samples = []
-    self._slices = []
+    self._toplevel_slices = []
+
+    # State only valid during import.
+    self._open_slices = []
+    self._newly_added_slices = []
 
   @property
-  def slices(self):
-    return self._slices
+  def toplevel_slices(self):
+    return self._toplevel_slices
+
+  @property
+  def all_slices(self):
+    return list(self.IterAllSlices())
 
   @property
   def samples(self):
     return self._samples
 
   @property
+  def async_slices(self):
+    return self._async_slices
+
+  @property
   def open_slice_count(self):
     return len(self._open_slices)
 
-  @property
-  def async_slices(self):
-    return self._async_slices
+  def IterChildContainers(self):
+    return iter([])
+
+  def IterAllSlices(self):
+    for s in self._toplevel_slices:
+      yield s
+      for sub_slice in s.IterEventsInThisContainerRecrusively():
+        yield sub_slice
+  def IterAllAsyncSlices(self):
+    for async_slice in self._async_slices:
+      yield async_slice
+      for sub_slice in async_slice.IterEventsInThisContainerRecrusively():
+        yield sub_slice
+
+  def IterEventsInThisContainer(self):
+    return itertools.chain(
+      iter(self._open_slices),
+      iter(self._newly_added_slices),
+      self.IterAllAsyncSlices(),
+      self.IterAllSlices(),
+      iter(self._samples)
+      )
 
   def AddSample(self, category, name, timestamp, args=None):
     if len(self._samples) and timestamp < self._samples[-1].start:
       raise ValueError(
           'Samples must be added in increasing timestamp order')
-    sample = tracing_sample.Sample(
-        category, name, timestamp, args=args, parent=self)
+    sample = tracing_sample.Sample(self,
+        category, name, timestamp, args=args)
     self._samples.append(sample)
-    self.children.append(sample)
 
   def AddAsyncSlice(self, async_slice):
     self._async_slices.append(async_slice)
-    async_slice.parent = self
-    self.children.append(async_slice)
 
   def BeginSlice(self, category, name, timestamp, args=None):
     """Opens a new slice for the thread.
@@ -66,7 +94,7 @@
       raise ValueError(
           'Slices must be added in increasing timestamp order')
     self._open_slices.append(
-        tracing_slice.Slice(category, name, timestamp, args=args, parent=self))
+        tracing_slice.Slice(self, category, name, timestamp, args=args))
 
   def EndSlice(self, end_timestamp):
     """ Ends the last begun slice in this group and pushes it onto the slice
@@ -87,14 +115,10 @@
     return self.PushSlice(curr_slice)
 
   def PushSlice(self, new_slice):
-    self._slices.append(new_slice)
-    self.children.append(new_slice)
+    self._newly_added_slices.append(new_slice)
     return new_slice
 
-  def AutoCloseOpenSlices(self, max_timestamp=None):
-    if max_timestamp is None:
-      self.UpdateBounds()
-      max_timestamp = self.end
+  def AutoCloseOpenSlices(self, max_timestamp):
     while len(self._open_slices) > 0:
       curr_slice = self.EndSlice(max_timestamp)
       curr_slice.did_not_finish = True
@@ -104,16 +128,6 @@
       return True
     return timestamp >= self._open_slices[-1].start
 
-  def UpdateBounds(self):
-    super(Thread, self).UpdateBounds()
-
-    # Take open slices into account for the start and duration of thread event
-    if len(self._open_slices) > 0:
-      if not len(self.slices) or self.start > self._open_slices[0].start:
-        self.start = self._open_slices[0].start
-      if not len(self.slices) or self.end < self._open_slices[-1].start:
-        self.duration = self._open_slices[-1].start - self.start
-
   def FinalizeImport(self):
     self._BuildSliceSubRows()
 
@@ -155,14 +169,18 @@
         return cmp(s2.end, s1.end)
       return cmp(s1.start, s2.start)
 
-    if not len(self._slices):
+    assert len(self._toplevel_slices) == 0
+    if not len(self._newly_added_slices):
       return
 
-    sorted_slices = sorted(self._slices, cmp=CompareSlices)
+    sorted_slices = sorted(self._newly_added_slices, cmp=CompareSlices)
     root_slice = sorted_slices[0]
+    self._toplevel_slices.append(root_slice)
     for s in sorted_slices[1:]:
       if not self._AddSliceIfBounds(root_slice, s):
         root_slice = s
+        self._toplevel_slices.append(root_slice)
+    self._newly_added_slices = []
 
   def _AddSliceIfBounds(self, root, child):
     ''' Adds a child slice to a root slice its proper row.
@@ -177,6 +195,7 @@
       if len(root.sub_slices) > 0:
         if self._AddSliceIfBounds(root.sub_slices[-1], child):
           return True
+      child.parent_slice = root
       root.AddSubSlice(child)
       return True
     return False
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer.py b/tools/telemetry/telemetry/core/timeline/trace_event_importer.py
similarity index 94%
rename from tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer.py
rename to tools/telemetry/telemetry/core/timeline/trace_event_importer.py
index 636ac20..2b191d4 100644
--- a/tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer.py
+++ b/tools/telemetry/telemetry/core/timeline/trace_event_importer.py
@@ -12,15 +12,13 @@
 import re
 
 from telemetry.core.timeline import importer
-import telemetry.core.timeline.tracing.async_slice as tracing_async_slice
-import telemetry.core.timeline.tracing.process as tracing_process
+import telemetry.core.timeline.async_slice as tracing_async_slice
 
 class TraceEventTimelineImporter(importer.TimelineImporter):
   def __init__(self, model, event_data):
     super(TraceEventTimelineImporter, self).__init__(
         model, event_data, import_priority=1)
 
-    self._processes = {}
     self._events_were_from_string = False
     self._all_async_events = []
     self._all_object_events = []
@@ -83,9 +81,7 @@
     return False
 
   def _GetOrCreateProcess(self, pid):
-    if pid not in self._processes:
-      self._processes[pid] = tracing_process.Process(pid)
-    return self._processes[pid]
+    return self._model.GetOrCreateProcess(pid)
 
   def _DeepCopyIfNeeded(self, obj):
     if self._events_were_from_string:
@@ -236,23 +232,15 @@
   def FinalizeImport(self):
     '''Called by the Model after all other importers have imported their
     events.'''
-    # Add all top level process events to the model.
-    for process in self._processes.itervalues():
-      self._model.AddEvent(process)
     self._model.UpdateBounds()
 
-    # Autoclose all open slices
-    for process in self._processes.itervalues():
-      for thread in process.threads:
-        thread.AutoCloseOpenSlices(max_timestamp=self._model.max_timestamp)
-
     # We need to reupdate the bounds in case the minimum start time changes
     self._model.UpdateBounds()
     self._CreateAsyncSlices()
     self._CreateExplicitObjects()
     self._CreateImplicitObjects()
 
-    for process in self._processes.itervalues():
+    for process in self._model.processes.itervalues():
       process.FinalizeImport()
 
   def _CreateAsyncSlices(self):
@@ -312,8 +300,7 @@
           async_slice = tracing_async_slice.AsyncSlice(
               events[0]['event']['cat'],
               name,
-              events[0]['event']['ts'] / 1000.0,
-              parent=self)
+              events[0]['event']['ts'] / 1000.0)
 
           async_slice.duration = ((event['ts'] / 1000.0)
               - (events[0]['event']['ts'] / 1000.0))
@@ -332,6 +319,7 @@
                 events[0]['event']['cat'],
                 sub_name,
                 events[j - 1]['event']['ts'] / 1000.0)
+            sub_slice.parent_slice = async_slice
 
             sub_slice.duration = ((events[j]['event']['ts'] / 1000.0)
                 - (events[j - 1]['event']['ts'] / 1000.0))
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer_unittest.py b/tools/telemetry/telemetry/core/timeline/trace_event_importer_unittest.py
similarity index 83%
rename from tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer_unittest.py
rename to tools/telemetry/telemetry/core/timeline/trace_event_importer_unittest.py
index 52de6c5..1aa6a3b 100644
--- a/tools/telemetry/telemetry/core/timeline/tracing/trace_event_importer_unittest.py
+++ b/tools/telemetry/telemetry/core/timeline/trace_event_importer_unittest.py
@@ -5,11 +5,9 @@
 import json
 import unittest
 
-from telemetry.core.timeline.tracing import trace_event_importer
+from telemetry.core.timeline import trace_event_importer
 import telemetry.core.timeline.model as timeline_model
-import telemetry.core.timeline.tracing.counter as tracing_counter
-import telemetry.core.timeline.tracing.process as tracing_process
-import telemetry.core.timeline.tracing.thread as tracing_thread
+import telemetry.core.timeline.counter as tracing_counter
 
 def FindEventNamed(events, name):
   for event in events:
@@ -17,14 +15,6 @@
       return event
   raise ValueError('No event found with name %s' % name)
 
-def GetAllProcesses(model):
-  return [e for e in model.GetRootEvents() if isinstance(
-      e, tracing_process.Process)]
-
-def GetAllThreads(model):
-  return [e for e in model.GetAllEvents() if isinstance(
-      e, tracing_thread.Thread)]
-
 class TraceEventTimelineImporterTest(unittest.TestCase):
   def testCanImportEmpty(self):
     self.assertFalse(
@@ -45,28 +35,28 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
     self.assertEqual(52, p.pid)
 
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(53)
-    self.assertEqual(2, len(t.slices))
+    t = p.threads[53]
+    self.assertEqual(2, len(t.all_slices))
     self.assertEqual(53, t.tid)
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertAlmostEqual(0, slice_event.start)
     self.assertAlmostEqual((560 - 520) / 1000.0, slice_event.duration)
-    self.assertEqual(0, len(slice_event.children))
+    self.assertEqual(0, len(slice_event.sub_slices))
 
-    slice_event = t.slices[1]
+    slice_event = t.all_slices[1]
     self.assertEqual('b', slice_event.name)
     self.assertEqual('bar', slice_event.category)
     self.assertAlmostEqual((629 - 520) / 1000.0, slice_event.start)
     self.assertAlmostEqual((631 - 629) / 1000.0, slice_event.duration)
-    self.assertEqual(0, len(slice_event.children))
+    self.assertEqual(0, len(slice_event.sub_slices))
 
   def testArgumentDupeCreatesNonFailingImportError(self):
     events = [
@@ -77,9 +67,9 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
-    t = processes[0].GetThreadWithId(1)
-    slice_a = FindEventNamed(t.slices, 'a')
+    processes = m.GetAllProcesses()
+    t = processes[0].threads[1]
+    slice_a = FindEventNamed(t.all_slices, 'a')
 
     self.assertEqual(2, slice_a.args['x'])
     self.assertEqual(1, len(m.import_errors))
@@ -93,16 +83,16 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
     self.assertEqual(52, p.pid)
 
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(53)
-    self.assertEqual(1, len(t.slices))
+    t = p.threads[53]
+    self.assertEqual(1, len(t.all_slices))
     self.assertEqual(53, t.tid)
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
 
@@ -119,10 +109,10 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    t = GetAllProcesses(m)[0].GetThreadWithId(1)
+    t = m.GetAllProcesses()[0].threads[1]
 
-    slice_a = FindEventNamed(t.slices, 'a')
-    slice_b = FindEventNamed(t.slices, 'b')
+    slice_a = FindEventNamed(t.all_slices, 'a')
+    slice_b = FindEventNamed(t.all_slices, 'b')
 
     self.assertEqual('a', slice_a.name)
     self.assertEqual('foo', slice_a.category)
@@ -147,9 +137,9 @@
        'tid': 2, 'ph': 'E'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(1)
-    slice_event = t.slices[0]
+    p = m.GetAllProcesses()[0]
+    t = p.threads[1]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertTrue(slice_event.did_not_finish)
@@ -163,9 +153,9 @@
        'tid': 1, 'ph': 'B'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(1)
-    slice_event = t.slices[0]
+    p = m.GetAllProcesses()[0]
+    t = p.threads[1]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertTrue(slice_event.did_not_finish)
@@ -185,11 +175,11 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    t = GetAllProcesses(m)[0].GetThreadWithId(1)
+    t = m.GetAllProcesses()[0].threads[1]
 
-    slice_a = FindEventNamed(t.slices, 'a')
-    slice_b1 = FindEventNamed(t.slices, 'b1')
-    slice_b2 = FindEventNamed(t.slices, 'b2')
+    slice_a = FindEventNamed(t.all_slices, 'a')
+    slice_b1 = FindEventNamed(t.all_slices, 'b1')
+    slice_b2 = FindEventNamed(t.all_slices, 'b2')
 
     self.assertAlmostEqual(0.003, slice_a.end)
     self.assertAlmostEqual(0.003, slice_b1.end)
@@ -211,28 +201,25 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(1)
-    self.assertEqual(2, len(t.slices))
+    p = m.GetAllProcesses()[0]
+    t = p.threads[1]
+    self.assertEqual(2, len(t.all_slices))
 
-    slice_event = FindEventNamed(t.slices, 'a')
+    slice_event = FindEventNamed(t.all_slices, 'a')
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertAlmostEqual(0, slice_event.start)
     self.assertAlmostEqual(0.003, slice_event.duration)
 
-    t2 = p.GetThreadWithId(2)
-    slice2 = FindEventNamed(t2.slices, 'c')
+    t2 = p.threads[2]
+    slice2 = FindEventNamed(t2.all_slices, 'c')
     self.assertEqual('c', slice2.name)
     self.assertEqual('bar', slice2.category)
     self.assertAlmostEqual(0.001, slice2.start)
     self.assertAlmostEqual(0.001, slice2.duration)
 
-    self.assertAlmostEqual(0.000, p.start)
-    self.assertAlmostEqual(0.003, p.end)
-
-    self.assertAlmostEqual(0.000, m.min_timestamp)
-    self.assertAlmostEqual(0.003, m.max_timestamp)
+    self.assertAlmostEqual(0.000, m.bounds.min)
+    self.assertAlmostEqual(0.003, m.bounds.max)
 
   def testNestedAutoclosing(self):
     events = [
@@ -250,12 +237,12 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    t1 = GetAllProcesses(m)[0].GetThreadWithId(1)
-    t2 = GetAllProcesses(m)[0].GetThreadWithId(2)
+    t1 = m.GetAllProcesses()[0].threads[1]
+    t2 = m.GetAllProcesses()[0].threads[2]
 
-    slice_a1 = FindEventNamed(t1.slices, 'a1')
-    slice_a2 = FindEventNamed(t1.slices, 'a2')
-    FindEventNamed(t2.slices, 'b')
+    slice_a1 = FindEventNamed(t1.all_slices, 'a1')
+    slice_a2 = FindEventNamed(t1.all_slices, 'a2')
+    FindEventNamed(t2.all_slices, 'b')
 
     self.assertAlmostEqual(0.002, slice_a1.end)
     self.assertAlmostEqual(0.002, slice_a2.end)
@@ -272,29 +259,29 @@
        'tid': 2, 'ph': 'E'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
 
     self.assertEqual(2, len(p.threads))
 
     # Check thread 1.
-    t = p.GetThreadWithId(1)
-    self.assertAlmostEqual(1, len(t.slices))
+    t = p.threads[1]
+    self.assertAlmostEqual(1, len(t.all_slices))
     self.assertAlmostEqual(1, t.tid)
 
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertAlmostEqual(0, slice_event.start)
     self.assertAlmostEqual((2 - 1) / 1000.0, slice_event.duration)
 
     # Check thread 2.
-    t = p.GetThreadWithId(2)
-    self.assertAlmostEqual(1, len(t.slices))
+    t = p.threads[2]
+    self.assertAlmostEqual(1, len(t.all_slices))
     self.assertAlmostEqual(2, t.tid)
 
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('b', slice_event.name)
     self.assertEqual('bar', slice_event.category)
     self.assertAlmostEqual((3 - 1) / 1000.0, slice_event.start)
@@ -313,7 +300,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(2, len(processes))
 
     p = processes[0]
@@ -321,11 +308,11 @@
     self.assertEqual(1, len(p.threads))
 
     # Check process 1 thread 1.
-    t = p.GetThreadWithId(1)
-    self.assertEqual(1, len(t.slices))
+    t = p.threads[1]
+    self.assertEqual(1, len(t.all_slices))
     self.assertEqual(1, t.tid)
 
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertAlmostEqual(0, slice_event.start)
@@ -336,20 +323,20 @@
     p = processes[1]
     self.assertEqual(2, p.pid)
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(2)
-    self.assertEqual(1, len(t.slices))
+    t = p.threads[2]
+    self.assertEqual(1, len(t.all_slices))
     self.assertEqual(2, t.tid)
 
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('b', slice_event.name)
     self.assertEqual('bar', slice_event.category)
     self.assertAlmostEqual((3 - 1) / 1000.0, slice_event.start)
     self.assertAlmostEqual((4 - 3) / 1000.0, slice_event.duration)
 
     # Check getAllThreads.
-    self.assertEqual([processes[0].GetThreadWithId(1),
-                      processes[1].GetThreadWithId(2)],
-                      GetAllThreads(m))
+    self.assertEqual([processes[0].threads[1],
+                      processes[1].threads[2]],
+                      m.GetAllThreads())
 
   def testThreadNames(self):
     events = [
@@ -367,9 +354,9 @@
         'pid': 2, 'ts': 0, 'tid': 2, 'ph': 'M'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
-    self.assertEqual('Thread 1', processes[0].GetThreadWithId(1).name)
-    self.assertEqual('Thread 2', processes[1].GetThreadWithId(2).name)
+    processes = m.GetAllProcesses()
+    self.assertEqual('Thread 1', processes[0].threads[1].name)
+    self.assertEqual('Thread 2', processes[1].threads[2].name)
 
   def testParsingWhenEndComesFirst(self):
     events = [
@@ -382,13 +369,13 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(1)
-    self.assertEqual(1, len(t.slices))
-    self.assertEqual('a', t.slices[0].name)
-    self.assertEqual('foo', t.slices[0].category)
-    self.assertEqual(0.004, t.slices[0].start)
-    self.assertEqual(0.001, t.slices[0].duration)
+    p = m.GetAllProcesses()[0]
+    t = p.threads[1]
+    self.assertEqual(1, len(t.all_slices))
+    self.assertEqual('a', t.all_slices[0].name)
+    self.assertEqual('foo', t.all_slices[0].category)
+    self.assertEqual(0.004, t.all_slices[0].start)
+    self.assertEqual(0.001, t.all_slices[0].duration)
     self.assertEqual(1, len(m.import_errors))
 
   def testImmediateParsing(self):
@@ -406,27 +393,30 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(1)
-    self.assertEqual(3, len(t.slices))
-    self.assertAlmostEqual(0.002, t.slices[0].start)
-    self.assertAlmostEqual(0, t.slices[0].duration)
-    self.assertAlmostEqual(0.004, t.slices[1].start)
-    self.assertAlmostEqual(0.001, t.slices[2].start)
-    self.assertAlmostEqual(0.003, t.slices[2].duration)
+    p = m.GetAllProcesses()[0]
+    t = p.threads[1]
+    self.assertEqual(3, len(t.all_slices))
 
-    slice_event = FindEventNamed(t.slices, 'a')
-    self.assertEqual('a', slice_event.name)
-    self.assertEqual('foo', slice_event.category)
-    self.assertEqual(0.003, slice_event.duration)
+    i = m.GetAllEventsOfName('immediate')[0]
+    self.assertAlmostEqual(0.002, i.start)
+    self.assertAlmostEqual(0, i.duration)
 
-    immed = FindEventNamed(t.slices, 'immediate')
-    self.assertEqual('immediate', immed.name)
-    self.assertEqual('bar', immed.category)
-    self.assertAlmostEqual(0.002, immed.start)
-    self.assertAlmostEqual(0, immed.duration)
+    slower = m.GetAllEventsOfName('slower')[0]
+    self.assertAlmostEqual(0.004, slower.start)
 
-    slower = FindEventNamed(t.slices, 'slower')
+    a = m.GetAllEventsOfName('a')[0]
+    self.assertAlmostEqual(0.001, a.start)
+    self.assertAlmostEqual(0.003, a.duration)
+
+    self.assertEqual('a', a.name)
+    self.assertEqual('foo', a.category)
+    self.assertEqual(0.003, a.duration)
+
+    self.assertEqual('immediate', i.name)
+    self.assertEqual('bar', i.category)
+    self.assertAlmostEqual(0.002, i.start)
+    self.assertAlmostEqual(0, i.duration)
+
     self.assertEqual('slower', slower.name)
     self.assertEqual('baz', slower.category)
     self.assertAlmostEqual(0.004, slower.start)
@@ -442,7 +432,7 @@
        'tid': 1, 'ph': 'C'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
+    p = m.GetAllProcesses()[0]
     ctr = p.counters['foo.ctr']
 
     self.assertEqual('ctr', ctr.name)
@@ -478,7 +468,7 @@
        'ph': 'C', 'id': 2}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
+    p = m.GetAllProcesses()[0]
     ctr = p.counters['foo.ctr[0]']
     self.assertEqual('ctr[0]', ctr.name)
     self.assertEqual('foo', ctr.category)
@@ -487,7 +477,7 @@
     self.assertEqual([0, 0.01], ctr.timestamps)
     self.assertEqual([0, 10], ctr.samples)
 
-    ctr = GetAllProcesses(m)[0].counters['foo.ctr[1]']
+    ctr = m.GetAllProcesses()[0].counters['foo.ctr[1]']
     self.assertEqual('ctr[1]', ctr.name)
     self.assertEqual('foo', ctr.category)
     self.assertEqual(3, ctr.num_samples)
@@ -495,7 +485,7 @@
     self.assertEqual([0.01, 0.015, 0.018], ctr.timestamps)
     self.assertEqual([10, 20, 30], ctr.samples)
 
-    ctr = GetAllProcesses(m)[0].counters['bar.ctr[2]']
+    ctr = m.GetAllProcesses()[0].counters['bar.ctr[2]']
     self.assertEqual('ctr[2]', ctr.name)
     self.assertEqual('bar', ctr.category)
     self.assertEqual(1, ctr.num_samples)
@@ -516,9 +506,7 @@
                    1, 7,
                    3, 0,
                    3.1, 0.5]
-    ctr.UpdateBounds()
-    self.assertEqual(0, ctr.min_timestamp)
-    self.assertEqual(7, ctr.max_timestamp)
+    ctr.FinalizeImport()
     self.assertEqual(8, ctr.max_total)
     self.assertEqual([0, 0,
                        1, 1,
@@ -539,7 +527,7 @@
        'cat': 'foo', 'tid': 1, 'ph': 'C'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
+    p = m.GetAllProcesses()[0]
     ctr = p.counters['foo.ctr']
     self.assertEqual('ctr', ctr.name)
 
@@ -564,7 +552,7 @@
     ] }
 
     m = timeline_model.TimelineModel(event_data=events)
-    self.assertEqual(1, len(GetAllProcesses(m)))
+    self.assertEqual(1, len(m.GetAllProcesses()))
 
   def testImportString(self):
     events = [
@@ -575,7 +563,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=json.dumps(events))
-    self.assertEqual(1, len(GetAllProcesses(m)))
+    self.assertEqual(1, len(m.GetAllProcesses()))
 
   def testImportStringWithTrailingNewLine(self):
     events = [
@@ -586,7 +574,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=json.dumps(events) + '\n')
-    self.assertEqual(1, len(GetAllProcesses(m)))
+    self.assertEqual(1, len(m.GetAllProcesses()))
 
   def testImportStringWithMissingCloseSquareBracket(self):
     events = [
@@ -602,7 +590,7 @@
     # Drop off the trailing ]
     dropped = tmp[:-1]
     m = timeline_model.TimelineModel(event_data=dropped)
-    self.assertEqual(1, len(GetAllProcesses(m)))
+    self.assertEqual(1, len(m.GetAllProcesses()))
 
   def testImportStringWithEndingCommaButMissingCloseSquareBracket(self):
     lines = [
@@ -615,9 +603,9 @@
     text = '\n'.join(lines)
 
     m = timeline_model.TimelineModel(event_data=text)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
-    self.assertEqual(1, len(processes[0].GetThreadWithId(53).slices))
+    self.assertEqual(1, len(processes[0].threads[53].all_slices))
 
   def testImportStringWithMissingCloseSquareBracketAndNewline(self):
     events = [
@@ -633,7 +621,7 @@
     # Drop off the trailing ] and add a newline
     dropped = tmp[:-1]
     m = timeline_model.TimelineModel(event_data=dropped + '\n')
-    self.assertEqual(1, len(GetAllProcesses(m)))
+    self.assertEqual(1, len(m.GetAllProcesses()))
 
   def testImportStringWithEndingCommaButMissingCloseSquareBracketCRLF(self):
     lines = [
@@ -646,9 +634,9 @@
     text = '\r\n'.join(lines)
 
     m = timeline_model.TimelineModel(event_data=text)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
-    self.assertEqual(1, len(processes[0].GetThreadWithId(53).slices))
+    self.assertEqual(1, len(processes[0].threads[53].all_slices))
 
   def testImportOldFormat(self):
     lines = [
@@ -659,9 +647,9 @@
       ]
     text = '\n'.join(lines)
     m = timeline_model.TimelineModel(event_data=text)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
-    self.assertEqual(1, len(processes[0].GetThreadWithId(8).slices))
+    self.assertEqual(1, len(processes[0].threads[8].all_slices))
 
   def testStartFinishOneSliceOneThread(self):
     events = [
@@ -675,8 +663,11 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
-    t = processes[0].GetThreadWithId(53)
+
+    self.assertEqual(2, len(m.GetAllEvents()))
+
+    processes = m.GetAllProcesses()
+    t = processes[0].threads[53]
     slices = t.async_slices
     self.assertEqual(1, len(slices))
     self.assertEqual('a', slices[0].name)
@@ -697,15 +688,15 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
 
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(53)
-    self.assertEqual(1, len(t.slices))
+    t = p.threads[53]
+    self.assertEqual(1, len(t.all_slices))
     self.assertEqual(53, t.tid)
-    slice_event = t.slices[0]
+    slice_event = t.all_slices[0]
     self.assertEqual('a', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertEqual(0, slice_event.start)
@@ -721,13 +712,13 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
 
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(53)
-    slice_event = t.slices[0]
+    t = p.threads[53]
+    slice_event = t.all_slices[0]
     self.assertEqual('b', slice_event.name)
     self.assertEqual('foo', slice_event.category)
     self.assertEqual(0, slice_event.start)
@@ -763,14 +754,14 @@
     ]
     m = timeline_model.TimelineModel(event_data=events,
                                      shift_world_to_zero=False)
-    processes = GetAllProcesses(m)
+    processes = m.GetAllProcesses()
     self.assertEqual(1, len(processes))
     p = processes[0]
 
     self.assertEqual(1, len(p.threads))
-    t = p.GetThreadWithId(53)
+    t = p.threads[53]
 
-    slice_a = t.slices[0]
+    slice_a = t.all_slices[0]
     self.assertEqual(4, len(slice_a.GetAllSubSlices()))
     self.assertEqual('a', slice_a.name)
     self.assertEqual(100 / 1000.0, slice_a.start)
@@ -799,7 +790,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    t = GetAllProcesses(m)[0].GetThreadWithId(53)
+    t = m.GetAllProcesses()[0].threads[53]
     self.assertEqual(1, len(t.async_slices))
     parent_slice = t.async_slices[0]
     self.assertEqual('c', parent_slice.name)
@@ -822,7 +813,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    t = GetAllProcesses(m)[0].GetThreadWithId(53)
+    t = m.GetAllProcesses()[0].threads[53]
     self.assertEqual(1, len(t.async_slices))
     parent_slice = t.async_slices[0]
     self.assertEqual('d', parent_slice.name)
@@ -844,7 +835,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    t = GetAllProcesses(m)[0].GetThreadWithId(53)
+    t = m.GetAllProcesses()[0].threads[53]
     self.assertEqual(1, len(t.async_slices))
     parent_slice = t.async_slices[0]
     self.assertEqual('a', parent_slice.name)
@@ -877,7 +868,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    t = GetAllProcesses(m)[0].GetThreadWithId(53)
+    t = m.GetAllProcesses()[0].threads[53]
     self.assertTrue(t is not None)
 
   def testAsyncStepsMissingFinish(self):
@@ -890,7 +881,7 @@
     ]
 
     m = timeline_model.TimelineModel(event_data=events)
-    t = GetAllProcesses(m)[0].GetThreadWithId(53)
+    t = m.GetAllProcesses()[0].threads[53]
     self.assertTrue(t is not None)
 
   def testImportSamples(self):
@@ -903,8 +894,8 @@
        'tid': 53, 'ph': 'P'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(53)
+    p = m.GetAllProcesses()[0]
+    t = p.threads[53]
     self.assertEqual(3, len(t.samples))
     self.assertEqual(0.0, t.samples[0].start)
     self.assertEqual(0.0, t.samples[1].start)
@@ -924,7 +915,7 @@
        'tid': 53, 'ph': 'P'}
     ]
     m = timeline_model.TimelineModel(event_data=events)
-    p = GetAllProcesses(m)[0]
-    t = p.GetThreadWithId(53)
+    p = m.GetAllProcesses()[0]
+    t = p.threads[53]
     self.assertEqual(3, len(t.samples))
     self.assertEqual(0, len(m.import_errors))
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/__init__.py b/tools/telemetry/telemetry/core/timeline/tracing/__init__.py
deleted file mode 100644
index 9228df8..0000000
--- a/tools/telemetry/telemetry/core/timeline/tracing/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py b/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
deleted file mode 100644
index 03031c1..0000000
--- a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import telemetry.core.timeline.tracing.slice as tracing_slice
-
-class AsyncSlice(tracing_slice.Slice):
-  ''' A AsyncSlice represents an interval of time during which an
-  asynchronous operation is in progress. An AsyncSlice consumes no CPU time
-  itself and so is only associated with Threads at its start and end point.
-  '''
-  def __init__(self, category, name, timestamp, args=None, parent=None):
-    super(AsyncSlice, self).__init__(
-        category, name, timestamp, args=args, parent=parent)
-    self.start_thread = None
-    self.end_thread = None
-    self.id = None
-
-  def AddSubSlice(self, sub_slice):
-    super(AsyncSlice, self).AddSubSlice(sub_slice)
-    self.children.append(sub_slice)
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/counter.py b/tools/telemetry/telemetry/core/timeline/tracing/counter.py
deleted file mode 100644
index 33f5e86..0000000
--- a/tools/telemetry/telemetry/core/timeline/tracing/counter.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-class Counter(object):
-  ''' Stores all the samples for a given counter.
-  '''
-  def __init__(self, parent, category, name):
-    self.parent = parent
-    self.full_name  = category + '.' + name
-    self.category = category
-    self.name = name
-    self.samples = []
-    self.timestamps = []
-    self.series_names = []
-    self.totals = []
-    self.max_total = 0
-    self._bounds = None
-
-  @property
-  def min_timestamp(self):
-    if not self._bounds:
-      self.UpdateBounds()
-    return self._bounds[0]
-
-  @property
-  def max_timestamp(self):
-    if not self._bounds:
-      self.UpdateBounds()
-    return self._bounds[1]
-
-  @property
-  def num_series(self):
-    return len(self.series_names)
-
-  @property
-  def num_samples(self):
-    return len(self.timestamps)
-
-  def UpdateBounds(self):
-    if self.num_series * self.num_samples != len(self.samples):
-      raise ValueError(
-          'Length of samples must be a multiple of length of timestamps.')
-
-    self.totals = []
-    self.max_total = 0
-    if not len(self.samples):
-      return
-
-    self._bounds = (self.timestamps[0], self.timestamps[-1])
-
-    max_total = None
-    for i in xrange(self.num_samples):
-      total = 0
-      for j in xrange(self.num_series):
-        total += self.samples[i * self.num_series + j]
-        self.totals.append(total)
-      if max_total is None or total > max_total:
-        max_total = total
-    self.max_total = max_total
-
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/process.py b/tools/telemetry/telemetry/core/timeline/tracing/process.py
deleted file mode 100644
index d25c3af..0000000
--- a/tools/telemetry/telemetry/core/timeline/tracing/process.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import telemetry.core.timeline.event as timeline_event
-import telemetry.core.timeline.tracing.counter as tracing_counter
-import telemetry.core.timeline.tracing.thread as tracing_thread
-
-class Process(timeline_event.TimelineEvent):
-  ''' The Process represents a single userland process in the trace.
-  '''
-  def __init__(self, pid):
-    super(Process, self).__init__('process %s' % pid, 0, 0)
-    self.pid = pid
-    self._threads = []
-    self._counters = {}
-
-  @property
-  def threads(self):
-    return self._threads
-
-  @property
-  def counters(self):
-    return self._counters
-
-  def GetThreadWithId(self, tid):
-    for t in self.threads:
-      if t.tid == tid:
-        return t
-    raise ValueError(
-        'Thread with id %s not found in process with id %s.' % (tid, self.pid))
-
-  def GetOrCreateThread(self, tid):
-    try:
-      return self.GetThreadWithId(tid)
-    except ValueError:
-      thread = tracing_thread.Thread(self, tid)
-      self.children.append(thread)
-      self._threads.append(thread)
-      return thread
-
-  def GetCounter(self, category, name):
-    counter_id = category + '.' + name
-    if counter_id in self.counters:
-      return self.counters[counter_id]
-    raise ValueError(
-        'Counter %s not found in process with id %s.' % (counter_id,
-                                                         self.pid))
-  def GetOrCreateCounter(self, category, name):
-    try:
-      return self.GetCounter(category, name)
-    except ValueError:
-      ctr = tracing_counter.Counter(self, category, name)
-      self._counters[ctr.full_name] = ctr
-      return ctr
-
-  def UpdateBounds(self):
-    super(Process, self).UpdateBounds()
-    for ctr in self.counters.itervalues():
-      ctr.UpdateBounds()
-
-  def FinalizeImport(self):
-    for thread in self._threads:
-      thread.FinalizeImport()
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/slice.py b/tools/telemetry/telemetry/core/timeline/tracing/slice.py
deleted file mode 100644
index 178b33a..0000000
--- a/tools/telemetry/telemetry/core/timeline/tracing/slice.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import telemetry.core.timeline.event as timeline_event
-
-class Slice(timeline_event.TimelineEvent):
-  ''' A Slice represents an interval of time plus parameters associated
-  with that interval.
-
-  NOTE: The Sample class implements the same interface as
-  Slice. These must be kept in sync.
-
-  All time units are stored in milliseconds.
-  '''
-  def __init__(self, category, name, timestamp, args=None, parent=None):
-    super(Slice, self).__init__(
-        name, timestamp, 0, args=args, parent=parent)
-    self._sub_slices = []
-    self.category = category
-    self.did_not_finish = False
-
-  @property
-  def sub_slices(self):
-    return self._sub_slices
-
-  def AddSubSlice(self, sub_slice):
-    self._sub_slices.append(sub_slice)
-
-  def _GetSubSlicesRecursive(self):
-    for sub_slice in self._sub_slices:
-      for s in sub_slice.GetAllSubSlices():
-        yield s
-      yield sub_slice
-
-  def GetAllSubSlices(self):
-    return list(self._GetSubSlicesRecursive())
-
-  def GetAllSubSlicesOfName(self, name):
-    return [e for e in self.GetAllSubSlices() if e.name == name]
diff --git a/tools/telemetry/telemetry/page/actions/media_action.js b/tools/telemetry/telemetry/page/actions/media_action.js
new file mode 100644
index 0000000..96f6ffa
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/media_action.js
@@ -0,0 +1,38 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file provides common functions for media actions.
+window.__findMediaElements = function(selector) {
+  // Returns elements matching the selector, otherwise returns the first video
+  // or audio tag element that can be found.
+  // If selector == 'all', returns all media elements.
+  if (selector == 'all') {
+    return document.querySelectorAll('video, audio');
+  } else if (selector) {
+    return document.querySelectorAll(selector);
+  } else {
+    var media = document.getElementsByTagName('video');
+    if (media.length > 0) {
+      return [media[0]];
+    } else {
+      media = document.getElementsByTagName('audio');
+      if (media.length > 0) {
+        return [media[0]];
+      }
+    }
+  }
+  console.error('Could not find any media elements matching: ' + selector);
+  return [];
+};
+
+window.__hasEventCompleted = function(selector, event_name) {
+  // Return true if the event_name fired for media satisfying the selector.
+  var mediaElements = window.__findMediaElements(selector);
+  for (var i = 0; i < mediaElements.length; i++) {
+    if (!mediaElements[i][event_name + '_completed'])
+      return false;
+  }
+  return true;
+};
diff --git a/tools/telemetry/telemetry/page/actions/media_action.py b/tools/telemetry/telemetry/page/actions/media_action.py
new file mode 100644
index 0000000..7f3829b
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/media_action.py
@@ -0,0 +1,46 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Common media action functions."""
+
+import os
+
+from telemetry.core import util
+from telemetry.page.actions import page_action
+
+
+class MediaAction(page_action.PageAction):
+  def __init__(self, attributes=None):
+    super(MediaAction, self).__init__(attributes)
+
+  def WillRunAction(self, page, tab):
+    """Loads the common media action JS code prior to running the action."""
+    self.LoadJS(tab, 'media_action.js')
+
+  def RunAction(self, page, tab, previous_action):
+    super(MediaAction, self).RunAction(page, tab, previous_action)
+
+  def LoadJS(self, tab, js_file_name):
+    """Loads and executes a JS file in the tab."""
+    with open(os.path.join(os.path.dirname(__file__), js_file_name)) as f:
+      js = f.read()
+      tab.ExecuteJavaScript(js)
+
+  def WaitForEvent(self, tab, selector, event_name, timeout,
+                   poll_interval=0.5):
+    """Halts media action until the selector's event is fired.
+
+    Args:
+      tab: The tab to check for event on.
+      selector: Media element selector.
+      event_name: Name of the event to check if fired or not.
+      timeout: Timeout to check for event, throws an exception if not fired.
+      poll_interval: Interval to poll for event firing status.
+    """
+    util.WaitFor(lambda: self.HasEventCompleted(tab, selector, event_name),
+                 timeout=timeout, poll_interval=poll_interval)
+
+  def HasEventCompleted(self, tab, selector, event_name):
+    return tab.EvaluateJavaScript(
+        'window.__hasEventCompleted("%s", "%s");' % (selector, event_name))
\ No newline at end of file
diff --git a/tools/telemetry/telemetry/page/actions/play.js b/tools/telemetry/telemetry/page/actions/play.js
index eb17424..ef3cb1b 100644
--- a/tools/telemetry/telemetry/page/actions/play.js
+++ b/tools/telemetry/telemetry/page/actions/play.js
@@ -4,32 +4,9 @@
 
 // This file performs actions on media elements.
 (function() {
-  function findMediaElements(selector) {
-    // Returns elements matching the selector, otherwise returns the first video
-    // or audio tag element that can be found.
-    // If selector == 'all', returns all media elements.
-    if (selector == 'all') {
-      return document.querySelectorAll('video, audio');
-    } else if (selector) {
-      return document.querySelectorAll(selector);
-    } else {
-      var media = document.getElementsByTagName('video');
-      if (media.length > 0) {
-        return [media[0]];
-      } else {
-        media = document.getElementsByTagName('audio');
-        if (media.length > 0) {
-          return [media[0]];
-        }
-      }
-    }
-    console.error('Could not find any media elements matching: ' + selector);
-    return [];
-  }
-
   function playMedia(selector) {
     // Performs the "Play" action on media satisfying selector.
-    var mediaElements = findMediaElements(selector);
+    var mediaElements = window.__findMediaElements(selector);
     for (var i = 0; i < mediaElements.length; i++) {
       console.log('Playing element: ' + mediaElements[i].src);
       play(mediaElements[i]);
@@ -61,16 +38,5 @@
     element.play();
   }
 
-  function hasEventCompleted(selector, event_name) {
-    // Return true if the event_name fired for media satisfying the selector.
-    var mediaElements = findMediaElements(selector);
-    for (var i = 0; i < mediaElements.length; i++) {
-      if (!mediaElements[i][event_name + '_completed'])
-        return false;
-    }
-    return true;
-  }
-
   window.__playMedia = playMedia;
-  window.__hasEventCompleted = hasEventCompleted;
 })();
diff --git a/tools/telemetry/telemetry/page/actions/play.py b/tools/telemetry/telemetry/page/actions/play.py
index 26b657f..3f67371 100644
--- a/tools/telemetry/telemetry/page/actions/play.py
+++ b/tools/telemetry/telemetry/page/actions/play.py
@@ -1,4 +1,4 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
@@ -12,27 +12,24 @@
 the action to wait until playing and ended events get fired respectively.
 """
 
-import os
-
+from telemetry.page.actions.media_action import MediaAction
 from telemetry.core import exceptions
-from telemetry.core import util
 from telemetry.page.actions import page_action
 
 
-class PlayAction(page_action.PageAction):
+class PlayAction(MediaAction):
   def __init__(self, attributes=None):
     super(PlayAction, self).__init__(attributes)
 
   def WillRunAction(self, page, tab):
     """Load the media metrics JS code prior to running the action."""
-    with open(os.path.join(os.path.dirname(__file__), 'play.js')) as f:
-      js = f.read()
-      tab.ExecuteJavaScript(js)
+    super(PlayAction, self).WillRunAction(page, tab)
+    self.LoadJS(tab, 'play.js')
 
   def RunAction(self, page, tab, previous_action):
     try:
       selector = self.selector if hasattr(self, 'selector') else ''
-      tab.ExecuteJavaScript('window.__playMedia(\'%s\');' % selector)
+      tab.ExecuteJavaScript('window.__playMedia("%s");' % selector)
       timeout = self.wait_timeout if hasattr(self, 'wait_timeout') else 60
       # Check if we need to wait for 'playing' event to fire.
       if hasattr(self, 'wait_for_playing') and self.wait_for_playing:
@@ -43,12 +40,3 @@
     except exceptions.EvaluateException:
       raise page_action.PageActionFailed('Cannot play media element(s) with '
                                          'selector = %s.' % selector)
-
-  def WaitForEvent(self, tab, selector, event_name, timeout):
-    """Halts play action until the selector's event is fired."""
-    util.WaitFor(lambda: self.HasEventCompleted(tab, selector, event_name),
-                 timeout=timeout, poll_interval=0.5)
-
-  def HasEventCompleted(self, tab, selector, event_name):
-    return tab.EvaluateJavaScript(
-        'window.__hasEventCompleted(\'%s\', \'%s\');' % (selector, event_name))
diff --git a/tools/telemetry/telemetry/page/actions/play_unittest.py b/tools/telemetry/telemetry/page/actions/play_unittest.py
index cd5444e..b29f8f8 100644
--- a/tools/telemetry/telemetry/page/actions/play_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/play_unittest.py
@@ -2,24 +2,20 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-import os
-
 from telemetry.core import util
 from telemetry.page.actions import play
 from telemetry.unittest import tab_test_case
 
-AUDIO_1_PLAYING_CHECK = "window.__hasEventCompleted('#audio_1', 'playing');"
-VIDEO_1_PLAYING_CHECK = "window.__hasEventCompleted('#video_1', 'playing');"
-VIDEO_1_ENDED_CHECK = "window.__hasEventCompleted('#video_1', 'ended');"
+AUDIO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#audio_1", "playing");'
+VIDEO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#video_1", "playing");'
+VIDEO_1_ENDED_CHECK = 'window.__hasEventCompleted("#video_1", "ended");'
 
 
 class PlayActionTest(tab_test_case.TabTestCase):
 
   def setUp(self):
     tab_test_case.TabTestCase.setUp(self)
-    unittest_data_dir = os.path.join(os.path.dirname(__file__),
-                                     '..', '..', '..', 'unittest_data')
-    self._browser.SetHTTPServerDirectories(unittest_data_dir)
+    self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
     self._tab.Navigate(self._browser.http_server.UrlOf('video_test.html'))
     self._tab.WaitForDocumentReadyStateToBeComplete()
 
diff --git a/tools/telemetry/telemetry/page/actions/seek.js b/tools/telemetry/telemetry/page/actions/seek.js
new file mode 100644
index 0000000..64f0ef1
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/seek.js
@@ -0,0 +1,49 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file performs actions on media elements.
+(function() {
+  function seekMedia(selector, seekTime, logSeekTime) {
+    // Performs the "Seek" action on media satisfying selector.
+    var mediaElements = window.__findMediaElements(selector);
+    for (var i = 0; i < mediaElements.length; i++) {
+      seek(mediaElements[i], seekTime, logSeekTime);
+    }
+  }
+
+  function seek(element, seekTime, logSeekTime) {
+    if (element instanceof HTMLMediaElement)
+      seekHTML5Element(element, seekTime, logSeekTime);
+    else
+      console.error('Can not seek non HTML5 media elements.');
+  }
+
+  function seekHTML5Element(element, seekTime, logSeekTime) {
+    element['seeked_completed'] = false;
+    var onSeeked = function(e) {
+      element[e.type + '_completed'] = true;
+      element.removeEventListener('seeked', onSeeked);
+    };
+    function onError(e) {
+      console.error('Error playing media :' + e.type);
+    }
+    element.addEventListener('error', onError);
+    element.addEventListener('abort', onError);
+
+    if (logSeekTime) {
+      var willSeekEvent = document.createEvent('Event');
+      willSeekEvent.initEvent('willSeek', false, false);
+      willSeekEvent.seekLabel = seekTime;
+      element.dispatchEvent(willSeekEvent);
+    }
+    element.addEventListener('seeked', onSeeked);
+    try {
+      element.currentTime = seekTime;
+    } catch (err) {
+      console.error('Cannot seek with network state: ' + element.networkState);
+    }
+  }
+
+  window.__seekMedia = seekMedia;
+})();
diff --git a/tools/telemetry/telemetry/page/actions/seek.py b/tools/telemetry/telemetry/page/actions/seek.py
new file mode 100644
index 0000000..af908a7
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/seek.py
@@ -0,0 +1,47 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""A Telemetry page_action that performs the "seek" action on media elements.
+
+Action attributes are:
+- seek_time: The media time to seek to. Test fails if not provided.
+- selector: If no selector is defined then the action attempts to seek the first
+            media element on the page. If 'all' then seek all media elements.
+- log_seek_time: If true the seek time is recorded, otherwise media measurement
+                 will not be aware of the seek action. Used to perform multiple
+                 seeks. Default true.
+- wait_for_seeked: If true forces the action to wait for seeked event to fire.
+                   Default false.
+- wait_timeout: Timeout to wait for seeked event. Only valid with
+                wait_for_seeked=true
+"""
+
+from telemetry.page.actions.media_action import MediaAction
+from telemetry.core import exceptions
+from telemetry.page.actions import page_action
+
+
+class SeekAction(MediaAction):
+  def __init__(self, attributes=None):
+    super(SeekAction, self).__init__(attributes)
+
+  def WillRunAction(self, page, tab):
+    """Load the media metrics JS code prior to running the action."""
+    super(SeekAction, self).WillRunAction(page, tab)
+    self.LoadJS(tab, 'seek.js')
+
+  def RunAction(self, page, tab, previous_action):
+    try:
+      assert hasattr(self, 'seek_time')
+      selector = self.selector if hasattr(self, 'selector') else ''
+      log_seek = self.log_seek if hasattr(self, 'log_seek') else True
+      tab.ExecuteJavaScript('window.__seekMedia("%s", "%s", "%s");' %
+                            (selector, self.seek_time, log_seek))
+      timeout = self.wait_timeout if hasattr(self, 'wait_timeout') else 60
+      # Check if we need to wait for 'seeked' event to fire.
+      if hasattr(self, 'wait_for_seeked') and self.wait_for_seeked:
+        self.WaitForEvent(tab, selector, 'seeked', timeout)
+    except exceptions.EvaluateException:
+      raise page_action.PageActionFailed('Cannot seek media element(s) with '
+                                         'selector = %s.' % selector)
diff --git a/tools/telemetry/telemetry/page/actions/seek_unittest.py b/tools/telemetry/telemetry/page/actions/seek_unittest.py
new file mode 100644
index 0000000..2f9d5a9
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/seek_unittest.py
@@ -0,0 +1,76 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.core import util
+from telemetry.page.actions import seek
+from telemetry.unittest import tab_test_case
+
+AUDIO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#audio_1", "seeked");'
+VIDEO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#video_1", "seeked");'
+
+
+class SeekActionTest(tab_test_case.TabTestCase):
+
+  def setUp(self):
+    tab_test_case.TabTestCase.setUp(self)
+    self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
+    self._tab.Navigate(self._browser.http_server.UrlOf('video_test.html'))
+    self._tab.WaitForDocumentReadyStateToBeComplete()
+
+  def testSeekWithNoSelector(self):
+    """Tests that with no selector Seek  action seeks first media element."""
+    data = {'wait_for_seeked': True, 'seek_time': 1}
+    action = seek.SeekAction(data)
+    action.WillRunAction(None, self._tab)
+    action.RunAction(None, self._tab, None)
+    # Assert only first video has played.
+    self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_SEEKED_CHECK))
+
+  def testSeekWithVideoSelector(self):
+    """Tests that Seek action seeks video element matching selector."""
+    data = {'selector': '#video_1', 'wait_for_seeked': True, 'seek_time': 1}
+    action = seek.SeekAction(data)
+    action.WillRunAction(None, self._tab)
+    # Both videos not playing before running action.
+    self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_SEEKED_CHECK))
+    action.RunAction(None, self._tab, None)
+    # Assert only video matching selector has played.
+    self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_SEEKED_CHECK))
+
+  def testSeekWithAllSelector(self):
+    """Tests that Seek action seeks all video elements with selector='all'."""
+    data = {'selector': 'all', 'wait_for_seeked': True, 'seek_time': 1}
+    action = seek.SeekAction(data)
+    action.WillRunAction(None, self._tab)
+    # Both videos not playing before running action.
+    self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_SEEKED_CHECK))
+    action.RunAction(None, self._tab, None)
+    # Assert all media elements played.
+    self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertTrue(self._tab.EvaluateJavaScript(AUDIO_1_SEEKED_CHECK))
+
+  def testSeekWaitForSeekTimeout(self):
+    """Tests that wait_for_seeked timeouts if video does not seek."""
+    data = {'selector': '#video_1',
+            'wait_for_seeked': True,
+            'wait_timeout': 1,
+            'seek_time': 1}
+    action = seek.SeekAction(data)
+    action.WillRunAction(None, self._tab)
+    self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""')
+    self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
+    self.assertRaises(util.TimeoutException, action.RunAction, None, self._tab,
+                      None)
+
+  def testSeekWithoutSeekTime(self):
+    """Tests that seek action fails with no seek time."""
+    data = {'wait_for_seeked': True}
+    action = seek.SeekAction(data)
+    action.WillRunAction(None, self._tab)
+    self.assertRaises(AssertionError, action.RunAction, None, self._tab,
+                      None)
diff --git a/tools/telemetry/telemetry/page/buildbot_page_measurement_results.py b/tools/telemetry/telemetry/page/buildbot_page_measurement_results.py
index c086eff..0f1ab81 100644
--- a/tools/telemetry/telemetry/page/buildbot_page_measurement_results.py
+++ b/tools/telemetry/telemetry/page/buildbot_page_measurement_results.py
@@ -33,12 +33,16 @@
       success_page_results = self._page_results
 
     # Print out the list of unique pages.
+    # Use a set and a list to efficiently create an order preserving list of
+    # unique URLs.
     unique_page_urls = []
+    unique_page_urls_set = set()
     for page_values in success_page_results:
       url = page_values.page.display_url
-      if unique_page_urls and unique_page_urls[0] == url:
-        break
+      if url in unique_page_urls_set:
+        continue
       unique_page_urls.append(url)
+      unique_page_urls_set.add(url)
     perf_tests_helper.PrintPages(unique_page_urls)
 
     # Build the results summary.
diff --git a/tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py b/tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py
index d73460a..147fa2f 100644
--- a/tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py
+++ b/tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py
@@ -125,6 +125,38 @@
       measurement_results.results,
       expected)
 
+  def test_repeated_pages(self):
+    test_page_set = _MakePageSet()
+
+    measurement_results = SummarySavingPageMeasurementResults()
+    measurement_results.WillMeasurePage(test_page_set.pages[0])
+    measurement_results.Add('a', 'seconds', 3)
+    measurement_results.DidMeasurePage()
+
+    measurement_results.WillMeasurePage(test_page_set.pages[0])
+    measurement_results.Add('a', 'seconds', 4)
+    measurement_results.DidMeasurePage()
+
+    measurement_results.WillMeasurePage(test_page_set.pages[1])
+    measurement_results.Add('a', 'seconds', 7)
+    measurement_results.DidMeasurePage()
+
+    measurement_results.WillMeasurePage(test_page_set.pages[1])
+    measurement_results.Add('a', 'seconds', 8)
+    measurement_results.DidMeasurePage()
+
+    measurement_results.PrintSummary()
+    expected = ['RESULT a_by_url: http___www.foo.com_= [3,4] seconds\n' +
+                'Avg a_by_url: 3.500000seconds\nSd  a_by_url: 0.707107seconds',
+                'RESULT a_by_url: http___www.bar.com_= [7,8] seconds\n' +
+                'Avg a_by_url: 7.500000seconds\nSd  a_by_url: 0.707107seconds',
+                '*RESULT a: a= [3,4,7,8] seconds\n' +
+                'Avg a: 5.500000seconds\nSd  a: 2.380476seconds'
+                ]
+    self.assertEquals(
+      measurement_results.results,
+      expected)
+
   def test_overall_results(self):
     test_page_set = _MakePageSet()
 
diff --git a/tools/telemetry/telemetry/page/csv_page_measurement_results.py b/tools/telemetry/telemetry/page/csv_page_measurement_results.py
index bd2e8d2..2440dd8 100644
--- a/tools/telemetry/telemetry/page/csv_page_measurement_results.py
+++ b/tools/telemetry/telemetry/page/csv_page_measurement_results.py
@@ -7,9 +7,10 @@
 
 class CsvPageMeasurementResults(
     page_measurement_results.PageMeasurementResults):
-  def __init__(self, output_stream, output_after_every_page):
+  def __init__(self, output_stream=None, output_after_every_page=None):
     super(CsvPageMeasurementResults, self).__init__()
-    self._results_writer = csv.writer(output_stream)
+    if output_stream:
+      self._results_writer = csv.writer(output_stream)
     self._did_output_header = False
     self._header_names_written_to_writer = None
     self._output_after_every_page = output_after_every_page
diff --git a/tools/telemetry/telemetry/page/page_runner.py b/tools/telemetry/telemetry/page/page_runner.py
index a3f1b85..9820a18 100644
--- a/tools/telemetry/telemetry/page/page_runner.py
+++ b/tools/telemetry/telemetry/page/page_runner.py
@@ -1,6 +1,7 @@
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
+import collections
 import glob
 import logging
 import os
@@ -16,6 +17,7 @@
 from telemetry.core import util
 from telemetry.core import wpr_modes
 from telemetry.page import page_filter as page_filter_module
+from telemetry.page import page_runner_repeat
 from telemetry.page import page_test
 
 
@@ -27,7 +29,7 @@
     self._append_to_existing_wpr = False
     self._last_archive_path = None
     self._first_browser = True
-    self.first_page = True
+    self.first_page = collections.defaultdict(lambda: True)
     self.profiler_dir = None
 
   def StartBrowser(self, test, page_set, page, possible_browser,
@@ -69,9 +71,8 @@
     if not self.tab:
       self.tab = self.browser.tabs[0]
 
-    if self.first_page:
-      self.first_page = False
-      test.WillRunPageSet(self.tab)
+    if self.first_page[page]:
+      self.first_page[page] = False
 
   def StopBrowser(self):
     if self.tab:
@@ -91,9 +92,9 @@
     if not self.profiler_dir:
       self.profiler_dir = tempfile.mkdtemp()
     output_file = os.path.join(self.profiler_dir, page.url_as_file_safe_name)
-    if options.page_repeat != 1 or options.pageset_repeat != 1:
+    if options.repeat_options.IsRepeating():
       output_file = _GetSequentialFileName(output_file)
-    self.browser.StartProfiling(options, output_file)
+    self.browser.StartProfiling(options.profiler, output_file)
 
   def StopProfiling(self):
     self.browser.StopProfiling()
@@ -147,6 +148,58 @@
   logging.warning('%s%s', title, stack_trace)
 
 
+def _PrepareAndRunPage(test, page_set, expectations, options, page,
+                       credentials_path, possible_browser, results, state):
+  if options.wpr_mode != wpr_modes.WPR_RECORD:
+    if page.archive_path and os.path.isfile(page.archive_path):
+      possible_browser.options.wpr_mode = wpr_modes.WPR_REPLAY
+    else:
+      possible_browser.options.wpr_mode = wpr_modes.WPR_OFF
+  results_for_current_run = results
+  if state.first_page[page] and test.discard_first_result:
+    # If discarding results, substitute a dummy object.
+    results_for_current_run = type(results)()
+  results_for_current_run.StartTest(page)
+  tries = 3
+  while tries:
+    try:
+      state.StartBrowser(test, page_set, page, possible_browser,
+                         credentials_path, page.archive_path)
+
+      _WaitForThermalThrottlingIfNeeded(state.browser.platform)
+
+      if options.profiler:
+        state.StartProfiling(page, options)
+
+      expectation = expectations.GetExpectationForPage(
+          state.browser.platform, page)
+
+      try:
+        _RunPage(test, page, state.tab, expectation,
+                 results_for_current_run, options)
+        _CheckThermalThrottling(state.browser.platform)
+      except exceptions.TabCrashException:
+        _LogStackTrace('Tab crashed: %s' % page.url, state.browser)
+        state.StopBrowser()
+
+      if options.profiler:
+        state.StopProfiling()
+
+      if test.NeedsBrowserRestartAfterEachRun(state.tab):
+        state.StopBrowser()
+
+      break
+    except exceptions.BrowserGoneException:
+      _LogStackTrace('Browser crashed', state.browser)
+      logging.warning('Lost connection to browser. Retrying.')
+      state.StopBrowser()
+      tries -= 1
+      if not tries:
+        logging.error('Lost connection to browser 3 times. Failing.')
+        raise
+  results_for_current_run.StopTest(page)
+
+
 def Run(test, page_set, expectations, options):
   """Runs a given test against a given page_set with the given options."""
   results = test.PrepareResults(options)
@@ -180,61 +233,35 @@
   for page in pages:
     test.CustomizeBrowserOptionsForPage(page, possible_browser.options)
 
+  for page in list(pages):
+    if not test.CanRunForPage(page):
+      logging.warning('Skipping test: it cannot run for %s', page.url)
+      results.AddSkip(page, 'Test cannot run')
+      pages.remove(page)
+
+  if not pages:
+    return results
+
   state = _RunState()
   # TODO(dtu): Move results creation and results_for_current_run into RunState.
-  results_for_current_run = results
 
   try:
-    for page in pages:
-      if options.wpr_mode != wpr_modes.WPR_RECORD:
-        if page.archive_path and os.path.isfile(page.archive_path):
-          possible_browser.options.wpr_mode = wpr_modes.WPR_REPLAY
-        else:
-          possible_browser.options.wpr_mode = wpr_modes.WPR_OFF
-      results_for_current_run = results
-      if state.first_page and test.discard_first_result:
-        # If discarding results, substitute a dummy object.
-        results_for_current_run = type(results)()
-      results_for_current_run.StartTest(page)
-      tries = 3
-      while tries:
-        try:
-          state.StartBrowser(test, page_set, page, possible_browser,
-                             credentials_path, page.archive_path)
+    test.WillRunTest(state.tab)
+    repeat_state = page_runner_repeat.PageRunnerRepeatState(
+                       options.repeat_options)
 
-          _WaitForThermalThrottlingIfNeeded(state.browser.platform)
+    repeat_state.WillRunPageSet()
+    while repeat_state.ShouldRepeatPageSet():
+      for page in pages:
+        repeat_state.WillRunPage()
+        while repeat_state.ShouldRepeatPage():
+          # execute test on page
+          _PrepareAndRunPage(test, page_set, expectations, options, page,
+                             credentials_path, possible_browser, results, state)
+          repeat_state.DidRunPage()
+      repeat_state.DidRunPageSet()
 
-          if options.profiler:
-            state.StartProfiling(page, options)
-
-          expectation = expectations.GetExpectationForPage(
-              state.browser.platform, page)
-
-          try:
-            _RunPage(test, page, state.tab, expectation,
-                     results_for_current_run, options)
-            _CheckThermalThrottling(state.browser.platform)
-          except exceptions.TabCrashException:
-            _LogStackTrace('Tab crashed: %s' % page.url, state.browser)
-            state.StopBrowser()
-
-          if options.profiler:
-            state.StopProfiling()
-
-          if test.NeedsBrowserRestartAfterEachRun(state.tab):
-            state.StopBrowser()
-
-          break
-        except exceptions.BrowserGoneException:
-          _LogStackTrace('Browser crashed', state.browser)
-          logging.warning('Lost connection to browser. Retrying.')
-          state.StopBrowser()
-          tries -= 1
-          if not tries:
-            logging.error('Lost connection to browser 3 times. Failing.')
-            raise
-      results_for_current_run.StopTest(page)
-    test.DidRunPageSet(state.tab, results_for_current_run)
+    test.DidRunTest(state.tab, results)
   finally:
     state.StopBrowser()
 
@@ -254,10 +281,8 @@
 
   if options.pageset_shuffle:
     random.Random().shuffle(pages)
-  return [page
-      for _ in xrange(int(options.pageset_repeat))
-      for page in pages
-      for _ in xrange(int(options.page_repeat))]
+
+  return pages
 
 
 def _CheckArchives(page_set, pages, results):
@@ -319,11 +344,6 @@
 
 
 def _RunPage(test, page, tab, expectation, results, options):
-  if not test.CanRunForPage(page):
-    logging.warning('Skipping test: it cannot run for %s', page.url)
-    results.AddSkip(page, 'Test cannot run')
-    return
-
   logging.info('Running %s' % page.url)
 
   page_state = PageState()
diff --git a/tools/telemetry/telemetry/page/page_runner_repeat.py b/tools/telemetry/telemetry/page/page_runner_repeat.py
new file mode 100644
index 0000000..acec0b0
--- /dev/null
+++ b/tools/telemetry/telemetry/page/page_runner_repeat.py
@@ -0,0 +1,54 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import time
+
+
+class PageRunnerRepeatState(object):
+  def __init__(self, repeat_options):
+    self.pageset_start_time = None
+    self.pageset_iters = None
+    self.page_start_time = None
+    self.page_iters = None
+
+    self.options = repeat_options
+
+  def WillRunPage(self):
+    """Runs before we start repeating a page"""
+    self.page_start_time = time.time()
+    self.page_iters = 0
+
+  def WillRunPageSet(self):
+    """Runs before we start repeating a pageset"""
+    self.pageset_start_time = time.time()
+    self.pageset_iters = 0
+
+  def DidRunPage(self):
+    """Runs after each completion of a page iteration"""
+    self.page_iters += 1
+
+  def DidRunPageSet(self):
+    """Runs after each completion of a pageset iteration"""
+    self.pageset_iters += 1
+
+  def ShouldRepeatPageSet(self):
+    """Returns True if we need to repeat this pageset more times"""
+    if (self.options.pageset_repeat_secs and
+        time.time() - self.pageset_start_time >
+          self.options.pageset_repeat_secs):
+      return False
+    elif (not self.options.pageset_repeat_secs and
+          self.pageset_iters >= self.options.pageset_repeat_iters):
+      return False
+    return True
+
+  def ShouldRepeatPage(self):
+    """Returns True if we need to repeat this page more times"""
+    if (self.options.page_repeat_secs and
+        time.time() - self.page_start_time > self.options.page_repeat_secs):
+      return False
+    elif (not self.options.page_repeat_secs and
+          self.page_iters >= self.options.page_repeat_iters):
+      return False
+    return True
diff --git a/tools/telemetry/telemetry/page/page_runner_unittest.py b/tools/telemetry/telemetry/page/page_runner_unittest.py
index 8aa37a1..8ac75c0 100644
--- a/tools/telemetry/telemetry/page/page_runner_unittest.py
+++ b/tools/telemetry/telemetry/page/page_runner_unittest.py
@@ -62,11 +62,14 @@
   def testDiscardFirstResult(self):
     ps = page_set.PageSet()
     expectations = test_expectations.TestExpectations()
-    page = page_module.Page(
+    ps.pages.append(page_module.Page(
         'file:///' + os.path.join('..', '..', 'unittest_data', 'blank.html'),
         ps,
-        base_dir=os.path.dirname(__file__))
-    ps.pages.append(page)
+        base_dir=os.path.dirname(__file__)))
+    ps.pages.append(page_module.Page(
+        'file:///' + os.path.join('..', '..', 'unittest_data', 'blank.html'),
+        ps,
+        base_dir=os.path.dirname(__file__)))
 
     class Test(page_test.PageTest):
       @property
@@ -77,10 +80,25 @@
 
     options = options_for_unittests.GetCopy()
     options.output_format = 'none'
+
+    options.repeat_options.page_repeat_iters = 1
+    options.repeat_options.pageset_repeat_iters = 1
     results = page_runner.Run(Test('RunTest'), ps, expectations, options)
     self.assertEquals(0, len(results.successes))
     self.assertEquals(0, len(results.failures))
 
+    options.repeat_options.page_repeat_iters = 1
+    options.repeat_options.pageset_repeat_iters = 2
+    results = page_runner.Run(Test('RunTest'), ps, expectations, options)
+    self.assertEquals(2, len(results.successes))
+    self.assertEquals(0, len(results.failures))
+
+    options.repeat_options.page_repeat_iters = 2
+    options.repeat_options.pageset_repeat_iters = 1
+    results = page_runner.Run(Test('RunTest'), ps, expectations, options)
+    self.assertEquals(2, len(results.successes))
+    self.assertEquals(0, len(results.failures))
+
   def testCredentialsWhenLoginFails(self):
     credentials_backend = StubCredentialsBackend(login_return_value=False)
     did_run = self.runCredentialsTest(credentials_backend)
diff --git a/tools/telemetry/telemetry/page/page_test.py b/tools/telemetry/telemetry/page/page_test.py
index 491ba50..f09ebb6 100644
--- a/tools/telemetry/telemetry/page/page_test.py
+++ b/tools/telemetry/telemetry/page/page_test.py
@@ -108,13 +108,15 @@
     """Override to customize if the test can be ran for the given page."""
     return True
 
-  def WillRunPageSet(self, tab):
-    """Override to do operations before the page set is navigated."""
+  def WillRunTest(self, tab):
+    """Override to do operations before the page set(s) are navigated."""
     pass
 
-  def DidRunPageSet(self, tab, results):
-    """Override to do operations after page set is completed, but before browser
-    is torn down."""
+  def DidRunTest(self, tab, results):
+    """Override to do operations after all page set(s) are completed.
+
+    This will occur before the browser is torn down.
+    """
     pass
 
   def DidStartHTTPServer(self, tab):
diff --git a/tools/telemetry/telemetry/test.py b/tools/telemetry/telemetry/test.py
index 9e06486..aea190c 100644
--- a/tools/telemetry/telemetry/test.py
+++ b/tools/telemetry/telemetry/test.py
@@ -1,12 +1,23 @@
 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
+import os
+import sys
+
 from telemetry.page import page_runner
 from telemetry.page import page_set
 from telemetry.page import test_expectations
 from telemetry.page import page_test
 
 
+def GetBaseDir():
+  main_module = sys.modules['__main__']
+  if hasattr(main_module, '__file__'):
+    return os.path.dirname(main_module.__file__)
+  else:
+    return os.getcwd()
+
+
 class Test(object):
   """Base class for a Telemetry test or benchmark.
 
@@ -38,7 +49,7 @@
     page_set attribute. Override to generate a custom page set.
     """
     assert hasattr(self, 'page_set'), 'This test has no "page_set" attribute.'
-    return page_set.PageSet.FromFile(self.page_set)
+    return page_set.PageSet.FromFile(os.path.join(GetBaseDir(), self.page_set))
 
   def CreateExpectations(self, ps):  # pylint: disable=W0613
     """Get the expectations this test will run with.
diff --git a/tools/telemetry/telemetry/test_runner.py b/tools/telemetry/telemetry/test_runner.py
index fe9922a..1345eaa 100644
--- a/tools/telemetry/telemetry/test_runner.py
+++ b/tools/telemetry/telemetry/test_runner.py
@@ -117,18 +117,10 @@
   return os.path.basename(sys.argv[0])
 
 
-def _GetBaseDir():
-  main_module = sys.modules['__main__']
-  if hasattr(main_module, '__file__'):
-    return os.path.dirname(main_module.__file__)
-  else:
-    return os.getcwd()
-
-
 def _GetTests():
   # Lazy load and cache results.
   if not hasattr(_GetTests, 'tests'):
-    base_dir = _GetBaseDir()
+    base_dir = test.GetBaseDir()
     _GetTests.tests = discover.DiscoverClasses(base_dir, base_dir, test.Test,
                                                index_by_class_name=True)
   return _GetTests.tests
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index d4e33fa..cc2d91f 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -5631,13 +5631,20 @@
    obj:/lib/libpthread-2.11.1.so
 }
 {
-   bug_155530
+   bug_155530a
    Memcheck:Leak
    fun:_Znw*
    ...
    fun:_ZN77GeolocationInfoBarQueueControllerTests_OneObservationPerInfoBarCancelled_Test8TestBodyEv
 }
 {
+   bug_155530b
+   Memcheck:Leak
+   fun:_Znw*
+   ...
+   fun:_ZN69PermissionQueueControllerTests_OneObservationPerInfoBarCancelled_Test8TestBodyEv
+}
+{
    bug_156705
    Memcheck:Leak
    fun:_Znw*
@@ -7379,4 +7386,19 @@
    fun:_ZN15webkit_database15DatabaseTracker23GetAllOriginIdentifiersEPSt6vectorISsSaISsEE
    fun:_ZN15webkit_database12_GLOBAL__N_120GetOriginsOnDBThreadEPNS_15DatabaseTrackerEPSt3setI4GURLSt4lessIS4_ESaIS4_EE
 }
-
+{
+   quic_socket_utils_write_packet_msg_name
+   Memcheck:Param
+   socketcall.sendmsg(msg.msg_name)
+   obj:/lib/x86_64-linux-gnu/libpthread-2.15.so
+   fun:_ZN3net5tools15QuicSocketUtils11WritePacketEiPKcmRKSt6vectorIhSaIhEERKNS_10IPEndPointEPi
+   ...
+}
+{
+   quic_socket_utils_write_packet_msg_control
+   Memcheck:Param
+   socketcall.sendmsg(msg.msg_control)
+   obj:/lib/x86_64-linux-gnu/libpthread-2.15.so
+   fun:_ZN3net5tools15QuicSocketUtils11WritePacketEiPKcmRKSt6vectorIhSaIhEERKNS_10IPEndPointEPi
+   ...
+}
diff --git a/tools/xdisplaycheck/xdisplaycheck.cc b/tools/xdisplaycheck/xdisplaycheck.cc
index ea5fe1e..8c432d1 100644
--- a/tools/xdisplaycheck/xdisplaycheck.cc
+++ b/tools/xdisplaycheck/xdisplaycheck.cc
@@ -106,3 +106,10 @@
 #endif
   return 0;
 }
+
+#if defined(LEAK_SANITIZER)
+// XOpenDisplay leaks memory if it takes more than one try to connect. This
+// causes LSan bots to fail. We don't care about memory leaks in xdisplaycheck
+// anyway, so just disable LSan completely.
+extern "C" int __lsan_is_turned_off() { return 1; }
+#endif
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index a465cdc..e5ba037 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -36,6 +36,12 @@
 
 namespace {
 
+// Distance a drag needs to be from the app grid to be considered 'outside', at
+// which point we rearrange the apps to their pre-drag configuration, as a drop
+// then would be canceled. We have a buffer to make it easier to drag apps to
+// other pages.
+const int kDragBufferPx = 20;
+
 // Padding space in pixels for fixed layout.
 const int kLeftRightPadding = 20;
 const int kTopPadding = 1;
@@ -183,10 +189,6 @@
   virtual void OnDragSourceMove() OVERRIDE {
     grid_view_->UpdateDrag(app_list::AppsGridView::MOUSE,
                            GetCursorInGridViewCoords());
-
-    // Don't turn pages if the cursor is dragged outside the view.
-    if (!IsCursorWithinGridView())
-      grid_view_->StopPageFlipTimer();
   }
 
   void SetupExchangeData(ui::OSExchangeData* data) {
@@ -241,6 +243,7 @@
       rows_per_page_(0),
       selected_view_(NULL),
       drag_view_(NULL),
+      drag_start_page_(-1),
       drag_pointer_(NONE),
       drag_and_drop_host_(NULL),
       forward_events_to_drag_and_drop_host_(false),
@@ -323,6 +326,7 @@
 
   drag_view_ = view;
   drag_view_offset_ = event.location();
+  drag_start_page_ = pagination_model_->selected_page();
   ExtractDragLocation(event, &drag_start_grid_view_);
   drag_view_start_ = gfx::Point(drag_view_->x(), drag_view_->y());
 }
@@ -407,7 +411,10 @@
   const Index last_drop_target = drop_target_;
   CalculateDropTarget(last_drag_point_, false);
 
-  MaybeStartPageFlipTimer(last_drag_point_);
+  if (IsPointWithinDragBuffer(last_drag_point_))
+    MaybeStartPageFlipTimer(last_drag_point_);
+  else
+    StopPageFlipTimer();
 
   gfx::Point page_switcher_point(last_drag_point_);
   views::View::ConvertPointToTarget(this, page_switcher_view_,
@@ -448,6 +455,9 @@
   drag_pointer_ = NONE;
   drop_target_ = Index();
   drag_view_ = NULL;
+  drag_start_grid_view_ = gfx::Point();
+  drag_start_page_ = -1;
+  drag_view_offset_ = gfx::Point();
   AnimateToIdealBounds();
 
   StopPageFlipTimer();
@@ -898,11 +908,16 @@
 
 void AppsGridView::CalculateDropTarget(const gfx::Point& drag_point,
                                        bool use_page_button_hovering) {
-  const int current_page = pagination_model_->selected_page();
+  int current_page = pagination_model_->selected_page();
+  gfx::Point point(drag_point);
+  if (!IsPointWithinDragBuffer(drag_point)) {
+    point = drag_start_grid_view_;
+    current_page = drag_start_page_;
+  }
 
   if (use_page_button_hovering &&
-      page_switcher_view_->bounds().Contains(drag_point)) {
-    gfx::Point page_switcher_point(drag_point);
+      page_switcher_view_->bounds().Contains(point)) {
+    gfx::Point page_switcher_point(point);
     views::View::ConvertPointToTarget(this, page_switcher_view_,
                                       &page_switcher_point);
     int page = page_switcher_view_->GetPageForPoint(page_switcher_point);
@@ -911,9 +926,9 @@
       drop_target_.slot = tiles_per_page() - 1;
     }
   } else {
-    const int drop_row = drag_point.y() / kPreferredTileHeight;
+    const int drop_row = point.y() / kPreferredTileHeight;
     const int drop_col = std::min(cols_ - 1,
-                                  drag_point.x() / kPreferredTileWidth);
+                                  point.x() / kPreferredTileWidth);
 
     drop_target_.page = current_page;
     drop_target_.slot = std::max(0, std::min(
@@ -990,6 +1005,8 @@
 }
 
 void AppsGridView::MaybeStartPageFlipTimer(const gfx::Point& drag_point) {
+  if (!IsPointWithinDragBuffer(drag_point))
+    StopPageFlipTimer();
   int new_page_flip_target = -1;
 
   if (page_switcher_view_->bounds().Contains(drag_point)) {
@@ -1012,18 +1029,15 @@
   if (new_page_flip_target == page_flip_target_)
     return;
 
+  StopPageFlipTimer();
   if (pagination_model_->is_valid_page(new_page_flip_target)) {
     page_flip_target_ = new_page_flip_target;
-    page_flip_timer_.Stop();
 
     if (page_flip_target_ != pagination_model_->selected_page()) {
       page_flip_timer_.Start(FROM_HERE,
           base::TimeDelta::FromMilliseconds(page_flip_delay_in_ms_),
           this, &AppsGridView::OnPageFlipTimer);
     }
-  } else {
-    page_flip_target_ = -1;
-    page_flip_timer_.Stop();
   }
 }
 
@@ -1060,6 +1074,12 @@
   }
 }
 
+bool AppsGridView::IsPointWithinDragBuffer(const gfx::Point& point) const {
+  gfx::Rect rect(GetLocalBounds());
+  rect.Inset(-kDragBufferPx, -kDragBufferPx, -kDragBufferPx, -kDragBufferPx);
+  return rect.Contains(point);
+}
+
 void AppsGridView::ButtonPressed(views::Button* sender,
                                  const ui::Event& event) {
   if (dragging())
diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h
index ed570e2..9c20164 100644
--- a/ui/app_list/views/apps_grid_view.h
+++ b/ui/app_list/views/apps_grid_view.h
@@ -222,6 +222,10 @@
   // Cancels any context menus showing for app items on the current page.
   void CancelContextMenusOnCurrentPage();
 
+  // Returnes true if |point| lies within the bounds of this grid view plus a
+  // buffer area surrounding it.
+  bool IsPointWithinDragBuffer(const gfx::Point& point) const;
+
   // Overridden from views::ButtonListener:
   virtual void ButtonPressed(views::Button* sender,
                              const ui::Event& event) OVERRIDE;
@@ -273,6 +277,9 @@
   // The location of |drag_view_| when the drag started.
   gfx::Point drag_view_start_;
 
+  // Page the drag started on.
+  int drag_start_page_;
+
 #if defined(OS_WIN) && !defined(USE_AURA)
   // Created when a drag is started (ie: drag exceeds the drag threshold), but
   // not Run() until supplied with a shortcut path.
diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc
index 16afea4..13d1232 100644
--- a/ui/aura/test/test_screen.cc
+++ b/ui/aura/test/test_screen.cc
@@ -39,20 +39,23 @@
 }
 
 void TestScreen::SetDeviceScaleFactor(float device_scale_factor) {
-  gfx::Rect bounds = display_.bounds();
-  gfx::Rect bounds_in_pixel = gfx::ToNearestRect(
-      gfx::ScaleRect(bounds, display_.device_scale_factor()));
+  gfx::Rect bounds_in_pixel(display_.GetSizeInPixel());
   display_.SetScaleAndBounds(device_scale_factor, bounds_in_pixel);
   root_window_->OnHostResized(bounds_in_pixel.size());
 }
 
 void TestScreen::SetDisplayRotation(gfx::Display::Rotation rotation) {
   display_.set_rotation(rotation);
+  // TODO(oshima|mukai): Update the display_ as well.
   root_window_->SetTransform(GetRotationTransform() * GetUIScaleTransform());
 }
 
 void TestScreen::SetUIScale(float ui_scale) {
   ui_scale_ = ui_scale;
+  gfx::Rect bounds_in_pixel(display_.GetSizeInPixel());
+  gfx::Rect new_bounds = gfx::ToNearestRect(
+      gfx::ScaleRect(bounds_in_pixel, 1.0f / ui_scale));
+  display_.SetScaleAndBounds(display_.device_scale_factor(), new_bounds);
   root_window_->SetTransform(GetRotationTransform() * GetUIScaleTransform());
 }
 
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
index 9e3156e..94cd664 100644
--- a/ui/base/clipboard/clipboard.h
+++ b/ui/base/clipboard/clipboard.h
@@ -13,7 +13,7 @@
 #include "base/gtest_prod_util.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/shared_memory.h"
-#include "base/process.h"
+#include "base/process/process.h"
 #include "base/strings/string16.h"
 #include "base/threading/platform_thread.h"
 #include "base/threading/thread_checker.h"
diff --git a/ui/base/strings/ui_strings.grd b/ui/base/strings/ui_strings.grd
index fd1cac9..203d936 100644
--- a/ui/base/strings/ui_strings.grd
+++ b/ui/base/strings/ui_strings.grd
@@ -498,9 +498,6 @@
       <message name="IDS_MESSAGE_CENTER_TOOLTIP_UNREAD" desc="Tooltip for notification tray icon with unread notifications">
         <ph name="product">$1<ex>Chrome</ex></ph> - Notifications (<ph name="QUANTITY">$2<ex>3</ex></ph> unread)
       </message>
-      <message name="IDS_MESSAGE_CENTER_SAMPLE_SYNCED_NOTIFICATION_SERVICE_NAME" desc="The name of the only source for synced notifications. TODO and note for translators: this text must be replaced by the real name by the branch point.  See crbug.com/254617">
-        Sample app
-      </message>
       <message name="IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME" desc="The name of screenshot notifier that is a system componet">
         Screenshot
       </message>
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc
index 004064d..d492be5 100644
--- a/ui/gfx/render_text_linux.cc
+++ b/ui/gfx/render_text_linux.cc
@@ -398,6 +398,7 @@
   for (GSList* it = current_line_->runs; it; it = it->next) {
     PangoLayoutRun* run = reinterpret_cast<PangoLayoutRun*>(it->data);
     int glyph_count = run->glyphs->num_glyphs;
+    // TODO(msw): Skip painting runs outside the display rect area, like Win.
     if (glyph_count == 0)
       continue;
 
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index 05be785..7870aa0 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -463,8 +463,12 @@
     // Get the run specified by the visual-to-logical map.
     internal::TextRun* run = runs_[visual_to_logical_[i]];
 
-    if (run->glyph_count == 0)
+    // Skip painting empty runs and runs outside the display rect area.
+    if ((run->glyph_count == 0) || (x >= display_rect().right()) ||
+        (x + run->width <= display_rect().x())) {
+      x += run->width;
       continue;
+    }
 
     // Based on WebCore::skiaDrawText.
     pos.resize(run->glyph_count);
@@ -482,6 +486,7 @@
     renderer.DrawDecorations(x, y, run->width, run->underline, run->strike,
                              run->diagonal_strike);
 
+    DCHECK_EQ(glyph_x - x, run->width);
     x = glyph_x;
   }
 }
diff --git a/ui/gl/gl.target.darwin-arm.mk b/ui/gl/gl.target.darwin-arm.mk
index 3838cb2..2f53a14 100644
--- a/ui/gl/gl.target.darwin-arm.mk
+++ b/ui/gl/gl.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -180,20 +181,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -219,8 +219,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -296,20 +296,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -336,8 +335,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -411,7 +410,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl.target.darwin-mips.mk b/ui/gl/gl.target.darwin-mips.mk
index b6d7446..3f1046a 100644
--- a/ui/gl/gl.target.darwin-mips.mk
+++ b/ui/gl/gl.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -179,20 +180,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -218,8 +218,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,20 +294,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -334,8 +333,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -405,7 +404,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl.target.darwin-x86.mk b/ui/gl/gl.target.darwin-x86.mk
index 7493608..aba33a5 100644
--- a/ui/gl/gl.target.darwin-x86.mk
+++ b/ui/gl/gl.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -182,20 +183,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -220,8 +220,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -300,20 +300,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -339,8 +338,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -409,7 +408,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl.target.linux-arm.mk b/ui/gl/gl.target.linux-arm.mk
index 3838cb2..2f53a14 100644
--- a/ui/gl/gl.target.linux-arm.mk
+++ b/ui/gl/gl.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -180,20 +181,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -219,8 +219,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -296,20 +296,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -336,8 +335,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -411,7 +410,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl.target.linux-mips.mk b/ui/gl/gl.target.linux-mips.mk
index b6d7446..3f1046a 100644
--- a/ui/gl/gl.target.linux-mips.mk
+++ b/ui/gl/gl.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -179,20 +180,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -218,8 +218,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,20 +294,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -334,8 +333,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -405,7 +404,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl.target.linux-x86.mk b/ui/gl/gl.target.linux-x86.mk
index 7493608..aba33a5 100644
--- a/ui/gl/gl.target.linux-x86.mk
+++ b/ui/gl/gl.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_mesa_mesa_headers_gyp)/mesa_headers.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_gl_gl_jni_headers_gyp)/gl_jni_headers.stamp
@@ -182,20 +183,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -220,8 +220,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -300,20 +300,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DGL_IMPLEMENTATION' \
 	'-DGL_GLEXT_PROTOTYPES' \
 	'-DEGL_EGLEXT_PROTOTYPES' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -339,8 +338,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -409,7 +408,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h
index 85fdbfb..c6a1eac 100644
--- a/ui/gl/gl_bindings.h
+++ b/ui/gl/gl_bindings.h
@@ -124,6 +124,7 @@
 
 /* GL_CHROMIUM_async_pixel_transfers */
 #define GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM      0x84F5
+#define GL_ASYNC_READ_PIXELS_COMPLETED_CHROMIUM          0x84F6
 
 // GL_OES_texure_3D
 #define GL_SAMPLER_3D_OES                                0x8B5F
diff --git a/ui/gl/gl_jni_headers.target.darwin-arm.mk b/ui/gl/gl_jni_headers.target.darwin-arm.mk
index ff49c06..497701a 100644
--- a/ui/gl/gl_jni_headers.target.darwin-arm.mk
+++ b/ui/gl/gl_jni_headers.target.darwin-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_jni_headers.target.darwin-mips.mk b/ui/gl/gl_jni_headers.target.darwin-mips.mk
index 4e5ba99..ee2cba4 100644
--- a/ui/gl/gl_jni_headers.target.darwin-mips.mk
+++ b/ui/gl/gl_jni_headers.target.darwin-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_jni_headers.target.darwin-x86.mk b/ui/gl/gl_jni_headers.target.darwin-x86.mk
index 4e7f5f5..c228a07 100644
--- a/ui/gl/gl_jni_headers.target.darwin-x86.mk
+++ b/ui/gl/gl_jni_headers.target.darwin-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_jni_headers.target.linux-arm.mk b/ui/gl/gl_jni_headers.target.linux-arm.mk
index ff49c06..497701a 100644
--- a/ui/gl/gl_jni_headers.target.linux-arm.mk
+++ b/ui/gl/gl_jni_headers.target.linux-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -166,10 +166,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_jni_headers.target.linux-mips.mk b/ui/gl/gl_jni_headers.target.linux-mips.mk
index 4e5ba99..ee2cba4 100644
--- a/ui/gl/gl_jni_headers.target.linux-mips.mk
+++ b/ui/gl/gl_jni_headers.target.linux-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_jni_headers.target.linux-x86.mk b/ui/gl/gl_jni_headers.target.linux-x86.mk
index 4e7f5f5..c228a07 100644
--- a/ui/gl/gl_jni_headers.target.linux-x86.mk
+++ b/ui/gl/gl_jni_headers.target.linux-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index 964a523..8b705df 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -14,7 +14,6 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "base/process_util.h"
 #include "base/synchronization/cancellation_flag.h"
 #include "base/synchronization/lock.h"
 #include "base/threading/non_thread_safe.h"
diff --git a/ui/gl/surface_jni_headers.target.darwin-arm.mk b/ui/gl/surface_jni_headers.target.darwin-arm.mk
index eefc019..16ad20a 100644
--- a/ui/gl/surface_jni_headers.target.darwin-arm.mk
+++ b/ui/gl/surface_jni_headers.target.darwin-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_jni_headers.target.darwin-mips.mk b/ui/gl/surface_jni_headers.target.darwin-mips.mk
index 1f98822..40aa459 100644
--- a/ui/gl/surface_jni_headers.target.darwin-mips.mk
+++ b/ui/gl/surface_jni_headers.target.darwin-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_jni_headers.target.darwin-x86.mk b/ui/gl/surface_jni_headers.target.darwin-x86.mk
index cc89bfe..8c546d8 100644
--- a/ui/gl/surface_jni_headers.target.darwin-x86.mk
+++ b/ui/gl/surface_jni_headers.target.darwin-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_jni_headers.target.linux-arm.mk b/ui/gl/surface_jni_headers.target.linux-arm.mk
index eefc019..16ad20a 100644
--- a/ui/gl/surface_jni_headers.target.linux-arm.mk
+++ b/ui/gl/surface_jni_headers.target.linux-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_jni_headers.target.linux-mips.mk b/ui/gl/surface_jni_headers.target.linux-mips.mk
index 1f98822..40aa459 100644
--- a/ui/gl/surface_jni_headers.target.linux-mips.mk
+++ b/ui/gl/surface_jni_headers.target.linux-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_jni_headers.target.linux-x86.mk b/ui/gl/surface_jni_headers.target.linux-x86.mk
index cc89bfe..8c546d8 100644
--- a/ui/gl/surface_jni_headers.target.linux-x86.mk
+++ b/ui/gl/surface_jni_headers.target.linux-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.darwin-arm.mk b/ui/gl/surface_texture_jni_headers.target.darwin-arm.mk
index 8021ac0..100f19e 100644
--- a/ui/gl/surface_texture_jni_headers.target.darwin-arm.mk
+++ b/ui/gl/surface_texture_jni_headers.target.darwin-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.darwin-mips.mk b/ui/gl/surface_texture_jni_headers.target.darwin-mips.mk
index 49b409d..c57e903 100644
--- a/ui/gl/surface_texture_jni_headers.target.darwin-mips.mk
+++ b/ui/gl/surface_texture_jni_headers.target.darwin-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.darwin-x86.mk b/ui/gl/surface_texture_jni_headers.target.darwin-x86.mk
index f19b71e..e205dd3 100644
--- a/ui/gl/surface_texture_jni_headers.target.darwin-x86.mk
+++ b/ui/gl/surface_texture_jni_headers.target.darwin-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.linux-arm.mk b/ui/gl/surface_texture_jni_headers.target.linux-arm.mk
index 8021ac0..100f19e 100644
--- a/ui/gl/surface_texture_jni_headers.target.linux-arm.mk
+++ b/ui/gl/surface_texture_jni_headers.target.linux-arm.mk
@@ -81,10 +81,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -159,10 +159,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.linux-mips.mk b/ui/gl/surface_texture_jni_headers.target.linux-mips.mk
index 49b409d..c57e903 100644
--- a/ui/gl/surface_texture_jni_headers.target.linux-mips.mk
+++ b/ui/gl/surface_texture_jni_headers.target.linux-mips.mk
@@ -80,10 +80,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/gl/surface_texture_jni_headers.target.linux-x86.mk b/ui/gl/surface_texture_jni_headers.target.linux-x86.mk
index f19b71e..e205dd3 100644
--- a/ui/gl/surface_texture_jni_headers.target.linux-x86.mk
+++ b/ui/gl/surface_texture_jni_headers.target.linux-x86.mk
@@ -83,10 +83,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc
index e70563a..a3530a5 100644
--- a/ui/message_center/notification.cc
+++ b/ui/message_center/notification.cc
@@ -26,7 +26,8 @@
 RichNotificationData::RichNotificationData()
     : priority(DEFAULT_PRIORITY),
       never_timeout(false),
-      timestamp(base::Time::Now()) {}
+      timestamp(base::Time::Now()),
+      progress(0) {}
 
 RichNotificationData::RichNotificationData(const RichNotificationData& other)
     : priority(other.priority),
@@ -35,6 +36,7 @@
       expanded_message(other.expanded_message),
       image(other.image),
       items(other.items),
+      progress(other.progress),
       buttons(other.buttons) {}
 
 RichNotificationData::~RichNotificationData() {}
diff --git a/ui/message_center/notification.h b/ui/message_center/notification.h
index 23e2e8c..4217ac4 100644
--- a/ui/message_center/notification.h
+++ b/ui/message_center/notification.h
@@ -44,6 +44,7 @@
   string16 expanded_message;
   gfx::Image image;
   std::vector<NotificationItem> items;
+  int progress;
   std::vector<ButtonInfo> buttons;
 };
 
@@ -88,6 +89,7 @@
   const std::vector<NotificationItem>& items() const {
     return optional_fields_.items;
   }
+  int progress() const { return optional_fields_.progress; }
   // End unpacked values.
 
   // Images fetched asynchronously.
diff --git a/ui/message_center/notification_types.h b/ui/message_center/notification_types.h
index eb4bd68..24d1f14 100644
--- a/ui/message_center/notification_types.h
+++ b/ui/message_center/notification_types.h
@@ -33,6 +33,7 @@
   NOTIFICATION_TYPE_BASE_FORMAT,
   NOTIFICATION_TYPE_IMAGE,
   NOTIFICATION_TYPE_MULTIPLE,
+  NOTIFICATION_TYPE_PROGRESS
 };
 
 enum NotificationPriority {
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc
index 5823507..7eb9838 100644
--- a/ui/message_center/views/message_view.cc
+++ b/ui/message_center/views/message_view.cc
@@ -430,7 +430,7 @@
   // even though the scroll gesture doesn't make no (or little) effects on the
   // slide-out behavior. See http://crbug.com/172991
 
-  if (!event->IsScrollGestureEvent())
+  if (!event->IsScrollGestureEvent() && !event->IsFlingScrollEvent())
     return;
 
   if (scroller_)
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index 0522e75..7947f47 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -24,6 +24,7 @@
 #include "ui/views/controls/button/image_button.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
+#include "ui/views/controls/progress_bar.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/layout/fill_layout.h"
 #include "ui/views/widget/widget.h"
@@ -38,6 +39,11 @@
 const int kTextBottomPadding = 12;
 const int kTextRightPadding = 23;
 const int kItemTitleToMessagePadding = 3;
+const int kProgressBarWidth = message_center::kNotificationWidth -
+    kTextLeftPadding - kTextRightPadding;
+const int kProgressBarHeight = 8;
+const int kProgressBarTopPadding = 12;
+const int kProgressBarBottomPadding = 2;
 const int kButtonVecticalPadding = 0;
 const int kButtonTitleTopPadding = 0;
 
@@ -75,6 +81,11 @@
 }
 
 // static
+views::Border* MakeProgressBarBorder(int top, int bottom) {
+  return MakeEmptyBorder(top, kTextLeftPadding, bottom, kTextRightPadding);
+}
+
+// static
 views::Border* MakeSeparatorBorder(int top, int left, SkColor color) {
   return views::Border::CreateSolidSidedBorder(top, left, 0, 0, color);
 }
@@ -223,6 +234,33 @@
   return message_center::GetImageSizeForWidth(width, size);
 }
 
+// NotificationProgressBar /////////////////////////////////////////////////////
+
+class NotificationProgressBar : public views::ProgressBar {
+ public:
+  NotificationProgressBar();
+  virtual ~NotificationProgressBar();
+
+ private:
+  // Overriden from View
+  virtual gfx::Size GetPreferredSize() OVERRIDE;
+
+  DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar);
+};
+
+NotificationProgressBar::NotificationProgressBar() {
+}
+
+NotificationProgressBar::~NotificationProgressBar() {
+}
+
+gfx::Size NotificationProgressBar::GetPreferredSize() {
+  gfx::Size pref_size(kProgressBarWidth, kProgressBarHeight);
+  gfx::Insets insets = GetInsets();
+  pref_size.Enlarge(insets.width(), insets.height());
+  return pref_size;
+}
+
 // NotificationButton //////////////////////////////////////////////////////////
 
 // NotificationButtons render the action buttons of notifications.
@@ -345,6 +383,7 @@
     case NOTIFICATION_TYPE_IMAGE:
     case NOTIFICATION_TYPE_MULTIPLE:
     case NOTIFICATION_TYPE_SIMPLE:
+    case NOTIFICATION_TYPE_PROGRESS:
       break;
     default:
       // If the caller asks for an unrecognized kind of view (entirely possible
@@ -422,6 +461,16 @@
     accessible_lines.push_back(notification.message());
   }
 
+  // Create the progress bar view.
+  progress_bar_view_ = NULL;
+  if (notification.type() == NOTIFICATION_TYPE_PROGRESS) {
+    progress_bar_view_ = new NotificationProgressBar();
+    progress_bar_view_->set_border(MakeProgressBarBorder(
+        kProgressBarTopPadding, kProgressBarBottomPadding));
+    progress_bar_view_->SetValue(notification.progress() / 100.0);
+    top_view_->AddChildView(progress_bar_view_);
+  }
+
   // Create the list item views (up to a maximum).
   int padding = kMessageLineHeight - views::Label().font().GetHeight();
   std::vector<NotificationItem> items = notification.items();
diff --git a/ui/message_center/views/notification_view.h b/ui/message_center/views/notification_view.h
index d70baaa..622e2c3 100644
--- a/ui/message_center/views/notification_view.h
+++ b/ui/message_center/views/notification_view.h
@@ -10,6 +10,10 @@
 #include "ui/message_center/message_center_export.h"
 #include "ui/message_center/views/message_view.h"
 
+namespace views {
+class ProgressBar;
+}
+
 namespace message_center {
 
 class BoundedLabel;
@@ -71,6 +75,7 @@
   views::View* icon_view_;
   views::View* bottom_view_;
   views::View* image_view_;
+  views::ProgressBar* progress_bar_view_;
   std::vector<views::View*> action_buttons_;
 
   DISALLOW_COPY_AND_ASSIGN(NotificationView);
diff --git a/ui/native_theme/native_theme.target.darwin-arm.mk b/ui/native_theme/native_theme.target.darwin-arm.mk
index 812aff6..496e563 100644
--- a/ui/native_theme/native_theme.target.darwin-arm.mk
+++ b/ui/native_theme/native_theme.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -76,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -108,8 +108,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -185,18 +185,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -218,8 +217,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/native_theme/native_theme.target.darwin-mips.mk b/ui/native_theme/native_theme.target.darwin-mips.mk
index d6d3998..613be8d 100644
--- a/ui/native_theme/native_theme.target.darwin-mips.mk
+++ b/ui/native_theme/native_theme.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -75,18 +76,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,18 +183,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -216,8 +215,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/native_theme/native_theme.target.darwin-x86.mk b/ui/native_theme/native_theme.target.darwin-x86.mk
index b4f114b..7e16151 100644
--- a/ui/native_theme/native_theme.target.darwin-x86.mk
+++ b/ui/native_theme/native_theme.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -78,18 +79,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,18 +189,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -221,8 +220,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/native_theme/native_theme.target.linux-arm.mk b/ui/native_theme/native_theme.target.linux-arm.mk
index 812aff6..496e563 100644
--- a/ui/native_theme/native_theme.target.linux-arm.mk
+++ b/ui/native_theme/native_theme.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -76,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -108,8 +108,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -185,18 +185,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -218,8 +217,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -294,7 +293,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/native_theme/native_theme.target.linux-mips.mk b/ui/native_theme/native_theme.target.linux-mips.mk
index d6d3998..613be8d 100644
--- a/ui/native_theme/native_theme.target.linux-mips.mk
+++ b/ui/native_theme/native_theme.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -75,18 +76,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -107,8 +107,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -183,18 +183,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -216,8 +215,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -288,7 +287,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/native_theme/native_theme.target.linux-x86.mk b/ui/native_theme/native_theme.target.linux-x86.mk
index b4f114b..7e16151 100644
--- a/ui/native_theme/native_theme.target.linux-x86.mk
+++ b/ui/native_theme/native_theme.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
 
@@ -78,18 +79,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -109,8 +109,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,18 +189,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DNATIVE_THEME_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -221,8 +220,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -292,7 +291,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.darwin-arm.mk b/ui/shell_dialogs.target.darwin-arm.mk
index 086de96..6b45420 100644
--- a/ui/shell_dialogs.target.darwin-arm.mk
+++ b/ui/shell_dialogs.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -80,18 +81,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -116,8 +116,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +192,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -304,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.darwin-mips.mk b/ui/shell_dialogs.target.darwin-mips.mk
index 0a29b8e..2299db7 100644
--- a/ui/shell_dialogs.target.darwin-mips.mk
+++ b/ui/shell_dialogs.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -79,18 +80,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -115,8 +115,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -190,18 +190,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -227,8 +226,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -298,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.darwin-x86.mk b/ui/shell_dialogs.target.darwin-x86.mk
index 20c88d1..03fba6d 100644
--- a/ui/shell_dialogs.target.darwin-x86.mk
+++ b/ui/shell_dialogs.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -117,8 +117,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -232,8 +231,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -302,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.linux-arm.mk b/ui/shell_dialogs.target.linux-arm.mk
index 086de96..6b45420 100644
--- a/ui/shell_dialogs.target.linux-arm.mk
+++ b/ui/shell_dialogs.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -80,18 +81,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -116,8 +116,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +192,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -304,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.linux-mips.mk b/ui/shell_dialogs.target.linux-mips.mk
index 0a29b8e..2299db7 100644
--- a/ui/shell_dialogs.target.linux-mips.mk
+++ b/ui/shell_dialogs.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -79,18 +80,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -115,8 +115,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -190,18 +190,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -227,8 +226,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -298,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs.target.linux-x86.mk b/ui/shell_dialogs.target.linux-x86.mk
index 20c88d1..03fba6d 100644
--- a/ui/shell_dialogs.target.linux-x86.mk
+++ b/ui/shell_dialogs.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_jni_headers_gyp)/ui_jni_headers.stamp
 
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -117,8 +117,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSHELL_DIALOGS_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -232,8 +231,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/ui/app_locale_settings \
 	$(gyp_shared_intermediate_dir)/ui/ui_strings \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -302,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
index 2a6f3e4..8d6c8f6 100644
--- a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
+++ b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc
@@ -12,7 +12,7 @@
 #include "base/message_loop/message_loop_proxy.h"
 #include "base/nix/mime_util_xdg.h"
 #include "base/nix/xdg_util.h"
-#include "base/process_util.h"
+#include "base/process/launch.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
diff --git a/ui/snapshot/snapshot.target.darwin-arm.mk b/ui/snapshot/snapshot.target.darwin-arm.mk
index b350f69..78fe887 100644
--- a/ui/snapshot/snapshot.target.darwin-arm.mk
+++ b/ui/snapshot/snapshot.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -71,18 +72,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -103,8 +103,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -180,18 +180,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -213,8 +212,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -289,7 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/snapshot/snapshot.target.darwin-mips.mk b/ui/snapshot/snapshot.target.darwin-mips.mk
index 4bb639e..832a782 100644
--- a/ui/snapshot/snapshot.target.darwin-mips.mk
+++ b/ui/snapshot/snapshot.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -70,18 +71,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -102,8 +102,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -178,18 +178,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -211,8 +210,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -283,7 +282,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/snapshot/snapshot.target.darwin-x86.mk b/ui/snapshot/snapshot.target.darwin-x86.mk
index 4a29c34..8c2ff42 100644
--- a/ui/snapshot/snapshot.target.darwin-x86.mk
+++ b/ui/snapshot/snapshot.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -73,18 +74,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -104,8 +104,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -184,18 +184,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -216,8 +215,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -287,7 +286,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/snapshot/snapshot.target.linux-arm.mk b/ui/snapshot/snapshot.target.linux-arm.mk
index b350f69..78fe887 100644
--- a/ui/snapshot/snapshot.target.linux-arm.mk
+++ b/ui/snapshot/snapshot.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -71,18 +72,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -103,8 +103,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -180,18 +180,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -213,8 +212,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -289,7 +288,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/snapshot/snapshot.target.linux-mips.mk b/ui/snapshot/snapshot.target.linux-mips.mk
index 4bb639e..832a782 100644
--- a/ui/snapshot/snapshot.target.linux-mips.mk
+++ b/ui/snapshot/snapshot.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -70,18 +71,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -102,8 +102,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -178,18 +178,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -211,8 +210,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -283,7 +282,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/snapshot/snapshot.target.linux-x86.mk b/ui/snapshot/snapshot.target.linux-x86.mk
index 4a29c34..8c2ff42 100644
--- a/ui/snapshot/snapshot.target.linux-x86.mk
+++ b/ui/snapshot/snapshot.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
@@ -73,18 +74,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -104,8 +104,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -184,18 +184,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSNAPSHOT_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -216,8 +215,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -287,7 +286,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/ui/surface/surface.target.darwin-arm.mk b/ui/surface/surface.target.darwin-arm.mk
index 0bb0691..5409afb 100644
--- a/ui/surface/surface.target.darwin-arm.mk
+++ b/ui/surface/surface.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -75,19 +76,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -110,8 +110,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +189,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -225,8 +224,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -302,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/surface/surface.target.darwin-mips.mk b/ui/surface/surface.target.darwin-mips.mk
index 424a28c..700185e 100644
--- a/ui/surface/surface.target.darwin-mips.mk
+++ b/ui/surface/surface.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -74,19 +75,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -109,8 +109,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,19 +187,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -223,8 +222,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -296,7 +295,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/surface/surface.target.darwin-x86.mk b/ui/surface/surface.target.darwin-x86.mk
index ac8f3ac..0d820db 100644
--- a/ui/surface/surface.target.darwin-x86.mk
+++ b/ui/surface/surface.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -77,19 +78,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -111,8 +111,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -193,19 +193,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -300,7 +299,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/surface/surface.target.linux-arm.mk b/ui/surface/surface.target.linux-arm.mk
index 0bb0691..5409afb 100644
--- a/ui/surface/surface.target.linux-arm.mk
+++ b/ui/surface/surface.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -75,19 +76,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -110,8 +110,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +189,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -225,8 +224,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -302,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/surface/surface.target.linux-mips.mk b/ui/surface/surface.target.linux-mips.mk
index 424a28c..700185e 100644
--- a/ui/surface/surface.target.linux-mips.mk
+++ b/ui/surface/surface.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -74,19 +75,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -109,8 +109,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -187,19 +187,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -223,8 +222,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -296,7 +295,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/surface/surface.target.linux-x86.mk b/ui/surface/surface.target.linux-x86.mk
index ac8f3ac..0d820db 100644
--- a/ui/surface/surface.target.linux-x86.mk
+++ b/ui/surface/surface.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -77,19 +78,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -111,8 +111,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -193,19 +193,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DSURFACE_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -300,7 +299,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/ui/ui.target.darwin-arm.mk b/ui/ui.target.darwin-arm.mk
index 2d45f00..76ee97e 100644
--- a/ui/ui.target.darwin-arm.mk
+++ b/ui/ui.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -190,19 +191,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -226,8 +226,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -308,19 +308,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -345,8 +344,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -426,7 +425,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui.target.darwin-mips.mk b/ui/ui.target.darwin-mips.mk
index f420b4c..88454bb 100644
--- a/ui/ui.target.darwin-mips.mk
+++ b/ui/ui.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -189,19 +190,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -225,8 +225,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -306,19 +306,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -343,8 +342,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -420,7 +419,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui.target.darwin-x86.mk b/ui/ui.target.darwin-x86.mk
index 7fe3b1a..d46367f 100644
--- a/ui/ui.target.darwin-x86.mk
+++ b/ui/ui.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -192,18 +193,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -227,8 +227,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -312,18 +312,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -348,8 +347,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -424,7 +423,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui.target.linux-arm.mk b/ui/ui.target.linux-arm.mk
index 2d45f00..76ee97e 100644
--- a/ui/ui.target.linux-arm.mk
+++ b/ui/ui.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -190,19 +191,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -226,8 +226,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -308,19 +308,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -345,8 +344,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -426,7 +425,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui.target.linux-mips.mk b/ui/ui.target.linux-mips.mk
index f420b4c..88454bb 100644
--- a/ui/ui.target.linux-mips.mk
+++ b/ui/ui.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -189,19 +190,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -225,8 +225,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -306,19 +306,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -343,8 +342,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -420,7 +419,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui.target.linux-x86.mk b/ui/ui.target.linux-x86.mk
index 7fe3b1a..d46367f 100644
--- a/ui/ui.target.linux-x86.mk
+++ b/ui/ui.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,ui_base_strings_ui_strings_gyp)/ui_strings.stamp \
@@ -192,18 +193,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -227,8 +227,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -312,18 +312,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DUI_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
 	'-DPNG_USER_CONFIG' \
@@ -348,8 +347,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -424,7 +423,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/ui/ui_jni_headers.target.darwin-arm.mk b/ui/ui_jni_headers.target.darwin-arm.mk
index be4f755..59203ce 100644
--- a/ui/ui_jni_headers.target.darwin-arm.mk
+++ b/ui/ui_jni_headers.target.darwin-arm.mk
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -236,10 +236,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/ui_jni_headers.target.darwin-mips.mk b/ui/ui_jni_headers.target.darwin-mips.mk
index 02e7889..8d7423d 100644
--- a/ui/ui_jni_headers.target.darwin-mips.mk
+++ b/ui/ui_jni_headers.target.darwin-mips.mk
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/ui_jni_headers.target.darwin-x86.mk b/ui/ui_jni_headers.target.darwin-x86.mk
index a178f97..b6ed284 100644
--- a/ui/ui_jni_headers.target.darwin-x86.mk
+++ b/ui/ui_jni_headers.target.darwin-x86.mk
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -241,10 +241,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/ui_jni_headers.target.linux-arm.mk b/ui/ui_jni_headers.target.linux-arm.mk
index be4f755..59203ce 100644
--- a/ui/ui_jni_headers.target.linux-arm.mk
+++ b/ui/ui_jni_headers.target.linux-arm.mk
@@ -158,10 +158,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -236,10 +236,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/ui_jni_headers.target.linux-mips.mk b/ui/ui_jni_headers.target.linux-mips.mk
index 02e7889..8d7423d 100644
--- a/ui/ui_jni_headers.target.linux-mips.mk
+++ b/ui/ui_jni_headers.target.linux-mips.mk
@@ -157,10 +157,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -234,10 +234,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/ui_jni_headers.target.linux-x86.mk b/ui/ui_jni_headers.target.linux-x86.mk
index a178f97..b6ed284 100644
--- a/ui/ui_jni_headers.target.linux-x86.mk
+++ b/ui/ui_jni_headers.target.linux-x86.mk
@@ -160,10 +160,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -241,10 +241,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 765c9ef..5a20d52 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -26,18 +26,15 @@
 
 namespace views {
 
-// The amount of time, in milliseconds, we wait before allowing another mouse
-// pressed event to show the menu.
-static const int64 kMinimumTimeBetweenButtonClicks = 100;
-
 // Default menu offset.
 static const int kDefaultMenuOffsetX = -2;
 static const int kDefaultMenuOffsetY = -4;
 
 // static
+const char MenuButton::kViewClassName[] = "MenuButton";
+const int64 MenuButton::kMinimumTimeBetweenButtonClicks = 100;
 const int MenuButton::kMenuMarkerPaddingLeft = 3;
 const int MenuButton::kMenuMarkerPaddingRight = -1;
-const char MenuButton::kViewClassName[] = "MenuButton";
 
 ////////////////////////////////////////////////////////////////////////////////
 //
diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h
index 20cdb83..575942b 100644
--- a/ui/views/controls/button/menu_button.h
+++ b/ui/views/controls/button/menu_button.h
@@ -28,6 +28,10 @@
  public:
   static const char kViewClassName[];
 
+  // The amount of time, in milliseconds, we wait before allowing another mouse
+  // pressed event to show the menu.
+  static const int64 kMinimumTimeBetweenButtonClicks;
+
   // How much padding to put on the left and right of the menu marker.
   static const int kMenuMarkerPaddingLeft;
   static const int kMenuMarkerPaddingRight;
diff --git a/ui/views/controls/combobox/native_combobox_views.cc b/ui/views/controls/combobox/native_combobox_views.cc
index 8ef1efa..7a0d873 100644
--- a/ui/views/controls/combobox/native_combobox_views.cc
+++ b/ui/views/controls/combobox/native_combobox_views.cc
@@ -19,6 +19,7 @@
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/color_constants.h"
+#include "ui/views/controls/button/menu_button.h"
 #include "ui/views/controls/combobox/combobox.h"
 #include "ui/views/controls/focusable_border.h"
 #include "ui/views/controls/menu/menu_runner.h"
@@ -97,7 +98,9 @@
 
 bool NativeComboboxViews::OnMousePressed(const ui::MouseEvent& mouse_event) {
   combobox_->RequestFocus();
-  if (mouse_event.IsLeftMouseButton()) {
+  const base::TimeDelta delta = base::Time::Now() - closed_time_;
+  if (mouse_event.IsLeftMouseButton() &&
+      (delta.InMilliseconds() > MenuButton::kMinimumTimeBetweenButtonClicks)) {
     UpdateFromModel();
     ShowDropDownMenu(ui::MENU_SOURCE_MOUSE);
   }
@@ -369,7 +372,6 @@
 }
 
 void NativeComboboxViews::ShowDropDownMenu(ui::MenuSourceType source_type) {
-
   if (!dropdown_list_menu_runner_.get())
     UpdateFromModel();
 
@@ -401,6 +403,7 @@
       MenuRunner::MENU_DELETED)
     return;
   dropdown_open_ = false;
+  closed_time_ = base::Time::Now();
 
   // Need to explicitly clear mouse handler so that events get sent
   // properly after the menu finishes running. If we don't do this, then
diff --git a/ui/views/controls/combobox/native_combobox_views.h b/ui/views/controls/combobox/native_combobox_views.h
index 3384b8a..bdf7033 100644
--- a/ui/views/controls/combobox/native_combobox_views.h
+++ b/ui/views/controls/combobox/native_combobox_views.h
@@ -5,6 +5,7 @@
 #ifndef UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_VIEWS_H_
 #define UI_VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_VIEWS_H_
 
+#include "base/time/time.h"
 #include "ui/views/controls/combobox/native_combobox_wrapper.h"
 #include "ui/views/controls/menu/menu_delegate.h"
 #include "ui/views/view.h"
@@ -90,6 +91,14 @@
   // Is the drop down list showing
   bool dropdown_open_;
 
+  // Like MenuButton, we use a time object in order to keep track of when the
+  // combobox was closed. The time is used for simulating menu behavior; that
+  // is, if the menu is shown and the button is pressed, we need to close the
+  // menu. There is no clean way to get the second click event because the
+  // menu is displayed using a modal loop and, unlike regular menus in Windows,
+  // the button is not part of the displayed menu.
+  base::Time closed_time_;
+
   // The selected index in the model. The default value is -1, which means no
   // selection.
   int selected_index_;
diff --git a/ui/views/controls/progress_bar.cc b/ui/views/controls/progress_bar.cc
index 7ce2a44..087c2df 100644
--- a/ui/views/controls/progress_bar.cc
+++ b/ui/views/controls/progress_bar.cc
@@ -183,7 +183,10 @@
 }
 
 gfx::Size ProgressBar::GetPreferredSize() {
-  return gfx::Size(100, 11);
+  gfx::Size pref_size(100, 11);
+  gfx::Insets insets = GetInsets();
+  pref_size.Enlarge(insets.width(), insets.height());
+  return pref_size;
 }
 
 const char* ProgressBar::GetClassName() const {
@@ -191,18 +194,24 @@
 }
 
 void ProgressBar::OnPaint(gfx::Canvas* canvas) {
+  gfx::Rect content_bounds = GetContentsBounds();
+  int bar_left = content_bounds.x();
+  int bar_top = content_bounds.y();
+  int bar_width = content_bounds.width();
+  int bar_height = content_bounds.height();
+
   const int progress_width =
-      static_cast<int>(width() * GetNormalizedValue() + 0.5);
+      static_cast<int>(bar_width * GetNormalizedValue() + 0.5);
 
   // Draw background.
   FillRoundRect(canvas,
-                0, 0, width(), height(),
+                bar_left, bar_top, bar_width, bar_height,
                 kCornerRadius,
                 kBackgroundColor, kBackgroundColor,
                 false);
   StrokeRoundRect(canvas,
-                  0, 0,
-                  width(), height(),
+                  bar_left, bar_top,
+                  bar_width, bar_height,
                   kCornerRadius,
                   kBackgroundBorderColor,
                   kBorderWidth);
@@ -214,7 +223,7 @@
 
       SkPath inner_path;
       AddRoundRectPathWithPadding(
-          0, 0, progress_width, height(),
+          bar_left, bar_top, progress_width, bar_height,
           kCornerRadius,
           0,
           &inner_path);
@@ -228,7 +237,7 @@
         kBarColorEnd,
       };
       // We want a thin 1-pixel line for kBarTopColor.
-      SkScalar scalar_height = SkIntToScalar(height());
+      SkScalar scalar_height = SkIntToScalar(bar_height);
       SkScalar highlight_width = SkScalarDiv(SK_Scalar1, scalar_height);
       SkScalar border_width = SkScalarDiv(SkIntToScalar(kBorderWidth),
                                           scalar_height);
@@ -257,8 +266,8 @@
       // Do not start from (kBorderWidth, kBorderWidth) because it makes gaps
       // between the inner and the border.
       FillRoundRect(canvas,
-                    0, 0,
-                    progress_width, height(),
+                    bar_left, bar_top,
+                    progress_width, bar_height,
                     kCornerRadius,
                     enabled() ? bar_colors : disabled_bar_colors,
                     enabled() ? bar_points : disabled_bar_points,
@@ -294,7 +303,7 @@
         paint.setShader(s.get());
         paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
         canvas->DrawRect(gfx::Rect(highlight_left, 0,
-                                   kHighlightWidth + kBorderWidth, height()),
+                                   kHighlightWidth + kBorderWidth, bar_height),
                          paint);
       }
 
@@ -303,7 +312,7 @@
 
     // Draw bar stroke
     StrokeRoundRect(canvas,
-                    0, 0, progress_width, height(),
+                    bar_left, bar_top, progress_width, bar_height,
                     kCornerRadius,
                     enabled() ? kBarBorderColor : kDisabledBarBorderColor,
                     kBorderWidth);
diff --git a/ui/views/controls/webview/webview.gyp b/ui/views/controls/webview/webview.gyp
index 25cb11a..1814d2f 100644
--- a/ui/views/controls/webview/webview.gyp
+++ b/ui/views/controls/webview/webview.gyp
@@ -14,7 +14,7 @@
         '../../../../base/base.gyp:base',
         '../../../../base/base.gyp:base_i18n',
         '../../../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
-        '../../../../content/content.gyp:content',
+        '../../../../content/content.gyp:content_browser',
         '../../../../skia/skia.gyp:skia',
         '../../../../url/url.gyp:url_lib',
         '../../../ui.gyp:ui',
diff --git a/ui/views/test/webview_test_helper.cc b/ui/views/test/webview_test_helper.cc
index 243baf0..81ac7b4 100644
--- a/ui/views/test/webview_test_helper.cc
+++ b/ui/views/test/webview_test_helper.cc
@@ -4,24 +4,19 @@
 
 #include "ui/views/test/webview_test_helper.h"
 
-#include "base/message_loop/message_loop.h"
-#include "content/public/test/test_browser_thread.h"
 #include "content/public/test/test_content_client_initializer.h"
 #include "ui/views/controls/webview/webview.h"
 
 namespace views {
 
-WebViewTestHelper::WebViewTestHelper(base::MessageLoopForUI* ui_loop) {
+WebViewTestHelper::WebViewTestHelper() {
   test_content_client_initializer_.reset(
-      new content::TestContentClientInitializer);
+      new content::TestContentClientInitializer());
 
   // Setup to register a new RenderViewHost factory which manufactures
   // mock render process hosts. This ensures that we never create a 'real'
   // render view host since support for it doesn't exist in unit tests.
   test_content_client_initializer_->CreateTestRenderViewHosts();
-
-  ui_thread_.reset(
-      new content::TestBrowserThread(content::BrowserThread::UI, ui_loop));
 }
 
 WebViewTestHelper::~WebViewTestHelper() {
diff --git a/ui/views/test/webview_test_helper.h b/ui/views/test/webview_test_helper.h
index 025ea06..c0fbdbf 100644
--- a/ui/views/test/webview_test_helper.h
+++ b/ui/views/test/webview_test_helper.h
@@ -13,22 +13,19 @@
 
 namespace content {
 class TestContentClientInitializer;
-class TestBrowserThread;
 }  // namespace content
 
 namespace views {
 
 class WebViewTestHelper {
  public:
-  explicit WebViewTestHelper(base::MessageLoopForUI* ui_loop);
+  WebViewTestHelper();
   virtual ~WebViewTestHelper();
 
  private:
   scoped_ptr<content::TestContentClientInitializer>
       test_content_client_initializer_;
 
-  scoped_ptr<content::TestBrowserThread> ui_thread_;
-
   DISALLOW_COPY_AND_ASSIGN(WebViewTestHelper);
 };
 
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 5282172..207e655 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "ui/aura/client/activation_client.h"
 #include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/cursor_client.h"
 #include "ui/aura/client/stacking_client.h"
 #include "ui/aura/focus_manager.h"
 #include "ui/aura/root_window.h"
@@ -166,7 +167,8 @@
       window_(new aura::Window(this)),
       native_widget_delegate_(delegate),
       last_drop_operation_(ui::DragDropTypes::DRAG_NONE),
-      restore_focus_on_activate_(false) {
+      restore_focus_on_activate_(false),
+      cursor_(gfx::kNullCursor) {
   window_->SetProperty(kDesktopNativeWidgetAuraKey, this);
   aura::client::SetFocusChangeObserver(window_, this);
   aura::client::SetActivationChangeObserver(window_, this);
@@ -550,11 +552,17 @@
 }
 
 void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) {
-  desktop_root_window_host_->AsRootWindowHost()->SetCursor(cursor);
+  cursor_ = cursor;
+  aura::client::CursorClient* cursor_client =
+      aura::client::GetCursorClient(window_->GetRootWindow());
+  if (cursor_client)
+    cursor_client->SetCursor(cursor);
 }
 
 bool DesktopNativeWidgetAura::IsMouseEventsEnabled() const {
-  return true;
+  aura::client::CursorClient* cursor_client =
+      aura::client::GetCursorClient(window_->GetRootWindow());
+  return cursor_client ? cursor_client->IsMouseEventsEnabled() : true;
 }
 
 void DesktopNativeWidgetAura::ClearNativeFocus() {
@@ -619,7 +627,7 @@
 }
 
 gfx::NativeCursor DesktopNativeWidgetAura::GetCursor(const gfx::Point& point) {
-  return gfx::kNullCursor;
+  return cursor_;
 }
 
 int DesktopNativeWidgetAura::GetNonClientComponent(
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
index 7773173..b98e1cc 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -248,6 +248,8 @@
   // See comments in OnLostActive().
   bool restore_focus_on_activate_;
 
+  gfx::NativeCursor cursor_;
+
   scoped_ptr<corewm::ShadowController> shadow_controller_;
 
   // Reorders child windows of |window_| associated with a view based on the
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
index ca4fb27..2df67e9 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
@@ -990,6 +990,12 @@
   // May want to factor CheckXEventForConsistency(xev); into a common location
   // since it is called here.
   switch (xev->type) {
+    case EnterNotify:
+    case LeaveNotify: {
+      ui::MouseEvent mouse_event(xev);
+      DispatchMouseEvent(&mouse_event);
+      break;
+    }
     case Expose: {
       gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y,
                             xev->xexpose.width, xev->xexpose.height);
diff --git a/url/url_lib.target.darwin-arm.mk b/url/url_lib.target.darwin-arm.mk
index fc9985a..b0ae24e 100644
--- a/url/url_lib.target.darwin-arm.mk
+++ b/url/url_lib.target.darwin-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/url/url_lib.target.darwin-mips.mk b/url/url_lib.target.darwin-mips.mk
index acacc2d..7b01d41 100644
--- a/url/url_lib.target.darwin-mips.mk
+++ b/url/url_lib.target.darwin-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/url/url_lib.target.darwin-x86.mk b/url/url_lib.target.darwin-x86.mk
index 7e3c450..c866bce 100644
--- a/url/url_lib.target.darwin-x86.mk
+++ b/url/url_lib.target.darwin-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/url/url_lib.target.linux-arm.mk b/url/url_lib.target.linux-arm.mk
index fc9985a..b0ae24e 100644
--- a/url/url_lib.target.linux-arm.mk
+++ b/url/url_lib.target.linux-arm.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -174,10 +174,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/url/url_lib.target.linux-mips.mk b/url/url_lib.target.linux-mips.mk
index acacc2d..7b01d41 100644
--- a/url/url_lib.target.linux-mips.mk
+++ b/url/url_lib.target.linux-mips.mk
@@ -87,10 +87,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/url/url_lib.target.linux-x86.mk b/url/url_lib.target.linux-x86.mk
index 7e3c450..c866bce 100644
--- a/url/url_lib.target.linux-x86.mk
+++ b/url/url_lib.target.linux-x86.mk
@@ -90,10 +90,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -179,10 +179,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DURL_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
diff --git a/webkit/browser/fileapi/copy_or_move_file_validator.h b/webkit/browser/fileapi/copy_or_move_file_validator.h
index 9b32f5b..2bd4df1 100644
--- a/webkit/browser/fileapi/copy_or_move_file_validator.h
+++ b/webkit/browser/fileapi/copy_or_move_file_validator.h
@@ -25,7 +25,16 @@
 
   virtual ~CopyOrMoveFileValidator() {}
 
-  virtual void StartValidation(const ResultCallback& result_callback) = 0;
+  // Called on a source file before copying or moving to the final
+  // destination.
+  virtual void StartPreWriteValidation(
+      const ResultCallback& result_callback) = 0;
+
+  // Called on a destination file after copying or moving to the final
+  // destination. Suitable for running Anti-Virus checks.
+  virtual void StartPostWriteValidation(
+      const base::FilePath& dest_platform_path,
+      const ResultCallback& result_callback) = 0;
 };
 
 class CopyOrMoveFileValidatorFactory {
diff --git a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
index 7b893ea..31530e0 100644
--- a/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
+++ b/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc
@@ -18,6 +18,7 @@
 #include "webkit/browser/fileapi/mock_file_system_context.h"
 #include "webkit/browser/fileapi/test_file_system_backend.h"
 #include "webkit/browser/quota/mock_special_storage_policy.h"
+#include "webkit/common/blob/shareable_file_reference.h"
 #include "webkit/common/fileapi/file_system_util.h"
 
 namespace fileapi {
@@ -184,46 +185,61 @@
     : public CopyOrMoveFileValidatorFactory {
  public:
   // A factory that creates validators that accept everything or nothing.
-  explicit TestCopyOrMoveFileValidatorFactory(bool all_valid)
-      : all_valid_(all_valid) {}
+  explicit TestCopyOrMoveFileValidatorFactory(bool all_valid,
+                                              bool all_valid_write)
+      : all_valid_(all_valid),
+        all_valid_write_(all_valid_write) {}
   virtual ~TestCopyOrMoveFileValidatorFactory() {}
 
   virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator(
       const FileSystemURL& /*src_url*/,
       const base::FilePath& /*platform_path*/) OVERRIDE {
-    return new TestCopyOrMoveFileValidator(all_valid_);
+    return new TestCopyOrMoveFileValidator(all_valid_, all_valid_write_);
   }
 
  private:
   class TestCopyOrMoveFileValidator : public CopyOrMoveFileValidator {
    public:
-    explicit TestCopyOrMoveFileValidator(bool all_valid)
-        : result_(all_valid ? base::PLATFORM_FILE_OK
-                            : base::PLATFORM_FILE_ERROR_SECURITY) {
+    explicit TestCopyOrMoveFileValidator(bool pre_copy_valid,
+                                         bool post_copy_valid)
+        : result_(pre_copy_valid ? base::PLATFORM_FILE_OK
+                                 : base::PLATFORM_FILE_ERROR_SECURITY),
+          write_result_(post_copy_valid ? base::PLATFORM_FILE_OK
+                                        : base::PLATFORM_FILE_ERROR_SECURITY) {
     }
     virtual ~TestCopyOrMoveFileValidator() {}
 
-    virtual void StartValidation(
+    virtual void StartPreWriteValidation(
         const ResultCallback& result_callback) OVERRIDE {
       // Post the result since a real validator must do work asynchronously.
       base::MessageLoop::current()->PostTask(
           FROM_HERE, base::Bind(result_callback, result_));
     }
 
+    virtual void StartPostWriteValidation(
+        const base::FilePath& dest_platform_path,
+        const ResultCallback& result_callback) OVERRIDE {
+      // Post the result since a real validator must do work asynchronously.
+      base::MessageLoop::current()->PostTask(
+          FROM_HERE, base::Bind(result_callback, write_result_));
+    }
+
    private:
     base::PlatformFileError result_;
+    base::PlatformFileError write_result_;
 
     DISALLOW_COPY_AND_ASSIGN(TestCopyOrMoveFileValidator);
   };
 
   bool all_valid_;
+  bool all_valid_write_;
 
   DISALLOW_COPY_AND_ASSIGN(TestCopyOrMoveFileValidatorFactory);
 };
 
 }  // namespace
 
-TEST(CopyOrMoveFileValidatorTest, NoValidatorWithin6ameFSType) {
+TEST(CopyOrMoveFileValidatorTest, NoValidatorWithinSameFSType) {
   // Within a file system type, validation is not expected, so it should
   // work for kWithValidatorType without a validator set.
   CopyOrMoveFileValidatorTestHelper helper(GURL("http://foo"),
@@ -236,7 +252,7 @@
 
 TEST(CopyOrMoveFileValidatorTest, MissingValidator) {
   // Copying or moving into a kWithValidatorType requires a file
-  // validator.  An error is expect if copy is attempted without a validator.
+  // validator.  An error is expected if copy is attempted without a validator.
   CopyOrMoveFileValidatorTestHelper helper(GURL("http://foo"),
                                            kNoValidatorType,
                                            kWithValidatorType);
@@ -251,7 +267,7 @@
                                            kWithValidatorType);
   helper.SetUp();
   scoped_ptr<CopyOrMoveFileValidatorFactory> factory(
-      new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/));
+      new TestCopyOrMoveFileValidatorFactory(true, true /*accept_all*/));
   helper.SetMediaCopyOrMoveFileValidatorFactory(factory.Pass());
 
   helper.CopyTest(base::PLATFORM_FILE_OK);
@@ -264,7 +280,7 @@
                                            kWithValidatorType);
   helper.SetUp();
   scoped_ptr<CopyOrMoveFileValidatorFactory> factory(
-      new TestCopyOrMoveFileValidatorFactory(false /*accept_all*/));
+      new TestCopyOrMoveFileValidatorFactory(false, false /*accept_all*/));
   helper.SetMediaCopyOrMoveFileValidatorFactory(factory.Pass());
 
   helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY);
@@ -278,15 +294,29 @@
                                            kWithValidatorType);
   helper.SetUp();
   scoped_ptr<CopyOrMoveFileValidatorFactory> reject_factory(
-      new TestCopyOrMoveFileValidatorFactory(false /*accept_all*/));
+      new TestCopyOrMoveFileValidatorFactory(false, false /*accept_all*/));
   helper.SetMediaCopyOrMoveFileValidatorFactory(reject_factory.Pass());
 
   scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory(
-      new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/));
+      new TestCopyOrMoveFileValidatorFactory(true, true /*accept_all*/));
   helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass());
 
   helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY);
   helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY);
 }
 
+TEST(CopyOrMoveFileValidatorTest, RejectPostWrite) {
+  CopyOrMoveFileValidatorTestHelper helper(GURL("http://foo"),
+                                           kNoValidatorType,
+                                           kWithValidatorType);
+  helper.SetUp();
+  scoped_ptr<CopyOrMoveFileValidatorFactory> factory(
+      // accept pre-copy, reject post-copy
+      new TestCopyOrMoveFileValidatorFactory(true, false));
+  helper.SetMediaCopyOrMoveFileValidatorFactory(factory.Pass());
+
+  helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY);
+  helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY);
+}
+
 }  // namespace fileapi
diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate.cc b/webkit/browser/fileapi/copy_or_move_operation_delegate.cc
index 8b70690..8746725 100644
--- a/webkit/browser/fileapi/copy_or_move_operation_delegate.cc
+++ b/webkit/browser/fileapi/copy_or_move_operation_delegate.cc
@@ -110,12 +110,14 @@
   // and operation==MOVE case, probably we can just rename the root directory.
   // http://crbug.com/172187
   StartRecursiveOperation(
-      src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy,
-                            AsWeakPtr(), src_root_, callback_));
+      src_root_, base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopyDir,
+                            AsWeakPtr(), src_root_,
+                            callback_));
 }
 
-void CopyOrMoveOperationDelegate::CopyOrMoveFile(const URLPair& url_pair,
-                                            const StatusCallback& callback) {
+void CopyOrMoveOperationDelegate::CopyOrMoveFile(
+    const URLPair& url_pair,
+    const StatusCallback& callback) {
   // Same filesystem case.
   if (same_file_system_) {
     if (operation_type_ == OPERATION_MOVE) {
@@ -131,7 +133,7 @@
   // copy_callback which removes the source file if operation_type == MOVE.
   StatusCallback copy_callback =
       base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, AsWeakPtr(),
-                 url_pair.src, callback);
+                 url_pair, callback);
   operation_runner()->CreateSnapshotFile(
       url_pair.src,
       base::Bind(&CopyOrMoveOperationDelegate::DidCreateSnapshot, AsWeakPtr(),
@@ -169,7 +171,7 @@
 
   validator_.reset(
       factory->CreateCopyOrMoveFileValidator(url_pair.src, platform_path));
-  validator_->StartValidation(
+  validator_->StartPreWriteValidation(
       base::Bind(&CopyOrMoveOperationDelegate::DidValidateFile, AsWeakPtr(),
                  url_pair.dest, callback, file_info, platform_path));
 }
@@ -188,7 +190,7 @@
   operation_runner()->CopyInForeignFile(platform_path, dest, callback);
 }
 
-void CopyOrMoveOperationDelegate::DidFinishCopy(
+void CopyOrMoveOperationDelegate::DidFinishCopyDir(
     const FileSystemURL& src,
     const StatusCallback& callback,
     base::PlatformFileError error) {
@@ -198,7 +200,7 @@
     return;
   }
 
-  DCHECK_EQ(OPERATION_MOVE, operation_type_);
+  DCHECK_EQ(operation_type_, OPERATION_MOVE);
 
   // Remove the source for finalizing move operation.
   operation_runner()->Remove(
@@ -207,6 +209,84 @@
                  AsWeakPtr(), callback));
 }
 
+void CopyOrMoveOperationDelegate::DidFinishCopy(
+    const URLPair& url_pair,
+    const StatusCallback& callback,
+    base::PlatformFileError error) {
+  if (error != base::PLATFORM_FILE_OK) {
+    callback.Run(error);
+    return;
+  }
+
+  // |validator_| is NULL in the same-filesystem case or when the destination
+  // filesystem does not do validation.
+  if (!validator_.get()) {
+    scoped_refptr<webkit_blob::ShareableFileReference> file_ref;
+    DidPostWriteValidation(url_pair, callback, file_ref,
+                           base::PLATFORM_FILE_OK);
+    return;
+  }
+
+  DCHECK(!same_file_system_);
+  operation_runner()->CreateSnapshotFile(
+      url_pair.dest,
+      base::Bind(&CopyOrMoveOperationDelegate::DoPostWriteValidation,
+                 AsWeakPtr(), url_pair, callback));
+}
+
+void CopyOrMoveOperationDelegate::DoPostWriteValidation(
+    const URLPair& url_pair,
+    const StatusCallback& callback,
+    base::PlatformFileError error,
+    const base::PlatformFileInfo& file_info,
+    const base::FilePath& platform_path,
+    const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
+  if (error != base::PLATFORM_FILE_OK) {
+    operation_runner()->Remove(
+        url_pair.dest, true,
+        base::Bind(&CopyOrMoveOperationDelegate::DidRemoveDestForError,
+                   AsWeakPtr(), error, callback));
+    return;
+  }
+
+  DCHECK(validator_.get());
+  // Note: file_ref passed here to keep the file alive until after
+  // the StartPostWriteValidation operation finishes.
+  validator_->StartPostWriteValidation(
+      platform_path,
+      base::Bind(&CopyOrMoveOperationDelegate::DidPostWriteValidation,
+                 AsWeakPtr(), url_pair, callback, file_ref));
+}
+
+// |file_ref| is unused; it is passed here to make sure the reference is
+// alive until after post-write validation is complete.
+void CopyOrMoveOperationDelegate::DidPostWriteValidation(
+    const URLPair& url_pair,
+    const StatusCallback& callback,
+    const scoped_refptr<webkit_blob::ShareableFileReference>& /*file_ref*/,
+    base::PlatformFileError error) {
+  if (error != base::PLATFORM_FILE_OK) {
+    operation_runner()->Remove(
+        url_pair.dest, true,
+        base::Bind(&CopyOrMoveOperationDelegate::DidRemoveDestForError,
+                   AsWeakPtr(), error, callback));
+    return;
+  }
+
+  if (operation_type_ == OPERATION_COPY) {
+    callback.Run(error);
+    return;
+  }
+
+  DCHECK_EQ(OPERATION_MOVE, operation_type_);
+
+  // Remove the source for finalizing move operation.
+  operation_runner()->Remove(
+      url_pair.src, true /* recursive */,
+      base::Bind(&CopyOrMoveOperationDelegate::DidRemoveSourceForMove,
+                 AsWeakPtr(), callback));
+}
+
 void CopyOrMoveOperationDelegate::DidRemoveSourceForMove(
     const StatusCallback& callback,
     base::PlatformFileError error) {
@@ -229,4 +309,15 @@
       relative);
 }
 
+void CopyOrMoveOperationDelegate::DidRemoveDestForError(
+    base::PlatformFileError prior_error,
+    const StatusCallback& callback,
+    base::PlatformFileError error) {
+  if (error != base::PLATFORM_FILE_OK) {
+    VLOG(1) << "Error removing destination file after validation error: "
+            << error;
+  }
+  callback.Run(prior_error);
+}
+
 }  // namespace fileapi
diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate.h b/webkit/browser/fileapi/copy_or_move_operation_delegate.h
index 4fc3818..21cd942 100644
--- a/webkit/browser/fileapi/copy_or_move_operation_delegate.h
+++ b/webkit/browser/fileapi/copy_or_move_operation_delegate.h
@@ -75,13 +75,33 @@
       const base::PlatformFileInfo& file_info,
       const base::FilePath& platform_path,
       base::PlatformFileError error);
-  void DidFinishCopy(
+  void DidFinishCopyDir(
       const FileSystemURL& src,
       const StatusCallback& callback,
       base::PlatformFileError error);
+  void DidFinishCopy(
+      const URLPair& url_pair,
+      const StatusCallback& callback,
+      base::PlatformFileError error);
+  void DoPostWriteValidation(
+      const URLPair& url_pair,
+      const StatusCallback& callback,
+      base::PlatformFileError error,
+      const base::PlatformFileInfo& file_info,
+      const base::FilePath& platform_path,
+      const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
+  void DidPostWriteValidation(
+      const URLPair& url_pair,
+      const StatusCallback& callback,
+      const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref,
+      base::PlatformFileError error);
   void DidRemoveSourceForMove(
       const StatusCallback& callback,
       base::PlatformFileError error);
+  void DidRemoveDestForError(
+      base::PlatformFileError prior_error,
+      const StatusCallback& callback,
+      base::PlatformFileError error);
 
   FileSystemURL CreateDestURL(const FileSystemURL& src_url) const;
 
diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
index 3008a3b..dbddb27 100644
--- a/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
+++ b/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
@@ -13,12 +13,14 @@
 #include "base/stl_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webkit/browser/fileapi/async_file_test_helper.h"
+#include "webkit/browser/fileapi/copy_or_move_file_validator.h"
 #include "webkit/browser/fileapi/file_system_backend.h"
 #include "webkit/browser/fileapi/file_system_context.h"
 #include "webkit/browser/fileapi/file_system_operation.h"
 #include "webkit/browser/fileapi/file_system_url.h"
 #include "webkit/browser/fileapi/mock_file_system_context.h"
 #include "webkit/browser/fileapi/test_file_set.h"
+#include "webkit/browser/fileapi/test_file_system_backend.h"
 #include "webkit/browser/quota/mock_quota_manager.h"
 #include "webkit/browser/quota/quota_manager.h"
 #include "webkit/common/fileapi/file_system_util.h"
@@ -35,6 +37,61 @@
   ASSERT_EQ(base::PLATFORM_FILE_OK, error);
 }
 
+class TestValidatorFactory : public CopyOrMoveFileValidatorFactory {
+ public:
+  // A factory that creates validators that accept everything or nothing.
+  TestValidatorFactory() {}
+  virtual ~TestValidatorFactory() {}
+
+  virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator(
+      const FileSystemURL& /*src_url*/,
+      const base::FilePath& /*platform_path*/) OVERRIDE {
+    return new TestValidator(true, true, std::string("2"));
+  }
+
+ private:
+  class TestValidator : public CopyOrMoveFileValidator {
+   public:
+    explicit TestValidator(bool pre_copy_valid,
+                           bool post_copy_valid,
+                           const std::string& reject_string)
+        : result_(pre_copy_valid ? base::PLATFORM_FILE_OK
+                                 : base::PLATFORM_FILE_ERROR_SECURITY),
+          write_result_(post_copy_valid ? base::PLATFORM_FILE_OK
+                                        : base::PLATFORM_FILE_ERROR_SECURITY),
+          reject_string_(reject_string) {
+    }
+    virtual ~TestValidator() {}
+
+    virtual void StartPreWriteValidation(
+        const ResultCallback& result_callback) OVERRIDE {
+      // Post the result since a real validator must do work asynchronously.
+      base::MessageLoop::current()->PostTask(
+          FROM_HERE, base::Bind(result_callback, result_));
+    }
+
+    virtual void StartPostWriteValidation(
+        const base::FilePath& dest_platform_path,
+        const ResultCallback& result_callback) OVERRIDE {
+      base::PlatformFileError result = write_result_;
+      std::string unsafe = dest_platform_path.BaseName().AsUTF8Unsafe();
+      if (unsafe.find(reject_string_) != std::string::npos) {
+        result = base::PLATFORM_FILE_ERROR_SECURITY;
+      }
+      // Post the result since a real validator must do work asynchronously.
+      base::MessageLoop::current()->PostTask(
+          FROM_HERE, base::Bind(result_callback, result));
+    }
+
+   private:
+    base::PlatformFileError result_;
+    base::PlatformFileError write_result_;
+    std::string reject_string_;
+
+    DISALLOW_COPY_AND_ASSIGN(TestValidator);
+  };
+};
+
 }  // namespace
 
 class CopyOrMoveOperationTestHelper {
@@ -79,6 +136,14 @@
         base::Bind(&ExpectOk));
     mount_point_provider =
         file_system_context_->GetFileSystemBackend(dest_type_);
+    if (dest_type_ == kFileSystemTypeTest) {
+      TestFileSystemBackend* test_provider =
+          static_cast<TestFileSystemBackend*>(mount_point_provider);
+      scoped_ptr<CopyOrMoveFileValidatorFactory> factory(
+          new TestValidatorFactory);
+      test_provider->set_require_copy_or_move_validator(true);
+      test_provider->InitializeCopyOrMoveFileValidatorFactory(factory.Pass());
+    }
     mount_point_provider->InitializeFileSystem(
         origin_, dest_type_,
         OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT,
@@ -154,10 +219,11 @@
       const test::TestCaseRecord* const test_cases,
       size_t test_case_size) {
     std::map<base::FilePath, const test::TestCaseRecord*> test_case_map;
-    for (size_t i = 0; i < test_case_size; ++i)
+    for (size_t i = 0; i < test_case_size; ++i) {
       test_case_map[
           base::FilePath(test_cases[i].path).NormalizePathSeparators()] =
               &test_cases[i];
+    }
 
     std::queue<FileSystemURL> directories;
     FileEntryList entries;
@@ -186,6 +252,10 @@
       }
     }
     EXPECT_TRUE(test_case_map.empty());
+    std::map<base::FilePath, const test::TestCaseRecord*>::const_iterator it;
+    for (it = test_case_map.begin(); it != test_case_map.end(); ++it) {
+      LOG(ERROR) << "Extra entry: " << it->first.LossyDisplayName();
+    }
   }
 
   base::PlatformFileError ReadDirectory(const FileSystemURL& url,
@@ -430,4 +500,38 @@
   ASSERT_EQ(src_increase, dest_increase);
 }
 
+TEST(LocalFileSystemCopyOrMoveOperationTest,
+     MoveDirectoryFailPostWriteValidation) {
+  CopyOrMoveOperationTestHelper helper(GURL("http://foo"),
+                                       kFileSystemTypeTemporary,
+                                       kFileSystemTypeTest);
+  helper.SetUp();
+
+  FileSystemURL src = helper.SourceURL("a");
+  FileSystemURL dest = helper.DestURL("b");
+
+  // Set up a source directory.
+  ASSERT_EQ(base::PLATFORM_FILE_OK, helper.CreateDirectory(src));
+  ASSERT_EQ(base::PLATFORM_FILE_OK,
+            helper.SetUpTestCaseFiles(src,
+                                      test::kRegularTestCases,
+                                      test::kRegularTestCaseSize));
+
+  // Move it.
+  helper.Move(src, dest);
+
+  // Verify.
+  ASSERT_TRUE(helper.DirectoryExists(src));
+  ASSERT_TRUE(helper.DirectoryExists(dest));
+
+  test::TestCaseRecord kMoveDirResultCases[] = {
+    {false, FILE_PATH_LITERAL("file 0"), 38},
+    {false, FILE_PATH_LITERAL("file 3"), 0},
+  };
+
+  helper.VerifyTestCaseFiles(dest,
+                             kMoveDirResultCases,
+                             arraysize(kMoveDirResultCases));
+}
+
 }  // namespace fileapi
diff --git a/webkit/browser/fileapi/sandbox_context.cc b/webkit/browser/fileapi/sandbox_context.cc
index 819f5d9..222317b 100644
--- a/webkit/browser/fileapi/sandbox_context.cc
+++ b/webkit/browser/fileapi/sandbox_context.cc
@@ -4,6 +4,7 @@
 
 #include "webkit/browser/fileapi/sandbox_context.h"
 
+#include "base/command_line.h"
 #include "base/task_runner_util.h"
 #include "webkit/browser/fileapi/async_file_util_adapter.h"
 #include "webkit/browser/fileapi/file_system_usage_cache.h"
@@ -13,6 +14,11 @@
 
 namespace fileapi {
 
+namespace {
+// A command line switch to disable usage tracking.
+const char kDisableUsageTracking[] = "disable-file-system-usage-tracking";
+}
+
 const base::FilePath::CharType
 SandboxContext::kFileSystemDirectory[] = FILE_PATH_LITERAL("File System");
 
@@ -32,7 +38,10 @@
           quota_manager_proxy,
           file_task_runner,
           sync_file_util(),
-          usage_cache())) {
+          usage_cache())),
+      is_usage_tracking_enabled_(
+          !CommandLine::ForCurrentProcess()->HasSwitch(
+              kDisableUsageTracking)) {
 }
 
 SandboxContext::~SandboxContext() {
diff --git a/webkit/browser/fileapi/sandbox_context.h b/webkit/browser/fileapi/sandbox_context.h
index 75f2368..67bd0f8 100644
--- a/webkit/browser/fileapi/sandbox_context.h
+++ b/webkit/browser/fileapi/sandbox_context.h
@@ -59,6 +59,8 @@
 
   ObfuscatedFileUtil* sync_file_util();
 
+  bool is_usage_tracking_enabled() { return is_usage_tracking_enabled_; }
+
  private:
   scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
 
@@ -68,6 +70,11 @@
 
   scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
 
+  // Indicates if the usage tracking for FileSystem is enabled or not.
+  // The usage tracking is enabled by default and can be disabled by
+  // a command-line switch (--disable-file-system-usage-tracking).
+  bool is_usage_tracking_enabled_;
+
   DISALLOW_COPY_AND_ASSIGN(SandboxContext);
 };
 
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc
index 1c034c9..fb8bea9 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.cc
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc
@@ -5,7 +5,6 @@
 #include "webkit/browser/fileapi/sandbox_file_system_backend.h"
 
 #include "base/bind.h"
-#include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
@@ -49,9 +48,6 @@
     "FileSystem.OpenFileSystemDetailNonthrottled";
 int64 kMinimumStatsCollectionIntervalHours = 1;
 
-// A command line switch to disable usage tracking.
-const char kDisableUsageTracking[] = "disable-file-system-usage-tracking";
-
 enum FileSystemError {
   kOK = 0,
   kIncognito,
@@ -138,12 +134,9 @@
     : file_system_options_(file_system_options),
       sandbox_context_(sandbox_context),
       enable_temporary_file_system_in_incognito_(false),
-      enable_usage_tracking_(
-          !CommandLine::ForCurrentProcess()->HasSwitch(
-              kDisableUsageTracking)),
       weak_factory_(this) {
   // Set quota observers.
-  if (enable_usage_tracking_) {
+  if (sandbox_context_->is_usage_tracking_enabled()) {
     update_observers_ = update_observers_.AddObserver(
         sandbox_context_->quota_observer(),
         sandbox_context_->file_task_runner());
@@ -217,7 +210,7 @@
                  base::Bind(callback, root_url, name),
                  base::Owned(error_ptr)));
 
-  if (enable_usage_tracking_)
+  if (sandbox_context_->is_usage_tracking_enabled())
     return;
 
   // Schedule full usage recalculation on the next launch without
@@ -394,7 +387,7 @@
     const GURL& origin_url,
     fileapi::FileSystemType type) {
   DCHECK(CanHandleType(type));
-  if (!enable_usage_tracking_)
+  if (!sandbox_context_->is_usage_tracking_enabled())
     return 0;
 
   // Don't use usage cache and return recalculated usage for sticky invalidated
diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.h b/webkit/browser/fileapi/sandbox_file_system_backend.h
index 5ac590f..3bf6f29 100644
--- a/webkit/browser/fileapi/sandbox_file_system_backend.h
+++ b/webkit/browser/fileapi/sandbox_file_system_backend.h
@@ -222,11 +222,6 @@
 
   std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_;
 
-  // Indicates if the usage tracking for FileSystem is enabled or not.
-  // The usage tracking is enabled by default and can be disabled by
-  // a command-line switch (--disable-file-system-usage-tracking).
-  bool enable_usage_tracking_;
-
   base::WeakPtrFactory<SandboxFileSystemBackend> weak_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend);
diff --git a/webkit/browser/fileapi/test_file_system_backend.cc b/webkit/browser/fileapi/test_file_system_backend.cc
index b20ce34..4df22b7 100644
--- a/webkit/browser/fileapi/test_file_system_backend.cc
+++ b/webkit/browser/fileapi/test_file_system_backend.cc
@@ -183,6 +183,7 @@
 
 void TestFileSystemBackend::InitializeCopyOrMoveFileValidatorFactory(
     scoped_ptr<CopyOrMoveFileValidatorFactory> factory) {
+  // What purpose is this check serving?
   if (!require_copy_or_move_validator_) {
     DCHECK(!factory);
     return;
diff --git a/webkit/common/gpu/webkit_gpu.target.darwin-arm.mk b/webkit/common/gpu/webkit_gpu.target.darwin-arm.mk
index 137e7c4..2592e3a 100644
--- a/webkit/common/gpu/webkit_gpu.target.darwin-arm.mk
+++ b/webkit/common/gpu/webkit_gpu.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +197,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -307,7 +306,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/gpu/webkit_gpu.target.darwin-mips.mk b/webkit/common/gpu/webkit_gpu.target.darwin-mips.mk
index fa25bab..979ef3b 100644
--- a/webkit/common/gpu/webkit_gpu.target.darwin-mips.mk
+++ b/webkit/common/gpu/webkit_gpu.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +197,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/gpu/webkit_gpu.target.darwin-x86.mk b/webkit/common/gpu/webkit_gpu.target.darwin-x86.mk
index e9a9361..fe573d4 100644
--- a/webkit/common/gpu/webkit_gpu.target.darwin-x86.mk
+++ b/webkit/common/gpu/webkit_gpu.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -84,18 +85,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -115,8 +115,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -201,18 +201,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -232,8 +231,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -305,7 +304,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/gpu/webkit_gpu.target.linux-arm.mk b/webkit/common/gpu/webkit_gpu.target.linux-arm.mk
index 137e7c4..2592e3a 100644
--- a/webkit/common/gpu/webkit_gpu.target.linux-arm.mk
+++ b/webkit/common/gpu/webkit_gpu.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +197,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -307,7 +306,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/gpu/webkit_gpu.target.linux-mips.mk b/webkit/common/gpu/webkit_gpu.target.linux-mips.mk
index fa25bab..979ef3b 100644
--- a/webkit/common/gpu/webkit_gpu.target.linux-mips.mk
+++ b/webkit/common/gpu/webkit_gpu.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -114,8 +114,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +197,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -229,8 +228,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +302,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/gpu/webkit_gpu.target.linux-x86.mk b/webkit/common/gpu/webkit_gpu.target.linux-x86.mk
index e9a9361..fe573d4 100644
--- a/webkit/common/gpu/webkit_gpu.target.linux-x86.mk
+++ b/webkit/common/gpu/webkit_gpu.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_minimal_gyp)/blink_minimal.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -84,18 +85,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -115,8 +115,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -201,18 +201,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_GPU_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -232,8 +231,8 @@
 	$(LOCAL_PATH) \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -305,7 +304,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/common/user_agent/user_agent.target.darwin-arm.mk b/webkit/common/user_agent/user_agent.target.darwin-arm.mk
index 2ffdd66..3b820bf 100644
--- a/webkit/common/user_agent/user_agent.target.darwin-arm.mk
+++ b/webkit/common/user_agent/user_agent.target.darwin-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/user_agent/user_agent.target.darwin-mips.mk b/webkit/common/user_agent/user_agent.target.darwin-mips.mk
index 2077886..7135ff5 100644
--- a/webkit/common/user_agent/user_agent.target.darwin-mips.mk
+++ b/webkit/common/user_agent/user_agent.target.darwin-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/user_agent/user_agent.target.darwin-x86.mk b/webkit/common/user_agent/user_agent.target.darwin-x86.mk
index 038ea4c..ca0ece3 100644
--- a/webkit/common/user_agent/user_agent.target.darwin-x86.mk
+++ b/webkit/common/user_agent/user_agent.target.darwin-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/user_agent/user_agent.target.linux-arm.mk b/webkit/common/user_agent/user_agent.target.linux-arm.mk
index 2ffdd66..3b820bf 100644
--- a/webkit/common/user_agent/user_agent.target.linux-arm.mk
+++ b/webkit/common/user_agent/user_agent.target.linux-arm.mk
@@ -75,10 +75,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -164,10 +164,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/user_agent/user_agent.target.linux-mips.mk b/webkit/common/user_agent/user_agent.target.linux-mips.mk
index 2077886..7135ff5 100644
--- a/webkit/common/user_agent/user_agent.target.linux-mips.mk
+++ b/webkit/common/user_agent/user_agent.target.linux-mips.mk
@@ -74,10 +74,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -162,10 +162,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/user_agent/user_agent.target.linux-x86.mk b/webkit/common/user_agent/user_agent.target.linux-x86.mk
index 038ea4c..ca0ece3 100644
--- a/webkit/common/user_agent/user_agent.target.linux-x86.mk
+++ b/webkit/common/user_agent/user_agent.target.linux-x86.mk
@@ -77,10 +77,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_USER_AGENT_IMPLEMENTATION' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/webkit/common/webkit_common.gyp b/webkit/common/webkit_common.gyp
index af1c688..2957aab 100644
--- a/webkit/common/webkit_common.gyp
+++ b/webkit/common/webkit_common.gyp
@@ -54,6 +54,9 @@
         'resource_response_info.h',
         'resource_type.cc',
         'resource_type.h',
+        'webkit_common_export.h',
+        'webpreferences.cc',
+        'webpreferences.h',
       ],
 
       'conditions': [
diff --git a/webkit/common/webkit_common.target.darwin-arm.mk b/webkit/common/webkit_common.target.darwin-arm.mk
index 48c85c5..002a142 100644
--- a/webkit/common/webkit_common.target.darwin-arm.mk
+++ b/webkit/common/webkit_common.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -79,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -114,8 +115,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -191,19 +192,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -227,8 +227,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/common/webkit_common.target.darwin-mips.mk b/webkit/common/webkit_common.target.darwin-mips.mk
index 2f6caf2..2c68f40 100644
--- a/webkit/common/webkit_common.target.darwin-mips.mk
+++ b/webkit/common/webkit_common.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +80,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -113,8 +114,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +190,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -225,8 +225,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -297,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/common/webkit_common.target.darwin-x86.mk b/webkit/common/webkit_common.target.darwin-x86.mk
index ff14945..840aaa9 100644
--- a/webkit/common/webkit_common.target.darwin-x86.mk
+++ b/webkit/common/webkit_common.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -81,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -115,8 +116,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -195,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -230,8 +230,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -301,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/common/webkit_common.target.linux-arm.mk b/webkit/common/webkit_common.target.linux-arm.mk
index 48c85c5..002a142 100644
--- a/webkit/common/webkit_common.target.linux-arm.mk
+++ b/webkit/common/webkit_common.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -79,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -114,8 +115,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -191,19 +192,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -227,8 +227,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/common/webkit_common.target.linux-mips.mk b/webkit/common/webkit_common.target.linux-mips.mk
index 2f6caf2..2c68f40 100644
--- a/webkit/common/webkit_common.target.linux-mips.mk
+++ b/webkit/common/webkit_common.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -78,19 +80,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -113,8 +114,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -189,19 +190,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -225,8 +225,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -297,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/common/webkit_common.target.linux-x86.mk b/webkit/common/webkit_common.target.linux-x86.mk
index ff14945..840aaa9 100644
--- a/webkit/common/webkit_common.target.linux-x86.mk
+++ b/webkit/common/webkit_common.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp
@@ -33,7 +34,8 @@
 	webkit/common/resource_devtools_info.cc \
 	webkit/common/resource_request_body.cc \
 	webkit/common/resource_response_info.cc \
-	webkit/common/resource_type.cc
+	webkit/common/resource_type.cc \
+	webkit/common/webpreferences.cc
 
 
 # Flags passed to both C and C++ files.
@@ -81,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -115,8 +116,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -195,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -230,8 +230,8 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -301,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/glue/glue_common.target.linux-arm.mk b/webkit/glue/glue_common.target.linux-arm.mk
deleted file mode 100644
index 4bd571d..0000000
--- a/webkit/glue/glue_common.target.linux-arm.mk
+++ /dev/null
@@ -1,327 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
-
-LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	-fstack-protector \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-fno-tree-sra \
-	-fuse-ld=gold \
-	-Wno-psabi \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fstack-protector \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-abi \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
-
-# Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/glue_common.target.linux-x86.mk b/webkit/glue/glue_common.target.linux-x86.mk
deleted file mode 100644
index 4884fb7..0000000
--- a/webkit/glue/glue_common.target.linux-x86.mk
+++ /dev/null
@@ -1,325 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_glue_glue_common_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
-	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_GENERATED_SOURCES :=
-
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
-
-LOCAL_SRC_FILES := \
-	webkit/common/webpreferences.cc
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Debug := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-g \
-	-fomit-frame-pointer \
-	-fdata-sections \
-	-ffunction-sections
-
-MY_DEFS_Debug := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
-	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
-	'-D_DEBUG'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Debug := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Debug := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-# Flags passed to both C and C++ files.
-MY_CFLAGS_Release := \
-	--param=ssp-buffer-size=4 \
-	-fno-exceptions \
-	-fno-strict-aliasing \
-	-Wno-unused-parameter \
-	-Wno-missing-field-initializers \
-	-fvisibility=hidden \
-	-pipe \
-	-fPIC \
-	-Wno-format \
-	-m32 \
-	-mmmx \
-	-march=pentium4 \
-	-msse2 \
-	-mfpmath=sse \
-	-fuse-ld=gold \
-	-ffunction-sections \
-	-funwind-tables \
-	-g \
-	-fno-short-enums \
-	-finline-limit=64 \
-	-Wa,--noexecstack \
-	-U_FORTIFY_SOURCE \
-	-Wno-extra \
-	-Wno-ignored-qualifiers \
-	-Wno-type-limits \
-	-Wno-address \
-	-Wno-format-security \
-	-Wno-return-type \
-	-Wno-sequence-point \
-	-fno-stack-protector \
-	-Os \
-	-fno-ident \
-	-fdata-sections \
-	-ffunction-sections \
-	-fomit-frame-pointer \
-	-fno-unwind-tables \
-	-fno-asynchronous-unwind-tables
-
-MY_DEFS_Release := \
-	'-DANGLE_DX11' \
-	'-D_FILE_OFFSET_BITS=64' \
-	'-DNO_TCMALLOC' \
-	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
-	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
-	'-DDISABLE_NACL' \
-	'-DCHROMIUM_BUILD' \
-	'-DUSE_LIBJPEG_TURBO=1' \
-	'-DUSE_PROPRIETARY_CODECS' \
-	'-DENABLE_GPU=1' \
-	'-DUSE_OPENSSL=1' \
-	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DWEBKIT_COMMON_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
-	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
-	'-DSK_BUILD_FOR_ANDROID' \
-	'-DU_USING_ICU_NAMESPACE=0' \
-	'-DANDROID' \
-	'-D__GNU_SOURCE=1' \
-	'-DUSE_STLPORT=1' \
-	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
-	'-DCHROME_BUILD_ID=""' \
-	'-DNDEBUG' \
-	'-DNVALGRIND' \
-	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
-
-
-# Include paths placed before CFLAGS/CPPFLAGS
-LOCAL_C_INCLUDES_Release := \
-	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
-	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/third_party/khronos \
-	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/skia/src/core \
-	$(LOCAL_PATH)/third_party/skia/include/config \
-	$(LOCAL_PATH)/third_party/skia/include/core \
-	$(LOCAL_PATH)/third_party/skia/include/effects \
-	$(LOCAL_PATH)/third_party/skia/include/pdf \
-	$(LOCAL_PATH)/third_party/skia/include/gpu \
-	$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
-	$(LOCAL_PATH)/third_party/skia/include/lazy \
-	$(LOCAL_PATH)/third_party/skia/include/pathops \
-	$(LOCAL_PATH)/third_party/skia/include/pipe \
-	$(LOCAL_PATH)/third_party/skia/include/ports \
-	$(LOCAL_PATH)/third_party/skia/include/utils \
-	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
-	$(PWD)/external/icu4c/common \
-	$(PWD)/external/icu4c/i18n \
-	$(LOCAL_PATH)/third_party/npapi \
-	$(LOCAL_PATH)/third_party/npapi/bindings \
-	$(LOCAL_PATH)/v8/include \
-	$(gyp_shared_intermediate_dir)/ui/ui_resources \
-	$(PWD)/frameworks/wilhelm/include \
-	$(PWD)/bionic \
-	$(PWD)/external/stlport/stlport
-
-
-# Flags passed to only C++ (and not C) files.
-LOCAL_CPPFLAGS_Release := \
-	-fno-rtti \
-	-fno-threadsafe-statics \
-	-fvisibility-inlines-hidden \
-	-Wno-deprecated \
-	-Wno-error=c++0x-compat \
-	-Wno-non-virtual-dtor \
-	-Wno-sign-promo \
-	-Wno-non-virtual-dtor
-
-
-LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
-LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
-LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
-	ui_ui_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_glue_glue_common_gyp
-
-# Alias gyp target name.
-.PHONY: glue_common
-glue_common: webkit_glue_glue_common_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index 396ddc8..2c88b76 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -130,7 +130,6 @@
         '<(DEPTH)/net/net.gyp:net',
         '<(DEPTH)/printing/printing.gyp:printing',
         '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
@@ -141,7 +140,6 @@
         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
         '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
         '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common',
-        '<(DEPTH)/webkit/glue/webkit_glue_common.gyp:glue_common',
         '<(DEPTH)/webkit/plugins/webkit_plugins.gyp:plugins_common',
         '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
         '<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser',
@@ -149,7 +147,6 @@
         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
         'plugins',
-        'webkit_media',
       ],
       'include_dirs': [
         '<(INTERMEDIATE_DIR)',
@@ -201,9 +198,9 @@
             }],
           ],
         }],
-        ['OS=="linux" and component=="shared_library" and linux_use_tcmalloc==1', {
+        ['chrome_multiple_dll!=1', {
           'dependencies': [
-            '<(DEPTH)/base/allocator/allocator.gyp:allocator',
+            '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
           ],
         }],
       ],
diff --git a/webkit/glue/webkit_glue_common.gyp b/webkit/glue/webkit_glue_common.gyp
deleted file mode 100644
index 51f152e..0000000
--- a/webkit/glue/webkit_glue_common.gyp
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'glue_common',
-      'type': '<(component)',
-      'variables': { 'enable_wexit_time_destructors': 1, },
-      'defines': [
-        'WEBKIT_COMMON_IMPLEMENTATION',
-      ],
-      'dependencies': [
-        '<(DEPTH)/base/base.gyp:base',
-        '<(DEPTH)/base/base.gyp:base_i18n',
-        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
-        '<(DEPTH)/net/net.gyp:net',
-        '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
-        '<(DEPTH)/ui/ui.gyp:ui',
-        '<(DEPTH)/ui/ui.gyp:ui_resources',
-        '<(DEPTH)/url/url.gyp:url_lib',
-      ],
-      'sources': [
-        '../common/webkit_common_export.h',
-        '../common/webpreferences.cc',
-        '../common/webpreferences.h',
-      ],
-      'conditions': [
-        ['toolkit_uses_gtk == 1', {
-          'dependencies': [
-            '<(DEPTH)/build/linux/system.gyp:gtk',
-          ],
-          'sources/': [['exclude', '_x11\\.cc$']],
-        }],
-        ['OS!="mac"', {
-          'sources/': [['exclude', '_mac\\.(cc|mm)$']],
-        }, {  # else: OS=="mac"
-          'link_settings': {
-            'libraries': [
-              '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
-            ],
-          },
-        }],
-        ['OS!="win"', {
-          'sources/': [['exclude', '_win\\.cc$']],
-        }, {  # else: OS=="win"
-          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-          'msvs_disabled_warnings': [ 4800, 4267 ],
-          'sources/': [['exclude', '_posix\\.cc$']],
-          'include_dirs': [
-            '<(DEPTH)/third_party/wtl/include',
-          ],
-        }],
-      ],
-    },
-  ],
-}
diff --git a/webkit/plugins/plugins_common.target.darwin-arm.mk b/webkit/plugins/plugins_common.target.darwin-arm.mk
index c7450c7..7c1a825 100644
--- a/webkit/plugins/plugins_common.target.darwin-arm.mk
+++ b/webkit/plugins/plugins_common.target.darwin-arm.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/webkit/plugins/plugins_common.target.darwin-mips.mk b/webkit/plugins/plugins_common.target.darwin-mips.mk
index 091ad2a..32b422c 100644
--- a/webkit/plugins/plugins_common.target.darwin-mips.mk
+++ b/webkit/plugins/plugins_common.target.darwin-mips.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/webkit/plugins/plugins_common.target.darwin-x86.mk b/webkit/plugins/plugins_common.target.darwin-x86.mk
index db518b0..2e7ff4e 100644
--- a/webkit/plugins/plugins_common.target.darwin-x86.mk
+++ b/webkit/plugins/plugins_common.target.darwin-x86.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
diff --git a/webkit/plugins/plugins_common.target.linux-arm.mk b/webkit/plugins/plugins_common.target.linux-arm.mk
index c7450c7..7c1a825 100644
--- a/webkit/plugins/plugins_common.target.linux-arm.mk
+++ b/webkit/plugins/plugins_common.target.linux-arm.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/webkit/plugins/plugins_common.target.linux-mips.mk b/webkit/plugins/plugins_common.target.linux-mips.mk
index 091ad2a..32b422c 100644
--- a/webkit/plugins/plugins_common.target.linux-mips.mk
+++ b/webkit/plugins/plugins_common.target.linux-mips.mk
@@ -76,10 +76,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DU_USING_ICU_NAMESPACE=0' \
diff --git a/webkit/plugins/plugins_common.target.linux-x86.mk b/webkit/plugins/plugins_common.target.linux-x86.mk
index db518b0..2e7ff4e 100644
--- a/webkit/plugins/plugins_common.target.linux-x86.mk
+++ b/webkit/plugins/plugins_common.target.linux-x86.mk
@@ -78,10 +78,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc
index 80cea1b..f28f6d2 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.cc
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc
@@ -7,10 +7,12 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop_proxy.h"
 #include "ppapi/c/pp_errors.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
 #include "ppapi/shared_impl/ppapi_preferences.h"
 #include "third_party/WebKit/public/platform/WebGamepads.h"
 #include "webkit/plugins/ppapi/mock_platform_image_2d.h"
 #include "webkit/plugins/ppapi/plugin_delegate.h"
+#include "webkit/plugins/ppapi/plugin_module.h"
 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
 
 namespace webkit {
@@ -409,5 +411,15 @@
     const WebKit::WebURLResponse& response) {
 }
 
+content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule(
+    scoped_refptr<PluginModule> module,
+    const base::FilePath& path,
+    ::ppapi::PpapiPermissions permissions,
+    const IPC::ChannelHandle& channel_handle,
+    base::ProcessId plugin_pid,
+    int plugin_child_id) {
+  return NULL;
+}
+
 }  // namespace ppapi
 }  // namespace webkit
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h
index f6e1586..3a65949 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.h
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.h
@@ -182,6 +182,13 @@
   virtual bool IsRunningInProcess(PP_Instance instance) const;
   virtual void HandleDocumentLoad(PluginInstance* instance,
                                   const WebKit::WebURLResponse& response);
+  virtual content::RendererPpapiHost* CreateExternalPluginModule(
+      scoped_refptr<PluginModule> module,
+      const base::FilePath& path,
+      ::ppapi::PpapiPermissions permissions,
+      const IPC::ChannelHandle& channel_handle,
+      base::ProcessId plugin_pid,
+      int plugin_child_id);
 };
 
 }  // namespace ppapi
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index 292d0e4..59f31f2 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -44,6 +44,10 @@
 class TransportDIB;
 struct PP_NetAddress_Private;
 
+namespace IPC {
+struct ChannelHandle;
+}
+
 namespace WebKit {
 class WebGraphicsContext3D;
 }
@@ -53,6 +57,10 @@
 class Time;
 }
 
+namespace content {
+class RendererPpapiHost;
+}
+
 namespace fileapi {
 struct DirectoryEntry;
 }
@@ -68,6 +76,7 @@
 
 namespace ppapi {
 class PepperFilePath;
+class PpapiPermissions;
 class PPB_X509Certificate_Fields;
 class SocketOptionData;
 struct DeviceRefData;
@@ -685,6 +694,16 @@
   // loader using set_document_loader.
   virtual void HandleDocumentLoad(PluginInstance* instance,
                                   const WebKit::WebURLResponse& response) = 0;
+
+  // Sets up the renderer host and out-of-process proxy for an external plugin
+  // module. Returns the renderer host, or NULL if it couldn't be created.
+  virtual content::RendererPpapiHost* CreateExternalPluginModule(
+      scoped_refptr<PluginModule> module,
+      const base::FilePath& path,
+      ::ppapi::PpapiPermissions permissions,
+      const IPC::ChannelHandle& channel_handle,
+      base::ProcessId plugin_pid,
+      int plugin_child_id) = 0;
 };
 
 }  // namespace ppapi
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 88c234f..dddabcc 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -480,27 +480,29 @@
   out_of_process_proxy_.reset(out_of_process_proxy);
 }
 
-scoped_refptr<PluginModule> PluginModule::CreateModuleForNaClInstance() {
+scoped_refptr<PluginModule>
+    PluginModule::CreateModuleForExternalPluginInstance() {
   // Create a new module, but don't set the lifetime delegate. This isn't a
   // plugin in the usual sense, so it isn't tracked by the browser.
-  scoped_refptr<PluginModule> nacl_module(
+  scoped_refptr<PluginModule> external_plugin_module(
       new PluginModule(name_,
                        path_,
                        NULL,  // no lifetime_delegate
                        permissions_));
-  return nacl_module;
+  return external_plugin_module;
 }
 
-PP_NaClResult PluginModule::InitAsProxiedNaCl(PluginInstance* instance) {
+PP_ExternalPluginResult PluginModule::InitAsProxiedExternalPlugin(
+    PluginInstance* instance) {
   DCHECK(out_of_process_proxy_.get());
   // InitAsProxied (for the trusted/out-of-process case) initializes only the
   // module, and one or more instances are added later. In this case, the
   // PluginInstance was already created as in-process, so we missed the proxy
   // AddInstance step and must do it now.
   out_of_process_proxy_->AddInstance(instance->pp_instance());
-  // In NaCl, we need to tell the instance to reset itself as proxied. This will
-  // clear cached interface pointers and send DidCreate (etc) to the plugin
-  // side of the proxy.
+  // For external plugins, we need to tell the instance to reset itself as
+  // proxied. This will clear cached interface pointers and send DidCreate (etc)
+  // to the plugin side of the proxy.
   return instance->ResetAsProxied(this);
 }
 
diff --git a/webkit/plugins/ppapi/plugin_module.h b/webkit/plugins/ppapi/plugin_module.h
index e58785c..fe8f62e 100644
--- a/webkit/plugins/ppapi/plugin_module.h
+++ b/webkit/plugins/ppapi/plugin_module.h
@@ -21,7 +21,7 @@
 #include "ppapi/c/pp_module.h"
 #include "ppapi/c/ppb.h"
 #include "ppapi/c/ppb_core.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
+#include "ppapi/c/private/ppb_instance_private.h"
 #include "ppapi/shared_impl/ppapi_permissions.h"
 #include "webkit/plugins/ppapi/plugin_delegate.h"
 #include "webkit/plugins/webkit_plugins_export.h"
@@ -117,15 +117,16 @@
   // ownership of the given pointer, even in the failure case.
   void InitAsProxied(PluginDelegate::OutOfProcessProxy* out_of_process_proxy);
 
-  // Creates a new module for a NaCl instance that will be using the IPC proxy.
-  // We can't use the existing module, or new instances of the plugin can't
-  // be created.
-  scoped_refptr<PluginModule> CreateModuleForNaClInstance();
+  // Creates a new module for an external plugin instance that will be using the
+  // IPC proxy. We can't use the existing module, or new instances of the plugin
+  // can't be created.
+  scoped_refptr<PluginModule> CreateModuleForExternalPluginInstance();
 
-  // Initializes the NaCl module for the out of process proxy. InitAsProxied
-  // must be called before calling InitAsProxiedNaCl. Returns a NaCl result code
-  // indicating whether the proxy started successfully or there was an error.
-  PP_NaClResult InitAsProxiedNaCl(PluginInstance* instance);
+  // Initializes the external plugin module for the out of process proxy.
+  // InitAsProxied must be called before calling InitAsProxiedExternalPlugin.
+  // Returns a result code indicating whether the proxy started successfully or
+  // there was an error.
+  PP_ExternalPluginResult InitAsProxiedExternalPlugin(PluginInstance* instance);
 
   bool IsProxied() const;
 
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 64aa18f..3cc6b7f 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -31,6 +31,7 @@
 #include "ppapi/c/ppp_messaging.h"
 #include "ppapi/c/ppp_mouse_lock.h"
 #include "ppapi/c/private/ppp_instance_private.h"
+#include "ppapi/shared_impl/ppapi_permissions.h"
 #include "ppapi/shared_impl/ppapi_preferences.h"
 #include "ppapi/shared_impl/ppb_gamepad_shared.h"
 #include "ppapi/shared_impl/ppb_input_event_shared.h"
@@ -47,6 +48,7 @@
 #include "printing/metafile.h"
 #include "printing/metafile_skia_wrapper.h"
 #include "printing/units.h"
+#include "skia/ext/platform_canvas.h"
 #include "skia/ext/platform_device.h"
 #include "third_party/WebKit/public/platform/WebGamepads.h"
 #include "third_party/WebKit/public/platform/WebString.h"
@@ -70,6 +72,8 @@
 #include "third_party/skia/include/core/SkCanvas.h"
 #include "third_party/skia/include/core/SkRect.h"
 #include "ui/base/range/range.h"
+#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/image/image_skia_rep.h"
 #include "ui/gfx/rect_conversions.h"
 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
 #include "v8/include/v8.h"
@@ -85,6 +89,7 @@
 #include "webkit/plugins/ppapi/plugin_module.h"
 #include "webkit/plugins/ppapi/plugin_object.h"
 #include "webkit/plugins/ppapi/ppb_buffer_impl.h"
+#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h"
 #include "webkit/plugins/ppapi/ppb_image_data_impl.h"
 #include "webkit/plugins/ppapi/ppp_pdf.h"
@@ -2454,7 +2459,7 @@
                                                         components);
 }
 
-PP_NaClResult PluginInstance::ResetAsProxied(
+PP_ExternalPluginResult PluginInstance::ResetAsProxied(
     scoped_refptr<PluginModule> module) {
   // Save the original module and switch over to the new one now that this
   // plugin is using the IPC-based proxy.
@@ -2477,7 +2482,7 @@
     // While this could be a failure to implement the interface in the NaCl
     // module, it is more likely that the NaCl process has crashed. Either
     // way, report that module initialization failed.
-    return PP_NACL_ERROR_MODULE;
+    return PP_EXTERNAL_PLUGIN_ERROR_MODULE;
   }
 
   instance_interface_.reset(ppp_instance_combined);
@@ -2500,7 +2505,7 @@
   scoped_ptr<const char*[]> argv_array(StringVectorToArgArray(argv_));
   if (!instance_interface_->DidCreate(pp_instance(), argn_.size(),
                                       argn_array.get(), argv_array.get()))
-    return PP_NACL_ERROR_INSTANCE;
+    return PP_EXTERNAL_PLUGIN_ERROR_INSTANCE;
   message_channel_->StopQueueingJavaScriptMessages();
 
   // Clear sent_initial_did_change_view_ and cancel any pending DidChangeView
@@ -2522,7 +2527,7 @@
     nacl_document_loader_.reset(NULL);
   }
 
-  return PP_NACL_OK;
+  return PP_EXTERNAL_PLUGIN_OK;
 }
 
 bool PluginInstance::IsValidInstanceOf(PluginModule* module) {
@@ -2539,6 +2544,89 @@
   return isolate_;
 }
 
+PluginInstance* PluginInstance::Get(PP_Instance instance_id) {
+  return HostGlobals::Get()->GetInstance(instance_id);
+}
+
+::ppapi::VarTracker* PluginInstance::GetVarTracker() {
+  return HostGlobals::Get()->GetVarTracker();
+}
+
+PP_Resource PluginInstance::CreateExternalFileReference(
+    const base::FilePath& external_file_path) {
+  webkit::ppapi::PPB_FileRef_Impl* ref =
+      webkit::ppapi::PPB_FileRef_Impl::CreateExternal(
+          pp_instance(), external_file_path, "");
+  return ref->GetReference();
+}
+
+PP_Resource PluginInstance::CreateImage(gfx::ImageSkia* source_image,
+                                        float scale) {
+  ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale);
+  gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(
+      scale_factor);
+
+  if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor)
+    return 0;
+
+  scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data(
+      new webkit::ppapi::PPB_ImageData_Impl(
+          pp_instance(),
+          webkit::ppapi::PPB_ImageData_Impl::PLATFORM));
+  if (!image_data->Init(
+          webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(),
+          image_skia_rep.pixel_width(),
+          image_skia_rep.pixel_height(),
+          false)) {
+    return 0;
+  }
+
+  webkit::ppapi::ImageDataAutoMapper mapper(image_data.get());
+  if (!mapper.is_valid())
+    return 0;
+
+  skia::PlatformCanvas* canvas = image_data->GetPlatformCanvas();
+  // Note: Do not SkBitmap::copyTo the canvas bitmap directly because it will
+  // ignore the allocated pixels in shared memory and re-allocate a new buffer.
+  canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0);
+
+  return image_data->GetReference();
+}
+
+base::FilePath PluginInstance::GetModulePath() {
+  return module_->path();
+}
+
+PP_ExternalPluginResult PluginInstance::SwitchToOutOfProcessProxy(
+    const base::FilePath& file_path,
+    ::ppapi::PpapiPermissions permissions,
+    const IPC::ChannelHandle& channel_handle,
+    base::ProcessId plugin_pid,
+    int plugin_child_id) {
+  // Create a new module for each instance of the external plugin that is using
+  // the IPC based out-of-process proxy. We can't use the existing module,
+  // because it is configured for the in-process plugin, and we must keep it
+  // that way to allow the page to create other instances.
+  scoped_refptr<webkit::ppapi::PluginModule> external_plugin_module(
+      module_->CreateModuleForExternalPluginInstance());
+
+  content::RendererPpapiHost* renderer_ppapi_host =
+      delegate_->CreateExternalPluginModule(
+          external_plugin_module,
+          file_path,
+          permissions,
+          channel_handle,
+          plugin_pid,
+          plugin_child_id);
+  if (!renderer_ppapi_host) {
+    DLOG(ERROR) << "CreateExternalPluginModule() failed";
+    return PP_EXTERNAL_PLUGIN_ERROR_MODULE;
+  }
+
+  // Finally, switch the instance to the proxy.
+  return external_plugin_module->InitAsProxiedExternalPlugin(this);
+}
+
 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) {
   cursor_.reset(cursor);
   if (fullscreen_container_) {
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 82d9f89..11bde42 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -35,7 +35,6 @@
 #include "ppapi/c/ppp_messaging.h"
 #include "ppapi/c/ppp_mouse_lock.h"
 #include "ppapi/c/private/ppb_content_decryptor_private.h"
-#include "ppapi/c/private/ppb_nacl_private.h"
 #include "ppapi/c/private/ppp_instance_private.h"
 #include "ppapi/shared_impl/ppb_instance_shared.h"
 #include "ppapi/shared_impl/ppb_view_shared.h"
@@ -63,6 +62,10 @@
 class SkBitmap;
 class TransportDIB;
 
+namespace IPC {
+struct ChannelHandle;
+}
+
 namespace WebKit {
 class WebInputEvent;
 class WebLayer;
@@ -84,10 +87,16 @@
 class RenderView;
 }
 
+namespace gfx {
+class ImageSkia;
+}
+
 namespace ppapi {
+class PpapiPermissions;
+class Resource;
+class VarTracker;
 struct InputEventData;
 struct PPP_Instance_Combined;
-class Resource;
 struct URLRequestInfoData;
 }
 
@@ -492,9 +501,9 @@
   // Reset this instance as proxied. Assigns the instance a new module, resets
   // cached interfaces to point to the out-of-process proxy and re-sends
   // DidCreate, DidChangeView, and HandleDocumentLoad (if necessary).
-  // This should be used only when switching a trusted NaCl in-process instance
-  // to an untrusted NaCl out-of-process instance.
-  PP_NaClResult ResetAsProxied(scoped_refptr<PluginModule> module);
+  // This should be used only when switching an in-process instance to an
+  // external out-of-process instance.
+  PP_ExternalPluginResult ResetAsProxied(scoped_refptr<PluginModule> module);
 
   // Checks whether this is a valid instance of the given module. After calling
   // ResetAsProxied above, a NaCl plugin instance's module changes, so external
@@ -511,6 +520,29 @@
   // This is not inlined so as to avoid an unnecessary header include of v8.h.
   v8::Isolate* GetIsolate() const;
 
+  static PluginInstance* Get(PP_Instance instance_id);
+
+  ::ppapi::VarTracker* GetVarTracker();
+
+  // Returns a reference to a file with the given path.
+  // The returned object will have a refcount of 0 (just like "new").
+  PP_Resource CreateExternalFileReference(
+      const base::FilePath& external_file_path);
+
+  // Creates a PPB_ImageData given a Skia image.
+  PP_Resource CreateImage(gfx::ImageSkia* source_image, float scale);
+
+  // Returns the location of this module.
+  base::FilePath GetModulePath();
+
+  // Switches this instance with one that uses the out of process IPC proxy.
+  PP_ExternalPluginResult SwitchToOutOfProcessProxy(
+      const base::FilePath& file_path,
+      ::ppapi::PpapiPermissions permissions,
+      const IPC::ChannelHandle& channel_handle,
+      base::ProcessId plugin_pid,
+      int plugin_child_id);
+
  private:
   friend class PpapiUnittest;
 
diff --git a/webkit/plugins/webkit_plugins.gypi b/webkit/plugins/webkit_plugins.gypi
index c63f524..b27d304 100644
--- a/webkit/plugins/webkit_plugins.gypi
+++ b/webkit/plugins/webkit_plugins.gypi
@@ -37,7 +37,6 @@
         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
         '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
         '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common',
-        '<(DEPTH)/webkit/glue/webkit_glue_common.gyp:glue_common',
         '<(DEPTH)/webkit/plugins/webkit_plugins.gyp:plugins_common',
         '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
         '<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common',
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-arm.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-arm.mk
index e406404..fb0dca7 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-arm.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -89,19 +90,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -124,8 +124,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -204,19 +204,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -240,8 +239,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -319,7 +318,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-mips.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-mips.mk
index 43da8c5..85588a9 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-mips.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -88,19 +89,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -123,8 +123,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -202,19 +202,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -238,8 +237,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -313,7 +312,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-x86.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-x86.mk
index 67b78d7..7154660 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-x86.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -91,19 +92,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -125,8 +125,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -208,19 +208,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -243,8 +242,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -317,7 +316,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-arm.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-arm.mk
index e406404..fb0dca7 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-arm.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -89,19 +90,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -124,8 +124,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -204,19 +204,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -240,8 +239,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -319,7 +318,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-mips.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-mips.mk
index 43da8c5..85588a9 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-mips.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -88,19 +89,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -123,8 +123,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -202,19 +202,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-D__STDC_CONSTANT_MACROS' \
@@ -238,8 +237,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -313,7 +312,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-x86.mk b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-x86.mk
index 67b78d7..7154660 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-x86.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_bindings.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,gpu_gpu_gyp)/gpu.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
 
@@ -91,19 +92,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -125,8 +125,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -208,19 +208,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_COMPOSITOR_BINDINGS_IMPLEMENTATION=1' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -243,8 +242,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -317,7 +316,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-arm.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-arm.mk
index c747d6f..c444477 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-arm.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -70,17 +71,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -103,8 +103,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -177,17 +177,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -211,8 +210,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -284,7 +283,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-mips.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-mips.mk
index 4bee403..929a3cc 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-mips.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -69,17 +70,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -102,8 +102,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -175,17 +175,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -209,8 +208,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -278,7 +277,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-x86.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-x86.mk
index b636855..3ff4531 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-x86.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -72,17 +73,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -105,8 +105,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -182,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -216,8 +215,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -284,7 +283,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-arm.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-arm.mk
index c747d6f..c444477 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-arm.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -70,17 +71,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -103,8 +103,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -177,17 +177,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -211,8 +210,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -284,7 +283,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-mips.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-mips.mk
index 4bee403..929a3cc 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-mips.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -69,17 +70,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -102,8 +102,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -175,17 +175,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -209,8 +208,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -278,7 +277,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-x86.mk b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-x86.mk
index b636855..3ff4531 100644
--- a/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-x86.mk
+++ b/webkit/renderer/compositor_bindings/webkit_compositor_support.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -72,17 +73,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -105,8 +105,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -182,17 +182,16 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -216,8 +215,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -284,7 +283,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/renderer/media/webkit_media.gypi b/webkit/renderer/media/webkit_media.gypi
index 7fa81ff..198ebfe 100644
--- a/webkit/renderer/media/webkit_media.gypi
+++ b/webkit/renderer/media/webkit_media.gypi
@@ -20,44 +20,6 @@
   },
   'targets': [
     {
-      'target_name': 'webkit_media',
-      'type': 'static_library',
-      'variables': { 'enable_wexit_time_destructors': 1, },
-      'dependencies': [
-        '<(DEPTH)/base/base.gyp:base',
-        '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
-        '<(DEPTH)/cc/cc.gyp:cc',
-        '<(DEPTH)/media/media.gyp:media',
-        '<(DEPTH)/media/media.gyp:shared_memory_support',
-        '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
-        '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
-      ],
-      'sources': [
-        'crypto/ppapi_decryptor.cc',
-        'crypto/ppapi_decryptor.h',
-      ],
-      'conditions': [
-        ['OS == "android"', {
-          'dependencies': [
-            '<(DEPTH)/media/media.gyp:player_android',
-          ],
-        }, { # OS != "android"'
-          'sources/': [
-            ['exclude', '^android/'],
-          ],
-        }],
-        ['enable_pepper_cdms != 1', {
-          'sources!': [
-            'crypto/ppapi_decryptor.cc',
-            'crypto/ppapi_decryptor.h',
-          ],
-        }],
-      ],
-      # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-      'msvs_disabled_warnings': [ 4267, ],
-    },
-    {
       'target_name': 'clearkeycdm',
       'type': 'none',
       # TODO(tomfinegan): Simplify this by unconditionally including all the
diff --git a/webkit/renderer/webkit_renderer.gyp b/webkit/renderer/webkit_renderer.gyp
index 14de2b9..dd7209a 100644
--- a/webkit/renderer/webkit_renderer.gyp
+++ b/webkit/renderer/webkit_renderer.gyp
@@ -21,7 +21,6 @@
         '<(DEPTH)/ui/ui.gyp:ui',
         '<(DEPTH)/url/url.gyp:url_lib',
         '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common',
-        '<(DEPTH)/webkit/glue/webkit_glue_common.gyp:glue_common',
       ],
       'sources': [
         'cpp_bound_class.cc',
diff --git a/webkit/renderer/webkit_renderer.target.darwin-arm.mk b/webkit/renderer/webkit_renderer.target.darwin-arm.mk
index 2e729c1..0afefea 100644
--- a/webkit/renderer/webkit_renderer.target.darwin-arm.mk
+++ b/webkit/renderer/webkit_renderer.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -80,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -112,8 +112,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,19 +196,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -308,7 +307,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/webkit_renderer.target.darwin-mips.mk b/webkit/renderer/webkit_renderer.target.darwin-mips.mk
index deb3d23..4449c2d 100644
--- a/webkit/renderer/webkit_renderer.target.darwin-mips.mk
+++ b/webkit/renderer/webkit_renderer.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -80,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -112,8 +112,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,19 +196,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -304,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/webkit_renderer.target.darwin-x86.mk b/webkit/renderer/webkit_renderer.target.darwin-x86.mk
index e0ce7b6..162968b 100644
--- a/webkit/renderer/webkit_renderer.target.darwin-x86.mk
+++ b/webkit/renderer/webkit_renderer.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -113,8 +113,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -200,18 +200,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -231,8 +230,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -306,7 +305,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/webkit_renderer.target.linux-arm.mk b/webkit/renderer/webkit_renderer.target.linux-arm.mk
index 2e729c1..0afefea 100644
--- a/webkit/renderer/webkit_renderer.target.linux-arm.mk
+++ b/webkit/renderer/webkit_renderer.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -80,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -112,8 +112,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,19 +196,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -308,7 +307,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/webkit_renderer.target.linux-mips.mk b/webkit/renderer/webkit_renderer.target.linux-mips.mk
index deb3d23..4449c2d 100644
--- a/webkit/renderer/webkit_renderer.target.linux-mips.mk
+++ b/webkit/renderer/webkit_renderer.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -80,19 +81,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -112,8 +112,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -196,19 +196,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -228,8 +227,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -304,7 +303,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/renderer/webkit_renderer.target.linux-x86.mk b/webkit/renderer/webkit_renderer.target.linux-x86.mk
index e0ce7b6..162968b 100644
--- a/webkit/renderer/webkit_renderer.target.linux-x86.mk
+++ b/webkit/renderer/webkit_renderer.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a
@@ -82,18 +83,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -113,8 +113,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -200,18 +200,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -231,8 +230,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -306,7 +305,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/storage_browser.gyp b/webkit/storage_browser.gyp
index 73ebdcc..cdc4aaf 100644
--- a/webkit/storage_browser.gyp
+++ b/webkit/storage_browser.gyp
@@ -14,7 +14,6 @@
         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
         '<(DEPTH)/net/net.gyp:net',
         '<(DEPTH)/sql/sql.gyp:sql',
-        '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
         '<(DEPTH)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
         '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
         '<(DEPTH)/url/url.gyp:url_lib',
@@ -243,6 +242,14 @@
       ],
       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
       'msvs_disabled_warnings': [ 4267, ],
+
+      'conditions': [
+        ['chrome_multiple_dll!=1', {
+          'dependencies': [
+            '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
+          ],
+        }],
+      ],
     },
     {
       'target_name': 'dump_file_system',
diff --git a/webkit/support/glue.target.darwin-arm.mk b/webkit/support/glue.target.darwin-arm.mk
index 719ac3a..9debda3 100644
--- a/webkit/support/glue.target.darwin-arm.mk
+++ b/webkit/support/glue.target.darwin-arm.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -88,20 +89,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -126,8 +126,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -140,7 +140,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -149,6 +148,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -217,20 +217,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -256,8 +255,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -270,7 +269,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -279,6 +277,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -340,7 +339,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue.target.darwin-mips.mk b/webkit/support/glue.target.darwin-mips.mk
index c80e2fa..bc3c5af 100644
--- a/webkit/support/glue.target.darwin-mips.mk
+++ b/webkit/support/glue.target.darwin-mips.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -87,20 +88,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -125,8 +125,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -139,7 +139,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -148,6 +147,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -215,20 +215,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -254,8 +253,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -268,7 +267,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -277,6 +275,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -334,7 +333,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue.target.darwin-x86.mk b/webkit/support/glue.target.darwin-x86.mk
index 46fa989..cdd651c 100644
--- a/webkit/support/glue.target.darwin-x86.mk
+++ b/webkit/support/glue.target.darwin-x86.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -90,19 +91,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -127,8 +127,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -141,7 +141,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -150,6 +149,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -221,19 +221,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -259,8 +258,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -273,7 +272,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -282,6 +280,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -338,7 +337,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue.target.linux-arm.mk b/webkit/support/glue.target.linux-arm.mk
index 719ac3a..9debda3 100644
--- a/webkit/support/glue.target.linux-arm.mk
+++ b/webkit/support/glue.target.linux-arm.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -88,20 +89,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -126,8 +126,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -140,7 +140,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -149,6 +148,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -217,20 +217,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -256,8 +255,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -270,7 +269,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -279,6 +277,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -340,7 +339,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue.target.linux-mips.mk b/webkit/support/glue.target.linux-mips.mk
index c80e2fa..bc3c5af 100644
--- a/webkit/support/glue.target.linux-mips.mk
+++ b/webkit/support/glue.target.linux-mips.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -87,20 +88,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -125,8 +125,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -139,7 +139,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -148,6 +147,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -215,20 +215,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -254,8 +253,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -268,7 +267,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -277,6 +275,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -334,7 +333,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue.target.linux-x86.mk b/webkit/support/glue.target.linux-x86.mk
index 46fa989..cdd651c 100644
--- a/webkit/support/glue.target.linux-x86.mk
+++ b/webkit/support/glue.target.linux-x86.mk
@@ -11,8 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
@@ -21,7 +21,8 @@
 	$(call intermediates-dir-for,GYP,ui_ui_resources_gyp)/ui_resources.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
 	$(call intermediates-dir-for,GYP,webkit_webkit_resources_gyp)/webkit_resources.stamp \
-	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp
+	$(call intermediates-dir-for,GYP,webkit_webkit_strings_gyp)/webkit_strings.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -90,19 +91,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -127,8 +127,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -141,7 +141,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -150,6 +149,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -221,19 +221,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_EXTENSIONS_IMPLEMENTATION' \
 	'-DWEBKIT_GLUE_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -259,8 +258,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -273,7 +272,6 @@
 	$(LOCAL_PATH)/third_party/skia/include/ports \
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/skia/ext \
-	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
 	$(LOCAL_PATH)/third_party/npapi \
@@ -282,6 +280,7 @@
 	$(LOCAL_PATH)/third_party/mesa/src/include \
 	$(gyp_shared_intermediate_dir)/ui/ui_resources \
 	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/WebKit \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -338,7 +337,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp
 
diff --git a/webkit/support/glue_child.target.darwin-arm.mk b/webkit/support/glue_child.target.darwin-arm.mk
index 7dc856c..bdfc392 100644
--- a/webkit/support/glue_child.target.darwin-arm.mk
+++ b/webkit/support/glue_child.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -96,19 +97,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -131,8 +131,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -218,19 +218,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -254,8 +253,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -335,7 +334,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/glue_child.target.darwin-mips.mk b/webkit/support/glue_child.target.darwin-mips.mk
index f998e4d..fe80dc4 100644
--- a/webkit/support/glue_child.target.darwin-mips.mk
+++ b/webkit/support/glue_child.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -95,19 +96,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -130,8 +130,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -216,19 +216,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -252,8 +251,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/glue_child.target.darwin-x86.mk b/webkit/support/glue_child.target.darwin-x86.mk
index cb75d40..4eb37fd 100644
--- a/webkit/support/glue_child.target.darwin-x86.mk
+++ b/webkit/support/glue_child.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -98,18 +99,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -132,8 +132,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -222,18 +222,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -257,8 +256,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -333,7 +332,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/glue_child.target.linux-arm.mk b/webkit/support/glue_child.target.linux-arm.mk
index 7dc856c..bdfc392 100644
--- a/webkit/support/glue_child.target.linux-arm.mk
+++ b/webkit/support/glue_child.target.linux-arm.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -96,19 +97,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -131,8 +131,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -218,19 +218,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -254,8 +253,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -335,7 +334,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/glue_child.target.linux-mips.mk b/webkit/support/glue_child.target.linux-mips.mk
index f998e4d..fe80dc4 100644
--- a/webkit/support/glue_child.target.linux-mips.mk
+++ b/webkit/support/glue_child.target.linux-mips.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -95,19 +96,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -130,8 +130,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -216,19 +216,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -252,8 +251,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -329,7 +328,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/glue_child.target.linux-x86.mk b/webkit/support/glue_child.target.linux-x86.mk
index cb75d40..4eb37fd 100644
--- a/webkit/support/glue_child.target.linux-x86.mk
+++ b/webkit/support/glue_child.target.linux-x86.mk
@@ -11,7 +11,8 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
@@ -98,18 +99,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -132,8 +132,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -222,18 +222,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_CHILD_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -257,8 +256,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -333,7 +332,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_ui_gyp
 
 # Enable grouping to fix circular references
diff --git a/webkit/support/overscroller_jni_headers.target.darwin-arm.mk b/webkit/support/overscroller_jni_headers.target.darwin-arm.mk
index db996f7..bbe2db8 100644
--- a/webkit/support/overscroller_jni_headers.target.darwin-arm.mk
+++ b/webkit/support/overscroller_jni_headers.target.darwin-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/overscroller_jni_headers.target.darwin-mips.mk b/webkit/support/overscroller_jni_headers.target.darwin-mips.mk
index 8e51c68..05f1a50 100644
--- a/webkit/support/overscroller_jni_headers.target.darwin-mips.mk
+++ b/webkit/support/overscroller_jni_headers.target.darwin-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/overscroller_jni_headers.target.darwin-x86.mk b/webkit/support/overscroller_jni_headers.target.darwin-x86.mk
index f771054..535f932 100644
--- a/webkit/support/overscroller_jni_headers.target.darwin-x86.mk
+++ b/webkit/support/overscroller_jni_headers.target.darwin-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/overscroller_jni_headers.target.linux-arm.mk b/webkit/support/overscroller_jni_headers.target.linux-arm.mk
index db996f7..bbe2db8 100644
--- a/webkit/support/overscroller_jni_headers.target.linux-arm.mk
+++ b/webkit/support/overscroller_jni_headers.target.linux-arm.mk
@@ -86,10 +86,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -171,10 +171,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/overscroller_jni_headers.target.linux-mips.mk b/webkit/support/overscroller_jni_headers.target.linux-mips.mk
index 8e51c68..05f1a50 100644
--- a/webkit/support/overscroller_jni_headers.target.linux-mips.mk
+++ b/webkit/support/overscroller_jni_headers.target.linux-mips.mk
@@ -85,10 +85,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -169,10 +169,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/overscroller_jni_headers.target.linux-x86.mk b/webkit/support/overscroller_jni_headers.target.linux-x86.mk
index f771054..535f932 100644
--- a/webkit/support/overscroller_jni_headers.target.linux-x86.mk
+++ b/webkit/support/overscroller_jni_headers.target.linux-x86.mk
@@ -88,10 +88,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -176,10 +176,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
diff --git a/webkit/support/plugins.target.darwin-arm.mk b/webkit/support/plugins.target.darwin-arm.mk
index 2c76ec3..5ca3470 100644
--- a/webkit/support/plugins.target.darwin-arm.mk
+++ b/webkit/support/plugins.target.darwin-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -121,20 +122,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,8 +159,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -250,20 +250,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -289,8 +288,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -373,7 +372,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/plugins.target.darwin-mips.mk b/webkit/support/plugins.target.darwin-mips.mk
index bf3d6b0..72511a4 100644
--- a/webkit/support/plugins.target.darwin-mips.mk
+++ b/webkit/support/plugins.target.darwin-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -120,20 +121,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,8 +158,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -248,20 +248,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -287,8 +286,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -367,7 +366,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/plugins.target.darwin-x86.mk b/webkit/support/plugins.target.darwin-x86.mk
index 2343442..a47110e 100644
--- a/webkit/support/plugins.target.darwin-x86.mk
+++ b/webkit/support/plugins.target.darwin-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -123,19 +124,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,8 +160,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -254,19 +254,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -292,8 +291,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -371,7 +370,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/plugins.target.linux-arm.mk b/webkit/support/plugins.target.linux-arm.mk
index 2c76ec3..5ca3470 100644
--- a/webkit/support/plugins.target.linux-arm.mk
+++ b/webkit/support/plugins.target.linux-arm.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -121,20 +122,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -159,8 +159,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -250,20 +250,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -289,8 +288,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -373,7 +372,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/plugins.target.linux-mips.mk b/webkit/support/plugins.target.linux-mips.mk
index bf3d6b0..72511a4 100644
--- a/webkit/support/plugins.target.linux-mips.mk
+++ b/webkit/support/plugins.target.linux-mips.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -120,20 +121,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -158,8 +158,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -248,20 +248,19 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -287,8 +286,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -367,7 +366,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/plugins.target.linux-x86.mk b/webkit/support/plugins.target.linux-x86.mk
index 2343442..a47110e 100644
--- a/webkit/support/plugins.target.linux-x86.mk
+++ b/webkit/support/plugins.target.linux-x86.mk
@@ -12,7 +12,8 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,ppapi_ppapi_c_gyp)/ppapi_c.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
+	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_gl_gl_gyp)/ui_gl_gl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,ui_ui_gyp)/ui_ui_gyp.a \
@@ -123,19 +124,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -160,8 +160,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -254,19 +254,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_PLUGINS_IMPLEMENTATION' \
 	'-DMEDIA_DISABLE_LIBVPX' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -292,8 +291,8 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -371,7 +370,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp \
+	skia_skia_library_gyp \
 	ui_gl_gl_gyp \
 	ui_ui_gyp \
 	webkit_support_glue_child_gyp
diff --git a/webkit/support/webkit_media.target.darwin-mips.mk b/webkit/support/webkit_media.target.darwin-mips.mk
deleted file mode 100644
index 3638ee9..0000000
--- a/webkit/support/webkit_media.target.darwin-mips.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
-
-# Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_media.target.darwin-x86.mk b/webkit/support/webkit_media.target.darwin-x86.mk
deleted file mode 100644
index 8c63eb0..0000000
--- a/webkit/support/webkit_media.target.darwin-x86.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
-
-# Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_media.target.linux-mips.mk b/webkit/support/webkit_media.target.linux-mips.mk
deleted file mode 100644
index 3638ee9..0000000
--- a/webkit/support/webkit_media.target.linux-mips.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-EL \
-	-Wl,--no-keep-memory \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
-
-# Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_media.target.linux-x86.mk b/webkit/support/webkit_media.target.linux-x86.mk
deleted file mode 100644
index 8c63eb0..0000000
--- a/webkit/support/webkit_media.target.linux-x86.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := webkit_support_webkit_media_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--gc-sections \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-m32 \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: webkit_support_webkit_media_gyp
-
-# Alias gyp target name.
-.PHONY: webkit_media
-webkit_media: webkit_support_webkit_media_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/webkit/support/webkit_support.gypi b/webkit/support/webkit_support.gypi
index 4717896..8e6e27a 100644
--- a/webkit/support/webkit_support.gypi
+++ b/webkit/support/webkit_support.gypi
@@ -26,7 +26,6 @@
         '<(DEPTH)/webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
         '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
         '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common',
-        '<(DEPTH)/webkit/glue/webkit_glue_common.gyp:glue_common',
         '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings',
         '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support',
         '<(DEPTH)/webkit/renderer/webkit_renderer.gyp:webkit_renderer',
@@ -36,7 +35,6 @@
         'glue',
         'glue_child',
         'plugins',
-        'webkit_media',
         'webkit_support_common',
       ],
       'include_dirs': [
diff --git a/webkit/webkit_storage_browser.target.darwin-arm.mk b/webkit/webkit_storage_browser.target.darwin-arm.mk
index a3d0f23..d101dfc 100644
--- a/webkit/webkit_storage_browser.target.darwin-arm.mk
+++ b/webkit/webkit_storage_browser.target.darwin-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -171,19 +171,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -203,9 +202,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -223,10 +226,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -291,19 +290,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -323,9 +321,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -343,10 +345,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -407,7 +405,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_browser.target.darwin-mips.mk b/webkit/webkit_storage_browser.target.darwin-mips.mk
index c57b0f3..23a0f59 100644
--- a/webkit/webkit_storage_browser.target.darwin-mips.mk
+++ b/webkit/webkit_storage_browser.target.darwin-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -171,19 +171,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -203,9 +202,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -223,10 +226,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -291,19 +290,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -323,9 +321,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -343,10 +345,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -403,7 +401,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_browser.target.darwin-x86.mk b/webkit/webkit_storage_browser.target.darwin-x86.mk
index 39b2833..0a068cf 100644
--- a/webkit/webkit_storage_browser.target.darwin-x86.mk
+++ b/webkit/webkit_storage_browser.target.darwin-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -173,18 +173,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -204,9 +203,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -224,10 +227,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -295,18 +294,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -326,9 +324,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,10 +348,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -405,7 +403,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_browser.target.linux-arm.mk b/webkit/webkit_storage_browser.target.linux-arm.mk
index a3d0f23..d101dfc 100644
--- a/webkit/webkit_storage_browser.target.linux-arm.mk
+++ b/webkit/webkit_storage_browser.target.linux-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -171,19 +171,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -203,9 +202,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -223,10 +226,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -291,19 +290,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -323,9 +321,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -343,10 +345,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -407,7 +405,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_browser.target.linux-mips.mk b/webkit/webkit_storage_browser.target.linux-mips.mk
index c57b0f3..23a0f59 100644
--- a/webkit/webkit_storage_browser.target.linux-mips.mk
+++ b/webkit/webkit_storage_browser.target.linux-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -171,19 +171,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -203,9 +202,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -223,10 +226,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -291,19 +290,18 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -323,9 +321,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -343,10 +345,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -403,7 +401,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_browser.target.linux-x86.mk b/webkit/webkit_storage_browser.target.linux-x86.mk
index 39b2833..0a068cf 100644
--- a/webkit/webkit_storage_browser.target.linux-x86.mk
+++ b/webkit/webkit_storage_browser.target.linux-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -173,18 +173,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -204,9 +203,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -224,10 +227,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -295,18 +294,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_BROWSER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -326,9 +324,13 @@
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
+	$(LOCAL_PATH)/third_party/leveldatabase/src \
+	$(LOCAL_PATH)/third_party/leveldatabase \
+	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -346,10 +348,6 @@
 	$(LOCAL_PATH)/third_party/npapi \
 	$(LOCAL_PATH)/third_party/npapi/bindings \
 	$(LOCAL_PATH)/v8/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src/include \
-	$(LOCAL_PATH)/third_party/leveldatabase/src \
-	$(LOCAL_PATH)/third_party/leveldatabase \
-	$(LOCAL_PATH)/third_party/sqlite \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -405,7 +403,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_common.target.darwin-arm.mk b/webkit/webkit_storage_common.target.darwin-arm.mk
index 750cc29..489b2ae 100644
--- a/webkit/webkit_storage_common.target.darwin-arm.mk
+++ b/webkit/webkit_storage_common.target.darwin-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
diff --git a/webkit/webkit_storage_common.target.darwin-mips.mk b/webkit/webkit_storage_common.target.darwin-mips.mk
index 86826f3..c9ed7c9 100644
--- a/webkit/webkit_storage_common.target.darwin-mips.mk
+++ b/webkit/webkit_storage_common.target.darwin-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
diff --git a/webkit/webkit_storage_common.target.darwin-x86.mk b/webkit/webkit_storage_common.target.darwin-x86.mk
index 2187894..796c81d 100644
--- a/webkit/webkit_storage_common.target.darwin-x86.mk
+++ b/webkit/webkit_storage_common.target.darwin-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/webkit/webkit_storage_common.target.linux-arm.mk b/webkit/webkit_storage_common.target.linux-arm.mk
index 750cc29..489b2ae 100644
--- a/webkit/webkit_storage_common.target.linux-arm.mk
+++ b/webkit/webkit_storage_common.target.linux-arm.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
diff --git a/webkit/webkit_storage_common.target.linux-mips.mk b/webkit/webkit_storage_common.target.linux-mips.mk
index 86826f3..c9ed7c9 100644
--- a/webkit/webkit_storage_common.target.linux-mips.mk
+++ b/webkit/webkit_storage_common.target.linux-mips.mk
@@ -82,10 +82,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
@@ -168,10 +168,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DPOSIX_AVOID_MMAP' \
 	'-DANDROID' \
diff --git a/webkit/webkit_storage_common.target.linux-x86.mk b/webkit/webkit_storage_common.target.linux-x86.mk
index 2187894..796c81d 100644
--- a/webkit/webkit_storage_common.target.linux-x86.mk
+++ b/webkit/webkit_storage_common.target.linux-x86.mk
@@ -84,10 +84,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -172,10 +172,10 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_COMMON_IMPLEMENTATION' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/webkit/webkit_storage_renderer.target.darwin-arm.mk b/webkit/webkit_storage_renderer.target.darwin-arm.mk
index 57fe600..a881f3d 100644
--- a/webkit/webkit_storage_renderer.target.darwin-arm.mk
+++ b/webkit/webkit_storage_renderer.target.darwin-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -109,8 +108,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +191,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -224,8 +222,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_renderer.target.darwin-mips.mk b/webkit/webkit_storage_renderer.target.darwin-mips.mk
index 0652419..ea2a42d 100644
--- a/webkit/webkit_storage_renderer.target.darwin-mips.mk
+++ b/webkit/webkit_storage_renderer.target.darwin-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -109,8 +108,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +191,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -224,8 +222,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -299,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_renderer.target.darwin-x86.mk b/webkit/webkit_storage_renderer.target.darwin-x86.mk
index c83ac0d..de8e129 100644
--- a/webkit/webkit_storage_renderer.target.darwin-x86.mk
+++ b/webkit/webkit_storage_renderer.target.darwin-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -79,18 +79,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -111,8 +110,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -229,8 +227,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_renderer.target.linux-arm.mk b/webkit/webkit_storage_renderer.target.linux-arm.mk
index 57fe600..a881f3d 100644
--- a/webkit/webkit_storage_renderer.target.linux-arm.mk
+++ b/webkit/webkit_storage_renderer.target.linux-arm.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -109,8 +108,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +191,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -224,8 +222,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_renderer.target.linux-mips.mk b/webkit/webkit_storage_renderer.target.linux-mips.mk
index 0652419..ea2a42d 100644
--- a/webkit/webkit_storage_renderer.target.linux-mips.mk
+++ b/webkit/webkit_storage_renderer.target.linux-mips.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -77,18 +77,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -109,8 +108,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -192,18 +191,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -224,8 +222,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -299,7 +297,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/webkit/webkit_storage_renderer.target.linux-x86.mk b/webkit/webkit_storage_renderer.target.linux-x86.mk
index c83ac0d..de8e129 100644
--- a/webkit/webkit_storage_renderer.target.linux-x86.mk
+++ b/webkit/webkit_storage_renderer.target.linux-x86.mk
@@ -12,7 +12,7 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_public_blink_gyp)/blink.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_gyp)/skia_skia_gyp.a
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -79,18 +79,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -111,8 +110,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -197,18 +196,17 @@
 	'-DCHROMIUM_BUILD' \
 	'-DUSE_LIBJPEG_TURBO=1' \
 	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DENABLE_GPU=1' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
-	'-DENABLE_LANGUAGE_DETECTION=1' \
 	'-DWEBKIT_STORAGE_RENDERER_IMPLEMENTATION' \
-	'-DSK_BUILD_NO_IMAGE_ENCODE' \
-	'-DSK_DEFERRED_CANVAS_USES_GPIPE=1' \
-	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
-	'-DGR_AGGRESSIVE_SHADER_OPTS=1' \
 	'-DSK_ENABLE_INST_COUNT=0' \
-	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
 	'-DSK_BUILD_FOR_ANDROID' \
+	'-DUSE_CHROMIUM_SKIA' \
+	'-DSK_USE_POSIX_THREADS' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -229,8 +227,8 @@
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/skia/include/config \
 	$(LOCAL_PATH)/third_party/skia/include/core \
 	$(LOCAL_PATH)/third_party/skia/include/effects \
@@ -303,7 +301,7 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_gyp
+	skia_skia_library_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true