Merge from Chromium at DEPS revision 38.0.2125.80

This commit was generated by merge_to_master.py.

Change-Id: I476bcbbda14078a7320852cf33a854eb1cb53de5
diff --git a/GypAndroid.darwin-arm.mk b/GypAndroid.darwin-arm.mk
index 2d36579..63f4d5a 100644
--- a/GypAndroid.darwin-arm.mk
+++ b/GypAndroid.darwin-arm.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.darwin-arm.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.darwin-arm.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.darwin-arm.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.darwin-arm.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.darwin-arm.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.darwin-arm.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.darwin-arm.mk
diff --git a/GypAndroid.darwin-arm64.mk b/GypAndroid.darwin-arm64.mk
index bc1cfdb..3a79c26 100644
--- a/GypAndroid.darwin-arm64.mk
+++ b/GypAndroid.darwin-arm64.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.darwin-arm64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.darwin-arm64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.darwin-arm64.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.darwin-arm64.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.darwin-arm64.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.darwin-arm64.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.darwin-arm64.mk
diff --git a/GypAndroid.darwin-mips.mk b/GypAndroid.darwin-mips.mk
index 5518fd1..6828936 100644
--- a/GypAndroid.darwin-mips.mk
+++ b/GypAndroid.darwin-mips.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.darwin-mips.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.darwin-mips.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.darwin-mips.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.darwin-mips.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.darwin-mips.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.darwin-mips.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.darwin-mips.mk
diff --git a/GypAndroid.darwin-x86.mk b/GypAndroid.darwin-x86.mk
index 7edb92c..a7a5320 100644
--- a/GypAndroid.darwin-x86.mk
+++ b/GypAndroid.darwin-x86.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.darwin-x86.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.darwin-x86.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.darwin-x86.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.darwin-x86.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.darwin-x86.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.darwin-x86.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.darwin-x86.mk
diff --git a/GypAndroid.darwin-x86_64.mk b/GypAndroid.darwin-x86_64.mk
index 0e84396..9676cd8 100644
--- a/GypAndroid.darwin-x86_64.mk
+++ b/GypAndroid.darwin-x86_64.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.darwin-x86_64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.darwin-x86_64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.darwin-x86_64.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.darwin-x86_64.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.darwin-x86_64.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.darwin-x86_64.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.darwin-x86_64.mk
diff --git a/GypAndroid.linux-arm.mk b/GypAndroid.linux-arm.mk
index e7ab6ed..f564a80 100644
--- a/GypAndroid.linux-arm.mk
+++ b/GypAndroid.linux-arm.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.linux-arm.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.linux-arm.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.linux-arm.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.linux-arm.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.linux-arm.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.linux-arm.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.linux-arm.mk
diff --git a/GypAndroid.linux-arm64.mk b/GypAndroid.linux-arm64.mk
index cddb188..3552596 100644
--- a/GypAndroid.linux-arm64.mk
+++ b/GypAndroid.linux-arm64.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.linux-arm64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.linux-arm64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.linux-arm64.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.linux-arm64.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.linux-arm64.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.linux-arm64.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.linux-arm64.mk
diff --git a/GypAndroid.linux-mips.mk b/GypAndroid.linux-mips.mk
index c0624cf..ec959ae 100644
--- a/GypAndroid.linux-mips.mk
+++ b/GypAndroid.linux-mips.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.linux-mips.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.linux-mips.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.linux-mips.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.linux-mips.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.linux-mips.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.linux-mips.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.linux-mips.mk
diff --git a/GypAndroid.linux-x86.mk b/GypAndroid.linux-x86.mk
index c8b31d9..6eade0c 100644
--- a/GypAndroid.linux-x86.mk
+++ b/GypAndroid.linux-x86.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.linux-x86.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.linux-x86.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.linux-x86.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.linux-x86.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.linux-x86.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.linux-x86.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.linux-x86.mk
diff --git a/GypAndroid.linux-x86_64.mk b/GypAndroid.linux-x86_64.mk
index 27e17a4..bbe0421 100644
--- a/GypAndroid.linux-x86_64.mk
+++ b/GypAndroid.linux-x86_64.mk
@@ -43,6 +43,7 @@
 include $(LOCAL_PATH)/components/components_strings.target.linux-x86_64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_browser.target.linux-x86_64.mk
 include $(LOCAL_PATH)/components/data_reduction_proxy_common.target.linux-x86_64.mk
+include $(LOCAL_PATH)/components/data_reduction_proxy_version_header.target.linux-x86_64.mk
 include $(LOCAL_PATH)/components/keyed_service_core.target.linux-x86_64.mk
 include $(LOCAL_PATH)/components/navigation_interception.target.linux-x86_64.mk
 include $(LOCAL_PATH)/components/navigation_interception_jni_headers.target.linux-x86_64.mk
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc
index 6e39cd7..207bd42 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -232,7 +232,6 @@
   data_reduction_proxy_auth_request_handler_.reset(
       new data_reduction_proxy::DataReductionProxyAuthRequestHandler(
           data_reduction_proxy::kClientAndroidWebview,
-          data_reduction_proxy::kAndroidWebViewProtocolVersion,
           data_reduction_proxy_settings->params(),
           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
 
diff --git a/android_webview/libwebviewchromium.target.darwin-arm.mk b/android_webview/libwebviewchromium.target.darwin-arm.mk
index 6a138ae..387d590 100644
--- a/android_webview/libwebviewchromium.target.darwin-arm.mk
+++ b/android_webview/libwebviewchromium.target.darwin-arm.mk
@@ -357,6 +357,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.darwin-arm64.mk b/android_webview/libwebviewchromium.target.darwin-arm64.mk
index e69f008..5ee19eb 100644
--- a/android_webview/libwebviewchromium.target.darwin-arm64.mk
+++ b/android_webview/libwebviewchromium.target.darwin-arm64.mk
@@ -341,6 +341,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.darwin-mips.mk b/android_webview/libwebviewchromium.target.darwin-mips.mk
index cb731c9..533c415 100644
--- a/android_webview/libwebviewchromium.target.darwin-mips.mk
+++ b/android_webview/libwebviewchromium.target.darwin-mips.mk
@@ -342,6 +342,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.darwin-x86.mk b/android_webview/libwebviewchromium.target.darwin-x86.mk
index b10e97b..ad5e117 100644
--- a/android_webview/libwebviewchromium.target.darwin-x86.mk
+++ b/android_webview/libwebviewchromium.target.darwin-x86.mk
@@ -356,6 +356,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.darwin-x86_64.mk b/android_webview/libwebviewchromium.target.darwin-x86_64.mk
index 4809a3f..3bd17f4 100644
--- a/android_webview/libwebviewchromium.target.darwin-x86_64.mk
+++ b/android_webview/libwebviewchromium.target.darwin-x86_64.mk
@@ -356,6 +356,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.linux-arm.mk b/android_webview/libwebviewchromium.target.linux-arm.mk
index 6a138ae..387d590 100644
--- a/android_webview/libwebviewchromium.target.linux-arm.mk
+++ b/android_webview/libwebviewchromium.target.linux-arm.mk
@@ -357,6 +357,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.linux-arm64.mk b/android_webview/libwebviewchromium.target.linux-arm64.mk
index e69f008..5ee19eb 100644
--- a/android_webview/libwebviewchromium.target.linux-arm64.mk
+++ b/android_webview/libwebviewchromium.target.linux-arm64.mk
@@ -341,6 +341,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.linux-mips.mk b/android_webview/libwebviewchromium.target.linux-mips.mk
index cb731c9..533c415 100644
--- a/android_webview/libwebviewchromium.target.linux-mips.mk
+++ b/android_webview/libwebviewchromium.target.linux-mips.mk
@@ -342,6 +342,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.linux-x86.mk b/android_webview/libwebviewchromium.target.linux-x86.mk
index b10e97b..ad5e117 100644
--- a/android_webview/libwebviewchromium.target.linux-x86.mk
+++ b/android_webview/libwebviewchromium.target.linux-x86.mk
@@ -356,6 +356,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/android_webview/libwebviewchromium.target.linux-x86_64.mk b/android_webview/libwebviewchromium.target.linux-x86_64.mk
index 4809a3f..3bd17f4 100644
--- a/android_webview/libwebviewchromium.target.linux-x86_64.mk
+++ b/android_webview/libwebviewchromium.target.linux-x86_64.mk
@@ -356,6 +356,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_common_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_cdm_renderer_gyp,,,$(GYP_VAR_PREFIX))/components_cdm_renderer_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_browser_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_browser_gyp.a \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_data_reduction_proxy_common_gyp,,,$(GYP_VAR_PREFIX))/components_data_reduction_proxy_common_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,components_navigation_interception_gyp,,,$(GYP_VAR_PREFIX))/components_navigation_interception_gyp.a \
 	$(call intermediates-dir-for,GYP,components_navigation_interception_jni_headers_gyp,,,$(GYP_VAR_PREFIX))/navigation_interception_jni_headers.stamp \
diff --git a/apps/ui/views/app_window_frame_view.cc b/apps/ui/views/app_window_frame_view.cc
index 4fd0955..84de3f0 100644
--- a/apps/ui/views/app_window_frame_view.cc
+++ b/apps/ui/views/app_window_frame_view.cc
@@ -318,8 +318,10 @@
 
 gfx::Size AppWindowFrameView::GetMinimumSize() const {
   gfx::Size min_size = widget_->client_view()->GetMinimumSize();
-  if (!draw_frame_)
+  if (!draw_frame_) {
+    min_size.SetToMax(gfx::Size(1, 1));
     return min_size;
+  }
 
   // Ensure we can display the top of the caption area.
   gfx::Rect client_bounds = GetBoundsForClientView();
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index bd8cf49..0569209 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -655,7 +655,8 @@
 
   // No change
   UpdateDisplay("400x500*2,300x300");
-  EXPECT_EQ(0, observer.CountAndReset());
+  // We still call into Pre/PostDisplayConfigurationChange().
+  EXPECT_EQ(1, observer.CountAndReset());
   EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
   EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
 
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index f707ca0..e2e4b75 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -870,13 +870,6 @@
   scoped_ptr<NonDesktopDisplayUpdater> non_desktop_display_updater(
       new NonDesktopDisplayUpdater(this, delegate_));
 
-  // Do not update |displays_| if there's nothing to be updated. Without this,
-  // it will not update the display layout, which causes the bug
-  // http://crbug.com/155948.
-  if (display_changes.empty() && added_display_indices.empty() &&
-      removed_displays.empty()) {
-    return;
-  }
   // Clear focus if the display has been removed, but don't clear focus if
   // the destkop has been moved from one display to another
   // (mirror -> docked, docked -> single internal).
@@ -886,6 +879,22 @@
   if (delegate_)
     delegate_->PreDisplayConfigurationChange(clear_focus);
 
+  // Do not update |displays_| if there's nothing to be updated. Without this,
+  // it will not update the display layout, which causes the bug
+  // http://crbug.com/155948.
+  if (display_changes.empty() && added_display_indices.empty() &&
+      removed_displays.empty()) {
+    // When changing from software mirroring mode to sinlge display mode, it
+    // is possible there is no need to update |displays_| and we early out
+    // here. But we still want to run the PostDisplayConfigurationChange()
+    // cause there are some clients need to act on this, e.g.
+    // TouchTransformerController needs to adjust the TouchTransformer when
+    // switching from dual displays to single display.
+    if (delegate_)
+      delegate_->PostDisplayConfigurationChange();
+    return;
+  }
+
   size_t updated_index;
   if (UpdateSecondaryDisplayBoundsForLayout(&new_displays, &updated_index) &&
       std::find(added_display_indices.begin(),
diff --git a/ash/display/virtual_keyboard_window_controller_unittest.cc b/ash/display/virtual_keyboard_window_controller_unittest.cc
index e2538c1..50f0573 100644
--- a/ash/display/virtual_keyboard_window_controller_unittest.cc
+++ b/ash/display/virtual_keyboard_window_controller_unittest.cc
@@ -39,44 +39,6 @@
   DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowControllerTest);
 };
 
-class VirtualKeyboardUsabilityExperimentTest
-    : public VirtualKeyboardWindowControllerTest {
- public:
-  VirtualKeyboardUsabilityExperimentTest()
-    : VirtualKeyboardWindowControllerTest() {}
-  virtual ~VirtualKeyboardUsabilityExperimentTest() {}
-
-  virtual void SetUp() OVERRIDE {
-    if (SupportsMultipleDisplays()) {
-      CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-          switches::kAshHostWindowBounds, "1+1-300x300,1+301-300x300");
-      CommandLine::ForCurrentProcess()->AppendSwitch(
-          keyboard::switches::kKeyboardUsabilityExperiment);
-    }
-    test::AshTestBase::SetUp();
-  }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardUsabilityExperimentTest);
-};
-
-TEST_F(VirtualKeyboardUsabilityExperimentTest, VirtualKeyboardWindowTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-  RunAllPendingInMessageLoop();
-  set_virtual_keyboard_window_controller(
-      Shell::GetInstance()->display_controller()->
-          virtual_keyboard_window_controller());
-  EXPECT_TRUE(root_window_controller());
-  aura::Window* container = root_window_controller()->GetContainer(
-      kShellWindowId_VirtualKeyboardContainer);
-  // Keyboard container is added to virtual keyboard window and its bounds is
-  // the same as root window.
-  EXPECT_TRUE(container);
-  EXPECT_EQ(container->bounds(),
-            root_window_controller()->GetRootWindow()->bounds());
-}
-
 // Tests that the onscreen keyboard becomes enabled when maximize mode is
 // enabled.
 TEST_F(VirtualKeyboardWindowControllerTest, EnabledDuringMaximizeMode) {
diff --git a/athena/content/web_contents_view_delegate_factory_impl.cc b/athena/content/web_contents_view_delegate_factory_impl.cc
index d378722..ce55107 100644
--- a/athena/content/web_contents_view_delegate_factory_impl.cc
+++ b/athena/content/web_contents_view_delegate_factory_impl.cc
@@ -5,7 +5,6 @@
 #include "athena/content/public/web_contents_view_delegate_creator.h"
 
 #include "athena/content/render_view_context_menu_impl.h"
-#include "components/web_modal/popup_manager.h"
 #include "components/web_modal/single_web_contents_dialog_manager.h"
 #include "components/web_modal/web_contents_modal_dialog_host.h"
 #include "components/web_modal/web_contents_modal_dialog_manager.h"
@@ -32,10 +31,11 @@
   }
 
   virtual bool Focus() OVERRIDE {
-    web_modal::PopupManager* popup_manager =
-        web_modal::PopupManager::FromWebContents(web_contents_);
-    if (popup_manager)
-      popup_manager->WasFocused(web_contents_);
+    web_modal::WebContentsModalDialogManager* manager =
+        web_modal::WebContentsModalDialogManager::FromWebContents(
+            web_contents_);
+    if (manager)
+      manager->FocusTopmostDialog();
     return false;
   }
 
diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
index a122c06..054e7f3 100644
--- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
+++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
@@ -295,10 +295,4 @@
             return intent.getTargetPackage();
         }
     }
-
-    public static boolean datePickerRequiresAccept() {
-        // TODO(miguelg) use the final code for the L
-        // https://crbug.com/399198
-        return Build.VERSION.SDK_INT <  20; /* CUR_DEVELOPMENT */
-    }
 }
diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE
index b6e746f..691a272 100644
--- a/build/util/LASTCHANGE
+++ b/build/util/LASTCHANGE
@@ -1 +1 @@
-LASTCHANGE=b1051ddfce88
+LASTCHANGE=65b79700354a
diff --git a/build/util/LASTCHANGE.blink b/build/util/LASTCHANGE.blink
index 117aa79..cb029ea 100644
--- a/build/util/LASTCHANGE.blink
+++ b/build/util/LASTCHANGE.blink
@@ -1 +1 @@
-LASTCHANGE=182343
+LASTCHANGE=182588
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index d4fe78a..4d651df 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -838,6 +838,7 @@
 
 void LayerTreeImpl::AsValueInto(base::debug::TracedValue* state) const {
   TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this);
+  state->SetInteger("source_frame_number", source_frame_number_);
 
   state->BeginDictionary("root_layer");
   root_layer_->AsValueInto(state);
diff --git a/chrome/VERSION b/chrome/VERSION
index b3dd77a..dfd0d56 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=38
 MINOR=0
 BUILD=2125
-PATCH=74
+PATCH=80
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
index 1e25b61..ec08bad 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
@@ -115,6 +115,9 @@
             int tabId, ViewGroup parentView, WebContents webContents) {
         super(activity);
 
+        // Workaround for http://crbug.com/407149. See explanation in onMeasure() below.
+        setVerticalScrollBarEnabled(false);
+
         FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
                 LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
         int topMarginDp = DeviceFormFactor.isTablet(activity)
@@ -144,6 +147,19 @@
         mNativeInfoBarContainer = nativeInit(webContents, mAutoLoginDelegate);
     }
 
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+
+        // Only enable scrollbars when the view is actually scrollable.
+        // This prevents 10-15 frames of jank that would otherwise occur 1.2 seconds after the
+        // InfoBarContainer is attached to the window. See: http://crbug.com/407149
+        boolean canScroll = mLinearLayout.getMeasuredHeight() > getMeasuredHeight();
+        if (canScroll != isVerticalScrollBarEnabled()) {
+            setVerticalScrollBarEnabled(canScroll);
+        }
+    }
+
     /**
      * @return The LinearLayout that holds the infobars (i.e. the ContentWrapperViews).
      */
diff --git a/chrome/browser/android/thumbnail/thumbnail_store.cc b/chrome/browser/android/thumbnail/thumbnail_store.cc
index 4caf0d8..dbe0fb2 100644
--- a/chrome/browser/android/thumbnail/thumbnail_store.cc
+++ b/chrome/browser/android/thumbnail/thumbnail_store.cc
@@ -833,33 +833,54 @@
         post_decompression_callback,
     skia::RefPtr<SkPixelRef> compressed_data,
     float scale,
