diff --git a/BUILD.gn b/BUILD.gn
index 3522948..2d4e60f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -829,7 +829,12 @@
       deps += [ "//chrome/test:performance_browser_tests" ]
     }
     if (is_linux && !is_chromeos) {
-      deps += [ "//chrome:linux_symbols" ]
+      if (is_official_build) {
+        # In GN builds, this is controlled by the 'linux_dump_symbols'
+        # flag, which defaults to 1 for official builds. For now,
+        # we skip the separate flag and just key off of is_official_build.
+        deps += [ "//chrome:linux_symbols" ]
+      }
 
       if (!is_chromeos) {
         deps += [ "//tools/perf/clear_system_cache" ]
diff --git a/DEPS b/DEPS
index e970a2d..1011036 100644
--- a/DEPS
+++ b/DEPS
@@ -39,7 +39,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '211df380655d3fd0c76b9b7f8be399040ca0b7a5',
+  'skia_revision': '7ea33f5e1ae9eb1fb1e7377d6edf6acdcf71d103',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
diff --git a/cc/blink/web_content_layer_impl.h b/cc/blink/web_content_layer_impl.h
index 1b18664..79b61d8 100644
--- a/cc/blink/web_content_layer_impl.h
+++ b/cc/blink/web_content_layer_impl.h
@@ -42,7 +42,6 @@
 
   scoped_ptr<WebLayerImpl> layer_;
   blink::WebContentLayerClient* client_;
-  bool draws_content_;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(WebContentLayerImpl);
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 0a09f8e6..305d2df 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1026,40 +1026,42 @@
     ]
   }
 
-  action("linux_symbols") {
-    script = "//build/linux/dump_app_syms.py"
+  if (is_official_build) {
+    action("linux_symbols") {
+      script = "//build/linux/dump_app_syms.py"
 
-    dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
-    dump_syms_binary =
-        get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
+      dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
+      dump_syms_binary =
+          get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
 
-    chrome_binary = "$root_out_dir/chrome"
-    if (current_cpu == "x86") {
-      # Use "ia32" instead of "x86" for GYP compat.
-      symbol_file = "$root_out_dir/chrome.breakpad.ia32"
-    } else {
-      symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
+      chrome_binary = "$root_out_dir/chrome"
+      if (current_cpu == "x86") {
+        # Use "ia32" instead of "x86" for GYP compat.
+        symbol_file = "$root_out_dir/chrome.breakpad.ia32"
+      } else {
+        symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
+      }
+
+      inputs = [
+        chrome_binary,
+        dump_syms_binary,
+      ]
+      outputs = [
+        symbol_file,
+      ]
+
+      args = [
+        "./" + rebase_path(dump_syms_binary, root_build_dir),
+        "0",  # TODO(GYP) This is linux_strip_binary if it is needed.
+        rebase_path(chrome_binary, root_build_dir),
+        rebase_path(symbol_file, root_build_dir),
+      ]
+
+      deps = [
+        ":chrome",
+        dump_syms_label,
+      ]
     }
-
-    inputs = [
-      chrome_binary,
-      dump_syms_binary,
-    ]
-    outputs = [
-      symbol_file,
-    ]
-
-    args = [
-      "./" + rebase_path(dump_syms_binary, root_build_dir),
-      "0",  # TODO(GYP) This is linux_strip_binary if it is needed.
-      rebase_path(chrome_binary, root_build_dir),
-      rebase_path(symbol_file, root_build_dir),
-    ]
-
-    deps = [
-      ":chrome",
-      dump_syms_label,
-    ]
   }
 
   # Copies some scripts and resources that are used for desktop integration.
diff --git a/chrome/browser/lifetime/application_lifetime_aura.cc b/chrome/browser/lifetime/application_lifetime_aura.cc
index 75d67ba..9790d2ad 100644
--- a/chrome/browser/lifetime/application_lifetime_aura.cc
+++ b/chrome/browser/lifetime/application_lifetime_aura.cc
@@ -4,7 +4,6 @@
 
 #include "chrome/browser/lifetime/application_lifetime.h"
 
-#include "ash/shell.h"
 #include "base/command_line.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/notifications/notification_ui_manager.h"
@@ -13,6 +12,10 @@
 #include "ui/aura/window_event_dispatcher.h"
 #include "ui/views/widget/widget.h"
 
+#if defined(USE_ASH)
+#include "ash/shell.h"
+#endif
+
 namespace chrome {
 
 void HandleAppExitingForPlatform() {
@@ -20,6 +23,7 @@
   // and windows created by Ash (launcher, background, etc).
   g_browser_process->notification_ui_manager()->CancelAll();
 
+#if defined(USE_ASH)
   // This may be called before |ash::Shell| is initialized when
   // XIOError is reported.  crbug.com/150633.
   if (ash::Shell::HasInstance()) {
@@ -28,6 +32,7 @@
     aura::client::GetCaptureClient(ash::Shell::GetPrimaryRootWindow())->
         SetCapture(NULL);
   }
+#endif
 
   views::Widget::CloseAllSecondaryWidgets();
 
@@ -43,7 +48,7 @@
     // NotifyAndTerminate does nothing if called more than once.
     NotifyAndTerminate(true);
   }
-#endif  // OS_CHROMEOS
+#endif
 }
 
 }  // namespace chrome
diff --git a/chrome/browser/permissions/permission_uma_util.cc b/chrome/browser/permissions/permission_uma_util.cc
index b9e60b2..328e685 100644
--- a/chrome/browser/permissions/permission_uma_util.cc
+++ b/chrome/browser/permissions/permission_uma_util.cc
@@ -95,50 +95,51 @@
       case CONTENT_SETTINGS_TYPE_GEOLOCATION:
         PERMISSION_ACTION_UMA(
             secure_origin,
-            "ContentSettings.PermissionActions_Geolocation",
-            "ContentSettings.PermissionActionsSecureOrigin_Geolocation",
-            "ContentSettings.PermissionActionsInsecureOrigin_Geolocation",
+            "Permissions.Action.Geolocation",
+            "Permissions.Action.SecureOrigin.Geolocation",
+            "Permissions.Action.InsecureOrigin.Geolocation",
             action);
         break;
       case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
         PERMISSION_ACTION_UMA(
             secure_origin,
-            "ContentSettings.PermissionActions_Notifications",
-            "ContentSettings.PermissionActionsSecureOrigin_Notifications",
-            "ContentSettings.PermissionActionsInsecureOrigin_Notifications",
+            "Permissions.Action.Notifications",
+            "Permissions.Action.SecureOrigin.Notifications",
+            "Permissions.Action.InsecureOrigin.Notifications",
             action);
         break;
       case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
         PERMISSION_ACTION_UMA(
             secure_origin,
-            "ContentSettings.PermissionActions_MidiSysEx",
-            "ContentSettings.PermissionActionsSecureOrigin_MidiSysEx",
-            "ContentSettings.PermissionActionsInsecureOrigin_MidiSysEx",
+            "Permissions.Action.MidiSysEx",
+            "Permissions.Action.SecureOrigin.MidiSysEx",
+            "Permissions.Action.InsecureOrigin.MidiSysEx",
             action);
         break;
       case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING:
         PERMISSION_ACTION_UMA(
             secure_origin,
-            "ContentSettings.PermissionActions_PushMessaging",
-            "ContentSettings.PermissionActionsSecureOrigin_PushMessaging",
-            "ContentSettings.PermissionActionsInsecureOrigin_PushMessaging",
+            "Permissions.Action.PushMessaging",
+            "Permissions.Action.SecureOrigin.PushMessaging",
+            "Permissions.Action.InsecureOrigin.PushMessaging",
             action);
         break;
 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
       case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
         PERMISSION_ACTION_UMA(
             secure_origin,
-            "ContentSettings.PermissionActions_ProtectedMedia",
-            "ContentSettings.PermissionActionsSecureOrigin_ProtectedMedia",
-            "ContentSettings.PermissionActionsInsecureOrigin_ProtectedMedia",
+            "Permissions.Action.ProtectedMedia",
+            "Permissions.Action.SecureOrigin.ProtectedMedia",
+            "Permissions.Action.InsecureOrigin.ProtectedMedia",
             action);
         break;
 #endif
       case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE:
         PERMISSION_ACTION_UMA(
-            secure_origin, "ContentSettings.PermissionActions_DurableStorage",
-            "ContentSettings.PermissionActionsSecureOrigin_DurableStorage",
-            "ContentSettings.PermissionActionsInsecureOrigin_DurableStorage",
+            secure_origin,
+            "Permissions.Action.DurableStorage",
+            "Permissions.Action.SecureOrigin.DurableStorage",
+            "Permissions.Action.InsecureOrigin.DurableStorage",
             action);
         break;
       case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
diff --git a/chrome/browser/ui/webui/browsing_history_handler.cc b/chrome/browser/ui/webui/browsing_history_handler.cc
new file mode 100644
index 0000000..1ba3f77
--- /dev/null
+++ b/chrome/browser/ui/webui/browsing_history_handler.cc
@@ -0,0 +1,885 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/browsing_history_handler.h"
+
+#include <set>
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/i18n/rtl.h"
+#include "base/i18n/time_formatting.h"
+#include "base/metrics/histogram.h"
+#include "base/prefs/pref_service.h"
+#include "base/strings/string16.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
+#include "base/values.h"
+#include "chrome/browser/banners/app_banner_settings_helper.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
+#include "chrome/browser/engagement/site_engagement_service.h"
+#include "chrome/browser/history/history_service_factory.h"
+#include "chrome/browser/history/history_utils.h"
+#include "chrome/browser/history/web_history_service_factory.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/webui/favicon_source.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/browser_sync/browser/profile_sync_service.h"
+#include "components/history/core/browser/history_service.h"
+#include "components/history/core/browser/history_types.h"
+#include "components/history/core/browser/web_history_service.h"
+#include "components/keyed_service/core/service_access_type.h"
+#include "components/query_parser/snippet.h"
+#include "components/sync_driver/device_info.h"
+#include "components/sync_driver/device_info_tracker.h"
+#include "components/url_formatter/url_formatter.h"
+#include "content/public/browser/url_data_source.h"
+#include "content/public/browser/web_ui.h"
+#include "sync/protocol/history_delete_directive_specifics.pb.h"
+#include "sync/protocol/sync_enums.pb.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/l10n/time_format.h"
+
+#if defined(ENABLE_EXTENSIONS)
+#include "chrome/browser/extensions/activity_log/activity_log.h"
+#endif
+
+#if defined(ENABLE_SUPERVISED_USERS)
+#include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
+#include "chrome/browser/supervised_user/supervised_user_service.h"
+#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
+#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
+#endif
+
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/chrome_application.h"
+#endif
+
+// The amount of time to wait for a response from the WebHistoryService.
+static const int kWebHistoryTimeoutSeconds = 3;
+
+using bookmarks::BookmarkModel;
+
+namespace {
+
+// Buckets for UMA histograms.
+enum WebHistoryQueryBuckets {
+  WEB_HISTORY_QUERY_FAILED = 0,
+  WEB_HISTORY_QUERY_SUCCEEDED,
+  WEB_HISTORY_QUERY_TIMED_OUT,
+  NUM_WEB_HISTORY_QUERY_BUCKETS
+};
+
+// Identifiers for the type of device from which a history entry originated.
+static const char kDeviceTypeLaptop[] = "laptop";
+static const char kDeviceTypePhone[] = "phone";
+static const char kDeviceTypeTablet[] = "tablet";
+
+// Returns a localized version of |visit_time| including a relative
+// indicator (e.g. today, yesterday).
+base::string16 GetRelativeDateLocalized(const base::Time& visit_time) {
+  base::Time midnight = base::Time::Now().LocalMidnight();
+  base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight);
+  if (date_str.empty()) {
+    date_str = base::TimeFormatFriendlyDate(visit_time);
+  } else {
+    date_str = l10n_util::GetStringFUTF16(
+        IDS_HISTORY_DATE_WITH_RELATIVE_TIME,
+        date_str,
+        base::TimeFormatFriendlyDate(visit_time));
+  }
+  return date_str;
+}
+
+// Sets the correct year when substracting months from a date.
+void NormalizeMonths(base::Time::Exploded* exploded) {
+  // Decrease a year at a time until we have a proper date.
+  while (exploded->month < 1) {
+    exploded->month += 12;
+    exploded->year--;
+  }
+}
+
+// Returns true if |entry| represents a local visit that had no corresponding
+// visit on the server.
+bool IsLocalOnlyResult(const BrowsingHistoryHandler::HistoryEntry& entry) {
+  return entry.entry_type == BrowsingHistoryHandler::HistoryEntry::LOCAL_ENTRY;
+}
+
+// Gets the name and type of a device for the given sync client ID.
+// |name| and |type| are out parameters.
+void GetDeviceNameAndType(const ProfileSyncService* sync_service,
+                          const std::string& client_id,
+                          std::string* name,
+                          std::string* type) {
+  // DeviceInfoTracker must be syncing in order for remote history entries to
+  // be available.
+  DCHECK(sync_service);
+  DCHECK(sync_service->GetDeviceInfoTracker());
+  DCHECK(sync_service->GetDeviceInfoTracker()->IsSyncing());
+
+  scoped_ptr<sync_driver::DeviceInfo> device_info =
+      sync_service->GetDeviceInfoTracker()->GetDeviceInfo(client_id);
+  if (device_info.get()) {
+    *name = device_info->client_name();
+    switch (device_info->device_type()) {
+      case sync_pb::SyncEnums::TYPE_PHONE:
+        *type = kDeviceTypePhone;
+        break;
+      case sync_pb::SyncEnums::TYPE_TABLET:
+        *type = kDeviceTypeTablet;
+        break;
+      default:
+        *type = kDeviceTypeLaptop;
+    }
+    return;
+  }
+
+  *name = l10n_util::GetStringUTF8(IDS_HISTORY_UNKNOWN_DEVICE);
+  *type = kDeviceTypeLaptop;
+}
+
+}  // namespace
+
+BrowsingHistoryHandler::HistoryEntry::HistoryEntry(
+    BrowsingHistoryHandler::HistoryEntry::EntryType entry_type,
+    const GURL& url, const base::string16& title, base::Time time,
+    const std::string& client_id, bool is_search_result,
+    const base::string16& snippet, bool blocked_visit,
+    const std::string& accept_languages) {
+  this->entry_type = entry_type;
+  this->url = url;
+  this->title = title;
+  this->time = time;
+  this->client_id = client_id;
+  all_timestamps.insert(time.ToInternalValue());
+  this->is_search_result = is_search_result;
+  this->snippet = snippet;
+  this->blocked_visit = blocked_visit;
+  this->accept_languages = accept_languages;
+}
+
+BrowsingHistoryHandler::HistoryEntry::HistoryEntry()
+    : entry_type(EMPTY_ENTRY), is_search_result(false), blocked_visit(false) {
+}
+
+BrowsingHistoryHandler::HistoryEntry::~HistoryEntry() {
+}
+
+void BrowsingHistoryHandler::HistoryEntry::SetUrlAndTitle(
+    base::DictionaryValue* result) const {
+  result->SetString("url", url.spec());
+
+  bool using_url_as_the_title = false;
+  base::string16 title_to_set(title);
+  if (title.empty()) {
+    using_url_as_the_title = true;
+    title_to_set = base::UTF8ToUTF16(url.spec());
+  }
+
+  // Since the title can contain BiDi text, we need to mark the text as either
+  // RTL or LTR, depending on the characters in the string. If we use the URL
+  // as the title, we mark the title as LTR since URLs are always treated as
+  // left to right strings.
+  if (base::i18n::IsRTL()) {
+    if (using_url_as_the_title)
+      base::i18n::WrapStringWithLTRFormatting(&title_to_set);
+    else
+      base::i18n::AdjustStringForLocaleDirection(&title_to_set);
+  }
+  result->SetString("title", title_to_set);
+}
+
+scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue(
+    BookmarkModel* bookmark_model,
+    SupervisedUserService* supervised_user_service,
+    const ProfileSyncService* sync_service) const {
+  scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
+  SetUrlAndTitle(result.get());
+
+  base::string16 domain =
+      url_formatter::IDNToUnicode(url.host(), accept_languages);
+  // When the domain is empty, use the scheme instead. This allows for a
+  // sensible treatment of e.g. file: URLs when group by domain is on.
+  if (domain.empty())
+    domain = base::UTF8ToUTF16(url.scheme() + ":");
+
+  // The items which are to be written into result are also described in
+  // chrome/browser/resources/history/history.js in @typedef for
+  // HistoryEntry. Please update it whenever you add or remove
+  // any keys in result.
+  result->SetString("domain", domain);
+  result->SetDouble("time", time.ToJsTime());
+
+  // Pass the timestamps in a list.
+  scoped_ptr<base::ListValue> timestamps(new base::ListValue);
+  for (std::set<int64>::const_iterator it = all_timestamps.begin();
+       it != all_timestamps.end(); ++it) {
+    timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime());
+  }
+  result->Set("allTimestamps", timestamps.release());
+
+  // Always pass the short date since it is needed both in the search and in
+  // the monthly view.
+  result->SetString("dateShort", base::TimeFormatShortDate(time));
+
+  // Only pass in the strings we need (search results need a shortdate
+  // and snippet, browse results need day and time information).
+  if (is_search_result) {
+    result->SetString("snippet", snippet);
+  } else {
+    base::Time midnight = base::Time::Now().LocalMidnight();
+    base::string16 date_str = ui::TimeFormat::RelativeDate(time, &midnight);
+    if (date_str.empty()) {
+      date_str = base::TimeFormatFriendlyDate(time);
+    } else {
+      date_str = l10n_util::GetStringFUTF16(
+          IDS_HISTORY_DATE_WITH_RELATIVE_TIME,
+          date_str,
+          base::TimeFormatFriendlyDate(time));
+    }
+    result->SetString("dateRelativeDay", date_str);
+    result->SetString("dateTimeOfDay", base::TimeFormatTimeOfDay(time));
+  }
+  result->SetBoolean("starred", bookmark_model->IsBookmarked(url));
+
+  std::string device_name;
+  std::string device_type;
+  if (!client_id.empty())
+    GetDeviceNameAndType(sync_service, client_id, &device_name, &device_type);
+  result->SetString("deviceName", device_name);
+  result->SetString("deviceType", device_type);
+
+#if defined(ENABLE_SUPERVISED_USERS)
+  if (supervised_user_service) {
+    const SupervisedUserURLFilter* url_filter =
+        supervised_user_service->GetURLFilterForUIThread();
+    int filtering_behavior =
+        url_filter->GetFilteringBehaviorForURL(url.GetWithEmptyPath());
+    result->SetInteger("hostFilteringBehavior", filtering_behavior);
+
+    result->SetBoolean("blockedVisit", blocked_visit);
+  }
+#endif
+
+  return result.Pass();
+}
+
+bool BrowsingHistoryHandler::HistoryEntry::SortByTimeDescending(
+    const BrowsingHistoryHandler::HistoryEntry& entry1,
+    const BrowsingHistoryHandler::HistoryEntry& entry2) {
+  return entry1.time > entry2.time;
+}
+
+BrowsingHistoryHandler::BrowsingHistoryHandler()
+    : has_pending_delete_request_(false),
+      history_service_observer_(this),
+      weak_factory_(this) {
+}
+
+BrowsingHistoryHandler::~BrowsingHistoryHandler() {
+  query_task_tracker_.TryCancelAll();
+  web_history_request_.reset();
+}
+
+void BrowsingHistoryHandler::RegisterMessages() {
+  // Create our favicon data source.
+  Profile* profile = Profile::FromWebUI(web_ui());
+  content::URLDataSource::Add(
+      profile, new FaviconSource(profile, FaviconSource::ANY));
+
+  // Get notifications when history is cleared.
+  history::HistoryService* hs = HistoryServiceFactory::GetForProfile(
+      profile, ServiceAccessType::EXPLICIT_ACCESS);
+  if (hs)
+    history_service_observer_.Add(hs);
+
+  web_ui()->RegisterMessageCallback("queryHistory",
+      base::Bind(&BrowsingHistoryHandler::HandleQueryHistory,
+                 base::Unretained(this)));
+  web_ui()->RegisterMessageCallback("removeVisits",
+      base::Bind(&BrowsingHistoryHandler::HandleRemoveVisits,
+                 base::Unretained(this)));
+  web_ui()->RegisterMessageCallback("clearBrowsingData",
+      base::Bind(&BrowsingHistoryHandler::HandleClearBrowsingData,
+                 base::Unretained(this)));
+  web_ui()->RegisterMessageCallback("removeBookmark",
+      base::Bind(&BrowsingHistoryHandler::HandleRemoveBookmark,
+                 base::Unretained(this)));
+}
+
+bool BrowsingHistoryHandler::ExtractIntegerValueAtIndex(
+    const base::ListValue* value,
+    int index,
+    int* out_int) {
+  double double_value;
+  if (value->GetDouble(index, &double_value)) {
+    *out_int = static_cast<int>(double_value);
+    return true;
+  }
+  NOTREACHED();
+  return false;
+}
+
+void BrowsingHistoryHandler::WebHistoryTimeout() {
+  // TODO(dubroy): Communicate the failure to the front end.
+  if (!query_task_tracker_.HasTrackedTasks())
+    ReturnResultsToFrontEnd();
+
+  UMA_HISTOGRAM_ENUMERATION(
+      "WebHistory.QueryCompletion",
+      WEB_HISTORY_QUERY_TIMED_OUT, NUM_WEB_HISTORY_QUERY_BUCKETS);
+}
+
+void BrowsingHistoryHandler::QueryHistory(
+    const base::string16& search_text,
+    const history::QueryOptions& options) {
+  Profile* profile = Profile::FromWebUI(web_ui());
+
+  // Anything in-flight is invalid.
+  query_task_tracker_.TryCancelAll();
+  web_history_request_.reset();
+
+  query_results_.clear();
+  results_info_value_.Clear();
+
+  history::HistoryService* hs = HistoryServiceFactory::GetForProfile(
+      profile, ServiceAccessType::EXPLICIT_ACCESS);
+  hs->QueryHistory(search_text,
+                   options,
+                   base::Bind(&BrowsingHistoryHandler::QueryComplete,
+                              base::Unretained(this),
+                              search_text,
+                              options),
+                   &query_task_tracker_);
+
+  history::WebHistoryService* web_history =
+      WebHistoryServiceFactory::GetForProfile(profile);
+  if (web_history) {
+    web_history_query_results_.clear();
+    web_history_request_ = web_history->QueryHistory(
+        search_text,
+        options,
+        base::Bind(&BrowsingHistoryHandler::WebHistoryQueryComplete,
+                   base::Unretained(this),
+                   search_text, options,
+                   base::TimeTicks::Now()));
+    // Start a timer so we know when to give up.
+    web_history_timer_.Start(
+        FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds),
+        this, &BrowsingHistoryHandler::WebHistoryTimeout);
+
+    // Set this to false until the results actually arrive.
+    results_info_value_.SetBoolean("hasSyncedResults", false);
+  }
+}
+
+void BrowsingHistoryHandler::HandleQueryHistory(const base::ListValue* args) {
+  history::QueryOptions options;
+
+  // Parse the arguments from JavaScript. There are five required arguments:
+  // - the text to search for (may be empty)
+  // - the offset from which the search should start (in multiples of week or
+  //   month, set by the next argument).
+  // - the range (BrowsingHistoryHandler::Range) Enum value that sets the range
+  //   of the query.
+  // - the end time for the query. Only results older than this time will be
+  //   returned.
+  // - the maximum number of results to return (may be 0, meaning that there
+  //   is no maximum).
+  base::string16 search_text = ExtractStringValue(args);
+  int offset;
+  if (!args->GetInteger(1, &offset)) {
+    NOTREACHED() << "Failed to convert argument 1. ";
+    return;
+  }
+  int range;
+  if (!args->GetInteger(2, &range)) {
+    NOTREACHED() << "Failed to convert argument 2. ";
+    return;
+  }
+
+  if (range == BrowsingHistoryHandler::MONTH)
+    SetQueryTimeInMonths(offset, &options);
+  else if (range == BrowsingHistoryHandler::WEEK)
+    SetQueryTimeInWeeks(offset, &options);
+
+  double end_time;
+  if (!args->GetDouble(3, &end_time)) {
+    NOTREACHED() << "Failed to convert argument 3. ";
+    return;
+  }
+  if (end_time)
+    options.end_time = base::Time::FromJsTime(end_time);
+
+  if (!ExtractIntegerValueAtIndex(args, 4, &options.max_count)) {
+    NOTREACHED() << "Failed to convert argument 4.";
+    return;
+  }
+
+  options.duplicate_policy = history::QueryOptions::REMOVE_DUPLICATES_PER_DAY;
+  QueryHistory(search_text, options);
+}
+
+void BrowsingHistoryHandler::HandleRemoveVisits(const base::ListValue* args) {
+  Profile* profile = Profile::FromWebUI(web_ui());
+  // TODO(davidben): history.js is not aware of this failure and will still
+  // override |deleteCompleteCallback_|.
+  if (delete_task_tracker_.HasTrackedTasks() ||
+      has_pending_delete_request_ ||
+      !profile->GetPrefs()->GetBoolean(prefs::kAllowDeletingBrowserHistory)) {
+    web_ui()->CallJavascriptFunction("deleteFailed");
+    return;
+  }
+
+  history::HistoryService* history_service =
+      HistoryServiceFactory::GetForProfile(profile,
+                                           ServiceAccessType::EXPLICIT_ACCESS);
+  history::WebHistoryService* web_history =
+      WebHistoryServiceFactory::GetForProfile(profile);
+
+  base::Time now = base::Time::Now();
+  std::vector<history::ExpireHistoryArgs> expire_list;
+  expire_list.reserve(args->GetSize());
+
+  DCHECK(urls_to_be_deleted_.empty());
+  for (base::ListValue::const_iterator it = args->begin();
+       it != args->end(); ++it) {
+    base::DictionaryValue* deletion = NULL;
+    base::string16 url;
+    base::ListValue* timestamps = NULL;
+
+    // Each argument is a dictionary with properties "url" and "timestamps".
+    if (!((*it)->GetAsDictionary(&deletion) &&
+        deletion->GetString("url", &url) &&
+        deletion->GetList("timestamps", &timestamps))) {
+      NOTREACHED() << "Unable to extract arguments";
+      return;
+    }
+    DCHECK(timestamps->GetSize() > 0);
+
+    // In order to ensure that visits will be deleted from the server and other
+    // clients (even if they are offline), create a sync delete directive for
+    // each visit to be deleted.
+    sync_pb::HistoryDeleteDirectiveSpecifics delete_directive;
+    sync_pb::GlobalIdDirective* global_id_directive =
+        delete_directive.mutable_global_id_directive();
+
+    double timestamp;
+    history::ExpireHistoryArgs* expire_args = NULL;
+    for (base::ListValue::const_iterator ts_iterator = timestamps->begin();
+         ts_iterator != timestamps->end(); ++ts_iterator) {
+      if (!(*ts_iterator)->GetAsDouble(&timestamp)) {
+        NOTREACHED() << "Unable to extract visit timestamp.";
+        continue;
+      }
+      base::Time visit_time = base::Time::FromJsTime(timestamp);
+      if (!expire_args) {
+        GURL gurl(url);
+        expire_list.resize(expire_list.size() + 1);
+        expire_args = &expire_list.back();
+        expire_args->SetTimeRangeForOneDay(visit_time);
+        expire_args->urls.insert(gurl);
+        urls_to_be_deleted_.insert(gurl);
+      }
+      // The local visit time is treated as a global ID for the visit.
+      global_id_directive->add_global_id(visit_time.ToInternalValue());
+    }
+
+    // Set the start and end time in microseconds since the Unix epoch.
+    global_id_directive->set_start_time_usec(
+        (expire_args->begin_time - base::Time::UnixEpoch()).InMicroseconds());
+
+    // Delete directives shouldn't have an end time in the future.
+    // TODO(dubroy): Use sane time (crbug.com/146090) here when it's ready.
+    base::Time end_time = std::min(expire_args->end_time, now);
+
+    // -1 because end time in delete directives is inclusive.
+    global_id_directive->set_end_time_usec(
+        (end_time - base::Time::UnixEpoch()).InMicroseconds() - 1);
+
+    // TODO(dubroy): Figure out the proper way to handle an error here.
+    if (web_history)
+      history_service->ProcessLocalDeleteDirective(delete_directive);
+  }
+
+  history_service->ExpireHistory(
+      expire_list,
+      base::Bind(&BrowsingHistoryHandler::RemoveComplete,
+                 base::Unretained(this)),
+      &delete_task_tracker_);
+
+  if (web_history) {
+    has_pending_delete_request_ = true;
+    web_history->ExpireHistory(
+        expire_list,
+        base::Bind(&BrowsingHistoryHandler::RemoveWebHistoryComplete,
+                   weak_factory_.GetWeakPtr()));
+  }
+
+#if defined(ENABLE_EXTENSIONS)
+  // If the profile has activity logging enabled also clean up any URLs from
+  // the extension activity log. The extension activity log contains URLS
+  // which websites an extension has activity on so it will indirectly
+  // contain websites that a user has visited.
+  extensions::ActivityLog* activity_log =
+      extensions::ActivityLog::GetInstance(profile);
+  for (std::vector<history::ExpireHistoryArgs>::const_iterator it =
+       expire_list.begin(); it != expire_list.end(); ++it) {
+    activity_log->RemoveURLs(it->urls);
+  }
+#endif
+
+  for (const history::ExpireHistoryArgs& expire_entry : expire_list)
+    AppBannerSettingsHelper::ClearHistoryForURLs(profile, expire_entry.urls);
+}
+
+void BrowsingHistoryHandler::HandleClearBrowsingData(
+    const base::ListValue* args) {
+#if defined(OS_ANDROID)
+  chrome::android::ChromeApplication::OpenClearBrowsingData(
+      web_ui()->GetWebContents());
+#else
+  // TODO(beng): This is an improper direct dependency on Browser. Route this
+  // through some sort of delegate.
+  Browser* browser = chrome::FindBrowserWithWebContents(
+      web_ui()->GetWebContents());
+  chrome::ShowClearBrowsingDataDialog(browser);
+#endif
+}
+
+void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) {
+  base::string16 url = ExtractStringValue(args);
+  Profile* profile = Profile::FromWebUI(web_ui());
+  BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
+  bookmarks::RemoveAllBookmarks(model, GURL(url));
+}
+
+// static
+void BrowsingHistoryHandler::MergeDuplicateResults(
+    std::vector<BrowsingHistoryHandler::HistoryEntry>* results) {
+  std::vector<BrowsingHistoryHandler::HistoryEntry> new_results;
+  // Pre-reserve the size of the new vector. Since we're working with pointers
+  // later on not doing this could lead to the vector being resized and to
+  // pointers to invalid locations.
+  new_results.reserve(results->size());
+  // Maps a URL to the most recent entry on a particular day.
+  std::map<GURL, BrowsingHistoryHandler::HistoryEntry*> current_day_entries;
+
+  // Keeps track of the day that |current_day_urls| is holding the URLs for,
+  // in order to handle removing per-day duplicates.
+  base::Time current_day_midnight;
+
+  std::sort(
+      results->begin(), results->end(), HistoryEntry::SortByTimeDescending);
+
+  for (std::vector<BrowsingHistoryHandler::HistoryEntry>::const_iterator it =
+           results->begin(); it != results->end(); ++it) {
+    // Reset the list of found URLs when a visit from a new day is encountered.
+    if (current_day_midnight != it->time.LocalMidnight()) {
+      current_day_entries.clear();
+      current_day_midnight = it->time.LocalMidnight();
+    }
+
+    // Keep this visit if it's the first visit to this URL on the current day.
+    if (current_day_entries.count(it->url) == 0) {
+      new_results.push_back(*it);
+      current_day_entries[it->url] = &new_results.back();
+    } else {
+      // Keep track of the timestamps of all visits to the URL on the same day.
+      BrowsingHistoryHandler::HistoryEntry* entry =
+          current_day_entries[it->url];
+      entry->all_timestamps.insert(
+          it->all_timestamps.begin(), it->all_timestamps.end());
+
+      if (entry->entry_type != it->entry_type) {
+        entry->entry_type =
+            BrowsingHistoryHandler::HistoryEntry::COMBINED_ENTRY;
+      }
+    }
+  }
+  results->swap(new_results);
+}
+
+void BrowsingHistoryHandler::ReturnResultsToFrontEnd() {
+  Profile* profile = Profile::FromWebUI(web_ui());
+  BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile);
+  SupervisedUserService* supervised_user_service = NULL;
+#if defined(ENABLE_SUPERVISED_USERS)
+  if (profile->IsSupervised())
+    supervised_user_service =
+        SupervisedUserServiceFactory::GetForProfile(profile);
+#endif
+  ProfileSyncService* sync_service =
+      ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
+
+  // Combine the local and remote results into |query_results_|, and remove
+  // any duplicates.
+  if (!web_history_query_results_.empty()) {
+    int local_result_count = query_results_.size();
+    query_results_.insert(query_results_.end(),
+                          web_history_query_results_.begin(),
+                          web_history_query_results_.end());
+    MergeDuplicateResults(&query_results_);
+
+    if (local_result_count) {
+      // In the best case, we expect that all local results are duplicated on
+      // the server. Keep track of how many are missing.
+      int missing_count = std::count_if(
+          query_results_.begin(), query_results_.end(), IsLocalOnlyResult);
+      UMA_HISTOGRAM_PERCENTAGE("WebHistory.LocalResultMissingOnServer",
+                               missing_count * 100.0 / local_result_count);
+    }
+  }
+
+  // Convert the result vector into a ListValue.
+  base::ListValue results_value;
+  for (std::vector<BrowsingHistoryHandler::HistoryEntry>::iterator it =
+           query_results_.begin(); it != query_results_.end(); ++it) {
+    scoped_ptr<base::Value> value(
+        it->ToValue(bookmark_model, supervised_user_service, sync_service));
+    results_value.Append(value.release());
+  }
+
+  web_ui()->CallJavascriptFunction(
+      "historyResult", results_info_value_, results_value);
+  results_info_value_.Clear();
+  query_results_.clear();
+  web_history_query_results_.clear();
+}
+
+void BrowsingHistoryHandler::QueryComplete(
+    const base::string16& search_text,
+    const history::QueryOptions& options,
+    history::QueryResults* results) {
+  DCHECK_EQ(0U, query_results_.size());
+  query_results_.reserve(results->size());
+  const std::string accept_languages = GetAcceptLanguages();
+
+  for (size_t i = 0; i < results->size(); ++i) {
+    history::URLResult const &page = (*results)[i];
+    // TODO(dubroy): Use sane time (crbug.com/146090) here when it's ready.
+    query_results_.push_back(
+        HistoryEntry(
+            HistoryEntry::LOCAL_ENTRY,
+            page.url(),
+            page.title(),
+            page.visit_time(),
+            std::string(),
+            !search_text.empty(),
+            page.snippet().text(),
+            page.blocked_visit(),
+            accept_languages));
+  }
+
+  // The items which are to be written into results_info_value_ are also
+  // described in chrome/browser/resources/history/history.js in @typedef for
+  // HistoryQuery. Please update it whenever you add or remove any keys in
+  // results_info_value_.
+  results_info_value_.SetString("term", search_text);
+  results_info_value_.SetBoolean("finished", results->reached_beginning());
+
+  // Add the specific dates that were searched to display them.
+  // TODO(sergiu): Put today if the start is in the future.
+  results_info_value_.SetString("queryStartTime",
+                                GetRelativeDateLocalized(options.begin_time));
+  if (!options.end_time.is_null()) {
+    results_info_value_.SetString("queryEndTime",
+        GetRelativeDateLocalized(options.end_time -
+                                 base::TimeDelta::FromDays(1)));
+  } else {
+    results_info_value_.SetString("queryEndTime",
+        GetRelativeDateLocalized(base::Time::Now()));
+  }
+  if (!web_history_timer_.IsRunning())
+    ReturnResultsToFrontEnd();
+}
+
+void BrowsingHistoryHandler::WebHistoryQueryComplete(
+    const base::string16& search_text,
+    const history::QueryOptions& options,
+    base::TimeTicks start_time,
+    history::WebHistoryService::Request* request,
+    const base::DictionaryValue* results_value) {
+  base::TimeDelta delta = base::TimeTicks::Now() - start_time;
+  UMA_HISTOGRAM_TIMES("WebHistory.ResponseTime", delta);
+  const std::string accept_languages = GetAcceptLanguages();
+
+  // If the response came in too late, do nothing.
+  // TODO(dubroy): Maybe show a banner, and prompt the user to reload?
+  if (!web_history_timer_.IsRunning())
+    return;
+  web_history_timer_.Stop();
+
+  UMA_HISTOGRAM_ENUMERATION(
+      "WebHistory.QueryCompletion",
+      results_value ? WEB_HISTORY_QUERY_SUCCEEDED : WEB_HISTORY_QUERY_FAILED,
+      NUM_WEB_HISTORY_QUERY_BUCKETS);
+
+  DCHECK_EQ(0U, web_history_query_results_.size());
+  const base::ListValue* events = NULL;
+  if (results_value && results_value->GetList("event", &events)) {
+    web_history_query_results_.reserve(events->GetSize());
+    for (unsigned int i = 0; i < events->GetSize(); ++i) {
+      const base::DictionaryValue* event = NULL;
+      const base::DictionaryValue* result = NULL;
+      const base::ListValue* results = NULL;
+      const base::ListValue* ids = NULL;
+      base::string16 url;
+      base::string16 title;
+      base::Time visit_time;
+
+      if (!(events->GetDictionary(i, &event) &&
+          event->GetList("result", &results) &&
+          results->GetDictionary(0, &result) &&
+          result->GetString("url", &url) &&
+          result->GetList("id", &ids) &&
+          ids->GetSize() > 0)) {
+        LOG(WARNING) << "Improperly formed JSON response from history server.";
+        continue;
+      }
+
+      // Ignore any URLs that should not be shown in the history page.
+      GURL gurl(url);
+      if (!CanAddURLToHistory(gurl))
+        continue;
+
+      // Title is optional, so the return value is ignored here.
+      result->GetString("title", &title);
+
+      // Extract the timestamps of all the visits to this URL.
+      // They are referred to as "IDs" by the server.
+      for (int j = 0; j < static_cast<int>(ids->GetSize()); ++j) {
+        const base::DictionaryValue* id = NULL;
+        std::string timestamp_string;
+        int64 timestamp_usec = 0;
+
+        if (!ids->GetDictionary(j, &id) ||
+            !id->GetString("timestamp_usec", &timestamp_string) ||
+            !base::StringToInt64(timestamp_string, &timestamp_usec)) {
+          NOTREACHED() << "Unable to extract timestamp.";
+          continue;
+        }
+        // The timestamp on the server is a Unix time.
+        base::Time time = base::Time::UnixEpoch() +
+            base::TimeDelta::FromMicroseconds(timestamp_usec);
+
+        // Get the ID of the client that this visit came from.
+        std::string client_id;
+        id->GetString("client_id", &client_id);
+
+        web_history_query_results_.push_back(
+            HistoryEntry(
+                HistoryEntry::REMOTE_ENTRY,
+                gurl,
+                title,
+                time,
+                client_id,
+                !search_text.empty(),
+                base::string16(),
+                /* blocked_visit */ false,
+                accept_languages));
+      }
+    }
+  }
+  results_info_value_.SetBoolean("hasSyncedResults", results_value != NULL);
+  if (!query_task_tracker_.HasTrackedTasks())
+    ReturnResultsToFrontEnd();
+}
+
+void BrowsingHistoryHandler::RemoveComplete() {
+  urls_to_be_deleted_.clear();
+
+  // Notify the page that the deletion request is complete, but only if a web
+  // history delete request is not still pending.
+  if (!has_pending_delete_request_)
+    web_ui()->CallJavascriptFunction("deleteComplete");
+}
+
+void BrowsingHistoryHandler::RemoveWebHistoryComplete(bool success) {
+  has_pending_delete_request_ = false;
+  // TODO(dubroy): Should we handle failure somehow? Delete directives will
+  // ensure that the visits are eventually deleted, so maybe it's not necessary.
+  if (!delete_task_tracker_.HasTrackedTasks())
+    RemoveComplete();
+}
+
+void BrowsingHistoryHandler::SetQueryTimeInWeeks(
+    int offset, history::QueryOptions* options) {
+  // LocalMidnight returns the beginning of the current day so get the
+  // beginning of the next one.
+  base::Time midnight = base::Time::Now().LocalMidnight() +
+                              base::TimeDelta::FromDays(1);
+  options->end_time = midnight -
+      base::TimeDelta::FromDays(7 * offset);
+  options->begin_time = midnight -
+      base::TimeDelta::FromDays(7 * (offset + 1));
+}
+
+void BrowsingHistoryHandler::SetQueryTimeInMonths(
+    int offset, history::QueryOptions* options) {
+  // Configure the begin point of the search to the start of the
+  // current month.
+  base::Time::Exploded exploded;
+  base::Time::Now().LocalMidnight().LocalExplode(&exploded);
+  exploded.day_of_month = 1;
+
+  if (offset == 0) {
+    options->begin_time = base::Time::FromLocalExploded(exploded);
+
+    // Set the end time of this first search to null (which will
+    // show results from the future, should the user's clock have
+    // been set incorrectly).
+    options->end_time = base::Time();
+  } else {
+    // Go back |offset| months in the past. The end time is not inclusive, so
+    // use the first day of the |offset| - 1 and |offset| months (e.g. for
+    // the last month, |offset| = 1, use the first days of the last month and
+    // the current month.
+    exploded.month -= offset - 1;
+    // Set the correct year.
+    NormalizeMonths(&exploded);
+    options->end_time = base::Time::FromLocalExploded(exploded);
+
+    exploded.month -= 1;
+    // Set the correct year
+    NormalizeMonths(&exploded);
+    options->begin_time = base::Time::FromLocalExploded(exploded);
+  }
+}
+
+// Helper function for Observe that determines if there are any differences
+// between the URLs noticed for deletion and the ones we are expecting.
+static bool DeletionsDiffer(const history::URLRows& deleted_rows,
+                            const std::set<GURL>& urls_to_be_deleted) {
+  if (deleted_rows.size() != urls_to_be_deleted.size())
+    return true;
+  for (const auto& i : deleted_rows) {
+    if (urls_to_be_deleted.find(i.url()) == urls_to_be_deleted.end())
+      return true;
+  }
+  return false;
+}
+
+std::string BrowsingHistoryHandler::GetAcceptLanguages() const {
+  Profile* profile = Profile::FromWebUI(web_ui());
+  return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
+}
+
+void BrowsingHistoryHandler::OnURLsDeleted(
+    history::HistoryService* history_service,
+    bool all_history,
+    bool expired,
+    const history::URLRows& deleted_rows,
+    const std::set<GURL>& favicon_urls) {
+  if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_))
+    web_ui()->CallJavascriptFunction("historyDeleted");
+}
diff --git a/chrome/browser/ui/webui/browsing_history_handler.h b/chrome/browser/ui/webui/browsing_history_handler.h
new file mode 100644
index 0000000..38f7777
--- /dev/null
+++ b/chrome/browser/ui/webui/browsing_history_handler.h
@@ -0,0 +1,223 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
+#include "base/strings/string16.h"
+#include "base/task/cancelable_task_tracker.h"
+#include "base/timer/timer.h"
+#include "base/values.h"
+#include "components/history/core/browser/history_service_observer.h"
+#include "components/history/core/browser/url_row.h"
+#include "components/history/core/browser/web_history_service.h"
+#include "content/public/browser/web_ui_message_handler.h"
+#include "url/gurl.h"
+
+class ProfileSyncService;
+class SupervisedUserService;
+
+namespace bookmarks {
+class BookmarkModel;
+}
+
+namespace history {
+class HistoryService;
+struct QueryOptions;
+class QueryResults;
+}
+
+// The handler for Javascript messages related to the "history" view.
+class BrowsingHistoryHandler : public content::WebUIMessageHandler,
+                               public history::HistoryServiceObserver {
+ public:
+  // Represents a history entry to be shown to the user, representing either
+  // a local or remote visit. A single entry can represent multiple visits,
+  // since only the most recent visit on a particular day is shown.
+  struct HistoryEntry {
+    // Values indicating whether an entry represents only local visits, only
+    // remote visits, or a mixture of both.
+    enum EntryType {
+      EMPTY_ENTRY = 0,
+      LOCAL_ENTRY,
+      REMOTE_ENTRY,
+      COMBINED_ENTRY
+    };
+
+    HistoryEntry(EntryType type, const GURL& url, const base::string16& title,
+                 base::Time time, const std::string& client_id,
+                 bool is_search_result, const base::string16& snippet,
+                 bool blocked_visit, const std::string& accept_languages);
+    HistoryEntry();
+    virtual ~HistoryEntry();
+
+    // Formats this entry's URL and title and adds them to |result|.
+    void SetUrlAndTitle(base::DictionaryValue* result) const;
+
+    // Converts the entry to a DictionaryValue to be owned by the caller.
+    scoped_ptr<base::DictionaryValue> ToValue(
+        bookmarks::BookmarkModel* bookmark_model,
+        SupervisedUserService* supervised_user_service,
+        const ProfileSyncService* sync_service) const;
+
+    // Comparison function for sorting HistoryEntries from newest to oldest.
+    static bool SortByTimeDescending(
+        const HistoryEntry& entry1, const HistoryEntry& entry2);
+
+    // The type of visits this entry represents: local, remote, or both.
+    EntryType entry_type;
+
+    GURL url;
+    base::string16 title;  // Title of the entry. May be empty.
+
+    // The time of the entry. Usually this will be the time of the most recent
+    // visit to |url| on a particular day as defined in the local timezone.
+    base::Time time;
+
+    // The sync ID of the client on which the most recent visit occurred.
+    std::string client_id;
+
+    // Timestamps of all local or remote visits the same URL on the same day.
+    std::set<int64> all_timestamps;
+
+    // If true, this entry is a search result.
+    bool is_search_result;
+
+    // The entry's search snippet, if this entry is a search result.
+    base::string16 snippet;
+
+    // Whether this entry was blocked when it was attempted.
+    bool blocked_visit;
+
+    // kAcceptLanguages pref value.
+    std::string accept_languages;
+  };
+
+  BrowsingHistoryHandler();
+  ~BrowsingHistoryHandler() override;
+
+  // WebUIMessageHandler implementation.
+  void RegisterMessages() override;
+
+  // Handler for the "queryHistory" message.
+  void HandleQueryHistory(const base::ListValue* args);
+
+  // Handler for the "removeVisits" message.
+  void HandleRemoveVisits(const base::ListValue* args);
+
+  // Handler for "clearBrowsingData" message.
+  void HandleClearBrowsingData(const base::ListValue* args);
+
+  // Handler for "removeBookmark" message.
+  void HandleRemoveBookmark(const base::ListValue* args);
+
+  // Merges duplicate entries from the query results, only retaining the most
+  // recent visit to a URL on a particular day. That visit contains the
+  // timestamps of the other visits.
+  static void MergeDuplicateResults(
+      std::vector<BrowsingHistoryHandler::HistoryEntry>* results);
+
+ private:
+  // The range for which to return results:
+  // - ALLTIME: allows access to all the results in a paginated way.
+  // - WEEK: the last 7 days.
+  // - MONTH: the last calendar month.
+  enum Range {
+    ALL_TIME = 0,
+    WEEK = 1,
+    MONTH = 2
+  };
+
+  // Core implementation of history querying.
+  void QueryHistory(const base::string16& search_text,
+                    const history::QueryOptions& options);
+
+  // Combines the query results from the local history database and the history
+  // server, and sends the combined results to the front end.
+  void ReturnResultsToFrontEnd();
+
+  // Callback from |web_history_timer_| when a response from web history has
+  // not been received in time.
+  void WebHistoryTimeout();
+
+  // Callback from the history system when a history query has completed.
+  void QueryComplete(const base::string16& search_text,
+                     const history::QueryOptions& options,
+                     history::QueryResults* results);
+
+  // Callback from the WebHistoryService when a query has completed.
+  void WebHistoryQueryComplete(const base::string16& search_text,
+                               const history::QueryOptions& options,
+                               base::TimeTicks start_time,
+                               history::WebHistoryService::Request* request,
+                               const base::DictionaryValue* results_value);
+
+  // Callback from the history system when visits were deleted.
+  void RemoveComplete();
+
+  // Callback from history server when visits were deleted.
+  void RemoveWebHistoryComplete(bool success);
+
+  bool ExtractIntegerValueAtIndex(
+      const base::ListValue* value, int index, int* out_int);
+
+  // Sets the query options for a week-wide query, |offset| weeks ago.
+  void SetQueryTimeInWeeks(int offset, history::QueryOptions* options);
+
+  // Sets the query options for a monthly query, |offset| months ago.
+  void SetQueryTimeInMonths(int offset, history::QueryOptions* options);
+
+  // kAcceptLanguages pref value.
+  std::string GetAcceptLanguages() const;
+
+  // history::HistoryServiceObserver:
+  void OnURLsDeleted(history::HistoryService* history_service,
+                     bool all_history,
+                     bool expired,
+                     const history::URLRows& deleted_rows,
+                     const std::set<GURL>& favicon_urls) override;
+
+  // Tracker for search requests to the history service.
+  base::CancelableTaskTracker query_task_tracker_;
+
+  // The currently-executing request for synced history results.
+  // Deleting the request will cancel it.
+  scoped_ptr<history::WebHistoryService::Request> web_history_request_;
+
+  // True if there is a pending delete requests to the history service.
+  bool has_pending_delete_request_;
+
+  // Tracker for delete requests to the history service.
+  base::CancelableTaskTracker delete_task_tracker_;
+
+  // The list of URLs that are in the process of being deleted.
+  std::set<GURL> urls_to_be_deleted_;
+
+  // The info value that is returned to the front end with the query results.
+  base::DictionaryValue results_info_value_;
+
+  // The list of query results received from the history service.
+  std::vector<HistoryEntry> query_results_;
+
+  // The list of query results received from the history server.
+  std::vector<HistoryEntry> web_history_query_results_;
+
+  // Timer used to implement a timeout on a Web History response.
+  base::OneShotTimer web_history_timer_;
+
+  ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
+      history_service_observer_;
+
+  base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
+};
+
+#endif  // CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_
diff --git a/chrome/browser/ui/webui/history_ui_unittest.cc b/chrome/browser/ui/webui/browsing_history_handler_unittest.cc
similarity index 97%
rename from chrome/browser/ui/webui/history_ui_unittest.cc
rename to chrome/browser/ui/webui/browsing_history_handler_unittest.cc
index 58d1ddc..9a097be 100644
--- a/chrome/browser/ui/webui/history_ui_unittest.cc
+++ b/chrome/browser/ui/webui/browsing_history_handler_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ui/webui/history_ui.h"
+#include "chrome/browser/ui/webui/browsing_history_handler.h"
 
 #include "base/strings/utf_string_conversions.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -49,7 +49,7 @@
 
 // Tests that the MergeDuplicateResults method correctly removes duplicate
 // visits to the same URL on the same day.
-TEST(HistoryUITest, MergeDuplicateResults) {
+TEST(BrowsingHistoryHandlerTest, MergeDuplicateResults) {
   {
     // Basic test that duplicates on the same day are removed.
     TestResult test_data[] = {
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 36cc8c2..7195f4c 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -4,102 +4,41 @@
 
 #include "chrome/browser/ui/webui/history_ui.h"
 
-#include <set>
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
 #include "base/command_line.h"
-#include "base/i18n/rtl.h"
-#include "base/i18n/time_formatting.h"
-#include "base/memory/singleton.h"
-#include "base/message_loop/message_loop.h"
-#include "base/metrics/histogram.h"
+#include "base/memory/ref_counted_memory.h"
 #include "base/prefs/pref_service.h"
 #include "base/strings/string16.h"
-#include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
-#include "base/time/time.h"
-#include "base/values.h"
-#include "chrome/browser/banners/app_banner_settings_helper.h"
-#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/engagement/site_engagement_service.h"
-#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/history_utils.h"
 #include "chrome/browser/history/web_history_service_factory.h"
 #include "chrome/browser/prefs/incognito_mode_prefs.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/chrome_pages.h"
-#include "chrome/browser/ui/webui/favicon_source.h"
+#include "chrome/browser/ui/webui/browsing_history_handler.h"
 #include "chrome/browser/ui/webui/metrics_handler.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/grit/generated_resources.h"
-#include "components/bookmarks/browser/bookmark_model.h"
-#include "components/bookmarks/browser/bookmark_utils.h"
-#include "components/browser_sync/browser/profile_sync_service.h"
-#include "components/history/core/browser/history_service.h"
-#include "components/history/core/browser/history_types.h"
-#include "components/history/core/browser/web_history_service.h"
 #include "components/search/search.h"
 #include "components/signin/core/browser/signin_manager.h"
-#include "components/sync_driver/device_info.h"
-#include "components/url_formatter/url_formatter.h"
-#include "content/public/browser/url_data_source.h"
 #include "content/public/browser/web_ui.h"
 #include "content/public/browser/web_ui_data_source.h"
 #include "grit/browser_resources.h"
 #include "grit/theme_resources.h"
-#include "net/base/escape.h"
-#include "sync/protocol/history_delete_directive_specifics.pb.h"
 #include "ui/base/l10n/l10n_util.h"
-#include "ui/base/l10n/time_format.h"
 #include "ui/base/resource/resource_bundle.h"
-#include "ui/base/webui/web_ui_util.h"
-
-#if defined(ENABLE_EXTENSIONS)
-#include "chrome/browser/extensions/activity_log/activity_log.h"
-#endif
-
-#if defined(ENABLE_SUPERVISED_USERS)
-#include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
-#include "chrome/browser/supervised_user/supervised_user_service.h"
-#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
-#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
-#endif
-
-#if defined(OS_ANDROID)
-#include "chrome/browser/android/chrome_application.h"
-#endif
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
 #include "chrome/browser/ui/webui/foreign_session_handler.h"
 #include "chrome/browser/ui/webui/history_login_handler.h"
 #endif
 
-using bookmarks::BookmarkModel;
-
 static const char kStringsJsFile[] = "strings.js";
 static const char kHistoryJsFile[] = "history.js";
 static const char kOtherDevicesJsFile[] = "other_devices.js";
 
-// The amount of time to wait for a response from the WebHistoryService.
-static const int kWebHistoryTimeoutSeconds = 3;
-
 namespace {
 
-// Buckets for UMA histograms.
-enum WebHistoryQueryBuckets {
-  WEB_HISTORY_QUERY_FAILED = 0,
-  WEB_HISTORY_QUERY_SUCCEEDED,
-  WEB_HISTORY_QUERY_TIMED_OUT,
-  NUM_WEB_HISTORY_QUERY_BUCKETS
-};
-
 #if defined(OS_MACOSX)
 const char kIncognitoModeShortcut[] = "("
     "\xE2\x87\xA7"  // Shift symbol (U+21E7 'UPWARDS WHITE ARROW').
@@ -111,11 +50,6 @@
 const char kIncognitoModeShortcut[] = "(Shift+Ctrl+N)";
 #endif
 
-// Identifiers for the type of device from which a history entry originated.
-static const char kDeviceTypeLaptop[] = "laptop";
-static const char kDeviceTypePhone[] = "phone";
-static const char kDeviceTypeTablet[] = "tablet";
-
 content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) {
   PrefService* prefs = profile->GetPrefs();
 
@@ -223,820 +157,8 @@
   return source;
 }
 
-// Returns a localized version of |visit_time| including a relative
-// indicator (e.g. today, yesterday).
-base::string16 getRelativeDateLocalized(const base::Time& visit_time) {
-  base::Time midnight = base::Time::Now().LocalMidnight();
-  base::string16 date_str = ui::TimeFormat::RelativeDate(visit_time, &midnight);
-  if (date_str.empty()) {
-    date_str = base::TimeFormatFriendlyDate(visit_time);
-  } else {
-    date_str = l10n_util::GetStringFUTF16(
-        IDS_HISTORY_DATE_WITH_RELATIVE_TIME,
-        date_str,
-        base::TimeFormatFriendlyDate(visit_time));
-  }
-  return date_str;
-}
-
-
-// Sets the correct year when substracting months from a date.
-void normalizeMonths(base::Time::Exploded* exploded) {
-  // Decrease a year at a time until we have a proper date.
-  while (exploded->month < 1) {
-    exploded->month += 12;
-    exploded->year--;
-  }
-}
-
-// Returns true if |entry| represents a local visit that had no corresponding
-// visit on the server.
-bool IsLocalOnlyResult(const BrowsingHistoryHandler::HistoryEntry& entry) {
-  return entry.entry_type == BrowsingHistoryHandler::HistoryEntry::LOCAL_ENTRY;
-}
-
-// Gets the name and type of a device for the given sync client ID.
-// |name| and |type| are out parameters.
-void GetDeviceNameAndType(const ProfileSyncService* sync_service,
-                          const std::string& client_id,
-                          std::string* name,
-                          std::string* type) {
-  // DeviceInfoTracker must be syncing in order for remote history entries to
-  // be available.
-  DCHECK(sync_service);
-  DCHECK(sync_service->GetDeviceInfoTracker());
-  DCHECK(sync_service->GetDeviceInfoTracker()->IsSyncing());
-
-  scoped_ptr<sync_driver::DeviceInfo> device_info =
-      sync_service->GetDeviceInfoTracker()->GetDeviceInfo(client_id);
-  if (device_info.get()) {
-    *name = device_info->client_name();
-    switch (device_info->device_type()) {
-      case sync_pb::SyncEnums::TYPE_PHONE:
-        *type = kDeviceTypePhone;
-        break;
-      case sync_pb::SyncEnums::TYPE_TABLET:
-        *type = kDeviceTypeTablet;
-        break;
-      default:
-        *type = kDeviceTypeLaptop;
-    }
-    return;
-  }
-
-  *name = l10n_util::GetStringUTF8(IDS_HISTORY_UNKNOWN_DEVICE);
-  *type = kDeviceTypeLaptop;
-}
-
 }  // namespace
 
-////////////////////////////////////////////////////////////////////////////////
-//
-// BrowsingHistoryHandler
-//
-////////////////////////////////////////////////////////////////////////////////
-
-BrowsingHistoryHandler::HistoryEntry::HistoryEntry(
-    BrowsingHistoryHandler::HistoryEntry::EntryType entry_type,
-    const GURL& url, const base::string16& title, base::Time time,
-    const std::string& client_id, bool is_search_result,
-    const base::string16& snippet, bool blocked_visit,
-    const std::string& accept_languages) {
-  this->entry_type = entry_type;
-  this->url = url;
-  this->title = title;
-  this->time = time;
-  this->client_id = client_id;
-  all_timestamps.insert(time.ToInternalValue());
-  this->is_search_result = is_search_result;
-  this->snippet = snippet;
-  this->blocked_visit = blocked_visit;
-  this->accept_languages = accept_languages;
-}
-
-BrowsingHistoryHandler::HistoryEntry::HistoryEntry()
-    : entry_type(EMPTY_ENTRY), is_search_result(false), blocked_visit(false) {
-}
-
-BrowsingHistoryHandler::HistoryEntry::~HistoryEntry() {
-}
-
-void BrowsingHistoryHandler::HistoryEntry::SetUrlAndTitle(
-    base::DictionaryValue* result) const {
-  result->SetString("url", url.spec());
-
-  bool using_url_as_the_title = false;
-  base::string16 title_to_set(title);
-  if (title.empty()) {
-    using_url_as_the_title = true;
-    title_to_set = base::UTF8ToUTF16(url.spec());
-  }
-
-  // Since the title can contain BiDi text, we need to mark the text as either
-  // RTL or LTR, depending on the characters in the string. If we use the URL
-  // as the title, we mark the title as LTR since URLs are always treated as
-  // left to right strings.
-  if (base::i18n::IsRTL()) {
-    if (using_url_as_the_title)
-      base::i18n::WrapStringWithLTRFormatting(&title_to_set);
-    else
-      base::i18n::AdjustStringForLocaleDirection(&title_to_set);
-  }
-  result->SetString("title", title_to_set);
-}
-
-scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue(
-    BookmarkModel* bookmark_model,
-    SupervisedUserService* supervised_user_service,
-    const ProfileSyncService* sync_service) const {
-  scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
-  SetUrlAndTitle(result.get());
-
-  base::string16 domain =
-      url_formatter::IDNToUnicode(url.host(), accept_languages);
-  // When the domain is empty, use the scheme instead. This allows for a
-  // sensible treatment of e.g. file: URLs when group by domain is on.
-  if (domain.empty())
-    domain = base::UTF8ToUTF16(url.scheme() + ":");
-
-  // The items which are to be written into result are also described in
-  // chrome/browser/resources/history/history.js in @typedef for
-  // HistoryEntry. Please update it whenever you add or remove
-  // any keys in result.
-  result->SetString("domain", domain);
-  result->SetDouble("time", time.ToJsTime());
-
-  // Pass the timestamps in a list.
-  scoped_ptr<base::ListValue> timestamps(new base::ListValue);
-  for (std::set<int64>::const_iterator it = all_timestamps.begin();
-       it != all_timestamps.end(); ++it) {
-    timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime());
-  }
-  result->Set("allTimestamps", timestamps.release());
-
-  // Always pass the short date since it is needed both in the search and in
-  // the monthly view.
-  result->SetString("dateShort", base::TimeFormatShortDate(time));
-
-  // Only pass in the strings we need (search results need a shortdate
-  // and snippet, browse results need day and time information).
-  if (is_search_result) {
-    result->SetString("snippet", snippet);
-  } else {
-    base::Time midnight = base::Time::Now().LocalMidnight();
-    base::string16 date_str = ui::TimeFormat::RelativeDate(time, &midnight);
-    if (date_str.empty()) {
-      date_str = base::TimeFormatFriendlyDate(time);
-    } else {
-      date_str = l10n_util::GetStringFUTF16(
-          IDS_HISTORY_DATE_WITH_RELATIVE_TIME,
-          date_str,
-          base::TimeFormatFriendlyDate(time));
-    }
-    result->SetString("dateRelativeDay", date_str);
-    result->SetString("dateTimeOfDay", base::TimeFormatTimeOfDay(time));
-  }
-  result->SetBoolean("starred", bookmark_model->IsBookmarked(url));
-
-  std::string device_name;
-  std::string device_type;
-  if (!client_id.empty())
-    GetDeviceNameAndType(sync_service, client_id, &device_name, &device_type);
-  result->SetString("deviceName", device_name);
-  result->SetString("deviceType", device_type);
-
-#if defined(ENABLE_SUPERVISED_USERS)
-  if (supervised_user_service) {
-    const SupervisedUserURLFilter* url_filter =
-        supervised_user_service->GetURLFilterForUIThread();
-    int filtering_behavior =
-        url_filter->GetFilteringBehaviorForURL(url.GetWithEmptyPath());
-    result->SetInteger("hostFilteringBehavior", filtering_behavior);
-
-    result->SetBoolean("blockedVisit", blocked_visit);
-  }
-#endif
-
-  return result.Pass();
-}
-
-bool BrowsingHistoryHandler::HistoryEntry::SortByTimeDescending(
-    const BrowsingHistoryHandler::HistoryEntry& entry1,
-    const BrowsingHistoryHandler::HistoryEntry& entry2) {
-  return entry1.time > entry2.time;
-}
-
-BrowsingHistoryHandler::BrowsingHistoryHandler()
-    : has_pending_delete_request_(false),
-      history_service_observer_(this),
-      weak_factory_(this) {
-}
-
-BrowsingHistoryHandler::~BrowsingHistoryHandler() {
-  query_task_tracker_.TryCancelAll();
-  web_history_request_.reset();
-}
-
-void BrowsingHistoryHandler::RegisterMessages() {
-  // Create our favicon data source.
-  Profile* profile = Profile::FromWebUI(web_ui());
-  content::URLDataSource::Add(
-      profile, new FaviconSource(profile, FaviconSource::ANY));
-
-  // Get notifications when history is cleared.
-  history::HistoryService* hs = HistoryServiceFactory::GetForProfile(
-      profile, ServiceAccessType::EXPLICIT_ACCESS);
-  if (hs)
-    history_service_observer_.Add(hs);
-
-  web_ui()->RegisterMessageCallback("queryHistory",
-      base::Bind(&BrowsingHistoryHandler::HandleQueryHistory,
-                 base::Unretained(this)));
-  web_ui()->RegisterMessageCallback("removeVisits",
-      base::Bind(&BrowsingHistoryHandler::HandleRemoveVisits,
-                 base::Unretained(this)));
-  web_ui()->RegisterMessageCallback("clearBrowsingData",
-      base::Bind(&BrowsingHistoryHandler::HandleClearBrowsingData,
-                 base::Unretained(this)));
-  web_ui()->RegisterMessageCallback("removeBookmark",
-      base::Bind(&BrowsingHistoryHandler::HandleRemoveBookmark,
-                 base::Unretained(this)));
-}
-
-bool BrowsingHistoryHandler::ExtractIntegerValueAtIndex(
-    const base::ListValue* value,
-    int index,
-    int* out_int) {
-  double double_value;
-  if (value->GetDouble(index, &double_value)) {
-    *out_int = static_cast<int>(double_value);
-    return true;
-  }
-  NOTREACHED();
-  return false;
-}
-
-void BrowsingHistoryHandler::WebHistoryTimeout() {
-  // TODO(dubroy): Communicate the failure to the front end.
-  if (!query_task_tracker_.HasTrackedTasks())
-    ReturnResultsToFrontEnd();
-
-  UMA_HISTOGRAM_ENUMERATION(
-      "WebHistory.QueryCompletion",
-      WEB_HISTORY_QUERY_TIMED_OUT, NUM_WEB_HISTORY_QUERY_BUCKETS);
-}
-
-void BrowsingHistoryHandler::QueryHistory(
-    const base::string16& search_text,
-    const history::QueryOptions& options) {
-  Profile* profile = Profile::FromWebUI(web_ui());
-
-  // Anything in-flight is invalid.
-  query_task_tracker_.TryCancelAll();
-  web_history_request_.reset();
-
-  query_results_.clear();
-  results_info_value_.Clear();
-
-  history::HistoryService* hs = HistoryServiceFactory::GetForProfile(
-      profile, ServiceAccessType::EXPLICIT_ACCESS);
-  hs->QueryHistory(search_text,
-                   options,
-                   base::Bind(&BrowsingHistoryHandler::QueryComplete,
-                              base::Unretained(this),
-                              search_text,
-                              options),
-                   &query_task_tracker_);
-
-  history::WebHistoryService* web_history =
-      WebHistoryServiceFactory::GetForProfile(profile);
-  if (web_history) {
-    web_history_query_results_.clear();
-    web_history_request_ = web_history->QueryHistory(
-        search_text,
-        options,
-        base::Bind(&BrowsingHistoryHandler::WebHistoryQueryComplete,
-                   base::Unretained(this),
-                   search_text, options,
-                   base::TimeTicks::Now()));
-    // Start a timer so we know when to give up.
-    web_history_timer_.Start(
-        FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds),
-        this, &BrowsingHistoryHandler::WebHistoryTimeout);
-
-    // Set this to false until the results actually arrive.
-    results_info_value_.SetBoolean("hasSyncedResults", false);
-  }
-}
-
-void BrowsingHistoryHandler::HandleQueryHistory(const base::ListValue* args) {
-  history::QueryOptions options;
-
-  // Parse the arguments from JavaScript. There are five required arguments:
-  // - the text to search for (may be empty)
-  // - the offset from which the search should start (in multiples of week or
-  //   month, set by the next argument).
-  // - the range (BrowsingHistoryHandler::Range) Enum value that sets the range
-  //   of the query.
-  // - the end time for the query. Only results older than this time will be
-  //   returned.
-  // - the maximum number of results to return (may be 0, meaning that there
-  //   is no maximum).
-  base::string16 search_text = ExtractStringValue(args);
-  int offset;
-  if (!args->GetInteger(1, &offset)) {
-    NOTREACHED() << "Failed to convert argument 1. ";
-    return;
-  }
-  int range;
-  if (!args->GetInteger(2, &range)) {
-    NOTREACHED() << "Failed to convert argument 2. ";
-    return;
-  }
-
-  if (range == BrowsingHistoryHandler::MONTH)
-    SetQueryTimeInMonths(offset, &options);
-  else if (range == BrowsingHistoryHandler::WEEK)
-    SetQueryTimeInWeeks(offset, &options);
-
-  double end_time;
-  if (!args->GetDouble(3, &end_time)) {
-    NOTREACHED() << "Failed to convert argument 3. ";
-    return;
-  }
-  if (end_time)
-    options.end_time = base::Time::FromJsTime(end_time);
-
-  if (!ExtractIntegerValueAtIndex(args, 4, &options.max_count)) {
-    NOTREACHED() << "Failed to convert argument 4.";
-    return;
-  }
-
-  options.duplicate_policy = history::QueryOptions::REMOVE_DUPLICATES_PER_DAY;
-  QueryHistory(search_text, options);
-}
-
-void BrowsingHistoryHandler::HandleRemoveVisits(const base::ListValue* args) {
-  Profile* profile = Profile::FromWebUI(web_ui());
-  // TODO(davidben): history.js is not aware of this failure and will still
-  // override |deleteCompleteCallback_|.
-  if (delete_task_tracker_.HasTrackedTasks() ||
-      has_pending_delete_request_ ||
-      !profile->GetPrefs()->GetBoolean(prefs::kAllowDeletingBrowserHistory)) {
-    web_ui()->CallJavascriptFunction("deleteFailed");
-    return;
-  }
-
-  history::HistoryService* history_service =
-      HistoryServiceFactory::GetForProfile(profile,
-                                           ServiceAccessType::EXPLICIT_ACCESS);
-  history::WebHistoryService* web_history =
-      WebHistoryServiceFactory::GetForProfile(profile);
-
-  base::Time now = base::Time::Now();
-  std::vector<history::ExpireHistoryArgs> expire_list;
-  expire_list.reserve(args->GetSize());
-
-  DCHECK(urls_to_be_deleted_.empty());
-  for (base::ListValue::const_iterator it = args->begin();
-       it != args->end(); ++it) {
-    base::DictionaryValue* deletion = NULL;
-    base::string16 url;
-    base::ListValue* timestamps = NULL;
-
-    // Each argument is a dictionary with properties "url" and "timestamps".
-    if (!((*it)->GetAsDictionary(&deletion) &&
-        deletion->GetString("url", &url) &&
-        deletion->GetList("timestamps", &timestamps))) {
-      NOTREACHED() << "Unable to extract arguments";
-      return;
-    }
-    DCHECK(timestamps->GetSize() > 0);
-
-    // In order to ensure that visits will be deleted from the server and other
-    // clients (even if they are offline), create a sync delete directive for
-    // each visit to be deleted.
-    sync_pb::HistoryDeleteDirectiveSpecifics delete_directive;
-    sync_pb::GlobalIdDirective* global_id_directive =
-        delete_directive.mutable_global_id_directive();
-
-    double timestamp;
-    history::ExpireHistoryArgs* expire_args = NULL;
-    for (base::ListValue::const_iterator ts_iterator = timestamps->begin();
-         ts_iterator != timestamps->end(); ++ts_iterator) {
-      if (!(*ts_iterator)->GetAsDouble(&timestamp)) {
-        NOTREACHED() << "Unable to extract visit timestamp.";
-        continue;
-      }
-      base::Time visit_time = base::Time::FromJsTime(timestamp);
-      if (!expire_args) {
-        GURL gurl(url);
-        expire_list.resize(expire_list.size() + 1);
-        expire_args = &expire_list.back();
-        expire_args->SetTimeRangeForOneDay(visit_time);
-        expire_args->urls.insert(gurl);
-        urls_to_be_deleted_.insert(gurl);
-      }
-      // The local visit time is treated as a global ID for the visit.
-      global_id_directive->add_global_id(visit_time.ToInternalValue());
-    }
-
-    // Set the start and end time in microseconds since the Unix epoch.
-    global_id_directive->set_start_time_usec(
-        (expire_args->begin_time - base::Time::UnixEpoch()).InMicroseconds());
-
-    // Delete directives shouldn't have an end time in the future.
-    // TODO(dubroy): Use sane time (crbug.com/146090) here when it's ready.
-    base::Time end_time = std::min(expire_args->end_time, now);
-
-    // -1 because end time in delete directives is inclusive.
-    global_id_directive->set_end_time_usec(
-        (end_time - base::Time::UnixEpoch()).InMicroseconds() - 1);
-
-    // TODO(dubroy): Figure out the proper way to handle an error here.
-    if (web_history)
-      history_service->ProcessLocalDeleteDirective(delete_directive);
-  }
-
-  history_service->ExpireHistory(
-      expire_list,
-      base::Bind(&BrowsingHistoryHandler::RemoveComplete,
-                 base::Unretained(this)),
-      &delete_task_tracker_);
-
-  if (web_history) {
-    has_pending_delete_request_ = true;
-    web_history->ExpireHistory(
-        expire_list,
-        base::Bind(&BrowsingHistoryHandler::RemoveWebHistoryComplete,
-                   weak_factory_.GetWeakPtr()));
-  }
-
-#if defined(ENABLE_EXTENSIONS)
-  // If the profile has activity logging enabled also clean up any URLs from
-  // the extension activity log. The extension activity log contains URLS
-  // which websites an extension has activity on so it will indirectly
-  // contain websites that a user has visited.
-  extensions::ActivityLog* activity_log =
-      extensions::ActivityLog::GetInstance(profile);
-  for (std::vector<history::ExpireHistoryArgs>::const_iterator it =
-       expire_list.begin(); it != expire_list.end(); ++it) {
-    activity_log->RemoveURLs(it->urls);
-  }
-#endif
-
-  for (const history::ExpireHistoryArgs& expire_entry : expire_list)
-    AppBannerSettingsHelper::ClearHistoryForURLs(profile, expire_entry.urls);
-}
-
-void BrowsingHistoryHandler::HandleClearBrowsingData(
-    const base::ListValue* args) {
-#if defined(OS_ANDROID)
-  chrome::android::ChromeApplication::OpenClearBrowsingData(
-      web_ui()->GetWebContents());
-#else
-  // TODO(beng): This is an improper direct dependency on Browser. Route this
-  // through some sort of delegate.
-  Browser* browser = chrome::FindBrowserWithWebContents(
-      web_ui()->GetWebContents());
-  chrome::ShowClearBrowsingDataDialog(browser);
-#endif
-}
-
-void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) {
-  base::string16 url = ExtractStringValue(args);
-  Profile* profile = Profile::FromWebUI(web_ui());
-  BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
-  bookmarks::RemoveAllBookmarks(model, GURL(url));
-}
-
-// static
-void BrowsingHistoryHandler::MergeDuplicateResults(
-    std::vector<BrowsingHistoryHandler::HistoryEntry>* results) {
-  std::vector<BrowsingHistoryHandler::HistoryEntry> new_results;
-  // Pre-reserve the size of the new vector. Since we're working with pointers
-  // later on not doing this could lead to the vector being resized and to
-  // pointers to invalid locations.
-  new_results.reserve(results->size());
-  // Maps a URL to the most recent entry on a particular day.
-  std::map<GURL, BrowsingHistoryHandler::HistoryEntry*> current_day_entries;
-
-  // Keeps track of the day that |current_day_urls| is holding the URLs for,
-  // in order to handle removing per-day duplicates.
-  base::Time current_day_midnight;
-
-  std::sort(
-      results->begin(), results->end(), HistoryEntry::SortByTimeDescending);
-
-  for (std::vector<BrowsingHistoryHandler::HistoryEntry>::const_iterator it =
-           results->begin(); it != results->end(); ++it) {
-    // Reset the list of found URLs when a visit from a new day is encountered.
-    if (current_day_midnight != it->time.LocalMidnight()) {
-      current_day_entries.clear();
-      current_day_midnight = it->time.LocalMidnight();
-    }
-
-    // Keep this visit if it's the first visit to this URL on the current day.
-    if (current_day_entries.count(it->url) == 0) {
-      new_results.push_back(*it);
-      current_day_entries[it->url] = &new_results.back();
-    } else {
-      // Keep track of the timestamps of all visits to the URL on the same day.
-      BrowsingHistoryHandler::HistoryEntry* entry =
-          current_day_entries[it->url];
-      entry->all_timestamps.insert(
-          it->all_timestamps.begin(), it->all_timestamps.end());
-
-      if (entry->entry_type != it->entry_type) {
-        entry->entry_type =
-            BrowsingHistoryHandler::HistoryEntry::COMBINED_ENTRY;
-      }
-    }
-  }
-  results->swap(new_results);
-}
-
-void BrowsingHistoryHandler::ReturnResultsToFrontEnd() {
-  Profile* profile = Profile::FromWebUI(web_ui());
-  BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile);
-  SupervisedUserService* supervised_user_service = NULL;
-#if defined(ENABLE_SUPERVISED_USERS)
-  if (profile->IsSupervised())
-    supervised_user_service =
-        SupervisedUserServiceFactory::GetForProfile(profile);
-#endif
-  ProfileSyncService* sync_service =
-      ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
-
-  // Combine the local and remote results into |query_results_|, and remove
-  // any duplicates.
-  if (!web_history_query_results_.empty()) {
-    int local_result_count = query_results_.size();
-    query_results_.insert(query_results_.end(),
-                          web_history_query_results_.begin(),
-                          web_history_query_results_.end());
-    MergeDuplicateResults(&query_results_);
-
-    if (local_result_count) {
-      // In the best case, we expect that all local results are duplicated on
-      // the server. Keep track of how many are missing.
-      int missing_count = std::count_if(
-          query_results_.begin(), query_results_.end(), IsLocalOnlyResult);
-      UMA_HISTOGRAM_PERCENTAGE("WebHistory.LocalResultMissingOnServer",
-                               missing_count * 100.0 / local_result_count);
-    }
-  }
-
-  // Convert the result vector into a ListValue.
-  base::ListValue results_value;
-  for (std::vector<BrowsingHistoryHandler::HistoryEntry>::iterator it =
-           query_results_.begin(); it != query_results_.end(); ++it) {
-    scoped_ptr<base::Value> value(
-        it->ToValue(bookmark_model, supervised_user_service, sync_service));
-    results_value.Append(value.release());
-  }
-
-  web_ui()->CallJavascriptFunction(
-      "historyResult", results_info_value_, results_value);
-  results_info_value_.Clear();
-  query_results_.clear();
-  web_history_query_results_.clear();
-}
-
-void BrowsingHistoryHandler::QueryComplete(
-    const base::string16& search_text,
-    const history::QueryOptions& options,
-    history::QueryResults* results) {
-  DCHECK_EQ(0U, query_results_.size());
-  query_results_.reserve(results->size());
-  const std::string accept_languages = GetAcceptLanguages();
-
-  for (size_t i = 0; i < results->size(); ++i) {
-    history::URLResult const &page = (*results)[i];
-    // TODO(dubroy): Use sane time (crbug.com/146090) here when it's ready.
-    query_results_.push_back(
-        HistoryEntry(
-            HistoryEntry::LOCAL_ENTRY,
-            page.url(),
-            page.title(),
-            page.visit_time(),
-            std::string(),
-            !search_text.empty(),
-            page.snippet().text(),
-            page.blocked_visit(),
-            accept_languages));
-  }
-
-  // The items which are to be written into results_info_value_ are also
-  // described in chrome/browser/resources/history/history.js in @typedef for
-  // HistoryQuery. Please update it whenever you add or remove any keys in
-  // results_info_value_.
-  results_info_value_.SetString("term", search_text);
-  results_info_value_.SetBoolean("finished", results->reached_beginning());
-
-  // Add the specific dates that were searched to display them.
-  // TODO(sergiu): Put today if the start is in the future.
-  results_info_value_.SetString("queryStartTime",
-                                getRelativeDateLocalized(options.begin_time));
-  if (!options.end_time.is_null()) {
-    results_info_value_.SetString("queryEndTime",
-        getRelativeDateLocalized(options.end_time -
-                                 base::TimeDelta::FromDays(1)));
-  } else {
-    results_info_value_.SetString("queryEndTime",
-        getRelativeDateLocalized(base::Time::Now()));
-  }
-  if (!web_history_timer_.IsRunning())
-    ReturnResultsToFrontEnd();
-}
-
-void BrowsingHistoryHandler::WebHistoryQueryComplete(
-    const base::string16& search_text,
-    const history::QueryOptions& options,
-    base::TimeTicks start_time,
-    history::WebHistoryService::Request* request,
-    const base::DictionaryValue* results_value) {
-  base::TimeDelta delta = base::TimeTicks::Now() - start_time;
-  UMA_HISTOGRAM_TIMES("WebHistory.ResponseTime", delta);
-  const std::string accept_languages = GetAcceptLanguages();
-
-  // If the response came in too late, do nothing.
-  // TODO(dubroy): Maybe show a banner, and prompt the user to reload?
-  if (!web_history_timer_.IsRunning())
-    return;
-  web_history_timer_.Stop();
-
-  UMA_HISTOGRAM_ENUMERATION(
-      "WebHistory.QueryCompletion",
-      results_value ? WEB_HISTORY_QUERY_SUCCEEDED : WEB_HISTORY_QUERY_FAILED,
-      NUM_WEB_HISTORY_QUERY_BUCKETS);
-
-  DCHECK_EQ(0U, web_history_query_results_.size());
-  const base::ListValue* events = NULL;
-  if (results_value && results_value->GetList("event", &events)) {
-    web_history_query_results_.reserve(events->GetSize());
-    for (unsigned int i = 0; i < events->GetSize(); ++i) {
-      const base::DictionaryValue* event = NULL;
-      const base::DictionaryValue* result = NULL;
-      const base::ListValue* results = NULL;
-      const base::ListValue* ids = NULL;
-      base::string16 url;
-      base::string16 title;
-      base::Time visit_time;
-
-      if (!(events->GetDictionary(i, &event) &&
-          event->GetList("result", &results) &&
-          results->GetDictionary(0, &result) &&
-          result->GetString("url", &url) &&
-          result->GetList("id", &ids) &&
-          ids->GetSize() > 0)) {
-        LOG(WARNING) << "Improperly formed JSON response from history server.";
-        continue;
-      }
-
-      // Ignore any URLs that should not be shown in the history page.
-      GURL gurl(url);
-      if (!CanAddURLToHistory(gurl))
-        continue;
-
-      // Title is optional, so the return value is ignored here.
-      result->GetString("title", &title);
-
-      // Extract the timestamps of all the visits to this URL.
-      // They are referred to as "IDs" by the server.
-      for (int j = 0; j < static_cast<int>(ids->GetSize()); ++j) {
-        const base::DictionaryValue* id = NULL;
-        std::string timestamp_string;
-        int64 timestamp_usec = 0;
-
-        if (!ids->GetDictionary(j, &id) ||
-            !id->GetString("timestamp_usec", &timestamp_string) ||
-            !base::StringToInt64(timestamp_string, &timestamp_usec)) {
-          NOTREACHED() << "Unable to extract timestamp.";
-          continue;
-        }
-        // The timestamp on the server is a Unix time.
-        base::Time time = base::Time::UnixEpoch() +
-            base::TimeDelta::FromMicroseconds(timestamp_usec);
-
-        // Get the ID of the client that this visit came from.
-        std::string client_id;
-        id->GetString("client_id", &client_id);
-
-        web_history_query_results_.push_back(
-            HistoryEntry(
-                HistoryEntry::REMOTE_ENTRY,
-                gurl,
-                title,
-                time,
-                client_id,
-                !search_text.empty(),
-                base::string16(),
-                /* blocked_visit */ false,
-                accept_languages));
-      }
-    }
-  }
-  results_info_value_.SetBoolean("hasSyncedResults", results_value != NULL);
-  if (!query_task_tracker_.HasTrackedTasks())
-    ReturnResultsToFrontEnd();
-}
-
-void BrowsingHistoryHandler::RemoveComplete() {
-  urls_to_be_deleted_.clear();
-
-  // Notify the page that the deletion request is complete, but only if a web
-  // history delete request is not still pending.
-  if (!has_pending_delete_request_)
-    web_ui()->CallJavascriptFunction("deleteComplete");
-}
-
-void BrowsingHistoryHandler::RemoveWebHistoryComplete(bool success) {
-  has_pending_delete_request_ = false;
-  // TODO(dubroy): Should we handle failure somehow? Delete directives will
-  // ensure that the visits are eventually deleted, so maybe it's not necessary.
-  if (!delete_task_tracker_.HasTrackedTasks())
-    RemoveComplete();
-}
-
-void BrowsingHistoryHandler::SetQueryTimeInWeeks(
-    int offset, history::QueryOptions* options) {
-  // LocalMidnight returns the beginning of the current day so get the
-  // beginning of the next one.
-  base::Time midnight = base::Time::Now().LocalMidnight() +
-                              base::TimeDelta::FromDays(1);
-  options->end_time = midnight -
-      base::TimeDelta::FromDays(7 * offset);
-  options->begin_time = midnight -
-      base::TimeDelta::FromDays(7 * (offset + 1));
-}
-
-void BrowsingHistoryHandler::SetQueryTimeInMonths(
-    int offset, history::QueryOptions* options) {
-  // Configure the begin point of the search to the start of the
-  // current month.
-  base::Time::Exploded exploded;
-  base::Time::Now().LocalMidnight().LocalExplode(&exploded);
-  exploded.day_of_month = 1;
-
-  if (offset == 0) {
-    options->begin_time = base::Time::FromLocalExploded(exploded);
-
-    // Set the end time of this first search to null (which will
-    // show results from the future, should the user's clock have
-    // been set incorrectly).
-    options->end_time = base::Time();
-  } else {
-    // Go back |offset| months in the past. The end time is not inclusive, so
-    // use the first day of the |offset| - 1 and |offset| months (e.g. for
-    // the last month, |offset| = 1, use the first days of the last month and
-    // the current month.
-    exploded.month -= offset - 1;
-    // Set the correct year.
-    normalizeMonths(&exploded);
-    options->end_time = base::Time::FromLocalExploded(exploded);
-
-    exploded.month -= 1;
-    // Set the correct year
-    normalizeMonths(&exploded);
-    options->begin_time = base::Time::FromLocalExploded(exploded);
-  }
-}
-
-// Helper function for Observe that determines if there are any differences
-// between the URLs noticed for deletion and the ones we are expecting.
-static bool DeletionsDiffer(const history::URLRows& deleted_rows,
-                            const std::set<GURL>& urls_to_be_deleted) {
-  if (deleted_rows.size() != urls_to_be_deleted.size())
-    return true;
-  for (const auto& i : deleted_rows) {
-    if (urls_to_be_deleted.find(i.url()) == urls_to_be_deleted.end())
-      return true;
-  }
-  return false;
-}
-
-std::string BrowsingHistoryHandler::GetAcceptLanguages() const {
-  Profile* profile = Profile::FromWebUI(web_ui());
-  return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
-}
-
-void BrowsingHistoryHandler::OnURLsDeleted(
-    history::HistoryService* history_service,
-    bool all_history,
-    bool expired,
-    const history::URLRows& deleted_rows,
-    const std::set<GURL>& favicon_urls) {
-  if (all_history || DeletionsDiffer(deleted_rows, urls_to_be_deleted_))
-    web_ui()->CallJavascriptFunction("historyDeleted");
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// HistoryUI
-//
-////////////////////////////////////////////////////////////////////////////////
-
 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
   web_ui->AddMessageHandler(new BrowsingHistoryHandler());
   web_ui->AddMessageHandler(new MetricsHandler());
diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h
index 3d5dcb2..10f2554 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -5,218 +5,13 @@
 #ifndef CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_
 #define CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_
 
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/scoped_observer.h"
-#include "base/strings/string16.h"
-#include "base/task/cancelable_task_tracker.h"
-#include "base/timer/timer.h"
-#include "base/values.h"
-#include "components/history/core/browser/history_service_observer.h"
-#include "components/history/core/browser/web_history_service.h"
 #include "content/public/browser/web_ui_controller.h"
-#include "content/public/browser/web_ui_message_handler.h"
 #include "ui/base/layout.h"
 
-class ProfileSyncService;
-class SupervisedUserService;
-
-namespace bookmarks {
-class BookmarkModel;
+namespace base {
+class RefCountedMemory;
 }
 
-namespace history {
-class HistoryService;
-}
-
-// The handler for Javascript messages related to the "history" view.
-class BrowsingHistoryHandler : public content::WebUIMessageHandler,
-                               public history::HistoryServiceObserver {
- public:
-  // Represents a history entry to be shown to the user, representing either
-  // a local or remote visit. A single entry can represent multiple visits,
-  // since only the most recent visit on a particular day is shown.
-  struct HistoryEntry {
-    // Values indicating whether an entry represents only local visits, only
-    // remote visits, or a mixture of both.
-    enum EntryType {
-      EMPTY_ENTRY = 0,
-      LOCAL_ENTRY,
-      REMOTE_ENTRY,
-      COMBINED_ENTRY
-    };
-
-    HistoryEntry(EntryType type, const GURL& url, const base::string16& title,
-                 base::Time time, const std::string& client_id,
-                 bool is_search_result, const base::string16& snippet,
-                 bool blocked_visit, const std::string& accept_languages);
-    HistoryEntry();
-    virtual ~HistoryEntry();
-
-    // Formats this entry's URL and title and adds them to |result|.
-    void SetUrlAndTitle(base::DictionaryValue* result) const;
-
-    // Converts the entry to a DictionaryValue to be owned by the caller.
-    scoped_ptr<base::DictionaryValue> ToValue(
-        bookmarks::BookmarkModel* bookmark_model,
-        SupervisedUserService* supervised_user_service,
-        const ProfileSyncService* sync_service) const;
-
-    // Comparison function for sorting HistoryEntries from newest to oldest.
-    static bool SortByTimeDescending(
-        const HistoryEntry& entry1, const HistoryEntry& entry2);
-
-    // The type of visits this entry represents: local, remote, or both.
-    EntryType entry_type;
-
-    GURL url;
-    base::string16 title;  // Title of the entry. May be empty.
-
-    // The time of the entry. Usually this will be the time of the most recent
-    // visit to |url| on a particular day as defined in the local timezone.
-    base::Time time;
-
-    // The sync ID of the client on which the most recent visit occurred.
-    std::string client_id;
-
-    // Timestamps of all local or remote visits the same URL on the same day.
-    std::set<int64> all_timestamps;
-
-    // If true, this entry is a search result.
-    bool is_search_result;
-
-    // The entry's search snippet, if this entry is a search result.
-    base::string16 snippet;
-
-    // Whether this entry was blocked when it was attempted.
-    bool blocked_visit;
-
-    // kAcceptLanguages pref value.
-    std::string accept_languages;
-  };
-
-  BrowsingHistoryHandler();
-  ~BrowsingHistoryHandler() override;
-
-  // WebUIMessageHandler implementation.
-  void RegisterMessages() override;
-
-  // Handler for the "queryHistory" message.
-  void HandleQueryHistory(const base::ListValue* args);
-
-  // Handler for the "removeVisits" message.
-  void HandleRemoveVisits(const base::ListValue* args);
-
-  // Handler for "clearBrowsingData" message.
-  void HandleClearBrowsingData(const base::ListValue* args);
-
-  // Handler for "removeBookmark" message.
-  void HandleRemoveBookmark(const base::ListValue* args);
-
-  // Merges duplicate entries from the query results, only retaining the most
-  // recent visit to a URL on a particular day. That visit contains the
-  // timestamps of the other visits.
-  static void MergeDuplicateResults(
-      std::vector<BrowsingHistoryHandler::HistoryEntry>* results);
-
- private:
-  // The range for which to return results:
-  // - ALLTIME: allows access to all the results in a paginated way.
-  // - WEEK: the last 7 days.
-  // - MONTH: the last calendar month.
-  enum Range {
-    ALL_TIME = 0,
-    WEEK = 1,
-    MONTH = 2
-  };
-
-  // Core implementation of history querying.
-  void QueryHistory(const base::string16& search_text,
-                    const history::QueryOptions& options);
-
-  // Combines the query results from the local history database and the history
-  // server, and sends the combined results to the front end.
-  void ReturnResultsToFrontEnd();
-
-  // Callback from |web_history_timer_| when a response from web history has
-  // not been received in time.
-  void WebHistoryTimeout();
-
-  // Callback from the history system when a history query has completed.
-  void QueryComplete(const base::string16& search_text,
-                     const history::QueryOptions& options,
-                     history::QueryResults* results);
-
-  // Callback from the WebHistoryService when a query has completed.
-  void WebHistoryQueryComplete(const base::string16& search_text,
-                               const history::QueryOptions& options,
-                               base::TimeTicks start_time,
-                               history::WebHistoryService::Request* request,
-                               const base::DictionaryValue* results_value);
-
-  // Callback from the history system when visits were deleted.
-  void RemoveComplete();
-
-  // Callback from history server when visits were deleted.
-  void RemoveWebHistoryComplete(bool success);
-
-  bool ExtractIntegerValueAtIndex(
-      const base::ListValue* value, int index, int* out_int);
-
-  // Sets the query options for a week-wide query, |offset| weeks ago.
-  void SetQueryTimeInWeeks(int offset, history::QueryOptions* options);
-
-  // Sets the query options for a monthly query, |offset| months ago.
-  void SetQueryTimeInMonths(int offset, history::QueryOptions* options);
-
-  // kAcceptLanguages pref value.
-  std::string GetAcceptLanguages() const;
-
-  // history::HistoryServiceObserver:
-  void OnURLsDeleted(history::HistoryService* history_service,
-                     bool all_history,
-                     bool expired,
-                     const history::URLRows& deleted_rows,
-                     const std::set<GURL>& favicon_urls) override;
-
-  // Tracker for search requests to the history service.
-  base::CancelableTaskTracker query_task_tracker_;
-
-  // The currently-executing request for synced history results.
-  // Deleting the request will cancel it.
-  scoped_ptr<history::WebHistoryService::Request> web_history_request_;
-
-  // True if there is a pending delete requests to the history service.
-  bool has_pending_delete_request_;
-
-  // Tracker for delete requests to the history service.
-  base::CancelableTaskTracker delete_task_tracker_;
-
-  // The list of URLs that are in the process of being deleted.
-  std::set<GURL> urls_to_be_deleted_;
-
-  // The info value that is returned to the front end with the query results.
-  base::DictionaryValue results_info_value_;
-
-  // The list of query results received from the history service.
-  std::vector<HistoryEntry> query_results_;
-
-  // The list of query results received from the history server.
-  std::vector<HistoryEntry> web_history_query_results_;
-
-  // Timer used to implement a timeout on a Web History response.
-  base::OneShotTimer web_history_timer_;
-
-  ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
-      history_service_observer_;
-
-  base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
-
-  DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
-};
-
 class HistoryUI : public content::WebUIController {
  public:
   explicit HistoryUI(content::WebUI* web_ui);
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index a67359c0..a92b49b6 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -203,6 +203,8 @@
       'browser/ui/website_settings/website_settings_ui.h',
       'browser/ui/webui/about_ui.cc',
       'browser/ui/webui/about_ui.h',
+      'browser/ui/webui/browsing_history_handler.cc',
+      'browser/ui/webui/browsing_history_handler.h',
       'browser/ui/webui/chrome_web_ui_controller_factory.cc',
       'browser/ui/webui/chrome_web_ui_controller_factory.h',
       'browser/ui/webui/chromeos/bluetooth_pairing_ui.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 09073989..0dfbb1fd 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -462,8 +462,8 @@
       'browser/ui/tests/ui_gfx_image_unittest.cc',
       'browser/ui/tests/ui_gfx_image_unittest.mm',
       'browser/ui/website_settings/website_settings_unittest.cc',
+      'browser/ui/webui/browsing_history_handler_unittest.cc',
       'browser/ui/webui/fileicon_source_unittest.cc',
-      'browser/ui/webui/history_ui_unittest.cc',
       'browser/ui/webui/log_web_ui_url_unittest.cc',
       'browser/update_client/chrome_update_query_params_delegate_unittest.cc',
       'common/chrome_content_client_unittest.cc',
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index 06228ad..dae948b 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -132,7 +132,6 @@
 AutofillAgent::ShowSuggestionsOptions::ShowSuggestionsOptions()
     : autofill_on_empty_values(false),
       requires_caret_at_end(false),
-      datalist_only(false),
       show_full_suggestion_list(false),
       show_password_suggestions_only(false) {
 }
@@ -460,7 +459,6 @@
 void AutofillAgent::openTextDataListChooser(const WebInputElement& element) {
   ShowSuggestionsOptions options;
   options.autofill_on_empty_values = true;
-  options.datalist_only = true;
   ShowSuggestions(element, options);
 }
 
@@ -647,14 +645,14 @@
                                     const ShowSuggestionsOptions& options) {
   if (!element.isEnabled() || element.isReadOnly())
     return;
-  if (!options.datalist_only && !element.suggestedValue().isEmpty())
+  if (!element.suggestedValue().isEmpty())
     return;
 
   const WebInputElement* input_element = toWebInputElement(&element);
   if (input_element) {
     if (!input_element->isTextField())
       return;
-    if (!options.datalist_only && !input_element->suggestedValue().isEmpty())
+    if (!input_element->suggestedValue().isEmpty())
       return;
   } else {
     DCHECK(form_util::IsTextAreaElement(element));
@@ -665,12 +663,11 @@
   // Don't attempt to autofill with values that are too large or if filling
   // criteria are not met.
   WebString value = element.editingValue();
-  if (!options.datalist_only &&
-      (value.length() > kMaxDataLength ||
-       (!options.autofill_on_empty_values && value.isEmpty()) ||
-       (options.requires_caret_at_end &&
-        (element.selectionStart() != element.selectionEnd() ||
-         element.selectionEnd() != static_cast<int>(value.length()))))) {
+  if (value.length() > kMaxDataLength ||
+      (!options.autofill_on_empty_values && value.isEmpty()) ||
+      (options.requires_caret_at_end &&
+       (element.selectionStart() != element.selectionEnd() ||
+        element.selectionEnd() != static_cast<int>(value.length())))) {
     // Any popup currently showing is obsolete.
     HidePopup();
     return;
@@ -696,12 +693,11 @@
   if (input_element && input_element->isPasswordField())
     return;
 
-  QueryAutofillSuggestions(element, options.datalist_only);
+  QueryAutofillSuggestions(element);
 }
 
 void AutofillAgent::QueryAutofillSuggestions(
-    const WebFormControlElement& element,
-    bool datalist_only) {
+    const WebFormControlElement& element) {
   if (!element.document().frame())
     return;
 
@@ -718,8 +714,6 @@
     // at providing suggestions.
     WebFormControlElementToFormField(element, form_util::EXTRACT_VALUE, &field);
   }
-  if (datalist_only)
-    field.should_autocomplete = false;
 
   gfx::RectF bounding_box_scaled = form_util::GetScaledBoundingBox(
       render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(),
diff --git a/components/autofill/content/renderer/autofill_agent.h b/components/autofill/content/renderer/autofill_agent.h
index ab8653b..6072eda 100644
--- a/components/autofill/content/renderer/autofill_agent.h
+++ b/components/autofill/content/renderer/autofill_agent.h
@@ -184,8 +184,7 @@
 
   // Queries the browser for Autocomplete and Autofill suggestions for the given
   // |element|.
-  void QueryAutofillSuggestions(const blink::WebFormControlElement& element,
-                                bool datalist_only);
+  void QueryAutofillSuggestions(const blink::WebFormControlElement& element);
 
   // Sets the element value to reflect the selected |suggested_value|.
   void AcceptDataListSuggestion(const base::string16& suggested_value);
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 289aaf4..0353523a 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -360,13 +360,6 @@
       'metrics/stability_metrics_helper_unittest.cc',
       'metrics/ui/screen_info_metrics_provider_unittest.cc',
     ],
-    'metrics_leak_detector_unittest_sources': [
-      'metrics/leak_detector/call_stack_manager_unittest.cc',
-      'metrics/leak_detector/call_stack_table_unittest.cc',
-      'metrics/leak_detector/leak_analyzer_unittest.cc',
-      'metrics/leak_detector/leak_detector_impl_unittest.cc',
-      'metrics/leak_detector/ranked_list_unittest.cc',
-    ],
     'mime_util_unittest_sources': [
       'mime_util/mime_util_unittest.cc',
     ],
@@ -1379,7 +1372,6 @@
             'wifi_sync/wifi_credential_unittest.cc',
             'wifi_sync/wifi_security_class_chromeos_unittest.cc',
             'wifi_sync/wifi_security_class_unittest.cc',
-            '<@(metrics_leak_detector_unittest_sources)',
             '<@(ownership_unittest_sources)',
           ],
           'sources!': [
@@ -1388,7 +1380,6 @@
           ],
           'dependencies': [
             '../chromeos/chromeos.gyp:chromeos_test_support',
-            'components.gyp:metrics_leak_detector',
             'components.gyp:ownership',
             'components.gyp:pairing',
             'components.gyp:user_manager_test_support',
diff --git a/components/metrics.gypi b/components/metrics.gypi
index 99db0491..36e8e57 100644
--- a/components/metrics.gypi
+++ b/components/metrics.gypi
@@ -104,29 +104,6 @@
       ],
     },
     {
-      'target_name': 'metrics_leak_detector',
-      'type': 'static_library',
-      'dependencies': [
-        '../base/base.gyp:base',
-      ],
-      'sources': [
-        'metrics/leak_detector/call_stack_manager.cc',
-        'metrics/leak_detector/call_stack_manager.h',
-        'metrics/leak_detector/call_stack_table.cc',
-        'metrics/leak_detector/call_stack_table.h',
-        'metrics/leak_detector/custom_allocator.cc',
-        'metrics/leak_detector/custom_allocator.h',
-        'metrics/leak_detector/leak_analyzer.cc',
-        'metrics/leak_detector/leak_analyzer.h',
-        'metrics/leak_detector/leak_detector_impl.cc',
-        'metrics/leak_detector/leak_detector_impl.h',
-        'metrics/leak_detector/leak_detector_value_type.cc',
-        'metrics/leak_detector/leak_detector_value_type.h',
-        'metrics/leak_detector/ranked_list.cc',
-        'metrics/leak_detector/ranked_list.h',
-      ],
-    },
-    {
       # GN version: //components/metrics:net
       'target_name': 'metrics_net',
       'type': 'static_library',
diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn
index f711a59b..836c243 100644
--- a/components/metrics/BUILD.gn
+++ b/components/metrics/BUILD.gn
@@ -111,30 +111,6 @@
   }
 }
 
-# GYP version: components/metrics.gypi:metrics_leak_detector
-static_library("leak_detector") {
-  sources = [
-    "leak_detector/call_stack_manager.cc",
-    "leak_detector/call_stack_manager.h",
-    "leak_detector/call_stack_table.cc",
-    "leak_detector/call_stack_table.h",
-    "leak_detector/custom_allocator.cc",
-    "leak_detector/custom_allocator.h",
-    "leak_detector/leak_analyzer.cc",
-    "leak_detector/leak_analyzer.h",
-    "leak_detector/leak_detector_impl.cc",
-    "leak_detector/leak_detector_impl.h",
-    "leak_detector/leak_detector_value_type.cc",
-    "leak_detector/leak_detector_value_type.h",
-    "leak_detector/ranked_list.cc",
-    "leak_detector/ranked_list.h",
-  ]
-
-  deps = [
-    "//base",
-  ]
-}
-
 # GYP version: components/metrics.gypi:metrics_net
 static_library("net") {
   sources = [
@@ -265,22 +241,6 @@
   }
 }
 
-source_set("leak_detector_unit_tests") {
-  testonly = true
-  sources = [
-    "leak_detector/call_stack_manager_unittest.cc",
-    "leak_detector/call_stack_table_unittest.cc",
-    "leak_detector/leak_analyzer_unittest.cc",
-    "leak_detector/leak_detector_impl_unittest.cc",
-    "leak_detector/ranked_list_unittest.cc",
-  ]
-
-  deps = [
-    ":leak_detector",
-    "//testing/gtest",
-  ]
-}
-
 source_set("unit_tests") {
   testonly = true
   sources = [
@@ -320,9 +280,5 @@
     sources += [ "serialization/serialization_utils_unittest.cc" ]
     deps += [ ":serialization" ]
   }
-
-  if (is_chromeos) {
-    deps += [ ":leak_detector_unit_tests" ]
-  }
 }
 # TODO(GYP): metrics_chromeos
diff --git a/components/metrics/leak_detector/OWNERS b/components/metrics/leak_detector/OWNERS
deleted file mode 100644
index d8bfc45..0000000
--- a/components/metrics/leak_detector/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-sque@chromium.org
-wfh@chromium.org
diff --git a/components/metrics/leak_detector/call_stack_manager.cc b/components/metrics/leak_detector/call_stack_manager.cc
deleted file mode 100644
index de9fcd8..0000000
--- a/components/metrics/leak_detector/call_stack_manager.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/call_stack_manager.h"
-
-#include <algorithm>  // For std::copy.
-#include <new>
-
-#include "base/hash.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-
-namespace metrics {
-namespace leak_detector {
-
-CallStackManager::CallStackManager() {}
-
-CallStackManager::~CallStackManager() {
-  for (CallStack* call_stack : call_stacks_) {
-    CustomAllocator::Free(call_stack->stack,
-                          call_stack->depth * sizeof(*call_stack->stack));
-    call_stack->stack = nullptr;
-    call_stack->depth = 0;
-
-    CustomAllocator::Free(call_stack, sizeof(CallStack));
-  }
-  call_stacks_.clear();
-}
-
-const CallStack* CallStackManager::GetCallStack(size_t depth,
-                                                const void* const stack[]) {
-  // Temporarily create a call stack object for lookup in |call_stacks_|.
-  CallStack temp;
-  temp.depth = depth;
-  temp.stack = const_cast<const void**>(stack);
-  // This is the only place where the call stack's hash is computed. This value
-  // can be reused in the created object to avoid further hash computation.
-  temp.hash =
-      base::Hash(reinterpret_cast<const char*>(stack), sizeof(*stack) * depth);
-
-  auto iter = call_stacks_.find(&temp);
-  if (iter != call_stacks_.end())
-    return *iter;
-
-  // Since |call_stacks_| stores CallStack pointers rather than actual objects,
-  // create new call objects manually here.
-  CallStack* call_stack =
-      new (CustomAllocator::Allocate(sizeof(CallStack))) CallStack;
-  call_stack->depth = depth;
-  call_stack->hash = temp.hash;  // Don't run the hash function again.
-  call_stack->stack = reinterpret_cast<const void**>(
-      CustomAllocator::Allocate(sizeof(*stack) * depth));
-  std::copy(stack, stack + depth, call_stack->stack);
-
-  call_stacks_.insert(call_stack);
-  return call_stack;
-}
-
-bool CallStackManager::CallStackPointerEqual::operator()(
-    const CallStack* c1,
-    const CallStack* c2) const {
-  return c1->depth == c2->depth && c1->hash == c2->hash &&
-         std::equal(c1->stack, c1->stack + c1->depth, c2->stack);
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/call_stack_manager.h b/components/metrics/leak_detector/call_stack_manager.h
deleted file mode 100644
index 1ec6b9d..0000000
--- a/components/metrics/leak_detector/call_stack_manager.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_MANAGER_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_MANAGER_H_
-
-#include <stdint.h>
-
-#include "base/containers/hash_tables.h"
-#include "base/macros.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/stl_allocator.h"
-
-// Summary of structures:
-//
-// struct CallStack:
-//   Represents a unique call stack, defined by its raw call stack (array of
-//   pointers), and hash value. All CallStack objects are owned by class
-//   CallStackManager. Other classes may hold pointers to them but should not
-//   attempt to create or modify any CallStack objects.
-//
-// class CallStackManager:
-//   Creates CallStack objects to represent unique call stacks. Owns all
-//   CallStack objects that it creates, storing them internally.
-//
-//   Returns the call stacks as const pointers because no caller should take
-//   ownership of them and modify or delete them. The lifetime of all CallStack
-//   objects is limited to that of the CallStackManager object that created
-//   them. When the CallStackManager is destroyed, the CallStack objects will be
-//   invalidated. Hence the caller should make sure that it does not use
-//   CallStack objects beyond the lifetime of the CallStackManager that created
-//   them.
-
-namespace metrics {
-namespace leak_detector {
-
-// Struct to represent a call stack.
-struct CallStack {
-  // Call stack as an array of pointers, |stack|. The array length is stored in
-  // |depth|. There is no null terminator.
-  const void** stack;
-  size_t depth;
-
-  // Hash of call stack. It is cached here so that it doesn not have to be
-  // recomputed each time.
-  size_t hash;
-};
-
-// Maintains and owns all unique call stack objects.
-// Not thread-safe.
-class CallStackManager {
- public:
-  CallStackManager();
-  ~CallStackManager();
-
-  // Returns a CallStack object for a given raw call stack. The first time a
-  // particular raw call stack is passed into this function, it will create a
-  // new CallStack object to hold the raw call stack data, and then return it.
-  // The CallStack object is stored internally.
-  //
-  // On subsequent calls with the same raw call stack, this function will return
-  // the previously created CallStack object.
-  const CallStack* GetCallStack(size_t depth, const void* const stack[]);
-
-  size_t size() const { return call_stacks_.size(); }
-
- private:
-  // Allocator class for unique call stacks.
-  using CallStackPointerAllocator = STLAllocator<CallStack*, CustomAllocator>;
-
-  // Hash operator for call stack object given as a pointer.
-  // Does not actually compute the hash. Instead, returns the already computed
-  // hash value stored in a CallStack object.
-  struct CallStackPointerStoredHash {
-    size_t operator()(const CallStack* call_stack) const {
-      return call_stack->hash;
-    }
-  };
-
-  // Equality comparator for call stack objects given as pointers. Compares
-  // their stack trace contents.
-  struct CallStackPointerEqual {
-    bool operator()(const CallStack* c1, const CallStack* c2) const;
-  };
-
-  // Holds all call stack objects. Each object is allocated elsewhere and stored
-  // as a pointer because the container may rearrange itself internally.
-  base::hash_set<CallStack*,
-                 CallStackPointerStoredHash,
-                 CallStackPointerEqual,
-                 CallStackPointerAllocator> call_stacks_;
-
-  DISALLOW_COPY_AND_ASSIGN(CallStackManager);
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_MANAGER_H_
diff --git a/components/metrics/leak_detector/call_stack_manager_unittest.cc b/components/metrics/leak_detector/call_stack_manager_unittest.cc
deleted file mode 100644
index 8b49006..0000000
--- a/components/metrics/leak_detector/call_stack_manager_unittest.cc
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/call_stack_manager.h"
-
-#include <stdint.h>
-
-#include <algorithm>
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Some test call stacks. The addresses are 64-bit but they should automatically
-// be truncated to 32 bits on a 32-bit machine.
-const void* kRawStack0[] = {
-    reinterpret_cast<const void*>(0x8899aabbccddeeff),
-    reinterpret_cast<const void*>(0x0000112233445566),
-    reinterpret_cast<const void*>(0x5566778899aabbcc),
-    reinterpret_cast<const void*>(0x9988776655443322),
-};
-// This is similar to kRawStack0, differing only in one address by 1. It should
-// still produce a distinct CallStack object and hash.
-const void* kRawStack1[] = {
-    kRawStack0[0], kRawStack0[1],
-    reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(kRawStack0[2]) +
-                                  1),
-    kRawStack0[3],
-};
-const void* kRawStack2[] = {
-    reinterpret_cast<const void*>(0x900df00dcab58888),
-    reinterpret_cast<const void*>(0x00001337cafedeed),
-    reinterpret_cast<const void*>(0x0000deafbabe1234),
-};
-const void* kRawStack3[] = {
-    reinterpret_cast<const void*>(0x0000000012345678),
-    reinterpret_cast<const void*>(0x00000000abcdef01),
-    reinterpret_cast<const void*>(0x00000000fdecab98),
-    reinterpret_cast<const void*>(0x0000deadbeef0001),
-    reinterpret_cast<const void*>(0x0000900ddeed0002),
-    reinterpret_cast<const void*>(0x0000f00dcafe0003),
-    reinterpret_cast<const void*>(0x0000f00d900d0004),
-    reinterpret_cast<const void*>(0xdeedcafebabe0005),
-};
-
-// Creates a copy of a call stack as a scoped_ptr to a raw stack. The depth is
-// the same as the original stack, but it is not stored in the result.
-scoped_ptr<const void* []> CopyStack(const CallStack* stack) {
-  scoped_ptr<const void* []> stack_copy(new const void*[stack->depth]);
-  std::copy(stack->stack, stack->stack + stack->depth, stack_copy.get());
-  return stack_copy.Pass();
-}
-
-}  // namespace
-
-class CallStackManagerTest : public ::testing::Test {
- public:
-  CallStackManagerTest() {}
-
-  void SetUp() override { CustomAllocator::Initialize(); }
-  void TearDown() override { EXPECT_TRUE(CustomAllocator::Shutdown()); }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(CallStackManagerTest);
-};
-
-TEST_F(CallStackManagerTest, NewStacks) {
-  CallStackManager manager;
-  EXPECT_EQ(0U, manager.size());
-
-  // Request some new stacks and make sure their creation is reflected in the
-  // size of |manager|.
-  const CallStack* stack0 =
-      manager.GetCallStack(arraysize(kRawStack0), kRawStack0);
-  EXPECT_EQ(arraysize(kRawStack0), stack0->depth);
-  EXPECT_EQ(1U, manager.size());
-
-  const CallStack* stack1 =
-      manager.GetCallStack(arraysize(kRawStack1), kRawStack1);
-  EXPECT_EQ(arraysize(kRawStack1), stack1->depth);
-  EXPECT_EQ(2U, manager.size());
-
-  const CallStack* stack2 =
-      manager.GetCallStack(arraysize(kRawStack2), kRawStack2);
-  EXPECT_EQ(arraysize(kRawStack2), stack2->depth);
-  EXPECT_EQ(3U, manager.size());
-
-  const CallStack* stack3 =
-      manager.GetCallStack(arraysize(kRawStack3), kRawStack3);
-  EXPECT_EQ(arraysize(kRawStack3), stack3->depth);
-  EXPECT_EQ(4U, manager.size());
-
-  // Call stack objects should be unique.
-  EXPECT_NE(stack0, stack1);
-  EXPECT_NE(stack0, stack2);
-  EXPECT_NE(stack0, stack3);
-  EXPECT_NE(stack1, stack2);
-  EXPECT_NE(stack1, stack3);
-  EXPECT_NE(stack2, stack3);
-}
-
-TEST_F(CallStackManagerTest, Hashes) {
-  CallStackManager manager;
-
-  const CallStack* stack0 =
-      manager.GetCallStack(arraysize(kRawStack0), kRawStack0);
-  const CallStack* stack1 =
-      manager.GetCallStack(arraysize(kRawStack1), kRawStack1);
-  const CallStack* stack2 =
-      manager.GetCallStack(arraysize(kRawStack2), kRawStack2);
-  const CallStack* stack3 =
-      manager.GetCallStack(arraysize(kRawStack3), kRawStack3);
-
-  // Hash values should be unique. This test is not designed to make sure the
-  // hash function is generating unique hashes, but that CallStackManager is
-  // properly storing the hashes in CallStack structs.
-  EXPECT_NE(stack0->hash, stack1->hash);
-  EXPECT_NE(stack0->hash, stack2->hash);
-  EXPECT_NE(stack0->hash, stack3->hash);
-  EXPECT_NE(stack1->hash, stack2->hash);
-  EXPECT_NE(stack1->hash, stack3->hash);
-  EXPECT_NE(stack2->hash, stack3->hash);
-}
-
-TEST_F(CallStackManagerTest, MultipleManagersHashes) {
-  CallStackManager manager1;
-  const CallStack* stack10 =
-      manager1.GetCallStack(arraysize(kRawStack0), kRawStack0);
-  const CallStack* stack11 =
-      manager1.GetCallStack(arraysize(kRawStack1), kRawStack1);
-  const CallStack* stack12 =
-      manager1.GetCallStack(arraysize(kRawStack2), kRawStack2);
-  const CallStack* stack13 =
-      manager1.GetCallStack(arraysize(kRawStack3), kRawStack3);
-
-  CallStackManager manager2;
-  const CallStack* stack20 =
-      manager2.GetCallStack(arraysize(kRawStack0), kRawStack0);
-  const CallStack* stack21 =
-      manager2.GetCallStack(arraysize(kRawStack1), kRawStack1);
-  const CallStack* stack22 =
-      manager2.GetCallStack(arraysize(kRawStack2), kRawStack2);
-  const CallStack* stack23 =
-      manager2.GetCallStack(arraysize(kRawStack3), kRawStack3);
-
-  // Different CallStackManagers should still generate the same hashes.
-  EXPECT_EQ(stack10->hash, stack20->hash);
-  EXPECT_EQ(stack11->hash, stack21->hash);
-  EXPECT_EQ(stack12->hash, stack22->hash);
-  EXPECT_EQ(stack13->hash, stack23->hash);
-}
-
-TEST_F(CallStackManagerTest, HashWithReducedDepth) {
-  CallStackManager manager;
-  const CallStack* stack =
-      manager.GetCallStack(arraysize(kRawStack3), kRawStack3);
-
-  // Hash function should only operate on the first |CallStack::depth| elements
-  // of CallStack::stack. To test this, reduce the depth value of one of the
-  // stacks and make sure the hash changes.
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 1, stack->stack)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 2, stack->stack)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 3, stack->stack)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 4, stack->stack)->hash);
-
-  // Also try subsets of the stack that don't start from the beginning.
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 1, stack->stack + 1)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 2, stack->stack + 2)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 3, stack->stack + 3)->hash);
-  EXPECT_NE(stack->hash,
-            manager.GetCallStack(stack->depth - 4, stack->stack + 4)->hash);
-}
-
-TEST_F(CallStackManagerTest, DuplicateStacks) {
-  CallStackManager manager;
-  EXPECT_EQ(0U, manager.size());
-
-  // Calling manager.GetCallStack() multiple times with the same raw stack
-  // arguments will not result in creation of new call stack objects after the
-  // first call. Instead, the previously created object will be returned, and
-  // the size of |manager| will remain unchanged.
-  //
-  // Thus a call to GetCallStack() will always return the same result, given the
-  // same inputs.
-
-  // Add stack0.
-  const CallStack* stack0 =
-      manager.GetCallStack(arraysize(kRawStack0), kRawStack0);
-
-  scoped_ptr<const void* []> rawstack0_duplicate0 = CopyStack(stack0);
-  const CallStack* stack0_duplicate0 =
-      manager.GetCallStack(arraysize(kRawStack0), rawstack0_duplicate0.get());
-  EXPECT_EQ(1U, manager.size());
-  EXPECT_EQ(stack0, stack0_duplicate0);
-
-  // Add stack1.
-  const CallStack* stack1 =
-      manager.GetCallStack(arraysize(kRawStack1), kRawStack1);
-  EXPECT_EQ(2U, manager.size());
-
-  scoped_ptr<const void* []> rawstack0_duplicate1 = CopyStack(stack0);
-  const CallStack* stack0_duplicate1 =
-      manager.GetCallStack(arraysize(kRawStack0), rawstack0_duplicate1.get());
-  EXPECT_EQ(2U, manager.size());
-  EXPECT_EQ(stack0, stack0_duplicate1);
-
-  scoped_ptr<const void* []> rawstack1_duplicate0 = CopyStack(stack1);
-  const CallStack* stack1_duplicate0 =
-      manager.GetCallStack(arraysize(kRawStack1), rawstack1_duplicate0.get());
-  EXPECT_EQ(2U, manager.size());
-  EXPECT_EQ(stack1, stack1_duplicate0);
-
-  // Add stack2 and stack3.
-  const CallStack* stack2 =
-      manager.GetCallStack(arraysize(kRawStack2), kRawStack2);
-  const CallStack* stack3 =
-      manager.GetCallStack(arraysize(kRawStack3), kRawStack3);
-  EXPECT_EQ(4U, manager.size());
-
-  scoped_ptr<const void* []> rawstack1_duplicate1 = CopyStack(stack1);
-  const CallStack* stack1_duplicate1 =
-      manager.GetCallStack(arraysize(kRawStack1), rawstack1_duplicate1.get());
-  EXPECT_EQ(4U, manager.size());
-  EXPECT_EQ(stack1, stack1_duplicate1);
-
-  scoped_ptr<const void* []> rawstack0_duplicate2 = CopyStack(stack0);
-  const CallStack* stack0_duplicate2 =
-      manager.GetCallStack(arraysize(kRawStack0), rawstack0_duplicate2.get());
-  EXPECT_EQ(4U, manager.size());
-  EXPECT_EQ(stack0, stack0_duplicate2);
-
-  scoped_ptr<const void* []> rawstack3_duplicate0 = CopyStack(stack3);
-  const CallStack* stack3_duplicate0 =
-      manager.GetCallStack(arraysize(kRawStack3), rawstack3_duplicate0.get());
-  EXPECT_EQ(4U, manager.size());
-  EXPECT_EQ(stack3, stack3_duplicate0);
-
-  scoped_ptr<const void* []> rawstack2_duplicate0 = CopyStack(stack2);
-  const CallStack* stack2_duplicate0 =
-      manager.GetCallStack(arraysize(kRawStack2), rawstack2_duplicate0.get());
-  EXPECT_EQ(4U, manager.size());
-  EXPECT_EQ(stack2, stack2_duplicate0);
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/call_stack_table.cc b/components/metrics/leak_detector/call_stack_table.cc
deleted file mode 100644
index f861ebbe..0000000
--- a/components/metrics/leak_detector/call_stack_table.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/call_stack_table.h"
-
-#include "components/metrics/leak_detector/call_stack_manager.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-using ValueType = LeakDetectorValueType;
-
-// During leak analysis, we only want to examine the top
-// |kMaxCountOfSuspciousStacks| entries.
-const int kMaxCountOfSuspciousStacks = 16;
-
-const int kInitialHashTableSize = 1999;
-
-}  // namespace
-
-size_t CallStackTable::StoredHash::operator()(
-    const CallStack* call_stack) const {
-  // The call stack object should already have a hash computed when it was
-  // created.
-  //
-  // This is NOT the actual hash computation function for a new call stack.
-  return call_stack->hash;
-}
-
-CallStackTable::CallStackTable(int call_stack_suspicion_threshold)
-    : num_allocs_(0),
-      num_frees_(0),
-      entry_map_(kInitialHashTableSize),
-      leak_analyzer_(kMaxCountOfSuspciousStacks,
-                     call_stack_suspicion_threshold) {}
-
-CallStackTable::~CallStackTable() {}
-
-void CallStackTable::Add(const CallStack* call_stack) {
-  Entry* entry = &entry_map_[call_stack];
-
-  ++entry->net_num_allocs;
-  ++num_allocs_;
-}
-
-void CallStackTable::Remove(const CallStack* call_stack) {
-  auto iter = entry_map_.find(call_stack);
-  if (iter == entry_map_.end())
-    return;
-  Entry* entry = &iter->second;
-  --entry->net_num_allocs;
-  ++num_frees_;
-
-  // Delete zero-alloc entries to free up space.
-  if (entry->net_num_allocs == 0)
-    entry_map_.erase(iter);
-}
-
-void CallStackTable::TestForLeaks() {
-  // Add all entries to the ranked list.
-  RankedList ranked_list(kMaxCountOfSuspciousStacks);
-
-  for (const auto& entry_pair : entry_map_) {
-    const Entry& entry = entry_pair.second;
-    // Assumes that |entry.net_num_allocs| is always > 0. If that changes
-    // elsewhere in this class, this code should be updated to only pass values
-    // > 0 to |ranked_list|.
-    LeakDetectorValueType call_stack_value(entry_pair.first);
-    ranked_list.Add(call_stack_value, entry.net_num_allocs);
-  }
-  leak_analyzer_.AddSample(ranked_list.Pass());
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/call_stack_table.h b/components/metrics/leak_detector/call_stack_table.h
deleted file mode 100644
index c412895..0000000
--- a/components/metrics/leak_detector/call_stack_table.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_
-
-#include <stdint.h>
-
-#include <functional>  // For std::equal_to.
-
-#include "base/containers/hash_tables.h"
-#include "base/macros.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/leak_analyzer.h"
-#include "components/metrics/leak_detector/stl_allocator.h"
-
-namespace metrics {
-namespace leak_detector {
-
-struct CallStack;
-
-// Contains a hash table where the key is the call stack and the value is the
-// number of allocations from that call stack.
-// Not thread-safe.
-class CallStackTable {
- public:
-  struct StoredHash {
-    size_t operator()(const CallStack* call_stack) const;
-  };
-
-  explicit CallStackTable(int call_stack_suspicion_threshold);
-  ~CallStackTable();
-
-  // Add/Remove an allocation for the given call stack.
-  // Note that this class does NOT own the CallStack objects. Instead, it
-  // identifies different CallStacks by their hashes.
-  void Add(const CallStack* call_stack);
-  void Remove(const CallStack* call_stack);
-
-  // Check for leak patterns in the allocation data.
-  void TestForLeaks();
-
-  const LeakAnalyzer& leak_analyzer() const { return leak_analyzer_; }
-
-  size_t size() const { return entry_map_.size(); }
-  bool empty() const { return entry_map_.empty(); }
-
-  uint32_t num_allocs() const { return num_allocs_; }
-  uint32_t num_frees() const { return num_frees_; }
-
- private:
-  // Hash table entry used to track allocation stats for a given call stack.
-  struct Entry {
-    // Net number of allocs (allocs minus frees).
-    uint32_t net_num_allocs;
-  };
-
-  // Total number of allocs and frees in this table.
-  uint32_t num_allocs_;
-  uint32_t num_frees_;
-
-  // Hash table containing entries.
-  using TableEntryAllocator =
-      STLAllocator<std::pair<const CallStack*, Entry>, CustomAllocator>;
-  base::hash_map<const CallStack*,
-                 Entry,
-                 StoredHash,
-                 std::equal_to<const CallStack*>,
-                 TableEntryAllocator> entry_map_;
-
-  // For detecting leak patterns in incoming allocations.
-  LeakAnalyzer leak_analyzer_;
-
-  DISALLOW_COPY_AND_ASSIGN(CallStackTable);
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_
diff --git a/components/metrics/leak_detector/call_stack_table_unittest.cc b/components/metrics/leak_detector/call_stack_table_unittest.cc
deleted file mode 100644
index c455f37..0000000
--- a/components/metrics/leak_detector/call_stack_table_unittest.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/call_stack_table.h"
-
-#include <set>
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "components/metrics/leak_detector/call_stack_manager.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Default threshold used for leak analysis.
-const int kDefaultLeakThreshold = 5;
-
-// Some test call stacks.
-const void* kRawStack0[] = {
-    reinterpret_cast<const void*>(0xaabbccdd),
-    reinterpret_cast<const void*>(0x11223344),
-    reinterpret_cast<const void*>(0x55667788),
-    reinterpret_cast<const void*>(0x99887766),
-};
-const void* kRawStack1[] = {
-    reinterpret_cast<const void*>(0xdeadbeef),
-    reinterpret_cast<const void*>(0x900df00d),
-    reinterpret_cast<const void*>(0xcafedeed),
-    reinterpret_cast<const void*>(0xdeafbabe),
-};
-const void* kRawStack2[] = {
-    reinterpret_cast<const void*>(0x12345678),
-    reinterpret_cast<const void*>(0xabcdef01),
-    reinterpret_cast<const void*>(0xfdecab98),
-};
-const void* kRawStack3[] = {
-    reinterpret_cast<const void*>(0xdead0001),
-    reinterpret_cast<const void*>(0xbeef0002),
-    reinterpret_cast<const void*>(0x900d0003),
-    reinterpret_cast<const void*>(0xf00d0004),
-    reinterpret_cast<const void*>(0xcafe0005),
-    reinterpret_cast<const void*>(0xdeed0006),
-    reinterpret_cast<const void*>(0xdeaf0007),
-    reinterpret_cast<const void*>(0xbabe0008),
-};
-
-}  // namespace
-
-class CallStackTableTest : public ::testing::Test {
- public:
-  CallStackTableTest()
-      : stack0_(nullptr),
-        stack1_(nullptr),
-        stack2_(nullptr),
-        stack3_(nullptr) {}
-
-  void SetUp() override {
-    CustomAllocator::Initialize();
-
-    manager_.reset(new CallStackManager);
-
-    // The unit tests expect a certain order to the call stack pointers. It is
-    // an important detail when checking the output of LeakAnalyzer's suspected
-    // leaks, which are ordered by the leak value (call stack pointer). Use a
-    // set to sort the pointers as they are created.
-    std::set<const CallStack*> stacks;
-    stacks.insert(manager_->GetCallStack(arraysize(kRawStack0), kRawStack0));
-    stacks.insert(manager_->GetCallStack(arraysize(kRawStack1), kRawStack1));
-    stacks.insert(manager_->GetCallStack(arraysize(kRawStack2), kRawStack2));
-    stacks.insert(manager_->GetCallStack(arraysize(kRawStack3), kRawStack3));
-    ASSERT_EQ(4U, stacks.size());
-
-    std::set<const CallStack*>::const_iterator iter = stacks.begin();
-    stack0_ = *iter++;
-    stack1_ = *iter++;
-    stack2_ = *iter++;
-    stack3_ = *iter++;
-  }
-
-  void TearDown() override {
-    // All call stacks generated by |manager_| will be invalidated when it is
-    // destroyed.
-    stack0_ = nullptr;
-    stack1_ = nullptr;
-    stack2_ = nullptr;
-    stack3_ = nullptr;
-
-    // Destroy the call stack manager before shutting down the allocator.
-    manager_.reset();
-
-    EXPECT_TRUE(CustomAllocator::Shutdown());
-  }
-
- protected:
-  // Unit tests should directly reference these pointers to CallStack objects.
-  const CallStack* stack0_;
-  const CallStack* stack1_;
-  const CallStack* stack2_;
-  const CallStack* stack3_;
-
- private:
-  scoped_ptr<CallStackManager> manager_;
-
-  DISALLOW_COPY_AND_ASSIGN(CallStackTableTest);
-};
-
-TEST_F(CallStackTableTest, PointerOrder) {
-  EXPECT_LT(stack0_, stack1_);
-  EXPECT_LT(stack1_, stack2_);
-  EXPECT_LT(stack2_, stack3_);
-}
-
-TEST_F(CallStackTableTest, EmptyTable) {
-  CallStackTable table(kDefaultLeakThreshold);
-  EXPECT_TRUE(table.empty());
-
-  EXPECT_EQ(0U, table.num_allocs());
-  EXPECT_EQ(0U, table.num_frees());
-
-  // The table should be able to gracefully handle an attempt to remove a call
-  // stack entry when none exists.
-  table.Remove(stack0_);
-  table.Remove(stack1_);
-  table.Remove(stack2_);
-  table.Remove(stack3_);
-
-  EXPECT_EQ(0U, table.num_allocs());
-  EXPECT_EQ(0U, table.num_frees());
-}
-
-TEST_F(CallStackTableTest, InsertionAndRemoval) {
-  CallStackTable table(kDefaultLeakThreshold);
-
-  table.Add(stack0_);
-  EXPECT_EQ(1U, table.size());
-  EXPECT_EQ(1U, table.num_allocs());
-  table.Add(stack1_);
-  EXPECT_EQ(2U, table.size());
-  EXPECT_EQ(2U, table.num_allocs());
-  table.Add(stack2_);
-  EXPECT_EQ(3U, table.size());
-  EXPECT_EQ(3U, table.num_allocs());
-  table.Add(stack3_);
-  EXPECT_EQ(4U, table.size());
-  EXPECT_EQ(4U, table.num_allocs());
-
-  // Add some call stacks that have already been added. There should be no
-  // change in the number of entries, as they are aggregated by call stack.
-  table.Add(stack2_);
-  EXPECT_EQ(4U, table.size());
-  EXPECT_EQ(5U, table.num_allocs());
-  table.Add(stack3_);
-  EXPECT_EQ(4U, table.size());
-  EXPECT_EQ(6U, table.num_allocs());
-
-  // Start removing entries.
-  EXPECT_EQ(0U, table.num_frees());
-
-  table.Remove(stack0_);
-  EXPECT_EQ(3U, table.size());
-  EXPECT_EQ(1U, table.num_frees());
-  table.Remove(stack1_);
-  EXPECT_EQ(2U, table.size());
-  EXPECT_EQ(2U, table.num_frees());
-
-  // Removing call stacks with multiple counts will not reduce the overall
-  // number of table entries, until the count reaches 0.
-  table.Remove(stack2_);
-  EXPECT_EQ(2U, table.size());
-  EXPECT_EQ(3U, table.num_frees());
-  table.Remove(stack3_);
-  EXPECT_EQ(2U, table.size());
-  EXPECT_EQ(4U, table.num_frees());
-
-  table.Remove(stack2_);
-  EXPECT_EQ(1U, table.size());
-  EXPECT_EQ(5U, table.num_frees());
-  table.Remove(stack3_);
-  EXPECT_EQ(0U, table.size());
-  EXPECT_EQ(6U, table.num_frees());
-
-  // Now the table should be empty, but attempt to remove some more and make
-  // sure nothing breaks.
-  table.Remove(stack0_);
-  table.Remove(stack1_);
-  table.Remove(stack2_);
-  table.Remove(stack3_);
-
-  EXPECT_TRUE(table.empty());
-  EXPECT_EQ(6U, table.num_allocs());
-  EXPECT_EQ(6U, table.num_frees());
-}
-
-TEST_F(CallStackTableTest, MassiveInsertionAndRemoval) {
-  CallStackTable table(kDefaultLeakThreshold);
-
-  for (int i = 0; i < 100; ++i)
-    table.Add(stack3_);
-  EXPECT_EQ(1U, table.size());
-  EXPECT_EQ(100U, table.num_allocs());
-
-  for (int i = 0; i < 100; ++i)
-    table.Add(stack2_);
-  EXPECT_EQ(2U, table.size());
-  EXPECT_EQ(200U, table.num_allocs());
-
-  for (int i = 0; i < 100; ++i)
-    table.Add(stack1_);
-  EXPECT_EQ(3U, table.size());
-  EXPECT_EQ(300U, table.num_allocs());
-
-  for (int i = 0; i < 100; ++i)
-    table.Add(stack0_);
-  EXPECT_EQ(4U, table.size());
-  EXPECT_EQ(400U, table.num_allocs());
-
-  // Remove them in a different order, by removing one of each stack during one
-  // iteration. The size should not decrease until the last iteration.
-  EXPECT_EQ(0U, table.num_frees());
-
-  for (int i = 0; i < 100; ++i) {
-    table.Remove(stack0_);
-    EXPECT_EQ(4U * i + 1, table.num_frees());
-
-    table.Remove(stack1_);
-    EXPECT_EQ(4U * i + 2, table.num_frees());
-
-    table.Remove(stack2_);
-    EXPECT_EQ(4U * i + 3, table.num_frees());
-
-    table.Remove(stack3_);
-    EXPECT_EQ(4U * i + 4, table.num_frees());
-  }
-  EXPECT_EQ(400U, table.num_frees());
-  EXPECT_TRUE(table.empty());
-
-  // Try to remove some more from an empty table and make sure nothing breaks.
-  table.Remove(stack0_);
-  table.Remove(stack1_);
-  table.Remove(stack2_);
-  table.Remove(stack3_);
-
-  EXPECT_TRUE(table.empty());
-  EXPECT_EQ(400U, table.num_allocs());
-  EXPECT_EQ(400U, table.num_frees());
-}
-
-TEST_F(CallStackTableTest, DetectLeak) {
-  CallStackTable table(kDefaultLeakThreshold);
-
-  // Add some base number of entries.
-  for (int i = 0; i < 60; ++i)
-    table.Add(stack0_);
-  for (int i = 0; i < 50; ++i)
-    table.Add(stack1_);
-  for (int i = 0; i < 64; ++i)
-    table.Add(stack2_);
-  for (int i = 0; i < 72; ++i)
-    table.Add(stack3_);
-
-  table.TestForLeaks();
-  EXPECT_TRUE(table.leak_analyzer().suspected_leaks().empty());
-
-  // Use the following scheme:
-  // - stack0_: increase by 4 each time -- leak suspect
-  // - stack1_: increase by 3 each time -- leak suspect
-  // - stack2_: increase by 1 each time -- not a suspect
-  // - stack3_: alternate between increasing and decreasing - not a suspect
-  bool increase_kstack3 = true;
-  for (int i = 0; i < kDefaultLeakThreshold; ++i) {
-    EXPECT_TRUE(table.leak_analyzer().suspected_leaks().empty());
-
-    for (int j = 0; j < 4; ++j)
-      table.Add(stack0_);
-
-    for (int j = 0; j < 3; ++j)
-      table.Add(stack1_);
-
-    table.Add(stack2_);
-
-    // Alternate between adding and removing.
-    if (increase_kstack3)
-      table.Add(stack3_);
-    else
-      table.Remove(stack3_);
-    increase_kstack3 = !increase_kstack3;
-
-    table.TestForLeaks();
-  }
-
-  // Check that the correct leak values have been detected.
-  const auto& leaks = table.leak_analyzer().suspected_leaks();
-  ASSERT_EQ(2U, leaks.size());
-  // Suspected leaks are reported in increasing leak value -- in this case, the
-  // CallStack object's address.
-  EXPECT_EQ(stack0_, leaks[0].call_stack());
-  EXPECT_EQ(stack1_, leaks[1].call_stack());
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/custom_allocator.cc b/components/metrics/leak_detector/custom_allocator.cc
deleted file mode 100644
index 1f80a971..0000000
--- a/components/metrics/leak_detector/custom_allocator.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/custom_allocator.h"
-
-#include <stddef.h>
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Wrappers around new and delete.
-void* DefaultAlloc(size_t size) {
-  return new char[size];
-}
-void DefaultFree(void* ptr, size_t /* size */) {
-  delete[] reinterpret_cast<char*>(ptr);
-}
-
-CustomAllocator::AllocFunc g_alloc_func = nullptr;
-CustomAllocator::FreeFunc g_free_func = nullptr;
-
-}  // namespace
-
-// static
-void CustomAllocator::Initialize() {
-  Initialize(&DefaultAlloc, &DefaultFree);
-}
-
-// static
-void CustomAllocator::Initialize(AllocFunc alloc_func, FreeFunc free_func) {
-  g_alloc_func = alloc_func;
-  g_free_func = free_func;
-}
-
-// static
-bool CustomAllocator::Shutdown() {
-  g_alloc_func = nullptr;
-  g_free_func = nullptr;
-  return true;
-}
-
-// static
-bool CustomAllocator::IsInitialized() {
-  return g_alloc_func && g_free_func;
-}
-
-// static
-void* CustomAllocator::Allocate(size_t size) {
-  return g_alloc_func(size);
-}
-
-// static
-void CustomAllocator::Free(void* ptr, size_t size) {
-  g_free_func(ptr, size);
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/custom_allocator.h b/components/metrics/leak_detector/custom_allocator.h
deleted file mode 100644
index fdbfc77..0000000
--- a/components/metrics/leak_detector/custom_allocator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_CUSTOM_ALLOCATOR_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_CUSTOM_ALLOCATOR_H_
-
-#include <stddef.h>
-
-#include <type_traits>
-
-namespace metrics {
-namespace leak_detector {
-
-// Custom allocator class to be passed to STLAllocator as a template argument.
-//
-// By default, CustomAllocator uses the default allocator (new/delete), but the
-// caller of Initialize ()can provide a pair of alternative alloc/ free
-// functions to use as an external allocator.
-//
-// This is a stateless class, but there is static data within the module that
-// needs to be created and deleted.
-//
-// Not thread-safe.
-class CustomAllocator {
- public:
-  using AllocFunc = std::add_pointer<void*(size_t)>::type;
-  using FreeFunc = std::add_pointer<void(void*, size_t)>::type;
-
-  // Initialize CustomAllocator to use the default allocator.
-  static void Initialize();
-
-  // Initialize CustomAllocator to use the given alloc/free functions.
-  static void Initialize(AllocFunc alloc_func, FreeFunc free_func);
-
-  // Performs any cleanup required, e.g. unset custom functions. Returns true
-  // on success or false if something failed.
-  static bool Shutdown();
-
-  static bool IsInitialized();
-
-  // These functions must match the specifications in STLAllocator.
-  static void* Allocate(size_t size);
-  static void Free(void* ptr, size_t size);
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_CUSTOM_ALLOCATOR_H_
diff --git a/components/metrics/leak_detector/leak_analyzer.cc b/components/metrics/leak_detector/leak_analyzer.cc
deleted file mode 100644
index 56905ba..0000000
--- a/components/metrics/leak_detector/leak_analyzer.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/leak_analyzer.h"
-
-#include <set>
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-using RankedEntry = RankedList::Entry;
-
-// Increase suspicion scores by this much each time an entry is suspected as
-// being a leak.
-const int kSuspicionScoreIncrease = 1;
-
-}  // namespace
-
-LeakAnalyzer::LeakAnalyzer(uint32_t ranking_size,
-                           uint32_t num_suspicions_threshold)
-    : ranking_size_(ranking_size),
-      score_threshold_(num_suspicions_threshold),
-      ranked_entries_(ranking_size),
-      prev_ranked_entries_(ranking_size) {
-  suspected_leaks_.reserve(ranking_size);
-}
-
-LeakAnalyzer::~LeakAnalyzer() {}
-
-void LeakAnalyzer::AddSample(RankedList ranked_list) {
-  // Save the ranked entries from the previous call.
-  prev_ranked_entries_ = ranked_entries_.Pass();
-
-  // Save the current entries.
-  ranked_entries_ = ranked_list.Pass();
-
-  RankedList ranked_deltas(ranking_size_);
-  for (const RankedEntry& entry : ranked_entries_) {
-    // Determine what count was recorded for this value last time.
-    uint32_t prev_count = 0;
-    if (GetPreviousCountForValue(entry.value, &prev_count))
-      ranked_deltas.Add(entry.value, entry.count - prev_count);
-  }
-
-  AnalyzeDeltas(ranked_deltas);
-}
-
-void LeakAnalyzer::AnalyzeDeltas(const RankedList& ranked_deltas) {
-  bool found_drop = false;
-  RankedList::const_iterator drop_position = ranked_deltas.end();
-
-  if (ranked_deltas.size() > 1) {
-    RankedList::const_iterator entry_iter = ranked_deltas.begin();
-    RankedList::const_iterator next_entry_iter = ranked_deltas.begin();
-    ++next_entry_iter;
-
-    // If the first entry is 0, that means all deltas are 0 or negative. Do
-    // not treat this as a suspicion of leaks; just quit.
-    if (entry_iter->count > 0) {
-      while (next_entry_iter != ranked_deltas.end()) {
-        const RankedEntry& entry = *entry_iter;
-        const RankedEntry& next_entry = *next_entry_iter;
-
-        // Find the first major drop in values (i.e. by 50% or more).
-        if (entry.count > next_entry.count * 2) {
-          found_drop = true;
-          drop_position = next_entry_iter;
-          break;
-        }
-        ++entry_iter;
-        ++next_entry_iter;
-      }
-    }
-  }
-
-  // All leak values before the drop are suspected during this analysis.
-  std::set<ValueType, std::less<ValueType>, Allocator<ValueType>>
-      current_suspects;
-  if (found_drop) {
-    for (RankedList::const_iterator ranked_list_iter = ranked_deltas.begin();
-         ranked_list_iter != drop_position; ++ranked_list_iter) {
-      current_suspects.insert(ranked_list_iter->value);
-    }
-  }
-
-  // Reset the score to 0 for all previously suspected leak values that did
-  // not get suspected this time.
-  auto iter = suspected_histogram_.begin();
-  while (iter != suspected_histogram_.end()) {
-    const ValueType& value = iter->first;
-    // Erase entries whose suspicion score reaches 0.
-    auto erase_iter = iter++;
-    if (current_suspects.find(value) == current_suspects.end())
-      suspected_histogram_.erase(erase_iter);
-  }
-
-  // For currently suspected values, increase the leak score.
-  for (const ValueType& value : current_suspects) {
-    auto histogram_iter = suspected_histogram_.find(value);
-    if (histogram_iter != suspected_histogram_.end()) {
-      histogram_iter->second += kSuspicionScoreIncrease;
-    } else if (suspected_histogram_.size() < ranking_size_) {
-      // Create a new entry if it didn't already exist.
-      suspected_histogram_[value] = kSuspicionScoreIncrease;
-    }
-  }
-
-  // Now check the leak suspicion scores. Make sure to erase the suspected
-  // leaks from the previous call.
-  suspected_leaks_.clear();
-  for (const auto& entry : suspected_histogram_) {
-    if (suspected_leaks_.size() > ranking_size_)
-      break;
-
-    // Only report suspected values that have accumulated a suspicion score.
-    // This is achieved by maintaining suspicion for several cycles, with few
-    // skips.
-    if (entry.second >= score_threshold_)
-      suspected_leaks_.emplace_back(entry.first);
-  }
-}
-
-bool LeakAnalyzer::GetPreviousCountForValue(const ValueType& value,
-                                            uint32_t* count) const {
-  // Determine what count was recorded for this value last time.
-  for (const RankedEntry& entry : prev_ranked_entries_) {
-    if (entry.value == value) {
-      *count = entry.count;
-      return true;
-    }
-  }
-  return false;
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/leak_analyzer.h b/components/metrics/leak_detector/leak_analyzer.h
deleted file mode 100644
index 9ca9c3e7..0000000
--- a/components/metrics/leak_detector/leak_analyzer.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_ANALYZER_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_ANALYZER_H_
-
-#include <map>
-#include <vector>
-
-#include "base/macros.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/leak_detector_value_type.h"
-#include "components/metrics/leak_detector/ranked_list.h"
-#include "components/metrics/leak_detector/stl_allocator.h"
-
-namespace metrics {
-namespace leak_detector {
-
-// This class looks for possible leak patterns in allocation data over time.
-// Not thread-safe.
-class LeakAnalyzer {
- public:
-  using ValueType = LeakDetectorValueType;
-
-  template <typename Type>
-  using Allocator = STLAllocator<Type, CustomAllocator>;
-
-  LeakAnalyzer(uint32_t ranking_size, uint32_t num_suspicions_threshold);
-  ~LeakAnalyzer();
-
-  // Take in a RankedList of allocations, sorted by count. Removes the contents
-  // of |ranked_list|, which must be passed in using move semantics.
-  void AddSample(RankedList ranked_list);
-
-  // Used to report suspected leaks. Reported leaks are sorted by ValueType.
-  const std::vector<ValueType, Allocator<ValueType>>& suspected_leaks() const {
-    return suspected_leaks_;
-  }
-
- private:
-  // Analyze a list of allocation count deltas from the previous iteration. If
-  // anything looks like a possible leak, update the suspicion scores.
-  void AnalyzeDeltas(const RankedList& ranked_deltas);
-
-  // Returns the count for the given value from the previous analysis in
-  // |count|. Returns true if the given value was present in the previous
-  // analysis, or false if not.
-  bool GetPreviousCountForValue(const ValueType& value, uint32_t* count) const;
-
-  // Look for the top |ranking_size_| entries when analyzing leaks.
-  const uint32_t ranking_size_;
-
-  // Report suspected leaks when the suspicion score reaches this value.
-  const uint32_t score_threshold_;
-
-  // A mapping of allocation values to suspicion score. All allocations in this
-  // container are suspected leaks. The score can increase or decrease over
-  // time. Once the score  reaches |score_threshold_|, the entry is reported as
-  // a suspected leak in |suspected_leaks_|.
-  std::map<ValueType,
-           uint32_t,
-           std::less<ValueType>,
-           Allocator<std::pair<ValueType, uint32_t>>> suspected_histogram_;
-
-  // Array of allocated values that passed the suspicion threshold and are being
-  // reported.
-  std::vector<ValueType, Allocator<ValueType>> suspected_leaks_;
-
-  // The most recent allocation entries, since the last call to AddSample().
-  RankedList ranked_entries_;
-  // The previous allocation entries, from before the last call to AddSample().
-  RankedList prev_ranked_entries_;
-
-  DISALLOW_COPY_AND_ASSIGN(LeakAnalyzer);
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_ANALYZER_H_
diff --git a/components/metrics/leak_detector/leak_analyzer_unittest.cc b/components/metrics/leak_detector/leak_analyzer_unittest.cc
deleted file mode 100644
index 0008708..0000000
--- a/components/metrics/leak_detector/leak_analyzer_unittest.cc
+++ /dev/null
@@ -1,362 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/leak_analyzer.h"
-
-#include "base/macros.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/ranked_list.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Default ranking size and threshold used for leak analysis.
-const int kDefaultRankedListSize = 10;
-const int kDefaultLeakThreshold = 5;
-
-// Makes it easier to instantiate LeakDetectorValueTypes. Instantiates with an
-// integer value that indicates an allocation size. Storing the size allows us
-// to track the storage of the LeakDetectorValueType object within LeakAnalyzer.
-//
-// There is no need to test this with call stacks in addition to sizes because
-// call stacks will be contained in a LeakDetectorValueType object as well.
-LeakDetectorValueType Size(uint32_t value) {
-  return LeakDetectorValueType(value);
-}
-
-}  // namespace
-
-class LeakAnalyzerTest : public ::testing::Test {
- public:
-  LeakAnalyzerTest() {}
-
-  void SetUp() override { CustomAllocator::Initialize(); }
-  void TearDown() override { EXPECT_TRUE(CustomAllocator::Shutdown()); }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(LeakAnalyzerTest);
-};
-
-TEST_F(LeakAnalyzerTest, Empty) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-  EXPECT_TRUE(analyzer.suspected_leaks().empty());
-}
-
-TEST_F(LeakAnalyzerTest, SingleSize) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 20; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 10);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected.
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, VariousSizesWithoutIncrease) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 20; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30);
-    list.Add(Size(32), 10);
-    list.Add(Size(56), 90);
-    list.Add(Size(64), 40);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected.
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, VariousSizesWithEqualIncrease) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 20; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);
-    list.Add(Size(32), 10 + i * 10);
-    list.Add(Size(56), 90 + i * 10);
-    list.Add(Size(64), 40 + i * 10);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected.
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, NotEnoughRunsToTriggerLeakReport) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  // Run this one iteration short of the number of cycles needed to trigger a
-  // leak report. Because LeakAnalyzer requires |kDefaultLeakThreshold|
-  // suspicions based on deltas between AddSample() calls, the below loop needs
-  // to run |kDefaultLeakThreshold + 1| times to trigger a leak report.
-  for (int i = 0; i <= kDefaultLeakThreshold - 1; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);  // This one has a potential leak.
-    list.Add(Size(32), 10 + i * 2);
-    list.Add(Size(56), 90 + i);
-    list.Add(Size(64), 40 + i / 2);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected.
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, LeakSingleSize) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  // Run this past the number of iterations required to trigger a leak report.
-  for (int i = 0; i < kDefaultLeakThreshold + 10; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(32), 10);
-    list.Add(Size(56), 90);
-    list.Add(Size(24), 30 + i * 10);  // This one has a potential leak.
-    list.Add(Size(64), 40);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected initially...
-    if (i < kDefaultLeakThreshold) {
-      EXPECT_TRUE(analyzer.suspected_leaks().empty());
-    } else {
-      // ... but there should be reported leaks once the threshold is reached.
-      const auto& leaks = analyzer.suspected_leaks();
-      ASSERT_EQ(1U, leaks.size());
-      EXPECT_EQ(24U, leaks[0].size());
-    }
-  }
-}
-
-TEST_F(LeakAnalyzerTest, LeakSingleSizeOthersAlsoIncreasing) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 10; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);  // This one has a potential leak.
-    list.Add(Size(32), 10 + i * 2);
-    list.Add(Size(56), 90 + i);
-    list.Add(Size(64), 40 + i / 2);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected initially...
-    if (i < kDefaultLeakThreshold) {
-      EXPECT_TRUE(analyzer.suspected_leaks().empty());
-    } else {
-      // ... but there should be reported leaks once the threshold is reached.
-      const auto& leaks = analyzer.suspected_leaks();
-      ASSERT_EQ(1U, leaks.size());
-      EXPECT_EQ(24U, leaks[0].size());
-    }
-  }
-}
-
-TEST_F(LeakAnalyzerTest, LeakMultipleSizes) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 10; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 5);
-    list.Add(Size(32), 10 + i * 40);
-    list.Add(Size(56), 90 + i * 30);
-    list.Add(Size(64), 40 + i * 20);
-    list.Add(Size(80), 20 + i * 3);
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected initially...
-    if (i < kDefaultLeakThreshold) {
-      EXPECT_TRUE(analyzer.suspected_leaks().empty());
-    } else {
-      // ... but there should be reported leaks once the threshold is reached.
-      const auto& leaks = analyzer.suspected_leaks();
-      ASSERT_EQ(3U, leaks.size());
-      // These should be in order of increasing allocation size.
-      EXPECT_EQ(32U, leaks[0].size());
-      EXPECT_EQ(56U, leaks[1].size());
-      EXPECT_EQ(64U, leaks[2].size());
-    }
-  }
-}
-
-TEST_F(LeakAnalyzerTest, LeakMultipleSizesValueOrder) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i <= kDefaultLeakThreshold; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    // These are similar to LeakMultipleSizes, but the relative order of
-    // allocation increases is different from the relative order of sizes.
-    list.Add(Size(24), 30 + i * 5);
-    list.Add(Size(32), 10 + i * 20);
-    list.Add(Size(56), 90 + i * 40);
-    list.Add(Size(64), 40 + i * 30);
-    list.Add(Size(80), 20 + i * 3);
-    analyzer.AddSample(list.Pass());
-  }
-
-  const auto& leaks = analyzer.suspected_leaks();
-  ASSERT_EQ(3U, leaks.size());
-  // These should be in order of increasing allocation size, NOT in order of
-  // allocation count or deltas.
-  EXPECT_EQ(32U, leaks[0].size());
-  EXPECT_EQ(56U, leaks[1].size());
-  EXPECT_EQ(64U, leaks[2].size());
-}
-
-TEST_F(LeakAnalyzerTest, EqualIncreasesNoLeak) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 20; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);
-    list.Add(Size(32), 10 + i * 10);
-    list.Add(Size(56), 90 + i * 10);
-    list.Add(Size(64), 40 + i * 10);
-    list.Add(Size(80), 20 + i * 10);
-    analyzer.AddSample(list.Pass());
-
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, NotBigEnoughDeltaGap) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i < kDefaultLeakThreshold + 20; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    // These all have different increments but there is no clear group of
-    // increases that are larger than the rest.
-    list.Add(Size(24), 30 + i * 80);
-    list.Add(Size(32), 10 + i * 45);
-    list.Add(Size(56), 90 + i * 25);
-    list.Add(Size(64), 40 + i * 15);
-    list.Add(Size(80), 20 + i * 10);
-    analyzer.AddSample(list.Pass());
-
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-}
-
-TEST_F(LeakAnalyzerTest, RepeatedRisesUntilLeakFound) {
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kDefaultLeakThreshold);
-
-  // Remember, there is an extra iteration beyond |kDefaultLeakThreshold| needed
-  // to actually trigger the leak detection.
-  for (int i = 0; i <= kDefaultLeakThreshold - 2; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);
-    list.Add(Size(32), 10);
-    list.Add(Size(56), 90);
-    list.Add(Size(64), 40);
-    list.Add(Size(80), 20);
-    analyzer.AddSample(list.Pass());
-
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-
-  // Drop back down to 30.
-  for (int i = 0; i <= kDefaultLeakThreshold - 1; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);
-    list.Add(Size(32), 10);
-    list.Add(Size(56), 90);
-    list.Add(Size(64), 40);
-    list.Add(Size(80), 20);
-    analyzer.AddSample(list.Pass());
-
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-  }
-
-  // Drop back down to 30.
-  for (int i = 0; i <= kDefaultLeakThreshold; ++i) {
-    // Initially there should not be any leak detected.
-    EXPECT_TRUE(analyzer.suspected_leaks().empty());
-
-    RankedList list(kDefaultRankedListSize);
-    list.Add(Size(24), 30 + i * 10);
-    list.Add(Size(32), 10);
-    list.Add(Size(56), 90);
-    list.Add(Size(64), 40);
-    list.Add(Size(80), 20);
-    analyzer.AddSample(list.Pass());
-  }
-  const auto& leaks = analyzer.suspected_leaks();
-  ASSERT_EQ(1U, leaks.size());
-  EXPECT_EQ(24U, leaks[0].size());
-}
-
-TEST_F(LeakAnalyzerTest, LeakWithMultipleGroupsOfDeltas) {
-  const int kRankedListSize = 20;
-  LeakAnalyzer analyzer(kRankedListSize, kDefaultLeakThreshold);
-
-  for (int i = 0; i <= kDefaultLeakThreshold; ++i) {
-    RankedList list(kRankedListSize);
-    list.Add(Size(24), 30 + i * 10);  // A group of smaller deltas.
-    list.Add(Size(32), 10 + i * 3);
-    list.Add(Size(80), 20 + i * 5);
-    list.Add(Size(40), 30 + i * 7);
-    list.Add(Size(56), 90);
-    list.Add(Size(64), 40);
-    list.Add(Size(128), 100);
-    list.Add(Size(44), 100 + i * 10);  // A group of medium deltas.
-    list.Add(Size(16), 60 + i * 50);
-    list.Add(Size(4), 20 + i * 40);
-    list.Add(Size(8), 100 + i * 60);
-    list.Add(Size(48), 100);
-    list.Add(Size(72), 60 + i * 240);  // A group of largest deltas.
-    list.Add(Size(28), 100);
-    list.Add(Size(100), 100 + i * 200);
-    list.Add(Size(104), 60 + i * 128);
-    analyzer.AddSample(list.Pass());
-  }
-  // Only the group of largest deltas should be caught.
-  const auto& leaks = analyzer.suspected_leaks();
-  ASSERT_EQ(3U, leaks.size());
-  // These should be in order of increasing allocation size.
-  EXPECT_EQ(72U, leaks[0].size());
-  EXPECT_EQ(100U, leaks[1].size());
-  EXPECT_EQ(104U, leaks[2].size());
-}
-
-TEST_F(LeakAnalyzerTest, LeakMultipleSizesWithLargeThreshold) {
-  const int kLeakThreshold = 50;
-  LeakAnalyzer analyzer(kDefaultRankedListSize, kLeakThreshold);
-
-  for (int i = 0; i <= kLeakThreshold + 10; ++i) {
-    RankedList list(kDefaultRankedListSize);
-    // * - Cluster of larger deltas
-    list.Add(Size(24), 30 + i * 5);
-    list.Add(Size(32), 10 + i * 40);  // *
-    list.Add(Size(56), 90 + i * 30);  // *
-    list.Add(Size(40), 30 + i * 7);
-    list.Add(Size(64), 40 + i * 25);  // *
-    list.Add(Size(80), 20 + i * 3);
-    list.Add(Size(128), 100);
-    list.Add(Size(44), 100 + i * 10);
-    list.Add(Size(16), 60 + i * 50);  // *
-    analyzer.AddSample(list.Pass());
-
-    // No leaks should have been detected initially...
-    if (i < kLeakThreshold) {
-      EXPECT_TRUE(analyzer.suspected_leaks().empty());
-    } else {
-      // ... but there should be reported leaks once the threshold is reached.
-      const auto& leaks = analyzer.suspected_leaks();
-      ASSERT_EQ(4U, leaks.size());
-      // These should be in order of increasing allocation size.
-      EXPECT_EQ(16U, leaks[0].size());
-      EXPECT_EQ(32U, leaks[1].size());
-      EXPECT_EQ(56U, leaks[2].size());
-      EXPECT_EQ(64U, leaks[3].size());
-    }
-  }
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/leak_detector_impl.cc b/components/metrics/leak_detector/leak_detector_impl.cc
deleted file mode 100644
index 091d1d1..0000000
--- a/components/metrics/leak_detector/leak_detector_impl.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "leak_detector_impl.h"
-
-#include <inttypes.h>
-#include <stddef.h>
-
-#include <algorithm>
-#include <new>
-
-#include "base/hash.h"
-#include "base/process/process_handle.h"
-#include "components/metrics/leak_detector/call_stack_table.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/ranked_list.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Look for leaks in the the top N entries in each tier, where N is this value.
-const int kRankedListSize = 16;
-
-// Initial hash table size for |LeakDetectorImpl::address_map_|.
-const int kAddressMapNumBuckets = 100003;
-
-// Number of entries in the alloc size table. As sizes are aligned to 32-bits
-// the max supported allocation size is (kNumSizeEntries * 4 - 1). Any larger
-// sizes are ignored. This value is chosen high enough that such large sizes
-// are rare if not nonexistent.
-const int kNumSizeEntries = 2048;
-
-using ValueType = LeakDetectorValueType;
-
-// Functions to convert an allocation size to/from the array index used for
-// |LeakDetectorImpl::size_entries_|.
-size_t SizeToIndex(const size_t size) {
-  int result = static_cast<int>(size / sizeof(uint32_t));
-  if (result < kNumSizeEntries)
-    return result;
-  return 0;
-}
-
-size_t IndexToSize(size_t index) {
-  return sizeof(uint32_t) * index;
-}
-
-}  // namespace
-
-LeakDetectorImpl::LeakReport::LeakReport() : alloc_size_bytes_(0) {}
-
-LeakDetectorImpl::LeakReport::~LeakReport() {}
-
-bool LeakDetectorImpl::LeakReport::operator<(const LeakReport& other) const {
-  if (alloc_size_bytes_ != other.alloc_size_bytes_)
-    return alloc_size_bytes_ < other.alloc_size_bytes_;
-  for (size_t i = 0; i < call_stack_.size() && i < other.call_stack_.size();
-       ++i) {
-    if (call_stack_[i] != other.call_stack_[i])
-      return call_stack_[i] < other.call_stack_[i];
-  }
-  return call_stack_.size() < other.call_stack_.size();
-}
-
-LeakDetectorImpl::LeakDetectorImpl(uintptr_t mapping_addr,
-                                   size_t mapping_size,
-                                   int size_suspicion_threshold,
-                                   int call_stack_suspicion_threshold)
-    : num_allocs_(0),
-      num_frees_(0),
-      alloc_size_(0),
-      free_size_(0),
-      num_allocs_with_call_stack_(0),
-      num_stack_tables_(0),
-      address_map_(kAddressMapNumBuckets),
-      size_leak_analyzer_(kRankedListSize, size_suspicion_threshold),
-      size_entries_(kNumSizeEntries),
-      mapping_addr_(mapping_addr),
-      mapping_size_(mapping_size),
-      call_stack_suspicion_threshold_(call_stack_suspicion_threshold) {}
-
-LeakDetectorImpl::~LeakDetectorImpl() {
-  // Free any call stack tables.
-  for (AllocSizeEntry& entry : size_entries_) {
-    CallStackTable* table = entry.stack_table;
-    if (!table)
-      continue;
-    table->~CallStackTable();
-    CustomAllocator::Free(table, sizeof(CallStackTable));
-  }
-  size_entries_.clear();
-}
-
-bool LeakDetectorImpl::ShouldGetStackTraceForSize(size_t size) const {
-  return size_entries_[SizeToIndex(size)].stack_table != nullptr;
-}
-
-void LeakDetectorImpl::RecordAlloc(const void* ptr,
-                                   size_t size,
-                                   int stack_depth,
-                                   const void* const stack[]) {
-  AllocInfo alloc_info;
-  alloc_info.size = size;
-
-  alloc_size_ += alloc_info.size;
-  ++num_allocs_;
-
-  AllocSizeEntry* entry = &size_entries_[SizeToIndex(size)];
-  ++entry->num_allocs;
-
-  if (entry->stack_table && stack_depth > 0) {
-    alloc_info.call_stack =
-        call_stack_manager_.GetCallStack(stack_depth, stack);
-    entry->stack_table->Add(alloc_info.call_stack);
-
-    ++num_allocs_with_call_stack_;
-  }
-
-  uintptr_t addr = reinterpret_cast<uintptr_t>(ptr);
-  address_map_.insert(std::pair<uintptr_t, AllocInfo>(addr, alloc_info));
-}
-
-void LeakDetectorImpl::RecordFree(const void* ptr) {
-  // Look up address.
-  uintptr_t addr = reinterpret_cast<uintptr_t>(ptr);
-  auto iter = address_map_.find(addr);
-  // TODO(sque): Catch and report double frees.
-  if (iter == address_map_.end())
-    return;
-
-  const AllocInfo& alloc_info = iter->second;
-
-  AllocSizeEntry* entry = &size_entries_[SizeToIndex(alloc_info.size)];
-  ++entry->num_frees;
-
-  const CallStack* call_stack = alloc_info.call_stack;
-  if (call_stack) {
-    if (entry->stack_table)
-      entry->stack_table->Remove(call_stack);
-  }
-  ++num_frees_;
-  free_size_ += alloc_info.size;
-
-  address_map_.erase(iter);
-}
-
-void LeakDetectorImpl::TestForLeaks(InternalVector<LeakReport>* reports) {
-  // Add net alloc counts for each size to a ranked list.
-  RankedList size_ranked_list(kRankedListSize);
-  for (size_t i = 0; i < size_entries_.size(); ++i) {
-    const AllocSizeEntry& entry = size_entries_[i];
-    ValueType size_value(IndexToSize(i));
-    size_ranked_list.Add(size_value, entry.num_allocs - entry.num_frees);
-  }
-  size_leak_analyzer_.AddSample(size_ranked_list.Pass());
-
-  // Get suspected leaks by size.
-  for (const ValueType& size_value : size_leak_analyzer_.suspected_leaks()) {
-    uint32_t size = size_value.size();
-    AllocSizeEntry* entry = &size_entries_[SizeToIndex(size)];
-    if (entry->stack_table)
-      continue;
-    entry->stack_table = new (CustomAllocator::Allocate(sizeof(CallStackTable)))
-        CallStackTable(call_stack_suspicion_threshold_);
-    ++num_stack_tables_;
-  }
-
-  // Check for leaks in each CallStackTable. It makes sense to this before
-  // checking the size allocations, because that could potentially create new
-  // CallStackTable. However, the overhead to check a new CallStackTable is
-  // small since this function is run very rarely. So handle the leak checks of
-  // Tier 2 here.
-  reports->clear();
-  for (size_t i = 0; i < size_entries_.size(); ++i) {
-    const AllocSizeEntry& entry = size_entries_[i];
-    CallStackTable* stack_table = entry.stack_table;
-    if (!stack_table || stack_table->empty())
-      continue;
-
-    size_t size = IndexToSize(i);
-
-    // Get suspected leaks by call stack.
-    stack_table->TestForLeaks();
-    const LeakAnalyzer& leak_analyzer = stack_table->leak_analyzer();
-    for (const ValueType& call_stack_value : leak_analyzer.suspected_leaks()) {
-      const CallStack* call_stack = call_stack_value.call_stack();
-
-      // Return reports by storing in |*reports|.
-      reports->resize(reports->size() + 1);
-      LeakReport* report = &reports->back();
-      report->alloc_size_bytes_ = size;
-      report->call_stack_.resize(call_stack->depth);
-      for (size_t j = 0; j < call_stack->depth; ++j) {
-        report->call_stack_[j] = GetOffset(call_stack->stack[j]);
-      }
-    }
-  }
-}
-
-size_t LeakDetectorImpl::AddressHash::operator()(uintptr_t addr) const {
-  return base::Hash(reinterpret_cast<const char*>(&addr), sizeof(addr));
-}
-
-uintptr_t LeakDetectorImpl::GetOffset(const void* ptr) const {
-  uintptr_t ptr_value = reinterpret_cast<uintptr_t>(ptr);
-  if (ptr_value >= mapping_addr_ && ptr_value < mapping_addr_ + mapping_size_)
-    return ptr_value - mapping_addr_;
-  return ptr_value;
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/leak_detector_impl.h b/components/metrics/leak_detector/leak_detector_impl.h
deleted file mode 100644
index 055743b4..0000000
--- a/components/metrics/leak_detector/leak_detector_impl.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_IMPL_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_IMPL_H_
-
-#include <stdint.h>
-
-#include <vector>
-
-#include "base/containers/hash_tables.h"
-#include "base/macros.h"
-#include "components/metrics/leak_detector/call_stack_manager.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/leak_analyzer.h"
-
-namespace metrics {
-namespace leak_detector {
-
-class CallStackTable;
-
-// Class that contains the actual leak detection mechanism.
-// Not thread-safe.
-class LeakDetectorImpl {
- public:
-  // Vector type that's safe to use within the memory leak detector. Uses
-  // CustomAllocator to avoid recursive malloc hook invocation.
-  template <typename T>
-  using InternalVector = std::vector<T, STLAllocator<T, CustomAllocator>>;
-
-  // Leak report generated by LeakDetectorImpl.
-  class LeakReport {
-   public:
-    LeakReport();
-    ~LeakReport();
-
-    size_t alloc_size_bytes() const { return alloc_size_bytes_; }
-
-    const InternalVector<uintptr_t>& call_stack() const { return call_stack_; }
-
-    // Used to compare the contents of two leak reports.
-    bool operator<(const LeakReport& other) const;
-
-   private:
-    // LeakDetectorImpl needs access to class members when creating a new leak
-    // report.
-    friend class LeakDetectorImpl;
-
-    // Number of bytes allocated by the leak site during each allocation.
-    size_t alloc_size_bytes_;
-
-    // Unlike the CallStack struct, which consists of addresses, this call stack
-    // will contain offsets in the executable binary.
-    InternalVector<uintptr_t> call_stack_;
-
-    // TODO(sque): Add leak detector parameters.
-  };
-
-  LeakDetectorImpl(uintptr_t mapping_addr,
-                   size_t mapping_size,
-                   int size_suspicion_threshold,
-                   int call_stack_suspicion_threshold);
-  ~LeakDetectorImpl();
-
-  // Indicates whether the given allocation size has an associated call stack
-  // table, and thus requires a stack unwind.
-  bool ShouldGetStackTraceForSize(size_t size) const;
-
-  // Record allocs and frees.
-  void RecordAlloc(const void* ptr,
-                   size_t size,
-                   int stack_depth,
-                   const void* const call_stack[]);
-  void RecordFree(const void* ptr);
-
-  // Run check for possible leaks based on the current profiling data.
-  void TestForLeaks(InternalVector<LeakReport>* reports);
-
- private:
-  // A record of allocations for a particular size.
-  struct AllocSizeEntry {
-    // Number of allocations and frees for this size.
-    uint32_t num_allocs;
-    uint32_t num_frees;
-
-    // A stack table, if this size is being profiled for stack as well.
-    CallStackTable* stack_table;
-  };
-
-  // Info for a single allocation.
-  struct AllocInfo {
-    AllocInfo() : call_stack(nullptr) {}
-
-    // Number of bytes in this allocation.
-    size_t size;
-
-    // Points to a unique call stack.
-    const CallStack* call_stack;
-  };
-
-  // Allocator class for allocation entry map. Maps allocated addresses to
-  // AllocInfo objects.
-  using AllocationEntryAllocator =
-      STLAllocator<std::pair<const void*, AllocInfo>, CustomAllocator>;
-
-  // Hash class for addresses.
-  struct AddressHash {
-    size_t operator()(uintptr_t addr) const;
-  };
-
-  // Returns the offset of |ptr| within the current binary. If it is not in the
-  // current binary, just return |ptr| as an integer.
-  uintptr_t GetOffset(const void* ptr) const;
-
-  // Owns all unique call stack objects, which are allocated on the heap. Any
-  // other class or function that references a call stack must get it from here,
-  // but may not take ownership of the call stack object.
-  CallStackManager call_stack_manager_;
-
-  // Allocation stats.
-  uint64_t num_allocs_;
-  uint64_t num_frees_;
-  uint64_t alloc_size_;
-  uint64_t free_size_;
-
-  uint32_t num_allocs_with_call_stack_;
-  uint32_t num_stack_tables_;
-
-  // Stores all individual recorded allocations.
-  base::hash_map<uintptr_t,
-                 AllocInfo,
-                 AddressHash,
-                 std::equal_to<uintptr_t>,
-                 AllocationEntryAllocator> address_map_;
-
-  // Used to analyze potential leak patterns in the allocation sizes.
-  LeakAnalyzer size_leak_analyzer_;
-
-  // Allocation stats for each size.
-  InternalVector<AllocSizeEntry> size_entries_;
-
-  // Address mapping info of the current binary.
-  uintptr_t mapping_addr_;
-  size_t mapping_size_;
-
-  // Number of consecutive times an allocation size must trigger suspicion to be
-  // considered a leak suspect.
-  int size_suspicion_threshold_;
-
-  // Number of consecutive times a call stack must trigger suspicion to be
-  // considered a leak suspect.
-  int call_stack_suspicion_threshold_;
-
-  DISALLOW_COPY_AND_ASSIGN(LeakDetectorImpl);
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_IMPL_H_
diff --git a/components/metrics/leak_detector/leak_detector_impl_unittest.cc b/components/metrics/leak_detector/leak_detector_impl_unittest.cc
deleted file mode 100644
index 0e9293e..0000000
--- a/components/metrics/leak_detector/leak_detector_impl_unittest.cc
+++ /dev/null
@@ -1,464 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/leak_detector_impl.h"
-
-#include <math.h>
-#include <stdint.h>
-
-#include <complex>
-#include <new>
-#include <set>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace metrics {
-namespace leak_detector {
-
-using InternalLeakReport = LeakDetectorImpl::LeakReport;
-
-namespace {
-
-// Makes working with complex numbers easier.
-using Complex = std::complex<double>;
-
-// The mapping location in memory for a fictional executable.
-const uintptr_t kMappingAddr = 0x800000;
-const size_t kMappingSize = 0x200000;
-
-// Some call stacks within the fictional executable.
-// * - outside the mapping range, e.g. JIT code.
-const uintptr_t kRawStack0[] = {
-    0x800100, 0x900000, 0x880080, 0x810000,
-};
-const uintptr_t kRawStack1[] = {
-    0x940000, 0x980000,
-    0xdeadbeef,  // *
-    0x9a0000,
-};
-const uintptr_t kRawStack2[] = {
-    0x8f0d00, 0x803abc, 0x9100a0,
-};
-const uintptr_t kRawStack3[] = {
-    0x90fcde,
-    0x900df00d,  // *
-    0x801000,   0x880088,
-    0xdeadcafe,  // *
-    0x9f0000,   0x8700a0, 0x96037c,
-};
-const uintptr_t kRawStack4[] = {
-    0x8c0000, 0x85d00d, 0x921337,
-    0x780000,  // *
-};
-const uintptr_t kRawStack5[] = {
-    0x990000, 0x888888, 0x830ac0, 0x8e0000,
-    0xc00000,  // *
-};
-
-// This struct makes it easier to pass call stack info to
-// LeakDetectorImplTest::Alloc().
-struct TestCallStack {
-  const uintptr_t* stack;  // A reference to the original stack data.
-  size_t depth;
-};
-
-const TestCallStack kStack0 = {kRawStack0, arraysize(kRawStack0)};
-const TestCallStack kStack1 = {kRawStack1, arraysize(kRawStack1)};
-const TestCallStack kStack2 = {kRawStack2, arraysize(kRawStack2)};
-const TestCallStack kStack3 = {kRawStack3, arraysize(kRawStack3)};
-const TestCallStack kStack4 = {kRawStack4, arraysize(kRawStack4)};
-const TestCallStack kStack5 = {kRawStack5, arraysize(kRawStack5)};
-
-// The interval between consecutive analyses (LeakDetectorImpl::TestForLeaks),
-// in number of bytes allocated. e.g. if |kAllocedSizeAnalysisInterval| = 1024
-// then call TestForLeaks() every 1024 bytes of allocation that occur.
-static const size_t kAllocedSizeAnalysisInterval = 8192;
-
-}  // namespace
-
-// This test suite will test the ability of LeakDetectorImpl to catch leaks in
-// a program. Individual tests can run leaky code locally.
-//
-// The leaky code must call Alloc() and Free() for heap memory management. It
-// should not call See comments on those
-// functions for more details.
-class LeakDetectorImplTest : public ::testing::Test {
- public:
-  LeakDetectorImplTest()
-      : total_num_allocs_(0),
-        total_num_frees_(0),
-        total_alloced_size_(0),
-        next_analysis_total_alloced_size_(kAllocedSizeAnalysisInterval) {}
-
-  void SetUp() override {
-    CustomAllocator::Initialize();
-
-    const int kSizeSuspicionThreshold = 4;
-    const int kCallStackSuspicionThreshold = 4;
-    detector_.reset(new LeakDetectorImpl(kMappingAddr, kMappingSize,
-                                         kSizeSuspicionThreshold,
-                                         kCallStackSuspicionThreshold));
-  }
-
-  void TearDown() override {
-    // Free any memory that was leaked by test cases. Do not use Free() because
-    // that will try to modify |alloced_ptrs_|.
-    for (void* ptr : alloced_ptrs_)
-      delete[] reinterpret_cast<char*>(ptr);
-    alloced_ptrs_.clear();
-
-    // Must destroy all objects that use CustomAllocator before shutting down.
-    detector_.reset();
-    stored_reports_.clear();
-
-    EXPECT_TRUE(CustomAllocator::Shutdown());
-  }
-
- protected:
-  // Alloc and free functions that allocate and free heap memory and
-  // automatically pass alloc/free info to |detector_|. They emulate the
-  // alloc/free hook functions that would call into LeakDetectorImpl in
-  // real-life usage. They also keep track of individual allocations locally, so
-  // any leaked memory could be cleaned up.
-  //
-  // |stack| is just a nominal call stack object to identify the call site. It
-  // doesn't have to contain the stack trace of the actual call stack.
-  void* Alloc(size_t size, const TestCallStack& stack) {
-    void* ptr = new char[size];
-    detector_->RecordAlloc(ptr, size, stack.depth,
-                           reinterpret_cast<const void* const*>(stack.stack));
-
-    EXPECT_TRUE(alloced_ptrs_.find(ptr) == alloced_ptrs_.end());
-    alloced_ptrs_.insert(ptr);
-
-    ++total_num_allocs_;
-    total_alloced_size_ += size;
-    if (total_alloced_size_ >= next_analysis_total_alloced_size_) {
-      LeakDetectorImpl::InternalVector<InternalLeakReport> reports;
-      detector_->TestForLeaks(&reports);
-      for (const InternalLeakReport& report : reports)
-        stored_reports_.insert(report);
-
-      // Determine when the next leak analysis should occur.
-      while (total_alloced_size_ >= next_analysis_total_alloced_size_)
-        next_analysis_total_alloced_size_ += kAllocedSizeAnalysisInterval;
-    }
-    return ptr;
-  }
-
-  // See comment for Alloc().
-  void Free(void* ptr) {
-    auto find_ptr_iter = alloced_ptrs_.find(ptr);
-    EXPECT_FALSE(find_ptr_iter == alloced_ptrs_.end());
-    if (find_ptr_iter == alloced_ptrs_.end())
-      return;
-    alloced_ptrs_.erase(find_ptr_iter);
-    ++total_num_frees_;
-
-    detector_->RecordFree(ptr);
-
-    delete[] reinterpret_cast<char*>(ptr);
-  }
-
-  // TEST CASE: Julia set fractal computation. Pass in enable_leaks=true to
-  // trigger some memory leaks.
-  void JuliaSet(bool enable_leaks);
-
-  // Instance of the class being tested.
-  scoped_ptr<LeakDetectorImpl> detector_;
-
-  // Number of pointers allocated and freed so far.
-  size_t total_num_allocs_;
-  size_t total_num_frees_;
-
-  // Keeps count of total size allocated by Alloc().
-  size_t total_alloced_size_;
-
-  // The cumulative allocation size at which to trigger the TestForLeaks() call.
-  size_t next_analysis_total_alloced_size_;
-
-  // Stores all pointers to memory allocated by by Alloc() so we can manually
-  // free the leaked pointers at the end. This also serves as redundant
-  // bookkeepping: it stores all pointers that have been allocated but not yet
-  // freed.
-  std::set<void*> alloced_ptrs_;
-
-  // Store leak reports here. Use a set so duplicate reports are not stored.
-  std::set<InternalLeakReport> stored_reports_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(LeakDetectorImplTest);
-};
-
-void LeakDetectorImplTest::JuliaSet(bool enable_leaks) {
-  // The center region of the complex plane that is the basis for our Julia set
-  // computations is a circle of radius kRadius.
-  constexpr double kRadius = 2;
-
-  // To track points in the complex plane, we will use a rectangular grid in the
-  // range defined by [-kRadius, kRadius] along both axes.
-  constexpr double kRangeMin = -kRadius;
-  constexpr double kRangeMax = kRadius;
-
-  // Divide each axis into intervals, each of which is associated with a point
-  // on that axis at its center.
-  constexpr double kIntervalInverse = 64;
-  constexpr double kInterval = 1.0 / kIntervalInverse;
-  constexpr int kNumPoints = (kRangeMax - kRangeMin) / kInterval + 1;
-
-  // Contains some useful functions for converting between points on the complex
-  // plane and in a gridlike data structure.
-  struct ComplexPlane {
-    static int GetXGridIndex(const Complex& value) {
-      return (value.real() + kInterval / 2 - kRangeMin) / kInterval;
-    }
-    static int GetYGridIndex(const Complex& value) {
-      return (value.imag() + kInterval / 2 - kRangeMin) / kInterval;
-    }
-    static int GetArrayIndex(const Complex& value) {
-      return GetXGridIndex(value) + GetYGridIndex(value) * kNumPoints;
-    }
-    static Complex GetComplexForGridPoint(size_t x, size_t y) {
-      return Complex(kRangeMin + x * kInterval, kRangeMin + y * kInterval);
-    }
-  };
-
-  // Make sure the choice of interval doesn't result in any loss of precision.
-  ASSERT_EQ(1.0, kInterval * kIntervalInverse);
-
-  // Create a grid for part of the complex plane, with each axis within the
-  // range [kRangeMin, kRangeMax].
-  constexpr size_t width = kNumPoints;
-  constexpr size_t height = kNumPoints;
-  std::vector<Complex*> grid(width * height);
-
-  // Initialize an object for each point within the inner circle |z| < kRadius.
-  for (size_t i = 0; i < width; ++i) {
-    for (size_t j = 0; j < height; ++j) {
-      Complex point = ComplexPlane::GetComplexForGridPoint(i, j);
-      // Do not store any values outside the inner circle.
-      if (abs(point) <= kRadius) {
-        grid[i + j * width] =
-            new (Alloc(sizeof(Complex), kStack0)) Complex(point);
-      }
-    }
-  }
-  EXPECT_LE(alloced_ptrs_.size(), width * height);
-
-  // Create a new grid for the result of the transformation.
-  std::vector<Complex*> next_grid(width * height, nullptr);
-
-  const int kNumIterations = 20;
-  for (int n = 0; n < kNumIterations; ++n) {
-    for (int i = 0; i < kNumPoints; ++i) {
-      for (int j = 0; j < kNumPoints; ++j) {
-        if (!grid[i + j * width])
-          continue;
-
-        // NOTE: The below code is NOT an efficient way to compute a Julia set.
-        // This is only to test the leak detector with some nontrivial code.
-
-        // A simple polynomial function for generating Julia sets is:
-        //   f(z) = z^n + c
-
-        // But in this algorithm, we need the inverse:
-        //   fInv(z) = (z - c)^(1/n)
-
-        // Here, let's use n=5 and c=0.544.
-        const Complex c(0.544, 0);
-        const Complex& z = *grid[i + j * width];
-
-        // This is the principal root.
-        Complex root = pow(z - c, 0.2);
-
-        // Discard the result if it is too far out from the center of the plane.
-        if (abs(root) > kRadius)
-          continue;
-
-        // The below code only allocates Complex objects of the same size. The
-        // leak detector expects various sizes, so increase the allocation size
-        // by a different amount at each call site.
-
-        // Nth root produces N results.
-        // Place all root results on |next_grid|.
-
-        // First, place the principal root.
-        if (!next_grid[ComplexPlane::GetArrayIndex(root)]) {
-          next_grid[ComplexPlane::GetArrayIndex(root)] =
-              new (Alloc(sizeof(Complex) + 24, kStack1)) Complex(root);
-        }
-
-        double magnitude = abs(root);
-        double angle = arg(root);
-        // To generate other roots, rotate the principal root by increments of
-        // 1/N of a full circle.
-        const double kAngleIncrement = M_PI * 2 / 5;
-
-        // Second root.
-        root = std::polar(magnitude, angle + kAngleIncrement);
-        if (!next_grid[ComplexPlane::GetArrayIndex(root)]) {
-          next_grid[ComplexPlane::GetArrayIndex(root)] =
-              new (Alloc(sizeof(Complex) + 40, kStack2)) Complex(root);
-        }
-
-        // In some of the sections below, setting |enable_leaks| to true will
-        // trigger a memory leak by overwriting the old Complex pointer value
-        // without freeing it. Due to the nature of complex roots being confined
-        // to equal sections of the complex plane, each new pointer will
-        // displace an old pointer that was allocated from the same line of
-        // code.
-
-        // Third root.
-        root = std::polar(magnitude, angle + kAngleIncrement * 2);
-        // *** LEAK ***
-        if (enable_leaks || !next_grid[ComplexPlane::GetArrayIndex(root)]) {
-          next_grid[ComplexPlane::GetArrayIndex(root)] =
-              new (Alloc(sizeof(Complex) + 40, kStack3)) Complex(root);
-        }
-
-        // Fourth root.
-        root = std::polar(magnitude, angle + kAngleIncrement * 3);
-        // *** LEAK ***
-        if (enable_leaks || !next_grid[ComplexPlane::GetArrayIndex(root)]) {
-          next_grid[ComplexPlane::GetArrayIndex(root)] =
-              new (Alloc(sizeof(Complex) + 52, kStack4)) Complex(root);
-        }
-
-        // Fifth root.
-        root = std::polar(magnitude, angle + kAngleIncrement * 4);
-        if (!next_grid[ComplexPlane::GetArrayIndex(root)]) {
-          next_grid[ComplexPlane::GetArrayIndex(root)] =
-              new (Alloc(sizeof(Complex) + 52, kStack5)) Complex(root);
-        }
-      }
-    }
-
-    // Clear the previously allocated points.
-    for (Complex*& point : grid) {
-      if (point) {
-        Free(point);
-        point = nullptr;
-      }
-    }
-
-    // Now swap the two grids for the next iteration.
-    grid.swap(next_grid);
-  }
-
-  // Clear the previously allocated points.
-  for (Complex*& point : grid) {
-    if (point) {
-      Free(point);
-      point = nullptr;
-    }
-  }
-}
-
-TEST_F(LeakDetectorImplTest, CheckTestFramework) {
-  EXPECT_EQ(0U, total_num_allocs_);
-  EXPECT_EQ(0U, total_num_frees_);
-  EXPECT_EQ(0U, alloced_ptrs_.size());
-
-  // Allocate some memory.
-  void* ptr0 = Alloc(12, kStack0);
-  void* ptr1 = Alloc(16, kStack0);
-  void* ptr2 = Alloc(24, kStack0);
-  EXPECT_EQ(3U, total_num_allocs_);
-  EXPECT_EQ(0U, total_num_frees_);
-  EXPECT_EQ(3U, alloced_ptrs_.size());
-
-  // Free one of the pointers.
-  Free(ptr1);
-  EXPECT_EQ(3U, total_num_allocs_);
-  EXPECT_EQ(1U, total_num_frees_);
-  EXPECT_EQ(2U, alloced_ptrs_.size());
-
-  // Allocate some more memory.
-  void* ptr3 = Alloc(72, kStack1);
-  void* ptr4 = Alloc(104, kStack1);
-  void* ptr5 = Alloc(96, kStack1);
-  void* ptr6 = Alloc(24, kStack1);
-  EXPECT_EQ(7U, total_num_allocs_);
-  EXPECT_EQ(1U, total_num_frees_);
-  EXPECT_EQ(6U, alloced_ptrs_.size());
-
-  // Free more pointers.
-  Free(ptr2);
-  Free(ptr4);
-  Free(ptr6);
-  EXPECT_EQ(7U, total_num_allocs_);
-  EXPECT_EQ(4U, total_num_frees_);
-  EXPECT_EQ(3U, alloced_ptrs_.size());
-
-  // Free remaining memory.
-  Free(ptr0);
-  Free(ptr3);
-  Free(ptr5);
-  EXPECT_EQ(7U, total_num_allocs_);
-  EXPECT_EQ(7U, total_num_frees_);
-  EXPECT_EQ(0U, alloced_ptrs_.size());
-}
-
-TEST_F(LeakDetectorImplTest, JuliaSetNoLeak) {
-  JuliaSet(false /* enable_leaks */);
-
-  // JuliaSet() should have run cleanly without leaking.
-  EXPECT_EQ(total_num_allocs_, total_num_frees_);
-  EXPECT_EQ(0U, alloced_ptrs_.size());
-  ASSERT_EQ(0U, stored_reports_.size());
-}
-
-TEST_F(LeakDetectorImplTest, JuliaSetWithLeak) {
-  JuliaSet(true /* enable_leaks */);
-
-  // JuliaSet() should have leaked some memory from two call sites.
-  EXPECT_GT(total_num_allocs_, total_num_frees_);
-  EXPECT_GT(alloced_ptrs_.size(), 0U);
-
-  // There should be one unique leak report generated for each leaky call site.
-  ASSERT_EQ(2U, stored_reports_.size());
-
-  // The reports should be stored in order of size.
-
-  // |report1| comes from the call site in JuliaSet() corresponding to
-  // |kStack3|.
-  const InternalLeakReport& report1 = *stored_reports_.begin();
-  EXPECT_EQ(sizeof(Complex) + 40, report1.alloc_size_bytes());
-  EXPECT_EQ(kStack3.depth, report1.call_stack().size());
-  for (size_t i = 0; i < kStack3.depth && i < report1.call_stack().size();
-       ++i) {
-    // The call stack's addresses may not fall within the mapping address.
-    // Those that don't will not be converted to mapping offsets.
-    if (kStack3.stack[i] >= kMappingAddr &&
-        kStack3.stack[i] <= kMappingAddr + kMappingSize) {
-      EXPECT_EQ(kStack3.stack[i] - kMappingAddr, report1.call_stack()[i]);
-    } else {
-      EXPECT_EQ(kStack3.stack[i], report1.call_stack()[i]);
-    }
-  }
-
-  // |report2| comes from the call site in JuliaSet() corresponding to
-  // |kStack4|.
-  const InternalLeakReport& report2 = *(++stored_reports_.begin());
-  EXPECT_EQ(sizeof(Complex) + 52, report2.alloc_size_bytes());
-  EXPECT_EQ(kStack4.depth, report2.call_stack().size());
-  for (size_t i = 0; i < kStack4.depth && i < report2.call_stack().size();
-       ++i) {
-    // The call stack's addresses may not fall within the mapping address.
-    // Those that don't will not be converted to mapping offsets.
-    if (kStack4.stack[i] >= kMappingAddr &&
-        kStack4.stack[i] <= kMappingAddr + kMappingSize) {
-      EXPECT_EQ(kStack4.stack[i] - kMappingAddr, report2.call_stack()[i]);
-    } else {
-      EXPECT_EQ(kStack4.stack[i], report2.call_stack()[i]);
-    }
-  }
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/leak_detector_value_type.cc b/components/metrics/leak_detector/leak_detector_value_type.cc
deleted file mode 100644
index 4642f515..0000000
--- a/components/metrics/leak_detector/leak_detector_value_type.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/leak_detector_value_type.h"
-
-#include <stdio.h>
-
-namespace metrics {
-namespace leak_detector {
-
-bool LeakDetectorValueType::operator==(
-    const LeakDetectorValueType& other) const {
-  if (type_ != other.type_)
-    return false;
-
-  switch (type_) {
-    case TYPE_SIZE:
-      return size_ == other.size_;
-    case TYPE_CALL_STACK:
-      return call_stack_ == other.call_stack_;
-    case TYPE_NONE:
-      // "NONE" types are considered to be all identical.
-      return true;
-  }
-  return false;
-}
-
-bool LeakDetectorValueType::operator<(
-    const LeakDetectorValueType& other) const {
-  if (type_ != other.type_)
-    return type_ < other.type_;
-
-  switch (type_) {
-    case TYPE_SIZE:
-      return size_ < other.size_;
-    case TYPE_CALL_STACK:
-      return call_stack_ < other.call_stack_;
-    case TYPE_NONE:
-      // "NONE" types are considered to be all identical.
-      return false;
-  }
-  return false;
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/leak_detector_value_type.h b/components/metrics/leak_detector/leak_detector_value_type.h
deleted file mode 100644
index 40f6108..0000000
--- a/components/metrics/leak_detector/leak_detector_value_type.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_VALUE_TYPE_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_VALUE_TYPE_
-
-#include <stddef.h>
-#include <stdint.h>
-
-namespace metrics {
-namespace leak_detector {
-
-// Used for tracking unique call stacks.
-// Not thread-safe.
-struct CallStack;
-
-class LeakDetectorValueType {
- public:
-  // Supported types.
-  enum Type {
-    TYPE_NONE,
-    TYPE_SIZE,
-    TYPE_CALL_STACK,
-  };
-
-  LeakDetectorValueType() : type_(TYPE_NONE), size_(0), call_stack_(nullptr) {}
-  explicit LeakDetectorValueType(size_t size)
-      : type_(TYPE_SIZE), size_(size), call_stack_(nullptr) {}
-  explicit LeakDetectorValueType(const CallStack* call_stack)
-      : type_(TYPE_CALL_STACK), size_(0), call_stack_(call_stack) {}
-
-  // Accessors.
-  Type type() const { return type_; }
-  size_t size() const { return size_; }
-  const CallStack* call_stack() const { return call_stack_; }
-
-  // Comparators.
-  bool operator==(const LeakDetectorValueType& other) const;
-  bool operator<(const LeakDetectorValueType& other) const;
-
- private:
-  Type type_;
-
-  size_t size_;
-  const CallStack* call_stack_;
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_LEAK_DETECTOR_VALUE_TYPE_
diff --git a/components/metrics/leak_detector/ranked_list.cc b/components/metrics/leak_detector/ranked_list.cc
deleted file mode 100644
index 4900025c..0000000
--- a/components/metrics/leak_detector/ranked_list.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/ranked_list.h"
-
-#include <algorithm>
-
-namespace metrics {
-namespace leak_detector {
-
-RankedList::RankedList(size_t max_size) : max_size_(max_size) {}
-
-RankedList::~RankedList() {}
-
-RankedList::RankedList(RankedList::RValue other)
-    : max_size_(other.object->max_size_) {
-  entries_.swap(other.object->entries_);
-}
-
-RankedList& RankedList::operator=(RankedList::RValue other) {
-  max_size_ = other.object->max_size_;
-  entries_.swap(other.object->entries_);
-  return *this;
-}
-
-void RankedList::Add(const ValueType& value, int count) {
-  // Determine where to insert the value given its count.
-  EntryList::iterator iter = std::upper_bound(entries_.begin(), entries_.end(),
-                                              Entry{ValueType(), count});
-
-  // If the list is full, do not add any entry with |count| if does not exceed
-  // the lowest count of the entries in the list.
-  if (size() == max_size_ && iter == end())
-    return;
-
-  entries_.insert(iter, Entry({value, count}));
-
-  // Limit the list size if it exceeds the maximum allowed size.
-  if (entries_.size() > max_size_)
-    entries_.resize(max_size_);
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/ranked_list.h b/components/metrics/leak_detector/ranked_list.h
deleted file mode 100644
index 5cb87ba..0000000
--- a/components/metrics/leak_detector/ranked_list.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_RANKED_LIST_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_RANKED_LIST_H_
-
-#include <stddef.h>
-
-#include <list>
-
-#include "base/macros.h"
-#include "base/move.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/leak_detector_value_type.h"
-#include "components/metrics/leak_detector/stl_allocator.h"
-
-namespace metrics {
-namespace leak_detector {
-
-// RankedList lets you add entries consisting of a value-count pair, and
-// automatically sorts them internally by count in descending order. This allows
-// for the user of this list to put value-count pairs into this list without
-// having to explicitly sort them by count.
-class RankedList {
-  MOVE_ONLY_TYPE_FOR_CPP_03(RankedList, RValue);
-
- public:
-  using ValueType = LeakDetectorValueType;
-
-  // A single entry in the RankedList. The RankedList sorts entries by |count|
-  // in descending order.
-  struct Entry {
-    ValueType value;
-    int count;
-
-    // Create a < comparator for reverse sorting.
-    bool operator<(const Entry& entry) const { return count > entry.count; }
-  };
-
-  using EntryList = std::list<Entry, STLAllocator<Entry, CustomAllocator>>;
-  using const_iterator = EntryList::const_iterator;
-
-  explicit RankedList(size_t max_size);
-  ~RankedList();
-
-  // For move semantics.
-  RankedList(RValue other);
-  RankedList& operator=(RValue other);
-
-  // Accessors for begin() and end() const iterators.
-  const_iterator begin() const { return entries_.begin(); }
-  const_iterator end() const { return entries_.end(); }
-
-  size_t size() const { return entries_.size(); }
-  size_t max_size() const { return max_size_; }
-
-  // Add a new value-count pair to the list. Does not check for existing entries
-  // with the same value. Is an O(n) operation due to ordering.
-  void Add(const ValueType& value, int count);
-
- private:
-  // Max and min counts. Returns 0 if the list is empty.
-  int max_count() const {
-    return entries_.empty() ? 0 : entries_.begin()->count;
-  }
-  int min_count() const {
-    return entries_.empty() ? 0 : entries_.rbegin()->count;
-  }
-
-  // Max number of items that can be stored in the list.
-  size_t max_size_;
-
-  // Points to the array of entries.
-  std::list<Entry, STLAllocator<Entry, CustomAllocator>> entries_;
-};
-
-}  // namespace leak_detector
-}  // namespace metrics
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_RANKED_LIST_H_
diff --git a/components/metrics/leak_detector/ranked_list_unittest.cc b/components/metrics/leak_detector/ranked_list_unittest.cc
deleted file mode 100644
index 9ebbefb..0000000
--- a/components/metrics/leak_detector/ranked_list_unittest.cc
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/metrics/leak_detector/ranked_list.h"
-
-#include "base/macros.h"
-#include "components/metrics/leak_detector/custom_allocator.h"
-#include "components/metrics/leak_detector/leak_detector_value_type.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace metrics {
-namespace leak_detector {
-
-namespace {
-
-// Makes it easier to instantiate LeakDetectorValueTypes.
-LeakDetectorValueType Value(uint32_t value) {
-  return LeakDetectorValueType(value);
-}
-
-}  // namespace
-
-class RankedListTest : public ::testing::Test {
- public:
-  RankedListTest() {}
-
-  void SetUp() override { CustomAllocator::Initialize(); }
-  void TearDown() override { EXPECT_TRUE(CustomAllocator::Shutdown()); }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(RankedListTest);
-};
-
-TEST_F(RankedListTest, Iterators) {
-  RankedList list(10);
-  EXPECT_TRUE(list.begin() == list.end());
-
-  list.Add(Value(0x1234), 100);
-  EXPECT_FALSE(list.begin() == list.end());
-}
-
-TEST_F(RankedListTest, SingleInsertion) {
-  RankedList list(10);
-  EXPECT_EQ(0U, list.size());
-
-  list.Add(Value(0x1234), 100);
-  EXPECT_EQ(1U, list.size());
-
-  auto iter = list.begin();
-  EXPECT_EQ(0x1234U, iter->value.size());
-  EXPECT_EQ(100, iter->count);
-}
-
-TEST_F(RankedListTest, InOrderInsertion) {
-  RankedList list(10);
-  EXPECT_EQ(0U, list.size());
-
-  list.Add(Value(0x1234), 100);
-  EXPECT_EQ(1U, list.size());
-  list.Add(Value(0x2345), 95);
-  EXPECT_EQ(2U, list.size());
-  list.Add(Value(0x3456), 90);
-  EXPECT_EQ(3U, list.size());
-  list.Add(Value(0x4567), 85);
-  EXPECT_EQ(4U, list.size());
-  list.Add(Value(0x5678), 80);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues[] = {
-      {Value(0x1234), 100}, {Value(0x2345), 95}, {Value(0x3456), 90},
-      {Value(0x4567), 85},  {Value(0x5678), 80},
-  };
-
-  size_t index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues));
-    EXPECT_EQ(kExpectedValues[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues[index].count, entry.count);
-    ++index;
-  }
-}
-
-TEST_F(RankedListTest, ReverseOrderInsertion) {
-  RankedList list(10);
-  EXPECT_EQ(0U, list.size());
-
-  list.Add(Value(0x1234), 0);
-  EXPECT_EQ(1U, list.size());
-  list.Add(Value(0x2345), 5);
-  EXPECT_EQ(2U, list.size());
-  list.Add(Value(0x3456), 10);
-  EXPECT_EQ(3U, list.size());
-  list.Add(Value(0x4567), 15);
-  EXPECT_EQ(4U, list.size());
-  list.Add(Value(0x5678), 20);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues[] = {
-      {Value(0x5678), 20}, {Value(0x4567), 15}, {Value(0x3456), 10},
-      {Value(0x2345), 5},  {Value(0x1234), 0},
-  };
-
-  size_t index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues));
-    EXPECT_EQ(kExpectedValues[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues[index].count, entry.count);
-    ++index;
-  }
-}
-
-TEST_F(RankedListTest, UnorderedInsertion) {
-  RankedList list(10);
-  EXPECT_EQ(0U, list.size());
-
-  list.Add(Value(0x1234), 15);
-  list.Add(Value(0x2345), 20);
-  list.Add(Value(0x3456), 10);
-  list.Add(Value(0x4567), 30);
-  list.Add(Value(0x5678), 25);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues1[] = {
-      {Value(0x4567), 30}, {Value(0x5678), 25}, {Value(0x2345), 20},
-      {Value(0x1234), 15}, {Value(0x3456), 10},
-  };
-
-  size_t index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues1));
-    EXPECT_EQ(kExpectedValues1[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues1[index].count, entry.count);
-    ++index;
-  }
-
-  // Add more items.
-  list.Add(Value(0x6789), 35);
-  list.Add(Value(0x789a), 40);
-  list.Add(Value(0x89ab), 50);
-  list.Add(Value(0x9abc), 5);
-  list.Add(Value(0xabcd), 0);
-  EXPECT_EQ(10U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues2[] = {
-      {Value(0x89ab), 50}, {Value(0x789a), 40}, {Value(0x6789), 35},
-      {Value(0x4567), 30}, {Value(0x5678), 25}, {Value(0x2345), 20},
-      {Value(0x1234), 15}, {Value(0x3456), 10}, {Value(0x9abc), 5},
-      {Value(0xabcd), 0},
-  };
-
-  index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues2));
-    EXPECT_EQ(kExpectedValues2[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues2[index].count, entry.count);
-    ++index;
-  }
-}
-
-TEST_F(RankedListTest, InsertionWithOverflow) {
-  RankedList list(5);
-  EXPECT_EQ(0U, list.size());
-
-  list.Add(Value(0x1234), 15);
-  list.Add(Value(0x2345), 20);
-  list.Add(Value(0x3456), 10);
-  list.Add(Value(0x4567), 30);
-  list.Add(Value(0x5678), 25);
-  EXPECT_EQ(5U, list.size());
-
-  // These values will not make it into the list, which is now full.
-  list.Add(Value(0x6789), 0);
-  EXPECT_EQ(5U, list.size());
-  list.Add(Value(0x789a), 5);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues1[] = {
-      {Value(0x4567), 30}, {Value(0x5678), 25}, {Value(0x2345), 20},
-      {Value(0x1234), 15}, {Value(0x3456), 10},
-  };
-
-  size_t index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues1));
-    EXPECT_EQ(kExpectedValues1[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues1[index].count, entry.count);
-    ++index;
-  }
-
-  // Insert some more values that go in the middle of the list.
-  list.Add(Value(0x89ab), 27);
-  EXPECT_EQ(5U, list.size());
-  list.Add(Value(0x9abc), 22);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues2[] = {
-      {Value(0x4567), 30}, {Value(0x89ab), 27}, {Value(0x5678), 25},
-      {Value(0x9abc), 22}, {Value(0x2345), 20},
-  };
-
-  index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues2));
-    EXPECT_EQ(kExpectedValues2[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues2[index].count, entry.count);
-    ++index;
-  }
-
-  // Insert some more values at the front of the list.
-  list.Add(Value(0xabcd), 40);
-  EXPECT_EQ(5U, list.size());
-  list.Add(Value(0xbcde), 35);
-  EXPECT_EQ(5U, list.size());
-
-  // Iterate through the contents to make sure they match what went in.
-  const RankedList::Entry kExpectedValues3[] = {
-      {Value(0xabcd), 40}, {Value(0xbcde), 35}, {Value(0x4567), 30},
-      {Value(0x89ab), 27}, {Value(0x5678), 25},
-  };
-
-  index = 0;
-  for (const auto& entry : list) {
-    EXPECT_LT(index, arraysize(kExpectedValues3));
-    EXPECT_EQ(kExpectedValues3[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues3[index].count, entry.count);
-    ++index;
-  }
-}
-
-TEST_F(RankedListTest, MoveOperation) {
-  const RankedList::Entry kExpectedValues[] = {
-      {Value(0x89ab), 50}, {Value(0x789a), 40}, {Value(0x6789), 35},
-      {Value(0x4567), 30}, {Value(0x5678), 25}, {Value(0x2345), 20},
-      {Value(0x1234), 15}, {Value(0x3456), 10}, {Value(0x9abc), 5},
-      {Value(0xabcd), 0},
-  };
-
-  RankedList source_list(10);
-  for (const RankedList::Entry& entry : kExpectedValues) {
-    source_list.Add(entry.value, entry.count);
-  }
-  EXPECT_EQ(10U, source_list.size());
-
-  RankedList dest_list(25);  // This should be changed by the move.
-  dest_list = source_list.Pass();
-  EXPECT_EQ(10U, dest_list.size());
-  EXPECT_EQ(10U, dest_list.max_size());
-
-  size_t index = 0;
-  for (const auto& entry : dest_list) {
-    EXPECT_LT(index, arraysize(kExpectedValues));
-    EXPECT_EQ(kExpectedValues[index].value.size(), entry.value.size());
-    EXPECT_EQ(kExpectedValues[index].count, entry.count);
-    ++index;
-  }
-}
-
-}  // namespace leak_detector
-}  // namespace metrics
diff --git a/components/metrics/leak_detector/stl_allocator.h b/components/metrics/leak_detector/stl_allocator.h
deleted file mode 100644
index bfef0a38..0000000
--- a/components/metrics/leak_detector/stl_allocator.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_METRICS_LEAK_DETECTOR_STL_ALLOCATOR_H_
-#define COMPONENTS_METRICS_LEAK_DETECTOR_STL_ALLOCATOR_H_
-
-#include <stddef.h>
-
-#include <limits>
-#include <memory>
-
-#include "base/logging.h"
-
-// Generic allocator class for STL objects.
-// deallocate() to use the template class Alloc's allocation.
-// that uses a given type-less allocator Alloc, which must provide:
-//   static void* Alloc::Allocate(size_t size);
-//   static void Alloc::Free(void* ptr, size_t size);
-//
-// Inherits from the default allocator, std::allocator. Overrides allocate() and
-// deallocate() and some other functions.
-//
-// STLAllocator<T, MyAlloc> provides the same thread-safety guarantees as
-// MyAlloc.
-//
-// Usage example:
-//   set<T, less<T>, STLAllocator<T, MyAlloc> > my_set;
-
-template <typename T, class Alloc>
-class STLAllocator : public std::allocator<T> {
- public:
-  typedef size_t size_type;
-  typedef T* pointer;
-
-  template <class T1>
-  struct rebind {
-    typedef STLAllocator<T1, Alloc> other;
-  };
-
-  STLAllocator() {}
-  explicit STLAllocator(const STLAllocator&) {}
-  template <class T1>
-  STLAllocator(const STLAllocator<T1, Alloc>&) {}
-  ~STLAllocator() {}
-
-  pointer allocate(size_type n, const void* = 0) {
-    // Make sure the computation of the total allocation size does not cause an
-    // integer overflow.
-    RAW_CHECK(n < max_size());
-    return static_cast<T*>(Alloc::Allocate(n * sizeof(T)));
-  }
-
-  void deallocate(pointer p, size_type n) { Alloc::Free(p, n * sizeof(T)); }
-
-  size_type max_size() const {
-    return std::numeric_limits<size_t>::max() / sizeof(T);
-  }
-};
-
-#endif  // COMPONENTS_METRICS_LEAK_DETECTOR_STL_ALLOCATOR_H_
diff --git a/components/mus/ws/connection_manager.cc b/components/mus/ws/connection_manager.cc
index 4eeecd6..4938254 100644
--- a/components/mus/ws/connection_manager.cc
+++ b/components/mus/ws/connection_manager.cc
@@ -443,6 +443,7 @@
 void ConnectionManager::OnWindowReordered(ServerWindow* window,
                                           ServerWindow* relative,
                                           mojom::OrderDirection direction) {
+  ProcessWindowReorder(window, relative, direction);
   if (!in_destructor_)
     SchedulePaint(window, gfx::Rect(window->bounds().size()));
 }
diff --git a/components/mus/ws/window_manager_client_apptest.cc b/components/mus/ws/window_manager_client_apptest.cc
index 7da2287d..5a2cd989 100644
--- a/components/mus/ws/window_manager_client_apptest.cc
+++ b/components/mus/ws/window_manager_client_apptest.cc
@@ -413,9 +413,7 @@
   EXPECT_NE(embedded1, embedded2);
 }
 
-// TODO(alhaad): Currently, the RunLoop gets stuck waiting for order change.
-// Debug and re-enable this.
-TEST_F(WindowServerTest, DISABLED_Reorder) {
+TEST_F(WindowServerTest, Reorder) {
   Window* window1 = window_manager()->NewWindow();
   window1->SetVisible(true);
   window_manager()->GetRoot()->AddChild(window1);
@@ -429,29 +427,48 @@
   Window* window12 = embedded->NewWindow();
   window12->SetVisible(true);
   embedded->GetRoot()->AddChild(window12);
+  ASSERT_TRUE(WaitForTreeSizeToMatch(window1, 3u));
 
   Window* root_in_embedded = embedded->GetRoot();
 
   {
-    ASSERT_TRUE(WaitForTreeSizeToMatch(root_in_embedded, 3u));
     window11->MoveToFront();
-    ASSERT_TRUE(WaitForOrderChange(embedded, root_in_embedded));
-
+    // The |embedded| tree should be updated immediately.
     EXPECT_EQ(root_in_embedded->children().front(),
               embedded->GetWindowById(window12->id()));
     EXPECT_EQ(root_in_embedded->children().back(),
               embedded->GetWindowById(window11->id()));
+
+    // The |window_manager()| tree is still not updated.
+    EXPECT_EQ(window1->children().back(),
+              window_manager()->GetWindowById(window12->id()));
+
+    // Wait until |window_manager()| tree is updated.
+    ASSERT_TRUE(WaitForOrderChange(
+        window_manager(), window_manager()->GetWindowById(window11->id())));
+    EXPECT_EQ(window1->children().front(),
+              window_manager()->GetWindowById(window12->id()));
+    EXPECT_EQ(window1->children().back(),
+              window_manager()->GetWindowById(window11->id()));
   }
 
   {
     window11->MoveToBack();
-    ASSERT_TRUE(
-        WaitForOrderChange(embedded, embedded->GetWindowById(window11->id())));
-
+    // |embedded| should be updated immediately.
     EXPECT_EQ(root_in_embedded->children().front(),
               embedded->GetWindowById(window11->id()));
     EXPECT_EQ(root_in_embedded->children().back(),
               embedded->GetWindowById(window12->id()));
+
+    // |window_manager()| is also eventually updated.
+    EXPECT_EQ(window1->children().back(),
+              window_manager()->GetWindowById(window11->id()));
+    ASSERT_TRUE(WaitForOrderChange(
+        window_manager(), window_manager()->GetWindowById(window11->id())));
+    EXPECT_EQ(window1->children().front(),
+              window_manager()->GetWindowById(window11->id()));
+    EXPECT_EQ(window1->children().back(),
+              window_manager()->GetWindowById(window12->id()));
   }
 }
 
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 6f6c3b9..954c3ee78 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -432,8 +432,8 @@
     sources += [
       "compositor/software_output_device_mus.cc",
       "compositor/software_output_device_mus.h",
-      "frame_host/render_widget_host_view_mus.cc",
-      "frame_host/render_widget_host_view_mus.h",
+      "renderer_host/render_widget_host_view_mus.cc",
+      "renderer_host/render_widget_host_view_mus.h",
       "web_contents/web_contents_view_mus.cc",
       "web_contents/web_contents_view_mus.h",
     ]
diff --git a/content/browser/frame_host/render_widget_host_view_mus.cc b/content/browser/renderer_host/render_widget_host_view_mus.cc
similarity index 98%
rename from content/browser/frame_host/render_widget_host_view_mus.cc
rename to content/browser/renderer_host/render_widget_host_view_mus.cc
index 07261341..e371035 100644
--- a/content/browser/frame_host/render_widget_host_view_mus.cc
+++ b/content/browser/renderer_host/render_widget_host_view_mus.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/browser/frame_host/render_widget_host_view_mus.h"
+#include "content/browser/renderer_host/render_widget_host_view_mus.h"
 
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 
diff --git a/content/browser/frame_host/render_widget_host_view_mus.h b/content/browser/renderer_host/render_widget_host_view_mus.h
similarity index 96%
rename from content/browser/frame_host/render_widget_host_view_mus.h
rename to content/browser/renderer_host/render_widget_host_view_mus.h
index 07b15cf..9974e41 100644
--- a/content/browser/frame_host/render_widget_host_view_mus.h
+++ b/content/browser/renderer_host/render_widget_host_view_mus.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
-#define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
+#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
+#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
 
 #include "base/macros.h"
 #include "content/browser/renderer_host/render_widget_host_view_base.h"
@@ -130,4 +130,4 @@
 
 }  // namespace content
 
-#endif  // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
+#endif  // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 2d49124..2201cd0 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -847,10 +847,8 @@
     // It should be OK to not set a default parent since such users will
     // explicitly add this WebContentsViewAura to their tree after they create
     // us.
-    if (root_window) {
-      aura::client::ParentWindowWithContext(
-          window_.get(), root_window, root_window->GetBoundsInScreen());
-    }
+    aura::client::ParentWindowWithContext(window_.get(), root_window,
+                                          root_window->GetBoundsInScreen());
   }
   window_->layer()->SetMasksToBounds(true);
   window_->SetName("WebContentsViewAura");
diff --git a/content/browser/web_contents/web_contents_view_mus.cc b/content/browser/web_contents/web_contents_view_mus.cc
index a0752311..97e45f8 100644
--- a/content/browser/web_contents/web_contents_view_mus.cc
+++ b/content/browser/web_contents/web_contents_view_mus.cc
@@ -5,7 +5,7 @@
 #include "content/browser/web_contents/web_contents_view_mus.h"
 
 #include "build/build_config.h"
-#include "content/browser/frame_host/render_widget_host_view_mus.h"
+#include "content/browser/renderer_host/render_widget_host_view_mus.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/render_widget_host_view.h"
 #include "third_party/WebKit/public/web/WebDragOperation.h"
diff --git a/mojo/BUILD.gn b/mojo/BUILD.gn
index 13970fa..72f8e8f 100644
--- a/mojo/BUILD.gn
+++ b/mojo/BUILD.gn
@@ -97,6 +97,7 @@
   deps += [
     "//mojo/package_manager:unittests",
     "//mojo/services/network:apptests",
+    "//mojo/shell:apptests",
     "//mojo/shell:mojo_shell_unittests",
   ]
 
diff --git a/mojo/shell/application_manager_apptest_driver.cc b/mojo/shell/application_manager_apptest_driver.cc
index 290fc32..dce9762 100644
--- a/mojo/shell/application_manager_apptest_driver.cc
+++ b/mojo/shell/application_manager_apptest_driver.cc
@@ -81,8 +81,7 @@
 
     application_manager->CreateInstanceForHandle(
         mojo::ScopedHandle(mojo::Handle(handle.release().value())),
-        "exe:application_manager_apptest_target",
-        "0");
+        "exe:application_manager_apptest_target");
     // Put the other end on the command line used to launch the target.
     platform_channel_pair.PrepareToPassClientHandleToChildProcess(
         &child_command_line, &handle_passing_info);
diff --git a/mojo/shell/application_manager_apptest_target.cc b/mojo/shell/application_manager_apptest_target.cc
index aa7bc784..fa80ce7 100644
--- a/mojo/shell/application_manager_apptest_target.cc
+++ b/mojo/shell/application_manager_apptest_target.cc
@@ -25,9 +25,9 @@
   // mojo::ApplicationDelegate:
   void Initialize(mojo::ApplicationImpl* app) override {
     CreateInstanceForHandleTestPtr service;
-    app->ConnectToService(
-        mojo::URLRequest::From(std::string("mojo:mojo_shell_apptests")),
-        &service);
+    mojo::ApplicationImpl::ConnectParams params(
+        std::string("mojo:mojo_shell_apptests"));
+    app->ConnectToService(&params, &service);
     service->Ping("From Target");
   }
   bool ConfigureIncomingConnection(
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index adb4705..2a7e469c 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -333,7 +333,6 @@
 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const {
   if (HttpStreamFactory::spdy_enabled() && params_.enable_npn) {
     *npn_protos = next_protos_;
-    DisableHTTP2(npn_protos);
   } else {
     npn_protos->clear();
   }
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h
index 6f8b203..32dd905 100644
--- a/net/http/http_network_transaction.h
+++ b/net/http/http_network_transaction.h
@@ -116,6 +116,8 @@
 
   FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest,
                            ResetStateForRestart);
+  FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, EnableNPN);
+  FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DisableNPN);
   FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest,
                            WindowUpdateReceived);
   FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest,
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 54c689b..b33d9ba 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -81,6 +81,7 @@
 #include "net/ssl/ssl_private_key.h"
 #include "net/test/cert_test_util.h"
 #include "net/websockets/websocket_handshake_stream_base.h"
+#include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/platform_test.h"
 #include "url/gurl.h"
@@ -15466,4 +15467,29 @@
             trans->GetTotalReceivedBytes());
 }
 
+TEST_P(HttpNetworkTransactionTest, EnableNPN) {
+  session_deps_.next_protos = NextProtosDefaults();
+  session_deps_.enable_npn = true;
+
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
+
+  EXPECT_THAT(trans.server_ssl_config_.alpn_protos,
+              testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+  EXPECT_THAT(trans.server_ssl_config_.npn_protos,
+              testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+}
+
+TEST_P(HttpNetworkTransactionTest, DisableNPN) {
+  session_deps_.next_protos = NextProtosDefaults();
+  session_deps_.enable_npn = false;
+
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
+
+  EXPECT_THAT(trans.server_ssl_config_.alpn_protos,
+              testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+  EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty());
+}
+
 }  // namespace net
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index f43d098..b1fcbee 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -64,51 +64,21 @@
 }
 
 // Chop a frame into an array of MockWrites.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) {
-  MockWrite* chunks = new MockWrite[num_chunks];
-  int chunk_size = length / num_chunks;
-  for (int index = 0; index < num_chunks; index++) {
-    const char* ptr = data + (index * chunk_size);
-    if (index == num_chunks - 1)
-      chunk_size += length % chunk_size;  // The last chunk takes the remainder.
-    chunks[index] = MockWrite(ASYNC, ptr, chunk_size);
-  }
-  return chunks;
-}
-
-// Chop a SpdyFrame into an array of MockWrites.
 // |frame| is the frame to chop.
 // |num_chunks| is the number of chunks to create.
 MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks) {
-  return ChopWriteFrame(frame.data(), frame.size(), num_chunks);
-}
-
-// Chop a frame into an array of MockReads.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const char* data, int length, int num_chunks) {
-  MockRead* chunks = new MockRead[num_chunks];
-  int chunk_size = length / num_chunks;
+  MockWrite* chunks = new MockWrite[num_chunks];
+  int chunk_size = frame.size() / num_chunks;
   for (int index = 0; index < num_chunks; index++) {
-    const char* ptr = data + (index * chunk_size);
+    const char* ptr = frame.data() + (index * chunk_size);
     if (index == num_chunks - 1)
-      chunk_size += length % chunk_size;  // The last chunk takes the remainder.
-    chunks[index] = MockRead(ASYNC, ptr, chunk_size);
+      chunk_size +=
+          frame.size() % chunk_size;  // The last chunk takes the remainder.
+    chunks[index] = MockWrite(ASYNC, ptr, chunk_size);
   }
   return chunks;
 }
 
-// Chop a SpdyFrame into an array of MockReads.
-// |frame| is the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks) {
-  return ChopReadFrame(frame.data(), frame.size(), num_chunks);
-}
-
 // Adds headers and values to a map.
 // |extra_headers| is an array of { name, value } pairs, arranged as strings
 // where the even entries are the header names, and the odd entries are the
@@ -413,6 +383,7 @@
       enable_compression(false),
       enable_ping(false),
       enable_user_alternate_protocol_ports(false),
+      enable_npn(true),
       protocol(protocol),
       session_max_recv_window_size(
           SpdySession::GetDefaultInitialWindowSize(protocol)),
@@ -471,6 +442,7 @@
   params.enable_spdy_ping_based_connection_checking = session_deps->enable_ping;
   params.enable_user_alternate_protocol_ports =
       session_deps->enable_user_alternate_protocol_ports;
+  params.enable_npn = session_deps->enable_npn;
   params.spdy_default_protocol = session_deps->protocol;
   params.spdy_session_max_recv_window_size =
       session_deps->session_max_recv_window_size;
@@ -1306,22 +1278,6 @@
   NOTREACHED();
 }
 
-const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) {
-  const SpdyHeaderInfo kHeader = {
-    type,
-    1,                            // Stream ID
-    0,                            // Associated stream ID
-    ConvertRequestPriorityToSpdyPriority(LOWEST, spdy_version_),
-    CONTROL_FLAG_FIN,             // Control Flags
-    false,                        // Compressed
-    RST_STREAM_INVALID,
-    NULL,                         // Data
-    0,                            // Length
-    DATA_FLAG_NONE
-  };
-  return kHeader;
-}
-
 scoped_ptr<SpdyFramer> SpdyTestUtil::CreateFramer(bool compressed) const {
   scoped_ptr<SpdyFramer> framer(new SpdyFramer(spdy_version_));
   framer->set_enable_compression(compressed);
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h
index db6e65c..5316e31 100644
--- a/net/spdy/spdy_test_util_common.h
+++ b/net/spdy/spdy_test_util_common.h
@@ -52,28 +52,11 @@
 // SPDY.
 NextProtoVector SpdyNextProtos();
 
-// Chop a frame into an array of MockWrites.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks);
-
 // Chop a SpdyFrame into an array of MockWrites.
 // |frame| is the frame to chop.
 // |num_chunks| is the number of chunks to create.
 MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks);
 
-// Chop a frame into an array of MockReads.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const char* data, int length, int num_chunks);
-
-// Chop a SpdyFrame into an array of MockReads.
-// |frame| is the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks);
-
 // Adds headers and values to a map.
 // |extra_headers| is an array of { name, value } pairs, arranged as strings
 // where the even entries are the header names, and the odd entries are the
@@ -214,6 +197,7 @@
   bool enable_compression;
   bool enable_ping;
   bool enable_user_alternate_protocol_ports;
+  bool enable_npn;
   NextProto protocol;
   size_t session_max_recv_window_size;
   size_t stream_max_recv_window_size;
@@ -415,11 +399,6 @@
                               SpdyStreamId stream_id,
                               RequestPriority request_priority);
 
-  SpdyFrame* ConstructSpdyGetForProxy(const char* const url,
-                                      bool compressed,
-                                      SpdyStreamId stream_id,
-                                      RequestPriority request_priority) const;
-
   // Constructs a standard SPDY GET SYN frame, optionally compressed.
   // |extra_headers| are the extra header-value pairs, which typically
   // will vary the most between calls.  If |direct| is false, the
@@ -557,8 +536,6 @@
   // class of stream destruction.
   void UpdateWithStreamDestruction(int stream_id);
 
-  const SpdyHeaderInfo MakeSpdyHeader(SpdyFrameType type);
-
   // For versions below SPDY4, adds the version HTTP/1.1 header.
   void MaybeAddVersionHeader(SpdyFrameWithHeaderBlockIR* frame_ir) const;
   void MaybeAddVersionHeader(SpdyHeaderBlock* block) const;
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn
index 23e5fb8..9bfc393 100644
--- a/remoting/host/BUILD.gn
+++ b/remoting/host/BUILD.gn
@@ -579,8 +579,7 @@
         deb_filename,
         changes_filename,
 
-        # TODO(GYP): These files will only be present if we're stripping
-        # binaries. We need to support linux_dump_symbols for this.
+        # TODO(GYP): Check that these are generated by build_deb.py.
         #"$root_build_dir/remoting_me2me_host.debug",
         #"$root_build_dir/remoting_start_host.debug",
         #"$root_build_dir/native_messaging_host.debug",
diff --git a/testing/buildbot/chromium.json b/testing/buildbot/chromium.json
index f47bedd..9cfd9e5 100644
--- a/testing/buildbot/chromium.json
+++ b/testing/buildbot/chromium.json
@@ -23,7 +23,7 @@
   },
   "Linux x64": {
     "additional_compile_targets": [
-      "all"
+      "gn_all"
     ],
     "scripts": [
       {
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 4078baeb..52fb6ad 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1347,4 +1347,6 @@
 
 crbug.com/548765 http/tests/inspector/console-fetch-logging.html [ Failure Pass Slow ]
 
+crbug.com/559300 inspector/layers/layer-canvas-log.html [ Failure ]
+
 crbug.com/549314 [ XP ] inspector-protocol/layout-fonts/unicode-range-combining-chars-fallback.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/W3CImportExpectations b/third_party/WebKit/LayoutTests/W3CImportExpectations
index c2ea093..f13a64e4 100644
--- a/third_party/WebKit/LayoutTests/W3CImportExpectations
+++ b/third_party/WebKit/LayoutTests/W3CImportExpectations
@@ -342,6 +342,7 @@
 imported/web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html [ Skip ]
 imported/web-platform-tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html [ Skip ]
 imported/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html [ Skip ]
+imported/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.sub.html [ Skip ]
 imported/web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html [ Skip ]
 imported/web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html [ Skip ]
 imported/web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html [ Skip ]
@@ -354,6 +355,9 @@
 imported/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent.html [ Skip ]
 imported/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html [ Skip ]
 imported/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html [ Skip ]
+imported/web-platform-tests/html/browsers/windows/noreferrer-window-name.html [ Skip ]
+imported/web-platform-tests/html/browsers/windows/noreferrer.html [ Skip ]
+imported/web-platform-tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html [ Skip ]
 imported/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/009.html [ Skip ]
 imported/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html [ Skip ]
 imported/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012.html [ Skip ]
@@ -453,6 +457,29 @@
 imported/web-platform-tests/shadow-dom/Element-interface-shadowRoot-attribute.html [ Skip ]
 imported/web-platform-tests/shadow-dom/ShadowRoot-interface.html [ Skip ]
 
+# CSS Writing Modes Level 3: Following tests require writing-mode: sideways-*, which we do not plan to support today.
+imported/csswg-test/css-writing-modes-3/block-flow-direction-042.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-043.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-045.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-046.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-047.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-048.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-049.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-050.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-051.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-052.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-053.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-054.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-055.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-056.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-057.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-058.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-059.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-060.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-061.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-062.xht [ Skip ]
+imported/csswg-test/css-writing-modes-3/block-flow-direction-063.xht [ Skip ]
+
 # CSS Writing Modes Level 3: Following tests require applying writing-mode to table-cell, which we do not support today. crbug.com/409155
 imported/csswg-test/css-writing-modes-3/block-flow-direction-017.xht [ Skip ]
 imported/csswg-test/css-writing-modes-3/block-flow-direction-018.xht [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-amplitude-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-amplitude-composition.html
index 43cb9f4..f98726b 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-amplitude-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-amplitude-composition.html
@@ -46,6 +46,7 @@
 assertAttributeInterpolation({
   property: 'amplitude',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-azimuth-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-azimuth-composition.html
index 4a087f3..d2b7cf40 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-azimuth-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-azimuth-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'azimuth',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-bias-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-bias-composition.html
index 2ac454ba..9cebe9d 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-bias-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-bias-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'bias',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-diffuseConstant-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-diffuseConstant-composition.html
index 9954a91..1ad0baf 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-diffuseConstant-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-diffuseConstant-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'diffuseConstant',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-divisor-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-divisor-composition.html
index fdc687f5..b7ce542 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-divisor-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-divisor-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'divisor',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-elevation-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-elevation-composition.html
index 1b638da..da9012bb 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-elevation-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-elevation-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'elevation',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-exponent-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-exponent-composition.html
index 9db687c..bf5abae2 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-exponent-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-exponent-composition.html
@@ -46,6 +46,7 @@
 assertAttributeInterpolation({
   property: 'exponent',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-intercept-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-intercept-composition.html
index 22c805b2..584cc812 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-intercept-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-intercept-composition.html
@@ -46,6 +46,7 @@
 assertAttributeInterpolation({
   property: 'intercept',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-k1-k2-k3-k4-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-k1-k2-k3-k4-composition.html
index 0ad666cc..9cf243d8 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-k1-k2-k3-k4-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-k1-k2-k3-k4-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'k1',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
@@ -90,6 +91,7 @@
 assertAttributeInterpolation({
   property: 'k2',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
@@ -136,6 +138,7 @@
 assertAttributeInterpolation({
   property: 'k3',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
@@ -182,6 +185,7 @@
 assertAttributeInterpolation({
   property: 'k4',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-limitingConeAngle-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-limitingConeAngle-composition.html
index a56ddc9..6489402 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-limitingConeAngle-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-limitingConeAngle-composition.html
@@ -48,6 +48,7 @@
 assertAttributeInterpolation({
   property: 'limitingConeAngle',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-mode-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-mode-composition.html
index df6771b6..b3eb412 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-mode-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-mode-composition.html
@@ -28,6 +28,7 @@
 assertAttributeInterpolation({
   property: 'mode',
   underlying: 'multiply'
+  from: neutralKeyframe,
   to: 'lighten',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-numOctaves-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-numOctaves-composition.html
index d439c118..043e8ad 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-numOctaves-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-numOctaves-composition.html
@@ -60,6 +60,7 @@
 assertAttributeInterpolation({
   property: 'numOctaves',
   underlying: '2',
+  from: neutralKeyframe,
   to: '7',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-offset-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-offset-composition.html
index d0d85e9..3349620 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-offset-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-offset-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'offset',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-orient-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-orient-composition.html
index 9e45c6c..1a8d969 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-orient-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-orient-composition.html
@@ -59,6 +59,7 @@
 assertAttributeInterpolation({
   property: 'orient',
   underlying: '20',
+  from: neutralKeyframe,
   to: '180',
   toComposite: 'replace'
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pathLength-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pathLength-composition.html
index 944d7d1..d8b095f 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pathLength-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pathLength-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'pathLength',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-points-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-points-composition.html
index 68a2571..5d1217c 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-points-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-points-composition.html
@@ -108,6 +108,7 @@
 assertAttributeInterpolation({
   property: 'points',
   underlying: '10 10, 20 20',
+  from: neutralKeyframe,
   to: '90 90, -10 -10',
   toComposite: 'replace',
 }, [
@@ -122,6 +123,7 @@
 assertAttributeInterpolation({
   property: 'points',
   underlying: '10 10, 20 20',
+  from: neutralKeyframe,
   to: '90 90, -10 -10, 50 50',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pointsAtX-pointsAtY-pointsAtZ-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pointsAtX-pointsAtY-pointsAtZ-composition.html
index 9376bae..cec17a59 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pointsAtX-pointsAtY-pointsAtZ-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-pointsAtX-pointsAtY-pointsAtZ-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'pointsAtX',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
@@ -90,6 +91,7 @@
 assertAttributeInterpolation({
   property: 'pointsAtY',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
@@ -136,6 +138,7 @@
 assertAttributeInterpolation({
   property: 'pointsAtZ',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-scale-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-scale-composition.html
index 113e2d09..d85756a 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-scale-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-scale-composition.html
@@ -48,6 +48,7 @@
 assertAttributeInterpolation({
   property: 'scale',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-seed-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-seed-composition.html
index b99da63..40c28d7 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-seed-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-seed-composition.html
@@ -48,6 +48,7 @@
 assertAttributeInterpolation({
   property: 'seed',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-slope-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-slope-composition.html
index 06cdd16..f21c4fa 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-slope-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-slope-composition.html
@@ -46,6 +46,7 @@
 assertAttributeInterpolation({
   property: 'slope',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularConstant-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularConstant-composition.html
index e7353465..f204f48 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularConstant-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularConstant-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'specularConstant',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularExponent-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularExponent-composition.html
index 170b1e47..24ee1b8f 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularExponent-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-specularExponent-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'specularExponent',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-surfaceScale-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-surfaceScale-composition.html
index f3852de3..35abf4d 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-surfaceScale-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-surfaceScale-composition.html
@@ -44,6 +44,7 @@
 assertAttributeInterpolation({
   property: 'surfaceScale',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-z-composition.html b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-z-composition.html
index 23a2fe84..f83dcaf 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-z-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-composition/svg-z-composition.html
@@ -48,6 +48,7 @@
 assertAttributeInterpolation({
   property: 'z',
   underlying: '5',
+  from: neutralKeyframe,
   to: '10',
   toComposite: 'replace',
 }, [
diff --git a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
index 6e24685b..923c5879 100644
--- a/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
+++ b/third_party/WebKit/LayoutTests/animations/svg-attribute-interpolation/resources/interpolation-test.js
@@ -3,22 +3,26 @@
  * found in the LICENSE file.
  *
  * Exported function:
- *  - assertAttributeInterpolation({property, [from], [to], [fromComposite], [toComposite], [underlying]}, [{at: fraction, is: value}])
+ *  - assertAttributeInterpolation({property, from, to, [fromComposite], [toComposite], [underlying]}, [{at: fraction, is: value}])
  *        Constructs a test case for each fraction that asserts the expected value
  *        equals the value produced by interpolation between from and to composited
  *        onto underlying by fromComposite and toComposite respectively using
  *        SMIL and Web Animations.
- *        If from or to are missing then a neutral keyframe will be used and the
- *        composite mode will be forced to be 'add'.
+ *        Set from/to to the exported neutralKeyframe object to specify neutral keyframes.
  *        SMIL will only be tested with equal fromComposite and toComposite values.
 */
 'use strict';
 (() => {
   var interpolationTests = [];
+  var neutralKeyframe = {};
 
   // Set to true to output rebaselined test expectations.
   var rebaselineTests = false;
 
+  function isNeutralKeyframe(keyframe) {
+    return keyframe === neutralKeyframe;
+  }
+
   function createElement(tagName, container) {
     var element = document.createElement(tagName);
     if (container) {
@@ -320,23 +324,19 @@
         // Replace 'transform' with 'svgTransform', etc. This avoids collisions with CSS properties or the Web Animations API (offset).
         var prefixedProperty = 'svg' + params.property[0].toUpperCase() + params.property.slice(1);
         var keyframes = [];
-        if ('from' in params) {
+        if (!isNeutralKeyframe(params.from)) {
           keyframes.push({
             offset: 0,
             [prefixedProperty]: params.from,
             composite: params.fromComposite,
           });
-        } else {
-          console.assert(params.fromComposite === 'add');
         }
-        if ('to' in params) {
+        if (!isNeutralKeyframe(params.to)) {
           keyframes.push({
             offset: 1,
             [prefixedProperty]: params.to,
             composite: params.toComposite,
           });
-        } else {
-          console.assert(params.toComposite === 'add');
         }
         target.animate(keyframes, {
           fill: 'forwards',
@@ -372,29 +372,44 @@
     var targets = [];
     for (var interpolationTest of interpolationTests) {
       var params = interpolationTest.params;
-      params.fromComposite = 'from' in params ? (params.fromComposite || 'replace') : 'add';
-      params.toComposite = 'to' in params ? (params.toComposite || 'replace') : 'add';
+      assert_true('property' in params);
+      assert_true('from' in params);
+      assert_true('to' in params);
+      params.fromComposite = isNeutralKeyframe(params.from) ? 'add' : (params.fromComposite || 'replace');
+      params.toComposite = isNeutralKeyframe(params.to) ? 'add' : (params.toComposite || 'replace');
       var underlyingText = params.underlying ? `with underlying [${params.underlying}] ` : '';
-      var fromText = 'from' in params ? `${params.fromComposite} [${params.from}]` : 'neutral';
-      var toText = 'to' in params ? `${params.toComposite} [${params.to}]` : 'neutral';
+      var fromText = isNeutralKeyframe(params.from) ? 'neutral' : `${params.fromComposite} [${params.from}]`;
+      var toText = isNeutralKeyframe(params.to) ? 'neutral' : `${params.toComposite} [${params.to}]`;
       var description = `Interpolate attribute <${params.property}> ${underlyingText}from ${fromText} to ${toText}`;
 
     if (rebaselineTests) {
         var rebaseline = createElement('pre', rebaselineContainer);
 
-        var fromCode = 'from' in params ? `
-  from: '${params.from}',
-  fromComposite: '${params.fromComposite}',` : '';
+        var assertionCode =
+          `assertAttributeInterpolation({\n` +
+          `  property: '${params.property}',\n` +
+          `  underlying: '${params.underlying}',\n`;
 
-        var toCode = 'to' in params ? `
-  to: '${params.to}',
-  toComposite: '${params.toComposite}',` : '';
 
-        rebaseline.appendChild(document.createTextNode(`\
-assertAttributeInterpolation({
-  property: '${params.property}',
-  underlying: '${params.underlying}',${fromCode}${toCode}
-}, [\n`));
+        if (isNeutralKeyframe(params.from)) {
+          assertionCode += `  from: neutralKeyframe,\n`;
+        } else {
+          assertionCode +=
+            `  from: '${params.from}',\n` +
+            `  fromComposite: '${params.fromComposite}',\n`;
+        }
+
+        if (isNeutralKeyframe(params.to)) {
+          assertionCode += `  to: neutralKeyframe,\n`;
+        } else {
+          assertionCode +=
+            `  to: '${params.to}',\n` +
+            `  fromComposite: '${params.fromComposite}',\n`;
+        }
+
+        assertionCode += `\n}, [\n`;
+
+        rebaseline.appendChild(document.createTextNode(assertionCode));
         var rebaselineExpectation;
         rebaseline.appendChild(rebaselineExpectation = document.createTextNode(''));
         rebaseline.appendChild(document.createTextNode(']);\n\n'));
@@ -461,4 +476,5 @@
   });
 
   window.assertAttributeInterpolation = assertAttributeInterpolation;
+  window.neutralKeyframe = neutralKeyframe;
 })();
diff --git a/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
index 0c6b662..b41aaec 100644
--- a/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -25,6 +25,7 @@
               ]
             },
             {
+              "bounds": [302, 302],
               "children": [
                 {
                   "position": [1, 286],
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context-expected.html b/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context-expected.html
index 31f2f32..a5859ca 100644
--- a/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context-expected.html
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context-expected.html
@@ -3,6 +3,10 @@
 <head>
 <style>
 
+div {
+  width: 800px;
+}
+
 span {
   position: absolute;
   width: 120px;
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context.html b/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context.html
index b117987..e9b024e 100644
--- a/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context.html
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/path-establishes-stacking-context.html
@@ -3,6 +3,10 @@
 <head>
 <style>
 
+div {
+  width: 800px;
+}
+
 span {
   position: absolute;
   width: 120px;
@@ -32,7 +36,7 @@
 }
 
 #div1 {
-  motion-path: path('M0,0');
+  motion-path: path('M400,0');
 }
 
 #div2 {
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/zero-length-expected.html b/third_party/WebKit/LayoutTests/css3/motion-path/zero-length-expected.html
new file mode 100644
index 0000000..3184a89
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/zero-length-expected.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#div1 {
+    position: absolute;
+    transform: translate(100px, 100px);
+    transform-origin: 0 0;
+}
+</style>
+</head>
+<body>
+<div id="div1">div1</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/zero-length.html b/third_party/WebKit/LayoutTests/css3/motion-path/zero-length.html
new file mode 100644
index 0000000..5d89601cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/zero-length.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#div1 {
+    position: absolute;
+    motion: path('M100,100L100,100') 0deg 0%;
+    transform-origin: 0 0;
+}
+</style>
+</head>
+<body>
+<div id="div1">div1</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-002.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-002.xht
index 800854dc..257f7ce 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-002.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-002.xht
@@ -15,9 +15,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-rl;
-  }
+    {
+      writing-mode: vertical-rl;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -26,22 +26,28 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.right-border { border-right: blue solid 1em; }
+  div.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-003.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-003.xht
index e2616223..5651161 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-003.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-003.xht
@@ -15,9 +15,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-lr;
-  }
+    {
+      writing-mode: vertical-lr;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -26,22 +26,28 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.left-border { border-left: blue solid 1em; }
+  div.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  div#right-border { border-right: blue solid 1em; }
+  div#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-005.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-005.xht
index 0c6c66bd..a2ab505 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-005.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-005.xht
@@ -15,23 +15,29 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#floated-left
-  {
-  background-color: blue;
-  border-top: blue solid 1em;
-  float: left;
-  height: 8em;
-  writing-mode: vertical-rl;
-  }
+    {
+      background-color: blue;
+      border-top: blue solid 1em;
+      float: left;
+      height: 8em;
+      writing-mode: vertical-rl;
+    }
 
-  div.right-border { border-right: blue solid 1em; }
+  div.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-006.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-006.xht
index 26173c4..3b1c6823 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-006.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-006.xht
@@ -15,22 +15,25 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div.floated-left
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-left: blue solid 1em;
-  border-top: blue solid 1em;
-  float: left;
-  writing-mode: vertical-rl;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-left: blue solid 1em;
+      border-top: blue solid 1em;
+      float: left;
+      writing-mode: vertical-rl;
+    }
 
-  div#right-border { border-right: blue solid 1em; }
+  div#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-007.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-007.xht
index 3814aef0..0a94be7 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-007.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-007.xht
@@ -15,23 +15,29 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#floated-right
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  float: right;
-  writing-mode: vertical-lr;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+      float: right;
+      writing-mode: vertical-lr;
+    }
 
-  div.left-border { border-left: blue solid 1em; }
+  div.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  div#right-border { border-right: blue solid 1em; }
+  div#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-008.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-008.xht
index ad49de4..4db0ef9 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-008.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-008.xht
@@ -15,22 +15,25 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div.floated-right
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-right: blue solid 1em;
-  border-top: blue solid 1em;
-  float: right;
-  writing-mode: vertical-lr;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-right: blue solid 1em;
+      border-top: blue solid 1em;
+      float: right;
+      writing-mode: vertical-lr;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-009.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-009.xht
index 1ff779b..7150801 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-009.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-009.xht
@@ -15,29 +15,35 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#abs-pos
-  {
-  height: 9em;
-  left: auto;
-  position: absolute;
-  writing-mode: vertical-rl;
-  }
+    {
+      height: 9em;
+      left: auto;
+      position: absolute;
+      writing-mode: vertical-rl;
+    }
 
   div#abs-pos > div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.right-border { border-right: blue solid 1em; }
+  div.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-010.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-010.xht
index cca46d3..3b4c8fe3 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-010.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-010.xht
@@ -15,29 +15,35 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#abs-pos
-  {
-  height: 9em;
-  left: auto;
-  position: absolute;
-  writing-mode: vertical-lr;
-  }
+    {
+      height: 9em;
+      left: auto;
+      position: absolute;
+      writing-mode: vertical-lr;
+    }
 
   div#abs-pos > div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.left-border { border-left: blue solid 1em; }
+  div.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  div#right-border { border-right: blue solid 1em; }
+  div#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-011.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-011.xht
index 803801b3..5fa2880 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-011.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-011.xht
@@ -11,37 +11,45 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl'
- establishes a block formating context with a right-to-left block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl' establishes a block formating context with a right-to-left block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#inline-block
-  {
-  background-color: blue;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  vertical-align: top;
+    {
+      background-color: blue;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      vertical-align: top;
   /*
   Why 'vertical-align: top' ?
   See
   http://lists.w3.org/Archives/Public/public-css-testsuite/2014Dec/0013.html
   for explanations
   */
-  writing-mode: vertical-rl;
-  }
+      writing-mode: vertical-rl;
+    }
 
-  span { display: block; }
+  span
+    {
+      display: block;
+    }
 
-  span.right-border { border-right: blue solid 1em; }
+  span.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  span#left-border { border-left: blue solid 1em; }
+  span#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-012.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-012.xht
index 960908b..c29d25e 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-012.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-012.xht
@@ -11,39 +11,41 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl'
- establishes a block formating context with a right-to-left block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl' establishes a block formating context with a right-to-left block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#inline-block
-  {
-  background-color: blue;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  vertical-align: top;
+    {
+      background-color: blue;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      vertical-align: top;
   /*
   Why 'vertical-align: top' ?
   See
   http://lists.w3.org/Archives/Public/public-css-testsuite/2014Dec/0013.html
   for explanations
   */
-  writing-mode: vertical-rl;
-  }
+      writing-mode: vertical-rl;
+    }
 
   span
-  {
-  border-right: blue solid 1em;
-  display: block;
-  }
+    {
+      border-right: blue solid 1em;
+      display: block;
+    }
 
-  span#left-border { border-left: blue solid 1em; }
+  span#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-013.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-013.xht
index bb8ad15..498df62 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-013.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-013.xht
@@ -11,36 +11,41 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl'
- establishes a block formating context with a right-to-left block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-rl' establishes a block formating context with a right-to-left block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div.inline-block
-  {
-  background-color: blue;
-  border-right: blue solid 1em;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  vertical-align: top;
+    {
+      background-color: blue;
+      border-right: blue solid 1em;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      vertical-align: top;
   /*
   Why 'vertical-align: top' ?
   See
   http://lists.w3.org/Archives/Public/public-css-testsuite/2014Dec/0013.html
   for explanations
   */
-  writing-mode: vertical-rl;
-  }
+      writing-mode: vertical-rl;
+    }
 
-  span { display: block; }
+  span
+    {
+      display: block;
+    }
 
-  span#left-border { border-left: blue solid 1em; }
+  span#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-014.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-014.xht
index da7cf3ac..27dfad7 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-014.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-014.xht
@@ -11,37 +11,45 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr'
- establishes a block formating context with a left-to-right block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr' establishes a block formating context with a left-to-right block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#inline-block
-  {
-  background-color: blue;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  vertical-align: top;
+    {
+      background-color: blue;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      vertical-align: top;
   /*
   Why 'vertical-align: top' ?
   See
   http://lists.w3.org/Archives/Public/public-css-testsuite/2014Dec/0013.html
   for explanations
   */
-  writing-mode: vertical-lr;
-  }
+      writing-mode: vertical-lr;
+    }
 
-  span { display: block; }
+  span
+    {
+      display: block;
+    }
 
-  span.left-border { border-left: blue solid 1em; }
+  span.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  span#right-border { border-right: blue solid 1em; }
+  span#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-015.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-015.xht
index 6c3d1ab3..258b525 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-015.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-015.xht
@@ -11,32 +11,34 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr'
- establishes a block formating context with a left-to-right block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr' establishes a block formating context with a left-to-right block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#inline-block
-  {
-  background-color: blue;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  writing-mode: vertical-lr;
-  }
+    {
+      background-color: blue;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      writing-mode: vertical-lr;
+    }
 
   span
-  {
-  border-left: blue solid 1em;
-  display: block;
-  }
+    {
+      border-left: blue solid 1em;
+      display: block;
+    }
 
-  span#right-border { border-right: blue solid 1em; }
+  span#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
@@ -46,7 +48,7 @@
 
     <div id="inline-block">
 
-<!--  The  "P"  --> <span>AAAAAAA B&nbsp; C&nbsp;&nbsp; D&nbsp; E&nbsp;&nbsp; FFFF&nbsp;&nbsp;</span>
+<!--  The "P"  --> <span>AAAAAAA B&nbsp; C&nbsp;&nbsp; D&nbsp; E&nbsp;&nbsp; FFFF&nbsp;&nbsp;</span>
 
 <!--  The "A"  --> <span>GGGGGGG H&nbsp; J&nbsp;&nbsp; K&nbsp; L&nbsp;&nbsp; MMMMMMM</span>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-016.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-016.xht
index 55b6a28..117f408ba 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-016.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-016.xht
@@ -11,36 +11,41 @@
   <link rel="match" href="block-flow-direction-001-ref.xht" />
 
   <meta content="ahem" name="flags" />
-  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr'
- establishes a block formating context with a left-to-right block flow direction." name="assert" />
+  <meta content="This test checks that an inline-block with its 'writing-mode' set to 'vertical-lr' establishes a block formating context with a left-to-right block flow direction." name="assert" />
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div.inline-block
-  {
-  background-color: blue;
-  border-left: blue solid 1em;
-  border-top: blue solid 1em;
-  display: inline-block;
-  height: 8em;
-  vertical-align: top;
+    {
+      background-color: blue;
+      border-left: blue solid 1em;
+      border-top: blue solid 1em;
+      display: inline-block;
+      height: 8em;
+      vertical-align: top;
   /*
   Why 'vertical-align: top' ?
   See
   http://lists.w3.org/Archives/Public/public-css-testsuite/2014Dec/0013.html
   for explanations
   */
-  writing-mode: vertical-lr;
-  }
+      writing-mode: vertical-lr;
+    }
 
-  span { display: block; }
+  span
+    {
+      display: block;
+    }
 
-  span#right-border { border-right: blue solid 1em; }
+  span#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-019.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-019.xht
index ca784745..43ebc1e 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-019.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-019.xht
@@ -15,28 +15,34 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#table-caption
-  {
-  display: table-caption;
-  height: 9em;
-  writing-mode: vertical-rl;
-  }
+    {
+      display: table-caption;
+      height: 9em;
+      writing-mode: vertical-rl;
+    }
 
   div#table-caption > div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.right-border { border-right: blue solid 1em; }
+  div.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-020.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-020.xht
index 59fcb4c..31d3a46 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-020.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-020.xht
@@ -15,28 +15,34 @@
 
   <style type="text/css"><![CDATA[
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+    }
 
   div#table-caption
-  {
-  display: table-caption;
-  height: 9em;
-  writing-mode: vertical-lr;
-  }
+    {
+      display: table-caption;
+      height: 9em;
+      writing-mode: vertical-lr;
+    }
 
   div#table-caption > div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div.left-border { border-left: blue solid 1em; }
+  div.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  div#right-border { border-right: blue solid 1em; }
+  div#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-021.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-021.xht
index 6980c85..9a38957 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-021.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-021.xht
@@ -15,9 +15,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-rl;
-  }
+    {
+      writing-mode: vertical-rl;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -26,24 +26,30 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   ul
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  list-style: none outside url("support/blue1x1.png");
-  margin: 0em;
-  padding-top: 1em; /* overriding default -webkit-padding-start: 40px in several browsers */
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      list-style: none outside url("support/blue1x1.png");
+      margin: 0em;
+      padding-top: 1em; /* overriding default -webkit-padding-start: 40px in several browsers */
+    }
 
-  ul.right-border { border-right: blue solid 1em; }
+  ul.right-border
+    {
+      border-right: blue solid 1em;
+    }
 
-  ul#left-border { border-left: blue solid 1em; }
+  ul#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-022.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-022.xht
index 868fcbd..e652e15 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-022.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-022.xht
@@ -15,9 +15,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-lr;
-  }
+    {
+      writing-mode: vertical-lr;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -26,24 +26,30 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   ul
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  list-style: none outside url("support/blue1x1.png");
-  margin: 0em;
-  padding-top: 1em; /* overriding default 40px in several browsers */
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      list-style: none outside url("support/blue1x1.png");
+      margin: 0em;
+      padding-top: 1em; /* overriding default 40px in several browsers */
+    }
 
-  ul.left-border { border-left: blue solid 1em; }
+  ul.left-border
+    {
+      border-left: blue solid 1em;
+    }
 
-  ul#right-border { border-right: blue solid 1em; }
+  ul#right-border
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-023.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-023.xht
index 42436d4b..edf0223c 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-023.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-023.xht
@@ -19,9 +19,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-lr;
-  }
+    {
+      writing-mode: vertical-lr;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -30,20 +30,23 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   div
-  {
-  background-color: blue;
-  border: blue solid 1em;
-  border-right: blue none 0em;
-  }
+    {
+      background-color: blue;
+      border: blue solid 1em;
+      border-right: blue none 0em;
+    }
 
-  div#right-most { border-right: blue solid 1em; }
+  div#right-most
+    {
+      border-right: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-024.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-024.xht
index 902be60..5da9dc1 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-024.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/block-flow-direction-024.xht
@@ -19,9 +19,9 @@
 
   <style type="text/css"><![CDATA[
   html
-  {
-  writing-mode: vertical-rl;
-  }
+    {
+      writing-mode: vertical-rl;
+    }
   /*
   "
   The principal writing mode of the document is determined by the writing-mode
@@ -30,21 +30,24 @@
   */
 
   body
-  {
-  color: yellow;
-  font: 20px/1 Ahem;
-  height: 9em;
-  }
+    {
+      color: yellow;
+      font: 20px/1 Ahem;
+      height: 9em;
+    }
 
   div
-  {
-  background-color: blue;
-  border-bottom: blue solid 1em;
-  border-right: blue solid 1em;
-  border-top: blue solid 1em;
-  }
+    {
+      background-color: blue;
+      border-bottom: blue solid 1em;
+      border-right: blue solid 1em;
+      border-top: blue solid 1em;
+    }
 
-  div#left-border { border-left: blue solid 1em; }
+  div#left-border
+    {
+      border-left: blue solid 1em;
+    }
   ]]></style>
  </head>
 
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006-expected.html b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006-expected.html
index 04a9d41..0773bf50 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006-expected.html
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006-expected.html
@@ -10,11 +10,12 @@
 .outline {
   color:orange;
   display:inline-block;
-  margin-left:3em;
   outline:blue solid 2px;
 }
 </style>
 <p>Test passes if inside of blue rectangles are orange.
 <div class="container">
-  <span class="outline">1<br>2</span>
+  <span class="outline" style="margin-left:1em">1</span><br>
+  <span class="outline" style="margin-left:3em">1<br>2</span><br>
+  <span class="outline" style="margin-left:5em">1<br>2<br>X</span>
 </div>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006.html b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006.html
index 15a9657d..f7794613 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006.html
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/outline-inline-block-vrl-006.html
@@ -9,7 +9,7 @@
 .container {
   color:transparent;
   font:50px/1 Ahem;
-  height:5em;
+  height:6em;
   writing-mode:vertical-rl;
 }
 .outline {
@@ -24,9 +24,9 @@
     Additional div to ensure that the origin of the containing block of the
     outline span is different from the origin of the writing mode root.
    -->
+  <div>123<span class="outline">XXX</span></div>
+  <div>12345 6<span class="outline">XX</span></div>
   <div>1</div>
-  <div>12345<span class="outline">67</span></div>
-  <div>1</div>
-  <div>1</div>
+  <div><span class="outline">1</span></div>
   <div>1</div>
 </div>
diff --git a/third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png
similarity index 100%
rename from third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png
rename to third_party/WebKit/LayoutTests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
similarity index 100%
copy from third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png
copy to third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
similarity index 100%
copy from third_party/WebKit/LayoutTests/scrollbars/border-box-rect-clips-scrollbars-expected.png
copy to third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
new file mode 100644
index 0000000..ee3d294
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -0,0 +1,63 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [500, 500],
+          "drawsContent": true,
+          "repaintRects": [
+            [-2000, -2000, 5000, 5000]
+          ],
+          "children": [
+            {
+              "bounds": [485, 485],
+              "children": [
+                {
+                  "bounds": [5000, 5000],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 0, 5000, 5000]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='content'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [500, 500],
+              "children": [
+                {
+                  "position": [0, 485],
+                  "bounds": [485, 15],
+                  "repaintRects": [
+                    [0, 0, 485, 15]
+                  ]
+                },
+                {
+                  "position": [485, 0],
+                  "bounds": [15, 485],
+                  "repaintRects": [
+                    [0, 0, 15, 485]
+                  ]
+                },
+                {
+                  "position": [485, 485],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
new file mode 100644
index 0000000..b172a4e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
@@ -0,0 +1,69 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidationClients": [
+        "LayoutBlockFlow HTML",
+        "LayoutBlockFlow BODY"
+      ],
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [200, 200],
+          "contentsOpaque": true,
+          "drawsContent": true,
+          "backgroundColor": "#D3D3D3",
+          "repaintRects": [
+            [0, 160, 21, 19]
+          ],
+          "paintInvalidationClients": [
+            "LayoutBlockFlow DIV id='scroller'"
+          ],
+          "children": [
+            {
+              "bounds": [185, 185],
+              "children": [
+                {
+                  "bounds": [200, 1620],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 610, 21, 19]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='scroller'",
+                    "LayoutBlockFlow DIV id='target'",
+                    "LayoutText #text",
+                    "InlineTextBox 'test'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [200, 200],
+              "children": [
+                {
+                  "position": [0, 185],
+                  "bounds": [185, 15]
+                },
+                {
+                  "position": [185, 0],
+                  "bounds": [15, 185]
+                },
+                {
+                  "position": [185, 185],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/css3/flexbox/flexbox-baseline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/css3/flexbox/flexbox-baseline-expected.png
index 572c3f0..cb189ac 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/css3/flexbox/flexbox-baseline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/css3/flexbox/flexbox-baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/replaced/width100percent-textarea-expected.png
index 410f75de..5bdfe9c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..7601080
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..be208ef
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..7601080
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/overflow/textarea-scroll-touch-expected.txt
index a473b6cf..4e9eea9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/css3/flexbox/flexbox-baseline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/css3/flexbox/flexbox-baseline-expected.png
index 87b873a..4a43cfe2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/css3/flexbox/flexbox-baseline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/css3/flexbox/flexbox-baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/replaced/width100percent-textarea-expected.png
index 9654f9a..c785c8a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..2c368c2d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
index a473b6cf..4e9eea9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..ef12d9f2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..2c368c2d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/iframes/resizer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/iframes/resizer-expected.txt
index d3f3b06..49e8cde 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/iframes/resizer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/iframes/resizer-expected.txt
@@ -52,9 +52,14 @@
               ]
             },
             {
-              "position": [287, 137],
-              "bounds": [15, 15],
-              "drawsContent": true
+              "bounds": [304, 154],
+              "children": [
+                {
+                  "position": [287, 137],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
             }
           ]
         }
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt
index d02628e..10d67a88 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [800, 600],
               "children": [
                 {
                   "position": [785, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
index f100ff5..5ce42ac 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -25,6 +25,7 @@
               ]
             },
             {
+              "bounds": [302, 302],
               "children": [
                 {
                   "position": [1, 286],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
index 6f8531a..33ff673 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
@@ -62,6 +62,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/clear-scroll-parent-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/clear-scroll-parent-expected.txt
index 9897bf2..24e6bde 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/clear-scroll-parent-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/clear-scroll-parent-expected.txt
@@ -23,6 +23,7 @@
               ]
             },
             {
+              "bounds": [308, 208],
               "children": [
                 {
                   "position": [289, 4],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/composited-scrolling-paint-phases-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/composited-scrolling-paint-phases-expected.txt
index 95b24d1..c44da56 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/composited-scrolling-paint-phases-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/composited-scrolling-paint-phases-expected.txt
@@ -74,6 +74,7 @@
                   ]
                 },
                 {
+                  "bounds": [202, 202],
                   "paintingPhases": [
                     "GraphicsLayerPaintBackground",
                     "GraphicsLayerPaintForeground",
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/content-gains-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/content-gains-scrollbars-expected.txt
index 444bcb4..aa0a47e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/content-gains-scrollbars-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/content-gains-scrollbars-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 0],
@@ -56,6 +57,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -86,6 +88,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -120,6 +123,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 85],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/overflow-scrollbar-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/overflow-scrollbar-layers-expected.txt
index 444bcb4..aa0a47e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/overflow-scrollbar-layers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/overflow-scrollbar-layers-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 0],
@@ -56,6 +57,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -86,6 +88,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -120,6 +123,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 85],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
index 1331fea..de87e717 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
@@ -55,6 +55,7 @@
           "bounds": [1200, 1000],
           "children": [
             {
+              "bounds": [1200, 1000],
               "children": [
                 {
                   "position": [1193, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-absolute-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-absolute-expected.txt
index 87b5990..545b2e7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-absolute-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-absolute-expected.txt
@@ -27,6 +27,7 @@
                   ]
                 },
                 {
+                  "bounds": [500, 500],
                   "children": [
                     {
                       "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
index dfc3b5c..3e92e6b8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
@@ -58,6 +58,7 @@
         },
         {
           "position": [98, 90],
+          "bounds": [102, 102],
           "children": [
             {
               "position": [94, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
index 99f929a..f0c1146 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
@@ -20,6 +20,7 @@
               ]
             },
             {
+              "bounds": [320, 340],
               "children": [
                 {
                   "position": [0, 325],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-without-painting-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-without-painting-expected.txt
index 9a9a59e..3b5d109 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-without-painting-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/scrolling-without-painting-expected.txt
@@ -23,6 +23,7 @@
               ]
             },
             {
+              "bounds": [202, 202],
               "children": [
                 {
                   "position": [1, 186],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index 7c2197f..79dee4ad 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -138,10 +139,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2466],
+  "bounds": [785, 2481],
   "children": [
     {
-      "bounds": [785, 2466],
+      "bounds": [785, 2481],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -163,6 +164,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -262,10 +264,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4326],
+  "bounds": [785, 4356],
   "children": [
     {
-      "bounds": [785, 4326],
+      "bounds": [785, 4356],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -284,6 +286,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -383,10 +386,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6141],
+  "bounds": [785, 6186],
   "children": [
     {
-      "bounds": [785, 6141],
+      "bounds": [785, 6186],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -405,6 +408,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-expected.txt
index 2d3f1d6..476204a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -135,10 +136,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2403],
+  "bounds": [785, 2418],
   "children": [
     {
-      "bounds": [785, 2403],
+      "bounds": [785, 2418],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -157,6 +158,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -256,10 +258,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4218],
+  "bounds": [785, 4248],
   "children": [
     {
-      "bounds": [785, 4218],
+      "bounds": [785, 4248],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -278,6 +280,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 9ccd40d7..154a301 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -135,10 +136,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2421],
+  "bounds": [785, 2436],
   "children": [
     {
-      "bounds": [785, 2421],
+      "bounds": [785, 2436],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -160,6 +161,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -259,10 +261,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4281],
+  "bounds": [785, 4311],
   "children": [
     {
-      "bounds": [785, 4281],
+      "bounds": [785, 4311],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -284,6 +286,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -383,10 +386,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6141],
+  "bounds": [785, 6186],
   "children": [
     {
-      "bounds": [785, 6141],
+      "bounds": [785, 6186],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -405,6 +408,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/textarea-scroll-touch-expected.txt
index d77a2aa..2ced3c6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -60,6 +61,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
index f30493ed..3da12b3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
@@ -26,6 +26,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -87,6 +88,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -143,6 +145,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -207,6 +210,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -268,6 +272,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -324,6 +329,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -384,6 +390,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -437,6 +444,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -491,6 +499,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -551,6 +560,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -612,6 +622,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -672,6 +683,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/updating-scrolling-content-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/updating-scrolling-content-expected.txt
index d9e0f1fb..1411ec6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/updating-scrolling-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/overflow/updating-scrolling-content-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 99d68de..43d00ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/scrollbars/nested-overlay-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/scrollbars/nested-overlay-scrollbars-expected.txt
index 767a7a5..ece2a700 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/scrollbars/nested-overlay-scrollbars-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/scrollbars/nested-overlay-scrollbars-expected.txt
@@ -57,6 +57,7 @@
                     },
                     {
                       "position": [2, 502],
+                      "bounds": [204, 204],
                       "children": [
                         {
                           "position": [2, 195],
@@ -80,6 +81,7 @@
               ]
             },
             {
+              "bounds": [404, 404],
               "children": [
                 {
                   "position": [395, 2],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/squashing/composited-bounds-for-negative-z-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/squashing/composited-bounds-for-negative-z-expected.txt
index 6554d17..bee8371 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/squashing/composited-bounds-for-negative-z-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/squashing/composited-bounds-for-negative-z-expected.txt
@@ -35,6 +35,7 @@
                   ]
                 },
                 {
+                  "bounds": [300, 300],
                   "children": [
                     {
                       "position": [285, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/update-paint-phases-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/update-paint-phases-expected.txt
index 267c8e1..9bd3514 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/update-paint-phases-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/compositing/update-paint-phases-expected.txt
@@ -48,6 +48,7 @@
               ]
             },
             {
+              "bounds": [102, 102],
               "paintingPhases": [
                 "GraphicsLayerPaintBackground",
                 "GraphicsLayerPaintForeground",
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/css3/flexbox/flexbox-baseline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/css3/flexbox/flexbox-baseline-expected.png
index 406fe09..429dd78 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/css3/flexbox/flexbox-baseline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/css3/flexbox/flexbox-baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-move-after-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-move-after-scroll-expected.txt
index 2f5cdaa..04f34ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-move-after-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-move-after-scroll-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [700, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-scroll-after-move-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-scroll-after-move-expected.txt
index 197433d..8000cd2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-scroll-after-move-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/repaint/overflow-scroll-after-move-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [300, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/replaced/width100percent-textarea-expected.png
index 43fab31..06fb809fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/invalidation/invalidate-after-composited-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/invalidation/invalidate-after-composited-scroll-expected.txt
index 6a2e951e..d4c77521 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/invalidation/invalidate-after-composited-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/invalidation/invalidate-after-composited-scroll-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [185, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/selection/selection-within-composited-scroller-expected.txt
index 3e848598..dc2e7c9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/selection/selection-within-composited-scroller-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/paint/selection/selection-within-composited-scroller-expected.txt
@@ -43,6 +43,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..35333a177
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
index 6f8531a..33ff673 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/accelerated-overflow-scroll-should-not-affect-perspective-expected.txt
@@ -62,6 +62,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
index 9897bf2..24e6bde 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
@@ -23,6 +23,7 @@
               ]
             },
             {
+              "bounds": [308, 208],
               "children": [
                 {
                   "position": [289, 4],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/composited-scrolling-paint-phases-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/composited-scrolling-paint-phases-expected.txt
index 95b24d1..c44da56 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/composited-scrolling-paint-phases-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/composited-scrolling-paint-phases-expected.txt
@@ -74,6 +74,7 @@
                   ]
                 },
                 {
+                  "bounds": [202, 202],
                   "paintingPhases": [
                     "GraphicsLayerPaintBackground",
                     "GraphicsLayerPaintForeground",
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/content-gains-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/content-gains-scrollbars-expected.txt
index 444bcb4..aa0a47e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/content-gains-scrollbars-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/content-gains-scrollbars-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 0],
@@ -56,6 +57,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -86,6 +88,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -120,6 +123,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 85],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
index 44d7f9b..05c99ae5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-expected.txt
@@ -22,6 +22,7 @@
               ]
             },
             {
+              "bounds": [300, 300],
               "children": [
                 {
                   "position": [0, 285],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
index 44d7f9b..05c99ae5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
@@ -22,6 +22,7 @@
               ]
             },
             {
+              "bounds": [300, 300],
               "children": [
                 {
                   "position": [0, 285],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-overlay-with-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-overlay-with-touch-expected.txt
index 44d7f9b..05c99ae5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-overlay-with-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-overlay-with-touch-expected.txt
@@ -22,6 +22,7 @@
               ]
             },
             {
+              "bounds": [300, 300],
               "children": [
                 {
                   "position": [0, 285],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scrollbar-layers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scrollbar-layers-expected.txt
index 444bcb4..aa0a47e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scrollbar-layers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scrollbar-layers-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 0],
@@ -56,6 +57,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -86,6 +88,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [0, 85],
@@ -120,6 +123,7 @@
               ]
             },
             {
+              "bounds": [100, 100],
               "children": [
                 {
                   "position": [85, 85],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
index 1331fea..de87e717 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/reparented-scrollbars-non-sc-anc-expected.txt
@@ -55,6 +55,7 @@
           "bounds": [1200, 1000],
           "children": [
             {
+              "bounds": [1200, 1000],
               "children": [
                 {
                   "position": [1193, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
index 87b5990..545b2e7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
@@ -27,6 +27,7 @@
                   ]
                 },
                 {
+                  "bounds": [500, 500],
                   "children": [
                     {
                       "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
index dfc3b5c..3e92e6b8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor-expected.txt
@@ -58,6 +58,7 @@
         },
         {
           "position": [98, 90],
+          "bounds": [102, 102],
           "children": [
             {
               "position": [94, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
index 99f929a..f0c1146 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
@@ -20,6 +20,7 @@
               ]
             },
             {
+              "bounds": [320, 340],
               "children": [
                 {
                   "position": [0, 325],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-without-painting-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-without-painting-expected.txt
index 9a9a59e..3b5d109 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-without-painting-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrolling-without-painting-expected.txt
@@ -23,6 +23,7 @@
               ]
             },
             {
+              "bounds": [202, 202],
               "children": [
                 {
                   "position": [1, 186],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index 7c2197f..79dee4ad 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -138,10 +139,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2466],
+  "bounds": [785, 2481],
   "children": [
     {
-      "bounds": [785, 2466],
+      "bounds": [785, 2481],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -163,6 +164,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -262,10 +264,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4326],
+  "bounds": [785, 4356],
   "children": [
     {
-      "bounds": [785, 4326],
+      "bounds": [785, 4356],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -284,6 +286,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -383,10 +386,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6141],
+  "bounds": [785, 6186],
   "children": [
     {
-      "bounds": [785, 6141],
+      "bounds": [785, 6186],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -405,6 +408,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
index 2d3f1d6..476204a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -135,10 +136,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2403],
+  "bounds": [785, 2418],
   "children": [
     {
-      "bounds": [785, 2403],
+      "bounds": [785, 2418],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -157,6 +158,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -256,10 +258,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4218],
+  "bounds": [785, 4248],
   "children": [
     {
-      "bounds": [785, 4218],
+      "bounds": [785, 4248],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -278,6 +280,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 9ccd40d7..154a301 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -135,10 +136,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2421],
+  "bounds": [785, 2436],
   "children": [
     {
-      "bounds": [785, 2421],
+      "bounds": [785, 2436],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -160,6 +161,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -259,10 +261,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4281],
+  "bounds": [785, 4311],
   "children": [
     {
-      "bounds": [785, 4281],
+      "bounds": [785, 4311],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -284,6 +286,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -383,10 +386,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6141],
+  "bounds": [785, 6186],
   "children": [
     {
-      "bounds": [785, 6141],
+      "bounds": [785, 6186],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -405,6 +408,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
index 5e42fcd7..85ad93d7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
@@ -113,6 +113,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
index 2dd754f..f84961f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
@@ -63,6 +63,7 @@
               ]
             },
             {
+              "bounds": [800, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
index d77a2aa..2ced3c6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -60,6 +61,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
index f30493ed..3da12b3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.txt
@@ -26,6 +26,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -87,6 +88,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -143,6 +145,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -207,6 +210,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -268,6 +272,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -324,6 +329,7 @@
                   ]
                 },
                 {
+                  "bounds": [104, 104],
                   "children": [
                     {
                       "position": [2, 87],
@@ -384,6 +390,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -437,6 +444,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -491,6 +499,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -551,6 +560,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -612,6 +622,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
@@ -672,6 +683,7 @@
               ]
             },
             {
+              "bounds": [104, 104],
               "children": [
                 {
                   "position": [2, 87],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
index 5ac5fcd..7fbe5e6f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
@@ -80,6 +80,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-expected.txt
index ac34cdd4..b114bd1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-expected.txt
@@ -35,6 +35,7 @@
               ]
             },
             {
+              "bounds": [210, 210],
               "children": [
                 {
                   "position": [5, 190],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-content-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-content-expected.txt
index d9e0f1fb..1411ec6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-content-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..35333a177
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..35333a177
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 99d68de..43d00ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
index 2f5cdaa..04f34ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [700, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
index 197433d..8000cd2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [300, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
index 6a2e951e..d4c77521 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [185, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
new file mode 100644
index 0000000..dc2e7c9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
@@ -0,0 +1,71 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidationClients": [
+        "LayoutBlockFlow HTML",
+        "LayoutBlockFlow BODY"
+      ],
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [200, 200],
+          "contentsOpaque": true,
+          "drawsContent": true,
+          "backgroundColor": "#D3D3D3",
+          "repaintRects": [
+            [0, 160, 23, 18]
+          ],
+          "paintInvalidationClients": [
+            "LayoutBlockFlow DIV id='scroller'"
+          ],
+          "children": [
+            {
+              "bounds": [185, 185],
+              "children": [
+                {
+                  "bounds": [200, 1620],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 610, 23, 18]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='scroller'",
+                    "LayoutBlockFlow DIV id='target'",
+                    "LayoutText #text",
+                    "InlineTextBox 'test'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [200, 200],
+              "children": [
+                {
+                  "position": [0, 185],
+                  "bounds": [185, 15],
+                  "drawsContent": true
+                },
+                {
+                  "position": [185, 0],
+                  "bounds": [15, 185],
+                  "drawsContent": true
+                },
+                {
+                  "position": [185, 185],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index d956378..da4ea44 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2436],
+  "bounds": [785, 2451],
   "children": [
     {
-      "bounds": [785, 2436],
+      "bounds": [785, 2451],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4266],
+  "bounds": [785, 4296],
   "children": [
     {
-      "bounds": [785, 4266],
+      "bounds": [785, 4296],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6051],
+  "bounds": [785, 6096],
   "children": [
     {
-      "bounds": [785, 6051],
+      "bounds": [785, 6096],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-expected.txt
index 655e094..9b101a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2373],
+  "bounds": [785, 2388],
   "children": [
     {
-      "bounds": [785, 2373],
+      "bounds": [785, 2388],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4158],
+  "bounds": [785, 4188],
   "children": [
     {
-      "bounds": [785, 4158],
+      "bounds": [785, 4188],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 595a6d3..69734cb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2391],
+  "bounds": [785, 2406],
   "children": [
     {
-      "bounds": [785, 2391],
+      "bounds": [785, 2406],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4221],
+  "bounds": [785, 4251],
   "children": [
     {
-      "bounds": [785, 4221],
+      "bounds": [785, 4251],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6051],
+  "bounds": [785, 6096],
   "children": [
     {
-      "bounds": [785, 6051],
+      "bounds": [785, 6096],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
index 0ef5bac..75ac18e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 778ead5..ee3d294 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/css3/flexbox/flexbox-baseline-expected.png b/third_party/WebKit/LayoutTests/platform/mac/css3/flexbox/flexbox-baseline-expected.png
index 8f03e5d9..cebcf0c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/css3/flexbox/flexbox-baseline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/css3/flexbox/flexbox-baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/replaced/width100percent-textarea-expected.png
index 923359de..a6cdb0c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt
index c6bf9a94..43c49b4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt
@@ -43,6 +43,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..b657943
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index d956378..da4ea44 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2436],
+  "bounds": [785, 2451],
   "children": [
     {
-      "bounds": [785, 2436],
+      "bounds": [785, 2451],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4266],
+  "bounds": [785, 4296],
   "children": [
     {
-      "bounds": [785, 4266],
+      "bounds": [785, 4296],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6051],
+  "bounds": [785, 6096],
   "children": [
     {
-      "bounds": [785, 6051],
+      "bounds": [785, 6096],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
index 655e094..9b101a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2373],
+  "bounds": [785, 2388],
   "children": [
     {
-      "bounds": [785, 2373],
+      "bounds": [785, 2388],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4158],
+  "bounds": [785, 4188],
   "children": [
     {
-      "bounds": [785, 4158],
+      "bounds": [785, 4188],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 595a6d3..69734cb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2391],
+  "bounds": [785, 2406],
   "children": [
     {
-      "bounds": [785, 2391],
+      "bounds": [785, 2406],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4221],
+  "bounds": [785, 4251],
   "children": [
     {
-      "bounds": [785, 4221],
+      "bounds": [785, 4251],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6051],
+  "bounds": [785, 6096],
   "children": [
     {
-      "bounds": [785, 6051],
+      "bounds": [785, 6096],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
index ad39358..05b1990c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
@@ -113,6 +113,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
index 07e9bc2..4b8e7e4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
@@ -63,6 +63,7 @@
               ]
             },
             {
+              "bounds": [800, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
index 0ef5bac..75ac18e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
index a0d7ab15a..6a84b252 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
@@ -80,6 +80,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..17291d6d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..b657943
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 778ead5..ee3d294 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
index 8dfd5f3..67397b3a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-move-after-scroll-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [700, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
index f99c2df..d4e783d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/fast/repaint/overflow-scroll-after-move-expected.txt
@@ -33,6 +33,7 @@
               ]
             },
             {
+              "bounds": [300, 400],
               "children": [
                 {
                   "position": [0, 385],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
index 0aac43dc..7a475c6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/invalidation/invalidate-after-composited-scroll-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [185, 0],
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
new file mode 100644
index 0000000..43c49b4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
@@ -0,0 +1,69 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidationClients": [
+        "LayoutBlockFlow HTML",
+        "LayoutBlockFlow BODY"
+      ],
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [200, 200],
+          "contentsOpaque": true,
+          "drawsContent": true,
+          "backgroundColor": "#D3D3D3",
+          "repaintRects": [
+            [0, 160, 23, 18]
+          ],
+          "paintInvalidationClients": [
+            "LayoutBlockFlow DIV id='scroller'"
+          ],
+          "children": [
+            {
+              "bounds": [185, 185],
+              "children": [
+                {
+                  "bounds": [200, 1620],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 610, 23, 18]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='scroller'",
+                    "LayoutBlockFlow DIV id='target'",
+                    "LayoutText #text",
+                    "InlineTextBox 'test'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [200, 200],
+              "children": [
+                {
+                  "position": [0, 185],
+                  "bounds": [185, 15]
+                },
+                {
+                  "position": [185, 0],
+                  "bounds": [15, 185]
+                },
+                {
+                  "position": [185, 185],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
index ff2a18fd..290b2c179 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers-expected.txt
@@ -25,6 +25,7 @@
               ]
             },
             {
+              "bounds": [302, 302],
               "children": [
                 {
                   "position": [1, 286],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index 058b91a..b85a763 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2546],
+  "bounds": [785, 2562],
   "children": [
     {
-      "bounds": [785, 2546],
+      "bounds": [785, 2562],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4498],
+  "bounds": [785, 4530],
   "children": [
     {
-      "bounds": [785, 4498],
+      "bounds": [785, 4530],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6402],
+  "bounds": [785, 6450],
   "children": [
     {
-      "bounds": [785, 6402],
+      "bounds": [785, 6450],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-expected.txt
index 6f74aec3..4a47763 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2498],
+  "bounds": [785, 2514],
   "children": [
     {
-      "bounds": [785, 2498],
+      "bounds": [785, 2514],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4402],
+  "bounds": [785, 4434],
   "children": [
     {
-      "bounds": [785, 4402],
+      "bounds": [785, 4434],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 2c91562..d6996d2 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2498],
+  "bounds": [785, 2514],
   "children": [
     {
-      "bounds": [785, 2498],
+      "bounds": [785, 2514],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4450],
+  "bounds": [785, 4482],
   "children": [
     {
-      "bounds": [785, 4450],
+      "bounds": [785, 4482],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6402],
+  "bounds": [785, 6450],
   "children": [
     {
-      "bounds": [785, 6402],
+      "bounds": [785, 6450],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/textarea-scroll-touch-expected.txt
index f9ac3308..ebcfe549 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 778ead5..ee3d294 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-basic-expected.png
index 54bfe9a..1ee2812 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-separator-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-separator-expected.png
index 6271a03..23450e3 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-separator-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/listbox-appearance-separator-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/menulist-appearance-basic-expected.png
index 99e0c77b..c9d4d746 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/replaced/width100percent-textarea-expected.png
index d85efac..4213dff5 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/paint/selection/selection-within-composited-scroller-expected.txt
index 60f1bd56..b172a4e 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/paint/selection/selection-within-composited-scroller-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/paint/selection/selection-within-composited-scroller-expected.txt
@@ -43,6 +43,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..cd52f30
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index 058b91a..b85a763 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2546],
+  "bounds": [785, 2562],
   "children": [
     {
-      "bounds": [785, 2546],
+      "bounds": [785, 2562],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4498],
+  "bounds": [785, 4530],
   "children": [
     {
-      "bounds": [785, 4498],
+      "bounds": [785, 4530],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6402],
+  "bounds": [785, 6450],
   "children": [
     {
-      "bounds": [785, 6402],
+      "bounds": [785, 6450],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
index 6f74aec3..4a47763 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2498],
+  "bounds": [785, 2514],
   "children": [
     {
-      "bounds": [785, 2498],
+      "bounds": [785, 2514],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4402],
+  "bounds": [785, 4434],
   "children": [
     {
-      "bounds": [785, 4402],
+      "bounds": [785, 4434],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index 2c91562..d6996d2 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2498],
+  "bounds": [785, 2514],
   "children": [
     {
-      "bounds": [785, 2498],
+      "bounds": [785, 2514],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4450],
+  "bounds": [785, 4482],
   "children": [
     {
-      "bounds": [785, 4450],
+      "bounds": [785, 4482],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6402],
+  "bounds": [785, 6450],
   "children": [
     {
-      "bounds": [785, 6402],
+      "bounds": [785, 6450],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
index 7ae5643..52e2586 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
@@ -113,6 +113,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
index 4fa99a3c..8336acb 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
@@ -63,6 +63,7 @@
               ]
             },
             {
+              "bounds": [800, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
index f9ac3308..ebcfe549 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
index fc1b74f3..569027b 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
@@ -80,6 +80,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..cd52f30
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..cd52f30
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
new file mode 100644
index 0000000..ee3d294
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -0,0 +1,63 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [500, 500],
+          "drawsContent": true,
+          "repaintRects": [
+            [-2000, -2000, 5000, 5000]
+          ],
+          "children": [
+            {
+              "bounds": [485, 485],
+              "children": [
+                {
+                  "bounds": [5000, 5000],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 0, 5000, 5000]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='content'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [500, 500],
+              "children": [
+                {
+                  "position": [0, 485],
+                  "bounds": [485, 15],
+                  "repaintRects": [
+                    [0, 0, 485, 15]
+                  ]
+                },
+                {
+                  "position": [485, 0],
+                  "bounds": [15, 485],
+                  "repaintRects": [
+                    [0, 0, 15, 485]
+                  ]
+                },
+                {
+                  "position": [485, 485],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
new file mode 100644
index 0000000..b172a4e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
@@ -0,0 +1,69 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidationClients": [
+        "LayoutBlockFlow HTML",
+        "LayoutBlockFlow BODY"
+      ],
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [200, 200],
+          "contentsOpaque": true,
+          "drawsContent": true,
+          "backgroundColor": "#D3D3D3",
+          "repaintRects": [
+            [0, 160, 21, 19]
+          ],
+          "paintInvalidationClients": [
+            "LayoutBlockFlow DIV id='scroller'"
+          ],
+          "children": [
+            {
+              "bounds": [185, 185],
+              "children": [
+                {
+                  "bounds": [200, 1620],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 610, 21, 19]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='scroller'",
+                    "LayoutBlockFlow DIV id='target'",
+                    "LayoutText #text",
+                    "InlineTextBox 'test'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [200, 200],
+              "children": [
+                {
+                  "position": [0, 185],
+                  "bounds": [185, 15]
+                },
+                {
+                  "position": [185, 0],
+                  "bounds": [15, 185]
+                },
+                {
+                  "position": [185, 185],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index f1d578d..8025a804 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2558],
+  "bounds": [785, 2574],
   "children": [
     {
-      "bounds": [785, 2558],
+      "bounds": [785, 2574],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4510],
+  "bounds": [785, 4542],
   "children": [
     {
-      "bounds": [785, 4510],
+      "bounds": [785, 4542],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6414],
+  "bounds": [785, 6462],
   "children": [
     {
-      "bounds": [785, 6414],
+      "bounds": [785, 6462],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-expected.txt
index fe372df7..cbce4a5 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2492],
+  "bounds": [785, 2508],
   "children": [
     {
-      "bounds": [785, 2492],
+      "bounds": [785, 2508],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4396],
+  "bounds": [785, 4428],
   "children": [
     {
-      "bounds": [785, 4396],
+      "bounds": [785, 4428],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index b40fab7..25504b7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2510],
+  "bounds": [785, 2526],
   "children": [
     {
-      "bounds": [785, 2510],
+      "bounds": [785, 2526],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4462],
+  "bounds": [785, 4494],
   "children": [
     {
-      "bounds": [785, 4462],
+      "bounds": [785, 4494],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6414],
+  "bounds": [785, 6462],
   "children": [
     {
-      "bounds": [785, 6414],
+      "bounds": [785, 6462],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
index ddda2df..11cc373 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
index 058003ff..185df10 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -31,6 +31,7 @@
               ]
             },
             {
+              "bounds": [500, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/css3/flexbox/flexbox-baseline-expected.png b/third_party/WebKit/LayoutTests/platform/win/css3/flexbox/flexbox-baseline-expected.png
index 3a7b963..3c05c34 100644
--- a/third_party/WebKit/LayoutTests/platform/win/css3/flexbox/flexbox-baseline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/css3/flexbox/flexbox-baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
index 71cffd15..3d9f3f8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-separator-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-separator-expected.png
index 3b07fb4..c3e7088 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-separator-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-separator-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
index 0b0d3835..f5081fc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/replaced/width100percent-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/replaced/width100percent-textarea-expected.png
index eb232289..971e61b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/replaced/width100percent-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/replaced/width100percent-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt
index 2e017dd..b0f1abd 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt
@@ -43,6 +43,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..16f9fc9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
index f1d578d..8025a804 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
@@ -39,6 +39,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -136,10 +137,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2558],
+  "bounds": [785, 2574],
   "children": [
     {
-      "bounds": [785, 2558],
+      "bounds": [785, 2574],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -161,6 +162,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -258,10 +260,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4510],
+  "bounds": [785, 4542],
   "children": [
     {
-      "bounds": [785, 4510],
+      "bounds": [785, 4542],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6414],
+  "bounds": [785, 6462],
   "children": [
     {
-      "bounds": [785, 6414],
+      "bounds": [785, 6462],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
index fe372df7..cbce4a5 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2492],
+  "bounds": [785, 2508],
   "children": [
     {
-      "bounds": [785, 2492],
+      "bounds": [785, 2508],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -155,6 +156,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -252,10 +254,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4396],
+  "bounds": [785, 4428],
   "children": [
     {
-      "bounds": [785, 4396],
+      "bounds": [785, 4428],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -274,6 +276,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
index b40fab7..25504b7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
@@ -36,6 +36,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -133,10 +134,10 @@
 *** iteration 2: ***
 
 {
-  "bounds": [785, 2510],
+  "bounds": [785, 2526],
   "children": [
     {
-      "bounds": [785, 2510],
+      "bounds": [785, 2526],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -158,6 +159,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -255,10 +257,10 @@
 *** iteration 3: ***
 
 {
-  "bounds": [785, 4462],
+  "bounds": [785, 4494],
   "children": [
     {
-      "bounds": [785, 4462],
+      "bounds": [785, 4494],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -280,6 +282,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
@@ -377,10 +380,10 @@
 *** iteration 4: ***
 
 {
-  "bounds": [785, 6414],
+  "bounds": [785, 6462],
   "children": [
     {
-      "bounds": [785, 6414],
+      "bounds": [785, 6462],
       "contentsOpaque": true,
       "drawsContent": true,
       "children": [
@@ -399,6 +402,7 @@
               ]
             },
             {
+              "bounds": [300, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
index 0471e5e..5aa53e6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-color-change-expected.txt
@@ -113,6 +113,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
index 3a6134df5..ff1468f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/text-match-highlight-expected.txt
@@ -63,6 +63,7 @@
               ]
             },
             {
+              "bounds": [800, 500],
               "children": [
                 {
                   "position": [0, 485],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
index ddda2df..11cc373 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
@@ -26,6 +26,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
@@ -59,6 +60,7 @@
               ]
             },
             {
+              "bounds": [206, 126],
               "children": [
                 {
                   "position": [190, 1],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
index 68e4140..b81eed4b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/updating-scrolling-container-and-content-expected.txt
@@ -80,6 +80,7 @@
               ]
             },
             {
+              "bounds": [200, 200],
               "children": [
                 {
                   "position": [0, 185],
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..16f9fc9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
new file mode 100644
index 0000000..16f9fc9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
new file mode 100644
index 0000000..185df10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer-expected.txt
@@ -0,0 +1,63 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [500, 500],
+          "drawsContent": true,
+          "repaintRects": [
+            [-2001, -2000, 5001, 5000]
+          ],
+          "children": [
+            {
+              "bounds": [485, 485],
+              "children": [
+                {
+                  "bounds": [5000, 5000],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [-1, 0, 5001, 5000]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='content'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [500, 500],
+              "children": [
+                {
+                  "position": [0, 485],
+                  "bounds": [485, 15],
+                  "repaintRects": [
+                    [0, 0, 485, 15]
+                  ]
+                },
+                {
+                  "position": [485, 0],
+                  "bounds": [15, 485],
+                  "repaintRects": [
+                    [0, 0, 15, 485]
+                  ]
+                },
+                {
+                  "position": [485, 485],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
new file mode 100644
index 0000000..b0f1abd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/syncpaint/paint/selection/selection-within-composited-scroller-expected.txt
@@ -0,0 +1,69 @@
+{
+  "bounds": [800, 600],
+  "children": [
+    {
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidationClients": [
+        "LayoutBlockFlow HTML",
+        "LayoutBlockFlow BODY"
+      ],
+      "children": [
+        {
+          "position": [8, 8],
+          "bounds": [200, 200],
+          "contentsOpaque": true,
+          "drawsContent": true,
+          "backgroundColor": "#D3D3D3",
+          "repaintRects": [
+            [0, 160, 23, 17]
+          ],
+          "paintInvalidationClients": [
+            "LayoutBlockFlow DIV id='scroller'"
+          ],
+          "children": [
+            {
+              "bounds": [185, 185],
+              "children": [
+                {
+                  "bounds": [200, 1620],
+                  "shouldFlattenTransform": false,
+                  "drawsContent": true,
+                  "repaintRects": [
+                    [0, 610, 23, 17]
+                  ],
+                  "paintInvalidationClients": [
+                    "LayoutBlockFlow DIV id='scroller'",
+                    "LayoutBlockFlow DIV id='target'",
+                    "LayoutText #text",
+                    "InlineTextBox 'test'"
+                  ]
+                }
+              ]
+            },
+            {
+              "bounds": [200, 200],
+              "children": [
+                {
+                  "position": [0, 185],
+                  "bounds": [185, 15]
+                },
+                {
+                  "position": [185, 0],
+                  "bounds": [15, 185]
+                },
+                {
+                  "position": [185, 185],
+                  "bounds": [15, 15],
+                  "drawsContent": true
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still-expected.txt b/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still-expected.txt
new file mode 100644
index 0000000..6d30bfd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still-expected.txt
@@ -0,0 +1,18 @@
+CONSOLE WARNING: SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
+SVG 1.1 dynamic animation tests
+
+
+Test animations that only express an offset
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rootSVGElement.getBBox().x is 100
+PASS rootSVGElement.getBBox().x is 200
+PASS rootSVGElement.getBBox().x is 200
+PASS rootSVGElement.getBBox().x is 0
+PASS rootSVGElement.getBBox().x is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still.html b/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still.html
new file mode 100644
index 0000000..2211993d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/animations/animateMotion-still.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/SVGTestCase.js"></script>
+<script src="resources/SVGAnimationTestCase.js"></script>
+</head>
+<body onload="runSMILTest()">
+<h1>SVG 1.1 dynamic animation tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/animateMotion-still.js"></script>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/svg/animations/resources/animateMotion-still.svg b/third_party/WebKit/LayoutTests/svg/animations/resources/animateMotion-still.svg
new file mode 100644
index 0000000..3199f07
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/animations/resources/animateMotion-still.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <rect width="50" height="50" x="0" y="0" fill="green">
+    <animateMotion id="anim" path="M 100 100 L 100 100"
+        begin="0s" dur="2s" repeatCount="2" accumulate="sum" fill="remove" />
+  </rect>
+</svg>
diff --git a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animateMotion-still.js b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animateMotion-still.js
new file mode 100644
index 0000000..c7bbc50
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animateMotion-still.js
@@ -0,0 +1,42 @@
+description("Test animations that only express an offset");
+embedSVGTestCase("resources/animateMotion-still.svg");
+
+// Setup animation test
+function sample1() {
+    shouldBeCloseEnough("rootSVGElement.getBBox().x", "100");
+}
+
+function sample2() {
+    shouldBeCloseEnough("rootSVGElement.getBBox().x", "200");
+}
+
+function sample3() {
+    shouldBeCloseEnough("rootSVGElement.getBBox().x", "200");
+}
+
+function sample4() {
+    shouldBeCloseEnough("rootSVGElement.getBBox().x", "0");
+}
+
+function sample5() {
+    shouldBeCloseEnough("rootSVGElement.getBBox().x", "0");
+}
+
+function executeTest() {
+    var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
+    rect1 = rects[0];
+
+    const expectedValues = [
+        // [animationId, time, sampleCallback]
+        ["anim", 1.0,   sample1],
+        ["anim", 2.0,   sample2],
+        ["anim", 3.0,   sample3],
+        ["anim", 4.0,   sample4],
+        ["anim", 5.0,   sample5]
+    ];
+
+    runAnimationTest(expectedValues);
+}
+
+window.animationStartsImmediately = true;
+var successfullyParsed = true;
diff --git a/third_party/WebKit/Source/core/frame/History.idl b/third_party/WebKit/Source/core/frame/History.idl
index 0c3ebcf..bec0890 100644
--- a/third_party/WebKit/Source/core/frame/History.idl
+++ b/third_party/WebKit/Source/core/frame/History.idl
@@ -31,6 +31,7 @@
     GarbageCollected,
 ] interface History {
     readonly attribute unsigned long length;
+    [RuntimeEnabled=ScrollRestoration, Measure] attribute ScrollRestoration scrollRestoration;
     // TODO(philipj): The SerializedScriptValue type should be any.
     [CachedAttribute=stateChanged] readonly attribute SerializedScriptValue state;
     [CallWith=ExecutionContext] void go(optional long delta = 0);
@@ -40,8 +41,4 @@
     // TODO(philipj): The title arguments should simply be 'DOMString title'.
     [RaisesException] void pushState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null);
     [RaisesException] void replaceState(SerializedScriptValue data, [TreatUndefinedAs=NullString] DOMString? title, optional DOMString? url = null);
-
-    // Experimental Scroll Restoration API
-    // https://www.chromestatus.com/features/5657284784947200
-    [RuntimeEnabled=ScrollRestoration] attribute ScrollRestoration scrollRestoration;
 };
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index 5d66eaa1..89a161a 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -888,6 +888,8 @@
         BackgroundSyncRegister = 1025,
         BorderImageWithBorderStyleNone = 1026,
         ExecCommandOnInputOrTextarea = 1027,
+        V8History_ScrollRestoration_AttributeGetter = 1028,
+        V8History_ScrollRestoration_AttributeSetter = 1029,
 
         // Add new features immediately above this line. Don't change assigned
         // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
index 5f949b8..0e36470b 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp
@@ -450,8 +450,7 @@
                 break;
 
             FloatPoint point;
-            bool ok = m_textPathCalculator->pointAndNormalAtLength(textPathOffset, point, angle);
-            ASSERT_UNUSED(ok, ok);
+            m_textPathCalculator->pointAndNormalAtLength(textPathOffset, point, angle);
             x = point.x();
             y = point.y();
 
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 5f05a189..5c51e0e 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1004,8 +1004,8 @@
 
     FloatPoint point;
     float angle;
-    if (!motionPath.path().pointAndNormalAtLength(computedDistance, point, angle))
-        return;
+    motionPath.path().pointAndNormalAtLength(computedDistance, point, angle);
+
     if (motionData.m_rotationType == MotionRotationFixed)
         angle = 0;
 
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
index bbd4503..72dd2ff 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
@@ -253,15 +253,12 @@
     float positionOnPath = m_animationPath.length() * percentage;
     FloatPoint position;
     float angle;
-    bool ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle);
-    if (!ok)
-        return;
+    m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle);
 
     // Handle accumulate="sum".
     if (isAccumulated() && repeatCount) {
-        FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_animationPath.length(), ok);
-        if (ok)
-            position.move(positionAtEndOfDuration.x() * repeatCount, positionAtEndOfDuration.y() * repeatCount);
+        FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_animationPath.length());
+        position.move(positionAtEndOfDuration.x() * repeatCount, positionAtEndOfDuration.y() * repeatCount);
     }
 
     transform->translate(position.x(), position.y());
diff --git a/third_party/WebKit/Source/platform/graphics/Path.cpp b/third_party/WebKit/Source/platform/graphics/Path.cpp
index f88cc53d..9cccb49 100644
--- a/third_party/WebKit/Source/platform/graphics/Path.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Path.cpp
@@ -172,11 +172,11 @@
     return SkScalarToFloat(length);
 }
 
-FloatPoint Path::pointAtLength(float length, bool& ok) const
+FloatPoint Path::pointAtLength(float length) const
 {
     FloatPoint point;
     float normal;
-    ok = pointAndNormalAtLength(length, point, normal);
+    pointAndNormalAtLength(length, point, normal);
     return point;
 }
 
@@ -201,16 +201,15 @@
     return false;
 }
 
-bool Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
+void Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
 {
     SkPathMeasure measure(m_path, false);
-
     if (calculatePointAndNormalOnPath(measure, WebCoreFloatToSkScalar(length), point, normal))
-        return true;
+        return;
 
+    SkPoint position = m_path.getPoint(0);
+    point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
     normal = 0;
-    point = FloatPoint(0, 0);
-    return false;
 }
 
 Path::PositionCalculator::PositionCalculator(const Path& path)
@@ -220,7 +219,7 @@
 {
 }
 
-bool Path::PositionCalculator::pointAndNormalAtLength(float length, FloatPoint& point, float& normalAngle)
+void Path::PositionCalculator::pointAndNormalAtLength(float length, FloatPoint& point, float& normalAngle)
 {
     SkScalar skLength = WebCoreFloatToSkScalar(length);
     if (skLength >= 0) {
@@ -233,12 +232,13 @@
         }
 
         if (calculatePointAndNormalOnPath(m_pathMeasure, skLength, point, normalAngle, &m_accumulatedLength))
-            return true;
+            return;
     }
 
+    SkPoint position = m_path.getPoint(0);
+    point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
     normalAngle = 0;
-    point = FloatPoint(0, 0);
-    return false;
+    return;
 }
 
 void Path::clear()
diff --git a/third_party/WebKit/Source/platform/graphics/Path.h b/third_party/WebKit/Source/platform/graphics/Path.h
index bbc1f750..adcacae 100644
--- a/third_party/WebKit/Source/platform/graphics/Path.h
+++ b/third_party/WebKit/Source/platform/graphics/Path.h
@@ -82,8 +82,8 @@
     FloatRect strokeBoundingRect(const StrokeData&) const;
 
     float length() const;
-    FloatPoint pointAtLength(float length, bool& ok) const;
-    bool pointAndNormalAtLength(float length, FloatPoint&, float&) const;
+    FloatPoint pointAtLength(float length) const;
+    void pointAndNormalAtLength(float length, FloatPoint&, float&) const;
 
     // Helper for computing a sequence of positions and normals (normal angles) on a path.
     // The best possible access pattern will be one where the |length| value is
@@ -96,7 +96,7 @@
     public:
         explicit PositionCalculator(const Path&);
 
-        bool pointAndNormalAtLength(float length, FloatPoint&, float&);
+        void pointAndNormalAtLength(float length, FloatPoint&, float&);
 
     private:
         SkPath m_path;
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl
index 14d6ae9..dd1c69d 100644
--- a/tools/mb/mb_config.pyl
+++ b/tools/mb/mb_config.pyl
@@ -59,10 +59,10 @@
     # This is just for completeness; any bot that uses this config should never actually run MB.
     'none': ['none'],
 
+    'noswarming_gn_release_bot': ['noswarming', 'gn', 'release_bot'],
     'noswarming_gyp_release_bot': ['noswarming', 'gyp', 'release_bot'],
-    'noswarming_gyp_release_bot_linux_dump_symbols': ['noswarming', 'gyp', 'release_bot', 'linux_dump_symbols'],
     'noswarming_gyp_release_bot_mac_strip': ['noswarming', 'gyp', 'release_bot', 'mac_strip'],
-    'noswarming_gyp_release_bot_x86_linux_dump_symbols': ['noswarming', 'gyp', 'release_bot', 'x86', 'linux_dump_symbols'],
+    'noswarming_gyp_release_bot_x86': ['noswarming', 'gyp', 'release_bot', 'x86'],
 
     'swarming_asan_lsan_gyp_release_trybot': ['swarming', 'asan', 'lsan', 'release_trybot'],
     'swarming_msan_gyp_release_trybot': ['swarming', 'chromeos', 'msan', 'gyp', 'release_trybot'],
@@ -237,11 +237,6 @@
 
     'libfuzzer': { 'gn_args': 'use_libfuzzer=true' },
 
-    'linux_dump_symbols': {
-      'gn_args': '', # TODO(GYP): Port linux_dump_symbols?
-      'gyp_defines': 'linux_dump_symbols=1',
-    },
-
     'lsan': {
       'gn_args': 'use_lsan=true',
       'gyp_defines': 'lsan=1',
@@ -277,6 +272,7 @@
     },
 
     'noswarming': {
+      # test_isolation_mode doesn't exist in a GN build (it's always a no-op).
       'gn_args': '',
       'gyp_defines': 'test_isolation_mode=noop',
     },
@@ -360,8 +356,8 @@
     'chromium': {
       'Win': 'noswarming_gyp_release_bot',
       'Mac': 'noswarming_gyp_release_bot_mac_strip',
-      'Linux x64': 'noswarming_gyp_release_bot_linux_dump_symbols',
-      'Linux': 'noswarming_gyp_release_bot_x86_linux_dump_symbols',
+      'Linux x64': 'noswarming_gn_release_bot',
+      'Linux': 'noswarming_gyp_release_bot_x86',
       'Android': 'android_gyp_release_bot_minimal_symbols',
     },
     'chromium.android': {
@@ -503,7 +499,7 @@
       'linux_arm_compile': 'swarming_gyp_release_trybot_arm',
       'linux_chromium_compile_dbg_32_ng': 'swarming_gyp_debug_trybot_x86',
       'linux_chromium_dbg_32_ng': 'swarming_gyp_debug_trybot_x86',
-      'linux_chromium_archive_rel_ng': 'noswarming_gyp_release_bot_linux_dump_symbols',
+      'linux_chromium_archive_rel_ng': 'noswarming_gn_release_bot',
       'linux_chromium_clobber_rel_ng': 'gyp_release_trybot',
       'linux_chromium_gn_upload': 'gn_linux_upload',
       'cast_shell_linux': 'cast_gyp_release_trybot',
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index d4e71658..b4f77cb 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -5154,6 +5154,9 @@
 </histogram>
 
 <histogram name="ContentSettings.PermissionActions" enum="PermissionAction">
+  <obsolete>
+    Removed 11/2015 in favor of Permissions.Action.*
+  </obsolete>
   <owner>miguelg@chromium.org</owner>
   <summary>
     Tracks whether a permission was granted, rejected, etc. The suffix of the
@@ -5163,6 +5166,9 @@
 
 <histogram name="ContentSettings.PermissionActionsInsecureOrigin"
     enum="PermissionAction">
+  <obsolete>
+    Removed 11/2015 in favor of Permissions.Action.InsecureOrigin.*
+  </obsolete>
   <owner>miguelg@chromium.org</owner>
   <summary>
     Tracks whether a permission was granted, rejected, etc on an insecure
@@ -5172,6 +5178,9 @@
 
 <histogram name="ContentSettings.PermissionActionsSecureOrigin"
     enum="PermissionAction">
+  <obsolete>
+    Removed 11/2015 in favor of Permissions.Action.SecureOrigin.*
+  </obsolete>
   <owner>miguelg@chromium.org</owner>
   <summary>
     Tracks whether a permission was granted, rejected, etc on a secure origin.
@@ -32104,6 +32113,24 @@
   </summary>
 </histogram>
 
+<histogram name="Permissions.Action.InsecureOrigin" enum="PermissionAction">
+  <owner>miguelg@chromium.org</owner>
+  <owner>mlamouri@chromium.org</owner>
+  <summary>
+    Tracks whether a permission was granted, rejected, etc on an insecure
+    origin. The suffix of the histogram indicates which particular permission.
+  </summary>
+</histogram>
+
+<histogram name="Permissions.Action.SecureOrigin" enum="PermissionAction">
+  <owner>miguelg@chromium.org</owner>
+  <owner>mlamouri@chromium.org</owner>
+  <summary>
+    Tracks whether a permission was granted, rejected, etc on a secure origin.
+    The suffix of the histogram indicates which particular permission.
+  </summary>
+</histogram>
+
 <histogram name="Permissions.Requested.CrossOrigin" enum="PermissionStatus">
   <owner>keenanb@google.com</owner>
   <owner>jww@chromium.org</owner>
@@ -81471,9 +81498,17 @@
 </histogram_suffixes>
 
 <histogram_suffixes name="PermissionTypes" separator=".">
+  <suffix name="MidiSysEx" label="Midi SysEx permsision actions"/>
+  <suffix name="PushMessaging" label="Push messaging permission actions"/>
+  <suffix name="Notifications" label="Notification permission actions"/>
+  <suffix name="Geolocation" label="Geolocation permission actions"/>
+  <suffix name="ProtectedMedia" label="Protected media permission actions"/>
+  <suffix name="DurableStorage" label="Durable Storage permission actions"/>
   <suffix name="AudioCapture" label="Microphone permission actions"/>
   <suffix name="VideoCapture" label="Camera permission actions"/>
   <affected-histogram name="Permissions.Action"/>
+  <affected-histogram name="Permissions.Action.InsecureOrigin"/>
+  <affected-histogram name="Permissions.Action.SecureOrigin"/>
 </histogram_suffixes>
 
 <histogram_suffixes name="PNaClTranslatorTypes" separator=".">
diff --git a/tools/perf_expectations/perf_expectations.json b/tools/perf_expectations/perf_expectations.json
index 7356408e..a6c6b90 100644
--- a/tools/perf_expectations/perf_expectations.json
+++ b/tools/perf_expectations/perf_expectations.json
@@ -1,5 +1,4 @@
-{
- "linux-release-64/sizes/chrome-si/initializers": {"reva": 281711, "revb": 281711, "type": "absolute", "better": "lower", "improve": 7, "regress": 7, "tolerance": 0, "sha1": "b11fc43a"},
+{"linux-release-64/sizes/chrome-si/initializers": {"reva": 361030, "revb": 361030, "type": "absolute", "better": "lower", "improve": 18, "regress": 18, "tolerance": 0, "sha1": "258cd4ac"},
  "linux-release-64/sizes/nacl_helper-si/initializers": {"reva": 271321, "revb": 271321, "type": "absolute", "better": "lower", "improve": 5, "regress": 7, "sha1": "f29296a1"},
  "linux-release-64/sizes/nacl_helper_bootstrap-si/initializers": {"reva": 114822, "revb": 115019, "type": "absolute", "better": "lower", "improve": 0, "regress": 0, "sha1": "228221af"},
  "linux-release/sizes/chrome-si/initializers": {"reva": 281717, "revb": 281717, "type": "absolute", "better": "lower", "improve": 8, "regress": 8, "tolerance": 0, "sha1": "b639bbc4"},
diff --git a/ui/events/ozone/BUILD.gn b/ui/events/ozone/BUILD.gn
index a110fb3d..c30ba34 100644
--- a/ui/events/ozone/BUILD.gn
+++ b/ui/events/ozone/BUILD.gn
@@ -17,151 +17,153 @@
   }
 }
 
-component("events_ozone") {
-  sources = [
-    "chromeos/cursor_controller.cc",
-    "chromeos/cursor_controller.h",
-    "device/device_event.cc",
-    "device/device_event.h",
-    "device/device_event_observer.h",
-    "device/device_manager.cc",
-    "device/device_manager.h",
-    "device/device_manager_manual.cc",
-    "device/device_manager_manual.h",
-    "device/udev/device_manager_udev.cc",
-    "device/udev/device_manager_udev.h",
-    "events_ozone_export.h",
-  ]
-
-  deps = [
-    "//base",
-    "//base/third_party/dynamic_annotations",
-    "//ui/events",
-    "//ui/events:events_base",
-  ]
-
-  defines = [ "EVENTS_OZONE_IMPLEMENTATION" ]
-
-  if (!use_udev) {
-    sources -= [
+if (use_ozone) {
+  component("events_ozone") {
+    sources = [
+      "chromeos/cursor_controller.cc",
+      "chromeos/cursor_controller.h",
+      "device/device_event.cc",
+      "device/device_event.h",
+      "device/device_event_observer.h",
+      "device/device_manager.cc",
+      "device/device_manager.h",
+      "device/device_manager_manual.cc",
+      "device/device_manager_manual.h",
       "device/udev/device_manager_udev.cc",
       "device/udev/device_manager_udev.h",
-    ]
-  }
-
-  if (use_ozone && use_udev) {
-    deps += [ "//device/udev_linux" ]
-  }
-}
-
-config("evdev") {
-  defines = [ "USE_EVDEV" ]
-}
-
-config("evdev_gestures") {
-  defines = [ "USE_EVDEV_GESTURES" ]
-}
-
-if (use_evdev_gestures) {
-  pkg_config("libevdev-cros") {
-    packages = [ "libevdev-cros" ]
-  }
-
-  pkg_config("libgestures") {
-    packages = [ "libgestures" ]
-  }
-}
-
-component("events_ozone_evdev") {
-  sources = [
-    "evdev/device_event_dispatcher_evdev.cc",
-    "evdev/device_event_dispatcher_evdev.h",
-    "evdev/event_converter_evdev.cc",
-    "evdev/event_converter_evdev.h",
-    "evdev/event_converter_evdev_impl.cc",
-    "evdev/event_converter_evdev_impl.h",
-    "evdev/event_device_info.cc",
-    "evdev/event_device_info.h",
-    "evdev/event_factory_evdev.cc",
-    "evdev/event_factory_evdev.h",
-    "evdev/event_modifiers_evdev.cc",
-    "evdev/event_modifiers_evdev.h",
-    "evdev/event_thread_evdev.cc",
-    "evdev/event_thread_evdev.h",
-    "evdev/events_ozone_evdev_export.h",
-    "evdev/input_controller_evdev.cc",
-    "evdev/input_controller_evdev.h",
-    "evdev/input_device_factory_evdev.cc",
-    "evdev/input_device_factory_evdev.h",
-    "evdev/input_device_factory_evdev_proxy.cc",
-    "evdev/input_device_factory_evdev_proxy.h",
-    "evdev/input_device_settings_evdev.cc",
-    "evdev/input_device_settings_evdev.h",
-    "evdev/input_injector_evdev.cc",
-    "evdev/input_injector_evdev.h",
-    "evdev/keyboard_evdev.cc",
-    "evdev/keyboard_evdev.h",
-    "evdev/keyboard_util_evdev.cc",
-    "evdev/keyboard_util_evdev.h",
-    "evdev/mouse_button_map_evdev.cc",
-    "evdev/mouse_button_map_evdev.h",
-    "evdev/tablet_event_converter_evdev.cc",
-    "evdev/tablet_event_converter_evdev.h",
-    "evdev/touch_evdev_debug_buffer.cc",
-    "evdev/touch_evdev_debug_buffer.h",
-    "evdev/touch_evdev_types.cc",
-    "evdev/touch_evdev_types.h",
-    "evdev/touch_event_converter_evdev.cc",
-    "evdev/touch_event_converter_evdev.h",
-    "evdev/touch_noise/far_apart_taps_touch_noise_filter.cc",
-    "evdev/touch_noise/far_apart_taps_touch_noise_filter.h",
-    "evdev/touch_noise/horizontally_aligned_touch_noise_filter.cc",
-    "evdev/touch_noise/horizontally_aligned_touch_noise_filter.h",
-    "evdev/touch_noise/single_position_touch_noise_filter.cc",
-    "evdev/touch_noise/single_position_touch_noise_filter.h",
-    "evdev/touch_noise/touch_noise_filter.h",
-    "evdev/touch_noise/touch_noise_finder.cc",
-    "evdev/touch_noise/touch_noise_finder.h",
-  ]
-
-  defines = [ "EVENTS_OZONE_EVDEV_IMPLEMENTATION" ]
-
-  deps = [
-    ":events_ozone",
-    ":events_ozone_layout",
-    "//base",
-    "//ui/events",
-    "//ui/events:dom_keycode_converter",
-    "//ui/events:events_base",
-    "//ui/events/devices",
-    "//ui/events/platform",
-    "//ui/gfx",
-  ]
-
-  public_configs = [ ":evdev" ]
-
-  if (use_ozone && use_evdev_gestures) {
-    sources += [
-      "evdev/libgestures_glue/event_reader_libevdev_cros.cc",
-      "evdev/libgestures_glue/event_reader_libevdev_cros.h",
-      "evdev/libgestures_glue/gesture_feedback.cc",
-      "evdev/libgestures_glue/gesture_feedback.h",
-      "evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc",
-      "evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h",
-      "evdev/libgestures_glue/gesture_logging.cc",
-      "evdev/libgestures_glue/gesture_logging.h",
-      "evdev/libgestures_glue/gesture_property_provider.cc",
-      "evdev/libgestures_glue/gesture_property_provider.h",
-      "evdev/libgestures_glue/gesture_timer_provider.cc",
-      "evdev/libgestures_glue/gesture_timer_provider.h",
+      "events_ozone_export.h",
     ]
 
-    public_configs += [ ":evdev_gestures" ]
-
-    configs += [
-      ":libevdev-cros",
-      ":libgestures",
+    deps = [
+      "//base",
+      "//base/third_party/dynamic_annotations",
+      "//ui/events",
+      "//ui/events:events_base",
     ]
+
+    defines = [ "EVENTS_OZONE_IMPLEMENTATION" ]
+
+    if (!use_udev) {
+      sources -= [
+        "device/udev/device_manager_udev.cc",
+        "device/udev/device_manager_udev.h",
+      ]
+    }
+
+    if (use_ozone && use_udev) {
+      deps += [ "//device/udev_linux" ]
+    }
+  }
+
+  config("evdev") {
+    defines = [ "USE_EVDEV" ]
+  }
+
+  config("evdev_gestures") {
+    defines = [ "USE_EVDEV_GESTURES" ]
+  }
+
+  if (use_evdev_gestures) {
+    pkg_config("libevdev-cros") {
+      packages = [ "libevdev-cros" ]
+    }
+
+    pkg_config("libgestures") {
+      packages = [ "libgestures" ]
+    }
+  }
+
+  component("events_ozone_evdev") {
+    sources = [
+      "evdev/device_event_dispatcher_evdev.cc",
+      "evdev/device_event_dispatcher_evdev.h",
+      "evdev/event_converter_evdev.cc",
+      "evdev/event_converter_evdev.h",
+      "evdev/event_converter_evdev_impl.cc",
+      "evdev/event_converter_evdev_impl.h",
+      "evdev/event_device_info.cc",
+      "evdev/event_device_info.h",
+      "evdev/event_factory_evdev.cc",
+      "evdev/event_factory_evdev.h",
+      "evdev/event_modifiers_evdev.cc",
+      "evdev/event_modifiers_evdev.h",
+      "evdev/event_thread_evdev.cc",
+      "evdev/event_thread_evdev.h",
+      "evdev/events_ozone_evdev_export.h",
+      "evdev/input_controller_evdev.cc",
+      "evdev/input_controller_evdev.h",
+      "evdev/input_device_factory_evdev.cc",
+      "evdev/input_device_factory_evdev.h",
+      "evdev/input_device_factory_evdev_proxy.cc",
+      "evdev/input_device_factory_evdev_proxy.h",
+      "evdev/input_device_settings_evdev.cc",
+      "evdev/input_device_settings_evdev.h",
+      "evdev/input_injector_evdev.cc",
+      "evdev/input_injector_evdev.h",
+      "evdev/keyboard_evdev.cc",
+      "evdev/keyboard_evdev.h",
+      "evdev/keyboard_util_evdev.cc",
+      "evdev/keyboard_util_evdev.h",
+      "evdev/mouse_button_map_evdev.cc",
+      "evdev/mouse_button_map_evdev.h",
+      "evdev/tablet_event_converter_evdev.cc",
+      "evdev/tablet_event_converter_evdev.h",
+      "evdev/touch_evdev_debug_buffer.cc",
+      "evdev/touch_evdev_debug_buffer.h",
+      "evdev/touch_evdev_types.cc",
+      "evdev/touch_evdev_types.h",
+      "evdev/touch_event_converter_evdev.cc",
+      "evdev/touch_event_converter_evdev.h",
+      "evdev/touch_noise/far_apart_taps_touch_noise_filter.cc",
+      "evdev/touch_noise/far_apart_taps_touch_noise_filter.h",
+      "evdev/touch_noise/horizontally_aligned_touch_noise_filter.cc",
+      "evdev/touch_noise/horizontally_aligned_touch_noise_filter.h",
+      "evdev/touch_noise/single_position_touch_noise_filter.cc",
+      "evdev/touch_noise/single_position_touch_noise_filter.h",
+      "evdev/touch_noise/touch_noise_filter.h",
+      "evdev/touch_noise/touch_noise_finder.cc",
+      "evdev/touch_noise/touch_noise_finder.h",
+    ]
+
+    defines = [ "EVENTS_OZONE_EVDEV_IMPLEMENTATION" ]
+
+    deps = [
+      ":events_ozone",
+      ":events_ozone_layout",
+      "//base",
+      "//ui/events",
+      "//ui/events:dom_keycode_converter",
+      "//ui/events:events_base",
+      "//ui/events/devices",
+      "//ui/events/platform",
+      "//ui/gfx",
+    ]
+
+    public_configs = [ ":evdev" ]
+
+    if (use_ozone && use_evdev_gestures) {
+      sources += [
+        "evdev/libgestures_glue/event_reader_libevdev_cros.cc",
+        "evdev/libgestures_glue/event_reader_libevdev_cros.h",
+        "evdev/libgestures_glue/gesture_feedback.cc",
+        "evdev/libgestures_glue/gesture_feedback.h",
+        "evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc",
+        "evdev/libgestures_glue/gesture_interpreter_libevdev_cros.h",
+        "evdev/libgestures_glue/gesture_logging.cc",
+        "evdev/libgestures_glue/gesture_logging.h",
+        "evdev/libgestures_glue/gesture_property_provider.cc",
+        "evdev/libgestures_glue/gesture_property_provider.h",
+        "evdev/libgestures_glue/gesture_timer_provider.cc",
+        "evdev/libgestures_glue/gesture_timer_provider.h",
+      ]
+
+      public_configs += [ ":evdev_gestures" ]
+
+      configs += [
+        ":libevdev-cros",
+        ":libgestures",
+      ]
+    }
   }
 }