-    const gfx::Size& encoded_size) {
-  SkBitmap raw_data;
+    const gfx::Size& content_size) {
+  SkBitmap raw_data_small;
   bool success = false;
 
   if (compressed_data.get()) {
-    size_t pixel_size = 4;  // Pixel size is 4 bytes for kARGB_8888_Config.
-    size_t stride = pixel_size * encoded_size.width();
+    gfx::Size buffer_size = gfx::Size(compressed_data->info().width(),
+                                      compressed_data->info().height());
 
-    raw_data.allocPixels(SkImageInfo::Make(encoded_size.width(),
-                                            encoded_size.height(),
-                                            kRGBA_8888_SkColorType,
-                                            kOpaque_SkAlphaType));
+    SkBitmap raw_data;
+    raw_data.allocPixels(SkImageInfo::Make(buffer_size.width(),
+                                           buffer_size.height(),
+                                           kRGBA_8888_SkColorType,
+                                           kOpaque_SkAlphaType));
     SkAutoLockPixels raw_data_lock(raw_data);
+    compressed_data->lockPixels();
     success = etc1_decode_image(
         reinterpret_cast<unsigned char*>(compressed_data->pixels()),
         reinterpret_cast<unsigned char*>(raw_data.getPixels()),
-        encoded_size.width(),
-        encoded_size.height(),
-        pixel_size,
-        stride);
+        buffer_size.width(),
+        buffer_size.height(),
+        raw_data.bytesPerPixel(),
+        raw_data.rowBytes());
+    compressed_data->unlockPixels();
     raw_data.setImmutable();
+
+    if (!success) {
+      // Leave raw_data_small empty for consistency with other failure modes.
+    } else if (content_size == buffer_size) {
+      // Shallow copy the pixel reference.
+      raw_data_small = raw_data;
+    } else {
+      // The content size is smaller than the buffer size (likely because of
+      // a power-of-two rounding), so deep copy the bitmap.
+      raw_data_small.allocPixels(SkImageInfo::Make(content_size.width(),
+                                                   content_size.height(),
+                                                   kRGBA_8888_SkColorType,
+                                                   kOpaque_SkAlphaType));
+      SkAutoLockPixels raw_data_small_lock(raw_data_small);
+      SkCanvas small_canvas(raw_data_small);
+      small_canvas.drawBitmap(raw_data, 0, 0);
+      raw_data_small.setImmutable();
+    }
   }
 
   content::BrowserThread::PostTask(
       content::BrowserThread::UI,
       FROM_HERE,
-      base::Bind(post_decompression_callback, success, raw_data));
+      base::Bind(post_decompression_callback, success, raw_data_small));
 }
 
 ThumbnailStore::ThumbnailMetaData::ThumbnailMetaData() {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 17b99db..5890400 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1724,11 +1724,11 @@
   // ownership of ssl_blocking_page.
   int options_mask = 0;
   if (overridable)
-    options_mask = SSLBlockingPage::OVERRIDABLE;
+    options_mask |= SSLBlockingPage::OVERRIDABLE;
   if (strict_enforcement)
-    options_mask = SSLBlockingPage::STRICT_ENFORCEMENT;
+    options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT;
   if (expired_previous_decision)
-    options_mask = SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED;
+    options_mask |= SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED;
   SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage(
       tab, cert_error, ssl_info, request_url, options_mask, callback);
   ssl_blocking_page->Show();
diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
index 58c41aa..a06ed5b 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -288,11 +288,6 @@
     : OAuth2TokenService::Consumer("extensions_identity_api"),
       should_prompt_for_scopes_(false),
       should_prompt_for_signin_(false) {
-  TRACE_EVENT_ASYNC_BEGIN1("identity",
-                           "IdentityGetAuthTokenFunction",
-                           this,
-                           "extension",
-                           extension()->id());
 }
 
 IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {
@@ -300,6 +295,12 @@
 }
 
 bool IdentityGetAuthTokenFunction::RunAsync() {
+  TRACE_EVENT_ASYNC_BEGIN1("identity",
+                           "IdentityGetAuthTokenFunction",
+                           this,
+                           "extension",
+                           extension()->id());
+
   if (GetProfile()->IsOffTheRecord()) {
     error_ = identity_constants::kOffTheRecord;
     return false;
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index b817f16..3dbfc1c 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -660,7 +660,6 @@
   globals_->data_reduction_proxy_auth_request_handler.reset(
       new data_reduction_proxy::DataReductionProxyAuthRequestHandler(
           DataReductionProxyChromeSettings::GetClient(),
-          chrome::VersionInfo().Version(),
           globals_->data_reduction_proxy_params.get(),
           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
   // This is the same as in ProfileImplIOData except that we do not collect
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 0d56050..7f22be2 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -31,7 +31,6 @@
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/chrome_version_info.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/common/url_constants.h"
 #include "components/domain_reliability/monitor.h"
@@ -422,7 +421,6 @@
   data_reduction_proxy_auth_request_handler_.reset(
       new data_reduction_proxy::DataReductionProxyAuthRequestHandler(
           DataReductionProxyChromeSettings::GetClient(),
-          chrome::VersionInfo().Version(),
           data_reduction_proxy_params_.get(),
           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
   data_reduction_proxy_usage_stats_.reset(
diff --git a/chrome/browser/safe_browsing/protocol_parser.cc b/chrome/browser/safe_browsing/protocol_parser.cc
index 82cbce7..790dda5 100644
--- a/chrome/browser/safe_browsing/protocol_parser.cc
+++ b/chrome/browser/safe_browsing/protocol_parser.cc
@@ -131,6 +131,23 @@
   DISALLOW_COPY_AND_ASSIGN(BufferReader);
 };
 
+bool ParseGetHashMetadata(size_t hash_count, BufferReader* reader) {
+  for (size_t i = 0; i < hash_count; ++i) {
+    base::StringPiece line;
+    if (!reader->GetLine(&line))
+      return false;
+
+    size_t meta_data_len;
+    if (!base::StringToSizeT(line, &meta_data_len))
+      return false;
+
+    const void* meta_data;
+    if (!reader->RefData(&meta_data, meta_data_len))
+      return false;
+  }
+  return true;
+}
+
 }  // namespace
 
 namespace safe_browsing {
@@ -206,6 +223,8 @@
     // Ignore hash results from lists we don't recognize.
     if (full_hash.list_id < 0) {
       reader.Advance(hash_len * hash_count);
+      if (has_metadata && !ParseGetHashMetadata(hash_count, &reader))
+        return false;
       continue;
     }
 
@@ -216,21 +235,9 @@
     }
 
     // Discard the metadata for now.
-    if (has_metadata) {
-      for (size_t i = 0; i < hash_count; ++i) {
-        base::StringPiece line;
-        if (!reader.GetLine(&line))
-          return false;
-
-        size_t meta_data_len;
-        if (!base::StringToSizeT(line, &meta_data_len))
-          return false;
-
-        const void* meta_data;
-        if (!reader.RefData(&meta_data, meta_data_len))
-          return false;
-      }
-    }
+    // TODO(mattm): handle the metadata (see crbug.com/176648).
+    if (has_metadata && !ParseGetHashMetadata(hash_count, &reader))
+      return false;
   }
 
   return reader.empty();
diff --git a/chrome/browser/safe_browsing/protocol_parser_unittest.cc b/chrome/browser/safe_browsing/protocol_parser_unittest.cc
index f67bd38..cf8cd7b 100644
--- a/chrome/browser/safe_browsing/protocol_parser_unittest.cc
+++ b/chrome/browser/safe_browsing/protocol_parser_unittest.cc
@@ -508,6 +508,28 @@
   EXPECT_EQ(safe_browsing_util::MALWARE, full_hashes[1].list_id);
 }
 
+TEST(SafeBrowsingProtocolParsingTest, TestGetHashWithUnknownListAndMetadata) {
+  std::vector<SBFullHashResult> full_hashes;
+  base::TimeDelta cache_lifetime;
+  // Test skipping over a hashentry with an unrecognized listname that also has
+  // metadata.
+  const std::string get_hash3(base::StringPrintf(
+      "600\n"
+      "BADLISTNAME:32:1:m\n"
+      "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+      "8\nMETADATA"
+      "%s:32:1\n"
+      "0123456789hashhashhashhashhashha",
+      kDefaultMalwareList));
+  EXPECT_TRUE(safe_browsing::ParseGetHash(get_hash3.data(), get_hash3.length(),
+                                          &cache_lifetime, &full_hashes));
+  ASSERT_EQ(1U, full_hashes.size());
+  EXPECT_EQ(memcmp(&full_hashes[0].hash,
+                   "0123456789hashhashhashhashhashha",
+                   sizeof(SBFullHash)), 0);
+  EXPECT_EQ(safe_browsing_util::MALWARE, full_hashes[0].list_id);
+}
+
 TEST(SafeBrowsingProtocolParsingTest, TestFormatHash) {
   std::vector<SBPrefix> prefixes;
   prefixes.push_back(0x34333231);
diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
index 906795c..545e759 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -275,6 +275,7 @@
   strings.SetString("title",
       l10n_util::GetStringUTF16(IDS_SIM_UNLOCK_ENTER_PIN_TITLE));
   strings.SetString("ok", l10n_util::GetStringUTF16(IDS_OK));
+  strings.SetString("cancel", l10n_util::GetStringUTF16(IDS_CANCEL));
   strings.SetString("enterPinTitle",
       l10n_util::GetStringUTF16(IDS_SIM_UNLOCK_ENTER_PIN_TITLE));
   strings.SetString("enterPinMessage",
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
index 22c98e0..0972ca8 100644
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -76,9 +76,9 @@
   // This delegate doesn't create an interstitial.
   int options_mask = 0;
   if (overridable)
-    options_mask = SSLBlockingPage::OVERRIDABLE;
+    options_mask |= SSLBlockingPage::OVERRIDABLE;
   if (strict_enforcement)
-    options_mask = SSLBlockingPage::STRICT_ENFORCEMENT;
+    options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT;
   return new SSLBlockingPage(web_contents,
                              cert_error,
                              ssl_info,
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 422815c..9254eb7 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -1411,6 +1411,7 @@
         LOG(WARNING) << "Policy prevents autoconnect, but value is True.";
         auto_connect_value.reset(new base::FundamentalValue(false));
       }
+      auto_connect_default_value = auto_connect_value.get();
     }
     SetManagedValueDictionary(shill::kAutoConnectProperty,
                               auto_connect_value.get(),
@@ -1418,6 +1419,12 @@
                               auto_connect_recommended,
                               auto_connect_default_value,
                               dictionary.get());
+  } else {
+    // Set AutoConnect property for unmanaged types (Cellular, Wimax).
+    bool auto_connect = false;
+    shill_properties.GetBooleanWithoutPathExpansion(
+        shill::kAutoConnectProperty, &auto_connect);
+    dictionary->SetBoolean(shill::kAutoConnectProperty, auto_connect);
   }
 
   // Show details dialog
diff --git a/chrome/renderer/pepper/pepper_uma_host.cc b/chrome/renderer/pepper/pepper_uma_host.cc
index 0ce2a40..e6dc2e6 100644
--- a/chrome/renderer/pepper/pepper_uma_host.cc
+++ b/chrome/renderer/pepper/pepper_uma_host.cc
@@ -21,6 +21,8 @@
 #include "ppapi/host/ppapi_host.h"
 #include "ppapi/proxy/ppapi_messages.h"
 
+#include "widevine_cdm_version.h"  // In SHARED_INTERMEDIATE_DIR.
+
 namespace {
 
 const char* const kPredefinedAllowedUMAOrigins[] = {
@@ -33,7 +35,10 @@
 };
 
 const char* const kWhitelistedPluginBaseNames[] = {
-    "libwidevinecdmadapter.so"  // see http://crbug.com/368743
+#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
+    kWidevineCdmAdapterFileName,  // see http://crbug.com/368743
+                                  // and http://crbug.com/410630
+#endif
 };
 
 std::string HashPrefix(const std::string& histogram) {
diff --git a/components/data_reduction_proxy.gypi b/components/data_reduction_proxy.gypi
index 9be6ed7..42ff0d2 100644
--- a/components/data_reduction_proxy.gypi
+++ b/components/data_reduction_proxy.gypi
@@ -10,6 +10,7 @@
       'target_name': 'data_reduction_proxy_browser',
       'type': 'static_library',
       'dependencies': [
+        'data_reduction_proxy_version_header',
         '../base/base.gyp:base',
         '../crypto/crypto.gyp:crypto',
         '../net/net.gyp:net',
@@ -86,6 +87,39 @@
         'data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h',
       ],
     },
+    {
+      'target_name': 'data_reduction_proxy_version_header',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '<(SHARED_INTERMEDIATE_DIR)',
+        ],
+      },
+      'actions': [
+        {
+          'action_name': 'version_header',
+          'message': 'Generating version header file: <@(_outputs)',
+          'inputs': [
+            '<(version_path)',
+            'data_reduction_proxy/common/version.h.in',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/components/data_reduction_proxy/common/version.h',
+          ],
+          'action': [
+            'python',
+            '<(version_py_path)',
+            '-e', 'VERSION_FULL="<(version_full)"',
+            'data_reduction_proxy/common/version.h.in',
+            '<@(_outputs)',
+          ],
+          'includes': [
+            '../build/util/version.gypi',
+          ],
+        },
+      ],
+    },
+
   ],
 }
 
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
index e2edb9b..12b9196 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc
@@ -16,6 +16,7 @@
 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
 #include "components/data_reduction_proxy/common/data_reduction_proxy_headers.h"
 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h"
+#include "components/data_reduction_proxy/common/version.h"
 #include "crypto/random.h"
 #include "net/proxy/proxy_server.h"
 #include "net/url_request/url_request.h"
@@ -43,20 +44,40 @@
 
 DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
     const std::string& client,
+    DataReductionProxyParams* params,
+    scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
+    : client_(client),
+      data_reduction_proxy_params_(params),
+      network_task_runner_(network_task_runner) {
+  GetChromiumBuildAndPatch(ChromiumVersion(), &build_number_, &patch_number_);
+  Init();
+}
+
+DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
+    const std::string& client,
     const std::string& version,
     DataReductionProxyParams* params,
     scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
-    : data_reduction_proxy_params_(params),
+    : client_(client),
+      data_reduction_proxy_params_(params),
       network_task_runner_(network_task_runner) {
-  client_ = client;
   GetChromiumBuildAndPatch(version, &build_number_, &patch_number_);
   Init();
 }
 
+std::string DataReductionProxyAuthRequestHandler::ChromiumVersion() const {
+#if defined(PRODUCT_VERSION)
+  return PRODUCT_VERSION;
+#else
+  return std::string();
+#endif
+}
+
+
 void DataReductionProxyAuthRequestHandler::GetChromiumBuildAndPatch(
     const std::string& version,
     std::string* build,
-    std::string* patch) {
+    std::string* patch) const {
   std::vector<std::string> version_parts;
   base::SplitString(version, '.', &version_parts);
   if (version_parts.size() != 4)
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
index 855e41c..cb10919 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
@@ -39,14 +39,9 @@
   static bool IsKeySetOnCommandLine();
 
   // Constructs a DataReductionProxyAuthRequestHandler object with the given
-  // client, version, params, and network task runner. The Chromium |version| is
-  // expected to be of the form "xx.xx.xx.xx". If it isn't of this form,
-  // |build_number_| and |patch_number_| are set to empty strings and not
-  // included in the header. http://crbug.com/410127 will change this so that
-  // the version is retrieved inside this constructor.
+  // client type, params, and network task runner.
   DataReductionProxyAuthRequestHandler(
       const std::string& client,
-      const std::string& version,
       DataReductionProxyParams* params,
       scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
 
@@ -82,6 +77,13 @@
   // Visible for testing.
   virtual std::string GetDefaultKey() const;
 
+  // Visible for testing.
+  DataReductionProxyAuthRequestHandler(
+      const std::string& client,
+      const std::string& version,
+      DataReductionProxyParams* params,
+      scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
+
  private:
   FRIEND_TEST_ALL_PREFIXES(DataReductionProxyAuthRequestHandlerTest,
                            Authorization);
@@ -90,11 +92,14 @@
   FRIEND_TEST_ALL_PREFIXES(DataReductionProxyAuthRequestHandlerTest,
                            AuthHashForSalt);
 
+  // Returns the version of Chromium that is being used.
+  std::string ChromiumVersion() const;
+
   // Returns the build and patch numbers of |version|. If |version| isn't of the
   // form xx.xx.xx.xx build and patch are not modified.
   void GetChromiumBuildAndPatch(const std::string& version,
                                 std::string* build,
-                                std::string* patch);
+                                std::string* patch) const;
 
   // Stores the supplied key and sets up credentials suitable for authenticating
   // with the data reduction proxy.
diff --git a/components/data_reduction_proxy/common/BUILD.gn b/components/data_reduction_proxy/common/BUILD.gn
index 2fc1435..93e147d 100644
--- a/components/data_reduction_proxy/common/BUILD.gn
+++ b/components/data_reduction_proxy/common/BUILD.gn
@@ -2,6 +2,8 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//components/data_reduction_proxy/common/version.gni")
+
 static_library("common") {
   sources = [
     "data_reduction_proxy_headers.cc",
@@ -13,6 +15,7 @@
   ]
 
   deps = [
+    ":version_header",
     "//base",
   ]
 }
@@ -27,3 +30,9 @@
     "//testing/gtest",
   ]
 }
+
+process_version("version_header") {
+  source = "version.h.in"
+  output = "$target_gen_dir/version.h"
+} 
+
diff --git a/components/data_reduction_proxy/common/version.gni b/components/data_reduction_proxy/common/version.gni
new file mode 100644
index 0000000..647d6d2
--- /dev/null
+++ b/components/data_reduction_proxy/common/version.gni
@@ -0,0 +1,50 @@
+# Copyright 2014 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.
+
+# Runs the version processing script over the given template file to produce
+# an output file. This is used for generating various forms of files that
+# incorporate the product name and version.
+#
+# This template automatically includes VERSION,
+#
+# Parameters:
+#   source:
+#     File name of source template file to read.
+#
+#   output:
+#     File name of file to write.
+#
+#   visibility (optional)
+#
+# Example:
+#   process_version("myversion") {
+#     source = "myfile.h.in"
+#     output = "$target_gen_dir/myfile.h"
+#   }
+template("process_version") {
+  assert(defined(invoker.source), "Source must be defined for $target_name")
+  assert(defined(invoker.output), "Output must be defined for $target_name")
+
+  action(target_name) {
+    if (defined(invoker.visibility)) {
+      visibility = invoker.visibility
+    }
+    script = "//build/util/version.py"
+
+    version_path = "//chrome/VERSION"
+
+    inputs = [
+      version_path,
+      invoker.source,
+    ]
+
+    outputs = [ invoker.output ]
+
+    args = [
+      "-f", rebase_path(version_path, root_build_dir),
+      rebase_path(invoker.source, root_build_dir),
+      rebase_path(invoker.output, root_build_dir),
+    ]
+  }
+}
diff --git a/components/data_reduction_proxy/common/version.h.in b/components/data_reduction_proxy/common/version.h.in
new file mode 100644
index 0000000..b5d7d50
--- /dev/null
+++ b/components/data_reduction_proxy/common/version.h.in
@@ -0,0 +1,12 @@
+// Copyright 2014 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.
+
+// version.h is generated from version.h.in.  Edit the source!
+
+#ifndef DATA_REDUCTION_PROXY_COMMON_VERSION_INFO_H_
+#define DATA_REDUCTION_PROXY_COMMON_VERSION_INFO_H_
+
+#define PRODUCT_VERSION "@VERSION_FULL@"
+
+#endif  // DATA_REDUCTION_PROXY_COMMON_VERSION_INFO_H_
diff --git a/components/data_reduction_proxy_browser.target.darwin-arm.mk b/components/data_reduction_proxy_browser.target.darwin-arm.mk
index c46c28b..4ece1e7 100644
--- a/components/data_reduction_proxy_browser.target.darwin-arm.mk
+++ b/components/data_reduction_proxy_browser.target.darwin-arm.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.darwin-arm64.mk b/components/data_reduction_proxy_browser.target.darwin-arm64.mk
index b74604f..239fd50 100644
--- a/components/data_reduction_proxy_browser.target.darwin-arm64.mk
+++ b/components/data_reduction_proxy_browser.target.darwin-arm64.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.darwin-mips.mk b/components/data_reduction_proxy_browser.target.darwin-mips.mk
index 7d208ae..5702f52 100644
--- a/components/data_reduction_proxy_browser.target.darwin-mips.mk
+++ b/components/data_reduction_proxy_browser.target.darwin-mips.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.darwin-x86.mk b/components/data_reduction_proxy_browser.target.darwin-x86.mk
index 79e9c30..211dc45 100644
--- a/components/data_reduction_proxy_browser.target.darwin-x86.mk
+++ b/components/data_reduction_proxy_browser.target.darwin-x86.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.darwin-x86_64.mk b/components/data_reduction_proxy_browser.target.darwin-x86_64.mk
index fcd7b0a..fcbd606 100644
--- a/components/data_reduction_proxy_browser.target.darwin-x86_64.mk
+++ b/components/data_reduction_proxy_browser.target.darwin-x86_64.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.linux-arm.mk b/components/data_reduction_proxy_browser.target.linux-arm.mk
index c46c28b..4ece1e7 100644
--- a/components/data_reduction_proxy_browser.target.linux-arm.mk
+++ b/components/data_reduction_proxy_browser.target.linux-arm.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.linux-arm64.mk b/components/data_reduction_proxy_browser.target.linux-arm64.mk
index b74604f..239fd50 100644
--- a/components/data_reduction_proxy_browser.target.linux-arm64.mk
+++ b/components/data_reduction_proxy_browser.target.linux-arm64.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.linux-mips.mk b/components/data_reduction_proxy_browser.target.linux-mips.mk
index 7d208ae..5702f52 100644
--- a/components/data_reduction_proxy_browser.target.linux-mips.mk
+++ b/components/data_reduction_proxy_browser.target.linux-mips.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.linux-x86.mk b/components/data_reduction_proxy_browser.target.linux-x86.mk
index 79e9c30..211dc45 100644
--- a/components/data_reduction_proxy_browser.target.linux-x86.mk
+++ b/components/data_reduction_proxy_browser.target.linux-x86.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_browser.target.linux-x86_64.mk b/components/data_reduction_proxy_browser.target.linux-x86_64.mk
index fcd7b0a..fcbd606 100644
--- a/components/data_reduction_proxy_browser.target.linux-x86_64.mk
+++ b/components/data_reduction_proxy_browser.target.linux-x86_64.mk
@@ -11,7 +11,8 @@
 gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
 
 # Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,components_data_reduction_proxy_version_header_gyp,,,$(GYP_VAR_PREFIX))/data_reduction_proxy_version_header.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/components/data_reduction_proxy_version_header.target.darwin-arm.mk b/components/data_reduction_proxy_version_header.target.darwin-arm.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.darwin-arm.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.darwin-arm64.mk b/components/data_reduction_proxy_version_header.target.darwin-arm64.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.darwin-arm64.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.darwin-mips.mk b/components/data_reduction_proxy_version_header.target.darwin-mips.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.darwin-mips.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.darwin-x86.mk b/components/data_reduction_proxy_version_header.target.darwin-x86.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.darwin-x86.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.darwin-x86_64.mk b/components/data_reduction_proxy_version_header.target.darwin-x86_64.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.darwin-x86_64.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.linux-arm.mk b/components/data_reduction_proxy_version_header.target.linux-arm.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.linux-arm.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.linux-arm64.mk b/components/data_reduction_proxy_version_header.target.linux-arm64.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.linux-arm64.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.linux-mips.mk b/components/data_reduction_proxy_version_header.target.linux-mips.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.linux-mips.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.linux-x86.mk b/components/data_reduction_proxy_version_header.target.linux-x86.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.linux-x86.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/data_reduction_proxy_version_header.target.linux-x86_64.mk b/components/data_reduction_proxy_version_header.target.linux-x86_64.mk
new file mode 100644
index 0000000..0037985
--- /dev/null
+++ b/components/data_reduction_proxy_version_header.target.linux-x86_64.mk
@@ -0,0 +1,55 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := components_data_reduction_proxy_version_header_gyp
+LOCAL_MODULE_STEM := data_reduction_proxy_version_header
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_TARGET_ARCH := $(TARGET_$(GYP_VAR_PREFIX)ARCH)
+gyp_intermediate_dir := $(call local-intermediates-dir,,$(GYP_VAR_PREFIX))
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+### Rules for action "version_header":
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h: $(LOCAL_PATH)/chrome/VERSION $(LOCAL_PATH)/components/data_reduction_proxy/common/version.h.in $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: Generating version header file: "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h" ($@)"
+	$(hide)cd $(gyp_local_path)/components; mkdir -p $(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common; python ../build/util/version.py -e "VERSION_FULL=\"38.0.2125.80\"" data_reduction_proxy/common/version.h.in "$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h"
+
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/components/data_reduction_proxy/common/version.h
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: components_data_reduction_proxy_version_header_gyp
+
+# Alias gyp target name.
+.PHONY: data_reduction_proxy_version_header
+data_reduction_proxy_version_header: components_data_reduction_proxy_version_header_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
+
+LOCAL_2ND_ARCH_VAR_PREFIX :=
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index c8abe0b..926a3ae 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -235,6 +235,11 @@
   current_cursor_ = cursor;
 }
 
+void WebViewPlugin::scheduleAnimation() {
+  if (container_)
+    container_->invalidate();
+}
+
 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) {
   if (delegate_)
     delegate_->BindWebFrame(frame);
diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h
index 2bdd437..498fa6c 100644
--- a/components/plugins/renderer/webview_plugin.h
+++ b/components/plugins/renderer/webview_plugin.h
@@ -124,6 +124,7 @@
   // WebWidgetClient methods:
   virtual void didInvalidateRect(const blink::WebRect&);
   virtual void didChangeCursor(const blink::WebCursorInfo& cursor);
+  virtual void scheduleAnimation();
 
   // WebFrameClient methods:
   virtual void didClearWindowObject(blink::WebLocalFrame* frame);
diff --git a/content/browser/devtools/tethering_handler.cc b/content/browser/devtools/tethering_handler.cc
index 9b3b7fa..6fdad54 100644
--- a/content/browser/devtools/tethering_handler.cc
+++ b/content/browser/devtools/tethering_handler.cc
@@ -111,8 +111,10 @@
   }
 
   void OnClientWrite(int result) {
-    if (result < 0)
+    if (result < 0) {
       SelfDestruct();
+      return;
+    }
 
     wire_buffer_->set_offset(wire_buffer_->offset() + result);
 
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index 51b3d67..5d0d84a 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -109,12 +109,11 @@
       INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED;
   for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(),
       end = events.end(); iter != end; ++iter)  {
-    if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(*(*iter),
-                                                                    this)) {
+    if (!gesture_recognizer_->ProcessTouchEventPreDispatch(*(*iter), this))
       continue;
-    }
+
     scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
-    gestures.reset(ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch(
+    gestures.reset(gesture_recognizer_->ProcessTouchEventPostDispatch(
         *(*iter), result, this));
     ProcessGestures(gestures.get());
   }
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
index 530028b..2606688 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
@@ -21,6 +21,24 @@
 #include "ui/gfx/image/image_skia.h"
 
 namespace content {
+namespace {
+
+// Returns true if the entry's URL or any of the URLs in entry's redirect chain
+// match |url|.
+bool DoesEntryMatchURL(NavigationEntry* entry, const GURL& url) {
+  if (entry->GetURL() == url)
+    return true;
+  const std::vector<GURL>& redirect_chain = entry->GetRedirectChain();
+  for (std::vector<GURL>::const_iterator it = redirect_chain.begin();
+       it != redirect_chain.end();
+       it++) {
+    if (*it == url)
+      return true;
+  }
+  return false;
+}
+
+}  // namespace
 
 // A LayerDelegate that paints an image for the layer.
 class ImageLayerDelegate : public ui::LayerDelegate {
@@ -116,7 +134,6 @@
       image_delegate_(NULL),
       loading_complete_(false),
       received_paint_update_(false),
-      pending_entry_id_(0),
       slide_direction_(SLIDE_UNKNOWN) {
 }
 
@@ -127,7 +144,6 @@
   loading_complete_ = false;
   received_paint_update_ = false;
   overlay_dismiss_layer_.reset();
-  pending_entry_id_ = 0;
   Observe(web_contents_);
 
   // Make sure the overlay window is on top.
@@ -137,10 +153,10 @@
   // Assumes the navigation has been initiated.
   NavigationEntry* pending_entry =
       web_contents_->GetController().GetPendingEntry();
-  // Save id of the pending entry to identify when it loads and paints later.
+  // Save url of the pending entry to identify when it loads and paints later.
   // Under some circumstances navigation can leave a null pending entry -
   // see comments in NavigationControllerImpl::NavigateToPendingEntry().
-  pending_entry_id_ = pending_entry ? pending_entry->GetUniqueID() : 0;
+  pending_entry_url_ = pending_entry ? pending_entry->GetURL() : GURL();
 }
 
 void OverscrollNavigationOverlay::SetOverlayWindow(
@@ -279,23 +295,21 @@
 }
 
 void OverscrollNavigationOverlay::DidFirstVisuallyNonEmptyPaint() {
-  int visible_entry_id =
-      web_contents_->GetController().GetVisibleEntry()->GetUniqueID();
-  if (visible_entry_id == pending_entry_id_ || !pending_entry_id_) {
+  NavigationEntry* visible_entry =
+      web_contents_->GetController().GetVisibleEntry();
+  if (pending_entry_url_.is_empty() ||
+      DoesEntryMatchURL(visible_entry, pending_entry_url_)) {
     received_paint_update_ = true;
     StopObservingIfDone();
   }
 }
 
 void OverscrollNavigationOverlay::DidStopLoading(RenderViewHost* host) {
-  // Use the last committed entry rather than the active one, in case a
-  // pending entry has been created.
-  int committed_entry_id =
-      web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID();
-  if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) {
-    loading_complete_ = true;
-    StopObservingIfDone();
-  }
+  // Don't compare URLs in this case - it's possible they won't match if
+  // a gesture-nav initiated navigation was interrupted by some other in-site
+  // navigation ((e.g., from a script, or from a bookmark).
+  loading_complete_ = true;
+  StopObservingIfDone();
 }
 
 }  // namespace content
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.h b/content/browser/web_contents/aura/overscroll_navigation_overlay.h
index e8e9171..ccef1bf 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay.h
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.h
@@ -101,10 +101,10 @@
   bool loading_complete_;
   bool received_paint_update_;
 
-  // Unique ID of the NavigationEntry we are navigating to. This is needed to
+  // URL of the NavigationEntry we are navigating to. This is needed to
   // filter on WebContentsObserver callbacks and is used to dismiss the overlay
   // when the relevant page loads and paints.
-  int pending_entry_id_;
+  GURL pending_entry_url_;
 
   // The |WindowSlider| that allows sliding history layers while the page is
   // being reloaded.
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
index 3f56f33..895b47b 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
@@ -157,7 +157,7 @@
   EXPECT_FALSE(GetOverlay()->received_paint_update_);
 
   ReceivePaintUpdate();
-  // Paint updates until the navigation is committed represent updates
+  // Paint updates until the navigation is committed typically represent updates
   // for the previous page, so they shouldn't affect the flag.
   EXPECT_FALSE(GetOverlay()->received_paint_update_);
 
@@ -179,17 +179,13 @@
   // Navigation was started, so the loading status flag should be reset.
   EXPECT_FALSE(GetOverlay()->loading_complete_);
 
-  // Load updates until the navigation is committed represent updates for the
-  // previous page, so they shouldn't affect the flag.
+  // DidStopLoading for any navigation should always reset the load flag and
+  // dismiss the overlay even if the pending navigation wasn't committed -
+  // this is a "safety net" in case we mis-identify the destination webpage
+  // (which can happen if a new navigation is performed while while a GestureNav
+  // navigation is in progress).
   contents()->TestSetIsLoading(true);
   contents()->TestSetIsLoading(false);
-  EXPECT_FALSE(GetOverlay()->loading_complete_);
-
-  contents()->CommitPendingNavigation();
-  contents()->TestSetIsLoading(true);
-  contents()->TestSetIsLoading(false);
-  // Navigation was committed and the load update was received - the flag
-  // should now be updated.
   EXPECT_TRUE(GetOverlay()->loading_complete_);
 
   EXPECT_FALSE(GetOverlay()->web_contents());
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 fa3f4e9..58f66b4 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
@@ -3015,6 +3015,19 @@
 
     @CalledByNative
     private void onSmartClipDataExtracted(String text, String html, Rect clipRect) {
+        // Translate the positions by the offsets introduced by location bar. Note that the
+        // coordinates are in dp scale, and that this definitely has the potential to be
+        // different from the offsets when extractSmartClipData() was called. However,
+        // as long as OEM has a UI that consumes all the inputs and waits until the
+        // callback is called, then there shouldn't be any difference.
+        // TODO(changwan): once crbug.com/416432 is resolved, try to pass offsets as
+        // separate params for extractSmartClipData(), and apply them not the new offset
+        // values in the callback.
+        final float deviceScale = mRenderCoordinates.getDeviceScaleFactor();
+        final int offsetXInDp = (int) (mSmartClipOffsetX / deviceScale);
+        final int offsetYInDp = (int) (mSmartClipOffsetY / deviceScale);
+        clipRect.offset(-offsetXInDp, -offsetYInDp);
+
         if (mSmartClipDataListener != null ) {
             mSmartClipDataListener.onSmartClipDataExtracted(text, html, clipRect);
         }
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
index f2c91e6..49123b2 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/InputDialogContainer.java
@@ -16,7 +16,6 @@
 import android.widget.ListView;
 import android.widget.TimePicker;
 
-import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.content.R;
 import org.chromium.content.browser.input.DateTimePickerDialog.OnDateTimeSetListener;
 import org.chromium.content.browser.input.MultiFieldTimePickerDialog.OnMultiFieldTimeSetListener;
@@ -247,11 +246,11 @@
             mDialog = new WeekPickerDialog(mContext, new MonthOrWeekListener(dialogType),
                     year, week, min, max);
         }
-        if (ApiCompatibilityUtils.datePickerRequiresAccept()) {
-            mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
-                    mContext.getText(R.string.date_picker_dialog_set),
-                    (DialogInterface.OnClickListener) mDialog);
-        }
+
+        mDialog.setButton(DialogInterface.BUTTON_POSITIVE,
+                mContext.getText(R.string.date_picker_dialog_set),
+                (DialogInterface.OnClickListener) mDialog);
+
 
         mDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
                 mContext.getText(android.R.string.cancel),
diff --git a/content/renderer/pepper/pepper_media_device_manager.cc b/content/renderer/pepper/pepper_media_device_manager.cc
index aaf437f..0d54964 100644
--- a/content/renderer/pepper/pepper_media_device_manager.cc
+++ b/content/renderer/pepper/pepper_media_device_manager.cc
@@ -16,7 +16,9 @@
 ppapi::DeviceRefData FromStreamDeviceInfo(const StreamDeviceInfo& info) {
   ppapi::DeviceRefData data;
   data.id = info.device.id;
-  data.name = info.device.name;
+  // Some Flash content can't handle an empty string, so stick a space in to
+  // make them happy. See crbug.com/408404.
+  data.name = info.device.name.empty() ? std::string(" ") : info.device.name;
   data.type = PepperMediaDeviceManager::FromMediaStreamType(info.device.type);
   return data;
 }
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc
index 4976b56..4d1501e 100644
--- a/media/audio/pulse/pulse_input.cc
+++ b/media/audio/pulse/pulse_input.cc
@@ -268,6 +268,15 @@
       break;
 
     const int number_of_frames = length / params_.GetBytesPerFrame();
+    if (number_of_frames > fifo_.GetUnfilledFrames()) {
+      // Dynamically increase capacity to the FIFO to handle larger buffer got
+      // from Pulse.
+      const int increase_blocks_of_buffer = static_cast<int>(
+          (number_of_frames - fifo_.GetUnfilledFrames()) /
+              params_.frames_per_buffer()) + 1;
+      fifo_.IncreaseCapacity(increase_blocks_of_buffer);
+    }
+
     fifo_.Push(data, number_of_frames, params_.bits_per_sample() / 8);
 
     // Checks if we still have data.
diff --git a/media/base/audio_block_fifo.cc b/media/base/audio_block_fifo.cc
index 5e8c9b3..000d131 100644
--- a/media/base/audio_block_fifo.cc
+++ b/media/base/audio_block_fifo.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <algorithm>
+
 #include "media/base/audio_block_fifo.h"
 
 #include "base/logging.h"
@@ -9,17 +11,13 @@
 namespace media {
 
 AudioBlockFifo::AudioBlockFifo(int channels, int frames, int blocks)
-    : block_frames_(frames),
+    : channels_(channels),
+      block_frames_(frames),
       write_block_(0),
       read_block_(0),
       available_blocks_(0),
       write_pos_(0) {
-  // Create |blocks| of audio buses and push them to the containers.
-  audio_blocks_.reserve(blocks);
-  for (int i = 0; i < blocks; ++i) {
-    scoped_ptr<AudioBus> audio_bus = AudioBus::Create(channels, frames);
-    audio_blocks_.push_back(audio_bus.release());
-  }
+  IncreaseCapacity(blocks);
 }
 
 AudioBlockFifo::~AudioBlockFifo() {}
@@ -31,6 +29,7 @@
   DCHECK_GT(frames, 0);
   DCHECK_GT(bytes_per_sample, 0);
   DCHECK_LT(available_blocks_, static_cast<int>(audio_blocks_.size()));
+  CHECK_LE(frames, GetUnfilledFrames());
 
   const uint8* source_ptr = static_cast<const uint8*>(source);
   int frames_to_push = frames;
@@ -54,7 +53,7 @@
       ++available_blocks_;
     }
 
-    source_ptr += push_frames * bytes_per_sample * current_block->channels();
+    source_ptr += push_frames * bytes_per_sample * channels_;
     frames_to_push -= push_frames;
     DCHECK_GE(frames_to_push, 0);
   }
@@ -86,4 +85,34 @@
   return unfilled_frames;
 }
 
+void AudioBlockFifo::IncreaseCapacity(int blocks) {
+  DCHECK_GT(blocks, 0);
+
+  // Create |blocks| of audio buses and insert them to the containers.
+  audio_blocks_.reserve(audio_blocks_.size() + blocks);
+
+  const int original_size = audio_blocks_.size();
+  for (int i = 0; i < blocks; ++i) {
+    audio_blocks_.push_back(
+        AudioBus::Create(channels_, block_frames_).release());
+  }
+
+  if (!original_size)
+    return;
+
+  std::rotate(audio_blocks_.begin() + read_block_,
+              audio_blocks_.begin() + original_size,
+              audio_blocks_.end());
+
+  // Update the write pointer if it is on top of the new inserted blocks.
+  if (write_block_ >= read_block_)
+    write_block_ += blocks;
+
+  // Update the read pointers correspondingly.
+  read_block_ += blocks;
+
+  DCHECK_LT(read_block_, static_cast<int>(audio_blocks_.size()));
+  DCHECK_LT(write_block_, static_cast<int>(audio_blocks_.size()));
+}
+
 }  // namespace media
diff --git a/media/base/audio_block_fifo.h b/media/base/audio_block_fifo.h
index fdb5cef..94786b9 100644
--- a/media/base/audio_block_fifo.h
+++ b/media/base/audio_block_fifo.h
@@ -45,10 +45,16 @@
   // Number of unfilled frames in the whole FIFO.
   int GetUnfilledFrames() const;
 
+  // Dynamically increase |blocks| of memory to the FIFO.
+  void IncreaseCapacity(int blocks);
+
  private:
   // The actual FIFO is a vector of audio buses.
   ScopedVector<AudioBus> audio_blocks_;
 
+  // Number of channels in AudioBus.
+  const int channels_;
+
   // Maximum number of frames of data one block of memory can contain.
   // This value is set by |frames| in the constructor.
   const int block_frames_;
diff --git a/media/base/audio_block_fifo_unittest.cc b/media/base/audio_block_fifo_unittest.cc
index 8e8b5e0..e12167c 100644
--- a/media/base/audio_block_fifo_unittest.cc
+++ b/media/base/audio_block_fifo_unittest.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/time/time.h"
+#include "media/audio/audio_power_monitor.h"
 #include "media/base/audio_block_fifo.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -14,14 +16,9 @@
 
   void PushAndVerify(AudioBlockFifo* fifo, int frames_to_push,
                      int channels, int block_frames, int max_frames) {
-    const int bytes_per_sample = 2;
-    const int data_byte_size = bytes_per_sample * channels * frames_to_push;
-    scoped_ptr<uint8[]> data(new uint8[data_byte_size]);
-    memset(data.get(), 0, data_byte_size);
-
     for (int filled_frames = max_frames - fifo->GetUnfilledFrames();
          filled_frames + frames_to_push <= max_frames;) {
-      fifo->Push(data.get(), frames_to_push, bytes_per_sample);
+      Push(fifo, frames_to_push, channels);
       filled_frames += frames_to_push;
       EXPECT_EQ(max_frames - filled_frames, fifo->GetUnfilledFrames());
       EXPECT_EQ(static_cast<int>(filled_frames / block_frames),
@@ -29,6 +26,28 @@
     }
   }
 
+  void Push(AudioBlockFifo* fifo, int frames_to_push, int channels) {
+    DCHECK_LE(frames_to_push, fifo->GetUnfilledFrames());
+    const int bytes_per_sample = 2;
+    const int data_byte_size = bytes_per_sample * channels * frames_to_push;
+    scoped_ptr<uint8[]> data(new uint8[data_byte_size]);
+    memset(data.get(), 1, data_byte_size);
+    fifo->Push(data.get(), frames_to_push, bytes_per_sample);
+  }
+
+  void ConsumeAndVerify(AudioBlockFifo* fifo, int expected_unfilled_frames,
+                        int expected_available_blocks) {
+    const AudioBus* bus = fifo->Consume();
+    EXPECT_EQ(fifo->GetUnfilledFrames(), expected_unfilled_frames);
+    EXPECT_EQ(fifo->available_blocks(), expected_available_blocks);
+
+    // Verify the audio data is not 0.
+    for (int i = 0; i < bus->channels(); ++i) {
+      EXPECT_GT(bus->channel(i)[0], 0.0f);
+      EXPECT_GT(bus->channel(i)[bus->frames() - 1], 0.0f);
+    }
+  }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(AudioBlockFifoTest);
 };
@@ -146,4 +165,62 @@
   EXPECT_TRUE(fifo.GetUnfilledFrames() == frames);
 }
 
+// Dynamically increase the capacity of FIFO and verify buffers are correct.
+TEST_F(AudioBlockFifoTest, DynamicallyIncreaseCapacity) {
+  // Create a FIFO with default blocks of buffers.
+  const int channels = 2;
+  const int frames = 441;
+  const int default_blocks = 2;
+  AudioBlockFifo fifo(channels, frames, default_blocks);
+  Push(&fifo, frames, channels);
+  int expected_unfilled_frames = frames;
+  int expected_available_blocks = 1;
+  EXPECT_EQ(expected_unfilled_frames, fifo.GetUnfilledFrames());
+  EXPECT_EQ(expected_available_blocks, fifo.available_blocks());
+
+  // Increase the capacity dynamically for the first time.
+  const int new_blocks_1 = 3;
+  fifo.IncreaseCapacity(new_blocks_1);
+  expected_unfilled_frames += new_blocks_1 * frames;
+  EXPECT_EQ(fifo.GetUnfilledFrames(), expected_unfilled_frames);
+  EXPECT_EQ(fifo.available_blocks(), expected_available_blocks);
+
+  // Verify the previous buffer is not affected by the dynamic capacity
+  // increment.
+  expected_unfilled_frames += frames;
+  expected_available_blocks -= 1;
+  ConsumeAndVerify(&fifo, expected_unfilled_frames, expected_available_blocks);
+
+  // Fill another |new_blocks_1 + 0.5| blocks of data to the FIFO.
+  const int frames_to_push = static_cast<int>((new_blocks_1 + 0.5) * frames);
+  int max_frames = frames * (default_blocks + new_blocks_1);
+  Push(&fifo, frames_to_push, channels);
+  expected_unfilled_frames = max_frames - frames_to_push;
+  expected_available_blocks = new_blocks_1;
+  EXPECT_EQ(fifo.GetUnfilledFrames(), expected_unfilled_frames);
+  EXPECT_EQ(fifo.available_blocks(), expected_available_blocks);
+
+  // Increase the capacity dynamically for the second time.
+  const int new_blocks_2 = 2;
+  fifo.IncreaseCapacity(new_blocks_2);
+  max_frames += new_blocks_2 * frames;
+  expected_unfilled_frames += new_blocks_2 * frames;
+  EXPECT_EQ(fifo.GetUnfilledFrames(), expected_unfilled_frames);
+  EXPECT_EQ(fifo.available_blocks(), expected_available_blocks);
+
+  // Verify the previous buffers are not affected by the dynamic capacity
+  // increment.
+  while (fifo.available_blocks()) {
+    expected_unfilled_frames += frames;
+    expected_available_blocks -= 1;
+    ConsumeAndVerify(&fifo, expected_unfilled_frames,
+                     expected_available_blocks);
+  }
+
+  // Fill up one block of buffer and consume it, FIFO should then be empty.
+  const int available_frames = max_frames - expected_unfilled_frames;
+  Push(&fifo, frames - available_frames, channels);
+  ConsumeAndVerify(&fifo, max_frames, 0);
+}
+
 }  // namespace media
diff --git a/media/cdm/ppapi/cdm_adapter.cc b/media/cdm/ppapi/cdm_adapter.cc
index 2452be8..775c539 100644
--- a/media/cdm/ppapi/cdm_adapter.cc
+++ b/media/cdm/ppapi/cdm_adapter.cc
@@ -18,6 +18,12 @@
 
 namespace {
 
+// Constants for UMA reporting of file size (in KB) via HistogramCustomCounts().
+// Note that the histogram is log-scaled (rather than linear).
+const uint32_t kSizeKBMin = 1;
+const uint32_t kSizeKBMax = 512 * 1024;  // 512MB
+const uint32_t kSizeKBBuckets = 100;
+
 #if !defined(NDEBUG)
   #define DLOG_TO_CONSOLE(message) LogToConsole(message);
 #else
@@ -266,7 +272,9 @@
       deferred_initialize_audio_decoder_(false),
       deferred_audio_decoder_config_id_(0),
       deferred_initialize_video_decoder_(false),
-      deferred_video_decoder_config_id_(0) {
+      deferred_video_decoder_config_id_(0),
+      last_read_file_size_kb_(0),
+      file_size_uma_reported_(false) {
   callback_factory_.Initialize(this);
 }
 
@@ -741,6 +749,17 @@
                                  uint32_t system_code,
                                  const char* error_message,
                                  uint32_t error_message_length) {
+  // UMA to investigate http://crbug.com/410630
+  // TODO(xhwang): Remove after bug is fixed.
+  if (system_code == 0x27) {
+    pp::UMAPrivate uma_interface(this);
+    uma_interface.HistogramCustomCounts("Media.EME.CdmFileIO.FileSizeKBOnError",
+                                        last_read_file_size_kb_,
+                                        kSizeKBMin,
+                                        kSizeKBMax,
+                                        kSizeKBBuckets);
+  }
+
   RejectPromise(promise_id,
                 error,
                 system_code,
@@ -1079,6 +1098,25 @@
   return true;
 }
 
+void CdmAdapter::OnFirstFileRead(int32_t file_size_bytes) {
+  PP_DCHECK(IsMainThread());
+  PP_DCHECK(file_size_bytes >= 0);
+
+  last_read_file_size_kb_ = file_size_bytes / 1024;
+
+  if (file_size_uma_reported_)
+    return;
+
+  pp::UMAPrivate uma_interface(this);
+  uma_interface.HistogramCustomCounts(
+      "Media.EME.CdmFileIO.FileSizeKBOnFirstRead",
+      last_read_file_size_kb_,
+      kSizeKBMin,
+      kSizeKBMax,
+      kSizeKBBuckets);
+  file_size_uma_reported_ = true;
+}
+
 #if !defined(NDEBUG)
 void CdmAdapter::LogToConsole(const pp::Var& value) {
   PP_DCHECK(IsMainThread());
@@ -1186,13 +1224,16 @@
 
 // The CDM owns the returned object and must call FileIO::Close() to release it.
 cdm::FileIO* CdmAdapter::CreateFileIO(cdm::FileIOClient* client) {
-  return new CdmFileIOImpl(client, pp_instance());
+  return new CdmFileIOImpl(
+      client,
+      pp_instance(),
+      callback_factory_.NewCallback(&CdmAdapter::OnFirstFileRead));
 }
 
 #if defined(OS_CHROMEOS)
 void CdmAdapter::ReportOutputProtectionUMA(OutputProtectionStatus status) {
-  pp::UMAPrivate uma_interface_(this);
-  uma_interface_.HistogramEnumeration(
+  pp::UMAPrivate uma_interface(this);
+  uma_interface.HistogramEnumeration(
       "Media.EME.OutputProtection", status, OUTPUT_PROTECTION_MAX);
 }
 
diff --git a/media/cdm/ppapi/cdm_adapter.h b/media/cdm/ppapi/cdm_adapter.h
index cd4738b..c2b573e 100644
--- a/media/cdm/ppapi/cdm_adapter.h
+++ b/media/cdm/ppapi/cdm_adapter.h
@@ -261,6 +261,9 @@
 
   bool IsValidVideoFrame(const LinkedVideoFrame& video_frame);
 
+  // Callback to report |file_size_bytes| of the first file read by FileIO.
+  void OnFirstFileRead(int32_t file_size_bytes);
+
 #if !defined(NDEBUG)
   // Logs the given message to the JavaScript console associated with the
   // CDM adapter instance. The name of the CDM adapter issuing the log message
@@ -312,6 +315,9 @@
   bool deferred_initialize_video_decoder_;
   uint32_t deferred_video_decoder_config_id_;
 
+  uint32_t last_read_file_size_kb_;
+  bool file_size_uma_reported_;
+
   DISALLOW_COPY_AND_ASSIGN(CdmAdapter);
 };
 
diff --git a/media/cdm/ppapi/cdm_file_io_impl.cc b/media/cdm/ppapi/cdm_file_io_impl.cc
index 7263889..3dbff43 100644
--- a/media/cdm/ppapi/cdm_file_io_impl.cc
+++ b/media/cdm/ppapi/cdm_file_io_impl.cc
@@ -13,7 +13,10 @@
 
 namespace media {
 
-const int kReadSize = 4 * 1024;  // Arbitrary choice.
+// Arbitrary choice based on the following heuristic ideas:
+// - not too big to avoid unnecessarily large memory allocation;
+// - not too small to avoid breaking most reads into multiple read operations.
+const int kReadSize = 8 * 1024;
 
 // Call func_call and check the result. If the result is not
 // PP_OK_COMPLETIONPENDING, print out logs, call OnError() and return.
@@ -23,6 +26,7 @@
     PP_DCHECK(result != PP_OK);                                         \
     if (result != PP_OK_COMPLETIONPENDING) {                            \
       CDM_DLOG() << #func_call << " failed with result: " << result;    \
+      state_ = STATE_ERROR;                                             \
       OnError(error_type);                                              \
       return;                                                           \
     }                                                                   \
@@ -55,36 +59,48 @@
   delete CdmFileIOImpl::file_lock_map_;
 }
 
-CdmFileIOImpl::CdmFileIOImpl(cdm::FileIOClient* client, PP_Instance pp_instance)
-    : state_(FILE_UNOPENED),
+CdmFileIOImpl::CdmFileIOImpl(
+    cdm::FileIOClient* client,
+    PP_Instance pp_instance,
+    const pp::CompletionCallback& first_file_read_cb)
+    : state_(STATE_UNOPENED),
       client_(client),
       pp_instance_handle_(pp_instance),
-      callback_factory_(this),
-      io_offset_(0) {
+      io_offset_(0),
+      first_file_read_reported_(false),
+      first_file_read_cb_(first_file_read_cb),
+      callback_factory_(this) {
   PP_DCHECK(IsMainThread());
   PP_DCHECK(pp_instance);  // 0 indicates a "NULL handle".
 }
 
 CdmFileIOImpl::~CdmFileIOImpl() {
-  PP_DCHECK(state_ == FILE_CLOSED);
+  // The destructor is private. |this| can only be destructed through Close().
+  PP_DCHECK(state_ == STATE_CLOSED);
 }
 
-// Call sequence: Open() -> OpenFileSystem() -> OpenFile() -> FILE_OPENED.
+// Call sequence: Open() -> OpenFileSystem() -> STATE_FILE_SYSTEM_OPENED.
+// Note: This only stores file name and opens the file system. The real file
+// open is deferred to when Read() or Write() is called.
 void CdmFileIOImpl::Open(const char* file_name, uint32_t file_name_size) {
   CDM_DLOG() << __FUNCTION__;
   PP_DCHECK(IsMainThread());
 
-  if (state_ != FILE_UNOPENED) {
+  if (state_ != STATE_UNOPENED) {
     CDM_DLOG() << "Open() called in an invalid state.";
     OnError(OPEN_ERROR);
     return;
   }
 
-  // File name should not contain any path separators.
+  // File name should not (1) be empty, (2) start with '_', or (3) contain any
+  // path separators.
   std::string file_name_str(file_name, file_name_size);
-  if (file_name_str.find('/') != std::string::npos ||
+  if (file_name_str.empty() ||
+      file_name_str[0] == '_' ||
+      file_name_str.find('/') != std::string::npos ||
       file_name_str.find('\\') != std::string::npos) {
     CDM_DLOG() << "Invalid file name.";
+    state_ = STATE_ERROR;
     OnError(OPEN_ERROR);
     return;
   }
@@ -98,59 +114,52 @@
     return;
   }
 
-  state_ = OPENING_FILE_SYSTEM;
+  state_ = STATE_OPENING_FILE_SYSTEM;
   OpenFileSystem();
 }
 
 // Call sequence:
-//                                       finished
-// Read() -> ReadFile() -> OnFileRead() ----------> Done.
-//               ^              |
-//               | not finished |
-//               |--------------|
+// Read() -> OpenFileForRead() -> ReadFile() -> Done.
 void CdmFileIOImpl::Read() {
   CDM_DLOG() << __FUNCTION__;
   PP_DCHECK(IsMainThread());
 
-  if (state_ == READING_FILE || state_ == WRITING_FILE) {
+  if (state_ == STATE_READING || state_ == STATE_WRITING) {
     CDM_DLOG() << "Read() called during pending read/write.";
     OnError(READ_WHILE_IN_USE);
     return;
   }
 
-  if (state_ != FILE_OPENED) {
+  if (state_ != STATE_FILE_SYSTEM_OPENED) {
     CDM_DLOG() << "Read() called in an invalid state.";
     OnError(READ_ERROR);
     return;
   }
 
+  PP_DCHECK(io_offset_ == 0);
   PP_DCHECK(io_buffer_.empty());
   PP_DCHECK(cumulative_read_buffer_.empty());
-
   io_buffer_.resize(kReadSize);
   io_offset_ = 0;
 
-  state_ = READING_FILE;
-  ReadFile();
+  state_ = STATE_READING;
+  OpenFileForRead();
 }
 
 // Call sequence:
-//                                            finished
-// Write() -> WriteFile() -> OnFileWritten() ----------> Done.
-//                ^                  |
-//                |                  | not finished
-//                |------------------|
+// Write() -> OpenTempFileForWrite() -> WriteTempFile() -> RenameTempFile().
+// The file name of the temporary file is /_<requested_file_name>.
 void CdmFileIOImpl::Write(const uint8_t* data, uint32_t data_size) {
   CDM_DLOG() << __FUNCTION__;
   PP_DCHECK(IsMainThread());
 
-  if (state_ == READING_FILE || state_ == WRITING_FILE) {
+  if (state_ == STATE_READING || state_ == STATE_WRITING) {
     CDM_DLOG() << "Write() called during pending read/write.";
     OnError(WRITE_WHILE_IN_USE);
     return;
   }
 
-  if (state_ != FILE_OPENED) {
+  if (state_ != STATE_FILE_SYSTEM_OPENED) {
     CDM_DLOG() << "Write() called in an invalid state.";
     OnError(WRITE_ERROR);
     return;
@@ -163,17 +172,16 @@
   else
     PP_DCHECK(!data);
 
-  state_ = WRITING_FILE;
-
-  // Always SetLength() in case |data_size| is less than the file size.
-  SetLength(data_size);
+  state_ = STATE_WRITING;
+  OpenTempFileForWrite();
 }
 
 void CdmFileIOImpl::Close() {
   CDM_DLOG() << __FUNCTION__;
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ != FILE_CLOSED);
-  CloseFile();
+  PP_DCHECK(state_ != STATE_CLOSED);
+  Reset();
+  state_ = STATE_CLOSED;
   ReleaseFileLock();
   // All pending callbacks are canceled since |callback_factory_| is destroyed.
   delete this;
@@ -232,7 +240,7 @@
 }
 
 void CdmFileIOImpl::OpenFileSystem() {
-  PP_DCHECK(state_ == OPENING_FILE_SYSTEM);
+  PP_DCHECK(state_ == STATE_OPENING_FILE_SYSTEM);
 
   pp::CompletionCallbackWithOutput<pp::FileSystem> cb =
       callback_factory_.NewCallbackWithOutput(
@@ -246,51 +254,71 @@
 void CdmFileIOImpl::OnFileSystemOpened(int32_t result,
                                        pp::FileSystem file_system) {
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ == OPENING_FILE_SYSTEM);
+  PP_DCHECK(state_ == STATE_OPENING_FILE_SYSTEM);
 
   if (result != PP_OK) {
     CDM_DLOG() << "File system open failed asynchronously.";
     ReleaseFileLock();
+    state_ = STATE_ERROR;
     OnError(OPEN_ERROR);
     return;
   }
 
   file_system_ = file_system;
-  state_ = OPENING_FILE;
-  OpenFile();
+
+  state_ = STATE_FILE_SYSTEM_OPENED;
+  client_->OnOpenComplete(cdm::FileIOClient::kSuccess);
 }
 
-void CdmFileIOImpl::OpenFile() {
-  PP_DCHECK(state_ == OPENING_FILE);
+void CdmFileIOImpl::OpenFileForRead() {
+  PP_DCHECK(state_ == STATE_READING);
 
+  PP_DCHECK(file_io_.is_null());
+  PP_DCHECK(file_ref_.is_null());
   file_io_ = pp::FileIO(pp_instance_handle_);
   file_ref_ = pp::FileRef(file_system_, file_name_.c_str());
-  int32_t file_open_flag = PP_FILEOPENFLAG_READ |
-                           PP_FILEOPENFLAG_WRITE |
-                           PP_FILEOPENFLAG_CREATE;
+
+  // Open file for read. If file doesn't exist, PP_ERROR_FILENOTFOUND will be
+  // returned.
+  int32_t file_open_flag = PP_FILEOPENFLAG_READ;
+
   pp::CompletionCallback cb =
-      callback_factory_.NewCallback(&CdmFileIOImpl::OnFileOpened);
+      callback_factory_.NewCallback(&CdmFileIOImpl::OnFileOpenedForRead);
   CHECK_PP_OK_COMPLETIONPENDING(file_io_.Open(file_ref_, file_open_flag, cb),
-                                OPEN_ERROR);
+                                READ_ERROR);
 }
 
-void CdmFileIOImpl::OnFileOpened(int32_t result) {
+void CdmFileIOImpl::OnFileOpenedForRead(int32_t result) {
+  CDM_DLOG() << __FUNCTION__ << ": " << result;
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ == OPENING_FILE);
+  PP_DCHECK(state_ == STATE_READING);
 
-  if (result != PP_OK) {
+  if (result != PP_OK && result != PP_ERROR_FILENOTFOUND) {
     CDM_DLOG() << "File open failed.";
-    ReleaseFileLock();
+    state_ = STATE_ERROR;
     OnError(OPEN_ERROR);
     return;
   }
 
-  state_ = FILE_OPENED;
-  client_->OnOpenComplete(cdm::FileIOClient::kSuccess);
+  // File doesn't exist.
+  if (result == PP_ERROR_FILENOTFOUND) {
+    Reset();
+    state_ = STATE_FILE_SYSTEM_OPENED;
+    client_->OnReadComplete(cdm::FileIOClient::kSuccess, NULL, 0);
+    return;
+  }
+
+  ReadFile();
 }
 
+// Call sequence:
+//                               fully read
+// ReadFile() ---> OnFileRead() ------------> Done.
+//     ^                |
+//     | partially read |
+//     |----------------|
 void CdmFileIOImpl::ReadFile() {
-  PP_DCHECK(state_ == READING_FILE);
+  PP_DCHECK(state_ == STATE_READING);
   PP_DCHECK(!io_buffer_.empty());
 
   pp::CompletionCallback cb =
@@ -303,11 +331,12 @@
 void CdmFileIOImpl::OnFileRead(int32_t bytes_read) {
   CDM_DLOG() << __FUNCTION__ << ": " << bytes_read;
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ == READING_FILE);
+  PP_DCHECK(state_ == STATE_READING);
 
   // 0 |bytes_read| indicates end-of-file reached.
   if (bytes_read < PP_OK) {
     CDM_DLOG() << "Read file failed.";
+    state_ = STATE_ERROR;
     OnError(READ_ERROR);
     return;
   }
@@ -319,61 +348,98 @@
                                  io_buffer_.begin() + bytes_read);
   io_offset_ += bytes_read;
 
-  // Not received end-of-file yet.
+  // Not received end-of-file yet. Keep reading.
   if (bytes_read > 0) {
     ReadFile();
     return;
   }
 
   // We hit end-of-file. Return read data to the client.
-  io_buffer_.clear();
-  io_offset_ = 0;
+
   // Clear |cumulative_read_buffer_| in case OnReadComplete() calls Read() or
   // Write().
   std::vector<char> local_buffer;
   std::swap(cumulative_read_buffer_, local_buffer);
 
-  state_ = FILE_OPENED;
   const uint8_t* data = local_buffer.empty() ?
       NULL : reinterpret_cast<const uint8_t*>(&local_buffer[0]);
+
+  // Call this before OnReadComplete() so that we always have the latest file
+  // size before CDM fires errors.
+  if (!first_file_read_reported_) {
+    first_file_read_cb_.Run(local_buffer.size());
+    first_file_read_reported_ = true;
+  }
+
+  Reset();
+
+  state_ = STATE_FILE_SYSTEM_OPENED;
   client_->OnReadComplete(
       cdm::FileIOClient::kSuccess, data, local_buffer.size());
 }
 
-void CdmFileIOImpl::SetLength(uint32_t length) {
-  PP_DCHECK(state_ == WRITING_FILE);
+void CdmFileIOImpl::OpenTempFileForWrite() {
+  PP_DCHECK(state_ == STATE_WRITING);
+
+  PP_DCHECK(file_name_.size() > 1 && file_name_[0] == '/');
+  // Temporary file name format: /_<requested_file_name>
+  std::string temp_file_name = "/_" + file_name_.substr(1);
+
+  PP_DCHECK(file_io_.is_null());
+  PP_DCHECK(file_ref_.is_null());
+  file_io_ = pp::FileIO(pp_instance_handle_);
+  file_ref_ = pp::FileRef(file_system_, temp_file_name.c_str());
+
+  // Create the file if it doesn't exist. Truncate the file to length 0 if it
+  // exists.
+  // TODO(xhwang): Find a good way to report to UMA cases where the temporary
+  // file already exists (due to previous interruption or failure).
+  int32_t file_open_flag = PP_FILEOPENFLAG_WRITE |
+                           PP_FILEOPENFLAG_TRUNCATE |
+                           PP_FILEOPENFLAG_CREATE;
 
   pp::CompletionCallback cb =
-      callback_factory_.NewCallback(&CdmFileIOImpl::OnLengthSet);
-  CHECK_PP_OK_COMPLETIONPENDING(file_io_.SetLength(length, cb), WRITE_ERROR);
+      callback_factory_.NewCallback(&CdmFileIOImpl::OnTempFileOpenedForWrite);
+  CHECK_PP_OK_COMPLETIONPENDING(
+      file_io_.Open(file_ref_, file_open_flag, cb), WRITE_ERROR);
 }
 
-void CdmFileIOImpl::OnLengthSet(int32_t result) {
+void CdmFileIOImpl::OnTempFileOpenedForWrite(int32_t result) {
   CDM_DLOG() << __FUNCTION__ << ": " << result;
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ == WRITING_FILE);
+  PP_DCHECK(state_ == STATE_WRITING);
 
   if (result != PP_OK) {
-    CDM_DLOG() << "File SetLength failed.";
+    CDM_DLOG() << "Open temporary file failed.";
+    state_ = STATE_ERROR;
     OnError(WRITE_ERROR);
     return;
   }
 
+  // We were told to write 0 bytes (to clear the file). In this case, there's
+  // no need to write anything.
   if (io_buffer_.empty()) {
-    state_ = FILE_OPENED;
-    client_->OnWriteComplete(cdm::FileIOClient::kSuccess);
+    RenameTempFile();
     return;
   }
 
-  WriteFile();
+  PP_DCHECK(io_offset_ == 0);
+  io_offset_ = 0;
+  WriteTempFile();
 }
 
-void CdmFileIOImpl::WriteFile() {
-  PP_DCHECK(state_ == WRITING_FILE);
+// Call sequence:
+//                                         fully written
+// WriteTempFile() -> OnTempFileWritten() ---------------> RenameTempFile().
+//      ^                     |
+//      |  partially written  |
+//      |---------------------|
+void CdmFileIOImpl::WriteTempFile() {
+  PP_DCHECK(state_ == STATE_WRITING);
   PP_DCHECK(io_offset_ < io_buffer_.size());
 
   pp::CompletionCallback cb =
-      callback_factory_.NewCallback(&CdmFileIOImpl::OnFileWritten);
+      callback_factory_.NewCallback(&CdmFileIOImpl::OnTempFileWritten);
   CHECK_PP_OK_COMPLETIONPENDING(file_io_.Write(io_offset_,
                                                &io_buffer_[io_offset_],
                                                io_buffer_.size() - io_offset_,
@@ -381,14 +447,15 @@
                                 WRITE_ERROR);
 }
 
-void CdmFileIOImpl::OnFileWritten(int32_t bytes_written) {
+void CdmFileIOImpl::OnTempFileWritten(int32_t bytes_written) {
   CDM_DLOG() << __FUNCTION__ << ": " << bytes_written;
   PP_DCHECK(IsMainThread());
-  PP_DCHECK(state_ == WRITING_FILE);
+  PP_DCHECK(state_ == STATE_WRITING);
 
   if (bytes_written <= PP_OK) {
-    CDM_DLOG() << "Write file failed.";
-    OnError(READ_ERROR);
+    CDM_DLOG() << "Write temporary file failed.";
+    state_ = STATE_ERROR;
+    OnError(WRITE_ERROR);
     return;
   }
 
@@ -396,35 +463,58 @@
   PP_DCHECK(io_offset_ <= io_buffer_.size());
 
   if (io_offset_ < io_buffer_.size()) {
-    WriteFile();
+    WriteTempFile();
     return;
   }
 
-  io_buffer_.clear();
-  io_offset_ = 0;
-  state_ = FILE_OPENED;
+  // All data written. Now rename the temporary file to the real file.
+  RenameTempFile();
+}
+
+void CdmFileIOImpl::RenameTempFile() {
+  PP_DCHECK(state_ == STATE_WRITING);
+
+  pp::CompletionCallback cb =
+      callback_factory_.NewCallback(&CdmFileIOImpl::OnTempFileRenamed);
+  CHECK_PP_OK_COMPLETIONPENDING(
+      file_ref_.Rename(pp::FileRef(file_system_, file_name_.c_str()), cb),
+      WRITE_ERROR);
+}
+
+void CdmFileIOImpl::OnTempFileRenamed(int32_t result) {
+  CDM_DLOG() << __FUNCTION__ << ": " << result;
+  PP_DCHECK(IsMainThread());
+  PP_DCHECK(state_ == STATE_WRITING);
+
+  if (result != PP_OK) {
+    CDM_DLOG() << "Rename temporary file failed.";
+    state_ = STATE_ERROR;
+    OnError(WRITE_ERROR);
+    return;
+  }
+
+  Reset();
+
+  state_ = STATE_FILE_SYSTEM_OPENED;
   client_->OnWriteComplete(cdm::FileIOClient::kSuccess);
 }
 
-void CdmFileIOImpl::CloseFile() {
+void CdmFileIOImpl::Reset() {
   PP_DCHECK(IsMainThread());
-
-  state_ = FILE_CLOSED;
-
-  file_io_.Close();
   io_buffer_.clear();
   io_offset_ = 0;
   cumulative_read_buffer_.clear();
+  file_io_.Close();
+  file_io_ = pp::FileIO();
+  file_ref_ = pp::FileRef();
 }
 
 void CdmFileIOImpl::OnError(ErrorType error_type) {
   // For *_WHILE_IN_USE errors, do not reset these values. Otherwise, the
   // existing read/write operation will fail.
-  if (error_type == READ_ERROR || error_type == WRITE_ERROR) {
-    io_buffer_.clear();
-    io_offset_ = 0;
-    cumulative_read_buffer_.clear();
-  }
+  if (error_type == READ_ERROR || error_type == WRITE_ERROR)
+    Reset();
+
   PostOnMain(callback_factory_.NewCallback(&CdmFileIOImpl::NotifyClientOfError,
                                            error_type));
 }
diff --git a/media/cdm/ppapi/cdm_file_io_impl.h b/media/cdm/ppapi/cdm_file_io_impl.h
index fc8215a..0957758 100644
--- a/media/cdm/ppapi/cdm_file_io_impl.h
+++ b/media/cdm/ppapi/cdm_file_io_impl.h
@@ -22,6 +22,17 @@
 namespace media {
 
 // Due to PPAPI limitations, all functions must be called on the main thread.
+//
+// Implementation notes about states:
+// 1, When a method is called in an invalid state (e.g. Read() before Open() is
+//    called, Write() before Open() finishes or Open() after Open()), kError
+//    will be returned. The state of |this| will not change.
+// 2, When the file is opened by another CDM instance, or when we call Read()/
+//    Write() during a pending Read()/Write(), kInUse will be returned. The
+//    state of |this| will not change.
+// 3, When a pepper operation failed (either synchronously or asynchronously),
+//    kError will be returned. The state of |this| will be set to ERROR.
+// 4. Any operation in ERROR state will end up with kError.
 class CdmFileIOImpl : public cdm::FileIO {
  public:
   // A class that helps release |file_lock_map_|.
@@ -35,7 +46,12 @@
     DISALLOW_COPY_AND_ASSIGN(ResourceTracker);
   };
 
-  CdmFileIOImpl(cdm::FileIOClient* client, PP_Instance pp_instance);
+  // After the first successful file read, call |first_file_read_cb| to report
+  // the file size. |first_file_read_cb| takes one parameter: the file size in
+  // bytes.
+  CdmFileIOImpl(cdm::FileIOClient* client,
+                PP_Instance pp_instance,
+                const pp::CompletionCallback& first_file_read_cb);
 
   // cdm::FileIO implementation.
   virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE;
@@ -44,14 +60,15 @@
   virtual void Close() OVERRIDE;
 
  private:
+  // TODO(xhwang): Introduce more detailed states for UMA logging if needed.
   enum State {
-    FILE_UNOPENED,
-    OPENING_FILE_SYSTEM,
-    OPENING_FILE,
-    FILE_OPENED,
-    READING_FILE,
-    WRITING_FILE,
-    FILE_CLOSED
+    STATE_UNOPENED,
+    STATE_OPENING_FILE_SYSTEM,
+    STATE_FILE_SYSTEM_OPENED,
+    STATE_READING,
+    STATE_WRITING,
+    STATE_CLOSED,
+    STATE_ERROR
   };
 
   enum ErrorType {
@@ -101,22 +118,41 @@
   // objects.
   void ReleaseFileLock();
 
+  // Helper functions for Open().
   void OpenFileSystem();
   void OnFileSystemOpened(int32_t result, pp::FileSystem file_system);
-  void OpenFile();
-  void OnFileOpened(int32_t result);
+
+  // Helper functions for Read().
+  void OpenFileForRead();
+  void OnFileOpenedForRead(int32_t result);
   void ReadFile();
   void OnFileRead(int32_t bytes_read);
-  void SetLength(uint32_t length);
-  void OnLengthSet(int32_t result);
-  void WriteFile();
-  void OnFileWritten(int32_t bytes_written);
 
-  void CloseFile();
+  // Helper functions for Write(). We always write data to a temporary file,
+  // then rename the temporary file to the target file. This can prevent data
+  // corruption if |this| is Close()'ed while waiting for writing to complete.
+  // However, if Close() is called after OpenTempFileForWrite() but before
+  // RenameTempFile(), we may still end up with an empty, partially written or
+  // fully written temporary file in the file system. This temporary file will
+  // be truncated next time OpenTempFileForWrite() is called.
 
-  // Calls client_->OnXxxxComplete with kError asynchronously. In some cases we
-  // could actually call them synchronously, but since these errors shouldn't
-  // happen in normal cases, we are not optimizing such cases.
+  void OpenTempFileForWrite();
+  void OnTempFileOpenedForWrite(int32_t result);
+  void WriteTempFile();
+  void OnTempFileWritten(int32_t bytes_written);
+  // Note: pp::FileRef::Rename() actually does a "move": if the target file
+  // exists, Rename() will succeed and the target file will be overwritten.
+  // See PepperInternalFileRefBackend::Rename() for implementation detail.
+  void RenameTempFile();
+  void OnTempFileRenamed(int32_t result);
+
+  // Reset |this| to a clean state.
+  void Reset();
+
+  // For real open/read/write errors, Reset() and set the |state_| to ERROR.
+  // Calls client_->OnXxxxComplete with kError or kInUse asynchronously. In some
+  // cases we could actually call them synchronously, but since these errors
+  // shouldn't happen in normal cases, we are not optimizing such cases.
   void OnError(ErrorType error_type);
 
   // Callback to notify client of error asynchronously.
@@ -129,6 +165,7 @@
 
   const pp::InstanceHandle pp_instance_handle_;
 
+  // Format: /<requested_file_name>
   std::string file_name_;
 
   // A string ID that uniquely identifies a file in the user's profile.
@@ -139,11 +176,13 @@
 
   pp::IsolatedFileSystemPrivate isolated_file_system_;
   pp::FileSystem file_system_;
+
+  // Shared between read and write. During read, |file_ref_| refers to the real
+  // file to read data from. During write, it refers to the temporary file to
+  // write data into.
   pp::FileIO file_io_;
   pp::FileRef file_ref_;
 
-  pp::CompletionCallbackFactory<CdmFileIOImpl> callback_factory_;
-
   // A temporary buffer to hold (partial) data to write or the data that has
   // been read. The size of |io_buffer_| is always "bytes to write" or "bytes to
   // read". Use "char" instead of "unit8_t" because PPB_FileIO uses char* for
@@ -158,6 +197,13 @@
   // when read completes.
   std::vector<char> cumulative_read_buffer_;
 
+  bool first_file_read_reported_;
+
+  // Callback to report the file size in bytes after the first successful read.
+  pp::CompletionCallback first_file_read_cb_;
+
+  pp::CompletionCallbackFactory<CdmFileIOImpl> callback_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl);
 };
 
diff --git a/media/cdm/ppapi/cdm_file_io_test.cc b/media/cdm/ppapi/cdm_file_io_test.cc
index ee6aa0b..2252e2c 100644
--- a/media/cdm/ppapi/cdm_file_io_test.cc
+++ b/media/cdm/ppapi/cdm_file_io_test.cc
@@ -24,12 +24,15 @@
 const uint32 kBigDataSize = arraysize(kBigData);
 
 // Must be > kReadSize in cdm_file_io_impl.cc.
-const uint32 kLargeDataSize = 9 * 1024 + 7;
+const uint32 kLargeDataSize = 20 * 1024 + 7;
 
 // Macros to help add test cases/steps.
+
+// |test_name| is also used as the file name. File name validity tests relies
+// on this to work.
 #define START_TEST_CASE(test_name)                                     \
   do {                                                                 \
-    FileIOTest test_case(create_file_io_cb_, "FileIOTest." test_name); \
+    FileIOTest test_case(create_file_io_cb_, test_name);               \
     CREATE_FILE_IO  // Create FileIO for each test case.
 
 #define ADD_TEST_STEP(type, status, data, data_size)                   \
@@ -90,6 +93,36 @@
 
 // Note: Consecutive expectations (EXPECT*) can happen in any order.
 void FileIOTestRunner::AddTests() {
+  START_TEST_CASE("/FileNameStartsWithForwardSlash")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("FileNameContains/ForwardSlash")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("\\FileNameStartsWithBackslash")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("FileNameContains\\Backslash")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("_FileNameStartsWithUnderscore")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("FileNameContains_Underscore")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+  END_TEST_CASE
+
   START_TEST_CASE("ReadBeforeOpeningFile")
     READ_FILE
     EXPECT_FILE_READ(kError, NULL, 0)
@@ -105,6 +138,11 @@
     READ_FILE
     EXPECT_FILE_OPENED(kSuccess)
     EXPECT_FILE_READ(kError, NULL, 0)
+    // After file opened, we can still do normal operations.
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
   START_TEST_CASE("WriteBeforeFileOpened")
@@ -112,6 +150,11 @@
     WRITE_FILE(kData, kDataSize)
     EXPECT_FILE_WRITTEN(kError)
     EXPECT_FILE_OPENED(kSuccess)
+    // After file opened, we can still do normal operations.
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
   START_TEST_CASE("ReadDuringPendingRead")
@@ -123,6 +166,9 @@
     READ_FILE
     EXPECT_FILE_READ(kInUse, NULL, 0)
     EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+    // Read again.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
   START_TEST_CASE("ReadDuringPendingWrite")
@@ -132,6 +178,9 @@
     READ_FILE
     EXPECT_FILE_READ(kInUse, NULL, 0)
     EXPECT_FILE_WRITTEN(kSuccess)
+    // Read again.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
   START_TEST_CASE("WriteDuringPendingRead")
@@ -141,6 +190,11 @@
     WRITE_FILE(kData, kDataSize)
     EXPECT_FILE_WRITTEN(kInUse)
     EXPECT_FILE_READ(kSuccess, NULL, 0)
+    // We can still do normal operations.
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
   START_TEST_CASE("WriteDuringPendingWrite")
@@ -150,9 +204,12 @@
     WRITE_FILE(kBigData, kBigDataSize)
     EXPECT_FILE_WRITTEN(kInUse)
     EXPECT_FILE_WRITTEN(kSuccess)
+    // Read to make sure original data (kData) is written.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
-  START_TEST_CASE("ReadEmptyFile")
+  START_TEST_CASE("ReadFileThatDoesNotExist")
     OPEN_FILE
     EXPECT_FILE_OPENED(kSuccess)
     READ_FILE
@@ -168,7 +225,7 @@
     EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
-  START_TEST_CASE("WriteZeroBytes")
+  START_TEST_CASE("WriteAndReadEmptyFile")
     OPEN_FILE
     EXPECT_FILE_OPENED(kSuccess)
     WRITE_FILE(NULL, 0)
@@ -234,7 +291,49 @@
     EXPECT_FILE_READ(kSuccess, kData, kDataSize)
   END_TEST_CASE
 
-  START_TEST_CASE("ReopenFileInTheSameFileIO")
+  START_TEST_CASE("MultipleReadsAndWrites")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    // Read file which doesn't exist.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, NULL, 0)
+    // Write kData to file.
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // Read file.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+    // Read file again.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+    // Overwrite file with large data.
+    WRITE_FILE(&large_data_[0], kLargeDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // Read file.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, &large_data_[0], kLargeDataSize)
+    // Overwrite file with kData.
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // Read file.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+    // Overwrite file with zero bytes.
+    WRITE_FILE(NULL, 0)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // Read file.
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, NULL, 0)
+  END_TEST_CASE
+
+  START_TEST_CASE("OpenAfterOpen")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kError)
+  END_TEST_CASE
+
+  START_TEST_CASE("OpenDuringPendingOpen")
     OPEN_FILE
     OPEN_FILE
     EXPECT_FILE_OPENED(kError)  // The second Open() failed.
@@ -263,17 +362,77 @@
   START_TEST_CASE("CloseDuringPendingWrite")
     OPEN_FILE
     EXPECT_FILE_OPENED(kSuccess)
-    WRITE_FILE(kData, kDataSize)
+    // TODO(xhwang): Reenable this after http:://crbug.com/415401 is fixed.
+    // WRITE_FILE(kData, kDataSize)
     CLOSE_FILE
   END_TEST_CASE
 
+  START_TEST_CASE("CloseDuringPendingOverwriteWithLargerData")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    WRITE_FILE(kData, kDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // TODO(xhwang): Reenable this after http:://crbug.com/415401 is fixed.
+    // WRITE_FILE(kBigData, kBigDataSize)
+    CLOSE_FILE
+    // Write() didn't finish and the content of the file is not modified.
+    CREATE_FILE_IO
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+  END_TEST_CASE
+
+  START_TEST_CASE("CloseDuringPendingOverwriteWithSmallerData")
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    WRITE_FILE(kBigData, kBigDataSize)
+    EXPECT_FILE_WRITTEN(kSuccess)
+    // TODO(xhwang): Reenable this after http:://crbug.com/415401 is fixed.
+    // WRITE_FILE(kData, kDataSize)
+    CLOSE_FILE
+    // Write() didn't finish and the content of the file is not modified.
+    CREATE_FILE_IO
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kBigData, kBigDataSize)
+  END_TEST_CASE
+
   START_TEST_CASE("CloseDuringPendingRead")
     OPEN_FILE
     EXPECT_FILE_OPENED(kSuccess)
     WRITE_FILE(kData, kDataSize)
     EXPECT_FILE_WRITTEN(kSuccess)
-    READ_FILE
+    // TODO(xhwang): Reenable this after http:://crbug.com/415401 is fixed.
+    // READ_FILE
     CLOSE_FILE
+    // Make sure the file is not modified.
+    CREATE_FILE_IO
+    OPEN_FILE
+    EXPECT_FILE_OPENED(kSuccess)
+    READ_FILE
+    EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+  END_TEST_CASE
+
+  START_TEST_CASE("StressTest")
+    for (int i = 0; i < 100; ++i) {
+      CREATE_FILE_IO
+      OPEN_FILE
+      EXPECT_FILE_OPENED(kSuccess)
+      WRITE_FILE(kData, kDataSize)
+      EXPECT_FILE_WRITTEN(kSuccess)
+      // TODO(xhwang): Reenable this after http:://crbug.com/415401 is fixed.
+      // WRITE_FILE(kBigData, kBigDataSize)
+      CLOSE_FILE
+      // Make sure the file is not modified.
+      CREATE_FILE_IO
+      OPEN_FILE
+      EXPECT_FILE_OPENED(kSuccess)
+      READ_FILE
+      EXPECT_FILE_READ(kSuccess, kData, kDataSize)
+      CLOSE_FILE
+    }
   END_TEST_CASE
 }
 
@@ -364,7 +523,7 @@
   if (a.type != RESULT_READ || a.status != cdm::FileIOClient::kSuccess)
     return true;
 
-  return (a.data_size == a.data_size &&
+  return (a.data_size == b.data_size &&
           std::equal(a.data, a.data + a.data_size, b.data));
 }
 
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index aa1c0f8..86e834f 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -356,6 +356,10 @@
     return rv;
   }
 
+  if (!session_->connection()->connected()) {
+    return ERR_CONNECTION_CLOSED;
+  }
+
   session_->StartReading();
   if (!session_->connection()->connected()) {
     return ERR_QUIC_PROTOCOL_ERROR;
@@ -863,8 +867,18 @@
       server_info.Pass(), server_id, config, &crypto_config_,
       base::MessageLoop::current()->message_loop_proxy().get(),
       net_log.net_log());
-  (*session)->InitializeSession();
   all_sessions_[*session] = server_id;  // owning pointer
+  (*session)->InitializeSession();
+  bool closed_during_initialize =
+      !ContainsKey(all_sessions_, *session) ||
+      !(*session)->connection()->connected();
+  UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession",
+                        closed_during_initialize);
+  if (closed_during_initialize) {
+    DLOG(DFATAL) << "Session closed during initialize";
+    *session = NULL;
+    return ERR_CONNECTION_CLOSED;
+  }
   return OK;
 }
 
diff --git a/remoting/webapp/menu_button.js b/remoting/webapp/menu_button.js
index b41d69a..73c7642 100644
--- a/remoting/webapp/menu_button.js
+++ b/remoting/webapp/menu_button.js
@@ -70,7 +70,7 @@
     if (that.onShow_) {
       that.onShow_();
     }
-    that.button_.classList.toggle(remoting.MenuButton.BUTTON_ACTIVE_CLASS_);
+    that.button_.classList.add(remoting.MenuButton.BUTTON_ACTIVE_CLASS_);
     document.body.addEventListener('click', closeHandler, false);
     event.stopPropagation();
   };
diff --git a/remoting/webapp/unittests/menu_button_unittest.js b/remoting/webapp/unittests/menu_button_unittest.js
index 48728f8..cba90fb 100644
--- a/remoting/webapp/unittests/menu_button_unittest.js
+++ b/remoting/webapp/unittests/menu_button_unittest.js
@@ -47,12 +47,15 @@
   ok(menu.offsetWidth == 0 && menu.offsetHeight == 0);
 });
 
+/*
+TODO(jamiewalch): Reinstate this once MenuButton is fixed properly.
 test('should dismiss when button is clicked', function() {
   var menu = menuButton.menu();
   menuButton.button().click();
   menuButton.button().click();
   ok(menu.offsetWidth == 0 && menu.offsetHeight == 0);
 });
+*/
 
 test('should dismiss when menu item is clicked', function() {
   var menu = menuButton.menu();
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 9b24087..986cbae 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -10946,6 +10946,23 @@
   <summary>Duration in milliseconds of HTML5 media (when known).</summary>
 </histogram>
 
+<histogram name="Media.EME.CdmFileIO.FileSizeKBOnError" units="KB">
+  <owner>xhwang@chromium.org</owner>
+  <summary>
+    Size in KB of the last file sucessfully read by the CDM through CDM FileIO
+    before a specific error happens. This is reported only when the error
+    happens, which should be rare.
+  </summary>
+</histogram>
+
+<histogram name="Media.EME.CdmFileIO.FileSizeKBOnFirstRead" units="KB">
+  <owner>xhwang@chromium.org</owner>
+  <summary>
+    Size in KB of the first file sucessfully read by the CDM through CDM FileIO.
+    This is recorded once per CDM instance.
+  </summary>
+</histogram>
+
 <histogram name="Media.EME.ClearKey.addKey" enum="MediaKeyException">
   <owner>xhwang@chromium.org</owner>
   <summary>addKey result using the Clear Key key system.</summary>
@@ -16051,6 +16068,14 @@
   </summary>
 </histogram>
 
+<histogram name="Net.QuicSession.ClosedDuringInitializeSession">
+  <owner>rch@chromium.org</owner>
+  <summary>
+     True if the QUIC session is closed during the call to InitializeSession,
+    logged for each session just after InitializeSession is called.
+  </summary>
+</histogram>
+
 <histogram name="Net.QuicSession.CloseSessionOnError" enum="NetErrorCodes">
   <owner>rch@chromium.org</owner>
   <summary>
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
index 180b493..9f53264 100644
--- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
+++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -13,6 +13,7 @@
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Build;
+import android.os.Environment;
 import android.provider.MediaStore;
 import android.text.TextUtils;
 import android.util.Log;
@@ -71,23 +72,31 @@
 
         Intent chooser = new Intent(Intent.ACTION_CHOOSER);
         Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+        Context context = window.getApplicationContext();
         camera.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION |
                 Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
-        Context context = window.getApplicationContext();
         try {
-            mCameraOutputUri = ContentUriUtils.getContentUriFromFile(
-                    context, getFileForImageCapture(context));
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+                mCameraOutputUri = ContentUriUtils.getContentUriFromFile(
+                        context, getFileForImageCapture(context));
+            } else {
+                mCameraOutputUri = Uri.fromFile(getFileForImageCapture(context));
+            }
         } catch (IOException e) {
             Log.e(TAG, "Cannot retrieve content uri from file", e);
         }
+
         if (mCameraOutputUri == null) {
             onFileNotSelected();
             return;
         }
 
         camera.putExtra(MediaStore.EXTRA_OUTPUT, mCameraOutputUri);
-        camera.setClipData(
-                ClipData.newUri(context.getContentResolver(), IMAGE_FILE_PATH, mCameraOutputUri));
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+            camera.setClipData(
+                    ClipData.newUri(context.getContentResolver(),
+                    IMAGE_FILE_PATH, mCameraOutputUri));
+        }
         Intent camcorder = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
         Intent soundRecorder = new Intent(
                 MediaStore.Audio.Media.RECORD_SOUND_ACTION);
@@ -145,13 +154,28 @@
     }
 
     /**
-     * Get a file for the image capture in the IMAGE_FILE_PATH directory.
+     * Get a file for the image capture operation. For devices with JB MR2 or
+     * latter android versions, the file is put under IMAGE_FILE_PATH directory.
+     * For ICS devices, the file is put under CAPTURE_IMAGE_DIRECTORY.
+     *
      * @param context The application context.
+     * @return file path for the captured image to be stored.
      */
     private File getFileForImageCapture(Context context) throws IOException {
-        final File path = new File(context.getFilesDir(), IMAGE_FILE_PATH);
-        if (!path.exists() && !path.mkdir()) {
-            throw new IOException("Folder cannot be created.");
+        File path;
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+            path = new File(context.getFilesDir(), IMAGE_FILE_PATH);
+            if (!path.exists() && !path.mkdir()) {
+                throw new IOException("Folder cannot be created.");
+            }
+        } else {
+            File externalDataDir = Environment.getExternalStoragePublicDirectory(
+                    Environment.DIRECTORY_DCIM);
+            path = new File(externalDataDir.getAbsolutePath() +
+                    File.separator + CAPTURE_IMAGE_DIRECTORY);
+            if (!path.exists() && !path.mkdirs()) {
+                path = externalDataDir;
+            }
         }
         File photoFile = File.createTempFile(
                 String.valueOf(System.currentTimeMillis()), ".jpg", path);
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 4f6c7d4..60cf1fb 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -83,7 +83,9 @@
       should_animate_window_close_(false),
       pending_close_(false),
       has_non_client_view_(false),
-      tooltip_(NULL) {
+      tooltip_(NULL),
+      need_synchronous_paint_(false),
+      in_sizing_loop_(false) {
 }
 
 DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() {
@@ -717,6 +719,22 @@
 }
 
 bool DesktopWindowTreeHostWin::HandleCommand(int command) {
+  // Windows uses the 4 lower order bits of |notification_code| for type-
+  // specific information so we must exclude this when comparing.
+  static const int sc_mask = 0xFFF0;
+  switch (command & sc_mask) {
+    case SC_RESTORE:
+    case SC_MAXIMIZE:
+      need_synchronous_paint_ = true;
+      break;
+
+    case SC_SIZE:
+      in_sizing_loop_ = true;
+      break;
+
+    default:
+      break;
+  }
   return GetWidget()->widget_delegate()->ExecuteWindowsCommand(command);
 }
 
@@ -752,10 +770,16 @@
 }
 
 void DesktopWindowTreeHostWin::HandleBeginWMSizeMove() {
+  if (in_sizing_loop_)
+    need_synchronous_paint_ = true;
   native_widget_delegate_->OnNativeWidgetBeginUserBoundsChange();
 }
 
 void DesktopWindowTreeHostWin::HandleEndWMSizeMove() {
+  if (in_sizing_loop_) {
+    need_synchronous_paint_ = false;
+    in_sizing_loop_ = false;
+  }
   native_widget_delegate_->OnNativeWidgetEndUserBoundsChange();
 }
 
@@ -912,8 +936,15 @@
 }
 
 void DesktopWindowTreeHostWin::HandleWindowSizeChanging() {
-  if (compositor())
+  if (compositor() && need_synchronous_paint_) {
     compositor()->FinishAllRendering();
+    // If we received the window size changing notification due to a restore or
+    // maximize operation, then we can reset the need_synchronous_paint_ flag
+    // here. For a sizing operation, the flag will be reset at the end of the
+    // operation.
+    if (!in_sizing_loop_)
+      need_synchronous_paint_ = false;
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index 933ecad..2929ceb 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -264,6 +264,14 @@
 
   scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_;
 
+  // This flag is set to true in cases where we need to force a synchronous
+  // paint via the compositor. Cases include restoring/resizing/maximizing the
+  // window. Defaults to false.
+  bool need_synchronous_paint_;
+
+  // Set to true if we are about to enter a sizing loop.
+  bool in_sizing_loop_;
+
   DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostWin);
 };