diff --git a/DEPS b/DEPS
index b9da793..4a1d04e 100644
--- a/DEPS
+++ b/DEPS
@@ -39,11 +39,11 @@
   # 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': 'c4ed68426649dd4ca2c3119cdafdd562d3c3ba28',
+  'skia_revision': 'ab926f0a1bca1c6e17520803d964a0344b4f79b4',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': 'd93a2c276a84d4b46e6698b2fc0780c22b2d7585',
+  'v8_revision': 'cdca13910c3fbc9108898c27ee4edfc592bb86a6',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
@@ -96,7 +96,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': '2b8a913d1773ab2145bce5267c94580690cc7d17',
+  'catapult_revision': '0728abf6c1028739bad3290673c1e3f50f770d05',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 10f1fd00..0fb216c 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -25,6 +25,7 @@
     r"^chrome[\\\/]browser[\\\/]resources[\\\/]pdf[\\\/]index.js",
 )
 
+
 # The NetscapePlugIn library is excluded from pan-project as it will soon
 # be deleted together with the rest of the NPAPI and it's not worthwhile to
 # update the coding style until then.
@@ -32,10 +33,12 @@
     r"^content[\\\/]shell[\\\/]tools[\\\/]plugin[\\\/].*",
 )
 
+
 # Fragment of a regular expression that matches C++ and Objective-C++
 # implementation files.
 _IMPLEMENTATION_EXTENSIONS = r'\.(cc|cpp|cxx|mm)$'
 
+
 # Regular expression that matches code only used for test binaries
 # (best effort).
 _TEST_CODE_EXCLUDED_PATHS = (
@@ -55,6 +58,7 @@
     r'testing[\\\/]iossim[\\\/]iossim\.mm$',
 )
 
+
 _TEST_ONLY_WARNING = (
     'You might be calling functions intended only for testing from\n'
     'production code.  It is OK to ignore this warning if you know what\n'
@@ -67,6 +71,7 @@
     'collation (LC_COLLATE=C) and check\nhttps://google.github.io/styleguide/'
     'cppguide.html#Names_and_Order_of_Includes')
 
+
 _BANNED_OBJC_FUNCTIONS = (
     (
       'addTrackingRect:',
@@ -291,6 +296,7 @@
     ),
 )
 
+
 _IPC_ENUM_TRAITS_DEPRECATED = (
     'You are using IPC_ENUM_TRAITS() in your code. It has been deprecated.\n'
     'See http://www.chromium.org/Home/chromium-security/education/security-tips-for-ipc')
@@ -322,10 +328,12 @@
     'net/tools/testserver/testserver.pydeps',
 ]
 
+
 _GENERIC_PYDEPS_FILES = [
     'build/secondary/tools/swarming_client/isolate.pydeps',
 ]
 
+
 _ALL_PYDEPS_FILES = _ANDROID_SPECIFIC_PYDEPS_FILES + _GENERIC_PYDEPS_FILES
 
 
@@ -491,6 +499,7 @@
     'been modified and the associated histogram name has no match in either '
     '%s or the modifications of it:' % (histograms_xml_path),  problems)]
 
+
 def _CheckFlakyTestUsage(input_api, output_api):
   """Check that FlakyTest annotation is our own instead of the android one"""
   pattern = input_api.re.compile(r'import android.test.FlakyTest;')
@@ -506,6 +515,7 @@
       files)]
   return []
 
+
 def _CheckNoNewWStrings(input_api, output_api):
   """Checks to make sure we don't introduce use of wstrings."""
   problems = []
@@ -566,51 +576,42 @@
   warnings = []
   errors = []
 
+  def IsBlacklisted(affected_file, blacklist):
+    local_path = affected_file.LocalPath()
+    for item in blacklist:
+      if input_api.re.match(item, local_path):
+        return True
+    return False
+
+  def CheckForMatch(affected_file, line_num, line, func_name, message, error):
+    matched = False
+    if func_name[0:1] == '/':
+      regex = func_name[1:]
+      if input_api.re.search(regex, line):
+        matched = True
+    elif func_name in line:
+        matched = True
+    if matched:
+      problems = warnings;
+      if error:
+        problems = errors;
+      problems.append('    %s:%d:' % (affected_file.LocalPath(), line_num))
+      for message_line in message:
+        problems.append('      %s' % message_line)
+
   file_filter = lambda f: f.LocalPath().endswith(('.mm', '.m', '.h'))
   for f in input_api.AffectedFiles(file_filter=file_filter):
     for line_num, line in f.ChangedContents():
       for func_name, message, error in _BANNED_OBJC_FUNCTIONS:
-        matched = False
-        if func_name[0:1] == '/':
-          regex = func_name[1:]
-          if input_api.re.search(regex, line):
-            matched = True
-        elif func_name in line:
-            matched = True
-        if matched:
-          problems = warnings;
-          if error:
-            problems = errors;
-          problems.append('    %s:%d:' % (f.LocalPath(), line_num))
-          for message_line in message:
-            problems.append('      %s' % message_line)
+        CheckForMatch(f, line_num, line, func_name, message, error)
 
   file_filter = lambda f: f.LocalPath().endswith(('.cc', '.mm', '.h'))
   for f in input_api.AffectedFiles(file_filter=file_filter):
     for line_num, line in f.ChangedContents():
       for func_name, message, error, excluded_paths in _BANNED_CPP_FUNCTIONS:
-        def IsBlacklisted(affected_file, blacklist):
-          local_path = affected_file.LocalPath()
-          for item in blacklist:
-            if input_api.re.match(item, local_path):
-              return True
-          return False
         if IsBlacklisted(f, excluded_paths):
           continue
-        matched = False
-        if func_name[0:1] == '/':
-          regex = func_name[1:]
-          if input_api.re.search(regex, line):
-            matched = True
-        elif func_name in line:
-            matched = True
-        if matched:
-          problems = warnings;
-          if error:
-            problems = errors;
-          problems.append('    %s:%d:' % (f.LocalPath(), line_num))
-          for message_line in message:
-            problems.append('      %s' % message_line)
+        CheckForMatch(f, line_num, line, func_name, message, error)
 
   result = []
   if (warnings):
@@ -1862,6 +1863,7 @@
   results.extend(_CheckSingletonInHeaders(input_api, output_api))
   results.extend(_CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api))
   results.extend(_CheckPydepsNeedsUpdating(input_api, output_api))
+  results.extend(_CheckJavaStyle(input_api, output_api))
 
   if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
     results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
@@ -2085,7 +2087,6 @@
   results = []
   results.extend(_CommonChecks(input_api, output_api))
   results.extend(_CheckValidHostsInDEPS(input_api, output_api))
-  results.extend(_CheckJavaStyle(input_api, output_api))
   results.extend(
       input_api.canned_checks.CheckGNFormatted(input_api, output_api))
   results.extend(_CheckUmaHistogramChanges(input_api, output_api))
@@ -2106,7 +2107,9 @@
   }
   master = master_map.get(bot)
   if not master:
-    if 'linux' in bot or 'android' in bot or 'presubmit' in bot:
+    if 'android' in bot:
+      master = 'tryserver.chromium.android'
+    elif 'linux' in bot or 'presubmit' in bot:
       master = 'tryserver.chromium.linux'
     elif 'win' in bot:
       master = 'tryserver.chromium.win'
diff --git a/WATCHLISTS b/WATCHLISTS
index dde403b7..ca7c6b1 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -567,7 +567,6 @@
     },
     'mus': {
       'filepath': 'components/mus/'\
-                  '|mojo/gles2/'\
                   '|mojo/gpu/',
     },
     'nacl': {
diff --git a/ash/ash_chromeos_strings.grdp b/ash/ash_chromeos_strings.grdp
index 1971bd116..1b3a4e5 100644
--- a/ash/ash_chromeos_strings.grdp
+++ b/ash/ash_chromeos_strings.grdp
@@ -234,7 +234,6 @@
   <message name="IDS_ASH_STATUS_TRAY_AUDIO_HDMI_DEVICE" desc="label used for hdmi audio device">
     <ph name="device_name">$1<ex>Speaker</ex></ph> (HDMI/DP)
   </message>
-  
   <message name="IDS_ASH_STATUS_TRAY_AUDIO_MIC_JACK_DEVICE" desc="label used for mic jack device">
     Mic Jack
   </message>
@@ -488,6 +487,18 @@
     Sign out now
   </message>
 
+  <!-- HaTS Strings -->
+  <message name="IDS_ASH_HATS_NOTIFICATION_TITLE" desc="The title of the notification for Happiness Tracking Survey.">
+    Help us improve Chromebooks
+  </message>
+  <message name="IDS_ASH_HATS_NOTIFICATION_BODY" desc="The body of the notification for Happiness Tracking Survey.">
+    <!-- TODO(malaykeshav): Implement the actual HaTS notification strings -->
+    Chrome OS HaTS survey text here. Chrome OS HaTS survey text here. Chrome OS HaTS survey text here. Chrome OS HaTS survey text here.
+  </message>
+  <message name="IDS_ASH_HATS_NOTIFICATION_TAKE_SURVEY_BUTTON" desc="The title of the button in the notification for Happiness Tracking Survey to take the said survey.">
+    Take our survey
+  </message>
+
   <!-- Deprecated Accelerators Messages -->
   <!-- Shortcut keys MUST be connected with pluses (e.g. Ctrl+Shift+L). -->
   <message name="IDS_SHORTCUT_LOCK_SCREEN_OLD" desc="the old deprecated shortcut to lock the screen.">
diff --git a/ash/system/system_notifier.cc b/ash/system/system_notifier.cc
index 2a4892f0..76875de 100644
--- a/ash/system/system_notifier.cc
+++ b/ash/system/system_notifier.cc
@@ -77,6 +77,7 @@
 const char kNotifierDisplayError[] = "ash.display.error";
 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change";
 const char kNotifierDualRole[] = "ash.dual-role";
+const char kNotifierHats[] = "ash.hats";
 const char kNotifierLocale[] = "ash.locale";
 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run";
 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector";
diff --git a/ash/system/system_notifier.h b/ash/system/system_notifier.h
index d2a14fa..8febc9f 100644
--- a/ash/system/system_notifier.h
+++ b/ash/system/system_notifier.h
@@ -21,6 +21,7 @@
 ASH_EXPORT extern const char kNotifierDisplayResolutionChange[];
 ASH_EXPORT extern const char kNotifierDisplayError[];
 ASH_EXPORT extern const char kNotifierDualRole[];
+ASH_EXPORT extern const char kNotifierHats[];
 ASH_EXPORT extern const char kNotifierLocale[];
 ASH_EXPORT extern const char kNotifierMultiProfileFirstRun[];
 ASH_EXPORT extern const char kNotifierNetwork[];
diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
index f9d8c14..cd02e9a 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -207,9 +207,9 @@
     net::NetLog* net_log,
     BlimpEngineConfig* engine_config,
     SettingsManager* settings_manager)
-    : browser_context_(std::move(browser_context)),
+    : screen_(new BlimpScreen),
+      browser_context_(std::move(browser_context)),
       engine_config_(engine_config),
-      screen_(new BlimpScreen),
       settings_manager_(settings_manager),
       settings_feature_(settings_manager_),
       render_widget_feature_(settings_manager_),
diff --git a/blimp/engine/session/blimp_engine_session.h b/blimp/engine/session/blimp_engine_session.h
index efe50e4..ea6e04d 100644
--- a/blimp/engine/session/blimp_engine_session.h
+++ b/blimp/engine/session/blimp_engine_session.h
@@ -171,15 +171,16 @@
   // This field is used per tab.
   bool last_page_load_completed_value_;
 
+  // Presents the client's single screen.
+  // Screen should be deleted after browser context (crbug.com/613372).
+  std::unique_ptr<BlimpScreen> screen_;
+
   // Content BrowserContext for this session.
   std::unique_ptr<BlimpBrowserContext> browser_context_;
 
   // Engine configuration including assigned client token.
   BlimpEngineConfig* engine_config_;
 
-  // Presents the client's single screen.
-  std::unique_ptr<BlimpScreen> screen_;
-
   // Represents the (currently single) browser window into which tab(s) will
   // be rendered.
   std::unique_ptr<BlimpWindowTreeHost> window_tree_host_;
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
index 105a23ec..3dd36d0 100755
--- a/build/install-build-deps.sh
+++ b/build/install-build-deps.sh
@@ -109,7 +109,7 @@
           libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev openbox
           patch perl pkg-config python python-cherrypy3 python-crypto
           python-dev python-numpy python-opencv python-openssl python-psutil
-          python-yaml rpm ruby subversion ttf-dejavu-core wdiff zip
+          python-yaml rpm ruby subversion ttf-dejavu-core wdiff xcompmgr zip
           $chromeos_dev_list"
 
 # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
diff --git a/cc/ipc/cc_param_traits.cc b/cc/ipc/cc_param_traits.cc
index 7c4406b..9caa36f 100644
--- a/cc/ipc/cc_param_traits.cc
+++ b/cc/ipc/cc_param_traits.cc
@@ -19,6 +19,7 @@
 #include "cc/quads/surface_draw_quad.h"
 #include "cc/quads/tile_draw_quad.h"
 #include "cc/quads/yuv_video_draw_quad.h"
+#include "cc/surfaces/surface_id.h"
 #include "third_party/skia/include/core/SkData.h"
 #include "third_party/skia/include/core/SkFlattenableSerialization.h"
 #include "third_party/skia/include/core/SkImageFilter.h"
@@ -567,6 +568,48 @@
   l->append("])");
 }
 
+void ParamTraits<cc::SurfaceId>::GetSize(base::PickleSizer* s,
+                                         const param_type& p) {
+  GetParamSize(s, p.id_namespace());
+  GetParamSize(s, p.local_id());
+  GetParamSize(s, p.nonce());
+}
+
+void ParamTraits<cc::SurfaceId>::Write(base::Pickle* m, const param_type& p) {
+  WriteParam(m, p.id_namespace());
+  WriteParam(m, p.local_id());
+  WriteParam(m, p.nonce());
+}
+
+bool ParamTraits<cc::SurfaceId>::Read(const base::Pickle* m,
+                                      base::PickleIterator* iter,
+                                      param_type* p) {
+  uint32_t id_namespace;
+  if (!ReadParam(m, iter, &id_namespace))
+    return false;
+
+  uint32_t local_id;
+  if (!ReadParam(m, iter, &local_id))
+    return false;
+
+  uint64_t nonce;
+  if (!ReadParam(m, iter, &nonce))
+    return false;
+
+  *p = cc::SurfaceId(id_namespace, local_id, nonce);
+  return true;
+}
+
+void ParamTraits<cc::SurfaceId>::Log(const param_type& p, std::string* l) {
+  l->append("SurfaceId(");
+  LogParam(p.id_namespace(), l);
+  l->append(", ");
+  LogParam(p.local_id(), l);
+  l->append(", ");
+  LogParam(p.nonce(), l);
+  l->append(")");
+}
+
 namespace {
 enum CompositorFrameType {
   NO_FRAME,
diff --git a/cc/ipc/cc_param_traits.h b/cc/ipc/cc_param_traits.h
index 310b3f0b..3110ce58 100644
--- a/cc/ipc/cc_param_traits.h
+++ b/cc/ipc/cc_param_traits.h
@@ -73,6 +73,17 @@
 };
 
 template <>
+struct CC_IPC_EXPORT ParamTraits<cc::SurfaceId> {
+  typedef cc::SurfaceId param_type;
+  static void GetSize(base::PickleSizer* s, const param_type& p);
+  static void Write(base::Pickle* m, const param_type& p);
+  static bool Read(const base::Pickle* m,
+                   base::PickleIterator* iter,
+                   param_type* r);
+  static void Log(const param_type& p, std::string* l);
+};
+
+template <>
 struct CC_IPC_EXPORT ParamTraits<cc::CompositorFrame> {
   typedef cc::CompositorFrame param_type;
   static void Write(base::Pickle* m, const param_type& p);
diff --git a/cc/ipc/cc_param_traits_macros.h b/cc/ipc/cc_param_traits_macros.h
index 6450b000..e560b52 100644
--- a/cc/ipc/cc_param_traits_macros.h
+++ b/cc/ipc/cc_param_traits_macros.h
@@ -48,10 +48,6 @@
   IPC_STRUCT_TRAITS_MEMBER(index)
 IPC_STRUCT_TRAITS_END()
 
-IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceId)
-  IPC_STRUCT_TRAITS_MEMBER(id)
-IPC_STRUCT_TRAITS_END()
-
 IPC_STRUCT_TRAITS_BEGIN(cc::SurfaceSequence)
   IPC_STRUCT_TRAITS_MEMBER(id_namespace)
   IPC_STRUCT_TRAITS_MEMBER(sequence)
diff --git a/cc/ipc/cc_param_traits_unittest.cc b/cc/ipc/cc_param_traits_unittest.cc
index 1def13d8..dd19404 100644
--- a/cc/ipc/cc_param_traits_unittest.cc
+++ b/cc/ipc/cc_param_traits_unittest.cc
@@ -355,7 +355,7 @@
   pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in,
                                       streamvideo_in->shared_quad_state);
 
-  cc::SurfaceId arbitrary_surface_id(3);
+  cc::SurfaceId arbitrary_surface_id(0, 3, 0);
   SurfaceDrawQuad* surface_in =
       pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
   surface_in->SetAll(shared_state3_in, arbitrary_rect2,
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc
index 429d928..c262d2e 100644
--- a/cc/layers/surface_layer_impl.cc
+++ b/cc/layers/surface_layer_impl.cc
@@ -179,7 +179,7 @@
 
 void SurfaceLayerImpl::AsValueInto(base::trace_event::TracedValue* dict) const {
   LayerImpl::AsValueInto(dict);
-  dict->SetInteger("surface_id", surface_id_.id);
+  dict->SetString("surface_id", surface_id_.ToString());
 }
 
 const char* SurfaceLayerImpl::LayerTypeAsString() const {
diff --git a/cc/layers/surface_layer_impl_unittest.cc b/cc/layers/surface_layer_impl_unittest.cc
index 50d4b3a..e88f3e54 100644
--- a/cc/layers/surface_layer_impl_unittest.cc
+++ b/cc/layers/surface_layer_impl_unittest.cc
@@ -22,7 +22,7 @@
       impl.AddChildToRoot<SurfaceLayerImpl>();
   surface_layer_impl->SetBounds(layer_size);
   surface_layer_impl->SetDrawsContent(true);
-  SurfaceId surface_id(9);
+  SurfaceId surface_id(0, 9, 0);
   surface_layer_impl->SetSurfaceId(surface_id);
   surface_layer_impl->SetSurfaceScale(1.f);
   surface_layer_impl->SetSurfaceSize(layer_size);
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index b7db7abd..83ba4a0 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -73,7 +73,7 @@
   scoped_refptr<SurfaceLayer> layer(SurfaceLayer::Create(
       base::Bind(&SatisfyCallback, &blank_change),
       base::Bind(&RequireCallback, &required_id, &required_seq)));
-  layer->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+  layer->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
   layer_tree_host_->set_surface_id_namespace(1);
   layer_tree_host_->SetRootLayer(layer);
 
@@ -82,7 +82,7 @@
   scoped_refptr<SurfaceLayer> layer2(SurfaceLayer::Create(
       base::Bind(&SatisfyCallback, &blank_change),
       base::Bind(&RequireCallback, &required_id, &required_seq)));
-  layer2->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+  layer2->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
   layer_tree_host2->set_surface_id_namespace(2);
   layer_tree_host2->SetRootLayer(layer2);
 
@@ -101,7 +101,7 @@
 
   // Set of sequences that need to be satisfied should include sequences from
   // both trees.
-  EXPECT_TRUE(required_id == SurfaceId(1));
+  EXPECT_TRUE(required_id == SurfaceId(0, 1, 0));
   EXPECT_EQ(2u, required_seq.size());
   EXPECT_TRUE(required_seq.count(expected1));
   EXPECT_TRUE(required_seq.count(expected2));
@@ -129,7 +129,7 @@
     layer_ = SurfaceLayer::Create(
         base::Bind(&SatisfyCallback, &satisfied_sequence_),
         base::Bind(&RequireCallback, &required_id_, &required_set_));
-    layer_->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+    layer_->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
 
     // Layer hasn't been added to tree so no SurfaceSequence generated yet.
     EXPECT_EQ(0u, required_set_.size());
@@ -138,7 +138,7 @@
 
     // Should have SurfaceSequence from first tree.
     SurfaceSequence expected(1u, 1u);
-    EXPECT_TRUE(required_id_ == SurfaceId(1));
+    EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
     EXPECT_EQ(1u, required_set_.size());
     EXPECT_TRUE(required_set_.count(expected));
 
@@ -208,7 +208,7 @@
   }
 
   void AfterTest() override {
-    EXPECT_TRUE(required_id_ == SurfaceId(1));
+    EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
     EXPECT_EQ(1u, required_set_.size());
     // Sequence should have been satisfied through Swap, not with the
     // callback.
@@ -249,7 +249,7 @@
   }
 
   void AfterTest() override {
-    EXPECT_TRUE(required_id_ == SurfaceId(1));
+    EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
     EXPECT_EQ(1u, required_set_.size());
     // Sequence should have been satisfied with the callback.
     EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u));
diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc
index b4af80b8e..4172d94 100644
--- a/cc/quads/draw_quad_unittest.cc
+++ b/cc/quads/draw_quad_unittest.cc
@@ -507,7 +507,7 @@
 
 TEST(DrawQuadTest, CopySurfaceDrawQuad) {
   gfx::Rect visible_rect(40, 50, 30, 20);
-  SurfaceId surface_id(1234);
+  SurfaceId surface_id(0, 1234, 0);
   CREATE_SHARED_STATE();
 
   CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id);
@@ -796,7 +796,7 @@
 
 TEST_F(DrawQuadIteratorTest, SurfaceDrawQuad) {
   gfx::Rect visible_rect(40, 50, 30, 20);
-  SurfaceId surface_id(4321);
+  SurfaceId surface_id(0, 4321, 0);
 
   CREATE_SHARED_STATE();
   CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id);
diff --git a/cc/quads/surface_draw_quad.cc b/cc/quads/surface_draw_quad.cc
index 6551581..d1a2882 100644
--- a/cc/quads/surface_draw_quad.cc
+++ b/cc/quads/surface_draw_quad.cc
@@ -41,7 +41,7 @@
 }
 
 void SurfaceDrawQuad::ExtendValue(base::trace_event::TracedValue* value) const {
-  value->SetInteger("surface_id", surface_id.id);
+  value->SetString("surface_id", surface_id.ToString());
 }
 
 
diff --git a/cc/surfaces/display_scheduler.cc b/cc/surfaces/display_scheduler.cc
index 881f8e5..4308550 100644
--- a/cc/surfaces/display_scheduler.cc
+++ b/cc/surfaces/display_scheduler.cc
@@ -78,7 +78,7 @@
 // triggering the deadline.
 void DisplayScheduler::SurfaceDamaged(SurfaceId surface_id) {
   TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamaged", "surface_id",
-               surface_id.id);
+               surface_id.ToString());
 
   needs_draw_ = true;
 
diff --git a/cc/surfaces/display_scheduler_unittest.cc b/cc/surfaces/display_scheduler_unittest.cc
index 50c082c..b09599ff 100644
--- a/cc/surfaces/display_scheduler_unittest.cc
+++ b/cc/surfaces/display_scheduler_unittest.cc
@@ -108,9 +108,9 @@
 };
 
 TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilNewRootSurface) {
-  SurfaceId root_surface_id1(1);
-  SurfaceId root_surface_id2(2);
-  SurfaceId sid1(3);
+  SurfaceId root_surface_id1(0, 1, 0);
+  SurfaceId root_surface_id2(0, 2, 0);
+  SurfaceId sid1(0, 3, 0);
   base::TimeTicks late_deadline;
 
   // Go trough an initial BeginFrame cycle with the root surface.
@@ -143,8 +143,8 @@
 }
 
 TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilDamagedSurface) {
-  SurfaceId root_surface_id(1);
-  SurfaceId sid1(2);
+  SurfaceId root_surface_id(0, 1, 0);
+  SurfaceId sid1(0, 2, 0);
   base::TimeTicks late_deadline;
 
   // Go trough an initial BeginFrame cycle with the root surface.
@@ -177,9 +177,9 @@
 }
 
 TEST_F(DisplaySchedulerTest, SurfaceDamaged) {
-  SurfaceId root_surface_id(0);
-  SurfaceId sid1(1);
-  SurfaceId sid2(2);
+  SurfaceId root_surface_id(0, 0, 0);
+  SurfaceId sid1(0, 1, 0);
+  SurfaceId sid2(0, 2, 0);
 
   // Set the root surface
   scheduler_->SetNewRootSurface(root_surface_id);
@@ -241,8 +241,8 @@
 }
 
 TEST_F(DisplaySchedulerTest, OutputSurfaceLost) {
-  SurfaceId root_surface_id(0);
-  SurfaceId sid1(1);
+  SurfaceId root_surface_id(0, 0, 0);
+  SurfaceId sid1(0, 1, 0);
 
   // Set the root surface
   scheduler_->SetNewRootSurface(root_surface_id);
@@ -272,8 +272,8 @@
 }
 
 TEST_F(DisplaySchedulerTest, ResizeCausesSwap) {
-  SurfaceId root_surface_id(0);
-  SurfaceId sid1(1);
+  SurfaceId root_surface_id(0, 0, 0);
+  SurfaceId sid1(0, 1, 0);
 
   // Set the root surface
   scheduler_->SetNewRootSurface(root_surface_id);
@@ -295,8 +295,8 @@
 }
 
 TEST_F(DisplaySchedulerTest, RootSurfaceResourcesLocked) {
-  SurfaceId root_surface_id(0);
-  SurfaceId sid1(1);
+  SurfaceId root_surface_id(0, 0, 0);
+  SurfaceId sid1(0, 1, 0);
   base::TimeTicks late_deadline;
 
   // Set the root surface
@@ -341,9 +341,9 @@
 }
 
 TEST_F(DisplaySchedulerTest, DidSwapBuffers) {
-  SurfaceId root_surface_id(0);
-  SurfaceId sid1(1);
-  SurfaceId sid2(2);
+  SurfaceId root_surface_id(0, 0, 0);
+  SurfaceId sid1(0, 1, 0);
+  SurfaceId sid2(0, 2, 0);
 
   // Set the root surface
   scheduler_->SetNewRootSurface(root_surface_id);
@@ -406,8 +406,8 @@
 // This test verfies that we try to reschedule the deadline
 // after any event that may change what deadline we want.
 TEST_F(DisplaySchedulerTest, ScheduleBeginFrameDeadline) {
-  SurfaceId root_surface_id(1);
-  SurfaceId sid1(2);
+  SurfaceId root_surface_id(0, 1, 0);
+  SurfaceId sid1(0, 2, 0);
   int count = 1;
   EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count());
 
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index 36772fc..ed99a1b0 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -98,8 +98,8 @@
     // Notify the manager that sequences were satisfied either if some new
     // sequences were satisfied, or if the set of referenced surfaces changed
     // to force a GC to happen.
-    factory_->manager()->DidSatisfySequences(
-        SurfaceIdAllocator::NamespaceForId(surface_id_), &satisfies_sequences);
+    factory_->manager()->DidSatisfySequences(surface_id_.id_namespace(),
+                                             &satisfies_sequences);
   }
 }
 
diff --git a/cc/surfaces/surface_aggregator_perftest.cc b/cc/surfaces/surface_aggregator_perftest.cc
index 3cc6a07..9c24bae 100644
--- a/cc/surfaces/surface_aggregator_perftest.cc
+++ b/cc/surfaces/surface_aggregator_perftest.cc
@@ -49,7 +49,7 @@
     aggregator_.reset(new SurfaceAggregator(&manager_, resource_provider_.get(),
                                             optimize_damage));
     for (int i = 1; i <= num_surfaces; i++) {
-      factory_.Create(SurfaceId(i));
+      factory_.Create(SurfaceId(0, i, 0));
       std::unique_ptr<RenderPass> pass(RenderPass::Create());
       std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
 
@@ -86,17 +86,17 @@
         SurfaceDrawQuad* surface_quad =
             pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
         surface_quad->SetNew(sqs, gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1),
-                             SurfaceId(i - 1));
+                             SurfaceId(0, i - 1, 0));
       }
 
       frame_data->render_pass_list.push_back(std::move(pass));
       std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
       frame->delegated_frame_data = std::move(frame_data);
-      factory_.SubmitCompositorFrame(SurfaceId(i), std::move(frame),
+      factory_.SubmitCompositorFrame(SurfaceId(0, i, 0), std::move(frame),
                                      SurfaceFactory::DrawCallback());
     }
 
-    factory_.Create(SurfaceId(num_surfaces + 1));
+    factory_.Create(SurfaceId(0, num_surfaces + 1, 0));
     timer_.Reset();
     do {
       std::unique_ptr<RenderPass> pass(RenderPass::Create());
@@ -106,7 +106,8 @@
       SurfaceDrawQuad* surface_quad =
           pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
       surface_quad->SetNew(sqs, gfx::Rect(0, 0, 100, 100),
-                           gfx::Rect(0, 0, 100, 100), SurfaceId(num_surfaces));
+                           gfx::Rect(0, 0, 100, 100),
+                           SurfaceId(0, num_surfaces, 0));
 
       if (full_damage)
         pass->damage_rect = gfx::Rect(0, 0, 100, 100);
@@ -116,21 +117,21 @@
       frame_data->render_pass_list.push_back(std::move(pass));
       std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
       frame->delegated_frame_data = std::move(frame_data);
-      factory_.SubmitCompositorFrame(SurfaceId(num_surfaces + 1),
+      factory_.SubmitCompositorFrame(SurfaceId(0, num_surfaces + 1, 0),
                                      std::move(frame),
                                      SurfaceFactory::DrawCallback());
 
       std::unique_ptr<CompositorFrame> aggregated =
-          aggregator_->Aggregate(SurfaceId(num_surfaces + 1));
+          aggregator_->Aggregate(SurfaceId(0, num_surfaces + 1, 0));
       timer_.NextLap();
     } while (!timer_.HasTimeLimitExpired());
 
     perf_test::PrintResult("aggregator_speed", "", name, timer_.LapsPerSecond(),
                            "runs/s", true);
 
-    factory_.Destroy(SurfaceId(num_surfaces + 1));
+    factory_.Destroy(SurfaceId(0, num_surfaces + 1, 0));
     for (int i = 1; i <= num_surfaces; i++)
-      factory_.Destroy(SurfaceId(i));
+      factory_.Destroy(SurfaceId(0, i, 0));
   }
 
  protected:
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index b0ab189..2ce40f1 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -38,8 +38,7 @@
 namespace {
 
 SurfaceId InvalidSurfaceId() {
-  static SurfaceId invalid;
-  invalid.id = static_cast<uint64_t>(-1);
+  static SurfaceId invalid(0, 0xdeadbeef, 0);
   return invalid;
 }
 
@@ -79,7 +78,7 @@
 };
 
 TEST_F(SurfaceAggregatorTest, ValidSurfaceNoFrame) {
-  SurfaceId one_id(7);
+  SurfaceId one_id(0, 7, 0);
   factory_.Create(one_id);
 
   std::unique_ptr<CompositorFrame> frame = aggregator_.Aggregate(one_id);
@@ -1961,7 +1960,7 @@
 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) {
   ResourceTrackingSurfaceFactoryClient client;
   SurfaceFactory factory(&manager_, &client);
-  SurfaceId surface_id(7u);
+  SurfaceId surface_id(0, 7u, 0);
   factory.Create(surface_id);
 
   ResourceId ids[] = {11, 12, 13};
@@ -1991,7 +1990,7 @@
 TEST_F(SurfaceAggregatorWithResourcesTest, TakeInvalidResources) {
   ResourceTrackingSurfaceFactoryClient client;
   SurfaceFactory factory(&manager_, &client);
-  SurfaceId surface_id(7u);
+  SurfaceId surface_id(0, 7u, 0);
   factory.Create(surface_id);
 
   std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -2026,10 +2025,10 @@
 TEST_F(SurfaceAggregatorWithResourcesTest, TwoSurfaces) {
   ResourceTrackingSurfaceFactoryClient client;
   SurfaceFactory factory(&manager_, &client);
-  SurfaceId surface1_id(7u);
+  SurfaceId surface1_id(0, 7u, 0);
   factory.Create(surface1_id);
 
-  SurfaceId surface2_id(8u);
+  SurfaceId surface2_id(0, 8u, 0);
   factory.Create(surface2_id);
 
   ResourceId ids[] = {11, 12, 13};
@@ -2067,11 +2066,11 @@
 TEST_F(SurfaceAggregatorWithResourcesTest, InvalidChildSurface) {
   ResourceTrackingSurfaceFactoryClient client;
   SurfaceFactory factory(&manager_, &client);
-  SurfaceId root_surface_id(7u);
+  SurfaceId root_surface_id(0, 7u, 0);
   factory.Create(root_surface_id);
-  SurfaceId middle_surface_id(8u);
+  SurfaceId middle_surface_id(0, 8u, 0);
   factory.Create(middle_surface_id);
-  SurfaceId child_surface_id(9u);
+  SurfaceId child_surface_id(0, 9u, 0);
   factory.Create(child_surface_id);
 
   ResourceId ids[] = {14, 15, 16};
@@ -2115,10 +2114,10 @@
 TEST_F(SurfaceAggregatorWithResourcesTest, SecureOutputTexture) {
   ResourceTrackingSurfaceFactoryClient client;
   SurfaceFactory factory(&manager_, &client);
-  SurfaceId surface1_id(7u);
+  SurfaceId surface1_id(0, 7u, 0);
   factory.Create(surface1_id);
 
-  SurfaceId surface2_id(8u);
+  SurfaceId surface2_id(0, 8u, 0);
   factory.Create(surface2_id);
 
   ResourceId ids[] = {11, 12, 13};
diff --git a/cc/surfaces/surface_factory_client.h b/cc/surfaces/surface_factory_client.h
index f42bf35c..3454c9c 100644
--- a/cc/surfaces/surface_factory_client.h
+++ b/cc/surfaces/surface_factory_client.h
@@ -13,7 +13,7 @@
 namespace cc {
 
 class BeginFrameSource;
-struct SurfaceId;
+class SurfaceId;
 
 class CC_SURFACES_EXPORT SurfaceFactoryClient {
  public:
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index d458e029..5a062c8 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -66,7 +66,7 @@
  public:
   SurfaceFactoryTest()
       : factory_(new SurfaceFactory(&manager_, &client_)),
-        surface_id_(3),
+        surface_id_(0, 3, 0),
         frame_sync_token_(GenTestSyncToken(4)),
         consumer_sync_token_(GenTestSyncToken(5)) {
     manager_.AddObserver(this);
@@ -419,7 +419,7 @@
 }
 
 TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
-  SurfaceId surface_id(6);
+  SurfaceId surface_id(0, 6, 0);
   factory_->Create(surface_id);
   Surface* surface = manager_.GetSurfaceForId(surface_id);
   ASSERT_NE(nullptr, surface);
@@ -437,7 +437,7 @@
                                uint32_t* execute_count,
                                SurfaceDrawStatus* result,
                                SurfaceDrawStatus drawn) {
-  SurfaceId new_id(7);
+  SurfaceId new_id(0, 7, 0);
   factory->Create(new_id);
   factory->Destroy(new_id);
   *execute_count += 1;
@@ -445,7 +445,7 @@
 }
 
 TEST_F(SurfaceFactoryTest, AddDuringDestroy) {
-  SurfaceId surface_id(6);
+  SurfaceId surface_id(0, 6, 0);
   factory_->Create(surface_id);
   std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
   frame->delegated_frame_data.reset(new DelegatedFrameData);
@@ -471,7 +471,7 @@
 
 // Tests doing a DestroyAll before shutting down the factory;
 TEST_F(SurfaceFactoryTest, DestroyAll) {
-  SurfaceId id(7);
+  SurfaceId id(0, 7, 0);
   factory_->Create(id);
 
   std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -494,7 +494,7 @@
 }
 
 TEST_F(SurfaceFactoryTest, DestroySequence) {
-  SurfaceId id2(5);
+  SurfaceId id2(0, 5, 0);
   factory_->Create(id2);
 
   manager_.RegisterSurfaceIdNamespace(0);
@@ -527,7 +527,7 @@
 // Sequences to be ignored.
 TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
   uint32_t id_namespace = 9u;
-  SurfaceId id(5);
+  SurfaceId id(id_namespace, 5, 0);
   factory_->Create(id);
 
   manager_.RegisterSurfaceIdNamespace(id_namespace);
@@ -546,7 +546,7 @@
 }
 
 TEST_F(SurfaceFactoryTest, DestroyCycle) {
-  SurfaceId id2(5);
+  SurfaceId id2(0, 5, 0);
   factory_->Create(id2);
 
   manager_.RegisterSurfaceIdNamespace(0);
diff --git a/cc/surfaces/surface_hittest_unittest.cc b/cc/surfaces/surface_hittest_unittest.cc
index fec6509..54a5b36 100644
--- a/cc/surfaces/surface_hittest_unittest.cc
+++ b/cc/surfaces/surface_hittest_unittest.cc
@@ -70,9 +70,7 @@
       CreateCompositorFrame(root_rect, &root_pass);
 
   // Add a reference to a non-existant child surface on the root surface.
-  SurfaceIdAllocator child_allocator(3);
-  SurfaceId child_surface_id;
-  child_surface_id.id = 0xdeadbeef;
+  SurfaceId child_surface_id(3, 0xdeadbeef, 0);
   gfx::Rect child_rect(200, 200);
   CreateSurfaceDrawQuad(root_pass,
                         gfx::Transform(),
diff --git a/cc/surfaces/surface_id.h b/cc/surfaces/surface_id.h
index bbc485f..c48e8129 100644
--- a/cc/surfaces/surface_id.h
+++ b/cc/surfaces/surface_id.h
@@ -10,36 +10,72 @@
 
 #include <functional>
 
+#include "base/format_macros.h"
+#include "base/hash.h"
+#include "base/strings/stringprintf.h"
+
 namespace cc {
 
-struct SurfaceId {
-  SurfaceId() : id(0) {}
-  explicit SurfaceId(uint64_t id) : id(id) {}
+class SurfaceId {
+ public:
+  SurfaceId() : id_namespace_(0), local_id_(0), nonce_(0) {}
 
-  bool is_null() const { return id == 0; }
+  SurfaceId(const SurfaceId& other)
+      : id_namespace_(other.id_namespace_),
+        local_id_(other.local_id_),
+        nonce_(other.nonce_) {}
 
+  // A SurfaceId consists of three components: namespace, local Id, and nonce.
+  // An |id_namespace| is a display compositor service allocated ID that
+  // uniquely identifies a client.
+  // A |local_id| is a sequentially allocated ID generated by the display
+  // compositor client.
+  // A |nonce| is a cryptographically secure random int that makes a SurfaceId
+  // unguessable by other clients.
+  SurfaceId(uint32_t id_namespace, uint32_t local_id, uint64_t nonce)
+      : id_namespace_(id_namespace), local_id_(local_id), nonce_(nonce) {}
+
+  bool is_null() const {
+    return id_namespace_ == 0 && nonce_ == 0 && local_id_ == 0;
+  }
+
+  size_t hash() const {
+    size_t interim = base::HashInts(id_namespace_, local_id_);
+    return base::HashInts(static_cast<uint64_t>(interim), nonce_);
+  }
+
+  uint32_t id_namespace() const { return id_namespace_; }
+
+  uint32_t local_id() const { return local_id_; }
+
+  uint64_t nonce() const { return nonce_; }
+
+  std::string ToString() const {
+    return base::StringPrintf("%d:%d:%" PRIu64, id_namespace_, local_id_,
+                              nonce_);
+  }
+
+  bool operator==(const SurfaceId& other) const {
+    return id_namespace_ == other.id_namespace_ &&
+           local_id_ == other.local_id_ && nonce_ == other.nonce_;
+  }
+
+  bool operator!=(const SurfaceId& other) const { return !(*this == other); }
+
+  bool operator<(const SurfaceId& other) const {
+    return std::tie(id_namespace_, local_id_, nonce_) <
+           std::tie(other.id_namespace_, other.local_id_, other.nonce_);
+  }
+
+ private:
   // See SurfaceIdAllocator::GenerateId.
-  uint32_t id_namespace() const { return id >> 32; }
-
-  uint64_t id;
+  uint32_t id_namespace_;
+  uint32_t local_id_;
+  uint64_t nonce_;
 };
 
-inline bool operator==(const SurfaceId& a, const SurfaceId& b) {
-  return a.id == b.id;
-}
-
-inline bool operator!=(const SurfaceId& a, const SurfaceId& b) {
-  return !(a == b);
-}
-
-inline bool operator<(const SurfaceId& a, const SurfaceId& b) {
-  return a.id < b.id;
-}
-
 struct SurfaceIdHash {
-  size_t operator()(const SurfaceId& key) const {
-    return std::hash<uint64_t>()(key.id);
-  }
+  size_t operator()(const SurfaceId& key) const { return key.hash(); }
 };
 
 }  // namespace cc
diff --git a/cc/surfaces/surface_id_allocator.cc b/cc/surfaces/surface_id_allocator.cc
index d7146756..8b169a5 100644
--- a/cc/surfaces/surface_id_allocator.cc
+++ b/cc/surfaces/surface_id_allocator.cc
@@ -6,6 +6,7 @@
 
 #include <stdint.h>
 
+#include "base/rand_util.h"
 #include "cc/surfaces/surface_manager.h"
 
 namespace cc {
@@ -26,14 +27,10 @@
 }
 
 SurfaceId SurfaceIdAllocator::GenerateId() {
-  SurfaceId id(static_cast<uint64_t>(id_namespace_) << 32 | next_id_);
+  uint64_t nonce = base::RandUint64();
+  SurfaceId id(id_namespace_, next_id_, nonce);
   next_id_++;
   return id;
 }
 
-// static
-uint32_t SurfaceIdAllocator::NamespaceForId(SurfaceId id) {
-  return id.id >> 32;
-}
-
 }  // namespace cc
diff --git a/cc/surfaces/surface_id_allocator.h b/cc/surfaces/surface_id_allocator.h
index b0f8bf4..d1e15fbb 100644
--- a/cc/surfaces/surface_id_allocator.h
+++ b/cc/surfaces/surface_id_allocator.h
@@ -25,8 +25,6 @@
 
   SurfaceId GenerateId();
 
-  static uint32_t NamespaceForId(SurfaceId id);
-
   // This needs to be called before any sequences with this allocator's
   // namespace will be used to enforce destruction dependencies.
   // When this SurfaceIdAllocator is destroyed, its namespace is
diff --git a/cc/surfaces/surface_unittest.cc b/cc/surfaces/surface_unittest.cc
index 03ffc3a9..d4ac06e 100644
--- a/cc/surfaces/surface_unittest.cc
+++ b/cc/surfaces/surface_unittest.cc
@@ -35,7 +35,7 @@
   FakeSurfaceFactoryClient surface_factory_client;
   SurfaceFactory factory(&manager, &surface_factory_client);
 
-  SurfaceId surface_id(6);
+  SurfaceId surface_id(0, 6, 0);
   {
     factory.Create(surface_id);
     EXPECT_TRUE(manager.GetSurfaceForId(surface_id));
@@ -54,7 +54,8 @@
     EXPECT_EQ(id1.id_namespace(), id_namespace);
     SurfaceId id2 = allocator.GenerateId();
     EXPECT_EQ(id2.id_namespace(), id_namespace);
-    EXPECT_NE(id1.id, id2.id);
+    EXPECT_NE(id1.local_id(), id2.local_id());
+    EXPECT_NE(id1.nonce(), id2.nonce());
   }
 }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgent.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgent.java
index a95ec53..172cf787 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgent.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgent.java
@@ -11,8 +11,8 @@
 import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.ParcelFileDescriptor;
-import android.preference.PreferenceManager;
 
+import org.chromium.base.ContextUtils;
 import org.chromium.base.Log;
 import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor;
 import org.chromium.chrome.browser.firstrun.FirstRunStatus;
@@ -62,8 +62,7 @@
 
     @Override
     public void onRestoreFinished() {
-        SharedPreferences sharedPrefs =
-                PreferenceManager.getDefaultSharedPreferences(ChromeBackupAgent.this);
+        SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
         Set<String> prefNames = sharedPrefs.getAll().keySet();
         // Save the user name for later restoration.
         String userName = sharedPrefs.getString(ChromeSigninController.SIGNED_IN_ACCOUNT_KEY, null);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index 11f45c3..0dbd443 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -53,6 +53,7 @@
 import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver;
+import org.chromium.chrome.browser.ntp.snippets.SnippetsConfig;
 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
 import org.chromium.chrome.browser.preferences.PrefServiceBridge;
 import org.chromium.chrome.browser.profiles.MostVisitedSites;
@@ -263,7 +264,7 @@
         @Override
         public boolean isToolbarEnabled() {
             return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_TOOLBAR)
-                    && !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS);
+                    && !SnippetsConfig.isEnabled();
         }
 
         @Override
@@ -655,7 +656,7 @@
         mLogoBridge = new LogoBridge(mProfile);
         updateSearchProviderHasLogo();
 
-        if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)) {
+        if (SnippetsConfig.isEnabled()) {
             mSnippetsBridge = new SnippetsBridge(mProfile);
         }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
index 4979f868..95795e3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -12,7 +12,6 @@
 
 import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.chrome.R;
-import org.chromium.chrome.browser.ChromeFeatureList;
 
 /**
  * Layout for the new tab page. This positions the page elements in the correct vertical positions.
@@ -173,8 +172,7 @@
      * material design is enabled.
      */
     private void setSearchBoxStyle() {
-        if ((ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
-                    || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATERIAL_DESIGN))
+        if (NtpColorUtils.shouldUseMaterialColors()
                 && ApiCompatibilityUtils.setElevation(mSearchBoxView,
                            getResources().getDimensionPixelSize(R.dimen.toolbar_elevation))) {
             // Replace drawable with one that does not contain a border.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
index 40a95d1..7edce0ff 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -44,6 +44,7 @@
 import org.chromium.chrome.browser.ntp.LogoBridge.LogoObserver;
 import org.chromium.chrome.browser.ntp.MostVisitedItem.MostVisitedItemManager;
 import org.chromium.chrome.browser.ntp.NewTabPage.OnSearchBoxScrollListener;
+import org.chromium.chrome.browser.ntp.cards.CardsLayoutOperations;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageListItem;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView;
@@ -415,7 +416,8 @@
             });
             initializeSearchBoxRecyclerViewScrollHandling();
             mRecyclerView.addItemDecoration(new SnippetItemDecoration());
-            updateSnippetsHeaderDisplay();
+            CardsLayoutOperations.updateSnippetsHeaderDisplay(mRecyclerView,
+                    mNewTabPageLayout.getPaddingTop());
         } else {
             initializeSearchBoxScrollHandling();
         }
@@ -450,16 +452,6 @@
         return mUseCardsUi ? mRecyclerView : mScrollView;
     }
 
-    private View getFirstViewMatchingViewType(int newTabPageListItemViewType) {
-        int adapterSize = mNewTabPageAdapter.getItemCount();
-        for (int i = 0; i < adapterSize; i++) {
-            if (mNewTabPageAdapter.getItemViewType(i) == newTabPageListItemViewType) {
-                return mRecyclerView.getLayoutManager().findViewByPosition(i);
-            }
-        }
-        return null;
-    }
-
     /**
      * Get the number of listed items (visible or not) for the given type.
      * @param newTabPageListItemViewType the item type to count.
@@ -477,96 +469,6 @@
     }
 
     /**
-     * Change the peeking card's width, padding and children's opacity to give a smooth transition.
-     */
-    private void updatePeekingCard() {
-        // Get the first snippet that could display to make the peeking card transition.
-        ViewGroup firstSnippet =
-                (ViewGroup) getFirstViewMatchingViewType(NewTabPageListItem.VIEW_TYPE_SNIPPET);
-
-        if (firstSnippet == null || !firstSnippet.isShown()) return;
-
-        // If first snippet exists change the peeking card margin and padding to change its
-        // width when scrolling.
-        // Value used for max peeking card height and padding.
-        int maxPadding = getResources().getDimensionPixelSize(
-                R.dimen.snippets_padding_and_peeking_card_height);
-
-        // The peeking card's resting position is |maxPadding| from the bottom of the screen hence
-        // |getHeight() - maxPadding|, and it grows the further it gets from this.
-        int padding = getHeight() - maxPadding - firstSnippet.getTop();
-
-        // Make sure the |padding| is between 0 and |maxPadding|.
-        padding = Math.min(Math.max(padding, 0), maxPadding);
-
-        // Modify the padding so as the margin increases, the padding decreases, keeping the card's
-        // contents in the same position. The top and bottom remain the same.
-        firstSnippet.setPadding(padding, maxPadding, padding, maxPadding);
-
-        RecyclerView.LayoutParams params =
-                (RecyclerView.LayoutParams) firstSnippet.getLayoutParams();
-        params.leftMargin = maxPadding - padding;
-        params.rightMargin = maxPadding - padding;
-
-        // Set the opacity of the card content to be 0 when peeking and 1 when full width.
-        int firstSnippetChildCount = firstSnippet.getChildCount();
-        for (int i = 0; i < firstSnippetChildCount; ++i) {
-            View snippetChild = firstSnippet.getChildAt(i);
-            snippetChild.setAlpha(padding / (float) maxPadding);
-        }
-    }
-
-    /**
-     * Show the snippets header when the user scrolls down and snippet articles starts reaching the
-     * top of the screen.
-     */
-    private void updateSnippetsHeaderDisplay() {
-        // Get the snippet header view.
-        View snippetHeader = getFirstViewMatchingViewType(NewTabPageListItem.VIEW_TYPE_HEADER);
-
-        if (snippetHeader == null || !snippetHeader.isShown()) return;
-
-        // Start doing the calculations if the snippet header is currently shown on screen.
-        RecyclerView.LayoutParams params =
-                (RecyclerView.LayoutParams) snippetHeader.getLayoutParams();
-        float headerAlpha = 0;
-        int headerHeight = 0;
-
-        // Get the max snippet header height.
-        int maxSnippetHeaderHeight =
-                getResources().getDimensionPixelSize(R.dimen.snippets_article_header_height);
-        // Measurement used to multiply the max snippet height to get a range on when to start
-        // modifying the display of article header.
-        final int numberHeaderHeight = 2;
-        // Used to indicate when to start modifying the snippet header.
-        int heightToStartChangingHeader = maxSnippetHeaderHeight * numberHeaderHeight;
-        int snippetHeaderTop = snippetHeader.getTop();
-        int omniBoxHeight = mNewTabPageLayout.getPaddingTop();
-
-        // Check if snippet header top is within range to start showing the snippet header.
-        if (snippetHeaderTop < omniBoxHeight + heightToStartChangingHeader) {
-            // The amount of space the article header has scrolled into the
-            // |heightToStartChangingHeader|.
-            int amountScrolledIntoHeaderSpace =
-                    heightToStartChangingHeader - (snippetHeaderTop - omniBoxHeight);
-
-            // Remove the |numberHeaderHeight| to get the actual header height we want to
-            // display. Never let the height be more than the |maxSnippetHeaderHeight|.
-            headerHeight = Math.min(
-                    amountScrolledIntoHeaderSpace / numberHeaderHeight, maxSnippetHeaderHeight);
-
-            // Get the alpha for the snippet header.
-            headerAlpha = (float) headerHeight / maxSnippetHeaderHeight;
-        }
-        snippetHeader.setAlpha(headerAlpha);
-        params.height = headerHeight;
-        snippetHeader.setLayoutParams(params);
-
-        // Update the space at the bottom, which needs to know about the height of the header.
-        mRecyclerView.refreshBottomSpacing();
-    }
-
-    /**
      * Sets up scrolling when snippets are enabled. It adds scroll listeners and touch listeners to
      * the RecyclerView.
      */
@@ -578,55 +480,10 @@
             @Override
             public void run() {
                 assert mPendingSnapScroll;
-                NewTabPageUma.SnapState currentSnapState = updateSnapScroll();
-                snapStateObserver.updateSnapState(NewTabPageView.this, currentSnapState);
-            }
-
-            private NewTabPageUma.SnapState updateSnapScroll() {
-                // These calculations only work if the first item is visible (since
-                // computeVerticalScrollOffset only takes into account visible items).
-                // Luckily, we only need to perform the calculations if the first item is visible.
-                if (!mRecyclerView.isFirstItemVisible()) {
-                    return NewTabPageUma.SnapState.BELOW_THE_FOLD;
-                }
-
-                final int currentScroll = getVerticalScroll();
-
-                // If snapping to Most Likely or to Articles, the omnibox will be at the top of the
-                // page, so offset the scroll so the scroll targets appear below it.
-                final int omniBoxHeight = mNewTabPageLayout.getPaddingTop();
-                final int topOfMostLikelyScroll = mMostVisitedLayout.getTop() - omniBoxHeight;
-                final int topOfSnippetsScroll = mNewTabPageLayout.getHeight() - omniBoxHeight;
-
-                assert currentScroll >= 0;
-                // Do not do any scrolling if the user is currently viewing articles.
-                if (currentScroll >= topOfSnippetsScroll) {
-                    return NewTabPageUma.SnapState.BELOW_THE_FOLD;
-                }
-
-                // If Most Likely is fully visible when we are scrolled to the top, we have two
-                // snap points: the Top and Articles.
-                // If not, we have three snap points, the Top, Most Likely and Articles.
-                boolean snapToMostLikely =
-                        mRecyclerView.getHeight() < mMostVisitedLayout.getBottom();
-
-                int targetScroll;
-                NewTabPageUma.SnapState snapState = NewTabPageUma.SnapState.ABOVE_THE_FOLD;
-                if (currentScroll < mNewTabPageLayout.getHeight() / 3) {
-                    // In either case, if in the top 1/3 of the original NTP, snap to the top.
-                    targetScroll = 0;
-                } else if (snapToMostLikely
-                        && currentScroll < mNewTabPageLayout.getHeight() * 2 / 3) {
-                    // If in the middle 1/3 and we are snapping to Most Likely, snap to it.
-                    targetScroll = topOfMostLikelyScroll;
-                } else {
-                    // Otherwise, snap to the Articles.
-                    targetScroll = topOfSnippetsScroll;
-                    snapState = NewTabPageUma.SnapState.BELOW_THE_FOLD;
-                }
-                mRecyclerView.smoothScrollBy(0, targetScroll - currentScroll);
                 mPendingSnapScroll = false;
-                return snapState;
+                NewTabPageUma.SnapState currentSnapState = CardsLayoutOperations.snapScroll(
+                        mRecyclerView, mNewTabPageLayout, mMostVisitedLayout, getVerticalScroll());
+                snapStateObserver.updateSnapState(NewTabPageView.this, currentSnapState);
             }
         };
 
@@ -638,8 +495,10 @@
                     mRecyclerView.postDelayed(mSnapScrollRunnable, SNAP_SCROLL_DELAY_MS);
                 }
                 updateSearchBoxOnScroll();
-                updatePeekingCard();
-                updateSnippetsHeaderDisplay();
+                CardsLayoutOperations
+                        .updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
+                CardsLayoutOperations.updateSnippetsHeaderDisplay(mRecyclerView,
+                        mNewTabPageLayout.getPaddingTop());
             }
         });
 
@@ -977,7 +836,7 @@
         updateSearchBoxOnScroll();
 
         if (mUseCardsUi) {
-            updatePeekingCard();
+            CardsLayoutOperations.updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
         }
     }
 
@@ -1241,7 +1100,7 @@
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 
         if (mUseCardsUi) {
-            updatePeekingCard();
+            CardsLayoutOperations.updatePeekingCard(mRecyclerView, mNewTabPageLayout, getHeight());
         }
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
index f963536..d2e7269 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NtpColorUtils.java
@@ -9,13 +9,13 @@
 import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.ChromeFeatureList;
+import org.chromium.chrome.browser.ntp.snippets.SnippetsConfig;
 
 /**
  * Utility class for figuring out which colors to use for the NTP. This class is needed while we
  * transition the NTP to the new material design spec.
  */
-public class NtpColorUtils {
-
+public final class NtpColorUtils {
     private NtpColorUtils() {}
 
     public static int getBackgroundColorResource(Resources res, boolean isIncognito) {
@@ -34,8 +34,8 @@
                 : ApiCompatibilityUtils.getColor(res, R.color.ntp_bg);
     }
 
-    private static boolean shouldUseMaterialColors() {
-        return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
+    public static boolean shouldUseMaterialColors() {
+        return SnippetsConfig.isEnabled()
                 || ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_MATERIAL_DESIGN);
     }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardsLayoutOperations.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardsLayoutOperations.java
new file mode 100644
index 0000000..b088af7
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/CardsLayoutOperations.java
@@ -0,0 +1,211 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.ntp.cards;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ntp.MostVisitedLayout;
+import org.chromium.chrome.browser.ntp.NewTabPageLayout;
+import org.chromium.chrome.browser.ntp.NewTabPageUma;
+import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder;
+import org.chromium.chrome.browser.util.MathUtils;
+
+/**
+ * This is a class to organise the various layout operations of the New Tab Page while using the
+ * cards layout. For example, updating the size of the peeking card or controlling the scroll
+ * behaviour.
+ */
+public class CardsLayoutOperations {
+
+    /**
+     * Change the width, padding and child opacity of the first card (the peeking card) to give a
+     * smooth transition as the user scrolls. The peeking card will scroll to the Articles on touch.
+     * @param recyclerView The NewTabPageRecyclerView that contains the peeking card.
+     * @param ntpLayout The NewTabPageLayout to scroll beyond when the peeking card is tapped.
+     * @param viewportHeight The height of the containing view, to calculate when the transition
+     *          should start.
+     */
+    public static void updatePeekingCard(final NewTabPageRecyclerView recyclerView,
+            final NewTabPageLayout ntpLayout, int viewportHeight) {
+        // Get the first snippet that could display to make the peeking card transition.
+        ViewGroup firstSnippet = (ViewGroup) getFirstViewMatchingViewType(recyclerView,
+                NewTabPageListItem.VIEW_TYPE_SNIPPET);
+
+        if (firstSnippet == null || !firstSnippet.isShown()) return;
+
+        // If first snippet exists change the peeking card margin and padding to change its
+        // width when scrolling.
+        // Value used for max peeking card height and padding.
+        int maxPadding = recyclerView.getResources().getDimensionPixelSize(
+                R.dimen.snippets_padding_and_peeking_card_height);
+
+        // The peeking card's resting position is |maxPadding| from the bottom of the screen hence
+        // |viewportHeight - maxPadding|, and it grows the further it gets from this.
+        // Also, make sure the |padding| is between 0 and |maxPadding|.
+        final int padding =
+                MathUtils.clamp(viewportHeight - maxPadding - firstSnippet.getTop(), 0, maxPadding);
+
+        // Modify the padding so as the margin increases, the padding decreases, keeping the card's
+        // contents in the same position. The top and bottom remain the same.
+        firstSnippet.setPadding(padding, maxPadding, padding, maxPadding);
+
+        RecyclerView.LayoutParams params =
+                (RecyclerView.LayoutParams) firstSnippet.getLayoutParams();
+        params.leftMargin = maxPadding - padding;
+        params.rightMargin = maxPadding - padding;
+
+        // Set the opacity of the card content to be 0 when peeking and 1 when full width.
+        int firstSnippetChildCount = firstSnippet.getChildCount();
+        for (int i = 0; i < firstSnippetChildCount; ++i) {
+            View snippetChild = firstSnippet.getChildAt(i);
+            snippetChild.setAlpha(padding / (float) maxPadding);
+        }
+
+        // If the peeking card is peeking, set its onClick to scroll to the articles section.
+        // If not, reset its onClick to its ViewHolder.
+        if (padding < maxPadding) {
+            firstSnippet.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    // Offset the target scroll by the height of the omnibox (the top padding).
+                    final int targetScroll = ntpLayout.getHeight() - ntpLayout.getPaddingTop();
+                    // If (somehow) the peeking card is tapped while midway through the transition,
+                    // we need to account for how much we have already scrolled.
+                    recyclerView.smoothScrollBy(0, targetScroll - padding);
+                }
+            });
+        } else {
+            SnippetArticleViewHolder vh =
+                    (SnippetArticleViewHolder) recyclerView.findContainingViewHolder(firstSnippet);
+            firstSnippet.setOnClickListener(vh);
+        }
+    }
+
+    /**
+     * Show the snippets header when the user scrolls down and snippet articles starts reaching the
+     * top of the screen.
+     * @param recyclerView The NewTabPageRecyclerView that contains the header card.
+     * @param omniBoxHeight The height of the omnibox displayed over the NTP, we use this to offset
+     *          the start point of the transition.
+     */
+    public static void updateSnippetsHeaderDisplay(NewTabPageRecyclerView recyclerView,
+            int omniBoxHeight) {
+        // Get the snippet header view.
+        View snippetHeader = getFirstViewMatchingViewType(recyclerView,
+                NewTabPageListItem.VIEW_TYPE_HEADER);
+
+        if (snippetHeader == null || !snippetHeader.isShown()) return;
+
+        // Start doing the calculations if the snippet header is currently shown on screen.
+        RecyclerView.LayoutParams params =
+                (RecyclerView.LayoutParams) snippetHeader.getLayoutParams();
+        float headerAlpha = 0;
+        int headerHeight = 0;
+
+        // Get the max snippet header height.
+        int maxSnippetHeaderHeight = recyclerView.getResources()
+                .getDimensionPixelSize(R.dimen.snippets_article_header_height);
+        // Measurement used to multiply the max snippet height to get a range on when to start
+        // modifying the display of article header.
+        final int numberHeaderHeight = 2;
+        // Used to indicate when to start modifying the snippet header.
+        int heightToStartChangingHeader = maxSnippetHeaderHeight * numberHeaderHeight;
+        int snippetHeaderTop = snippetHeader.getTop();
+
+        // Check if snippet header top is within range to start showing the snippet header.
+        if (snippetHeaderTop < omniBoxHeight + heightToStartChangingHeader) {
+            // The amount of space the article header has scrolled into the
+            // |heightToStartChangingHeader|.
+            int amountScrolledIntoHeaderSpace =
+                    heightToStartChangingHeader - (snippetHeaderTop - omniBoxHeight);
+
+            // Remove the |numberHeaderHeight| to get the actual header height we want to
+            // display. Never let the height be more than the |maxSnippetHeaderHeight|.
+            headerHeight = Math.min(
+                    amountScrolledIntoHeaderSpace / numberHeaderHeight, maxSnippetHeaderHeight);
+
+            // Get the alpha for the snippet header.
+            headerAlpha = (float) headerHeight / maxSnippetHeaderHeight;
+        }
+        snippetHeader.setAlpha(headerAlpha);
+        params.height = headerHeight;
+        snippetHeader.setLayoutParams(params);
+
+        // Update the space at the bottom, which needs to know about the height of the header.
+        recyclerView.refreshBottomSpacing();
+    }
+
+    /**
+     * Snaps the scroll point to the top of the screen, the top of most visited or to articles
+     * depending on the current scroll. This function makes gross assumptions about the layout, so
+     * will probably need to be changed if the new tab page changes.
+     * @param recyclerView The NewTabPageRecyclerView containing everything.
+     * @param newTabPageLayout The above the fold content.
+     * @param mostVisitedLayout The view to snap to while snapping to most visited.
+     * @param currentScroll The current scroll.
+     * @return Whether the snap point was above or below the fold.
+     */
+    public static NewTabPageUma.SnapState snapScroll(NewTabPageRecyclerView recyclerView,
+            NewTabPageLayout newTabPageLayout, MostVisitedLayout mostVisitedLayout,
+            int currentScroll) {
+        // These calculations only work if the first item is visible (since
+        // computeVerticalScrollOffset only takes into account visible items).
+        // Luckily, we only need to perform the calculations if the first item is visible.
+        if (!recyclerView.isFirstItemVisible()) {
+            return NewTabPageUma.SnapState.BELOW_THE_FOLD;
+        }
+
+        // If snapping to Most Likely or to Articles, the omnibox will be at the top of the
+        // page, so offset the scroll so the scroll targets appear below it.
+        final int omniBoxHeight = newTabPageLayout.getPaddingTop();
+        final int topOfMostLikelyScroll = mostVisitedLayout.getTop() - omniBoxHeight;
+        final int topOfSnippetsScroll = newTabPageLayout.getHeight() - omniBoxHeight;
+
+        assert currentScroll >= 0;
+        // Do not do any scrolling if the user is currently viewing articles.
+        if (currentScroll >= topOfSnippetsScroll) {
+            return NewTabPageUma.SnapState.BELOW_THE_FOLD;
+        }
+
+        // If Most Likely is fully visible when we are scrolled to the top, we have two
+        // snap points: the Top and Articles.
+        // If not, we have three snap points, the Top, Most Likely and Articles.
+        boolean snapToMostLikely =
+                recyclerView.getHeight() < mostVisitedLayout.getBottom();
+
+        int targetScroll;
+        NewTabPageUma.SnapState snapState = NewTabPageUma.SnapState.ABOVE_THE_FOLD;
+        if (currentScroll < newTabPageLayout.getHeight() / 3) {
+            // In either case, if in the top 1/3 of the original NTP, snap to the top.
+            targetScroll = 0;
+        } else if (snapToMostLikely
+                && currentScroll < newTabPageLayout.getHeight() * 2 / 3) {
+            // If in the middle 1/3 and we are snapping to Most Likely, snap to it.
+            targetScroll = topOfMostLikelyScroll;
+        } else {
+            // Otherwise, snap to the Articles.
+            targetScroll = topOfSnippetsScroll;
+            snapState = NewTabPageUma.SnapState.BELOW_THE_FOLD;
+        }
+        recyclerView.smoothScrollBy(0, targetScroll - currentScroll);
+        return snapState;
+    }
+
+    private static View getFirstViewMatchingViewType(RecyclerView recyclerView,
+            int newTabPageListItemViewType) {
+        int adapterSize = recyclerView.getAdapter().getItemCount();
+        for (int i = 0; i < adapterSize; i++) {
+            if (recyclerView.getAdapter().getItemViewType(i) == newTabPageListItemViewType) {
+                return recyclerView.getLayoutManager().findViewByPosition(i);
+            }
+        }
+        return null;
+    }
+}
+
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
index 317008d7..6887bbd2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
@@ -10,6 +10,7 @@
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.TransitionDrawable;
 import android.media.ThumbnailUtils;
+import android.support.v4.text.BidiFormatter;
 import android.text.format.DateUtils;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -122,9 +123,10 @@
         SnippetArticle item = (SnippetArticle) article;
 
         mHeadlineTextView.setText(item.mTitle);
-        mPublisherTextView.setText(String.format(PUBLISHER_FORMAT_STRING, item.mPublisher,
-                DateUtils.getRelativeTimeSpanString(item.mTimestamp, System.currentTimeMillis(),
-                        DateUtils.MINUTE_IN_MILLIS)));
+        String publisherAttribution = String.format(PUBLISHER_FORMAT_STRING, item.mPublisher,
+                DateUtils.getRelativeTimeSpanString(
+                        item.mTimestamp, System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS));
+        mPublisherTextView.setText(BidiFormatter.getInstance().unicodeWrap(publisherAttribution));
 
         mArticleSnippetTextView.setText(item.mPreviewText);
         mUrl = item.mUrl;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java
new file mode 100644
index 0000000..4397a92c
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java
@@ -0,0 +1,20 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.ntp.snippets;
+
+import org.chromium.chrome.browser.ChromeFeatureList;
+import org.chromium.chrome.browser.preferences.PrefServiceBridge;
+
+/**
+ * Provides configuration details for NTP snippets.
+ */
+public final class SnippetsConfig {
+    private SnippetsConfig() {}
+
+    public static boolean isEnabled() {
+        return ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)
+                && PrefServiceBridge.getInstance().isSearchSuggestEnabled();
+    }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
index cde0999..b8fab1c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
@@ -396,26 +396,25 @@
 
         File path = Environment.getDataDirectory();
         StatFs statFs = new StatFs(path.getAbsolutePath());
-        int size;
+        long size;
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
             size = getSize(statFs);
         } else {
             size = getSizeUpdatedApi(statFs);
         }
         RecordHistogram.recordLinearCountHistogram(
-                "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", size, 1, 200, 100);
+                "GoogleUpdate.InfoBar.InternalStorageSizeAvailable", (int) size, 1, 200, 100);
     }
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
-    private static int getSizeUpdatedApi(StatFs statFs) {
-        return (int) statFs.getAvailableBytes() / (1024 * 1024);
+    private static long getSizeUpdatedApi(StatFs statFs) {
+        return statFs.getAvailableBytes() / (1024 * 1024);
     }
 
     @SuppressWarnings("deprecation")
-    private static int getSize(StatFs statFs) {
+    private static long getSize(StatFs statFs) {
         int blockSize = statFs.getBlockSize();
         int availableBlocks = statFs.getAvailableBlocks();
-        int size = (blockSize * availableBlocks) / (1024 * 1024);
-        return size;
+        return (blockSize * availableBlocks) / (1024 * 1024);
     }
 }
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index 161143d..4a0e4a2 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -504,8 +504,10 @@
   "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetHeaderListItem.java",
   "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java",
   "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java",
+  "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsConfig.java",
   "java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java",
   "java/src/org/chromium/chrome/browser/ntp/cards/AboveTheFoldListItem.java",
+  "java/src/org/chromium/chrome/browser/ntp/cards/CardsLayoutOperations.java",
   "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java",
   "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageListItem.java",
   "java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackupIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackupIntegrationTest.java
index 11b8bfd..d90896a3 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackupIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackupIntegrationTest.java
@@ -9,9 +9,9 @@
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.os.Build;
-import android.preference.PreferenceManager;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import org.chromium.base.ContextUtils;
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.MinAndroidSdkLevel;
 import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor;
@@ -63,7 +63,7 @@
         Context targetContext = getInstrumentation().getTargetContext();
 
         // Fake having previously gone through FRE and signed in.
-        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(targetContext);
+        SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
         SharedPreferences.Editor preferenceEditor = prefs.edit();
         preferenceEditor.putBoolean(FirstRunStatus.FIRST_RUN_FLOW_COMPLETE, true);
         preferenceEditor.putBoolean(FirstRunSignInProcessor.FIRST_RUN_FLOW_SIGNIN_SETUP, true);
@@ -93,7 +93,7 @@
         Context targetContext = getInstrumentation().getTargetContext();
 
         // Fake having previously gone through FRE and signed in.
-        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(targetContext);
+        SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
         SharedPreferences.Editor preferenceEditor = prefs.edit();
         preferenceEditor.putBoolean(FirstRunStatus.FIRST_RUN_FLOW_COMPLETE, true);
         preferenceEditor.putBoolean(FirstRunSignInProcessor.FIRST_RUN_FLOW_SIGNIN_SETUP, true);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
index 20e1cb0..62853b63 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
@@ -9,9 +9,10 @@
 import static org.junit.Assert.assertThat;
 
 import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
 
+import org.chromium.base.ContextUtils;
 import org.chromium.testing.local.LocalRobolectricTestRunner;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -32,10 +33,14 @@
         }
     }
 
+    @Before
+    public void setUp() throws Exception {
+        ContextUtils.initApplicationContextForTests(Robolectric.application);
+    }
+
     @Test
     public void testOnRestoreFinished() {
-        SharedPreferences sharedPrefs =
-                PreferenceManager.getDefaultSharedPreferences(Robolectric.application);
+        SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
         SharedPreferences.Editor editor = sharedPrefs.edit();
         editor.putBoolean("crash_dump_upload", false);
         editor.putString("google.services.username", "user1");
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 5e3c53d..87b2aa1 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -14927,6 +14927,12 @@
     <message name="IDS_FLAGS_FONT_CACHE_SCALING_DESCRIPTION" desc="Description for the flag to enable FontCache scaling">
       Reuse a cached font in the renderer to serve different sizes of font for faster layout.
     </message>
+    <if expr="is_macosx">
+      <message name="IDS_ANNOUNCEMENT_COMPLETION_AVAILABLE_MAC" desc="Text to be
+read aloud to screenreader users to announce that a completion is available.">
+        Completion available: <ph name="COMPLETION_TEXT">$1</ph>
+      </message>
+    </if>
     </messages>
   </release>
 </grit>
diff --git a/chrome/browser/android/offline_pages/prerender_adapter.cc b/chrome/browser/android/offline_pages/prerender_adapter.cc
deleted file mode 100644
index 0313149..0000000
--- a/chrome/browser/android/offline_pages/prerender_adapter.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2016 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/android/offline_pages/prerender_adapter.h"
-
-#include "chrome/browser/prerender/prerender_manager.h"
-#include "chrome/browser/prerender/prerender_manager_factory.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/web_contents.h"
-#include "ui/gfx/geometry/size.h"
-
-namespace offline_pages {
-
-PrerenderAdapter::Observer::Observer() {}
-PrerenderAdapter::Observer::~Observer() {}
-
-PrerenderAdapter::PrerenderAdapter(PrerenderAdapter::Observer* observer)
-    : observer_(observer) {
-  DCHECK(observer);
-}
-
-PrerenderAdapter::~PrerenderAdapter() {
-  if (IsActive())
-    DestroyActive();
-}
-
-bool PrerenderAdapter::CanPrerender() const {
-  return prerender::PrerenderManager::ActuallyPrerendering();
-}
-
-bool PrerenderAdapter::StartPrerender(
-    content::BrowserContext* browser_context,
-    const GURL& url,
-    content::SessionStorageNamespace* session_storage_namespace,
-    const gfx::Size& size) {
-  DCHECK(!IsActive());
-  DCHECK(CanPrerender());
-
-  Profile* profile = Profile::FromBrowserContext(browser_context);
-  prerender::PrerenderManager* manager =
-      prerender::PrerenderManagerFactory::GetForProfile(profile);
-  DCHECK(manager);
-
-  // Start prerendering the url and capture the handle for the prerendering.
-  active_handle_.reset(
-      manager->AddPrerenderForOffline(url, session_storage_namespace, size));
-  if (!active_handle_)
-    return false;
-
-  active_handle_->SetObserver(this);
-  return true;
-}
-
-content::WebContents* PrerenderAdapter::GetWebContents() const {
-  DCHECK(IsActive());
-  DCHECK(active_handle_->contents());
-  // Note: the prerender stack maintains ownership of these contents
-  // and PrerenderingLoader::StopLoading() must be called to report
-  // the Loader is done with the contents.
-  return active_handle_->contents()->prerender_contents();
-}
-
-prerender::FinalStatus PrerenderAdapter::GetFinalStatus() const {
-  DCHECK(IsActive());
-  DCHECK(active_handle_->contents());
-  return active_handle_->contents()->final_status();
-}
-
-bool PrerenderAdapter::IsActive() const {
-  return active_handle_.get();
-}
-
-void PrerenderAdapter::DestroyActive() {
-  DCHECK(IsActive());
-  active_handle_->OnCancel();
-  active_handle_.reset(nullptr);
-}
-
-void PrerenderAdapter::OnPrerenderStart(prerender::PrerenderHandle* handle) {
-  DCHECK(active_handle_.get() == handle);
-  observer_->OnPrerenderStart();
-}
-
-void PrerenderAdapter::OnPrerenderStopLoading(
-    prerender::PrerenderHandle* handle) {
-  DCHECK(active_handle_.get() == handle);
-  observer_->OnPrerenderDomContentLoaded();
-}
-
-void PrerenderAdapter::OnPrerenderDomContentLoaded(
-    prerender::PrerenderHandle* handle) {
-  DCHECK(active_handle_.get() == handle);
-  observer_->OnPrerenderDomContentLoaded();
-}
-
-void PrerenderAdapter::OnPrerenderStop(prerender::PrerenderHandle* handle) {
-  DCHECK(active_handle_.get() == handle);
-  observer_->OnPrerenderStop();
-}
-
-}  // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/prerender_adapter.h b/chrome/browser/android/offline_pages/prerender_adapter.h
deleted file mode 100644
index 1382170..0000000
--- a/chrome/browser/android/offline_pages/prerender_adapter.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2016 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_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_
-#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_
-
-#include <memory>
-
-#include "chrome/browser/prerender/prerender_handle.h"
-
-class GURL;
-
-namespace content {
-class BrowserContext;
-class WebContents;
-class SessionStorageNamespace;
-}  // namespace content
-
-namespace gfx {
-class Size;
-}  // namespace gfx
-
-namespace offline_pages {
-
-// An adapter for managing a prerendering request for offlining. This handles
-// all calls into the prerender stack and tracks the active prerender handle.
-class PrerenderAdapter : public prerender::PrerenderHandle::Observer {
- public:
-  // An observer of PrerenderHandle events that does not expose the handle.
-  class Observer {
-   public:
-    // Signals that the prerender has started running.
-    virtual void OnPrerenderStart() = 0;
-
-    // Signals that the prerender has had its load event.
-    virtual void OnPrerenderStopLoading() = 0;
-
-    // Signals that the prerender has had its 'DOMContentLoaded' event.
-    virtual void OnPrerenderDomContentLoaded() = 0;
-
-    // Signals that the prerender has stopped running and any retrieved
-    // WebContents (via |GetWebContents()|) have become invalidated.
-    virtual void OnPrerenderStop() = 0;
-
-   protected:
-    Observer();
-    virtual ~Observer();
-  };
-
-  explicit PrerenderAdapter(PrerenderAdapter::Observer* observer);
-  ~PrerenderAdapter() override;
-
-  // Returns whether prerendering is enabled and configured.
-  virtual bool CanPrerender() const;
-
-  // Starts prerendering |url| for offlining. There must be no active
-  // prerender request when calling this. Returns whether it was able
-  // to start the prerendering operation.
-  virtual bool StartPrerender(
-      content::BrowserContext* browser_context,
-      const GURL& url,
-      content::SessionStorageNamespace* session_storage_namespace,
-      const gfx::Size& size);
-
-  // Returns a pointer to the prerendered WebContents. This should only be
-  // called once prerendering observer events indicate content is loaded.
-  // It may be used for snapshotting the page. The caller does NOT get
-  // ownership on the contents and must call |DestroyActive()|
-  // to report when it no longer needs the web contents. The caller should
-  // watch for its |PrerenderAdapter::Observer::OnPrerenderStop()| to
-  // learn that the web contents should no longer be used.
-  virtual content::WebContents* GetWebContents() const;
-
-  // Returns the final status of prerendering.
-  virtual prerender::FinalStatus GetFinalStatus() const;
-
-  // Returns whether this adapter has an active prerender request. This
-  // adapter supports one request at a time. DestroyActive() may be used
-  // to clear an active request (which will allow StartPrerender() to be
-  // called to request a new one).
-  virtual bool IsActive() const;
-
-  // Cancels any current prerendering operation and destroys its local handle.
-  virtual void DestroyActive();
-
-  // PrerenderHandle::Observer interface:
-  void OnPrerenderStart(prerender::PrerenderHandle* handle) override;
-  void OnPrerenderStopLoading(prerender::PrerenderHandle* handle) override;
-  void OnPrerenderDomContentLoaded(prerender::PrerenderHandle* handle) override;
-  void OnPrerenderStop(prerender::PrerenderHandle* handle) override;
-
- private:
-  // At most one prerender request may be active for this adapter and this
-  // holds its handle if one is active.
-  std::unique_ptr<prerender::PrerenderHandle> active_handle_;
-
-  // Observer of active handle events. Not owned.
-  PrerenderAdapter::Observer* observer_;
-
-  DISALLOW_COPY_AND_ASSIGN(PrerenderAdapter);
-};
-
-}  // namespace offline_pages
-
-#endif  // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.cc b/chrome/browser/android/offline_pages/prerendering_loader.cc
index 7ae17b3..08576826 100644
--- a/chrome/browser/android/offline_pages/prerendering_loader.cc
+++ b/chrome/browser/android/offline_pages/prerendering_loader.cc
@@ -4,167 +4,26 @@
 
 #include "chrome/browser/android/offline_pages/prerendering_loader.h"
 
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/profiles/profile.h"
 #include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_thread.h"
 #include "content/public/browser/web_contents.h"
 #include "ui/gfx/geometry/size.h"
 
 namespace offline_pages {
 
-PrerenderingLoader::PrerenderingLoader(content::BrowserContext* browser_context)
-    : state_(State::IDLE), browser_context_(browser_context) {
-  adapter_.reset(new PrerenderAdapter(this));
-}
+PrerenderingLoader::PrerenderingLoader(
+    content::BrowserContext* browser_context) {}
 
-PrerenderingLoader::~PrerenderingLoader() {
-  CancelPrerender();
-}
+PrerenderingLoader::~PrerenderingLoader() {}
 
-bool PrerenderingLoader::LoadPage(const GURL& url,
-                                  const LoadPageCallback& callback) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  if (!IsIdle()) {
-    DVLOG(1)
-        << "WARNING: Existing request in progress or waiting for StopLoading()";
-    return false;
-  }
-  if (!CanPrerender())
-    return false;
-
-  // Create a WebContents instance to define and hold a SessionStorageNamespace
-  // for this load request.
-  DCHECK(!session_contents_.get());
-  session_contents_.reset(content::WebContents::Create(
-      content::WebContents::CreateParams(browser_context_)));
-  content::SessionStorageNamespace* sessionStorageNamespace =
-      session_contents_->GetController().GetDefaultSessionStorageNamespace();
-  gfx::Size renderWindowSize = session_contents_->GetContainerBounds().size();
-  bool accepted = adapter_->StartPrerender(
-      browser_context_, url, sessionStorageNamespace, renderWindowSize);
-  if (!accepted)
-    return false;
-
-  DCHECK(adapter_->IsActive());
-  callback_ = callback;
-  state_ = State::PENDING;
-  return true;
+bool PrerenderingLoader::LoadPage(
+    const GURL& url,
+    const LoadPageCallback& callback) {
+  // TODO(dougarnett): implement.
+  return false;
 }
 
 void PrerenderingLoader::StopLoading() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  CancelPrerender();
-}
-
-bool PrerenderingLoader::CanPrerender() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  return adapter_->CanPrerender();
-}
-
-bool PrerenderingLoader::IsIdle() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  return state_ == State::IDLE;
-}
-
-bool PrerenderingLoader::IsLoaded() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  return state_ == State::LOADED;
-}
-
-void PrerenderingLoader::SetAdapterForTesting(
-    std::unique_ptr<PrerenderAdapter> prerender_adapter) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  adapter_ = std::move(prerender_adapter);
-}
-
-void PrerenderingLoader::OnPrerenderStart() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  DCHECK(state_ == State::PENDING);
-  state_ = State::LOADING;
-}
-
-void PrerenderingLoader::OnPrerenderStopLoading() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  // TODO(dougarnett): Implement/integrate to delay policy here.
-  HandleLoadEvent();
-}
-
-void PrerenderingLoader::OnPrerenderDomContentLoaded() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  // TODO(dougarnett): Implement/integrate to delay policy here.
-  HandleLoadEvent();
-}
-
-void PrerenderingLoader::OnPrerenderStop() {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  HandleLoadingStopped();
-}
-
-void PrerenderingLoader::HandleLoadEvent() {
-  // If still loading, check if the load succeeded or not, then update
-  // the internal state (LOADED for success or IDLE for failure) and post
-  // callback.
-  // Note: it is possible to receive a load event (e.g., if timeout-based)
-  // after the request has completed via another path (e.g., canceled) so
-  // the Loader may be idle at this point.
-
-  if (IsIdle() || IsLoaded())
-    return;
-
-  content::WebContents* web_contents = adapter_->GetWebContents();
-  if (web_contents) {
-    state_ = State::LOADED;
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::Bind(callback_, Offliner::RequestStatus::LOADED, web_contents));
-  } else {
-    // No WebContents means that the load failed (and it stopped).
-    HandleLoadingStopped();
-  }
-}
-
-void PrerenderingLoader::HandleLoadingStopped() {
-  // Loading has stopped so unless the Loader has already transistioned to the
-  // idle state, clean up the previous request state, transition to the idle
-  // state, and post callback.
-  // Note: it is possible to receive some asynchronous stopped indication after
-  // the request has completed/stopped via another path so the Loader may be
-  // idle at this point.
-
-  if (IsIdle())
-    return;
-
-  if (adapter_->IsActive()) {
-    DVLOG(1) << "Load failed: " << adapter_->GetFinalStatus();
-    adapter_->DestroyActive();
-  }
-  // Request status depends on whether we are still loading (failed) or
-  // did load and then loading was stopped (cancel - from prerender stack).
-  Offliner::RequestStatus request_status =
-      IsLoaded() ? Offliner::RequestStatus::CANCELED
-                 : Offliner::RequestStatus::FAILED;
-  // TODO(dougarnett): For failure, determine from final status if retry-able
-  // and report different failure statuses if retry-able or not.
-  session_contents_.reset(nullptr);
-  state_ = State::IDLE;
-  base::ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, base::Bind(callback_, request_status, nullptr));
-}
-
-void PrerenderingLoader::CancelPrerender() {
-  if (adapter_->IsActive()) {
-    adapter_->DestroyActive();
-  }
-  session_contents_.reset(nullptr);
-  if (!IsLoaded() && !IsIdle()) {
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::Bind(callback_, Offliner::RequestStatus::CANCELED, nullptr));
-  }
-  state_ = State::IDLE;
+  // TODO(dougarnett): implement.
 }
 
 }  // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/prerendering_loader.h b/chrome/browser/android/offline_pages/prerendering_loader.h
index 22659e9..f4af6a2 100644
--- a/chrome/browser/android/offline_pages/prerendering_loader.h
+++ b/chrome/browser/android/offline_pages/prerendering_loader.h
@@ -5,10 +5,7 @@
 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
 
-#include <memory>
-
 #include "base/callback.h"
-#include "chrome/browser/android/offline_pages/prerender_adapter.h"
 #include "components/offline_pages/background/offliner.h"
 
 class GURL;
@@ -26,99 +23,29 @@
 namespace offline_pages {
 
 // A client-side page loader that integrates with the PrerenderManager to do
-// the page loading in the background. It operates on a single thread and
-// needs to run on BrowserThread::UI to work with the PrerenderManager.
-// It supports a single load request at a time.
-class PrerenderingLoader : public PrerenderAdapter::Observer {
+// the page loading in the background.
+class PrerenderingLoader {
  public:
   // Reports status of a load page request with loaded contents if available.
-  typedef base::Callback<void(Offliner::RequestStatus, content::WebContents*)>
+  typedef base::Callback<void(Offliner::CompletionStatus,
+                              content::WebContents*)>
       LoadPageCallback;
 
   explicit PrerenderingLoader(content::BrowserContext* browser_context);
-  ~PrerenderingLoader() override;
+  virtual ~PrerenderingLoader();
 
   // Loads a page in the background if possible and returns whether the
   // request was accepted. If so, the LoadPageCallback will be informed
   // of status. Only one load request may exist as a time. If a previous
-  // request is still in progress it must be stopped before a new
-  // request will be accepted. The callback may be called more than
-  // once - first for a successful load and then if canceled after the
-  // load (which may be from resources being reclaimed) at which point
-  // the retrieved WebContents should no longer be used.
+  // request is still in progress it must be canceled before a new
+  // request will be accepted.
   virtual bool LoadPage(const GURL& url, const LoadPageCallback& callback);
 
   // Stops (completes or cancels) the load request. Must be called when
-  // LoadPageCallback is done with consuming the contents. May be called
-  // prior to LoadPageCallback in order to cancel the current request (in
-  // which case the callback will not be run).
+  // LoadPageCallback is done with consuming the contents.
   // This loader should also be responsible for stopping offline
   // prerenders when Chrome is transitioned to foreground.
   virtual void StopLoading();
-
-  // Returns whether prerendering is possible for this device's configuration
-  // and the browser context.
-  virtual bool CanPrerender();
-
-  // Returns whether the loader is idle and able to accept new LoadPage
-  // request.
-  virtual bool IsIdle();
-
-  // Returns whether the loader has successfully loaded web contents.
-  // Note that |StopLoading()| should be used to clear this state once
-  // the loaded web contents are no longer needed.
-  virtual bool IsLoaded();
-
-  // Overrides the prerender stack adapter for unit testing.
-  void SetAdapterForTesting(
-      std::unique_ptr<PrerenderAdapter> prerender_adapter);
-
-  // PrerenderAdapter::Observer implementation:
-  void OnPrerenderStart() override;
-  void OnPrerenderStopLoading() override;
-  void OnPrerenderDomContentLoaded() override;
-  void OnPrerenderStop() override;
-
- private:
-  // State of the loader (only one request may be active at a time).
-  enum class State {
-    IDLE,     // No active load request.
-    PENDING,  // Load request is pending the start of prerendering.
-    LOADING,  // Loading in progress.
-    LOADED,   // Loaded and now waiting for requestor to StopLoading().
-  };
-
-  // Handles some event/signal that the load request has succeeded or failed.
-  // It may be due to some asynchronous trigger that occurs after the request
-  // has completed for some other reason/event.
-  void HandleLoadEvent();
-
-  // Handles some event/signal that loading has stopped (whether due to a
-  // failure, cancel, or stop request). It may be due to some asynchronous
-  // trigger that occurs after the request has stopped for some other reason.
-  void HandleLoadingStopped();
-
-  // Cancels any current prerender and moves loader to idle state.
-  void CancelPrerender();
-
-  // Tracks loading state including whether the Loader is idle.
-  State state_;
-
-  // Not owned.
-  content::BrowserContext* browser_context_;
-
-  // Adapter for handling calls to the prerender stack.
-  std::unique_ptr<PrerenderAdapter> adapter_;
-
-  // A WebContents for the active load request that is used to hold the session
-  // storage namespace for rendering. This will NOT have the loaded page.
-  std::unique_ptr<content::WebContents> session_contents_;
-
-  // Callback to call when the active load request completes, fails, or is
-  // canceled.
-  LoadPageCallback callback_;
-
-  DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader);
 };
 
 }  // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/prerendering_loader_unittest.cc b/chrome/browser/android/offline_pages/prerendering_loader_unittest.cc
deleted file mode 100644
index 68e1b07..0000000
--- a/chrome/browser/android/offline_pages/prerendering_loader_unittest.cc
+++ /dev/null
@@ -1,288 +0,0 @@
-// Copyright 2016 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/android/offline_pages/prerendering_loader.h"
-
-#include "base/bind.h"
-#include "base/memory/ptr_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/run_loop.h"
-#include "chrome/test/base/testing_profile.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "content/public/test/web_contents_tester.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace offline_pages {
-
-namespace {
-
-// Adapter that intercepts prerender stack calls for testing.
-class TestAdapter : public PrerenderAdapter {
- public:
-  explicit TestAdapter(PrerenderAdapter::Observer* observer)
-      : PrerenderAdapter(observer), observer_(observer) {}
-  ~TestAdapter() override {}
-
-  // PrerenderAdapter implementation.
-  bool CanPrerender() const override;
-  bool StartPrerender(
-      content::BrowserContext* browser_context,
-      const GURL& url,
-      content::SessionStorageNamespace* session_storage_namespace,
-      const gfx::Size& size) override;
-  content::WebContents* GetWebContents() const override;
-  prerender::FinalStatus GetFinalStatus() const override;
-  bool IsActive() const override;
-  void DestroyActive() override;
-
-  // Sets prerendering to be disabled. This will cause the CanPrerender()
-  // to return false.
-  void Disable();
-
-  // Configures mocked prerendering details.
-  void Configure(content::WebContents* web_contents,
-                 prerender::FinalStatus final_status);
-
-  // Returns the observer for test access.
-  PrerenderAdapter::Observer* GetObserver() const { return observer_; }
-
- private:
-  bool active_;
-  bool disabled_;
-  PrerenderAdapter::Observer* observer_;
-  content::WebContents* web_contents_;
-  prerender::FinalStatus final_status_;
-
-  DISALLOW_COPY_AND_ASSIGN(TestAdapter);
-};
-
-void TestAdapter::Disable() {
-  disabled_ = true;
-}
-
-void TestAdapter::Configure(content::WebContents* web_contents,
-                            prerender::FinalStatus final_status) {
-  web_contents_ = web_contents;
-  final_status_ = final_status;
-}
-
-bool TestAdapter::CanPrerender() const {
-  return !disabled_;
-}
-
-bool TestAdapter::StartPrerender(
-    content::BrowserContext* browser_context,
-    const GURL& url,
-    content::SessionStorageNamespace* session_storage_namespace,
-    const gfx::Size& size) {
-  active_ = true;
-  return true;
-}
-
-content::WebContents* TestAdapter::GetWebContents() const {
-  return web_contents_;
-}
-
-prerender::FinalStatus TestAdapter::GetFinalStatus() const {
-  return final_status_;
-}
-
-bool TestAdapter::IsActive() const {
-  return active_;
-}
-
-void TestAdapter::DestroyActive() {
-  active_ = false;
-}
-
-void PumpLoop() {
-  base::RunLoop().RunUntilIdle();
-}
-
-}  // namespace
-
-// Test class.
-class PrerenderingLoaderTest : public testing::Test {
- public:
-  PrerenderingLoaderTest();
-  ~PrerenderingLoaderTest() override {}
-
-  void SetUp() override;
-
-  // Returns the PrerenderLoader to test.
-  PrerenderingLoader* loader() const { return loader_.get(); }
-  // Returns the TestAdapter to allow test behavior configuration.
-  TestAdapter* test_adapter() const { return test_adapter_; }
-  bool callback_called() { return callback_called_; }
-  Offliner::RequestStatus callback_load_status() {
-    return callback_load_status_;
-  }
-  Profile* profile() { return &profile_; }
-  void OnLoadDone(Offliner::RequestStatus load_status,
-                  content::WebContents* web_contents);
-
- private:
-  content::TestBrowserThreadBundle thread_bundle_;
-  TestingProfile profile_;
-  TestAdapter* test_adapter_;
-  std::unique_ptr<PrerenderingLoader> loader_;
-  bool callback_called_;
-  Offliner::RequestStatus callback_load_status_;
-
-  DISALLOW_COPY_AND_ASSIGN(PrerenderingLoaderTest);
-};
-
-PrerenderingLoaderTest::PrerenderingLoaderTest()
-    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
-      callback_load_status_(Offliner::RequestStatus::UNKNOWN) {}
-
-void PrerenderingLoaderTest::SetUp() {
-  loader_.reset(new PrerenderingLoader(&profile_));
-  test_adapter_ = new TestAdapter(loader_.get());
-  loader_->SetAdapterForTesting(base::WrapUnique(test_adapter_));
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-}
-
-void PrerenderingLoaderTest::OnLoadDone(Offliner::RequestStatus load_status,
-                                        content::WebContents* web_contents) {
-  callback_called_ = true;
-  callback_load_status_ = load_status;
-}
-
-TEST_F(PrerenderingLoaderTest, CanPrerender) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  EXPECT_TRUE(loader()->CanPrerender());
-
-  test_adapter()->Disable();
-  EXPECT_FALSE(loader()->CanPrerender());
-}
-
-TEST_F(PrerenderingLoaderTest, StopLoadingWhenIdle) {
-  EXPECT_TRUE(loader()->IsIdle());
-  loader()->StopLoading();
-  EXPECT_TRUE(loader()->IsIdle());
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageLoadSucceededFromDomContentLoaded) {
-  test_adapter()->Configure(
-      content::WebContentsTester::CreateTestWebContents(profile(), NULL),
-      prerender::FinalStatus::FINAL_STATUS_USED);
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-  EXPECT_TRUE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-
-  test_adapter()->GetObserver()->OnPrerenderDomContentLoaded();
-  PumpLoop();
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_TRUE(loader()->IsLoaded());
-  EXPECT_TRUE(callback_called());
-  EXPECT_EQ(Offliner::RequestStatus::LOADED, callback_load_status());
-
-  loader()->StopLoading();
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageLoadSucceededFromPrerenderStopLoading) {
-  test_adapter()->Configure(
-      content::WebContentsTester::CreateTestWebContents(profile(), NULL),
-      prerender::FinalStatus::FINAL_STATUS_USED);
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-  EXPECT_TRUE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-
-  test_adapter()->GetObserver()->OnPrerenderStart();
-  PumpLoop();
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-
-  test_adapter()->GetObserver()->OnPrerenderStopLoading();
-  PumpLoop();
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_TRUE(loader()->IsLoaded());
-  EXPECT_TRUE(callback_called());
-  EXPECT_EQ(Offliner::RequestStatus::LOADED, callback_load_status());
-
-  // Consider Prerenderer stops (eg, times out) before Loader is done with it.
-  test_adapter()->GetObserver()->OnPrerenderStop();
-  PumpLoop();
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-  EXPECT_EQ(Offliner::RequestStatus::CANCELED, callback_load_status());
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageLoadFailedNoContent) {
-  test_adapter()->Configure(
-      nullptr /* web_contents */,
-      prerender::FinalStatus::FINAL_STATUS_MEMORY_LIMIT_EXCEEDED);
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_TRUE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-
-  test_adapter()->GetObserver()->OnPrerenderDomContentLoaded();
-  PumpLoop();
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_TRUE(callback_called());
-  // We did not provide any WebContents for the callback so expect did not load.
-  EXPECT_EQ(Offliner::RequestStatus::FAILED, callback_load_status());
-
-  // Stopped event causes no harm.
-  test_adapter()->GetObserver()->OnPrerenderStop();
-  PumpLoop();
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageLoadCanceledFromStopLoading) {
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_TRUE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-
-  loader()->StopLoading();
-  PumpLoop();
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_TRUE(callback_called());
-  EXPECT_EQ(Offliner::RequestStatus::CANCELED, callback_load_status());
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageNotAcceptedWhenNotIdle) {
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_TRUE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-  EXPECT_FALSE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->IsLoaded());
-
-  // Now try another load while first is still active.
-  EXPECT_FALSE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-  EXPECT_FALSE(loader()->IsIdle());
-}
-
-TEST_F(PrerenderingLoaderTest, LoadPageNotAcceptedWhenPrerenderingDisabled) {
-  test_adapter()->Disable();
-  GURL gurl("http://testit.sea");
-  EXPECT_TRUE(loader()->IsIdle());
-  EXPECT_FALSE(loader()->LoadPage(
-      gurl,
-      base::Bind(&PrerenderingLoaderTest::OnLoadDone, base::Unretained(this))));
-  EXPECT_TRUE(loader()->IsIdle());
-}
-
-}  // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner.cc b/chrome/browser/android/offline_pages/prerendering_offliner.cc
index b654c75a6..c38afcb7 100644
--- a/chrome/browser/android/offline_pages/prerendering_offliner.cc
+++ b/chrome/browser/android/offline_pages/prerendering_offliner.cc
@@ -20,8 +20,9 @@
 
 PrerenderingOffliner::~PrerenderingOffliner() {}
 
-void PrerenderingOffliner::OnLoadPageDone(Offliner::RequestStatus load_status,
-                                          content::WebContents* contents) {
+void PrerenderingOffliner::OnLoadPageDone(
+    const Offliner::CompletionStatus load_status,
+    content::WebContents* contents) {
   // TODO(dougarnett): Implement save attempt and running CompletionCallback.
 }
 
@@ -40,12 +41,6 @@
   GetOrCreateLoader()->StopLoading();
 }
 
-void PrerenderingOffliner::SetLoaderForTesting(
-    std::unique_ptr<PrerenderingLoader> loader) {
-  DCHECK(!loader_);
-  loader_ = std::move(loader);
-}
-
 PrerenderingLoader* PrerenderingOffliner::GetOrCreateLoader() {
   if (!loader_) {
     loader_.reset(new PrerenderingLoader(browser_context_));
@@ -53,4 +48,10 @@
   return loader_.get();
 }
 
+void PrerenderingOffliner::SetLoaderForTesting(
+    std::unique_ptr<PrerenderingLoader> loader) {
+  DCHECK(!loader_);
+  loader_ = std::move(loader);
+}
+
 }  // namespace offline_pages
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner.h b/chrome/browser/android/offline_pages/prerendering_offliner.h
index 4b970c4..9a3f340 100644
--- a/chrome/browser/android/offline_pages/prerendering_offliner.h
+++ b/chrome/browser/android/offline_pages/prerendering_offliner.h
@@ -41,7 +41,7 @@
   void SetLoaderForTesting(std::unique_ptr<PrerenderingLoader> loader);
 
  private:
-  void OnLoadPageDone(const Offliner::RequestStatus load_status,
+  void OnLoadPageDone(const Offliner::CompletionStatus load_status,
                       content::WebContents* contents);
 
   PrerenderingLoader* GetOrCreateLoader();
diff --git a/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc b/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc
index 71f66b6..f13a1237 100644
--- a/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc
+++ b/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc
@@ -10,7 +10,6 @@
 #include "chrome/browser/android/offline_pages/prerendering_loader.h"
 #include "components/offline_pages/background/offliner.h"
 #include "components/offline_pages/background/save_page_request.h"
-#include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace offline_pages {
@@ -25,9 +24,7 @@
 class MockPrerenderingLoader : public PrerenderingLoader {
  public:
   explicit MockPrerenderingLoader(content::BrowserContext* browser_context)
-      : PrerenderingLoader(browser_context),
-        mock_loading_(false),
-        mock_loaded_(false) {}
+      : PrerenderingLoader(browser_context), mock_loading_(false) {}
   ~MockPrerenderingLoader() override {}
 
   bool LoadPage(const GURL& url, const LoadPageCallback& callback) override {
@@ -35,18 +32,12 @@
     return mock_loading_;
   }
 
-  void StopLoading() override {
-    mock_loading_ = false;
-    mock_loaded_ = false;
-  }
-  bool IsIdle() override { return !mock_loading_ && !mock_loaded_; }
-  bool IsLoaded() override { return mock_loaded_; }
+  void StopLoading() override { mock_loading_ = false; }
 
   bool mock_loading() const { return mock_loading_; }
 
  private:
   bool mock_loading_;
-  bool mock_loaded_;
 
   DISALLOW_COPY_AND_ASSIGN(MockPrerenderingLoader);
 };
@@ -67,23 +58,23 @@
   }
 
   bool loading() const { return loader_->mock_loading(); }
-  Offliner::RequestStatus completion_status() { return completion_status_; }
+  Offliner::CompletionStatus completion_status() {
+    return completion_status_;
+  }
 
  private:
   void OnCompletion(const SavePageRequest& request,
-                    Offliner::RequestStatus status);
+                    Offliner::CompletionStatus status);
 
-  content::TestBrowserThreadBundle thread_bundle_;
   std::unique_ptr<PrerenderingOffliner> offliner_;
   // Not owned.
   MockPrerenderingLoader* loader_;
-  Offliner::RequestStatus completion_status_;
+  Offliner::CompletionStatus completion_status_;
 
   DISALLOW_COPY_AND_ASSIGN(PrerenderingOfflinerTest);
 };
 
-PrerenderingOfflinerTest::PrerenderingOfflinerTest()
-    : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
+PrerenderingOfflinerTest::PrerenderingOfflinerTest() {}
 
 PrerenderingOfflinerTest::~PrerenderingOfflinerTest() {}
 
@@ -96,7 +87,7 @@
 }
 
 void PrerenderingOfflinerTest::OnCompletion(const SavePageRequest& request,
-                                            Offliner::RequestStatus status) {
+                                            Offliner::CompletionStatus status) {
   completion_status_ = status;
 }
 
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
index aa00284..7d387cd5 100644
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -38,9 +38,11 @@
 #include "chrome/browser/sync/profile_sync_service_factory.h"
 #include "chrome/browser/translate/chrome_translate_client.h"
 #include "chrome/browser/ui/android/android_about_app_info.h"
+#include "chrome/common/channel_info.h"
 #include "chrome/common/chrome_features.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/grit/locale_settings.h"
+#include "components/browser_sync/browser/profile_sync_service.h"
 #include "components/browsing_data_ui/history_notice_utils.h"
 #include "components/content_settings/core/browser/host_content_settings_map.h"
 #include "components/content_settings/core/common/content_settings.h"
@@ -704,6 +706,7 @@
   browsing_data_ui::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
       ProfileSyncServiceFactory::GetForProfile(GetOriginalProfile()),
       WebHistoryServiceFactory::GetForProfile(GetOriginalProfile()),
+      chrome::GetChannel(),
       base::Bind(&EnableDialogAboutOtherFormsOfBrowsingHistory,
                  base::Owned(new ScopedJavaGlobalRef<jobject>(env, listener))));
 }
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 2a24e8a..ae80690 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -989,7 +989,7 @@
       data_reduction_proxy_settings));
   host->AddFilter(new startup_metric_utils::StartupMetricMessageFilter());
 
-  host->Send(new ChromeViewMsg_SetIsIncognitoProcess(
+  host->GetImmediateSender()->Send(new ChromeViewMsg_SetIsIncognitoProcess(
       profile->IsOffTheRecord()));
 
   for (size_t i = 0; i < extra_parts_.size(); ++i)
@@ -1006,7 +1006,8 @@
     GetRendererContentSettingRules(
         HostContentSettingsMapFactory::GetForProfile(profile), &rules);
   }
-  host->Send(new ChromeViewMsg_SetContentSettingRules(rules));
+  host->GetImmediateSender()->Send(
+      new ChromeViewMsg_SetContentSettingRules(rules));
 }
 
 GURL ChromeContentBrowserClient::GetEffectiveURL(
diff --git a/chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc b/chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc
new file mode 100644
index 0000000..e921a4c
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc
@@ -0,0 +1,234 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/arc/arc_downloads_watcher_service.h"
+
+#include <memory>
+#include <utility>
+
+#include "base/callback.h"
+#include "base/files/file_enumerator.h"
+#include "base/files/file_path.h"
+#include "base/files/file_path_watcher.h"
+#include "base/memory/ptr_util.h"
+#include "base/time/time.h"
+#include "chrome/browser/download/download_prefs.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/common/chrome_paths.h"
+#include "components/arc/arc_bridge_service.h"
+#include "content/public/browser/browser_thread.h"
+#include "mojo/public/cpp/bindings/array.h"
+
+using content::BrowserThread;
+
+// Mapping from Android file paths to last modified timestamps.
+using TimestampMap = std::map<base::FilePath, base::Time>;
+
+static const base::FilePath::CharType kAndroidDownloadDir[] =
+    FILE_PATH_LITERAL("/storage/emulated/0/Download");
+
+namespace arc {
+
+namespace {
+
+// Compares two TimestampMaps and returns the list of file paths added/removed
+// or whose timestamp have changed.
+std::vector<base::FilePath> CollectChangedPaths(
+    const TimestampMap& timestamp_map_a,
+    const TimestampMap& timestamp_map_b) {
+  std::vector<base::FilePath> changed_paths;
+
+  TimestampMap::const_iterator iter_a = timestamp_map_a.begin();
+  TimestampMap::const_iterator iter_b = timestamp_map_b.begin();
+  while (iter_a != timestamp_map_a.end() && iter_b != timestamp_map_b.end()) {
+    if (iter_a->first == iter_b->first) {
+      if (iter_a->second != iter_b->second) {
+        changed_paths.emplace_back(iter_a->first);
+      }
+      ++iter_a;
+      ++iter_b;
+    } else if (iter_a->first < iter_b->first) {
+      changed_paths.emplace_back(iter_a->first);
+      ++iter_a;
+    } else {  // iter_a->first > iter_b->first
+      changed_paths.emplace_back(iter_b->first);
+      ++iter_b;
+    }
+  }
+
+  while (iter_a != timestamp_map_a.end()) {
+    changed_paths.emplace_back(iter_a->first);
+    ++iter_a;
+  }
+  while (iter_b != timestamp_map_b.end()) {
+    changed_paths.emplace_back(iter_b->first);
+    ++iter_b;
+  }
+
+  return changed_paths;
+}
+
+}  // namespace
+
+// The core part of ArcDownloadsWatcherService to watch for file changes in
+// Downloads directory.
+class ArcDownloadsWatcherService::DownloadsWatcher {
+ public:
+  using Callback =
+      base::Callback<void(const std::vector<base::FilePath>& paths)>;
+
+  explicit DownloadsWatcher(const Callback& callback);
+  ~DownloadsWatcher();
+
+  // Starts watching Downloads directory.
+  void Start();
+
+ private:
+  // Called by base::FilePathWatcher to notify file changes.
+  void OnFilePathChanged(const base::FilePath& path, bool error);
+
+  // Scans files under |downloads_dir_| recursively and builds a map from file
+  // paths (in Android filesystem) to last modified timestamps.
+  TimestampMap BuildTimestampMap() const;
+
+  Callback callback_;
+  base::FilePath downloads_dir_;
+  std::unique_ptr<base::FilePathWatcher> watcher_;
+  TimestampMap last_timestamp_map_;
+
+  // Note: This should remain the last member so it'll be destroyed and
+  // invalidate the weak pointers before any other members are destroyed.
+  base::WeakPtrFactory<DownloadsWatcher> weak_ptr_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(DownloadsWatcher);
+};
+
+ArcDownloadsWatcherService::DownloadsWatcher::DownloadsWatcher(
+    const Callback& callback)
+    : callback_(callback), weak_ptr_factory_(this) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+  downloads_dir_ = DownloadPrefs(ProfileManager::GetActiveUserProfile())
+                       .GetDefaultDownloadDirectoryForProfile()
+                       .StripTrailingSeparators();
+}
+
+ArcDownloadsWatcherService::DownloadsWatcher::~DownloadsWatcher() {
+  DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+}
+
+void ArcDownloadsWatcherService::DownloadsWatcher::Start() {
+  DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+
+  // Initialize with the current timestamp map and avoid initial notification.
+  // It is not needed since MediaProvider scans whole storage area on boot.
+  last_timestamp_map_ = BuildTimestampMap();
+
+  watcher_ = base::MakeUnique<base::FilePathWatcher>();
+  // On Linux, base::FilePathWatcher::Watch() always returns true.
+  watcher_->Watch(downloads_dir_, true,
+                  base::Bind(&DownloadsWatcher::OnFilePathChanged,
+                             weak_ptr_factory_.GetWeakPtr()));
+}
+
+void ArcDownloadsWatcherService::DownloadsWatcher::OnFilePathChanged(
+    const base::FilePath& path,
+    bool error) {
+  // On Linux, |error| is always false. Also, |path| is always the same path
+  // as one given to FilePathWatcher::Watch().
+  DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+
+  TimestampMap current_timestamp_map = BuildTimestampMap();
+
+  std::vector<base::FilePath> changed_paths =
+      CollectChangedPaths(last_timestamp_map_, current_timestamp_map);
+
+  last_timestamp_map_ = std::move(current_timestamp_map);
+
+  callback_.Run(changed_paths);
+}
+
+TimestampMap ArcDownloadsWatcherService::DownloadsWatcher::BuildTimestampMap()
+    const {
+  DCHECK(!downloads_dir_.EndsWithSeparator());
+  TimestampMap timestamp_map;
+
+  // Enumerate normal files only; directories and symlinks are skipped.
+  base::FileEnumerator enumerator(downloads_dir_, true,
+                                  base::FileEnumerator::FILES);
+  for (base::FilePath cros_path = enumerator.Next(); !cros_path.empty();
+       cros_path = enumerator.Next()) {
+    // Android file path can be obtained by replacing |downloads_dir_| prefix
+    // with |kAndroidDownloadDir|.
+    const base::FilePath& android_path =
+        base::FilePath(kAndroidDownloadDir)
+            .Append(
+                cros_path.value().substr(downloads_dir_.value().length() + 1));
+    const base::FileEnumerator::FileInfo& info = enumerator.GetInfo();
+    timestamp_map[android_path] = info.GetLastModifiedTime();
+  }
+  return timestamp_map;
+}
+
+ArcDownloadsWatcherService::ArcDownloadsWatcherService(
+    ArcBridgeService* bridge_service)
+    : ArcService(bridge_service), weak_ptr_factory_(this) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  arc_bridge_service()->AddObserver(this);
+}
+
+ArcDownloadsWatcherService::~ArcDownloadsWatcherService() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  arc_bridge_service()->RemoveObserver(this);
+  StopWatchingDownloads();
+  DCHECK(!watcher_.get());
+}
+
+void ArcDownloadsWatcherService::OnFileSystemInstanceReady() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  StartWatchingDownloads();
+}
+
+void ArcDownloadsWatcherService::OnFileSystemInstanceClosed() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  StopWatchingDownloads();
+}
+
+void ArcDownloadsWatcherService::StartWatchingDownloads() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  StopWatchingDownloads();
+  DCHECK(!watcher_.get());
+  watcher_ = base::MakeUnique<DownloadsWatcher>(
+      base::Bind(&ArcDownloadsWatcherService::OnDownloadsChanged,
+                 weak_ptr_factory_.GetWeakPtr()));
+  BrowserThread::PostTask(
+      BrowserThread::FILE, FROM_HERE,
+      base::Bind(&DownloadsWatcher::Start, base::Unretained(watcher_.get())));
+}
+
+void ArcDownloadsWatcherService::StopWatchingDownloads() {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  if (watcher_.get()) {
+    BrowserThread::DeleteSoon(BrowserThread::FILE, FROM_HERE,
+                              watcher_.release());
+  }
+}
+
+void ArcDownloadsWatcherService::OnDownloadsChanged(
+    const std::vector<base::FilePath>& paths) {
+  DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+
+  auto instance = arc_bridge_service()->file_system_instance();
+  if (!instance) {
+    return;
+  }
+
+  mojo::Array<mojo::String> mojo_paths(paths.size());
+  for (size_t i = 0; i < paths.size(); ++i) {
+    mojo_paths[i] = paths[i].value();
+  }
+  instance->RequestMediaScan(std::move(mojo_paths));
+}
+
+}  // namespace arc
diff --git a/chrome/browser/chromeos/arc/arc_downloads_watcher_service.h b/chrome/browser/chromeos/arc/arc_downloads_watcher_service.h
new file mode 100644
index 0000000..415230f
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_downloads_watcher_service.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
+
+#include <memory>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service.h"
+
+namespace base {
+
+class FilePath;
+
+}  // namespace base
+
+namespace arc {
+
+// Watches Downloads directory and registers newly created media files to
+// Android MediaProvider.
+class ArcDownloadsWatcherService : public ArcService,
+                                   public ArcBridgeService::Observer {
+ public:
+  explicit ArcDownloadsWatcherService(ArcBridgeService* bridge_service);
+  ~ArcDownloadsWatcherService() override;
+
+  // ArcBridgeService::Observer
+  void OnFileSystemInstanceReady() override;
+  void OnFileSystemInstanceClosed() override;
+
+ private:
+  class DownloadsWatcher;
+
+  void StartWatchingDownloads();
+  void StopWatchingDownloads();
+
+  void OnDownloadsChanged(const std::vector<base::FilePath>& paths);
+
+  std::unique_ptr<DownloadsWatcher> watcher_;
+
+  // Note: This should remain the last member so it'll be destroyed and
+  // invalidate the weak pointers before any other members are destroyed.
+  base::WeakPtrFactory<ArcDownloadsWatcherService> weak_ptr_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(ArcDownloadsWatcherService);
+};
+
+}  // namespace arc
+
+#endif  // CHROME_BROWSER_CHROMEOS_ARC_ARC_DOWNLOADS_WATCHER_SERVICE_H_
diff --git a/chrome/browser/chromeos/arc/arc_service_launcher.cc b/chrome/browser/chromeos/arc/arc_service_launcher.cc
index fc866b19..4499c8a 100644
--- a/chrome/browser/chromeos/arc/arc_service_launcher.cc
+++ b/chrome/browser/chromeos/arc/arc_service_launcher.cc
@@ -7,6 +7,7 @@
 #include "base/bind.h"
 #include "base/memory/ptr_util.h"
 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
+#include "chrome/browser/chromeos/arc/arc_downloads_watcher_service.h"
 #include "chrome/browser/chromeos/arc/arc_policy_bridge.h"
 #include "chrome/browser/chromeos/arc/arc_process_service.h"
 #include "chrome/browser/chromeos/arc/arc_settings_service.h"
@@ -28,6 +29,9 @@
       new ArcServiceManager(content::BrowserThread::GetBlockingPool()));
   arc_service_manager_->AddService(base::WrapUnique(
       new ArcAuthService(arc_service_manager_->arc_bridge_service())));
+  arc_service_manager_->AddService(
+      base::WrapUnique(new ArcDownloadsWatcherService(
+          arc_service_manager_->arc_bridge_service())));
   arc_service_manager_->AddService(base::WrapUnique(
       new ArcPolicyBridge(arc_service_manager_->arc_bridge_service())));
   arc_service_manager_->AddService(base::WrapUnique(
diff --git a/chrome/browser/chromeos/hats/hats_notification_controller.cc b/chrome/browser/chromeos/hats/hats_notification_controller.cc
new file mode 100644
index 0000000..e852beb1
--- /dev/null
+++ b/chrome/browser/chromeos/hats/hats_notification_controller.cc
@@ -0,0 +1,76 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/hats/hats_notification_controller.h"
+
+#include "ash/system/system_notifier.h"
+#include "base/feature_list.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/notifications/notification_ui_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_features.h"
+#include "chrome/common/pref_names.h"
+#include "content/public/browser/browser_thread.h"
+#include "grit/ash_strings.h"
+#include "grit/theme_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/message_center/message_center.h"
+#include "ui/message_center/notification_types.h"
+#include "ui/strings/grit/ui_strings.h"
+
+namespace chromeos {
+
+// static
+const char HatsNotificationController::kDelegateId[] = "hats_delegate";
+
+// static
+const char HatsNotificationController::kNotificationId[] = "hats_notification";
+
+HatsNotificationController::HatsNotificationController(Profile* profile)
+    : profile_(profile) {
+  std::unique_ptr<Notification> notification(CreateNotification());
+  g_browser_process->notification_ui_manager()->Add(*notification, profile_);
+}
+
+HatsNotificationController::~HatsNotificationController() {}
+
+// static
+// TODO(malaykeshav): Implement this stub.
+bool HatsNotificationController::ShouldShowSurveyToProfile(Profile* profile) {
+  // Do not show the survey if the HaTS feature is disabled for the device.
+  return base::FeatureList::IsEnabled(features::kHappininessTrackingSystem);
+}
+
+// NotificationDelegate override:
+std::string HatsNotificationController::id() const {
+  return kDelegateId;
+}
+
+// message_center::NotificationDelegate override:
+void HatsNotificationController::ButtonClick(int button_index) {}
+
+// message_center::NotificationDelegate override:
+void HatsNotificationController::Close(bool by_user) {}
+
+Notification* HatsNotificationController::CreateNotification() {
+  message_center::RichNotificationData optional;
+  optional.buttons.push_back(message_center::ButtonInfo(
+      l10n_util::GetStringUTF16(IDS_ASH_HATS_NOTIFICATION_TAKE_SURVEY_BUTTON)));
+
+  return new Notification(
+      message_center::NOTIFICATION_TYPE_SIMPLE,
+      l10n_util::GetStringUTF16(IDS_ASH_HATS_NOTIFICATION_TITLE),
+      l10n_util::GetStringUTF16(IDS_ASH_HATS_NOTIFICATION_BODY),
+      // TODO(malaykeshav): Change this to actual HaTS icon.
+      ui::ResourceBundle::GetSharedInstance().GetImageNamed(
+          IDR_SCREENSHOT_NOTIFICATION_ICON),
+      message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
+                                 ash::system_notifier::kNotifierHats),
+      l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_HATS_NAME),
+      GURL() /* Send an empty invalid url */, kNotificationId, optional, this);
+}
+
+}  // namespace chromeos
diff --git a/chrome/browser/chromeos/hats/hats_notification_controller.h b/chrome/browser/chromeos/hats/hats_notification_controller.h
new file mode 100644
index 0000000..c6bd83b
--- /dev/null
+++ b/chrome/browser/chromeos/hats/hats_notification_controller.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "chrome/browser/notifications/notification.h"
+#include "chrome/browser/notifications/notification_delegate.h"
+
+class Profile;
+class NetworkState;
+
+namespace chromeos {
+
+// Happiness tracking survey (HaTS) notification controller is responsible for
+// managing the HaTS notification that is displayed to the user.
+class HatsNotificationController : public NotificationDelegate {
+ public:
+  static const char kDelegateId[];
+  static const char kNotificationId[];
+
+  explicit HatsNotificationController(Profile* profile);
+
+  // Returns true if the survey needs to be displayed for the given |profile|.
+  static bool ShouldShowSurveyToProfile(Profile* profile);
+
+ private:
+  ~HatsNotificationController() override;
+
+  // NotificationDelegate overrides:
+  void ButtonClick(int button_index) override;
+  void Close(bool by_user) override;
+  std::string id() const override;
+
+  Notification* CreateNotification();
+
+  Profile* profile_;
+
+  DISALLOW_COPY_AND_ASSIGN(HatsNotificationController);
+};
+
+}  // namespace chromeos
+
+#endif  // CHROME_BROWSER_CHROMEOS_HATS_HATS_NOTIFICATION_CONTROLLER_H_
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 455bd89f..3a1848c 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -697,6 +697,9 @@
   // Reenable clicking on other windows and status area.
   login_display_->SetUIEnabled(true);
 
+  if (HatsNotificationController::ShouldShowSurveyToProfile(profile))
+    hats_notification_controller_ = new HatsNotificationController(profile);
+
   if (browser_launched)
     host_ = nullptr;
 
diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h
index 3d1c873..e33bf67 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.h
+++ b/chrome/browser/chromeos/login/existing_user_controller.h
@@ -19,6 +19,7 @@
 #include "base/time/time.h"
 #include "base/timer/timer.h"
 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
+#include "chrome/browser/chromeos/hats/hats_notification_controller.h"
 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
 #include "chrome/browser/chromeos/login/signin/token_handle_util.h"
 #include "chrome/browser/chromeos/login/ui/login_display.h"
@@ -343,6 +344,9 @@
 
   std::unique_ptr<TokenHandleUtil> token_handle_util_;
 
+  scoped_refptr<typename HatsNotificationController::HatsNotificationController>
+      hats_notification_controller_;
+
   FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin);
 
   // Factory of callbacks.
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc
index 5539dcf..5e8ed329 100644
--- a/chrome/browser/content_settings/content_settings_browsertest.cc
+++ b/chrome/browser/content_settings/content_settings_browsertest.cc
@@ -19,6 +19,7 @@
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/test_launcher_utils.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "components/content_settings/core/browser/cookie_settings.h"
 #include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -328,13 +329,6 @@
     base::FilePath::StringType pepper_plugins = BuildPepperCdmRegistration(
         kClearKeyCdmBaseDirectory, kClearKeyCdmAdapterFileName,
         kClearKeyCdmDisplayName, kClearKeyCdmPepperMimeType);
-#if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
-    // The CDM must be registered when it is a component.
-    pepper_plugins.append(FILE_PATH_LITERAL(","));
-    pepper_plugins.append(BuildPepperCdmRegistration(
-        kWidevineCdmBaseDirectory, kWidevineCdmAdapterFileName,
-        kWidevineCdmDisplayName, kWidevineCdmPluginMimeType));
-#endif  // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
     command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
                                      pepper_plugins);
 #endif  // defined(ENABLE_PEPPER_CDMS)
@@ -345,6 +339,15 @@
 #endif
   }
 
+#if defined(ENABLE_PEPPER_CDMS)
+  void SetUpDefaultCommandLine(base::CommandLine* command_line) override {
+    base::CommandLine default_command_line(base::CommandLine::NO_PROGRAM);
+    InProcessBrowserTest::SetUpDefaultCommandLine(&default_command_line);
+    test_launcher_utils::RemoveCommandLineSwitch(
+        default_command_line, switches::kDisableComponentUpdate, command_line);
+  }
+#endif  // defined(ENABLE_PEPPER_CDMS)
+
   void RunLoadPepperPluginTest(const char* mime_type, bool expect_loaded) {
     const char* expected_result = expect_loaded ? "Loaded" : "Not Loaded";
     content::WebContents* web_contents =
diff --git a/chrome/browser/extensions/api/messaging/extension_message_port.cc b/chrome/browser/extensions/api/messaging/extension_message_port.cc
index 3225143..6a544a50 100644
--- a/chrome/browser/extensions/api/messaging/extension_message_port.cc
+++ b/chrome/browser/extensions/api/messaging/extension_message_port.cc
@@ -99,6 +99,7 @@
       extension_id_(extension_id),
       browser_context_(extension_process->GetBrowserContext()),
       extension_process_(extension_process),
+      opener_tab_id_(-1),
       did_create_port_(false),
       background_host_ptr_(nullptr),
       frame_tracker_(new FrameTracker(this)) {
@@ -121,6 +122,7 @@
       extension_id_(extension_id),
       browser_context_(rfh->GetProcess()->GetBrowserContext()),
       extension_process_(nullptr),
+      opener_tab_id_(-1),
       did_create_port_(false),
       background_host_ptr_(nullptr),
       frame_tracker_(new FrameTracker(this)) {
@@ -158,6 +160,17 @@
 
 ExtensionMessagePort::~ExtensionMessagePort() {}
 
+void ExtensionMessagePort::RevalidatePort() {
+  // Only opener ports need to be revalidated, because these are created in the
+  // renderer before the browser knows about them.
+  DCHECK(!extension_process_);
+  DCHECK_LE(frames_.size(), 1U);
+
+  // If the port is unknown, the renderer will respond by closing the port.
+  SendToPort(base::MakeUnique<ExtensionMsg_ValidateMessagePort>(
+          MSG_ROUTING_NONE, port_id_));
+}
+
 void ExtensionMessagePort::RemoveCommonFrames(const MessagePort& port) {
   // Avoid overlap in the set of frames to make sure that it does not matter
   // when UnregisterFrame is called.
@@ -190,8 +203,10 @@
     const GURL& source_url,
     const std::string& tls_channel_id) {
   ExtensionMsg_TabConnectionInfo source;
-  if (source_tab)
+  if (source_tab) {
     source.tab.Swap(source_tab.get());
+    source.tab.GetInteger("id", &opener_tab_id_);
+  }
   source.frame_id = source_frame_id;
 
   ExtensionMsg_ExternalConnectionInfo info;
@@ -212,8 +227,8 @@
 }
 
 void ExtensionMessagePort::DispatchOnMessage(const Message& message) {
-  SendToPort(base::WrapUnique(
-      new ExtensionMsg_DeliverMessage(MSG_ROUTING_NONE, port_id_, message)));
+  SendToPort(base::WrapUnique(new ExtensionMsg_DeliverMessage(
+      MSG_ROUTING_NONE, port_id_, opener_tab_id_, message)));
 }
 
 void ExtensionMessagePort::IncrementLazyKeepaliveCount() {
diff --git a/chrome/browser/extensions/api/messaging/extension_message_port.h b/chrome/browser/extensions/api/messaging/extension_message_port.h
index dd6e584..92b7858 100644
--- a/chrome/browser/extensions/api/messaging/extension_message_port.h
+++ b/chrome/browser/extensions/api/messaging/extension_message_port.h
@@ -41,6 +41,12 @@
                        content::RenderProcessHost* extension_process);
   ~ExtensionMessagePort() override;
 
+  // Checks whether the frames to which this port is tied at its construction
+  // are still aware of this port's existence. Frames that don't know about
+  // the port are removed from the set of frames. This should be used for opener
+  // ports because the frame may be navigated before the port was initialized.
+  void RevalidatePort();
+
   // MessageService::MessagePort:
   void RemoveCommonFrames(const MessagePort& port) override;
   bool HasFrame(content::RenderFrameHost* rfh) const override;
@@ -92,6 +98,11 @@
   // when the frame is removed or unloaded.
   std::set<content::RenderFrameHost*> frames_;
 
+  // The ID of the tab where the channel was created. This is saved so that any
+  // onMessage events can be run in the scope of the tab.
+  // Only set on receiver ports (if the opener was a tab). -1 if invalid.
+  int opener_tab_id_;
+
   // Whether the renderer acknowledged creation of the port. This is used to
   // distinguish abnormal port closure (e.g. no receivers) from explicit port
   // closure (e.g. by the port.disconnect() JavaScript method in the renderer).
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index 36df03b9..92af506 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -573,13 +573,14 @@
     return;
   }
 
-  std::unique_ptr<MessagePort> opener(
+  std::unique_ptr<ExtensionMessagePort> opener(
       new ExtensionMessagePort(weak_factory_.GetWeakPtr(),
                                GET_OPPOSITE_PORT_ID(params->receiver_port_id),
                                params->source_extension_id, source, false));
   if (!opener->IsValidPort())
     return;
   opener->OpenPort(params->source_process_id, params->source_routing_id);
+  opener->RevalidatePort();
 
   params->receiver->RemoveCommonFrames(*opener);
   if (!params->receiver->IsValidPort()) {
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
index c04916f..0e8c167 100644
--- a/chrome/browser/media/encrypted_media_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -16,6 +16,7 @@
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_switches.h"
+#include "chrome/test/base/test_launcher_utils.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/test/browser_test_utils.h"
 #include "testing/gtest/include/gtest/gtest-spi.h"
@@ -98,8 +99,6 @@
 // Base class for encrypted media tests.
 class EncryptedMediaTestBase : public MediaBrowserTest {
  public:
-  EncryptedMediaTestBase() {}
-
   bool IsExternalClearKey(const std::string& key_system) {
     if (key_system == kExternalClearKeyKeySystem)
       return true;
@@ -241,6 +240,15 @@
         switches::kDisableGestureRequirementForMediaPlayback);
   }
 
+#if defined(ENABLE_PEPPER_CDMS)
+  void SetUpDefaultCommandLine(base::CommandLine* command_line) override {
+    base::CommandLine default_command_line(base::CommandLine::NO_PROGRAM);
+    InProcessBrowserTest::SetUpDefaultCommandLine(&default_command_line);
+    test_launcher_utils::RemoveCommandLineSwitch(
+        default_command_line, switches::kDisableComponentUpdate, command_line);
+  }
+#endif  // defined(ENABLE_PEPPER_CDMS)
+
   void SetUpCommandLineForKeySystem(const std::string& key_system,
                                     base::CommandLine* command_line) {
     if (GetServerConfig(key_system))
@@ -255,13 +263,6 @@
                         kClearKeyCdmAdapterFileName, kClearKeyCdmDisplayName,
                         kClearKeyCdmPepperMimeType);
     }
-#if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
-    else if (IsWidevine(key_system)) {  // NOLINT
-      RegisterPepperCdm(command_line, kWidevineCdmBaseDirectory,
-                        kWidevineCdmAdapterFileName, kWidevineCdmDisplayName,
-                        kWidevineCdmPluginMimeType);
-    }
-#endif  // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
 #endif  // defined(ENABLE_PEPPER_CDMS)
   }
 };
diff --git a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
index 65c6f9cf..d960099b 100644
--- a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
@@ -18,7 +18,9 @@
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
 #include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/test_launcher_utils.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/test/browser_test_utils.h"
@@ -85,20 +87,15 @@
 #endif  // defined(ENABLE_PEPPER_CDMS)
 
 // Expectations for Widevine.
-// Note: Widevine is not available on platforms using components because
-// RegisterPepperCdm() cannot set the codecs.
-// TODO(xhwang): Enable these tests after we have the ability to use the
-// manifest in these tests. See http://crbug.com/586634
-#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT)
+#if defined(WIDEVINE_CDM_AVAILABLE)
 #define EXPECT_WV_SUCCESS EXPECT_SUCCESS
 #define EXPECT_WV_PROPRIETARY EXPECT_PROPRIETARY
 #define EXPECT_WV_NO_MATCH EXPECT_NO_MATCH
-#else  // defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT)
+#else  // defined(WIDEVINE_CDM_AVAILABLE)
 #define EXPECT_WV_SUCCESS EXPECT_UNKNOWN_KEYSYSTEM
 #define EXPECT_WV_PROPRIETARY EXPECT_UNKNOWN_KEYSYSTEM
 #define EXPECT_WV_NO_MATCH EXPECT_UNKNOWN_KEYSYSTEM
-#endif  // defined(WIDEVINE_CDM_AVAILABLE) &&
-        // !defined(WIDEVINE_CDM_IS_COMPONENT)
+#endif  // defined(WIDEVINE_CDM_AVAILABLE)
 
 };  // namespace
 
@@ -151,6 +148,15 @@
   }
   const CodecVector& invalid_codecs() const { return invalid_codecs_; }
 
+#if defined(ENABLE_PEPPER_CDMS)
+  void SetUpDefaultCommandLine(base::CommandLine* command_line) override {
+    base::CommandLine default_command_line(base::CommandLine::NO_PROGRAM);
+    InProcessBrowserTest::SetUpDefaultCommandLine(&default_command_line);
+    test_launcher_utils::RemoveCommandLineSwitch(
+        default_command_line, switches::kDisableComponentUpdate, command_line);
+  }
+#endif  // defined(ENABLE_PEPPER_CDMS)
+
   void SetUpOnMainThread() override {
     InProcessBrowserTest::SetUpOnMainThread();
 
@@ -265,9 +271,6 @@
 #endif  // defined(ENABLE_PEPPER_CDMS)
 };
 
-// TODO(sandersd): Register the Widevine CDM if it is a component. A component
-// CDM registered using RegisterPepperCdm() declares support for audio codecs,
-// but not the other codecs we expect. http://crbug.com/356833.
 class EncryptedMediaSupportedTypesWidevineTest
     : public EncryptedMediaSupportedTypesTest {
 };
@@ -652,9 +655,8 @@
   EXPECT_UNKNOWN_KEYSYSTEM(AreCodecsSupportedByKeySystem(
       kVideoWebMMimeType, no_codecs(), kExternalClearKey));
 
-  // This will fail in all builds unless widevine is available but not a
-  // component, in which case it is registered internally
-#if !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT)
+// This will fail in all builds unless widevine is available.
+#if !defined(WIDEVINE_CDM_AVAILABLE)
   EXPECT_UNKNOWN_KEYSYSTEM(AreCodecsSupportedByKeySystem(
       kVideoWebMMimeType, no_codecs(), kWidevine));
 #endif
@@ -678,9 +680,8 @@
       kVideoWebMMimeType, no_codecs(), kClearKey));
 }
 
-// This will fail in all builds unless Widevine is available but not a
-// component, in which case it is registered internally.
-#if !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT)
+// This will fail in all builds unless Widevine is available.
+#if !defined(WIDEVINE_CDM_AVAILABLE)
 IN_PROC_BROWSER_TEST_F(
     EncryptedMediaSupportedTypesWidevineCDMRegisteredWithWrongPathTest,
     PepperCDMsRegisteredButAdapterNotPresent) {
@@ -691,8 +692,6 @@
   EXPECT_SUCCESS(AreCodecsSupportedByKeySystem(
       kVideoWebMMimeType, no_codecs(), kClearKey));
 }
-#endif  // !defined(WIDEVINE_CDM_AVAILABLE) ||
-        // defined(WIDEVINE_CDM_IS_COMPONENT)
+#endif  // !defined(WIDEVINE_CDM_AVAILABLE)
 #endif  // defined(ENABLE_PEPPER_CDMS)
-
 }  // namespace chrome
diff --git a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
index 17dbfc2..6ae606b8 100644
--- a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
+++ b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
@@ -4,6 +4,7 @@
 
 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
 
+#include "base/feature_list.h"
 #include "base/memory/ptr_util.h"
 #include "base/memory/singleton.h"
 #include "chrome/browser/browser_process.h"
@@ -14,12 +15,14 @@
 #include "chrome/browser/signin/signin_manager_factory.h"
 #include "chrome/browser/sync/profile_sync_service_factory.h"
 #include "chrome/common/channel_info.h"
+#include "chrome/common/pref_names.h"
 #include "components/browser_sync/browser/profile_sync_service.h"
 #include "components/image_fetcher/image_fetcher.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/ntp_snippets/ntp_snippets_fetcher.h"
 #include "components/ntp_snippets/ntp_snippets_scheduler.h"
 #include "components/ntp_snippets/ntp_snippets_service.h"
+#include "components/prefs/pref_service.h"
 #include "components/safe_json/safe_json_parser.h"
 #include "components/signin/core/browser/profile_oauth2_token_service.h"
 #include "components/signin/core/browser/signin_manager.h"
@@ -30,6 +33,7 @@
 #include "net/url_request/url_request_context_getter.h"
 
 #if defined(OS_ANDROID)
+#include "chrome/browser/android/chrome_feature_list.h"
 #include "chrome/browser/android/ntp/ntp_snippets_launcher.h"
 #endif  // OS_ANDROID
 
@@ -66,6 +70,15 @@
 KeyedService* NTPSnippetsServiceFactory::BuildServiceInstanceFor(
     content::BrowserContext* context) const {
   Profile* profile = Profile::FromBrowserContext(context);
+
+  // TODO(mvanouwerkerk): Move the enable logic into the service once we start
+  // observing pref changes.
+  bool enabled = profile->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled);
+#if defined(OS_ANDROID)
+  enabled = enabled &&
+            base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature);
+#endif  // OS_ANDROID
+
   SigninManagerBase* signin_manager =
       SigninManagerFactory::GetForProfile(profile);
   OAuth2TokenService* token_service =
@@ -90,8 +103,8 @@
               base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
 
   return new ntp_snippets::NTPSnippetsService(
-      profile->GetPrefs(), sync_service, suggestions_service, task_runner,
-      g_browser_process->GetApplicationLocale(), scheduler,
+      enabled, profile->GetPrefs(), sync_service, suggestions_service,
+      task_runner, g_browser_process->GetApplicationLocale(), scheduler,
       base::WrapUnique(new ntp_snippets::NTPSnippetsFetcher(
           signin_manager, token_service, request_context,
           base::Bind(&safe_json::SafeJsonParser::Parse),
diff --git a/chrome/browser/password_manager/account_chooser_dialog_android.cc b/chrome/browser/password_manager/account_chooser_dialog_android.cc
index e6f6a81..f33ed44 100644
--- a/chrome/browser/password_manager/account_chooser_dialog_android.cc
+++ b/chrome/browser/password_manager/account_chooser_dialog_android.cc
@@ -20,7 +20,6 @@
 #include "components/browser_sync/browser/profile_sync_service.h"
 #include "components/password_manager/core/browser/password_bubble_experiment.h"
 #include "components/password_manager/core/browser/password_manager_constants.h"
-#include "components/password_manager/core/browser/password_manager_metrics_util.h"
 #include "components/password_manager/core/browser/password_ui_utils.h"
 #include "components/password_manager/core/common/credential_manager_types.h"
 #include "jni/AccountChooserDialog_jni.h"
@@ -226,13 +225,8 @@
   using namespace password_manager;
   if (type == CredentialType::CREDENTIAL_TYPE_EMPTY) {
     passwords_data_.ChooseCredential(nullptr);
-    password_manager::metrics_util::LogAccountChooserUserAction(
-        password_manager::metrics_util::ACCOUNT_CHOOSER_DISMISSED);
-
     return;
   }
-  password_manager::metrics_util::LogAccountChooserUserAction(
-      password_manager::metrics_util::ACCOUNT_CHOOSER_CREDENTIAL_CHOSEN);
   const auto& credentials_forms =
       (type == CredentialType::CREDENTIAL_TYPE_PASSWORD)
           ? local_credentials_forms()
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 93a514c..60eeafb 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -108,7 +108,6 @@
 #endif
 
 #if defined(OS_ANDROID)
-#include "chrome/browser/android/chrome_feature_list.h"
 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
 #include "components/ntp_snippets/ntp_snippets_service.h"
 #endif
@@ -1230,10 +1229,7 @@
 
 #if defined(OS_ANDROID)
   // Service is responsible for fetching content snippets for the NTP.
-  // Note: Create the service even if the feature is disabled, so that any
-  // remaining tasks will be cleaned up.
-  NTPSnippetsServiceFactory::GetForProfile(profile)->Init(
-      base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature));
+  NTPSnippetsServiceFactory::GetForProfile(profile);
 #endif
 }
 
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 6fd54cf..b5783655 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -169,6 +169,7 @@
       "//storage/common",
       "//third_party/WebKit/public:resources",
       "//third_party/adobe/flash:flapper_version_h",
+      "//third_party/brotli",
       "//third_party/leveldatabase",
       "//third_party/libjingle",
       "//third_party/re2",
diff --git a/chrome/browser/ui/autofill/create_card_unmask_prompt_view.h b/chrome/browser/ui/autofill/create_card_unmask_prompt_view.h
index 8bb8eb2..4a584cbd 100644
--- a/chrome/browser/ui/autofill/create_card_unmask_prompt_view.h
+++ b/chrome/browser/ui/autofill/create_card_unmask_prompt_view.h
@@ -14,7 +14,9 @@
 class CardUnmaskPromptController;
 class CardUnmaskPromptView;
 
-// Factory function for CardUnmaskPromptView on non-iOS platforms.
+// Factory function for CardUnmaskPromptView on non-iOS platforms. This function
+// has separate implementations for Views browsers, for Cocoa browsers, and for
+// Android.
 CardUnmaskPromptView* CreateCardUnmaskPromptView(
     CardUnmaskPromptController* controller, content::WebContents* web_contents);
 
diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm
index aad8e68f..f51cba6 100644
--- a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm
+++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm
@@ -59,12 +59,6 @@
 
 namespace autofill {
 
-CardUnmaskPromptView* CreateCardUnmaskPromptView(
-    CardUnmaskPromptController* controller,
-    content::WebContents* web_contents) {
-  return new CardUnmaskPromptViewBridge(controller, web_contents);
-}
-
 #pragma mark CardUnmaskPromptViewBridge
 
 CardUnmaskPromptViewBridge::CardUnmaskPromptViewBridge(
diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_views.mm b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_views.mm
new file mode 100644
index 0000000..b2b322cd
--- /dev/null
+++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_views.mm
@@ -0,0 +1,19 @@
+// Copyright 2016 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/browser_dialogs.h"
+#include "chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h"
+#include "chrome/browser/ui/views/autofill/card_unmask_prompt_views.h"
+
+namespace autofill {
+
+CardUnmaskPromptView* CreateCardUnmaskPromptView(
+    CardUnmaskPromptController* controller,
+    content::WebContents* web_contents) {
+  if (chrome::ToolkitViewsWebUIDialogsEnabled())
+    return new CardUnmaskPromptViews(controller, web_contents);
+  return new CardUnmaskPromptViewBridge(controller, web_contents);
+}
+
+}
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
index b5be1b5..04a9f447 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
@@ -197,6 +197,9 @@
   // Returns true if the caret is at the end of the content.
   bool IsCaretAtEnd() const;
 
+  // Announce that an inline autocomplete is available for screenreaders.
+  void AnnounceAutocompleteForScreenReader(const base::string16& text);
+
   Profile* profile_;
 
   std::unique_ptr<OmniboxPopupView> popup_view_;
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index 07d1e5f..6ebdfc79 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -39,6 +39,7 @@
 #include "ui/base/clipboard/clipboard.h"
 #include "ui/base/clipboard/clipboard_util_mac.h"
 #import "ui/base/cocoa/cocoa_base_utils.h"
+#import "ui/base/l10n/l10n_util_mac.h"
 #include "ui/base/material_design/material_design_controller.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_palette.h"
@@ -46,6 +47,9 @@
 #include "ui/gfx/font_list.h"
 #include "ui/gfx/geometry/rect.h"
 
+// TODO(ellyjones): Remove this when the deployment target is 10.9 or later.
+extern NSString* const NSAccessibilityPriorityKey;
+
 using content::WebContents;
 
 // Focus-handling between |field_| and model() is a bit subtle.
@@ -657,6 +661,8 @@
   model()->OnChanged();
   [field_ clearUndoChain];
 
+  AnnounceAutocompleteForScreenReader(display_text);
+
   return true;
 }
 
@@ -1147,3 +1153,18 @@
   const NSRange selection = GetSelectedRange();
   return NSMaxRange(selection) == GetTextLength();
 }
+
+void OmniboxViewMac::AnnounceAutocompleteForScreenReader(
+    const base::string16& display_text) {
+  NSString* announcement =
+      l10n_util::GetNSStringF(IDS_ANNOUNCEMENT_COMPLETION_AVAILABLE_MAC,
+                              display_text);
+  NSDictionary* notification_info = @{
+      NSAccessibilityAnnouncementKey : announcement,
+      NSAccessibilityPriorityKey :     @(NSAccessibilityPriorityHigh)
+  };
+  NSAccessibilityPostNotificationWithUserInfo(
+      [field_ window],
+      NSAccessibilityAnnouncementRequestedNotification,
+      notification_info);
+}
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
index e0438ee..b342673 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
@@ -19,12 +19,6 @@
 PermissionBubbleCocoa::~PermissionBubbleCocoa() {
 }
 
-// static
-std::unique_ptr<PermissionBubbleView> PermissionBubbleView::Create(
-    Browser* browser) {
-  return base::WrapUnique(new PermissionBubbleCocoa(browser));
-}
-
 void PermissionBubbleCocoa::Show(
     const std::vector<PermissionBubbleRequest*>& requests,
     const std::vector<bool>& accept_state) {
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
index 483db63c..0dbda3e6 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
@@ -36,6 +36,12 @@
 // Designated initializer.  |browser| and |bridge| must both be non-nil.
 - (id)initWithBrowser:(Browser*)browser bridge:(PermissionBubbleCocoa*)bridge;
 
+// Returns the anchor point to use for the given Cocoa |browser|.
++ (NSPoint)getAnchorPointForBrowser:(Browser*)browser;
+
+// Returns true if |browser| has a visible location bar.
++ (bool)hasVisibleLocationBarForBrowser:(Browser*)browser;
+
 // Makes the bubble visible. The bubble will be popuplated with text retrieved
 // from |requests|. |delegate| will receive callbacks for user actions.
 - (void)showWithDelegate:(PermissionBubbleView::Delegate*)delegate
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
index bfb30cb..72bfbf8 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
@@ -248,6 +248,44 @@
   return self;
 }
 
++ (NSPoint)getAnchorPointForBrowser:(Browser*)browser {
+  NSPoint anchor;
+  NSWindow* parentWindow = browser->window()->GetNativeWindow();
+  if ([PermissionBubbleController hasVisibleLocationBarForBrowser:browser]) {
+    LocationBarViewMac* location_bar =
+        [[parentWindow windowController] locationBarBridge];
+    anchor = location_bar->GetPageInfoBubblePoint();
+  } else {
+    // Center the bubble if there's no location bar.
+    NSRect contentFrame = [[parentWindow contentView] frame];
+    anchor = NSMakePoint(NSMidX(contentFrame), NSMaxY(contentFrame));
+  }
+
+  return ui::ConvertPointFromWindowToScreen(parentWindow, anchor);
+}
+
++ (bool)hasVisibleLocationBarForBrowser:(Browser*)browser {
+  if (!browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
+    return false;
+
+  if (!browser->exclusive_access_manager()->context()->IsFullscreen())
+    return true;
+
+  // If the browser is in browser-initiated full screen, a preference can cause
+  // the toolbar to be hidden.
+  if (browser->exclusive_access_manager()
+          ->fullscreen_controller()
+          ->IsFullscreenForBrowser()) {
+    PrefService* prefs = browser->profile()->GetPrefs();
+    bool show_toolbar = prefs->GetBoolean(prefs::kShowFullscreenToolbar);
+    return show_toolbar;
+  }
+
+  // Otherwise this is fullscreen without a toolbar, so there is no visible
+  // location bar.
+  return false;
+}
+
 - (void)windowWillClose:(NSNotification*)notification {
   [[NSNotificationCenter defaultCenter]
       removeObserver:self
@@ -436,41 +474,11 @@
 }
 
 - (NSPoint)getExpectedAnchorPoint {
-  NSPoint anchor;
-  if ([self hasVisibleLocationBar]) {
-    LocationBarViewMac* location_bar =
-        [[[self getExpectedParentWindow] windowController] locationBarBridge];
-    anchor = location_bar->GetPageInfoBubblePoint();
-  } else {
-    // Center the bubble if there's no location bar.
-    NSRect contentFrame = [[[self getExpectedParentWindow] contentView] frame];
-    anchor = NSMakePoint(NSMidX(contentFrame), NSMaxY(contentFrame));
-  }
-
-  return ui::ConvertPointFromWindowToScreen([self getExpectedParentWindow],
-                                            anchor);
+  return [PermissionBubbleController getAnchorPointForBrowser:browser_];
 }
 
 - (bool)hasVisibleLocationBar {
-  if (!browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
-    return false;
-
-  if (!browser_->exclusive_access_manager()->context()->IsFullscreen())
-    return true;
-
-  // If the browser is in browser-initiated full screen, a preference can cause
-  // the toolbar to be hidden.
-  if (browser_->exclusive_access_manager()
-          ->fullscreen_controller()
-          ->IsFullscreenForBrowser()) {
-    PrefService* prefs = browser_->profile()->GetPrefs();
-    bool show_toolbar = prefs->GetBoolean(prefs::kShowFullscreenToolbar);
-    return show_toolbar;
-  }
-
-  // Otherwise this is fullscreen without a toolbar, so there is no visible
-  // location bar.
-  return false;
+  return [PermissionBubbleController hasVisibleLocationBarForBrowser:browser_];
 }
 
 - (info_bubble::BubbleArrowLocation)getExpectedArrowLocation {
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller_unittest.mm
index cea377c..03d2958 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller_unittest.mm
@@ -48,14 +48,14 @@
 @end
 
 @implementation MockBubbleYesLocationBar
-- (bool)hasVisibleLocationBar { return true; }
++ (bool)hasVisibleLocationBarForBrowser:(Browser*)browser { return true; }
 @end
 
 @interface MockBubbleNoLocationBar : NSObject
 @end
 
 @implementation MockBubbleNoLocationBar
-- (bool)hasVisibleLocationBar { return false; }
++ (bool)hasVisibleLocationBarForBrowser:(Browser*)browser { return false; }
 @end
 
 namespace {
@@ -353,7 +353,7 @@
 TEST_F(PermissionBubbleControllerTest, AnchorPositionWithLocationBar) {
   base::mac::ScopedObjCClassSwizzler locationSwizzle(
       [PermissionBubbleController class], [MockBubbleYesLocationBar class],
-      @selector(hasVisibleLocationBar));
+      @selector(hasVisibleLocationBarForBrowser:));
 
   NSPoint anchor = [controller_ getExpectedAnchorPoint];
 
@@ -370,7 +370,7 @@
 TEST_F(PermissionBubbleControllerTest, AnchorPositionWithoutLocationBar) {
   base::mac::ScopedObjCClassSwizzler locationSwizzle(
       [PermissionBubbleController class], [MockBubbleNoLocationBar class],
-      @selector(hasVisibleLocationBar));
+      @selector(hasVisibleLocationBarForBrowser:));
 
   NSPoint anchor = [controller_ getExpectedAnchorPoint];
 
@@ -388,7 +388,7 @@
   {
     base::mac::ScopedObjCClassSwizzler locationSwizzle(
         [PermissionBubbleController class], [MockBubbleYesLocationBar class],
-        @selector(hasVisibleLocationBar));
+        @selector(hasVisibleLocationBarForBrowser:));
     withLocationBar = [controller_ getExpectedAnchorPoint];
   }
 
@@ -396,7 +396,7 @@
   {
     base::mac::ScopedObjCClassSwizzler locationSwizzle(
         [PermissionBubbleController class], [MockBubbleNoLocationBar class],
-        @selector(hasVisibleLocationBar));
+        @selector(hasVisibleLocationBarForBrowser:));
     withoutLocationBar = [controller_ getExpectedAnchorPoint];
   }
 
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_view_cocoa_views.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_view_cocoa_views.mm
new file mode 100644
index 0000000..590b903
--- /dev/null
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_view_cocoa_views.mm
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/ptr_util.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/browser_window.h"
+#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#import "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h"
+#import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h"
+#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
+#include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h"
+#import "ui/base/cocoa/cocoa_base_utils.h"
+#import "ui/gfx/mac/coordinate_conversion.h"
+
+// Implementation of PermissionBubbleViewViews' anchor methods for Cocoa
+// browsers. In Cocoa browsers there is no parent views::View for the permission
+// bubble, so these methods supply an anchor point instead.
+
+views::View* PermissionBubbleViewViews::GetAnchorView() {
+  return nullptr;
+}
+
+gfx::Point PermissionBubbleViewViews::GetAnchorPoint() {
+  return gfx::ScreenPointFromNSPoint(
+      [PermissionBubbleController getAnchorPointForBrowser:browser_]);
+}
+
+views::BubbleBorder::Arrow PermissionBubbleViewViews::GetAnchorArrow() {
+  return [PermissionBubbleController hasVisibleLocationBarForBrowser:browser_]
+             ? views::BubbleBorder::TOP_LEFT
+             : views::BubbleBorder::NONE;
+}
+
+// static
+std::unique_ptr<PermissionBubbleView> PermissionBubbleView::Create(
+    Browser* browser) {
+  if (chrome::ToolkitViewsWebUIDialogsEnabled())
+    return base::WrapUnique(new PermissionBubbleViewViews(browser));
+  return base::WrapUnique(new PermissionBubbleCocoa(browser));
+}
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
index 7734d62..de2ec39d 100644
--- a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
+++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
@@ -55,12 +55,6 @@
 
 }  // namespace
 
-CardUnmaskPromptView* CreateCardUnmaskPromptView(
-    CardUnmaskPromptController* controller,
-    content::WebContents* web_contents) {
-  return new CardUnmaskPromptViews(controller, web_contents);
-}
-
 CardUnmaskPromptViews::CardUnmaskPromptViews(
     CardUnmaskPromptController* controller,
     content::WebContents* web_contents)
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views_shim.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views_shim.cc
new file mode 100644
index 0000000..f463b32
--- /dev/null
+++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views_shim.cc
@@ -0,0 +1,15 @@
+// Copyright 2016 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/views/autofill/card_unmask_prompt_views.h"
+
+namespace autofill {
+
+CardUnmaskPromptView* CreateCardUnmaskPromptView(
+    CardUnmaskPromptController* controller,
+    content::WebContents* web_contents) {
+  return new CardUnmaskPromptViews(controller, web_contents);
+}
+
+}
diff --git a/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc b/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc
index de51279..da0b51f 100644
--- a/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc
+++ b/chrome/browser/ui/views/website_settings/permissions_bubble_view.cc
@@ -9,13 +9,11 @@
 #include "base/macros.h"
 #include "base/memory/ptr_util.h"
 #include "base/strings/string16.h"
+#include "chrome/browser/platform_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_window.h"
 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
-#include "chrome/browser/ui/views/frame/browser_view.h"
-#include "chrome/browser/ui/views/frame/top_container_view.h"
-#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
-#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h"
 #include "chrome/browser/ui/views/website_settings/permission_selector_view_observer.h"
 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
@@ -148,8 +146,6 @@
       public PermissionCombobox::Listener {
  public:
   PermissionsBubbleDialogDelegateView(
-      views::View* anchor_view,
-      views::BubbleBorder::Arrow anchor_arrow,
       PermissionBubbleViewViews* owner,
       const std::vector<PermissionBubbleRequest*>& requests,
       const std::vector<bool>& accept_state);
@@ -177,6 +173,7 @@
   // Updates the anchor's arrow and view. Also repositions the bubble so it's
   // displayed in the correct location.
   void UpdateAnchor(views::View* anchor_view,
+                    const gfx::Point& anchor_point,
                     views::BubbleBorder::Arrow anchor_arrow);
 
  private:
@@ -190,13 +187,10 @@
 };
 
 PermissionsBubbleDialogDelegateView::PermissionsBubbleDialogDelegateView(
-    views::View* anchor_view,
-    views::BubbleBorder::Arrow anchor_arrow,
     PermissionBubbleViewViews* owner,
     const std::vector<PermissionBubbleRequest*>& requests,
     const std::vector<bool>& accept_state)
-    : views::BubbleDialogDelegateView(anchor_view, anchor_arrow),
-      owner_(owner),
+    : owner_(owner),
       multiple_requests_(requests.size() > 1) {
   DCHECK(!requests.empty());
 
@@ -353,10 +347,8 @@
 
 void PermissionsBubbleDialogDelegateView::UpdateAnchor(
     views::View* anchor_view,
+    const gfx::Point& anchor_point,
     views::BubbleBorder::Arrow anchor_arrow) {
-  if (GetAnchorView() == anchor_view && arrow() == anchor_arrow)
-    return;
-
   set_arrow(anchor_arrow);
 
   // Update the border in the bubble: will either add or remove the arrow.
@@ -369,7 +361,10 @@
       new views::BubbleBorder(adjusted_arrow, shadow(), color())));
 
   // Reposition the bubble based on the updated arrow and view.
-  SetAnchorView(anchor_view);
+  if (anchor_view)
+    SetAnchorView(anchor_view);
+  else
+    SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -380,35 +375,12 @@
       delegate_(nullptr),
       bubble_delegate_(nullptr) {
   DCHECK(browser);
+  DCHECK(browser->window());
 }
 
 PermissionBubbleViewViews::~PermissionBubbleViewViews() {
 }
 
-// static
-std::unique_ptr<PermissionBubbleView> PermissionBubbleView::Create(
-    Browser* browser) {
-  return base::WrapUnique(new PermissionBubbleViewViews(browser));
-}
-
-views::View* PermissionBubbleViewViews::GetAnchorView() {
-  BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
-
-  if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
-    return browser_view->GetLocationBarView()->location_icon_view();
-
-  if (browser_view->IsFullscreenBubbleVisible())
-    return browser_view->exclusive_access_bubble()->GetView();
-
-  return browser_view->top_container();
-}
-
-views::BubbleBorder::Arrow PermissionBubbleViewViews::GetAnchorArrow() {
-  if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
-    return views::BubbleBorder::TOP_LEFT;
-  return views::BubbleBorder::NONE;
-}
-
 void PermissionBubbleViewViews::SetDelegate(Delegate* delegate) {
   delegate_ = delegate;
 }
@@ -420,15 +392,18 @@
     bubble_delegate_->CloseBubble();
 
   bubble_delegate_ = new PermissionsBubbleDialogDelegateView(
-      GetAnchorView(), GetAnchorArrow(), this, requests, values);
+      this, requests, values);
 
   // Set |parent_window| because some valid anchors can become hidden.
-  views::Widget* widget = views::Widget::GetWidgetForNativeWindow(
-      browser_->window()->GetNativeWindow());
-  bubble_delegate_->set_parent_window(widget->GetNativeView());
+  bubble_delegate_->set_parent_window(
+      platform_util::GetViewForWindow(browser_->window()->GetNativeWindow()));
 
   views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_)->Show();
   bubble_delegate_->SizeToContents();
+
+  bubble_delegate_->UpdateAnchor(GetAnchorView(),
+                                 GetAnchorPoint(),
+                                 GetAnchorArrow());
 }
 
 bool PermissionBubbleViewViews::CanAcceptRequestUpdate() {
@@ -447,8 +422,13 @@
 }
 
 void PermissionBubbleViewViews::UpdateAnchorPosition() {
-  if (IsVisible())
-    bubble_delegate_->UpdateAnchor(GetAnchorView(), GetAnchorArrow());
+  if (IsVisible()) {
+    bubble_delegate_->set_parent_window(
+        platform_util::GetViewForWindow(browser_->window()->GetNativeWindow()));
+    bubble_delegate_->UpdateAnchor(GetAnchorView(),
+                                   GetAnchorPoint(),
+                                   GetAnchorArrow());
+  }
 }
 
 gfx::NativeWindow PermissionBubbleViewViews::GetNativeWindow() {
diff --git a/chrome/browser/ui/views/website_settings/permissions_bubble_view.h b/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
index ccc94de..bc839fd 100644
--- a/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
+++ b/chrome/browser/ui/views/website_settings/permissions_bubble_view.h
@@ -5,11 +5,13 @@
 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_PERMISSIONS_BUBBLE_VIEW_H_
 
+#include <memory>
 #include <string>
 
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "chrome/browser/ui/website_settings/permission_bubble_view.h"
+#include "ui/gfx/geometry/point.h"
 #include "ui/views/bubble/bubble_border.h"
 
 namespace views {
@@ -40,7 +42,10 @@
   void Deny();
 
  private:
+  // These three functions have separate implementations for Views-based and
+  // Cocoa-based browsers, to allow this bubble to be used in either.
   views::View* GetAnchorView();
+  gfx::Point GetAnchorPoint();
   views::BubbleBorder::Arrow GetAnchorArrow();
 
   Browser* browser_;
diff --git a/chrome/browser/ui/views/website_settings/permissions_bubble_view_views.cc b/chrome/browser/ui/views/website_settings/permissions_bubble_view_views.cc
new file mode 100644
index 0000000..3ff9bedb
--- /dev/null
+++ b/chrome/browser/ui/views/website_settings/permissions_bubble_view_views.cc
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/ptr_util.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/frame/top_container_view.h"
+#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
+#include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h"
+#include "ui/gfx/geometry/point.h"
+
+// The Views browser implementation of PermissionBubbleViewViews'
+// anchor methods. Views browsers have a native View to anchor the bubble to,
+// which these functions provide.
+
+views::View* PermissionBubbleViewViews::GetAnchorView() {
+  BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
+
+  if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
+    return browser_view->GetLocationBarView()->location_icon_view();
+
+  if (browser_view->IsFullscreenBubbleVisible())
+    return browser_view->exclusive_access_bubble()->GetView();
+
+  return browser_view->top_container();
+}
+
+gfx::Point PermissionBubbleViewViews::GetAnchorPoint() {
+  return gfx::Point();
+}
+
+views::BubbleBorder::Arrow PermissionBubbleViewViews::GetAnchorArrow() {
+  if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
+    return views::BubbleBorder::TOP_LEFT;
+  return views::BubbleBorder::NONE;
+}
+
+// static
+std::unique_ptr<PermissionBubbleView> PermissionBubbleView::Create(
+    Browser* browser) {
+  return base::WrapUnique(new PermissionBubbleViewViews(browser));
+}
diff --git a/chrome/browser/ui/webui/DEPS b/chrome/browser/ui/webui/DEPS
index 38d38fe..a6854af 100644
--- a/chrome/browser/ui/webui/DEPS
+++ b/chrome/browser/ui/webui/DEPS
@@ -14,6 +14,7 @@
 
   # Other libraries.
   "+third_party/angle",       # For ANGLE version.
+  "+third_party/brotli",      # For compressed resources.
   "+third_party/zlib/zlib.h", # For compression level constants.
   "+third_party/libaddressinput", # For i18n address input.
 
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index 8985b91..2b3f3e67 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -63,6 +63,7 @@
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_fetcher.h"
 #include "net/url_request/url_request_status.h"
+#include "third_party/brotli/dec/decode.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/base/webui/jstemplate_builder.h"
@@ -760,8 +761,25 @@
       idr = IDR_KEYBOARD_UTILS_JS;
 #endif
 
-    response = ResourceBundle::GetSharedInstance().GetRawDataResource(
-        idr).as_string();
+    base::StringPiece raw_response =
+        ResourceBundle::GetSharedInstance().GetRawDataResource(idr);
+    if (idr == IDR_ABOUT_UI_CREDITS_HTML) {
+      size_t decoded_size;
+      const uint8_t* encoded_response_buffer =
+          reinterpret_cast<const uint8_t*>(raw_response.data());
+      CHECK(BrotliDecompressedSize(raw_response.size(), encoded_response_buffer,
+                                   &decoded_size));
+
+      // Resizing the response and using it as the buffer Brotli decompresses
+      // into.
+      response.resize(decoded_size);
+      CHECK(BrotliDecompressBuffer(raw_response.size(), encoded_response_buffer,
+                                   &decoded_size,
+                                   reinterpret_cast<uint8_t*>(&response[0])) ==
+            BROTLI_RESULT_SUCCESS);
+    } else {
+      response = raw_response.as_string();
+    }
 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
   } else if (source_name_ == chrome::kChromeUIDiscardsHost) {
     response = AboutDiscards(path);
diff --git a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
index ae34338..339ccb3 100644
--- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
+++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc
@@ -34,6 +34,7 @@
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/profile_sync_service_factory.h"
 #include "chrome/browser/ui/accelerator_utils.h"
+#include "chrome/common/channel_info.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/grit/generated_resources.h"
 #include "chrome/grit/locale_settings.h"
@@ -408,6 +409,7 @@
     browsing_data_ui::ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
         sync_service_,
         WebHistoryServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())),
+        chrome::GetChannel(),
         base::Bind(&ClearBrowserDataHandler::UpdateHistoryDeletionDialog,
                    weak_ptr_factory_.GetWeakPtr()));
   }
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 443611a..b05d76f 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1565,8 +1565,6 @@
       'browser/android/offline_pages/offline_page_utils.cc',
       'browser/android/offline_pages/offline_page_utils.h',
       'browser/android/offline_pages/offliner_factory.h',
-      'browser/android/offline_pages/prerender_adapter.cc',
-      'browser/android/offline_pages/prerender_adapter.h',
       'browser/android/offline_pages/prerendering_loader.cc',
       'browser/android/offline_pages/prerendering_loader.h',
       'browser/android/offline_pages/prerendering_offliner.cc',
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi
index f2e2360..1528c043 100644
--- a/chrome/chrome_browser_chromeos.gypi
+++ b/chrome/chrome_browser_chromeos.gypi
@@ -60,6 +60,8 @@
         'browser/chromeos/arc/arc_auth_notification.h',
         'browser/chromeos/arc/arc_auth_service.cc',
         'browser/chromeos/arc/arc_auth_service.h',
+        'browser/chromeos/arc/arc_downloads_watcher_service.cc',
+        'browser/chromeos/arc/arc_downloads_watcher_service.h',
         'browser/chromeos/arc/arc_service_launcher.cc',
         'browser/chromeos/arc/arc_service_launcher.h',
         'browser/chromeos/arc/arc_support_host.cc',
@@ -366,6 +368,8 @@
         'browser/chromeos/first_run/steps/tray_step.cc',
         'browser/chromeos/first_run/steps/tray_step.h',
         'browser/chromeos/genius_app/app_id.h',
+        "browser/chromeos/hats/hats_notification_controller.cc",
+        "browser/chromeos/hats/hats_notification_controller.h",
         'browser/chromeos/idle_detector.cc',
         'browser/chromeos/idle_detector.h',
         'browser/chromeos/input_method/accessibility.cc',
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 46ea02b2..66287e2 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -829,6 +829,7 @@
       'browser/ui/cocoa/autofill/autofill_tooltip_controller.mm',
       'browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h',
       'browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm',
+      'browser/ui/cocoa/autofill/card_unmask_prompt_view_views.mm',
       'browser/ui/cocoa/autofill/down_arrow_popup_menu_cell.h',
       'browser/ui/cocoa/autofill/down_arrow_popup_menu_cell.mm',
       'browser/ui/cocoa/autofill/layout_view.h',
@@ -1308,6 +1309,7 @@
       'browser/ui/cocoa/web_contents_modal_dialog_manager_views_mac.mm',
       'browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h',
       'browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm',
+      'browser/ui/cocoa/website_settings/permission_bubble_view_cocoa_views.mm',
       'browser/ui/cocoa/website_settings/permission_bubble_cocoa.h',
       'browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm',
       'browser/ui/cocoa/website_settings/permission_bubble_controller.h',
@@ -2105,6 +2107,14 @@
       'browser/ui/views/apps/chrome_native_app_window_views_mac.mm',
       'browser/ui/views/apps/native_app_window_frame_view_mac.h',
       'browser/ui/views/apps/native_app_window_frame_view_mac.mm',
+      'browser/ui/views/autofill/card_unmask_prompt_views.cc',
+      'browser/ui/views/autofill/card_unmask_prompt_views.h',
+      'browser/ui/views/autofill/decorated_textfield.cc',
+      'browser/ui/views/autofill/decorated_textfield.h',
+      'browser/ui/views/autofill/info_bubble.cc',
+      'browser/ui/views/autofill/info_bubble.h',
+      'browser/ui/views/autofill/tooltip_icon.cc',
+      'browser/ui/views/autofill/tooltip_icon.h',
       'browser/ui/views/bookmarks/bookmark_bubble_view.cc',
       'browser/ui/views/bookmarks/bookmark_bubble_view.h',
       'browser/ui/views/bookmarks/bookmark_editor_view.cc',
@@ -2145,6 +2155,8 @@
       'browser/ui/views/sync/bubble_sync_promo_view.h',
       'browser/ui/views/website_settings/chosen_object_view.cc',
       'browser/ui/views/website_settings/chosen_object_view.h',
+      'browser/ui/views/website_settings/permissions_bubble_view.cc',
+      'browser/ui/views/website_settings/permissions_bubble_view.h',
       'browser/ui/views/website_settings/permission_selector_view.cc',
       'browser/ui/views/website_settings/permission_selector_view.h',
       'browser/ui/views/website_settings/permission_selector_view_observer.h',
@@ -2180,22 +2192,15 @@
       'browser/ui/views/autofill/autofill_popup_base_view.h',
       'browser/ui/views/autofill/autofill_popup_view_views.cc',
       'browser/ui/views/autofill/autofill_popup_view_views.h',
-      'browser/ui/views/autofill/card_unmask_prompt_views.cc',
-      'browser/ui/views/autofill/card_unmask_prompt_views.h',
-      'browser/ui/views/autofill/decorated_textfield.cc',
-      'browser/ui/views/autofill/decorated_textfield.h',
+      'browser/ui/views/autofill/card_unmask_prompt_views_shim.cc',
       'browser/ui/views/autofill/expanding_textfield.cc',
       'browser/ui/views/autofill/expanding_textfield.h',
-      'browser/ui/views/autofill/info_bubble.cc',
-      'browser/ui/views/autofill/info_bubble.h',
       'browser/ui/views/autofill/password_generation_popup_view_views.cc',
       'browser/ui/views/autofill/password_generation_popup_view_views.h',
       'browser/ui/views/autofill/save_card_bubble_views.cc',
       'browser/ui/views/autofill/save_card_bubble_views.h',
       'browser/ui/views/autofill/save_card_icon_view.cc',
       'browser/ui/views/autofill/save_card_icon_view.h',
-      'browser/ui/views/autofill/tooltip_icon.cc',
-      'browser/ui/views/autofill/tooltip_icon.h',
       'browser/ui/views/bar_control_button.cc',
       'browser/ui/views/bar_control_button.h',
       'browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc',
@@ -2479,8 +2484,7 @@
       'browser/ui/views/web_contents_modal_dialog_manager_views.cc',
       'browser/ui/views/website_settings/chooser_bubble_ui_view.cc',
       'browser/ui/views/website_settings/chooser_bubble_ui_view.h',
-      'browser/ui/views/website_settings/permissions_bubble_view.cc',
-      'browser/ui/views/website_settings/permissions_bubble_view.h',
+      'browser/ui/views/website_settings/permissions_bubble_view_views.cc',
     ],
     'chrome_browser_ui_views_extensions_non_mac_sources': [
       'browser/ui/views/extensions/bookmark_app_confirmation_view.cc',
@@ -2915,6 +2919,7 @@
             '../net/net.gyp:stale_while_revalidate_experiment_domains',
             '../storage/storage_browser.gyp:storage',
             '../storage/storage_common.gyp:storage_common',
+            '../third_party/brotli/brotli.gyp:brotli',
             '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
             '../third_party/re2/re2.gyp:re2',
             '../ui/base/ime/ui_base_ime.gyp:ui_base_ime',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index bce5f54..c196a24 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -1642,7 +1642,6 @@
       'browser/android/offline_pages/offline_page_mhtml_archiver_unittest.cc',
       'browser/android/offline_pages/offline_page_tab_helper_unittest.cc',
       'browser/android/offline_pages/offline_page_utils_unittest.cc',
-      'browser/android/offline_pages/prerendering_loader_unittest.cc',
       'browser/android/offline_pages/prerendering_offliner_unittest.cc',
       'browser/android/offline_pages/recent_tab_helper_unittest.cc',
       'browser/android/offline_pages/request_coordinator_factory_unittest.cc',
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index a4f2126..48b71dd 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -135,7 +135,6 @@
     : browser_(NULL),
       exit_when_last_browser_closes_(true),
       open_about_blank_on_browser_launch_(true),
-      multi_desktop_test_(false),
       run_accessibility_checks_for_test_case_(false)
 #if defined(OS_MACOSX)
       , autorelease_pool_(NULL)
@@ -196,7 +195,7 @@
   // Allow subclasses to change the command line before running any tests.
   SetUpCommandLine(command_line);
   // Add command line arguments that are used by all InProcessBrowserTests.
-  PrepareTestCommandLine(command_line);
+  SetUpDefaultCommandLine(command_line);
 
   // Create a temporary user data directory if required.
   ASSERT_TRUE(CreateUserDataDirectory())
@@ -241,7 +240,7 @@
   BrowserTestBase::SetUp();
 }
 
-void InProcessBrowserTest::PrepareTestCommandLine(
+void InProcessBrowserTest::SetUpDefaultCommandLine(
     base::CommandLine* command_line) {
   // Propagate commandline settings from test_launcher_utils.
   test_launcher_utils::PrepareBrowserCommandLineForTests(command_line);
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h
index 3afebd8..ae3d8e9c 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -60,13 +60,22 @@
 //   SetUpInProcessBrowserTestFixture and other related hook methods for a
 //   cleaner alternative).
 //
-// Following three hook methods are called in sequence before calling
+// The following four hook methods are called in sequence before calling
 // BrowserMain(), thus no browser has been created yet. They are mainly for
 // setting up the environment for running the browser.
 // . SetUpUserDataDirectory()
 // . SetUpCommandLine()
+// . SetUpDefaultCommandLine()
 // . SetUpInProcessBrowserTestFixture()
 //
+// Default command line switches are added in the default implementation of
+// SetUpDefaultCommandLine(). Addtional command line switches can be simply
+// appended in SetUpCommandLine() without the need to invoke
+// InProcessBrowserTest::SetUpCommandLine(). If a test needs to change the
+// default command line, it can override SetUpDefaultCommandLine(), where it
+// should invoke InProcessBrowserTest::SetUpDefaultCommandLine() to get the
+// default swtiches, and modify them as needed.
+//
 // SetUpOnMainThread() is called just after creating the default browser object
 // and before executing the real test code. It's mainly for setting up things
 // related to the browser object and associated window, like opening a new Tab
@@ -135,6 +144,13 @@
                      const GURL& url,
                      ui::PageTransition transition);
 
+  // Setups default command line that will be used to launch the child browser
+  // process with an in-process test. Called by SetUp() after SetupCommandLine()
+  // to add default commandline switches. A default implementation is provided
+  // in this class. If a test does not want to use the default implementation,
+  // it should override this method.
+  virtual void SetUpDefaultCommandLine(base::CommandLine* command_line);
+
   // Initializes the contents of the user data directory. Called by SetUp()
   // after creating the user data directory, but before any browser is launched.
   // If a test wishes to set up some initial non-empty state in the user data
@@ -207,11 +223,6 @@
     open_about_blank_on_browser_launch_ = value;
   }
 
-  // This must be called before RunTestOnMainThreadLoop() to have any effect.
-  void set_multi_desktop_test(bool multi_desktop_test) {
-    multi_desktop_test_ = multi_desktop_test;
-  }
-
   // Runs accessibility checks and sets |error_message| if it fails.
   bool RunAccessibilityChecks(std::string* error_message);
 
@@ -223,10 +234,6 @@
   // Quits all open browsers and waits until there are no more browsers.
   void QuitBrowsers();
 
-  // Prepare command line that will be used to launch the child browser process
-  // with an in-process test.
-  void PrepareTestCommandLine(base::CommandLine* command_line);
-
   // Browser created from CreateBrowser.
   Browser* browser_;
 
@@ -240,10 +247,6 @@
   // True if the about:blank tab should be opened when the browser is launched.
   bool open_about_blank_on_browser_launch_;
 
-  // True if this is a multi-desktop test (in which case this browser test will
-  // not ensure that Browsers are only created on the tested desktop).
-  bool multi_desktop_test_;
-
   // True if the accessibility test should run for a particular test case.
   // This is reset for every test case.
   bool run_accessibility_checks_for_test_case_;
diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc
index 61fb15d..3616ddb0 100644
--- a/chrome/test/base/test_launcher_utils.cc
+++ b/chrome/test/base/test_launcher_utils.cc
@@ -72,6 +72,21 @@
   command_line->AppendSwitch(switches::kDisableComponentUpdate);
 }
 
+void RemoveCommandLineSwitch(const base::CommandLine& in_command_line,
+                             const std::string& switch_to_remove,
+                             base::CommandLine* out_command_line) {
+  const base::CommandLine::SwitchMap& switch_map =
+      in_command_line.GetSwitches();
+  for (base::CommandLine::SwitchMap::const_iterator i = switch_map.begin();
+       i != switch_map.end(); ++i) {
+    const std::string& switch_name = i->first;
+    if (switch_name == switch_to_remove)
+      continue;
+
+    out_command_line->AppendSwitchNative(switch_name, i->second);
+  }
+}
+
 bool OverrideUserDataDir(const base::FilePath& user_data_dir) {
   bool success = true;
 
diff --git a/chrome/test/base/test_launcher_utils.h b/chrome/test/base/test_launcher_utils.h
index 24bd23db..8aea122 100644
--- a/chrome/test/base/test_launcher_utils.h
+++ b/chrome/test/base/test_launcher_utils.h
@@ -21,6 +21,13 @@
 // when running under tests.
 void PrepareBrowserCommandLineForTests(base::CommandLine* command_line);
 
+// Appends all switches from |in_command_line| to |out_command_line| except for
+// |switch_to_remove|.
+// TODO(xhwang): Add CommandLine::RemoveSwitch() so we don't need this hack.
+void RemoveCommandLineSwitch(const base::CommandLine& in_command_line,
+                             const std::string& switch_to_remove,
+                             base::CommandLine* out_command_line);
+
 // Overrides the current process' user data dir.
 bool OverrideUserDataDir(
     const base::FilePath& user_data_dir) WARN_UNUSED_RESULT;
diff --git a/components/BUILD.gn b/components/BUILD.gn
index c6eb245..a0c28f3 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -63,6 +63,7 @@
     "//components/bookmarks/browser:unit_tests",
     "//components/bookmarks/managed:unit_tests",
     "//components/browser_sync/browser:unit_tests",
+    "//components/browsing_data_ui:unit_tests",
     "//components/bubble:unit_tests",
     "//components/captive_portal:unit_tests",
     "//components/certificate_reporting:unit_tests",
diff --git a/components/bitmap_uploader/BUILD.gn b/components/bitmap_uploader/BUILD.gn
index e1c6c900..909eb6b 100644
--- a/components/bitmap_uploader/BUILD.gn
+++ b/components/bitmap_uploader/BUILD.gn
@@ -19,7 +19,6 @@
     "//components/mus/public/interfaces",
     "//gpu",
     "//mojo/converters/surfaces",
-    "//mojo/gles2",
     "//mojo/public/c/system:for_component",
     "//services/shell/public/cpp",
     "//services/shell/public/interfaces",
diff --git a/components/bitmap_uploader/bitmap_uploader.cc b/components/bitmap_uploader/bitmap_uploader.cc
index 8f574805..5c255db 100644
--- a/components/bitmap_uploader/bitmap_uploader.cc
+++ b/components/bitmap_uploader/bitmap_uploader.cc
@@ -9,13 +9,12 @@
 
 #include "base/bind.h"
 #include "base/callback.h"
+#include "components/mus/public/cpp/gles2_context.h"
 #include "components/mus/public/cpp/window.h"
 #include "components/mus/public/cpp/window_surface.h"
 #include "mojo/converters/geometry/geometry_type_converters.h"
 #include "mojo/converters/surfaces/surfaces_type_converters.h"
 #include "mojo/converters/surfaces/surfaces_utils.h"
-#include "mojo/public/c/gles2/chromium_extension.h"
-#include "mojo/public/c/gles2/gles2.h"
 #include "services/shell/public/cpp/connector.h"
 
 namespace bitmap_uploader {
@@ -23,10 +22,6 @@
 
 const uint32_t g_transparent_color = 0x00000000;
 
-void LostContext(void*) {
-  // TODO(fsamuel): Figure out if there's something useful to do here.
-}
-
 }  // namespace
 
 const char kBitmapUploaderForAcceleratedWidget[] =
@@ -42,7 +37,6 @@
       id_namespace_(0u) {}
 
 BitmapUploader::~BitmapUploader() {
-  MojoGLES2DestroyContext(gles2_context_);
 }
 
 void BitmapUploader::Init(shell::Connector* connector) {
@@ -53,10 +47,9 @@
   connector->ConnectToInterface("mojo:mus", &gpu_service_);
   mus::mojom::CommandBufferPtr gles2_client;
   gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client));
-  gles2_context_ = MojoGLES2CreateContext(
-      gles2_client.PassInterface().PassHandle().release().value(), nullptr,
-      &LostContext, nullptr);
-  MojoGLES2MakeCurrent(gles2_context_);
+  gles2_context_.reset(new mus::GLES2Context(
+      std::vector<int32_t>(), gles2_client.PassInterface().PassHandle()));
+  DCHECK(gles2_context_->Initialize());
 }
 
 // Sets the color which is RGBA.
@@ -103,31 +96,25 @@
   pass->shared_quad_states.push_back(
       mojo::CreateDefaultSQS(bounds.size()));
 
-  MojoGLES2MakeCurrent(gles2_context_);
   if (bitmap_.get()) {
+    gpu::gles2::GLES2Interface* gl = gles2_context_->interface();
     mojo::Size bitmap_size;
     bitmap_size.width = width_;
     bitmap_size.height = height_;
     GLuint texture_id = BindTextureForSize(bitmap_size);
-    glTexSubImage2D(GL_TEXTURE_2D,
-                    0,
-                    0,
-                    0,
-                    bitmap_size.width,
-                    bitmap_size.height,
-                    TextureFormat(),
-                    GL_UNSIGNED_BYTE,
-                    &((*bitmap_)[0]));
+    gl->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap_size.width,
+                      bitmap_size.height, TextureFormat(), GL_UNSIGNED_BYTE,
+                      &((*bitmap_)[0]));
 
     gpu::Mailbox mailbox;
-    glGenMailboxCHROMIUM(mailbox.name);
-    glProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
+    gl->GenMailboxCHROMIUM(mailbox.name);
+    gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
 
-    const GLuint64 fence_sync = glInsertFenceSyncCHROMIUM();
-    glShallowFlushCHROMIUM();
+    const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM();
+    gl->ShallowFlushCHROMIUM();
 
     gpu::SyncToken sync_token;
-    glGenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
+    gl->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
 
     mus::mojom::TransferableResourcePtr resource =
         mus::mojom::TransferableResource::New();
@@ -213,20 +200,14 @@
 }
 
 uint32_t BitmapUploader::BindTextureForSize(const mojo::Size size) {
+  gpu::gles2::GLES2Interface* gl = gles2_context_->interface();
   // TODO(jamesr): Recycle textures.
   GLuint texture = 0u;
-  glGenTextures(1, &texture);
-  glBindTexture(GL_TEXTURE_2D, texture);
-  glTexImage2D(GL_TEXTURE_2D,
-                0,
-                TextureFormat(),
-                size.width,
-                size.height,
-                0,
-                TextureFormat(),
-                GL_UNSIGNED_BYTE,
-                0);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+  gl->GenTextures(1, &texture);
+  gl->BindTexture(GL_TEXTURE_2D, texture);
+  gl->TexImage2D(GL_TEXTURE_2D, 0, TextureFormat(), size.width, size.height, 0,
+                 TextureFormat(), GL_UNSIGNED_BYTE, 0);
+  gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   return texture;
 }
 
@@ -239,17 +220,16 @@
 void BitmapUploader::OnResourcesReturned(
     mus::WindowSurface* surface,
     mojo::Array<mus::mojom::ReturnedResourcePtr> resources) {
-  MojoGLES2MakeCurrent(gles2_context_);
+  gpu::gles2::GLES2Interface* gl = gles2_context_->interface();
   // TODO(jamesr): Recycle.
   for (size_t i = 0; i < resources.size(); ++i) {
     mus::mojom::ReturnedResourcePtr resource = std::move(resources[i]);
     DCHECK_EQ(1, resource->count);
-    glWaitSyncTokenCHROMIUM(
-        resource->sync_token.GetConstData());
+    gl->WaitSyncTokenCHROMIUM(resource->sync_token.GetConstData());
     uint32_t texture_id = resource_to_texture_id_map_[resource->id];
     DCHECK_NE(0u, texture_id);
     resource_to_texture_id_map_.erase(resource->id);
-    glDeleteTextures(1, &texture_id);
+    gl->DeleteTextures(1, &texture_id);
   }
 }
 
diff --git a/components/bitmap_uploader/bitmap_uploader.h b/components/bitmap_uploader/bitmap_uploader.h
index 5e90f6d..7b8f062 100644
--- a/components/bitmap_uploader/bitmap_uploader.h
+++ b/components/bitmap_uploader/bitmap_uploader.h
@@ -19,7 +19,10 @@
 #include "components/mus/public/interfaces/gpu.mojom.h"
 #include "gpu/GLES2/gl2chromium.h"
 #include "gpu/GLES2/gl2extchromium.h"
-#include "mojo/public/c/gles2/gles2.h"
+
+namespace mus {
+class GLES2Context;
+}
 
 namespace shell {
 class Connector;
@@ -72,7 +75,7 @@
   mus::Window* window_;
   mus::mojom::GpuPtr gpu_service_;
   std::unique_ptr<mus::WindowSurface> surface_;
-  MojoGLES2Context gles2_context_;
+  std::unique_ptr<mus::GLES2Context> gles2_context_;
 
   mojo::Size size_;
   uint32_t color_;
diff --git a/components/browsing_data_ui.gypi b/components/browsing_data_ui.gypi
index 859c0cc6..f7d10e0f 100644
--- a/components/browsing_data_ui.gypi
+++ b/components/browsing_data_ui.gypi
@@ -10,8 +10,9 @@
       'type': 'static_library',
       'dependencies': [
         '../base/base.gyp:base',
-        'browser_sync_browser',
         'history_core_browser',
+        'sync_driver',
+        'version_info',
       ],
       'include_dirs': [
         '..',
diff --git a/components/browsing_data_ui/BUILD.gn b/components/browsing_data_ui/BUILD.gn
index 3faf508..241e32d 100644
--- a/components/browsing_data_ui/BUILD.gn
+++ b/components/browsing_data_ui/BUILD.gn
@@ -10,7 +10,27 @@
 
   deps = [
     "//base",
-    "//components/browser_sync/browser",
     "//components/history/core/browser",
+    "//components/sync_driver:sync_driver",
+    "//components/version_info",
+  ]
+}
+
+source_set("unit_tests") {
+  testonly = true
+  sources = [
+    "history_notice_utils_unittest.cc",
+  ]
+
+  deps = [
+    ":browsing_data_ui",
+    "//base",
+    "//components/history/core/test:test",
+    "//components/signin/core/browser:test_support",
+    "//components/sync_driver:test_support",
+    "//components/version_info:version_info",
+    "//net",
+    "//sync/protocol:protocol",
+    "//testing/gtest",
   ]
 }
diff --git a/components/browsing_data_ui/DEPS b/components/browsing_data_ui/DEPS
index d7f9272..b798afd 100644
--- a/components/browsing_data_ui/DEPS
+++ b/components/browsing_data_ui/DEPS
@@ -1,4 +1,10 @@
 include_rules = [
-  "+components/history/core/browser",
   "+components/browser_sync/browser",
+  "+components/history/core/browser",
+  "+components/history/core/test",
+  "+components/signin",
+  "+components/sync_driver",
+  "+components/version_info",
+  "+sync/internal_api/public",
+  "+net",
 ]
diff --git a/components/browsing_data_ui/history_notice_utils.cc b/components/browsing_data_ui/history_notice_utils.cc
index c1568f2..6a54c26d 100644
--- a/components/browsing_data_ui/history_notice_utils.cc
+++ b/components/browsing_data_ui/history_notice_utils.cc
@@ -4,9 +4,50 @@
 
 #include "components/browsing_data_ui/history_notice_utils.h"
 
+#include "base/bind.h"
 #include "base/callback.h"
-#include "components/browser_sync/browser/profile_sync_service.h"
+#include "base/message_loop/message_loop.h"
+#include "base/strings/stringprintf.h"
 #include "components/history/core/browser/web_history_service.h"
+#include "components/sync_driver/sync_service.h"
+#include "components/version_info/version_info.h"
+
+namespace {
+
+// Merges several asynchronous boolean callbacks into one that returns a boolean
+// product of their responses. Deletes itself when done.
+class MergeBooleanCallbacks {
+ public:
+  // Constructor. Upon receiving |expected_call_count| calls to |RunCallback|,
+  // |target_callback| will be run with the boolean product of their results.
+  MergeBooleanCallbacks(
+      int expected_call_count,
+      const base::Callback<void(bool)>& target_callback)
+      : expected_call_count_(expected_call_count),
+        target_callback_(target_callback),
+        final_response_(true),
+        call_count_(0) {}
+
+  // This method is to be bound to all asynchronous callbacks which we want
+  // to merge.
+  void RunCallback(bool response) {
+    final_response_ &= response;
+
+    if (++call_count_ < expected_call_count_)
+      return;
+
+    target_callback_.Run(final_response_);
+    base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+  }
+
+ private:
+  int expected_call_count_;
+  base::Callback<void(bool)> target_callback_;
+  bool final_response_;
+  int call_count_;
+};
+
+}  // namespace
 
 namespace browsing_data_ui {
 
@@ -14,14 +55,16 @@
 
 bool g_override_other_forms_of_browsing_history_query = false;
 
-}
+}  // namespace testing
 
 void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
-    const ProfileSyncService* sync_service,
+    const sync_driver::SyncService* sync_service,
     history::WebHistoryService* history_service,
     base::Callback<void(bool)> callback) {
   if (!sync_service ||
       !sync_service->IsSyncActive() ||
+      !sync_service->GetActiveDataTypes().Has(
+          syncer::HISTORY_DELETE_DIRECTIVES) ||
       sync_service->IsUsingSecondaryPassphrase() ||
       !history_service) {
     callback.Run(false);
@@ -32,12 +75,48 @@
 }
 
 void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
-    const ProfileSyncService* sync_service,
+    const sync_driver::SyncService* sync_service,
+    history::WebHistoryService* history_service,
+    version_info::Channel channel,
+    base::Callback<void(bool)> callback) {
+  // If the query for other forms of browsing history is overriden for testing,
+  // the conditions are identical with
+  // ShouldShowNoticeAboutOtherFormsOfBrowsingHistory.
+  if (testing::g_override_other_forms_of_browsing_history_query) {
+    ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
+        sync_service, history_service, callback);
+    return;
+  }
+
+  if (!sync_service ||
+      !sync_service->IsSyncActive() ||
+      !sync_service->GetActiveDataTypes().Has(
+          syncer::HISTORY_DELETE_DIRECTIVES) ||
+      sync_service->IsUsingSecondaryPassphrase() ||
+      !history_service) {
+    callback.Run(false);
+    return;
+  }
+
+  // Return the boolean product of QueryWebAndAppActivity and
+  // QueryOtherFormsOfBrowsingHistory. MergeBooleanCallbacks deletes itself
+  // after processing both callbacks.
+  MergeBooleanCallbacks* merger = new MergeBooleanCallbacks(2, callback);
+  history_service->QueryWebAndAppActivity(base::Bind(
+      &MergeBooleanCallbacks::RunCallback, base::Unretained(merger)));
+  history_service->QueryOtherFormsOfBrowsingHistory(
+      channel,
+      base::Bind(
+          &MergeBooleanCallbacks::RunCallback, base::Unretained(merger)));
+}
+
+// TODO(crbug.com/614319): This function is deprecated and should be removed.
+void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
+    const sync_driver::SyncService* sync_service,
     history::WebHistoryService* history_service,
     base::Callback<void(bool)> callback) {
   if (!history_service ||
-      (!testing::g_override_other_forms_of_browsing_history_query &&
-       !history_service->HasOtherFormsOfBrowsingHistory())) {
+      !testing::g_override_other_forms_of_browsing_history_query) {
     callback.Run(false);
     return;
   }
diff --git a/components/browsing_data_ui/history_notice_utils.h b/components/browsing_data_ui/history_notice_utils.h
index c3ab520d..96fabd4 100644
--- a/components/browsing_data_ui/history_notice_utils.h
+++ b/components/browsing_data_ui/history_notice_utils.h
@@ -5,14 +5,22 @@
 #ifndef COMPONENTS_BROWSING_DATA_UI_HISTORY_NOTICE_UTILS_H_
 #define COMPONENTS_BROWSING_DATA_UI_HISTORY_NOTICE_UTILS_H_
 
-#include "base/callback_forward.h"
+#include <string>
 
-class ProfileSyncService;
+#include "base/callback_forward.h"
 
 namespace history {
 class WebHistoryService;
 }
 
+namespace sync_driver {
+class SyncService;
+}
+
+namespace version_info {
+enum class Channel;
+}
+
 namespace browsing_data_ui {
 
 namespace testing {
@@ -23,22 +31,32 @@
 // found. Used only for testing. The default is false.
 extern bool g_override_other_forms_of_browsing_history_query;
 
-}
+}  // testing
 
 // Whether the Clear Browsing Data UI should show a notice about the existence
 // of other forms of browsing history stored in user's account. The response
 // is returned in a |callback|.
 void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
-    const ProfileSyncService* sync_service,
+    const sync_driver::SyncService* sync_service,
     history::WebHistoryService* history_service,
     base::Callback<void(bool)> callback);
 
 // Whether the Clear Browsing Data UI should popup a dialog with information
 // about the existence of other forms of browsing history stored in user's
 // account when the user deletes their browsing history for the first time.
-// The response is returned in a |callback|.
+// The response is returned in a |callback|. The |channel| parameter
+// must be provided for successful communication with the Sync server, but
+// the result does not depend on it.
 void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
-    const ProfileSyncService* sync_service,
+    const sync_driver::SyncService* sync_service,
+    history::WebHistoryService* history_service,
+    version_info::Channel channel,
+    base::Callback<void(bool)> callback);
+
+// A deprecated overloaded version of the above function called by iOS.
+// TODO(crbug.com/614319): Remove this when iOS calls the correct version.
+void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
+    const sync_driver::SyncService* sync_service,
     history::WebHistoryService* history_service,
     base::Callback<void(bool)> callback);
 
diff --git a/components/browsing_data_ui/history_notice_utils_unittest.cc b/components/browsing_data_ui/history_notice_utils_unittest.cc
new file mode 100644
index 0000000..e850b74f
--- /dev/null
+++ b/components/browsing_data_ui/history_notice_utils_unittest.cc
@@ -0,0 +1,187 @@
+// Copyright 2016 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/browsing_data_ui/history_notice_utils.h"
+
+#include <memory>
+
+#include "base/callback.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "components/history/core/test/fake_web_history_service.h"
+#include "components/signin/core/browser/account_tracker_service.h"
+#include "components/signin/core/browser/fake_profile_oauth2_token_service.h"
+#include "components/signin/core/browser/fake_signin_manager.h"
+#include "components/signin/core/browser/test_signin_client.h"
+#include "components/sync_driver/fake_sync_service.h"
+#include "components/version_info/version_info.h"
+#include "net/http/http_status_code.h"
+#include "net/url_request/url_request_test_util.h"
+#include "sync/internal_api/public/base/model_type.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace browsing_data_ui {
+
+namespace {
+
+class TestSyncService : public sync_driver::FakeSyncService {
+ public:
+  // Getters (FakeSyncService implementation). ---------------------------------
+  bool IsSyncActive() const override {
+   return sync_active_;
+  }
+
+  syncer::ModelTypeSet GetActiveDataTypes() const override {
+    return active_data_types_;
+  }
+
+  bool IsUsingSecondaryPassphrase() const override {
+    return using_secondary_passphrase_;
+  }
+
+  // Setters. ------------------------------------------------------------------
+  void set_sync_active(bool active) {
+    sync_active_ = active;
+  }
+
+  void set_active_data_types(syncer::ModelTypeSet data_types) {
+    active_data_types_ = data_types;
+  }
+
+  void set_using_secondary_passphrase(bool passphrase) {
+    using_secondary_passphrase_ = passphrase;
+  }
+
+ private:
+  syncer::ModelTypeSet active_data_types_;
+  bool using_secondary_passphrase_ = false;
+  bool sync_active_ = false;
+};
+
+}  // namespace
+
+
+class HistoryNoticeUtilsTest : public ::testing::Test {
+ public:
+  HistoryNoticeUtilsTest()
+    : signin_client_(nullptr),
+      signin_manager_(&signin_client_, &account_tracker_) {
+  }
+
+  void SetUp() override {
+    sync_service_.reset(new TestSyncService());
+    history_service_.reset(new history::FakeWebHistoryService(
+        &oauth2_token_service_,
+        &signin_manager_,
+        url_request_context_));
+    history_service_->SetupFakeResponse(true /* success */, net::HTTP_OK);
+  }
+
+  TestSyncService* sync_service() {
+    return sync_service_.get();
+  }
+
+  history::FakeWebHistoryService* history_service() {
+    return history_service_.get();
+  }
+
+  void ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(
+      bool expected_test_case_result) {
+    bool got_result = false;
+
+    ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
+        sync_service_.get(),
+        history_service_.get(),
+        version_info::Channel::STABLE,
+        base::Bind(
+            &HistoryNoticeUtilsTest::Callback,
+            base::Unretained(this),
+            base::Unretained(&got_result)));
+
+    if (!got_result) {
+      run_loop_.reset(new base::RunLoop());
+      run_loop_->Run();
+    }
+
+    // Process the DeleteSoon() called on MergeBooleanCallbacks, otherwise
+    // this it will be considered to be leaked.
+    base::MessageLoop::current()->RunUntilIdle();
+
+    EXPECT_EQ(expected_test_case_result, result_);
+  }
+
+ private:
+  void Callback(bool* got_result, bool result) {
+    *got_result = true;
+    result_ = result;
+
+    if (run_loop_)
+      run_loop_->Quit();
+  }
+
+  FakeProfileOAuth2TokenService oauth2_token_service_;
+  AccountTrackerService account_tracker_;
+  TestSigninClient signin_client_;
+  FakeSigninManagerBase signin_manager_;
+  scoped_refptr<net::URLRequestContextGetter> url_request_context_;
+  std::unique_ptr<TestSyncService> sync_service_;
+  std::unique_ptr<history::FakeWebHistoryService> history_service_;
+
+  std::unique_ptr<base::RunLoop> run_loop_;
+  bool result_;
+
+  base::MessageLoop message_loop_;
+};
+
+TEST_F(HistoryNoticeUtilsTest, NotSyncing) {
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+}
+
+TEST_F(HistoryNoticeUtilsTest, SyncingWithWrongParameters) {
+  sync_service()->set_sync_active(true);
+
+  // Regardless of the state of the web history...
+  history_service()->SetWebAndAppActivityEnabled(true);
+  history_service()->SetOtherFormsOfBrowsingHistoryPresent(true);
+
+  // ...the response is false if there's custom passphrase...
+  sync_service()->set_active_data_types(syncer::ModelTypeSet::All());
+  sync_service()->set_using_secondary_passphrase(true);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+
+  // ...or even if there's no custom passphrase, but we're not syncing history.
+  syncer::ModelTypeSet only_passwords(syncer::PASSWORDS);
+  sync_service()->set_active_data_types(only_passwords);
+  sync_service()->set_using_secondary_passphrase(false);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+}
+
+TEST_F(HistoryNoticeUtilsTest, WebHistoryStates) {
+  // If history Sync is active...
+  sync_service()->set_sync_active(true);
+  sync_service()->set_active_data_types(syncer::ModelTypeSet::All());
+
+  // ...the result is true if both web history queries return true...
+  history_service()->SetWebAndAppActivityEnabled(true);
+  history_service()->SetOtherFormsOfBrowsingHistoryPresent(true);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(true);
+
+  // ...but not otherwise.
+  history_service()->SetOtherFormsOfBrowsingHistoryPresent(false);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+  history_service()->SetWebAndAppActivityEnabled(false);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+  history_service()->SetOtherFormsOfBrowsingHistoryPresent(true);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+
+  // Invalid responses from the web history are interpreted as false.
+  history_service()->SetWebAndAppActivityEnabled(true);
+  history_service()->SetOtherFormsOfBrowsingHistoryPresent(true);
+  history_service()->SetupFakeResponse(true, net::HTTP_INTERNAL_SERVER_ERROR);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+  history_service()->SetupFakeResponse(false, net::HTTP_OK);
+  ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false);
+}
+
+}  // namespace browsing_data_ui
diff --git a/components/components_resources.gyp b/components/components_resources.gyp
index 783ddb4..9e092c2 100644
--- a/components/components_resources.gyp
+++ b/components/components_resources.gyp
@@ -5,6 +5,7 @@
 {
   'variables': {
     'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
+    'about_credits_file_bro': '<(SHARED_INTERMEDIATE_DIR)/about_credits.bro',
   },
   'targets': [
     {
@@ -12,7 +13,7 @@
       'target_name': 'components_resources',
       'type': 'none',
       'dependencies': [
-        'about_credits',
+        'compressed_about_credits',
       ],
       'hard_dependency': 1,
       'variables': {
@@ -25,7 +26,7 @@
           'variables': {
             'grit_grd_file': 'resources/components_resources.grd',
             'grit_additional_defines': [
-              '-E', 'about_credits_file=<(about_credits_file)',
+              '-E', 'about_credits_file=<(about_credits_file_bro)',
             ],
           },
           'includes': [ '../build/grit_action.gypi' ],
@@ -42,6 +43,22 @@
       'includes': [ '../build/grit_target.gypi' ],
     },
     {
+      'target_name': 'compressed_about_credits',
+      'type': 'none',
+      'actions': [
+        {
+          'variables': {
+            'input_file': '<(about_credits_file)',
+            'output_file': '<(about_credits_file_bro)',
+          },
+          'includes': ['../third_party/brotli/bro.gypi'],
+	}
+      ],
+      'dependencies': [
+        'about_credits'
+      ],
+    },
+    {
       # GN version: //components/resources:about_credits
       'target_name': 'about_credits',
       'type': 'none',
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 319a28e2..6f312a9 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -1,4 +1,4 @@
- # Copyright 2014 The Chromium Authors. All rights reserved.
+# Copyright 2014 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
@@ -89,6 +89,9 @@
       'browser_watcher/watcher_metrics_provider_win_unittest.cc',
       'browser_watcher/window_hang_monitor_win_unittest.cc',
     ],
+    'browsing_data_ui_unittest_sources': [
+      'browsing_data_ui/history_notice_utils_unittest.cc'
+    ],
     'bubble_unittest_sources': [
       'bubble/bubble_manager_mocks.cc',
       'bubble/bubble_manager_mocks.h',
@@ -979,6 +982,7 @@
         '<@(bookmarks_unittest_sources)',
         '<@(browser_sync_unittest_sources)',
         '<@(browser_watcher_unittest_sources)',
+        '<@(browsing_data_ui_unittest_sources)',
         '<@(bubble_unittest_sources)',
         '<@(captive_portal_unittest_sources)',
         '<@(cast_certificate_unittest_sources)',
@@ -1089,6 +1093,7 @@
         'components.gyp:bookmarks_test_support',
         'components.gyp:browser_sync_browser',
         'components.gyp:browser_sync_browser_test_support',
+        'components.gyp:browsing_data_ui',
         'components.gyp:bubble',
         'components.gyp:captive_portal_test_support',
         'components.gyp:cast_certificate',
diff --git a/components/history.gypi b/components/history.gypi
index 0948c70..580eee3 100644
--- a/components/history.gypi
+++ b/components/history.gypi
@@ -31,6 +31,7 @@
         'signin_core_browser',
         'sync_driver',
         'url_formatter/url_formatter.gyp:url_formatter',
+        'version_info',
       ],
       'export_dependent_settings': [
         '../skia/skia.gyp:skia',
diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn
index 67f9ee4..8557531 100644
--- a/components/history/core/browser/BUILD.gn
+++ b/components/history/core/browser/BUILD.gn
@@ -99,6 +99,7 @@
     "//components/signin/core/browser",
     "//components/sync_driver",
     "//components/url_formatter",
+    "//components/version_info",
     "//google_apis",
     "//net",
     "//sql",
diff --git a/components/history/core/browser/web_history_service.cc b/components/history/core/browser/web_history_service.cc
index 3a0aa29..2b14601 100644
--- a/components/history/core/browser/web_history_service.cc
+++ b/components/history/core/browser/web_history_service.cc
@@ -4,15 +4,21 @@
 
 #include "components/history/core/browser/web_history_service.h"
 
+#include <memory>
+
 #include "base/bind.h"
+#include "base/command_line.h"
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
 #include "base/metrics/histogram.h"
+#include "base/optional.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "components/signin/core/browser/signin_manager.h"
+#include "components/sync_driver/local_device_info_provider_impl.h"
+#include "components/sync_driver/sync_util.h"
 #include "google_apis/gaia/gaia_urls.h"
 #include "google_apis/gaia/google_service_auth_error.h"
 #include "google_apis/gaia/oauth2_token_service.h"
@@ -23,6 +29,8 @@
 #include "net/url_request/url_fetcher.h"
 #include "net/url_request/url_fetcher_delegate.h"
 #include "net/url_request/url_request_context_getter.h"
+#include "sync/protocol/history_status.pb.h"
+#include "ui/base/device_form_factor.h"
 #include "url/gurl.h"
 
 namespace history {
@@ -47,8 +55,12 @@
 const char kQueryWebAndAppActivityUrl[] =
     "https://history.google.com/history/api/lookup?client=web_app";
 
+const char kQueryOtherFormsOfBrowsingHistoryUrlSuffix[] = "/historystatus";
+
 const char kPostDataMimeType[] = "text/plain";
 
+const char kSyncProtoMimeType[] = "application/octet-stream";
+
 // The maximum number of retries for the URLFetcher requests.
 const size_t kMaxRetries = 1;
 
@@ -81,6 +93,7 @@
         signin_manager_(signin_manager),
         request_context_(request_context),
         url_(url),
+        post_data_mime_type_(kPostDataMimeType),
         response_code_(0),
         auth_retry_count_(0),
         callback_(callback),
@@ -160,8 +173,8 @@
   // Helper for creating a new URLFetcher for the API request.
   std::unique_ptr<net::URLFetcher> CreateUrlFetcher(
       const std::string& access_token) {
-    net::URLFetcher::RequestType request_type = post_data_.empty() ?
-        net::URLFetcher::GET : net::URLFetcher::POST;
+    net::URLFetcher::RequestType request_type = post_data_ ?
+        net::URLFetcher::POST : net::URLFetcher::GET;
     std::unique_ptr<net::URLFetcher> fetcher =
         net::URLFetcher::Create(url_, request_type, this);
     fetcher->SetRequestContext(request_context_.get());
@@ -171,13 +184,30 @@
     fetcher->AddExtraRequestHeader("Authorization: Bearer " + access_token);
     fetcher->AddExtraRequestHeader("X-Developer-Key: " +
         GaiaUrls::GetInstance()->oauth2_chrome_client_id());
-    if (request_type == net::URLFetcher::POST)
-      fetcher->SetUploadData(kPostDataMimeType, post_data_);
+
+    if (!user_agent_.empty()) {
+      fetcher->AddExtraRequestHeader(
+          std::string(net::HttpRequestHeaders::kUserAgent) +
+          ": " + user_agent_);
+    }
+
+    if (post_data_)
+      fetcher->SetUploadData(post_data_mime_type_, post_data_.value());
     return fetcher;
   }
 
   void SetPostData(const std::string& post_data) override {
+    SetPostDataAndType(post_data, kPostDataMimeType);
+  }
+
+  void SetPostDataAndType(const std::string& post_data,
+                          const std::string& mime_type) override {
     post_data_ = post_data;
+    post_data_mime_type_ = mime_type;
+  }
+
+  void SetUserAgent(const std::string& user_agent) override {
+    user_agent_ = user_agent;
   }
 
   OAuth2TokenService* token_service_;
@@ -188,7 +218,13 @@
   GURL url_;
 
   // POST data to be sent with the request (may be empty).
-  std::string post_data_;
+  base::Optional<std::string> post_data_;
+
+  // MIME type of the post requests. Defaults to text/plain.
+  std::string post_data_mime_type_;
+
+  // The user agent header used with this request.
+  std::string user_agent_;
 
   // The OAuth2 access token request.
   std::unique_ptr<OAuth2TokenService::Request> token_request_;
@@ -302,6 +338,7 @@
   STLDeleteElements(&pending_expire_requests_);
   STLDeleteElements(&pending_audio_history_requests_);
   STLDeleteElements(&pending_web_and_app_activity_requests_);
+  STLDeleteElements(&pending_other_forms_of_browsing_history_requests_);
 }
 
 WebHistoryService::Request* WebHistoryService::CreateRequest(
@@ -441,12 +478,6 @@
   return pending_audio_history_requests_.size();
 }
 
-bool WebHistoryService::HasOtherFormsOfBrowsingHistory() const {
-  // TODO(msramek): Query history.google.com for existence of other forms of
-  // browsing history. In the meantime, assume that there isn't.
-  return false;
-}
-
 void WebHistoryService::QueryWebAndAppActivity(
     const QueryWebAndAppActivityCallback& callback) {
   // Wrap the original callback into a generic completion callback.
@@ -461,6 +492,46 @@
   request->Start();
 }
 
+void WebHistoryService::QueryOtherFormsOfBrowsingHistory(
+    version_info::Channel channel,
+    const QueryOtherFormsOfBrowsingHistoryCallback& callback) {
+  // Wrap the original callback into a generic completion callback.
+  CompletionCallback completion_callback = base::Bind(
+      &WebHistoryService::QueryOtherFormsOfBrowsingHistoryCompletionCallback,
+      weak_ptr_factory_.GetWeakPtr(),
+      callback);
+
+  // Find the Sync request URL.
+  GURL url =
+      GetSyncServiceURL(*base::CommandLine::ForCurrentProcess(), channel);
+  GURL::Replacements replace_path;
+  std::string new_path =
+      url.path() + kQueryOtherFormsOfBrowsingHistoryUrlSuffix;
+  replace_path.SetPathStr(new_path);
+  url = url.ReplaceComponents(replace_path);
+  DCHECK(url.is_valid());
+
+  Request* request = CreateRequest(url, completion_callback);
+
+  // Set the Sync-specific user agent.
+  // TODO(pavely): Refactor LocalDeviceInfoProviderImpl::GetSyncUserAgent()
+  // to a standalone function.
+  browser_sync::LocalDeviceInfoProviderImpl local_device_info_provider_(
+      channel, std::string() /* version (unused) */,
+      ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET);
+  request->SetUserAgent(local_device_info_provider_.GetSyncUserAgent());
+
+  pending_other_forms_of_browsing_history_requests_.insert(request);
+
+  // Set the request protobuf.
+  sync_pb::HistoryStatusRequest request_proto;
+  std::string post_data;
+  request_proto.SerializeToString(&post_data);
+  request->SetPostDataAndType(post_data, kSyncProtoMimeType);
+
+  request->Start();
+}
+
 // static
 void WebHistoryService::QueryHistoryCompletionCallback(
     const WebHistoryService::QueryWebHistoryCallback& callback,
@@ -530,4 +601,21 @@
   callback.Run(web_and_app_activity_enabled);
 }
 
+void WebHistoryService::QueryOtherFormsOfBrowsingHistoryCompletionCallback(
+    const WebHistoryService::QueryOtherFormsOfBrowsingHistoryCallback& callback,
+    WebHistoryService::Request* request,
+    bool success) {
+  pending_other_forms_of_browsing_history_requests_.erase(request);
+  std::unique_ptr<Request> request_ptr(request);
+
+  bool has_other_forms_of_browsing_history = false;
+  if (success && request->GetResponseCode() == net::HTTP_OK) {
+    sync_pb::HistoryStatusResponse history_status;
+    if (history_status.ParseFromString(request->GetResponseBody()))
+      has_other_forms_of_browsing_history = history_status.has_derived_data();
+  }
+
+  callback.Run(has_other_forms_of_browsing_history);
+}
+
 }  // namespace history
diff --git a/components/history/core/browser/web_history_service.h b/components/history/core/browser/web_history_service.h
index 2b170cf..0b6c08b 100644
--- a/components/history/core/browser/web_history_service.h
+++ b/components/history/core/browser/web_history_service.h
@@ -25,6 +25,10 @@
 class URLRequestContextGetter;
 }
 
+namespace version_info {
+enum class Channel;
+}
+
 class OAuth2TokenService;
 class SigninManagerBase;
 
@@ -55,6 +59,11 @@
 
     virtual void SetPostData(const std::string& post_data) = 0;
 
+    virtual void SetPostDataAndType(const std::string& post_data,
+                                    const std::string& mime_type) = 0;
+
+    virtual void SetUserAgent(const std::string& user_agent) = 0;
+
     // Tells the request to begin.
     virtual void Start() = 0;
 
@@ -75,6 +84,9 @@
 
   typedef base::Callback<void(bool success)> QueryWebAndAppActivityCallback;
 
+  typedef base::Callback<void(bool success)>
+      QueryOtherFormsOfBrowsingHistoryCallback;
+
   typedef base::Callback<void(Request*, bool success)> CompletionCallback;
 
   WebHistoryService(
@@ -121,7 +133,9 @@
   size_t GetNumberOfPendingAudioHistoryRequests();
 
   // Whether there are other forms of browsing history stored on the server.
-  bool HasOtherFormsOfBrowsingHistory() const;
+  void QueryOtherFormsOfBrowsingHistory(
+      version_info::Channel channel,
+      const QueryOtherFormsOfBrowsingHistoryCallback& callback);
 
  protected:
   // This function is pulled out for testing purposes. Caller takes ownership of
@@ -166,6 +180,14 @@
     WebHistoryService::Request* request,
     bool success);
 
+  // Called by |request| when a query for other forms of browsing history has
+  // completed. Unpacks the response and calls |callback|, which is the original
+  // callback that was passed to QueryOtherFormsOfBrowsingHistory().
+  void QueryOtherFormsOfBrowsingHistoryCompletionCallback(
+    const WebHistoryService::QueryWebAndAppActivityCallback& callback,
+    WebHistoryService::Request* request,
+    bool success);
+
  private:
   friend class WebHistoryServiceTest;
 
@@ -193,6 +215,10 @@
   // profile shutdown.
   std::set<Request*> pending_web_and_app_activity_requests_;
 
+  // Pending queries for other forms of browsing history to be canceled if not
+  // complete by profile shutdown.
+  std::set<Request*> pending_other_forms_of_browsing_history_requests_;
+
   base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(WebHistoryService);
diff --git a/components/history/core/browser/web_history_service_unittest.cc b/components/history/core/browser/web_history_service_unittest.cc
index f5e789b2..6a62a10c 100644
--- a/components/history/core/browser/web_history_service_unittest.cc
+++ b/components/history/core/browser/web_history_service_unittest.cc
@@ -122,6 +122,11 @@
   void SetPostData(const std::string& post_data) override {
     post_data_ = post_data;
   }
+  void SetPostDataAndType(const std::string& post_data,
+                          const std::string& mime_type) override {
+    SetPostData(post_data);
+  }
+  void SetUserAgent(const std::string& post_data) override {}
 
   void Start() override {
     is_pending_ = true;
diff --git a/components/history/core/test/BUILD.gn b/components/history/core/test/BUILD.gn
index cd3d94f..9bc56b1f 100644
--- a/components/history/core/test/BUILD.gn
+++ b/components/history/core/test/BUILD.gn
@@ -33,6 +33,7 @@
     "//net",
     "//sql",
     "//sql:test_support",
+    "//sync/protocol:protocol",
     "//testing/gtest",
     "//ui/gfx",
     "//url",
diff --git a/components/history/core/test/fake_web_history_service.cc b/components/history/core/test/fake_web_history_service.cc
index 2739974e..44e5be420 100644
--- a/components/history/core/test/fake_web_history_service.cc
+++ b/components/history/core/test/fake_web_history_service.cc
@@ -9,9 +9,11 @@
 #include "base/callback.h"
 #include "base/macros.h"
 #include "base/strings/string_number_conversions.h"
+#include "base/strings/stringprintf.h"
 #include "base/time/time.h"
 #include "net/base/url_util.h"
 #include "net/url_request/url_request_context_getter.h"
+#include "sync/protocol/history_status.pb.h"
 
 namespace history {
 
@@ -19,9 +21,22 @@
 
 namespace {
 
+// TODO(msramek): Find a way to keep these URLs in sync with what is used
+// in WebHistoryService.
+
+const char kLookupUrl[] =
+    "https://history.google.com/history/api/lookup";
+
+const char kChromeClient[] = "chrome";
+
+const char kWebAndAppClient[] = "web_app";
+
+const char kSyncServerHost[] = "clients4.google.com";
+
 class FakeRequest : public WebHistoryService::Request {
  public:
   FakeRequest(FakeWebHistoryService* service,
+              const GURL& url,
               bool emulate_success,
               int emulate_response_code,
               const WebHistoryService::CompletionCallback& callback,
@@ -34,10 +49,14 @@
   int GetResponseCode() override;
   const std::string& GetResponseBody() override;
   void SetPostData(const std::string& post_data) override;
+  void SetPostDataAndType(const std::string& post_data,
+                          const std::string& mime_type) override;
+  void SetUserAgent(const std::string& user_agent) override;
   void Start() override;
 
  private:
   FakeWebHistoryService* service_;
+  GURL url_;
   bool emulate_success_;
   int emulate_response_code_;
   const WebHistoryService::CompletionCallback& callback_;
@@ -52,6 +71,7 @@
 
 FakeRequest::FakeRequest(
     FakeWebHistoryService* service,
+    const GURL& url,
     bool emulate_success,
     int emulate_response_code,
     const WebHistoryService::CompletionCallback& callback,
@@ -59,13 +79,14 @@
     base::Time end,
     int max_count)
         : service_(service),
-        emulate_success_(emulate_success),
-        emulate_response_code_(emulate_response_code),
-        callback_(callback),
-        begin_(begin),
-        end_(end),
-        max_count_(max_count),
-        is_pending_(false) {
+          url_(url),
+          emulate_success_(emulate_success),
+          emulate_response_code_(emulate_response_code),
+          callback_(callback),
+          begin_(begin),
+          end_(end),
+          max_count_(max_count),
+          is_pending_(false) {
 }
 
 bool FakeRequest::IsPending() {
@@ -77,14 +98,41 @@
 }
 
 const std::string& FakeRequest::GetResponseBody() {
-  int count = service_->GetNumberOfVisitsBetween(begin_, end_);
-  if (max_count_ && max_count_ < count)
-    count = max_count_;
+  std::string client;
+  net::GetValueForKeyInQuery(url_, "client", &client);
 
-  response_body_ = "{ \"event\": [";
-  for (int i = 0; i < count; ++i)
-    response_body_ += i ? ", {}" : "{}";
-  response_body_ += "] }";
+  GURL::Replacements remove_query;
+  remove_query.ClearQuery();
+  GURL base_url = url_.ReplaceComponents(remove_query);
+
+  // History query.
+  if (base_url == GURL(kLookupUrl) && client == kChromeClient) {
+    int count = service_->GetNumberOfVisitsBetween(begin_, end_);
+    if (max_count_ && max_count_ < count)
+      count = max_count_;
+
+    response_body_ = "{ \"event\": [";
+    for (int i = 0; i < count; ++i)
+      response_body_ += i ? ", {}" : "{}";
+    response_body_ += "] }";
+  }
+
+  // Web and app activity query.
+  if (base_url == GURL(kLookupUrl) && client == kWebAndAppClient) {
+    response_body_ = base::StringPrintf(
+        "{ \"history_recording_enabled\": %s }",
+        service_->IsWebAndAppActivityEnabled() ? "true" : "false");
+  }
+
+  // Other forms of browsing history query.
+  if (url_.host() == kSyncServerHost) {
+    std::unique_ptr<sync_pb::HistoryStatusResponse> history_status(
+        new sync_pb::HistoryStatusResponse());
+    history_status->set_has_derived_data(
+        service_->AreOtherFormsOfBrowsingHistoryPresent());
+    history_status->SerializeToString(&response_body_);
+  }
+
   return response_body_;
 }
 
@@ -92,6 +140,15 @@
   // Unused.
 };
 
+void FakeRequest::SetPostDataAndType(const std::string& post_data,
+                                     const std::string& mime_type) {
+  // Unused.
+};
+
+void FakeRequest::SetUserAgent(const std::string& user_agent) {
+  // Unused.
+};
+
 void FakeRequest::Start() {
   is_pending_ = true;
   callback_.Run(this, emulate_success_);
@@ -165,8 +222,25 @@
   if (net::GetValueForKeyInQuery(url, "num", &max_count_str))
     base::StringToInt(max_count_str, &max_count);
 
-  return new FakeRequest(this, emulate_success_, emulate_response_code_,
+  return new FakeRequest(this, url, emulate_success_, emulate_response_code_,
                          callback, begin, end, max_count);
 }
 
+bool FakeWebHistoryService::IsWebAndAppActivityEnabled() {
+  return web_and_app_activity_enabled_;
+}
+
+void FakeWebHistoryService::SetWebAndAppActivityEnabled(bool enabled) {
+  web_and_app_activity_enabled_ = enabled;
+}
+
+bool FakeWebHistoryService::AreOtherFormsOfBrowsingHistoryPresent() {
+  return other_forms_of_browsing_history_present_;
+}
+
+void FakeWebHistoryService::SetOtherFormsOfBrowsingHistoryPresent(
+    bool present) {
+  other_forms_of_browsing_history_present_ = present;
+}
+
 }  // namespace history
diff --git a/components/history/core/test/fake_web_history_service.h b/components/history/core/test/fake_web_history_service.h
index 79a5b37..7832e27 100644
--- a/components/history/core/test/fake_web_history_service.h
+++ b/components/history/core/test/fake_web_history_service.h
@@ -24,11 +24,9 @@
 // Use |SetupFakeResponse| to influence whether the requests should succeed
 // or fail, and with which error code.
 //
-// Note: Currently, the only test that uses this class only counts the number
-// of visits and does not inspect their contents. Therefore, the behavior
-// of this class is only defined for |WebHistoryService::QueryHistory| queries
-// and even for them, we only return the correct number of items, without
-// contents.
+// Note: The behavior of this class is only defined for some WebHistoryService
+// queries. If needed, improve FakeRequest::GetResponseBody() to simulate
+// responses for other queries.
 //
 // TODO(msramek): This class might need its own set of tests.
 class FakeWebHistoryService : public history::WebHistoryService {
@@ -53,6 +51,14 @@
   // Counts the number of visits within a certain time range.
   int GetNumberOfVisitsBetween(const base::Time& begin, const base::Time& end);
 
+  // Get and set the fake state of web and app activity.
+  bool IsWebAndAppActivityEnabled();
+  void SetWebAndAppActivityEnabled(bool enabled);
+
+  // Get and set the fake state of other forms of browsing history.
+  bool AreOtherFormsOfBrowsingHistoryPresent();
+  void SetOtherFormsOfBrowsingHistoryPresent(bool present);
+
  private:
   base::Time GetTimeForKeyInQuery(const GURL& url, const std::string& key);
 
@@ -64,6 +70,10 @@
   bool emulate_success_;
   int emulate_response_code_;
 
+  // States of serverside corpora.
+  bool web_and_app_activity_enabled_;
+  bool other_forms_of_browsing_history_present_;
+
   // Fake visits storage.
   typedef std::pair<std::string, base::Time> Visit;
   std::vector<Visit> visits_;
diff --git a/components/mus/public/cpp/BUILD.gn b/components/mus/public/cpp/BUILD.gn
index 8ffa189..f785a6f 100644
--- a/components/mus/public/cpp/BUILD.gn
+++ b/components/mus/public/cpp/BUILD.gn
@@ -60,7 +60,6 @@
     "//mojo/converters/geometry",
     "//mojo/converters/input_events",
     "//mojo/converters/surfaces",
-    "//mojo/public/c/gles2:gles2",
     "//mojo/public/cpp/bindings:bindings",
     "//mojo/public/cpp/system",
     "//services/shell/public/cpp",
diff --git a/components/mus/public/cpp/context_provider.h b/components/mus/public/cpp/context_provider.h
index 0538efb..78d701b 100644
--- a/components/mus/public/cpp/context_provider.h
+++ b/components/mus/public/cpp/context_provider.h
@@ -38,11 +38,6 @@
   ~ContextProvider() override;
 
  private:
-  static void ContextLostThunk(void* closure) {
-    static_cast<ContextProvider*>(closure)->ContextLost();
-  }
-  void ContextLost();
-
   mojo::ScopedMessagePipeHandle command_buffer_handle_;
   std::unique_ptr<GLES2Context> context_;
 
diff --git a/components/mus/public/cpp/gles2_context.h b/components/mus/public/cpp/gles2_context.h
index 805e667..f2239b2 100644
--- a/components/mus/public/cpp/gles2_context.h
+++ b/components/mus/public/cpp/gles2_context.h
@@ -13,9 +13,6 @@
 #include "base/macros.h"
 #include "components/mus/public/cpp/lib/command_buffer_client_impl.h"
 #include "gpu/command_buffer/client/gles2_implementation.h"
-#include "mojo/public/c/gles2/gles2.h"
-
-struct MojoGLES2ContextPrivate {};
 
 namespace gpu {
 class TransferBuffer;
@@ -27,12 +24,10 @@
 
 namespace mus {
 
-class GLES2Context : public MojoGLES2ContextPrivate {
+class GLES2Context {
  public:
   explicit GLES2Context(const std::vector<int32_t>& attribs,
-                        mojo::ScopedMessagePipeHandle command_buffer_handle,
-                        MojoGLES2ContextLost lost_callback,
-                        void* closure);
+                        mojo::ScopedMessagePipeHandle command_buffer_handle);
   virtual ~GLES2Context();
   bool Initialize();
 
@@ -42,14 +37,10 @@
   gpu::ContextSupport* context_support() const { return implementation_.get(); }
 
  private:
-  void OnLostContext();
-
   CommandBufferClientImpl command_buffer_;
   std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_;
   std::unique_ptr<gpu::TransferBuffer> transfer_buffer_;
   std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_;
-  MojoGLES2ContextLost lost_callback_;
-  void* closure_;
 
   DISALLOW_COPY_AND_ASSIGN(GLES2Context);
 };
diff --git a/components/mus/public/cpp/lib/DEPS b/components/mus/public/cpp/lib/DEPS
index 5e8f71d2..c635ea6 100644
--- a/components/mus/public/cpp/lib/DEPS
+++ b/components/mus/public/cpp/lib/DEPS
@@ -1,4 +1,3 @@
 include_rules = [
-  "+mojo/gles2",
   "+mojo/gpu"
 ]
diff --git a/components/mus/public/cpp/lib/context_provider.cc b/components/mus/public/cpp/lib/context_provider.cc
index f1468f0..7e06ee6 100644
--- a/components/mus/public/cpp/lib/context_provider.cc
+++ b/components/mus/public/cpp/lib/context_provider.cc
@@ -18,10 +18,8 @@
 }
 
 bool ContextProvider::BindToCurrentThread() {
-  DCHECK(command_buffer_handle_.is_valid());
   std::unique_ptr<GLES2Context> context(new GLES2Context(
-      std::vector<int32_t>(), std::move(command_buffer_handle_),
-      &ContextLostThunk, this));
+      std::vector<int32_t>(), std::move(command_buffer_handle_)));
   if (context->Initialize())
     context_ = std::move(context);
   return !!context_;
@@ -60,6 +58,4 @@
 ContextProvider::~ContextProvider() {
 }
 
-void ContextProvider::ContextLost() {}
-
 }  // namespace mus
diff --git a/components/mus/public/cpp/lib/gles2_context.cc b/components/mus/public/cpp/lib/gles2_context.cc
index 1962849..c71f0ec 100644
--- a/components/mus/public/cpp/lib/gles2_context.cc
+++ b/components/mus/public/cpp/lib/gles2_context.cc
@@ -18,12 +18,8 @@
 namespace mus {
 
 GLES2Context::GLES2Context(const std::vector<int32_t>& attribs,
-                           mojo::ScopedMessagePipeHandle command_buffer_handle,
-                           MojoGLES2ContextLost lost_callback,
-                           void* closure)
-    : command_buffer_(attribs, std::move(command_buffer_handle)),
-      lost_callback_(lost_callback),
-      closure_(closure) {}
+                           mojo::ScopedMessagePipeHandle command_buffer_handle)
+    : command_buffer_(attribs, std::move(command_buffer_handle)) {}
 
 GLES2Context::~GLES2Context() {}
 
@@ -53,13 +49,7 @@
                                    default_limits.max_transfer_buffer_size,
                                    default_limits.mapped_memory_reclaim_limit))
     return false;
-  implementation_->SetLostContextCallback(
-      base::Bind(&GLES2Context::OnLostContext, base::Unretained(this)));
   return true;
 }
 
-void GLES2Context::OnLostContext() {
-  lost_callback_(closure_);
-}
-
 }  // namespace mus
diff --git a/components/mus/public/cpp/tests/BUILD.gn b/components/mus/public/cpp/tests/BUILD.gn
index 25d3816..b5939b7 100644
--- a/components/mus/public/cpp/tests/BUILD.gn
+++ b/components/mus/public/cpp/tests/BUILD.gn
@@ -68,7 +68,6 @@
     "//mojo/converters/geometry",
     "//mojo/converters/input_events",
     "//mojo/edk/system",
-    "//mojo/gles2",
     "//mojo/public/cpp/system",
     "//services/shell/public/cpp",
     "//testing/gtest",
diff --git a/components/mus/public/interfaces/surface_id.mojom b/components/mus/public/interfaces/surface_id.mojom
index 7d6f657f..6142365 100644
--- a/components/mus/public/interfaces/surface_id.mojom
+++ b/components/mus/public/interfaces/surface_id.mojom
@@ -4,10 +4,10 @@
 
 module mus.mojom;
 
-// A surface ID is composed of two parts, a local part and a namespace. The
-// local part is allocated by the client using any scheme that avoids
-// duplicates. The namespace is allocated by the service and will be different
-// for each client (aka each connection to mojo.Surface).
+// A surface ID is composed of three parts: a namespace, a local ID, and a
+// nonce. The local part and nonce are allocated by the client using any scheme
+// that avoids duplicates and makes IDs unguessable respectively. The namespace
+// is allocated by the service and will be different for each client.
 //
 // The special id_namespace value 0 is equivalent to the namespace of the
 // client. This can be used to create, destroy and submit frames to
@@ -15,6 +15,14 @@
 // owned by the same client. The actual id namespace must be used to pass
 // surface ids to other clients for them to reference.
 struct SurfaceId {
-  uint32 local;
+  // A service allocated ID identifying a client.
   uint32 id_namespace;
+
+  // An identifier allocated by the client uniquely identifying a surface within
+  // a client process.
+  uint32 local_id;
+
+  // A cryptographically secure random int chosen to make the SurfaceId
+  // unguessable by other clients.
+  uint64 nonce;
 };
diff --git a/components/mus/ws/BUILD.gn b/components/mus/ws/BUILD.gn
index 59c178e..0ec4147 100644
--- a/components/mus/ws/BUILD.gn
+++ b/components/mus/ws/BUILD.gn
@@ -214,7 +214,6 @@
     "//mojo/converters/geometry",
     "//mojo/converters/input_events",
     "//mojo/converters/transform",
-    "//mojo/gles2",
     "//mojo/public/cpp/bindings:bindings",
     "//services/shell/public/cpp:shell_test_support",
     "//services/shell/public/cpp:sources",
diff --git a/components/mus/ws/server_window_surface.cc b/components/mus/ws/server_window_surface.cc
index 4ae254a..7403512 100644
--- a/components/mus/ws/server_window_surface.cc
+++ b/components/mus/ws/server_window_surface.cc
@@ -110,7 +110,7 @@
   // Surface ids originate from the client, meaning they are ClientWindowIds
   // and can only be resolved by the client that submitted the frame.
   const ClientWindowId other_client_window_id(
-      input->surface_quad_state->surface.To<cc::SurfaceId>().id);
+      input->surface_quad_state->surface->local_id);
   ServerWindow* other_window = window()->delegate()->FindWindowForSurface(
       window(), mojom::SurfaceType::DEFAULT, other_client_window_id);
   if (!other_window) {
diff --git a/components/mus/ws/window_finder.h b/components/mus/ws/window_finder.h
index 0b587b95..2b535fc 100644
--- a/components/mus/ws/window_finder.h
+++ b/components/mus/ws/window_finder.h
@@ -5,10 +5,6 @@
 #ifndef COMPONENTS_MUS_WS_WINDOW_FINDER_H_
 #define COMPONENTS_MUS_WS_WINDOW_FINDER_H_
 
-namespace cc {
-struct SurfaceId;
-}
-
 namespace gfx {
 class Point;
 class Transform;
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 4da4e50..b269c42 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -186,6 +186,7 @@
 }  // namespace
 
 NTPSnippetsService::NTPSnippetsService(
+    bool enabled,
     PrefService* pref_service,
     sync_driver::SyncService* sync_service,
     SuggestionsService* suggestions_service,
@@ -194,8 +195,8 @@
     NTPSnippetsScheduler* scheduler,
     std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher,
     std::unique_ptr<ImageFetcher> image_fetcher)
-    : state_(State::NOT_INITED),
-      enabled_(false),
+    : state_(State::INITED),
+      enabled_(enabled),
       pref_service_(pref_service),
       sync_service_(sync_service),
       sync_service_observer_(this),
@@ -211,24 +212,7 @@
   // |sync_service_| can be null in tests or if sync is disabled.
   if (sync_service_)
     sync_service_observer_.Add(sync_service_);
-}
 
-NTPSnippetsService::~NTPSnippetsService() {
-  DCHECK(state_ == State::NOT_INITED || state_ == State::SHUT_DOWN);
-}
-
-// static
-void NTPSnippetsService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
-  registry->RegisterListPref(prefs::kSnippets);
-  registry->RegisterListPref(prefs::kDiscardedSnippets);
-  registry->RegisterListPref(prefs::kSnippetHosts);
-}
-
-void NTPSnippetsService::Init(bool enabled) {
-  DCHECK(state_ == State::NOT_INITED);
-  state_ = State::INITED;
-
-  enabled_ = enabled;
   if (enabled_) {
     // |suggestions_service_| can be null in tests.
     if (snippets_fetcher_->UsesHostRestrictions() && suggestions_service_) {
@@ -249,6 +233,17 @@
   RescheduleFetching();
 }
 
+NTPSnippetsService::~NTPSnippetsService() {
+  DCHECK(state_ == State::SHUT_DOWN);
+}
+
+// static
+void NTPSnippetsService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
+  registry->RegisterListPref(prefs::kSnippets);
+  registry->RegisterListPref(prefs::kDiscardedSnippets);
+  registry->RegisterListPref(prefs::kSnippetHosts);
+}
+
 void NTPSnippetsService::Shutdown() {
   DCHECK(state_ == State::INITED);
   state_ = State::SHUT_DOWN;
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index a5bac53..cdfd97d 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -64,6 +64,7 @@
   // the locale, so 'en_US' (English language with US locale) and 'en-GB_US'
   // (British English person in the US) are not language codes.
   NTPSnippetsService(
+      bool enabled,
       PrefService* pref_service,
       sync_driver::SyncService* sync_service,
       suggestions::SuggestionsService* suggestions_service,
@@ -76,8 +77,6 @@
 
   static void RegisterProfilePrefs(PrefRegistrySimple* registry);
 
-  void Init(bool enabled);
-
   // Inherited from KeyedService.
   void Shutdown() override;
 
@@ -163,11 +162,13 @@
   bool IsSyncStateIncompatible();
 
   enum class State {
-    NOT_INITED,
     INITED,
     SHUT_DOWN
   } state_;
 
+  // When |enabled_| is true the service will fetch snippets from the server
+  // using |snippets_fetcher_|, load snippets from device storage, and schedule
+  // the |scheduler_|.
   bool enabled_;
 
   PrefService* pref_service_;
diff --git a/components/ntp_snippets/ntp_snippets_service_unittest.cc b/components/ntp_snippets/ntp_snippets_service_unittest.cc
index 0141584..2307a4ba 100644
--- a/components/ntp_snippets/ntp_snippets_service_unittest.cc
+++ b/components/ntp_snippets/ntp_snippets_service_unittest.cc
@@ -278,14 +278,13 @@
         new net::TestURLRequestContextGetter(task_runner.get());
 
     service_.reset(new NTPSnippetsService(
-        pref_service_.get(), mock_sync_service_.get(), nullptr, task_runner,
-        std::string("fr"), &scheduler_,
+        enabled, pref_service_.get(), mock_sync_service_.get(), nullptr,
+        task_runner, std::string("fr"), &scheduler_,
         base::WrapUnique(new NTPSnippetsFetcher(
             fake_signin_manager_.get(), fake_token_service_.get(),
             std::move(request_context_getter), base::Bind(&ParseJson),
             /*is_stable_channel=*/true)),
         /*image_fetcher=*/nullptr));
-    service_->Init(enabled);
   }
 
  protected:
diff --git a/components/offline_pages/background/offliner.h b/components/offline_pages/background/offliner.h
index ead1adf..e245060 100644
--- a/components/offline_pages/background/offliner.h
+++ b/components/offline_pages/background/offliner.h
@@ -15,19 +15,18 @@
 // a request with a URL.
 class Offliner {
  public:
-  // Status of processing an offline page request.
-  enum class RequestStatus {
-    UNKNOWN,   // No status determined/reported yet.
-    LOADED,    // Page loaded but not (yet) saved.
-    SAVED,     // Offline page snapshot saved.
-    CANCELED,  // Request was canceled.
-    FAILED,    // Request failed.
-    // TODO(dougarnett): Define a retry-able failure status.
+  // Completion status of processing an offline page request.
+  enum CompletionStatus {
+    SAVED = 0,
+    CANCELED = 1,
+    FAILED_CONSIDER_RETRY = 2,
+    FAILED_DO_NOT_RETRY = 3,
+    UNKNOWN = 4,
   };
 
   // Reports the completion status of a request.
   // TODO(dougarnett): consider passing back a request id instead of request.
-  typedef base::Callback<void(const SavePageRequest&, RequestStatus)>
+  typedef base::Callback<void(const SavePageRequest&, CompletionStatus)>
       CompletionCallback;
 
   Offliner() {}
diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc
index 09d388f..fe53232 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -23,7 +23,7 @@
       factory_(std::move(factory)),
       queue_(std::move(queue)),
       scheduler_(std::move(scheduler)),
-      last_offlining_status_(Offliner::RequestStatus::UNKNOWN) {
+      last_offlining_status_(Offliner::UNKNOWN) {
   DCHECK(policy_ != nullptr);
 }
 
@@ -45,7 +45,7 @@
   queue_->AddRequest(request,
                      base::Bind(&RequestCoordinator::AddRequestResultCallback,
                                 AsWeakPtr()));
-  // TODO(petewil): Do I need to persist the request in case the add fails?
+  // TODO: Do I need to persist the request in case the add fails?
 
   // TODO(petewil): Eventually we will wait for the StartProcessing callback,
   // but for now just kick start the request so we can test the wiring.
@@ -73,26 +73,25 @@
 void RequestCoordinator::StopProcessing() {
 }
 
-void RequestCoordinator::SendRequestToOffliner(const SavePageRequest& request) {
+void RequestCoordinator::SendRequestToOffliner(SavePageRequest& request) {
   // TODO(petewil): When we have multiple offliners, we need to pick one.
   Offliner* offliner = factory_->GetOffliner(policy_.get());
   if (!offliner) {
-    DVLOG(0) << "Unable to create Offliner. "
-             << "Cannot background offline page.";
+    LOG(ERROR) << "Unable to create Prerendering Offliner. "
+               << "Cannot background offline page.";
     return;
   }
 
-  // Start the load and save process in the offliner (Async).
+  // Start the load and save process in the prerenderer (Async).
   offliner->LoadAndSave(
       request,
       base::Bind(&RequestCoordinator::OfflinerDoneCallback, AsWeakPtr()));
 }
 
-void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
-                                              Offliner::RequestStatus status) {
-  DVLOG(2) << "offliner finished, saved: "
-           << (status == Offliner::RequestStatus::SAVED) << ", "
-           << __FUNCTION__;
+void RequestCoordinator::OfflinerDoneCallback(
+    const SavePageRequest& request,
+    Offliner::CompletionStatus status) {
+  DVLOG(2) << "prerenderer finished, status " << status << ", " << __FUNCTION__;
   last_offlining_status_ = status;
 }
 
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index 77c2494..4ab1e5a 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -60,7 +60,7 @@
   Scheduler* GetSchedulerForTesting() { return scheduler_.get(); }
 
   // Returns the status of the most recent offlining.
-  Offliner::RequestStatus last_offlining_status() {
+  Offliner::CompletionStatus last_offlining_status() {
     return last_offlining_status_;
   }
 
@@ -68,10 +68,10 @@
   void AddRequestResultCallback(RequestQueue::AddRequestResult result,
                                 const SavePageRequest& request);
 
-  void SendRequestToOffliner(const SavePageRequest& request);
+  void SendRequestToOffliner(SavePageRequest& request);
 
   void OfflinerDoneCallback(const SavePageRequest& request,
-                            Offliner::RequestStatus status);
+                            Offliner::CompletionStatus status);
 
   // RequestCoordinator takes over ownership of the policy
   std::unique_ptr<OfflinerPolicy> policy_;
@@ -82,7 +82,7 @@
   // Scheduler. Used to request a callback when network is available.  Owned.
   std::unique_ptr<Scheduler> scheduler_;
   // Status of the most recent offlining.
-  Offliner::RequestStatus last_offlining_status_;
+  Offliner::CompletionStatus last_offlining_status_;
 
   DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
 };
diff --git a/components/offline_pages/background/request_coordinator_unittest.cc b/components/offline_pages/background/request_coordinator_unittest.cc
index ab506f0..ca6b363 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -6,7 +6,6 @@
 
 #include <memory>
 #include <utility>
-#include <vector>
 
 #include "base/bind.h"
 #include "base/location.h"
@@ -56,8 +55,7 @@
                    const CompletionCallback& callback) override {
     // Post the callback on the run loop.
     base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::Bind(callback, request, Offliner::RequestStatus::SAVED));
+        FROM_HERE, base::Bind(callback, request, Offliner::SAVED));
     return true;
   }
 
@@ -174,8 +172,7 @@
   EXPECT_TRUE(scheduler_stub->schedule_called());
 
   // Check that the offliner callback got a response.
-  EXPECT_EQ(Offliner::RequestStatus::SAVED,
-            coordinator()->last_offlining_status());
+  EXPECT_EQ(Offliner::SAVED, coordinator()->last_offlining_status());
 
   // TODO(petewil): Expect that the scheduler got notified.
 }
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc
index 32a0b249..80cb5b3 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.cc
+++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -88,12 +88,6 @@
                             AUTO_SIGNIN_PROMO_ACTION_COUNT);
 }
 
-void LogAccountChooserUserAction(AccountChooserUserAction action) {
-  // TODO(vasilii): deprecate the histogram when the new ones hit the Stable.
-  UMA_HISTOGRAM_ENUMERATION("PasswordManager.AccountChooserDialog", action,
-                            ACCOUNT_CHOOSER_ACTION_COUNT);
-}
-
 void LogAccountChooserUserActionOneAccount(AccountChooserUserAction action) {
   UMA_HISTOGRAM_ENUMERATION("PasswordManager.AccountChooserDialogOneAccount",
                             action, ACCOUNT_CHOOSER_ACTION_COUNT);
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h
index 038d7db..e7b2ddb 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.h
+++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -173,7 +173,6 @@
 void LogAutoSigninPromoUserAction(AutoSigninPromoUserAction action);
 
 // Log a user action on showing the account chooser for one or many accounts.
-void LogAccountChooserUserAction(AccountChooserUserAction action);
 void LogAccountChooserUserActionOneAccount(AccountChooserUserAction action);
 void LogAccountChooserUserActionManyAccounts(AccountChooserUserAction action);
 
diff --git a/components/resources/BUILD.gn b/components/resources/BUILD.gn
index 97034c1a..6f2f2a1 100644
--- a/components/resources/BUILD.gn
+++ b/components/resources/BUILD.gn
@@ -3,8 +3,10 @@
 # found in the LICENSE file.
 
 import("//tools/grit/grit_rule.gni")
+import("//third_party/brotli/brotli.gni")
 
 about_credits_file = "$target_gen_dir/about_credits.html"
+about_credits_file_bro = "$target_gen_dir/about_credits.bro"
 
 # GYP version: components/components_resources.gyp:components_resources
 group("resources") {
@@ -29,11 +31,11 @@
 
   grit_flags = [
     "-E",
-    "about_credits_file=" + rebase_path(about_credits_file, root_build_dir),
+    "about_credits_file=" + rebase_path(about_credits_file_bro, root_build_dir),
   ]
 
   deps = [
-    ":about_credits",
+    ":compressed_about_credits",
   ]
 }
 
@@ -55,6 +57,14 @@
   output_dir = "$root_gen_dir/components"
 }
 
+compress_file_brotli("compressed_about_credits") {
+  input_file = about_credits_file
+  output_file = about_credits_file_bro
+  deps = [
+    ":about_credits",
+  ]
+}
+
 # GYP version: components/components_resources.gyp:about_credits
 action("about_credits") {
   script = "//tools/licenses.py"
diff --git a/components/test/data/password_manager/form_annotation_extension/README b/components/test/data/password_manager/form_annotation_extension/README
new file mode 100644
index 0000000..609ee3f
--- /dev/null
+++ b/components/test/data/password_manager/form_annotation_extension/README
@@ -0,0 +1,26 @@
+This extension generates Python scripts for testing form classifier in Chrome.
+
+0. Set the list of sites to be visited in "sites_to_visit.js" and the value of
+IS_PWD_CREATION_VALUE in "background.js".
+1. Install the extension into Chrome as an unpacked extension on 
+chrome://extensions (don't forget to turn on "Developer mode" on this page).
+2. Open background page. Open the Console in Developer tools on the
+background page.
+3. Back to the main window and click on the extension icon that is on the right
+from the address bar. The extension will get the first site.
+4. Click on page elements to go to the sigin/signup form. If some element 
+appears after hovering over another element, click on the latter. The extenstion
+logs only clicks, but not mouse movement.
+5. Click on the password field. The extension will output a Python test for the
+current site and will get the next site.
+6. Repeat steps 4-5 till all sites have been visited.
+7. You can output the tests for all sites you visited, if you print the value
+of the variable "all_tests" in background page's console.
+8. Copy the generated code into the source code of the form classifier tests
+(components/test/data/password_manager/form_classification_tests).
+
+You might also visit arbitrary sites. Just go to a site, reach the form and 
+put focus into password field. The backgound page will output a Python test to
+the console, but then the extension will get to the next unvisited site.
+
+See this video for more info: goo.gl/nDTIOc.
\ No newline at end of file
diff --git a/components/test/data/password_manager/form_annotation_extension/background.js b/components/test/data/password_manager/form_annotation_extension/background.js
new file mode 100644
index 0000000..be78ca4
--- /dev/null
+++ b/components/test/data/password_manager/form_annotation_extension/background.js
@@ -0,0 +1,177 @@
+// Copyright 2016 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.
+
+/**
+ * The identation for generated Python code.
+ *
+ * @type {string}
+ */
+var IDENT_PAD = '  ';
+
+/**
+ * If the extension should generate Python code for signup or change password
+ * forms, then this value should be 'True' (i.e. it will be expected that
+ * password generation will be offered on the given field). Otherwise, the value
+ * should be 'False'.
+ *
+ * @type {string}
+ */
+var IS_PWD_CREATION_VALUE = 'False';
+
+/**
+ * Used by the extension to store the steps that user performs to reach
+ * a password form (signin or signup).
+ *
+ * When the user is reaching the form, the extension saves to the array the
+ * URLs of visited pages, clicked elements' CSS selectors and other stuff.
+ * When the user has reached the form, the extension converts the array to
+ * Python test code and clears the array (before visiting the next site).
+ *
+ * @type {Array}
+ */
+var steps = [];
+
+/**
+ * The index of the last visited site from |sites_to_visit| (sites_to_visit.js).
+ *
+ * @type {number}
+ */
+var last_visited_site_index = 0;
+
+/**
+ * Generated Python tests.
+ *
+ * A test is printed to the background page's console right after the user click
+ * on the password field. The test is also appended to this variable to be able
+ * to print all generated tests at once.
+ * Attention: if the extension is reloaded, the variable is cleared. So, print
+ * the variable and save the generated tests before extension reload,
+ * browser closing or so.
+ *
+ * @type {string}
+ */
+var all_tests = '\n';
+
+/**
+ * Return the name of the test based on the form's url |url|
+ * (e.g. http://login.example.com/path => test_login_example_com).
+ *
+ * @param {string} url The form's url.
+ * @return {string} The test name.
+ */
+function getTestName(url) {
+  var a = document.createElement('a');
+  a.href = url;
+  return 'test_' + a.hostname.split(/[.-]+/).join('_');
+}
+
+/**
+ * Removes query and anchor from |url|
+ * (e.g. https://example.com/path?query=1#anchor => https://example.com/path).
+ *
+ * @param {string} url The full url to be processed.
+ * @return {string} The url w/o parameters and anchors.
+ */
+function stripUrl(url) {
+  var a = document.createElement('a');
+  a.href = url;
+  return a.origin + a.pathname;
+}
+
+/**
+ * Removes the elements before the first element in |steps| that might be the
+ * first in Python script (i.e. it is possible to go to its url and find needed
+ * element). See |couldBeFirstPageOfScript| on content.js for clarification.
+ *
+ * @param {Array} steps The steps to reach the password field.
+ * @return {Array} Reduced list of steps.
+ */
+function removeUnnecessarySteps(steps) {
+  var n = steps.length;
+  var result = [];
+  for (var i = n - 1; i >= 0; i--) {
+    result.unshift(steps[i]);
+    if (steps[i].couldBeFirst) {
+      break;
+    }
+  }
+  return result;
+}
+
+/**
+ * Generate python code to switch to another frame.
+ *
+ * @param {Object} step A step of the script.
+ * @return {string} Python code that performs frame switching.
+ */
+function switchToIframeIfNecessary(step) {
+  var result = '';
+  for (var i = 0; i < step.frames.length; i++) {
+     result += IDENT_PAD + IDENT_PAD + 'self.SwitchTo(\'' + step.frames[i] +
+         '\')\n';
+  }
+  return result;
+}
+
+/**
+ * Outputs to the console the code of a Python test based on script steps
+ * accumulated in |steps|. Also appends the test code to |all_tests|.
+ */
+function outputPythonTestCode() {
+  var lastStepUrl = stripUrl(steps[steps.length - 1].url);
+  var test = '';
+  test += IDENT_PAD + 'def ' + getTestName(steps[steps.length - 1].url) +
+      '(self):\n';
+  steps = removeUnnecessarySteps(steps);
+  test += IDENT_PAD + IDENT_PAD + 'self.GoTo("' + stripUrl(steps[0].url) +
+      '")\n';
+  for (var i = 0; i <= steps.length - 2; i++) {
+    test += switchToIframeIfNecessary(steps[i]);
+    test += IDENT_PAD + IDENT_PAD + 'self.Click("' + steps[i].selector + '")\n';
+  }
+  test += switchToIframeIfNecessary(steps[steps.length - 1]);
+
+  test +=
+      IDENT_PAD + IDENT_PAD + 'self.CheckPwdField("' +
+      steps[steps.length - 1].selector + '", ' +
+      'is_pwd_creation=' + IS_PWD_CREATION_VALUE + ')\n';
+  test += '\n';
+
+  console.log(test);
+  all_tests += test;
+  steps = [];
+}
+
+/**
+ * Moves the current tab to the next site.
+ */
+function visitNextSite() {
+  console.log('next site: ' + sites_to_visit[last_visited_site_index] + ' ' +
+              last_visited_site_index);
+  chrome.tabs.update(
+      {url: 'http://' + sites_to_visit[last_visited_site_index]});
+  steps = [];
+  last_visited_site_index += 1;
+}
+
+/**
+ * Add listener for messages from content script.
+ */
+chrome.runtime.onMessage.addListener(
+  function(request, sender, sendResponse) {
+    steps.push(request);
+    // If the user clicked on the password field, output a Python test and go to
+    // the next site.
+    if (request.isPwdField) {
+      outputPythonTestCode();
+      visitNextSite();
+    }
+});
+
+/**
+ * Add listener for browser action (i.e. click on the icon of the extension).
+ */
+chrome.browserAction.onClicked.addListener(function(tab) {
+  visitNextSite();
+});
diff --git a/components/test/data/password_manager/form_annotation_extension/content.js b/components/test/data/password_manager/form_annotation_extension/content.js
new file mode 100644
index 0000000..5990a9f
--- /dev/null
+++ b/components/test/data/password_manager/form_annotation_extension/content.js
@@ -0,0 +1,209 @@
+// Copyright 2016 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.
+
+/**
+ * Find one or two CSS classes in the class list |list| that uniquely identify
+ * the element in the document |doc|.
+ * If the two classes are not enough to uniquely identify the element, chooses
+ * two classes that minimize the number of elements (that have these classes).
+ *
+ * @param {string} list The class list of the element to be uniquely identified.
+ * @param {Document} doc The owner document of the element.
+ * @return {string} One or two class names joined with a space.
+ */
+function reduceClassName(list, doc) {
+  var minCount = 1000000;
+  var minCountClasses = '';
+  for (i = 0; i < list.length; i++) {
+    var className = list.item(i);
+    var count = doc.getElementsByClassName(className).length;
+    if (count == 1)
+      return '.' + className;
+    if (count < minCount) {
+      minCount = count;
+      minCountClasses = '.' + className;
+    }
+  }
+  for (i = 0; i < list.length; i++) {
+    var className1 = list.item(i);
+    for (j = 0; j < list.length; j++) {
+      var className2 = list.item(j);
+      var count =
+          doc.getElementsByClassName(className1 + ' ' + className2).length;
+      if (count == 1)
+        return '.' + className1 + '.' + className2;
+      if (count < minCount) {
+        minCount = count;
+        minCountClasses = '.' + className1 + '.' + className2;
+      }
+    }
+  }
+  return minCountClasses;
+}
+
+/**
+ * For the given element |elem|, returns the number of previous siblings that
+ * have LI tag.
+ *
+ * @param {Element} elem The element siblings of which should be counted.
+ * @return {number} The number of siblings with LI tag.
+ */
+function getIndexInChildrenList(elem) {
+  var result = 1;
+  var sibling = elem.previousSibling;
+  while (sibling) {
+    if (sibling.tagName == 'LI')
+      result++;
+    sibling = sibling.previousSibling;
+  }
+  return result;
+}
+
+/**
+ * Returns compact CSS selector that uniquely identifies |elem|.
+ * MOST IMPORTANT part in the extension. By a number of heuristics, it creates
+ * a CSS selector that would be persistent to web page changes (e.g. full path
+ * to the element |elem| is a bad idea), but allows to find element |elem|.
+ * TODO(crbug.com/614649): sometimes it fails to build unique selector. Fix it.
+ *
+ * @param {Element} elem The element which CSS selector should be created.
+ * @return {string} CSS selector of the element.
+ */
+function getSmartSelector(elem) {
+  var doc = elem.ownerDocument;
+  var result = elem.tagName;
+
+  if (elem.id)
+    result += "[id='" + elem.id + "']";  // Works for IDs started with a digit.
+  if (elem.name)
+    result += "[name='" + elem.name + "']";
+  if (elem.tagName == 'INPUT' && elem.type)
+    result += "[type='" + elem.type + "']";
+  if (elem.classList.length > 0)
+    result += reduceClassName(elem.classList, doc);
+  if (elem.tagName == 'LI')
+    result += ':nth-child(' + getIndexInChildrenList(elem) + ')';
+
+  // If failed to build a unique selector for |elem|, try to add the parent CSS
+  // selector.
+  if (doc.querySelectorAll(result).length != 1) {
+    if (elem.parentElement) {
+      var parentSelector = getSmartSelector(elem.parentElement);
+      if (parentSelector) {
+        return parentSelector + ' > ' + result;
+      }
+    }
+    console.error('failed to build unique css selector ' + result + ': ' +
+        doc.querySelectorAll(result));
+    return '';
+  } else {
+    return result;
+  }
+}
+
+/**
+ * Returns CSS selectors of parent frames.
+ * Doesn't work for cross-domain iframes. TODO(crbug.com/614651): Chrome
+ * extensions should be able to process cross-domain stuff. Fix it.
+ *
+ * @param {Element} elem The element which parent frames should be returned.
+ * @return {Array} The array of CSS selectors of parent frames.
+ */
+function getFrames(elem) {
+  frames = [];
+  while (elem.ownerDocument.defaultView != top) {
+    var frameElement = elem.ownerDocument.defaultView.frameElement;
+    if (!frameElement) {
+      console.error('frameElement is null. Unable to fetch data about iframes');
+      break;
+    }
+    var iframe_selector = getSmartSelector(frameElement);
+    frames.unshift(iframe_selector);
+    elem = elem.ownerDocument.defaultView.frameElement;
+  }
+  return frames;
+}
+
+/**
+ * Returns true if |element| is probably a clickable element.
+ *
+ * @param {Element} element The element to be checked.
+ * @return {boolean} True if the element is probably clickable.
+ */
+function isClickableElementOrInput(element) {
+  return (element.tagName == 'INPUT' || element.tagName == 'A' ||
+      element.tagName == 'BUTTON' || element.tagName == 'SUBMIT' ||
+      element.getAttribute('href'));
+}
+
+/**
+ * Returns |element|, if |element| is clickable element. Othrewise, returns
+ * clickable children or parent of the given element |element|.
+ * Font element might consume a user click, but Chrome Driver will be unable to
+ * click on the font element, so find really clickable element to perform click.
+ *
+ * @param {Element} element The element where a clickable tag should be find.
+ * @return {Element} The clicable element.
+ */
+function fixElementSelection(element) {
+  if (isClickableElementOrInput(element))
+    return element;
+  var clickableChildren = element.querySelectorAll(
+      ':scope input, :scope a, :scope button, :scope submit, :scope [href]');
+  if (clickableChildren.length > 0)
+    return clickableChildren[0];
+  var parent = element;
+  for (var i = 0; i < 5; i++) {
+    parent = parent.parentElement;
+    if (!parent)
+      break;
+    if (isClickableElementOrInput(parent))
+      return parent;
+  }
+  return element;
+}
+
+/**
+ * Check if it is possible to fetch the owner document of |elem| and find |elem|
+ * there.
+ * Sometimes getting to the form require a number of steps. So, keeping just URL
+ * of the last step is not enough. This function checks if it is possible to
+ * start with the |elem.ownerDocument.URL|.
+ *
+ * @param {Element} elem The element to be checked.
+ * @param {string} selector The CSS selector of |elem|.
+ * @return {boolean} True, if it is possible find an element with CSS selector
+ *    |selector| on |elem.ownerDocument.URL|.
+ */
+function couldBeFirstStepOfScript(elem, selector) {
+  try {
+    var xmlHttp = new XMLHttpRequest();
+    xmlHttp.open('GET', elem.ownerDocument.URL,
+                 false /* false for synchronous request */);
+    xmlHttp.send();
+    var wrapper = document.createElement('html');
+    wrapper.innerHTML = xmlHttp.responseText;
+    var e = wrapper.querySelector(selector);
+    return e && (e.offsetWidth * e.offsetHeight > 0);
+  } catch (err) {
+    return false;
+  }
+}
+
+/**
+ * Add click listener.
+ */
+document.addEventListener('click', function(event) {
+  var element = fixElementSelection(event.target);
+  var url = element.ownerDocument.URL;
+  var isPwdField = (element.tagName == 'INPUT') && (element.type == 'password');
+  var selector = getSmartSelector(element);
+  var frames = getFrames(element);
+  var classifierOutcome = element.hasAttribute('pm_debug_pwd_creation_field');
+  var couldBeFirst = couldBeFirstStepOfScript(element, selector);
+  chrome.runtime.sendMessage(
+    {isPwdField: isPwdField, selector: selector, url: url, frames: frames,
+     couldBeFirst: couldBeFirst, classifierOutcome: classifierOutcome},
+    function(response) {});
+}, true);
diff --git a/components/test/data/password_manager/form_annotation_extension/manifest.json b/components/test/data/password_manager/form_annotation_extension/manifest.json
new file mode 100644
index 0000000..5fbaafb4
--- /dev/null
+++ b/components/test/data/password_manager/form_annotation_extension/manifest.json
@@ -0,0 +1,21 @@
+{
+  "manifest_version": 2,
+  
+  "name": "Forms annotating extension",
+  "version": "1.0",
+
+  "browser_action": {
+    "default_title": "Next site"
+  },
+  "background": {
+    "scripts": ["background.js", "sites_to_visit.js"],
+    "persistent": false
+  },
+  "content_scripts": [
+    {
+      "matches": ["<all_urls>"],
+      "js": ["content.js"],
+      "all_frames": true
+    }
+  ]
+}
\ No newline at end of file
diff --git a/components/test/data/password_manager/form_annotation_extension/sites_to_visit.js b/components/test/data/password_manager/form_annotation_extension/sites_to_visit.js
new file mode 100644
index 0000000..6b6e1b60
--- /dev/null
+++ b/components/test/data/password_manager/form_annotation_extension/sites_to_visit.js
@@ -0,0 +1,119 @@
+// Copyright 2016 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.
+
+// The list of sites to generate Python tests for.
+var sites_to_visit = [
+'360.cn',
+'9gag.com',
+'adf.ly',
+'adobe.com',
+'adsterra.com',
+'allegro.pl',
+'amazon.com',
+'aol.com',
+'apple.com',
+'baidu.com',
+'bet365.com',
+'blogs.forbes.com',
+'cnet.com',
+'csdn.net',
+'detik.com',
+'ebay.com',
+'email.163.com',
+'en.softonic.com',
+'eui.orange.fr',
+'feedly.com',
+'flickr.com',
+'gfycat.com',
+'github.com',
+'globo.com',
+'gmx.net',
+'godaddy.com',
+'google.com',
+'i.360.cn',
+'id.ifeng.com',
+'imdb.com',
+'imgur.com',
+'indeed.com',
+'instagram.com',
+'jd.com',
+'kakaku.com',
+'kat.cr',
+'linkedin.com',
+'live.com',
+'mail.ru',
+'mega.nz',
+'member.livedoor.com',
+'my.outbrain.com',
+'naver.com',
+'naver.jp',
+'netflix.com',
+'passport.bilibili.com',
+'passport.china.com',
+'passport.twitch.tv',
+'paypal.com',
+'pinterest.com',
+'pixnet.cc',
+'qq.com',
+'rakuten.co.jp',
+'reddit.com',
+'signup.live.com',
+'sina.com',
+'skype.com',
+'sohu.com',
+'soundcloud.com',
+'ssl.bbc.com',
+'ssl.bbc.com',
+'stackexchange.com',
+'stackoverflow.com',
+'steampowered.com',
+'store.steampowered.com',
+'theguardian.com',
+'thepiratebay.se',
+'torrentz.eu',
+'tudou.com',
+'tumblr.com',
+'twitter.com',
+'udn.com',
+'uptodown.com',
+'vimeo.com',
+'web.de',
+'weibo.com',
+'wikipedia.org',
+'www.avito.ru',
+'www.babytree.com',
+'www.booking.com',
+'www.buzzfeed.com',
+'www.dailymail.co.uk',
+'www.deviantart.com',
+'www.dmm.com',
+'www.douyu.com',
+'www.dropbox.com',
+'www.etsy.com',
+'www.facebook.com',
+'www.foxnews.com',
+'www.homedepot.com',
+'www.iqiyi.com',
+'www.linkedin.com',
+'www.livejournal.com',
+'www.mediafire.com',
+'www.nytimes.com',
+'www.popads.net',
+'www.quora.com',
+'www.slideshare.net',
+'www.so.com',
+'www.sunmaker.com',
+'www.tianya.cn',
+'www.tribunnews.com',
+'www.tripadvisor.com',
+'www.walmart.com',
+'www.wikia.com',
+'www.wikihow.com',
+'www.wittyfeed.com',
+'www.yelp.com',
+'www.zillow.com',
+'yahoo.com',
+'yandex.ru',
+'youku.com',
+'zol.com.cn'];
diff --git a/components/tracing/graphics_memory_dump_provider_android.cc b/components/tracing/graphics_memory_dump_provider_android.cc
index da216173..26b57856 100644
--- a/components/tracing/graphics_memory_dump_provider_android.cc
+++ b/components/tracing/graphics_memory_dump_provider_android.cc
@@ -39,6 +39,10 @@
 bool GraphicsMemoryDumpProvider::OnMemoryDump(
     const base::trace_event::MemoryDumpArgs& args,
     base::trace_event::ProcessMemoryDump* pmd) {
+  if (args.level_of_detail !=
+      base::trace_event::MemoryDumpLevelOfDetail::DETAILED)
+    return true;  // Dump on detailed memory dumps only.
+
   const char kAbstractSocketName[] = "chrome_tracing_memtrack_helper";
   struct sockaddr_un addr;
 
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index bb27e53..c891057 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -52,7 +52,7 @@
 
 namespace cc {
 class CompositorFrame;
-struct SurfaceId;
+class SurfaceId;
 struct SurfaceSequence;
 }  // namespace cc
 
diff --git a/content/browser/frame_host/cross_process_frame_connector.h b/content/browser/frame_host/cross_process_frame_connector.h
index b913399..214858aa 100644
--- a/content/browser/frame_host/cross_process_frame_connector.h
+++ b/content/browser/frame_host/cross_process_frame_connector.h
@@ -19,7 +19,7 @@
 }
 
 namespace cc {
-struct SurfaceId;
+class SurfaceId;
 struct SurfaceSequence;
 }
 
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 81931e4b..cd0d68a1c 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -18,6 +18,7 @@
 #include "content/common/content_constants_internal.h"
 #include "content/common/navigation_params.h"
 #include "content/common/page_state_serialization.h"
+#include "content/common/resource_request_body.h"
 #include "content/common/site_isolation_policy.h"
 #include "content/public/common/browser_side_navigation_policy.h"
 #include "content/public/common/content_constants.h"
@@ -569,8 +570,22 @@
   return copy;
 }
 
+scoped_refptr<ResourceRequestBody>
+NavigationEntryImpl::ConstructBodyFromBrowserInitiatedPostData() const {
+  scoped_refptr<ResourceRequestBody> browser_initiated_post_body;
+  if (GetHasPostData()) {
+    if (const base::RefCountedMemory* memory = GetBrowserInitiatedPostData()) {
+      browser_initiated_post_body = new ResourceRequestBody();
+      browser_initiated_post_body->AppendBytes(memory->front_as<char>(),
+                                               memory->size());
+    }
+  }
+  return browser_initiated_post_body;
+}
+
 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
     const FrameNavigationEntry& frame_entry,
+    const scoped_refptr<ResourceRequestBody>& post_body,
     const GURL& dest_url,
     const Referrer& dest_referrer,
     FrameMsg_Navigate_Type::Value navigation_type,
@@ -592,26 +607,19 @@
   if (IsBrowserSideNavigationEnabled())
     method = frame_entry.method();
   else
-    method = GetHasPostData() ? "POST" : "GET";
+    method = (post_body.get() || GetHasPostData()) ? "POST" : "GET";
 
   return CommonNavigationParams(
       dest_url, dest_referrer, GetTransitionType(), navigation_type,
       !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type,
       GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state,
-      navigation_start, method);
+      navigation_start, method,
+      post_body ? post_body : ConstructBodyFromBrowserInitiatedPostData());
 }
 
 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams()
     const {
-  std::vector<unsigned char> browser_initiated_post_data;
-  if (GetBrowserInitiatedPostData()) {
-    browser_initiated_post_data.assign(
-        GetBrowserInitiatedPostData()->front(),
-        GetBrowserInitiatedPostData()->front() +
-            GetBrowserInitiatedPostData()->size());
-  }
-
-  return StartNavigationParams(extra_headers(), browser_initiated_post_data,
+  return StartNavigationParams(extra_headers(),
 #if defined(OS_ANDROID)
                                has_user_gesture(),
 #endif
diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h
index d2b34d3..313f03b 100644
--- a/content/browser/frame_host/navigation_entry_impl.h
+++ b/content/browser/frame_host/navigation_entry_impl.h
@@ -23,6 +23,7 @@
 #include "content/public/common/ssl_status.h"
 
 namespace content {
+class ResourceRequestBody;
 struct CommonNavigationParams;
 struct RequestNavigationParams;
 struct StartNavigationParams;
@@ -159,8 +160,11 @@
 
   // Helper functions to construct NavigationParameters for a navigation to this
   // NavigationEntry.
+  scoped_refptr<ResourceRequestBody> ConstructBodyFromBrowserInitiatedPostData()
+      const;
   CommonNavigationParams ConstructCommonNavigationParams(
       const FrameNavigationEntry& frame_entry,
+      const scoped_refptr<ResourceRequestBody>& post_body,
       const GURL& dest_url,
       const Referrer& dest_referrer,
       FrameMsg_Navigate_Type::Value navigation_type,
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index b8ef2b1..0095578 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -83,20 +83,12 @@
 
   // Fill POST data in the request body.
   scoped_refptr<ResourceRequestBody> request_body;
-  if (frame_entry.method() == "POST") {
+  if (frame_entry.method() == "POST")
     request_body = frame_entry.GetPostData();
-    if (!request_body && entry.GetBrowserInitiatedPostData()) {
-      request_body = new ResourceRequestBody();
-      request_body->AppendBytes(
-          reinterpret_cast<const char*>(
-              entry.GetBrowserInitiatedPostData()->front()),
-          entry.GetBrowserInitiatedPostData()->size());
-    }
-  }
 
   std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
       frame_tree_node, entry.ConstructCommonNavigationParams(
-                           frame_entry, dest_url, dest_referrer,
+                           frame_entry, request_body, dest_url, dest_referrer,
                            navigation_type, lofi_state, navigation_start),
       BeginNavigationParams(headers.ToString(),
                             LoadFlagFromNavigationType(navigation_type),
@@ -110,7 +102,7 @@
           controller->GetIndexOfEntry(&entry),
           controller->GetLastCommittedEntryIndex(),
           controller->GetEntryCount()),
-      request_body, true, &frame_entry, &entry));
+      true, &frame_entry, &entry));
   return navigation_request;
 }
 
@@ -119,7 +111,6 @@
     FrameTreeNode* frame_tree_node,
     const CommonNavigationParams& common_params,
     const BeginNavigationParams& begin_params,
-    scoped_refptr<ResourceRequestBody> body,
     int current_history_list_offset,
     int current_history_list_length) {
   // TODO(clamy): Check if some PageState should be provided here.
@@ -145,7 +136,7 @@
       false);                  // should_clear_history_list
   std::unique_ptr<NavigationRequest> navigation_request(
       new NavigationRequest(frame_tree_node, common_params, begin_params,
-                            request_params, body, false, nullptr, nullptr));
+                            request_params, false, nullptr, nullptr));
   return navigation_request;
 }
 
@@ -154,7 +145,6 @@
     const CommonNavigationParams& common_params,
     const BeginNavigationParams& begin_params,
     const RequestNavigationParams& request_params,
-    scoped_refptr<ResourceRequestBody> body,
     bool browser_initiated,
     const FrameNavigationEntry* frame_entry,
     const NavigationEntryImpl* entry)
@@ -167,7 +157,6 @@
       restore_type_(NavigationEntryImpl::RESTORE_NONE),
       is_view_source_(false),
       bindings_(NavigationEntryImpl::kInvalidBindings),
-      post_data_(body),
       associated_site_instance_type_(AssociatedSiteInstanceType::NONE) {
   DCHECK(!browser_initiated || (entry != nullptr && frame_entry != nullptr));
   if (browser_initiated) {
@@ -200,7 +189,7 @@
   info_.reset(new NavigationRequestInfo(
       common_params, begin_params, first_party_for_cookies,
       frame_tree_node->current_origin(), frame_tree_node->IsMainFrame(),
-      parent_is_main_frame, frame_tree_node->frame_tree_node_id(), body));
+      parent_is_main_frame, frame_tree_node->frame_tree_node_id()));
 }
 
 NavigationRequest::~NavigationRequest() {
@@ -264,7 +253,7 @@
     const scoped_refptr<ResourceResponse>& response) {
   // If the navigation is no longer a POST, the POST data should be reset.
   if (redirect_info.new_method != "POST")
-    post_data_ = nullptr;
+    common_params_.post_data = nullptr;
 
   common_params_.url = redirect_info.new_url;
   common_params_.method = redirect_info.new_method;
@@ -435,7 +424,7 @@
   TransferNavigationHandleOwnership(render_frame_host);
   render_frame_host->CommitNavigation(response_.get(), std::move(body_),
                                       common_params_, request_params_,
-                                      is_view_source_, post_data_);
+                                      is_view_source_);
 
   // When navigating to a Javascript url, the NavigationRequest is not stored
   // in the FrameTreeNode. Therefore do not reset it, as this could cancel an
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
index 1f4994a..30e9b2f6 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -92,7 +92,6 @@
       FrameTreeNode* frame_tree_node,
       const CommonNavigationParams& common_params,
       const BeginNavigationParams& begin_params,
-      scoped_refptr<ResourceRequestBody> body,
       int current_history_list_offset,
       int current_history_list_length);
 
@@ -166,7 +165,6 @@
                     const CommonNavigationParams& common_params,
                     const BeginNavigationParams& begin_params,
                     const RequestNavigationParams& request_params,
-                    scoped_refptr<ResourceRequestBody> body,
                     bool browser_initiated,
                     const FrameNavigationEntry* frame_navigation_entry,
                     const NavigationEntryImpl* navitation_entry);
@@ -230,9 +228,6 @@
   bool is_view_source_;
   int bindings_;
 
-  // This is kept to be sent to the renderer on commit.
-  scoped_refptr<ResourceRequestBody> post_data_;
-
   // The type of SiteInstance associated with this navigation.
   AssociatedSiteInstanceType associated_site_instance_type_;
 
diff --git a/content/browser/frame_host/navigation_request_info.cc b/content/browser/frame_host/navigation_request_info.cc
index 5bfd979a..6b01863 100644
--- a/content/browser/frame_host/navigation_request_info.cc
+++ b/content/browser/frame_host/navigation_request_info.cc
@@ -14,16 +14,14 @@
     const url::Origin& request_initiator,
     bool is_main_frame,
     bool parent_is_main_frame,
-    int frame_tree_node_id,
-    scoped_refptr<ResourceRequestBody> request_body)
+    int frame_tree_node_id)
     : common_params(common_params),
       begin_params(begin_params),
       first_party_for_cookies(first_party_for_cookies),
       request_initiator(request_initiator),
       is_main_frame(is_main_frame),
       parent_is_main_frame(parent_is_main_frame),
-      frame_tree_node_id(frame_tree_node_id),
-      request_body(request_body) {}
+      frame_tree_node_id(frame_tree_node_id) {}
 
 NavigationRequestInfo::~NavigationRequestInfo() {}
 
diff --git a/content/browser/frame_host/navigation_request_info.h b/content/browser/frame_host/navigation_request_info.h
index ef677db4..9244818 100644
--- a/content/browser/frame_host/navigation_request_info.h
+++ b/content/browser/frame_host/navigation_request_info.h
@@ -28,8 +28,7 @@
                         const url::Origin& request_initiator,
                         bool is_main_frame,
                         bool parent_is_main_frame,
-                        int frame_tree_node_id,
-                        scoped_refptr<ResourceRequestBody> request_body);
+                        int frame_tree_node_id);
   ~NavigationRequestInfo();
 
   const CommonNavigationParams common_params;
@@ -46,8 +45,6 @@
   const bool parent_is_main_frame;
 
   const int frame_tree_node_id;
-
-  scoped_refptr<ResourceRequestBody> request_body;
 };
 
 }  // namespace content
diff --git a/content/browser/frame_host/navigator.cc b/content/browser/frame_host/navigator.cc
index ac6c248..c2eec4b 100644
--- a/content/browser/frame_host/navigator.cc
+++ b/content/browser/frame_host/navigator.cc
@@ -35,11 +35,8 @@
   return base::TimeTicks::Now();
 }
 
-void Navigator::OnBeginNavigation(
-    FrameTreeNode* frame_tree_node,
-    const CommonNavigationParams& common_params,
-    const BeginNavigationParams& begin_params,
-    scoped_refptr<ResourceRequestBody> body) {
-}
+void Navigator::OnBeginNavigation(FrameTreeNode* frame_tree_node,
+                                  const CommonNavigationParams& common_params,
+                                  const BeginNavigationParams& begin_params) {}
 
 }  // namespace content
diff --git a/content/browser/frame_host/navigator.h b/content/browser/frame_host/navigator.h
index ce1c97d..9dfe024 100644
--- a/content/browser/frame_host/navigator.h
+++ b/content/browser/frame_host/navigator.h
@@ -142,11 +142,9 @@
   // PlzNavigate
   // Used to start a new renderer-initiated navigation, following a
   // BeginNavigation IPC from the renderer.
-  virtual void OnBeginNavigation(
-      FrameTreeNode* frame_tree_node,
-      const CommonNavigationParams& common_params,
-      const BeginNavigationParams& begin_params,
-      scoped_refptr<ResourceRequestBody> body);
+  virtual void OnBeginNavigation(FrameTreeNode* frame_tree_node,
+                                 const CommonNavigationParams& common_params,
+                                 const BeginNavigationParams& begin_params);
 
   // PlzNavigate
   // Called when a NavigationRequest for |frame_tree_node| failed. An
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 71453f0..961b37d 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -387,7 +387,7 @@
       FrameMsg_Navigate_Type::Value navigation_type = GetNavigationType(
           controller_->GetBrowserContext(), entry, reload_type);
       dest_render_frame_host->Navigate(
-          entry.ConstructCommonNavigationParams(frame_entry, dest_url,
+          entry.ConstructCommonNavigationParams(frame_entry, nullptr, dest_url,
                                                 dest_referrer, navigation_type,
                                                 lofi_state, navigation_start),
           entry.ConstructStartNavigationParams(),
@@ -860,8 +860,7 @@
 void NavigatorImpl::OnBeginNavigation(
     FrameTreeNode* frame_tree_node,
     const CommonNavigationParams& common_params,
-    const BeginNavigationParams& begin_params,
-    scoped_refptr<ResourceRequestBody> body) {
+    const BeginNavigationParams& begin_params) {
   // TODO(clamy): the url sent by the renderer should be validated with
   // FilterURL.
   // This is a renderer-initiated navigation.
@@ -889,7 +888,7 @@
   // NavigationRequest is created for the node.
   frame_tree_node->CreatedNavigationRequest(
       NavigationRequest::CreateRendererInitiated(
-          frame_tree_node, common_params, begin_params, body,
+          frame_tree_node, common_params, begin_params,
           controller_->GetLastCommittedEntryIndex(),
           controller_->GetEntryCount()));
   NavigationRequest* navigation_request = frame_tree_node->navigation_request();
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index 14958713..d760f7c 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -80,8 +80,7 @@
   void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override;
   void OnBeginNavigation(FrameTreeNode* frame_tree_node,
                          const CommonNavigationParams& common_params,
-                         const BeginNavigationParams& begin_params,
-                         scoped_refptr<ResourceRequestBody> body) override;
+                         const BeginNavigationParams& begin_params) override;
   void FailedNavigation(FrameTreeNode* frame_tree_node,
                         bool has_stale_copy_in_cache,
                         int error_code) override;
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index a22c5e0..f7d3b40 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1644,13 +1644,12 @@
 
 void RenderFrameHostImpl::OnBeginNavigation(
     const CommonNavigationParams& common_params,
-    const BeginNavigationParams& begin_params,
-    scoped_refptr<ResourceRequestBody> body) {
+    const BeginNavigationParams& begin_params) {
   CHECK(IsBrowserSideNavigationEnabled());
   CommonNavigationParams validated_params = common_params;
   GetProcess()->FilterURL(false, &validated_params.url);
   frame_tree_node()->navigator()->OnBeginNavigation(
-      frame_tree_node(), validated_params, begin_params, body);
+      frame_tree_node(), validated_params, begin_params);
 }
 
 void RenderFrameHostImpl::OnDispatchLoad() {
@@ -2100,10 +2099,10 @@
       data_url, Referrer(), ui::PAGE_TRANSITION_LINK,
       FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(),
       FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF,
-      base::TimeTicks::Now(), "GET");
+      base::TimeTicks::Now(), "GET", nullptr);
   if (IsBrowserSideNavigationEnabled()) {
     CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(),
-                     false, nullptr);
+                     false);
   } else {
     Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
   }
@@ -2240,8 +2239,7 @@
     std::unique_ptr<StreamHandle> body,
     const CommonNavigationParams& common_params,
     const RequestNavigationParams& request_params,
-    bool is_view_source,
-    scoped_refptr<ResourceRequestBody> post_data) {
+    bool is_view_source) {
   DCHECK((response && body.get()) ||
           !ShouldMakeNetworkRequestForURL(common_params.url));
   UpdatePermissionsForNavigation(common_params, request_params);
@@ -2262,7 +2260,7 @@
   const ResourceResponseHead head = response ?
       response->head : ResourceResponseHead();
   Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
-                                     request_params, post_data));
+                                     request_params));
 
   // If a network request was made, update the LoFi state.
   if (ShouldMakeNetworkRequestForURL(common_params.url))
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index f3cb4189..420a2c27 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -496,8 +496,7 @@
                         std::unique_ptr<StreamHandle> body,
                         const CommonNavigationParams& common_params,
                         const RequestNavigationParams& request_params,
-                        bool is_view_source,
-                        scoped_refptr<ResourceRequestBody> post_data);
+                        bool is_view_source);
 
   // PlzNavigate
   // Indicates that a navigation failed and that this RenderFrame should display
@@ -653,8 +652,7 @@
                      blink::WebTextDirection title_direction);
   void OnUpdateEncoding(const std::string& encoding);
   void OnBeginNavigation(const CommonNavigationParams& common_params,
-                         const BeginNavigationParams& begin_params,
-                         scoped_refptr<ResourceRequestBody> body);
+                         const BeginNavigationParams& begin_params);
   void OnDispatchLoad();
   void OnAccessibilityEvents(
       const std::vector<AccessibilityHostMsg_EventParams>& params,
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc
index 8f4a9b9..0de7dd1 100644
--- a/content/browser/loader/navigation_url_loader_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -110,8 +110,7 @@
     common_params.url = url;
     std::unique_ptr<NavigationRequestInfo> request_info(
         new NavigationRequestInfo(common_params, begin_params, url,
-                                  url::Origin(url), true, false, -1,
-                                  scoped_refptr<ResourceRequestBody>()));
+                                  url::Origin(url), true, false, -1));
 
     return NavigationURLLoader::Create(
         browser_context_.get(), std::move(request_info), nullptr, delegate);
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 4de8a08..da256df9 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -2253,15 +2253,14 @@
       GetChromeBlobStorageContextForResourceContext(resource_context));
 
   // Resolve elements from request_body and prepare upload data.
-  if (info.request_body.get()) {
-    AttachRequestBodyBlobDataHandles(
-        info.request_body.get(),
-        blob_context);
+  ResourceRequestBody* body = info.common_params.post_data.get();
+  if (body) {
+    AttachRequestBodyBlobDataHandles(body, blob_context);
     // TODO(davidben): The FileSystemContext is null here. In the case where
     // another renderer requested this navigation, this should be the same
     // FileSystemContext passed into ShouldServiceRequest.
     new_request->set_upload(UploadDataStreamBuilder::Build(
-        info.request_body.get(),
+        body,
         blob_context,
         nullptr,  // file_system_context
         BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
@@ -2326,7 +2325,8 @@
   ServiceWorkerRequestHandler::InitializeForNavigation(
       new_request.get(), service_worker_handle_core, blob_context,
       info.begin_params.skip_service_worker, resource_type,
-      info.begin_params.request_context_type, frame_type, info.request_body);
+      info.begin_params.request_context_type, frame_type,
+      info.common_params.post_data);
 
   // TODO(davidben): Attach AppCacheInterceptor.
 
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 18b98a88..58ab2d1 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -1143,8 +1143,7 @@
       common_params.url = url;
       std::unique_ptr<NavigationRequestInfo> request_info(
           new NavigationRequestInfo(common_params, begin_params, url,
-                                    url::Origin(url), true, false, -1,
-                                    scoped_refptr<ResourceRequestBody>()));
+                                    url::Origin(url), true, false, -1));
       std::unique_ptr<NavigationURLLoader> test_loader =
           NavigationURLLoader::Create(browser_context_.get(),
                                       std::move(request_info), nullptr,
@@ -2610,8 +2609,7 @@
     common_params.url = download_url;
     std::unique_ptr<NavigationRequestInfo> request_info(
         new NavigationRequestInfo(common_params, begin_params, download_url,
-                                  url::Origin(download_url), true, false, -1,
-                                  scoped_refptr<ResourceRequestBody>()));
+                                  url::Origin(download_url), true, false, -1));
     std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create(
         browser_context_.get(), std::move(request_info), nullptr, &delegate);
 
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
index b0ba89f7..6ca1b42bc 100644
--- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
+++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
@@ -75,66 +75,6 @@
   }
 }
 
-void ComputeInputLatencyHistograms(WebInputEvent::Type type,
-                                   int64_t latency_component_id,
-                                   const LatencyInfo& latency) {
-  if (latency.coalesced())
-    return;
-
-  LatencyInfo::LatencyComponent rwh_component;
-  if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
-                           latency_component_id, &rwh_component)) {
-    return;
-  }
-  DCHECK_EQ(rwh_component.event_count, 1u);
-
-  LatencyInfo::LatencyComponent ui_component;
-  if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0,
-                          &ui_component)) {
-    DCHECK_EQ(ui_component.event_count, 1u);
-    base::TimeDelta ui_delta =
-        rwh_component.event_time - ui_component.event_time;
-    switch (type) {
-      case blink::WebInputEvent::MouseWheel:
-        UMA_HISTOGRAM_CUSTOM_COUNTS(
-            "Event.Latency.Browser.WheelUI",
-            ui_delta.InMicroseconds(), 1, 20000, 100);
-        break;
-      case blink::WebInputEvent::TouchTypeFirst:
-        UMA_HISTOGRAM_CUSTOM_COUNTS(
-            "Event.Latency.Browser.TouchUI",
-            ui_delta.InMicroseconds(), 1, 20000, 100);
-        break;
-      default:
-        NOTREACHED();
-        break;
-    }
-  }
-
-  LatencyInfo::LatencyComponent acked_component;
-  if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
-                          &acked_component)) {
-    DCHECK_EQ(acked_component.event_count, 1u);
-    base::TimeDelta acked_delta =
-        acked_component.event_time - rwh_component.event_time;
-    switch (type) {
-      case blink::WebInputEvent::MouseWheel:
-        UMA_HISTOGRAM_CUSTOM_COUNTS(
-            "Event.Latency.Browser.WheelAcked",
-            acked_delta.InMicroseconds(), 1, 1000000, 100);
-        break;
-      case blink::WebInputEvent::TouchTypeFirst:
-        UMA_HISTOGRAM_CUSTOM_COUNTS(
-            "Event.Latency.Browser.TouchAcked",
-            acked_delta.InMicroseconds(), 1, 1000000, 100);
-        break;
-      default:
-        NOTREACHED();
-        break;
-    }
-  }
-}
-
 // Touch to scroll latency that is mostly under 1 second.
 #define UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(name, start, end)               \
   UMA_HISTOGRAM_CUSTOM_COUNTS(                                                \
@@ -287,11 +227,11 @@
     : last_event_id_(0),
       latency_component_id_(0),
       device_scale_factor_(1),
-      has_seen_first_gesture_scroll_update_(false) {
-}
+      has_seen_first_gesture_scroll_update_(false),
+      multi_finger_gesture_(false),
+      touch_start_default_prevented_(false) {}
 
-RenderWidgetHostLatencyTracker::~RenderWidgetHostLatencyTracker() {
-}
+RenderWidgetHostLatencyTracker::~RenderWidgetHostLatencyTracker() {}
 
 void RenderWidgetHostLatencyTracker::Initialize(int routing_id,
                                                 int process_id) {
@@ -301,6 +241,95 @@
   latency_component_id_ = routing_id | last_event_id_;
 }
 
+void RenderWidgetHostLatencyTracker::ComputeInputLatencyHistograms(
+    WebInputEvent::Type type,
+    int64_t latency_component_id,
+    const LatencyInfo& latency,
+    InputEventAckState ack_result) {
+  if (latency.coalesced())
+    return;
+
+  LatencyInfo::LatencyComponent rwh_component;
+  if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
+                           latency_component_id, &rwh_component)) {
+    return;
+  }
+  DCHECK_EQ(rwh_component.event_count, 1u);
+
+  LatencyInfo::LatencyComponent ui_component;
+  if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0,
+                          &ui_component)) {
+    DCHECK_EQ(ui_component.event_count, 1u);
+    base::TimeDelta ui_delta =
+        rwh_component.event_time - ui_component.event_time;
+
+    if (type == blink::WebInputEvent::MouseWheel) {
+      UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.WheelUI",
+                                  ui_delta.InMicroseconds(), 1, 20000, 100);
+
+    } else {
+      DCHECK(WebInputEvent::isTouchEventType(type));
+      UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.TouchUI",
+                                  ui_delta.InMicroseconds(), 1, 20000, 100);
+    }
+  }
+
+  LatencyInfo::LatencyComponent main_component;
+  if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
+                          &main_component)) {
+    DCHECK_EQ(main_component.event_count, 1u);
+    base::TimeDelta queueing_delta =
+        main_component.event_time - rwh_component.event_time;
+    if (type == WebInputEvent::TouchMove && !multi_finger_gesture_) {
+      if (touch_start_default_prevented_ ||
+          ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) {
+        UMA_HISTOGRAM_TIMES(
+            "Event.Latency.QueueingTime.TouchMoveDefaultPrevented",
+            queueing_delta);
+      } else if (ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
+        UMA_HISTOGRAM_TIMES(
+            "Event.Latency.QueueingTime.TouchMoveDefaultAllowed",
+            queueing_delta);
+      }
+    }
+  }
+
+  LatencyInfo::LatencyComponent acked_component;
+  if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0,
+                          &acked_component)) {
+    DCHECK_EQ(acked_component.event_count, 1u);
+    base::TimeDelta acked_delta =
+        acked_component.event_time - rwh_component.event_time;
+    if (type == blink::WebInputEvent::MouseWheel) {
+      UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.WheelAcked",
+                                  acked_delta.InMicroseconds(), 1, 1000000,
+                                  100);
+    } else {
+      DCHECK(WebInputEvent::isTouchEventType(type));
+      UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Browser.TouchAcked",
+                                  acked_delta.InMicroseconds(), 1, 1000000,
+                                  100);
+    }
+
+    if (type == WebInputEvent::TouchMove && !multi_finger_gesture_ &&
+        main_component.event_time != base::TimeTicks()) {
+      base::TimeDelta blocking_delta;
+      blocking_delta = acked_component.event_time - main_component.event_time;
+
+      if (touch_start_default_prevented_ ||
+          ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) {
+        UMA_HISTOGRAM_TIMES(
+            "Event.Latency.BlockingTime.TouchMoveDefaultPrevented",
+            blocking_delta);
+      } else if (ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
+        UMA_HISTOGRAM_TIMES(
+            "Event.Latency.BlockingTime.TouchMoveDefaultAllowed",
+            blocking_delta);
+      }
+    }
+  }
+}
+
 void RenderWidgetHostLatencyTracker::OnInputEvent(
     const blink::WebInputEvent& event,
     LatencyInfo* latency) {
@@ -362,7 +391,7 @@
 
 void RenderWidgetHostLatencyTracker::OnInputEventAck(
     const blink::WebInputEvent& event,
-    LatencyInfo* latency) {
+    LatencyInfo* latency, InputEventAckState ack_result) {
   DCHECK(latency);
 
   // Latency ends when it is acked but does not cause render scheduling.
@@ -381,13 +410,23 @@
   }
 
   if (WebInputEvent::isTouchEventType(event.type)) {
+    const WebTouchEvent& touch_event =
+        *static_cast<const WebTouchEvent*>(&event);
+    if (event.type == WebInputEvent::TouchStart) {
+      DCHECK(touch_event.touchesLength >= 1);
+      multi_finger_gesture_ = touch_event.touchesLength != 1;
+      touch_start_default_prevented_ =
+          ack_result == INPUT_EVENT_ACK_STATE_CONSUMED;
+    }
+
     latency->AddLatencyNumber(ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0);
+
     if (!rendering_scheduled) {
       latency->AddLatencyNumber(
           ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0);
     }
-    ComputeInputLatencyHistograms(WebInputEvent::TouchTypeFirst,
-                                  latency_component_id_, *latency);
+    ComputeInputLatencyHistograms(event.type, latency_component_id_, *latency,
+                                  ack_result);
     return;
   }
 
@@ -397,8 +436,8 @@
       latency->AddLatencyNumber(
           ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_WHEEL_COMPONENT, 0, 0);
     }
-    ComputeInputLatencyHistograms(WebInputEvent::MouseWheel,
-                                  latency_component_id_, *latency);
+    ComputeInputLatencyHistograms(event.type, latency_component_id_, *latency,
+                                  ack_result);
     return;
   }
 
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h
index 633e4e8..f86d628d 100644
--- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.h
+++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.h
@@ -12,6 +12,7 @@
 #include "base/macros.h"
 #include "content/browser/renderer_host/event_with_latency_info.h"
 #include "content/common/content_export.h"
+#include "content/common/input/input_event_ack_state.h"
 #include "ui/events/latency_info.h"
 
 namespace content {
@@ -27,6 +28,11 @@
   // Called once after the RenderWidgetHost is fully initialized.
   void Initialize(int routing_id, int process_id);
 
+  void ComputeInputLatencyHistograms(blink::WebInputEvent::Type type,
+                                     int64_t latency_component_id,
+                                     const ui::LatencyInfo& latency,
+                                     InputEventAckState ack_result);
+
   // Populates the LatencyInfo with relevant entries for latency tracking.
   // Called when an event is received by the RenderWidgetHost, prior to
   // that event being forwarded to the renderer (via the InputRouter).
@@ -38,7 +44,8 @@
   // performing relevant UMA latency reporting. Called when an event is ack'ed
   // to the RenderWidgetHost (from the InputRouter).
   void OnInputEventAck(const blink::WebInputEvent& event,
-                       ui::LatencyInfo* latency);
+                       ui::LatencyInfo* latency,
+                       InputEventAckState ack_result);
 
   // Populates renderer-created LatencyInfo entries with the appropriate latency
   // component id. Called when the RenderWidgetHost receives a compositor swap
@@ -65,6 +72,12 @@
   int64_t latency_component_id_;
   float device_scale_factor_;
   bool has_seen_first_gesture_scroll_update_;
+  // Whether the current stream of touch events has ever included more than one
+  // touch point.
+  bool multi_finger_gesture_;
+  // Whether the touch start for the current stream of touch events had its
+  // default action prevented. Only valid for single finger gestures.
+  bool touch_start_default_prevented_;
 
   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTracker);
 };
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
index 9b757dc8..536fa684 100644
--- a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
+++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
@@ -6,9 +6,12 @@
 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker.h"
 #include "content/common/input/synthetic_web_input_event_builders.h"
 #include "content/public/browser/native_web_keyboard_event.h"
+#include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::Bucket;
 using blink::WebInputEvent;
+using testing::ElementsAre;
 
 namespace content {
 namespace {
@@ -74,6 +77,10 @@
     histogram_tester_.reset(new base::HistogramTester());
   }
 
+  const base::HistogramTester& histogram_tester() {
+    return *histogram_tester_;
+  }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTrackerTest);
   const int kTestRoutingId = 3;
@@ -100,7 +107,8 @@
       EXPECT_TRUE(scroll_latency.FindLatency(
           ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr));
       EXPECT_EQ(1U, scroll_latency.input_coordinates_size());
-      tracker()->OnInputEventAck(scroll, &scroll_latency);
+      tracker()->OnInputEventAck(scroll, &scroll_latency,
+                                 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     }
 
     {
@@ -118,7 +126,8 @@
       EXPECT_TRUE(wheel_latency.FindLatency(
           ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr));
       EXPECT_EQ(1U, wheel_latency.input_coordinates_size());
-      tracker()->OnInputEventAck(wheel, &wheel_latency);
+      tracker()->OnInputEventAck(wheel, &wheel_latency,
+                                 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     }
 
     {
@@ -135,7 +144,8 @@
       EXPECT_TRUE(touch_latency.FindLatency(
           ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr));
       EXPECT_EQ(2U, touch_latency.input_coordinates_size());
-      tracker()->OnInputEventAck(touch, &touch_latency);
+      tracker()->OnInputEventAck(touch, &touch_latency,
+                                 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
       tracker()->OnFrameSwapped(touch_latency);
     }
 
@@ -177,7 +187,8 @@
     // Don't include the rendering schedule component, since we're testing the
     // case where rendering isn't scheduled.
     tracker()->OnInputEvent(scroll, &scroll_latency);
-    tracker()->OnInputEventAck(scroll, &scroll_latency);
+    tracker()->OnInputEventAck(scroll, &scroll_latency,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     EXPECT_TRUE(scroll_latency.FindLatency(
         ui::INPUT_EVENT_LATENCY_TERMINATED_GESTURE_COMPONENT, 0, nullptr));
     EXPECT_TRUE(scroll_latency.terminated());
@@ -189,7 +200,8 @@
     ui::LatencyInfo wheel_latency;
     AddFakeComponents(*tracker(), &wheel_latency);
     tracker()->OnInputEvent(wheel, &wheel_latency);
-    tracker()->OnInputEventAck(wheel, &wheel_latency);
+    tracker()->OnInputEventAck(wheel, &wheel_latency,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     EXPECT_TRUE(wheel_latency.FindLatency(
         ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_WHEEL_COMPONENT, 0, nullptr));
     EXPECT_TRUE(wheel_latency.terminated());
@@ -201,7 +213,8 @@
     ui::LatencyInfo touch_latency;
     AddFakeComponents(*tracker(), &touch_latency);
     tracker()->OnInputEvent(touch, &touch_latency);
-    tracker()->OnInputEventAck(touch, &touch_latency);
+    tracker()->OnInputEventAck(touch, &touch_latency,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     EXPECT_TRUE(touch_latency.FindLatency(
         ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, nullptr));
     EXPECT_TRUE(touch_latency.terminated());
@@ -214,7 +227,8 @@
     ui::LatencyInfo mouse_latency;
     AddFakeComponents(*tracker(), &mouse_latency);
     tracker()->OnInputEvent(mouse_move, &mouse_latency);
-    tracker()->OnInputEventAck(mouse_move, &mouse_latency);
+    tracker()->OnInputEventAck(mouse_move, &mouse_latency,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     EXPECT_TRUE(mouse_latency.FindLatency(
         ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, nullptr));
     EXPECT_TRUE(mouse_latency.terminated());
@@ -226,7 +240,8 @@
     ui::LatencyInfo key_latency;
     AddFakeComponents(*tracker(), &key_latency);
     tracker()->OnInputEvent(key_event, &key_latency);
-    tracker()->OnInputEventAck(key_event, &key_latency);
+    tracker()->OnInputEventAck(key_event, &key_latency,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
     EXPECT_TRUE(key_latency.FindLatency(
         ui::INPUT_EVENT_LATENCY_TERMINATED_KEYBOARD_COMPONENT, 0, nullptr));
     EXPECT_TRUE(key_latency.terminated());
@@ -364,4 +379,62 @@
   EXPECT_EQ(3U, scroll_latency.latency_components().size());
 }
 
+TEST_F(RenderWidgetHostLatencyTrackerTest, TouchBlockingAndQueueingTime) {
+  for (InputEventAckState blocking :
+       {INPUT_EVENT_ACK_STATE_NOT_CONSUMED, INPUT_EVENT_ACK_STATE_CONSUMED}) {
+    SyntheticWebTouchEvent event;
+    event.PressPoint(1, 1);
+
+    ui::LatencyInfo latency_start;
+    tracker()->OnInputEvent(event, &latency_start);
+    tracker()->OnInputEventAck(event, &latency_start,
+                               INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+
+    ui::LatencyInfo latency_move;
+    event.MovePoint(0, 20, 20);
+    tracker()->OnInputEvent(event, &latency_move);
+
+    EXPECT_TRUE(latency_move.FindLatency(
+        ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, nullptr));
+    EXPECT_TRUE(
+        latency_move.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
+                                 tracker()->latency_component_id(), nullptr));
+
+    EXPECT_EQ(2U, latency_move.latency_components().size());
+
+    ui::LatencyInfo fake_latency_move;
+    fake_latency_move.AddLatencyNumberWithTimestamp(
+        ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT,
+        tracker()->latency_component_id(), 0,
+        base::TimeTicks() + base::TimeDelta::FromMilliseconds(1), 1);
+
+    fake_latency_move.AddLatencyNumberWithTimestamp(
+        ui::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 0,
+        base::TimeTicks() + base::TimeDelta::FromMilliseconds(5), 1);
+
+    fake_latency_move.AddLatencyNumberWithTimestamp(
+        ui::INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, 0, 0,
+        base::TimeTicks() + base::TimeDelta::FromMilliseconds(12), 1);
+
+    // Call ComputeInputLatencyHistograms directly to avoid OnInputEventAck
+    // overwriting components.
+    tracker()->ComputeInputLatencyHistograms(event.type,
+                                             tracker()->latency_component_id(),
+                                             fake_latency_move, blocking);
+  }
+
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Event.Latency.QueueingTime.TouchMoveDefaultPrevented"),
+              ElementsAre(Bucket(4, 1)));
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Event.Latency.QueueingTime.TouchMoveDefaultAllowed"),
+              ElementsAre(Bucket(4, 1)));
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Event.Latency.BlockingTime.TouchMoveDefaultPrevented"),
+              ElementsAre(Bucket(7, 1)));
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Event.Latency.BlockingTime.TouchMoveDefaultAllowed"),
+              ElementsAre(Bucket(7, 1)));
+}
+
 }  // namespace content
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 17a387d0..00984f7a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -164,6 +164,7 @@
 #include "ipc/attachment_broker_privileged.h"
 #include "ipc/ipc_channel.h"
 #include "ipc/ipc_logging.h"
+#include "ipc/ipc_sender.h"
 #include "ipc/ipc_switches.h"
 #include "ipc/mojo/ipc_channel_mojo.h"
 #include "media/base/media_switches.h"
@@ -447,6 +448,25 @@
 
 }  // namespace
 
+class RenderProcessHostImpl::SafeSenderProxy : public IPC::Sender {
+ public:
+  // |process| must outlive this object.
+  explicit SafeSenderProxy(RenderProcessHostImpl* process, bool send_now)
+      : process_(process), send_now_(send_now) {}
+  ~SafeSenderProxy() override {}
+
+  // IPC::Sender:
+  bool Send(IPC::Message* message) override {
+    return process_->SendImpl(base::WrapUnique(message), send_now_);
+  }
+
+ private:
+  RenderProcessHostImpl* const process_;
+  const bool send_now_;
+
+  DISALLOW_COPY_AND_ASSIGN(SafeSenderProxy);
+};
+
 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
 
 base::MessageLoop* g_in_process_thread;
@@ -536,6 +556,8 @@
       is_self_deleted_(false),
 #endif
       pending_views_(0),
+      immediate_sender_(new SafeSenderProxy(this, true)),
+      io_thread_sender_(new SafeSenderProxy(this, false)),
       mojo_application_host_(new MojoApplicationHost),
       visible_widgets_(0),
       is_process_backgrounded_(false),
@@ -648,10 +670,8 @@
 #endif
   // We may have some unsent messages at this point, but that's OK.
   channel_.reset();
-  while (!queued_messages_.empty()) {
-    delete queued_messages_.front();
+  while (!queued_messages_.empty())
     queued_messages_.pop();
-  }
 
   UnregisterHost(GetID());
 
@@ -1017,6 +1037,41 @@
   }
 }
 
+bool RenderProcessHostImpl::SendImpl(std::unique_ptr<IPC::Message> msg,
+                                     bool send_now) {
+  TRACE_EVENT0("renderer_host", "RenderProcessHostImpl::SendImpl");
+#if !defined(OS_ANDROID)
+  DCHECK(!msg->is_sync());
+#endif
+
+  if (!channel_) {
+#if defined(OS_ANDROID)
+    if (msg->is_sync())
+      return false;
+#endif
+    if (!is_initialized_) {
+      queued_messages_.emplace(std::move(msg));
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) {
+#if defined(OS_ANDROID)
+    if (msg->is_sync())
+      return false;
+#endif
+    queued_messages_.emplace(std::move(msg));
+    return true;
+  }
+
+  if (send_now)
+    return channel_->SendNow(std::move(msg));
+
+  return channel_->SendOnIPCThread(std::move(msg));
+}
+
 void RenderProcessHostImpl::RegisterMojoServices() {
 #if !defined(OS_ANDROID)
   mojo_application_host_->service_registry()->AddService(
@@ -1645,39 +1700,7 @@
 }
 
 bool RenderProcessHostImpl::Send(IPC::Message* msg) {
-  TRACE_EVENT0("renderer_host", "RenderProcessHostImpl::Send");
-#if !defined(OS_ANDROID)
-  DCHECK(!msg->is_sync());
-#endif
-
-  if (!channel_) {
-#if defined(OS_ANDROID)
-    if (msg->is_sync()) {
-      delete msg;
-      return false;
-    }
-#endif
-    if (!is_initialized_) {
-      queued_messages_.push(msg);
-      return true;
-    } else {
-      delete msg;
-      return false;
-    }
-  }
-
-  if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) {
-#if defined(OS_ANDROID)
-    if (msg->is_sync()) {
-      delete msg;
-      return false;
-    }
-#endif
-    queued_messages_.push(msg);
-    return true;
-  }
-
-  return channel_->Send(msg);
+  return SendImpl(base::WrapUnique(msg), false /* send_now */);
 }
 
 bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
@@ -2033,6 +2056,14 @@
   return channel_.get();
 }
 
+IPC::Sender* RenderProcessHostImpl::GetImmediateSender() {
+  return immediate_sender_.get();
+}
+
+IPC::Sender* RenderProcessHostImpl::GetIOThreadSender() {
+  return io_thread_sender_.get();
+}
+
 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) {
   channel_->AddFilter(filter->GetFilter());
 }
@@ -2378,10 +2409,8 @@
       channel_.get());
 #endif
   channel_.reset();
-  while (!queued_messages_.empty()) {
-    delete queued_messages_.front();
+  while (!queued_messages_.empty())
     queued_messages_.pop();
-  }
   UpdateProcessPriority();
   DCHECK(!is_process_backgrounded_);
 
@@ -2558,7 +2587,7 @@
                                          NotificationService::NoDetails());
 
   while (!queued_messages_.empty()) {
-    Send(queued_messages_.front());
+    Send(queued_messages_.front().release());
     queued_messages_.pop();
   }
 
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index e46e2c51..efb808a 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -135,6 +135,8 @@
   void SetSuddenTerminationAllowed(bool enabled) override;
   bool SuddenTerminationAllowed() const override;
   IPC::ChannelProxy* GetChannel() override;
+  IPC::Sender* GetImmediateSender() override;
+  IPC::Sender* GetIOThreadSender() override;
   void AddFilter(BrowserMessageFilter* filter) override;
   bool FastShutdownForPageCount(size_t count) override;
   bool FastShutdownStarted() const override;
@@ -291,8 +293,11 @@
   int32_t pending_views_;
 
  private:
-  friend class VisitRelayingRenderProcessHost;
+  class SafeSenderProxy;
+
   friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test;
+  friend class SafeSenderProxy;
+  friend class VisitRelayingRenderProcessHost;
 
   std::unique_ptr<IPC::ChannelProxy> CreateChannelProxy(
       const std::string& channel_id);
@@ -300,6 +305,9 @@
   // Creates and adds the IO thread message filters.
   void CreateMessageFilters();
 
+  // Shared implementation for IPC::Senders exposed by this RPH.
+  bool SendImpl(std::unique_ptr<IPC::Message> message, bool send_now);
+
   // Registers Mojo services to be exposed to the renderer.
   void RegisterMojoServices();
 
@@ -362,6 +370,11 @@
   base::FilePath GetEventLogFilePathWithExtensions(const base::FilePath& file);
 #endif
 
+  // IPC::Senders which live as long as this RPH and provide safe, opaque
+  // access to ChannelProxy SendNow() and SendOnIOThread() respectively.
+  const std::unique_ptr<SafeSenderProxy> immediate_sender_;
+  const std::unique_ptr<SafeSenderProxy> io_thread_sender_;
+
   std::unique_ptr<MojoChildConnection> mojo_child_connection_;
   std::unique_ptr<MojoApplicationHost> mojo_application_host_;
 
@@ -407,7 +420,7 @@
   // instead of in the channel so that we ensure they're sent after init related
   // messages that are sent once the process handle is available.  This is
   // because the queued messages may have dependencies on the init messages.
-  std::queue<IPC::Message*> queued_messages_;
+  std::queue<std::unique_ptr<IPC::Message>> queued_messages_;
 
   // The globally-unique identifier for this RPH.
   const int id_;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 8abf5cda..cf493b2 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -230,7 +230,8 @@
   latency_tracker_.Initialize(routing_id_, GetProcess()->GetID());
 
   input_router_.reset(new InputRouterImpl(
-      process_, this, this, routing_id_, GetInputRouterConfigForPlatform()));
+      process_->GetImmediateSender(), this, this, routing_id_,
+      GetInputRouterConfigForPlatform()));
 
   touch_emulator_.reset();
 
@@ -1346,7 +1347,8 @@
   // event. (In particular, the above call to view_->RenderProcessGone will
   // destroy the aura window, which may dispatch a synthetic mouse move.)
   input_router_.reset(new InputRouterImpl(
-      process_, this, this, routing_id_, GetInputRouterConfigForPlatform()));
+      process_->GetImmediateSender(), this, this, routing_id_,
+      GetInputRouterConfigForPlatform()));
 
   synthetic_gesture_controller_.reset();
 }
@@ -1886,12 +1888,13 @@
 void RenderWidgetHostImpl::OnKeyboardEventAck(
       const NativeWebKeyboardEventWithLatencyInfo& event,
       InputEventAckState ack_result) {
-  latency_tracker_.OnInputEventAck(event.event, &event.latency);
+  latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
+
+  const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result);
 
   // We only send unprocessed key event upwards if we are not hidden,
   // because the user has moved away from us and no longer expect any effect
   // of this key event.
-  const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result);
   if (delegate_ && !processed && !is_hidden() && !event.event.skip_in_browser) {
     delegate_->HandleKeyboardEvent(event.event);
 
@@ -1904,13 +1907,15 @@
 void RenderWidgetHostImpl::OnMouseEventAck(
     const MouseEventWithLatencyInfo& mouse_event,
     InputEventAckState ack_result) {
-  latency_tracker_.OnInputEventAck(mouse_event.event, &mouse_event.latency);
+  latency_tracker_.OnInputEventAck(mouse_event.event, &mouse_event.latency,
+                                   ack_result);
 }
 
 void RenderWidgetHostImpl::OnWheelEventAck(
     const MouseWheelEventWithLatencyInfo& wheel_event,
     InputEventAckState ack_result) {
-  latency_tracker_.OnInputEventAck(wheel_event.event, &wheel_event.latency);
+  latency_tracker_.OnInputEventAck(wheel_event.event, &wheel_event.latency,
+                                   ack_result);
 
   if (!is_hidden() && view_) {
     if (ack_result != INPUT_EVENT_ACK_STATE_CONSUMED &&
@@ -1924,7 +1929,7 @@
 void RenderWidgetHostImpl::OnGestureEventAck(
     const GestureEventWithLatencyInfo& event,
     InputEventAckState ack_result) {
-  latency_tracker_.OnInputEventAck(event.event, &event.latency);
+  latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
 
   if (view_)
     view_->GestureEventAck(event.event, ack_result);
@@ -1933,7 +1938,7 @@
 void RenderWidgetHostImpl::OnTouchEventAck(
     const TouchEventWithLatencyInfo& event,
     InputEventAckState ack_result) {
-  latency_tracker_.OnInputEventAck(event.event, &event.latency);
+  latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
 
   if (touch_emulator_ &&
       touch_emulator_->HandleTouchEventAck(event.event, ack_result)) {
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index e23fe255..e1d4f1c 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -273,7 +273,7 @@
   }
 
   for (auto it = hittest_data_.begin(); it != hittest_data_.end();) {
-    if (cc::SurfaceIdAllocator::NamespaceForId(it->first) == id)
+    if (it->first.id_namespace() == id)
       it = hittest_data_.erase(it);
     else
       ++it;
@@ -282,8 +282,7 @@
 
 void RenderWidgetHostInputEventRouter::OnHittestData(
     const FrameHostMsg_HittestData_Params& params) {
-  if (owner_map_.find(cc::SurfaceIdAllocator::NamespaceForId(
-          params.surface_id)) == owner_map_.end()) {
+  if (owner_map_.find(params.surface_id.id_namespace()) == owner_map_.end()) {
     return;
   }
   HittestData data;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index f94ff61b..fd50cf5 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2062,7 +2062,7 @@
   // case we return our current namespace.
   if (id.is_null())
     return GetSurfaceIdNamespace();
-  return cc::SurfaceIdAllocator::NamespaceForId(id);
+  return id.id_namespace();
 }
 
 void RenderWidgetHostViewAura::ProcessMouseEvent(
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 384bc26..68c95ddbc 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1639,7 +1639,7 @@
   // case we return our current namespace.
   if (id.is_null())
     return GetSurfaceIdNamespace();
-  return cc::SurfaceIdAllocator::NamespaceForId(id);
+  return id.id_namespace();
 }
 
 bool RenderWidgetHostViewMac::ShouldRouteEvent(
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 7dd4a64..9a936aa 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -341,6 +341,7 @@
   IPC_STRUCT_TRAITS_MEMBER(lofi_state)
   IPC_STRUCT_TRAITS_MEMBER(navigation_start)
   IPC_STRUCT_TRAITS_MEMBER(method)
+  IPC_STRUCT_TRAITS_MEMBER(post_data)
 IPC_STRUCT_TRAITS_END()
 
 IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams)
@@ -353,7 +354,6 @@
 
 IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams)
   IPC_STRUCT_TRAITS_MEMBER(extra_headers)
-  IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
 #if defined(OS_ANDROID)
   IPC_STRUCT_TRAITS_MEMBER(has_user_gesture)
 #endif
@@ -845,12 +845,11 @@
 // Tells the renderer that a navigation is ready to commit.  The renderer should
 // request |stream_url| to get access to the stream containing the body of the
 // response.
-IPC_MESSAGE_ROUTED5(FrameMsg_CommitNavigation,
+IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation,
                     content::ResourceResponseHead,    /* response */
                     GURL,                             /* stream_url */
                     content::CommonNavigationParams,  /* common_params */
-                    content::RequestNavigationParams, /* request_params */
-                    scoped_refptr<content::ResourceRequestBody> /* post_data */)
+                    content::RequestNavigationParams) /* request_params */
 
 // PlzNavigate
 // Tells the renderer that a navigation failed with the error code |error_code|
@@ -1352,10 +1351,9 @@
 
 // PlzNavigate
 // Tells the browser to perform a navigation.
-IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation,
+IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation,
                     content::CommonNavigationParams,
-                    content::BeginNavigationParams,
-                    scoped_refptr<content::ResourceRequestBody>)
+                    content::BeginNavigationParams)
 
 // Sent as a response to FrameMsg_VisualStateRequest.
 // The message is delivered using RenderWidget::QueueMessage.
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index f09cccf..39162ffe 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -47,7 +47,8 @@
     const GURL& history_url_for_data_url,
     LoFiState lofi_state,
     const base::TimeTicks& navigation_start,
-    std::string method)
+    std::string method,
+    const scoped_refptr<ResourceRequestBody>& post_data)
     : url(url),
       referrer(referrer),
       transition(transition),
@@ -60,7 +61,8 @@
       history_url_for_data_url(history_url_for_data_url),
       lofi_state(lofi_state),
       navigation_start(navigation_start),
-      method(method) {}
+      method(method),
+      post_data(post_data) {}
 
 CommonNavigationParams::CommonNavigationParams(
     const CommonNavigationParams& other) = default;
@@ -100,14 +102,12 @@
 
 StartNavigationParams::StartNavigationParams(
     const std::string& extra_headers,
-    const std::vector<unsigned char>& browser_initiated_post_data,
 #if defined(OS_ANDROID)
     bool has_user_gesture,
 #endif
     int transferred_request_child_id,
     int transferred_request_request_id)
     : extra_headers(extra_headers),
-      browser_initiated_post_data(browser_initiated_post_data),
 #if defined(OS_ANDROID)
       has_user_gesture(has_user_gesture),
 #endif
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h
index f803874..bebd36d 100644
--- a/content/common/navigation_params.h
+++ b/content/common/navigation_params.h
@@ -9,10 +9,12 @@
 
 #include <string>
 
+#include "base/memory/ref_counted.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
 #include "content/common/content_export.h"
 #include "content/common/frame_message_enums.h"
+#include "content/common/resource_request_body.h"
 #include "content/public/common/page_state.h"
 #include "content/public/common/referrer.h"
 #include "content/public/common/request_context_type.h"
@@ -60,7 +62,8 @@
                          const GURL& history_url_for_data_url,
                          LoFiState lofi_state,
                          const base::TimeTicks& navigation_start,
-                         std::string method);
+                         std::string method,
+                         const scoped_refptr<ResourceRequestBody>& post_data);
   CommonNavigationParams(const CommonNavigationParams& other);
   ~CommonNavigationParams();
 
@@ -118,6 +121,9 @@
 
   // The request method: GET, POST, etc.
   std::string method;
+
+  // Body of HTTP POST request.
+  scoped_refptr<ResourceRequestBody> post_data;
 };
 
 // Provided by the renderer ----------------------------------------------------
@@ -172,24 +178,18 @@
 // PlzNavigate: These are not used.
 struct CONTENT_EXPORT StartNavigationParams {
   StartNavigationParams();
-  StartNavigationParams(
-      const std::string& extra_headers,
-      const std::vector<unsigned char>& browser_initiated_post_data,
+  StartNavigationParams(const std::string& extra_headers,
 #if defined(OS_ANDROID)
-      bool has_user_gesture,
+                        bool has_user_gesture,
 #endif
-      int transferred_request_child_id,
-      int transferred_request_request_id);
+                        int transferred_request_child_id,
+                        int transferred_request_request_id);
   StartNavigationParams(const StartNavigationParams& other);
   ~StartNavigationParams();
 
   // Extra headers (separated by \n) to send during the request.
   std::string extra_headers;
 
-  // If is_post is true, holds the post_data information from browser. Empty
-  // otherwise.
-  std::vector<unsigned char> browser_initiated_post_data;
-
 #if defined(OS_ANDROID)
   bool has_user_gesture;
 #endif
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
index b1f13c0..f2e37c2 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
@@ -1127,8 +1127,8 @@
         // TODO(changwan): reduce the number of selection changes
         waitForEventLogs("selectionchange,selectionchange,selectionchange,"
                 + "keydown(229),compositionstart(),compositionupdate(a),input,"
-                + "keyup(229),compositionend(a),input,selectionchange,selectionchange,"
-                + "selectionchange,selectionchange,selectionchange");
+                + "keyup(229),compositionupdate(a),input,compositionend(a),selectionchange,"
+                + "selectionchange,selectionchange,selectionchange,selectionchange");
     }
 
     @MediumTest
diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h
index 67fc03f..198e7e53 100644
--- a/content/public/browser/render_process_host.h
+++ b/content/public/browser/render_process_host.h
@@ -178,6 +178,14 @@
   // Returns the renderer channel.
   virtual IPC::ChannelProxy* GetChannel() = 0;
 
+  // Returns an IPC::Sender which tries to send messages immediately from the
+  // calling thread. The returned Sender is owned by the RenderProcessHost.
+  virtual IPC::Sender* GetImmediateSender() = 0;
+
+  // Returns an IPC::Sender which always sends messages from the IO thread's
+  // task queue. The returned Sender is owned by the RenderProcessHost.
+  virtual IPC::Sender* GetIOThreadSender() = 0;
+
   // Adds a message filter to the IPC channel.
   virtual void AddFilter(BrowserMessageFilter* filter) = 0;
 
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc
index 43b47a342..dd10d04 100644
--- a/content/public/test/mock_render_process_host.cc
+++ b/content/public/test/mock_render_process_host.cc
@@ -240,7 +240,15 @@
 }
 
 IPC::ChannelProxy* MockRenderProcessHost::GetChannel() {
-  return NULL;
+  return nullptr;
+}
+
+IPC::Sender* MockRenderProcessHost::GetImmediateSender() {
+  return this;
+}
+
+IPC::Sender* MockRenderProcessHost::GetIOThreadSender() {
+  return this;
 }
 
 void MockRenderProcessHost::AddFilter(BrowserMessageFilter* filter) {
diff --git a/content/public/test/mock_render_process_host.h b/content/public/test/mock_render_process_host.h
index a7aca5f..2b88d19 100644
--- a/content/public/test/mock_render_process_host.h
+++ b/content/public/test/mock_render_process_host.h
@@ -74,6 +74,8 @@
   BrowserContext* GetBrowserContext() const override;
   bool InSameStoragePartition(StoragePartition* partition) const override;
   IPC::ChannelProxy* GetChannel() override;
+  IPC::Sender* GetImmediateSender() override;
+  IPC::Sender* GetIOThreadSender() override;
   void AddFilter(BrowserMessageFilter* filter) override;
   bool FastShutdownForPageCount(size_t count) override;
   base::TimeDelta GetChildProcessIdleTime() const override;
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 2fc47aa..90a8cb81 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -579,7 +579,7 @@
       url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
       true, false, base::TimeTicks(),
       FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
-      LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET");
+      LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr);
   RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
   TestRenderFrame* frame =
       static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
@@ -710,7 +710,7 @@
       url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
       FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
       FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
-      LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET");
+      LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr);
   RequestNavigationParams request_params;
   request_params.page_state = state;
   request_params.page_id = impl->page_id_ + offset;
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index 6cd8bebe..99092e4b 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -23,7 +23,7 @@
 struct FrameMsg_BuffersSwapped_Params;
 
 namespace cc {
-struct SurfaceId;
+class SurfaceId;
 struct SurfaceSequence;
 }
 
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 4e0a32e8..2c6ba29 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -547,7 +547,7 @@
 // to the WebURLRequest used to commit the navigation. This ensures that the
 // POST data will be in the PageState sent to the browser on commit.
 void AddHTTPBodyToRequest(WebURLRequest* request,
-                          scoped_refptr<ResourceRequestBody> body) {
+                          const scoped_refptr<ResourceRequestBody>& body) {
   WebHTTPBody http_body;
   http_body.initialize();
   http_body.setIdentifier(body->identifier());
@@ -639,7 +639,8 @@
       request->url(), referrer, extra_data->transition_type(),
       FrameMsg_Navigate_Type::NORMAL, true, should_replace_current_entry,
       ui_timestamp, report_type, GURL(), GURL(), extra_data->lofi_state(),
-      base::TimeTicks::Now(), request->httpMethod().latin1());
+      base::TimeTicks::Now(), request->httpMethod().latin1(),
+      GetRequestBodyForWebURLRequest(*request));
 }
 
 media::Context3D GetSharedMainThreadContext3D(
@@ -1579,7 +1580,7 @@
   TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_,
                "url", common_params.url.possibly_invalid_spec());
   NavigateInternal(common_params, start_params, request_params,
-                   std::unique_ptr<StreamOverrideParameters>(), nullptr);
+                   std::unique_ptr<StreamOverrideParameters>());
 }
 
 void RenderFrameImpl::BindServiceRegistry(
@@ -4711,8 +4712,7 @@
     const ResourceResponseHead& response,
     const GURL& stream_url,
     const CommonNavigationParams& common_params,
-    const RequestNavigationParams& request_params,
-    scoped_refptr<ResourceRequestBody> post_data) {
+    const RequestNavigationParams& request_params) {
   CHECK(IsBrowserSideNavigationEnabled());
   // This will override the url requested by the WebURLLoader, as well as
   // provide it with the response to the request.
@@ -4722,7 +4722,7 @@
   stream_override->response = response;
 
   NavigateInternal(common_params, StartNavigationParams(), request_params,
-                   std::move(stream_override), post_data);
+                   std::move(stream_override));
 }
 
 // PlzNavigate
@@ -5324,8 +5324,7 @@
     const CommonNavigationParams& common_params,
     const StartNavigationParams& start_params,
     const RequestNavigationParams& request_params,
-    std::unique_ptr<StreamOverrideParameters> stream_params,
-    scoped_refptr<ResourceRequestBody> post_data) {
+    std::unique_ptr<StreamOverrideParameters> stream_params) {
   bool browser_side_navigation = IsBrowserSideNavigationEnabled();
 
   // Lower bound for browser initiated navigation start time.
@@ -5386,8 +5385,8 @@
       CreateURLRequestForNavigation(common_params, std::move(stream_params),
                                     frame_->isViewSourceModeEnabled());
 
-  if (IsBrowserSideNavigationEnabled() && post_data)
-    AddHTTPBodyToRequest(&request, post_data);
+  if (IsBrowserSideNavigationEnabled() && common_params.post_data)
+    AddHTTPBodyToRequest(&request, common_params.post_data);
 
   // Used to determine whether this frame is actually loading a request as part
   // of a history navigation.
@@ -5478,18 +5477,9 @@
       }
     }
 
-    if (common_params.method == "POST" && !browser_side_navigation) {
-      // Set post data.
-      WebHTTPBody http_body;
-      http_body.initialize();
-      const char* data = nullptr;
-      if (start_params.browser_initiated_post_data.size()) {
-        data = reinterpret_cast<const char*>(
-            &start_params.browser_initiated_post_data.front());
-      }
-      http_body.appendData(
-          WebData(data, start_params.browser_initiated_post_data.size()));
-      request.setHTTPBody(http_body);
+    if (common_params.method == "POST" && !browser_side_navigation &&
+        common_params.post_data) {
+      AddHTTPBodyToRequest(&request, common_params.post_data);
     }
 
     // A session history navigation should have been accompanied by state.
@@ -5748,8 +5738,7 @@
                             GetLoadFlagsForWebURLRequest(*request),
                             request->hasUserGesture(),
                             request->skipServiceWorker(),
-                            GetRequestContextTypeForWebURLRequest(*request)),
-      GetRequestBodyForWebURLRequest(*request)));
+                            GetRequestContextTypeForWebURLRequest(*request))));
 }
 
 void RenderFrameImpl::LoadDataURL(
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 1a5d442..3ddbf72 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -800,8 +800,7 @@
   void OnCommitNavigation(const ResourceResponseHead& response,
                           const GURL& stream_url,
                           const CommonNavigationParams& common_params,
-                          const RequestNavigationParams& request_params,
-                          scoped_refptr<ResourceRequestBody> post_data);
+                          const RequestNavigationParams& request_params);
   void OnFailedNavigation(const CommonNavigationParams& common_params,
                           const RequestNavigationParams& request_params,
                           bool has_stale_copy_in_cache,
@@ -849,8 +848,7 @@
       const CommonNavigationParams& common_params,
       const StartNavigationParams& start_params,
       const RequestNavigationParams& request_params,
-      std::unique_ptr<StreamOverrideParameters> stream_params,
-      scoped_refptr<ResourceRequestBody> body);
+      std::unique_ptr<StreamOverrideParameters> stream_params);
 
   // Update current main frame's encoding and send it to browser window.
   // Since we want to let users see the right encoding info from menu
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h
index 375b308d..f0b115c 100644
--- a/content/renderer/render_frame_proxy.h
+++ b/content/renderer/render_frame_proxy.h
@@ -24,7 +24,7 @@
 }
 
 namespace cc {
-struct SurfaceId;
+class SurfaceId;
 struct SurfaceSequence;
 }
 
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 7d8eb88b..fbf67bd 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -608,11 +608,11 @@
   request_params.page_id = -1;
 
   // Set up post data.
-  const unsigned char* raw_data = reinterpret_cast<const unsigned char*>(
-      "post \0\ndata");
-  const unsigned int length = 11;
-  const std::vector<unsigned char> post_data(raw_data, raw_data + length);
-  start_params.browser_initiated_post_data = post_data;
+  const char raw_data[] = "post \0\ndata";
+  const size_t length = arraysize(raw_data);
+  scoped_refptr<ResourceRequestBody> post_data(new ResourceRequestBody);
+  post_data->AppendBytes(raw_data, length);
+  common_params.post_data = post_data;
 
   frame()->Navigate(common_params, start_params, request_params);
   ProcessPendingMessages();
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
index 591bdde7..11ab624 100644
--- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -326,6 +326,16 @@
     self.Fail('deqp/functional/gles3/texturespecification/' +
         'texstorage3d_format_depth_stencil.html',
         ['win', 'intel'], bug=614418)
+    self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html',
+        ['win', 'intel'], bug=614418)
+    self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html',
+        ['win', 'intel'], bug=614418)
+    self.Fail('deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html',
+        ['win', 'intel'], bug=614418)
+    self.Fail('deqp/functional/gles3/textureformat/sized_depth_stencil.html',
+        ['win', 'intel'], bug=614418)
+    self.Fail('deqp/functional/gles3/textureformat/compressed_cube.html',
+        ['win', 'intel'], bug=614418)
 
     # Mac only.
     self.Fail('deqp/functional/gles3/texturefiltering/cube_formats_*',
diff --git a/content/test/test_render_frame.cc b/content/test/test_render_frame.cc
index fd323140..359e59e0 100644
--- a/content/test/test_render_frame.cc
+++ b/content/test/test_render_frame.cc
@@ -30,7 +30,7 @@
   // PlzNavigate
   if (IsBrowserSideNavigationEnabled()) {
     OnCommitNavigation(ResourceResponseHead(), GURL(), common_params,
-                       request_params, nullptr);
+                       request_params);
   } else {
     OnNavigate(common_params, start_params, request_params);
   }
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index a969084..5ed27573e 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -369,8 +369,7 @@
     common_params.url = url;
     common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault);
     common_params.transition = ui::PAGE_TRANSITION_LINK;
-    OnBeginNavigation(common_params, begin_params,
-                      scoped_refptr<ResourceRequestBody>());
+    OnBeginNavigation(common_params, begin_params);
   }
 }
 
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index ccc88f0..b35d86aa 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -564,6 +564,11 @@
                     std::string /* state */,
                     int32_t /* callback_id */)
 
+// Check whether the Port for extension messaging exists in the frame. If the
+// port ID is unknown, the frame replies with ExtensionHostMsg_CloseMessagePort.
+IPC_MESSAGE_ROUTED1(ExtensionMsg_ValidateMessagePort,
+                    int /* port_id */)
+
 // Dispatch the Port.onConnect event for message channels.
 IPC_MESSAGE_ROUTED5(ExtensionMsg_DispatchOnConnect,
                     int /* target_port_id */,
@@ -573,8 +578,9 @@
                     std::string /* tls_channel_id */)
 
 // Deliver a message sent with ExtensionHostMsg_PostMessage.
-IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage,
+IPC_MESSAGE_ROUTED3(ExtensionMsg_DeliverMessage,
                     int /* target_port_id */,
+                    int /* source_tab_id */,
                     extensions::Message)
 
 // Dispatch the Port.onDisconnect event for message channels.
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 54c8dc2d..20946d2 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -672,13 +672,6 @@
   }
 }
 
-void Dispatcher::ClearPortData(int port_id) {
-  // Only the target port side has entries in |port_to_tab_id_map_|. If
-  // |port_id| is a source port, std::map::erase() will just silently fail
-  // here as a no-op.
-  port_to_tab_id_map_.erase(port_id);
-}
-
 // static
 std::vector<std::pair<std::string, int> > Dispatcher::GetJsResources() {
   std::vector<std::pair<std::string, int> > resources;
@@ -887,8 +880,8 @@
       "event_natives",
       std::unique_ptr<NativeHandler>(new EventBindings(context)));
   module_system->RegisterNativeHandler(
-      "messaging_natives", std::unique_ptr<NativeHandler>(
-                               MessagingBindings::Get(dispatcher, context)));
+      "messaging_natives",
+      std::unique_ptr<NativeHandler>(MessagingBindings::Get(context)));
   module_system->RegisterNativeHandler(
       "apiDefinitions", std::unique_ptr<NativeHandler>(
                             new ApiDefinitionsNatives(dispatcher, context)));
@@ -1035,13 +1028,13 @@
   DispatchEvent(extension_id, kOnSuspendCanceledEvent);
 }
 
-void Dispatcher::OnDeliverMessage(int target_port_id, const Message& message) {
+void Dispatcher::OnDeliverMessage(int target_port_id,
+                                  int source_tab_id,
+                                  const Message& message) {
   std::unique_ptr<RequestSender::ScopedTabID> scoped_tab_id;
-  std::map<int, int>::const_iterator it =
-      port_to_tab_id_map_.find(target_port_id);
-  if (it != port_to_tab_id_map_.end()) {
+  if (source_tab_id != -1) {
     scoped_tab_id.reset(
-        new RequestSender::ScopedTabID(request_sender(), it->second));
+        new RequestSender::ScopedTabID(request_sender(), source_tab_id));
   }
 
   MessagingBindings::DeliverMessage(*script_context_set_, target_port_id,
@@ -1055,11 +1048,7 @@
     const ExtensionMsg_TabConnectionInfo& source,
     const ExtensionMsg_ExternalConnectionInfo& info,
     const std::string& tls_channel_id) {
-  DCHECK(!ContainsKey(port_to_tab_id_map_, target_port_id));
   DCHECK_EQ(1, target_port_id % 2);  // target renderer ports have odd IDs.
-  int sender_tab_id = -1;
-  source.tab.GetInteger("id", &sender_tab_id);
-  port_to_tab_id_map_[target_port_id] = sender_tab_id;
 
   MessagingBindings::DispatchOnConnect(*script_context_set_, target_port_id,
                                        channel_name, source, info,
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h
index 55c2418..fb5121e 100644
--- a/extensions/renderer/dispatcher.h
+++ b/extensions/renderer/dispatcher.h
@@ -136,8 +136,6 @@
                                 const base::ListValue& args,
                                 bool user_gesture);
 
-  void ClearPortData(int port_id);
-
   // Returns a list of (module name, resource id) pairs for the JS modules to
   // add to the source map.
   static std::vector<std::pair<std::string, int> > GetJsResources();
@@ -163,7 +161,9 @@
 
   void OnActivateExtension(const std::string& extension_id);
   void OnCancelSuspend(const std::string& extension_id);
-  void OnDeliverMessage(int target_port_id, const Message& message);
+  void OnDeliverMessage(int target_port_id,
+                        int source_tab_id,
+                        const Message& message);
   void OnDispatchOnConnect(int target_port_id,
                            const std::string& channel_name,
                            const ExtensionMsg_TabConnectionInfo& source,
@@ -300,9 +300,6 @@
   std::string system_font_family_;
   std::string system_font_size_;
 
-  // Mapping of port IDs to tabs. If there is no tab, the value would be -1.
-  std::map<int, int> port_to_tab_id_map_;
-
   // It is important for this to come after the ScriptInjectionManager, so that
   // the observer is destroyed before the UserScriptSet.
   ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer>
diff --git a/extensions/renderer/extension_frame_helper.cc b/extensions/renderer/extension_frame_helper.cc
index ba47a7c7..d9cd7e9 100644
--- a/extensions/renderer/extension_frame_helper.cc
+++ b/extensions/renderer/extension_frame_helper.cc
@@ -189,6 +189,8 @@
 bool ExtensionFrameHelper::OnMessageReceived(const IPC::Message& message) {
   bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(ExtensionFrameHelper, message)
+    IPC_MESSAGE_HANDLER(ExtensionMsg_ValidateMessagePort,
+                        OnExtensionValidateMessagePort)
     IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnConnect,
                         OnExtensionDispatchOnConnect)
     IPC_MESSAGE_HANDLER(ExtensionMsg_DeliverMessage, OnExtensionDeliverMessage)
@@ -206,6 +208,11 @@
   return handled;
 }
 
+void ExtensionFrameHelper::OnExtensionValidateMessagePort(int port_id) {
+  MessagingBindings::ValidateMessagePort(
+      extension_dispatcher_->script_context_set(), port_id, render_frame());
+}
+
 void ExtensionFrameHelper::OnExtensionDispatchOnConnect(
     int target_port_id,
     const std::string& channel_name,
@@ -223,6 +230,7 @@
 }
 
 void ExtensionFrameHelper::OnExtensionDeliverMessage(int target_id,
+                                                     int source_tab_id,
                                                      const Message& message) {
   MessagingBindings::DeliverMessage(
       extension_dispatcher_->script_context_set(), target_id, message,
diff --git a/extensions/renderer/extension_frame_helper.h b/extensions/renderer/extension_frame_helper.h
index 57ac3b6..bd37234b 100644
--- a/extensions/renderer/extension_frame_helper.h
+++ b/extensions/renderer/extension_frame_helper.h
@@ -95,6 +95,7 @@
   bool OnMessageReceived(const IPC::Message& message) override;
 
   // IPC handlers.
+  void OnExtensionValidateMessagePort(int port_id);
   void OnExtensionDispatchOnConnect(
       int target_port_id,
       const std::string& channel_name,
@@ -102,6 +103,7 @@
       const ExtensionMsg_ExternalConnectionInfo& info,
       const std::string& tls_channel_id);
   void OnExtensionDeliverMessage(int target_port_id,
+                                 int source_tab_id,
                                  const Message& message);
   void OnExtensionDispatchOnDisconnect(int port_id,
                                        const std::string& error_message);
diff --git a/extensions/renderer/messaging_bindings.cc b/extensions/renderer/messaging_bindings.cc
index c1da6263..79fb716 100644
--- a/extensions/renderer/messaging_bindings.cc
+++ b/extensions/renderer/messaging_bindings.cc
@@ -12,7 +12,6 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/callback.h"
-#include "base/lazy_instance.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/message_loop/message_loop.h"
@@ -25,7 +24,6 @@
 #include "extensions/common/api/messaging/message.h"
 #include "extensions/common/extension_messages.h"
 #include "extensions/common/manifest_handlers/externally_connectable.h"
-#include "extensions/renderer/dispatcher.h"
 #include "extensions/renderer/event_bindings.h"
 #include "extensions/renderer/extension_frame_helper.h"
 #include "extensions/renderer/gc_callback.h"
@@ -61,191 +59,51 @@
 
 namespace {
 
-// Tracks every reference between ScriptContexts and Ports, by ID.
-class PortTracker {
- public:
-  PortTracker() {}
-  ~PortTracker() {}
-
-  // Returns true if |context| references |port_id|.
-  bool HasReference(ScriptContext* context, int port_id) const {
-    auto ports = contexts_to_ports_.find(context);
-    return ports != contexts_to_ports_.end() &&
-           ports->second.count(port_id) > 0;
-  }
-
-  // Marks |context| and |port_id| as referencing each other.
-  void AddReference(ScriptContext* context, int port_id) {
-    contexts_to_ports_[context].insert(port_id);
-  }
-
-  // Removes the references between |context| and |port_id|.
-  // Returns true if a reference was removed, false if the reference didn't
-  // exist to be removed.
-  bool RemoveReference(ScriptContext* context, int port_id) {
-    auto ports = contexts_to_ports_.find(context);
-    if (ports == contexts_to_ports_.end() ||
-        ports->second.erase(port_id) == 0) {
-      return false;
-    }
-    if (ports->second.empty())
-      contexts_to_ports_.erase(context);
-    return true;
-  }
-
-  // Returns true if this tracker has any reference to |port_id|.
-  bool HasPort(int port_id) const {
-    for (auto it : contexts_to_ports_) {
-      if (it.second.count(port_id) > 0)
-        return true;
-    }
-    return false;
-  }
-
-  // Deletes all references to |port_id|.
-  void DeletePort(int port_id) {
-    for (auto it = contexts_to_ports_.begin();
-         it != contexts_to_ports_.end();) {
-      if (it->second.erase(port_id) > 0 && it->second.empty())
-        contexts_to_ports_.erase(it++);
-      else
-        ++it;
-    }
-  }
-
-  // Gets every port ID that has a reference to |context|.
-  std::set<int> GetPortsForContext(ScriptContext* context) const {
-    auto ports = contexts_to_ports_.find(context);
-    return ports == contexts_to_ports_.end() ? std::set<int>() : ports->second;
-  }
-
- private:
-  // Maps ScriptContexts to the port IDs that have a reference to it.
-  std::map<ScriptContext*, std::set<int>> contexts_to_ports_;
-
-  DISALLOW_COPY_AND_ASSIGN(PortTracker);
-};
-
-base::LazyInstance<PortTracker> g_port_tracker = LAZY_INSTANCE_INITIALIZER;
-
-const char kPortClosedError[] = "Attempting to use a disconnected port object";
-
 class ExtensionImpl : public ObjectBackedNativeHandler {
  public:
-  ExtensionImpl(Dispatcher* dispatcher, ScriptContext* context)
-      : ObjectBackedNativeHandler(context),
-        dispatcher_(dispatcher),
-        weak_ptr_factory_(this) {
+  explicit ExtensionImpl(ScriptContext* context)
+      : ObjectBackedNativeHandler(context), weak_ptr_factory_(this) {
     RouteFunction(
         "CloseChannel",
         base::Bind(&ExtensionImpl::CloseChannel, base::Unretained(this)));
     RouteFunction(
-        "PortAddRef",
-        base::Bind(&ExtensionImpl::PortAddRef, base::Unretained(this)));
-    RouteFunction(
-        "PortRelease",
-        base::Bind(&ExtensionImpl::PortRelease, base::Unretained(this)));
-    RouteFunction(
         "PostMessage",
         base::Bind(&ExtensionImpl::PostMessage, base::Unretained(this)));
     // TODO(fsamuel, kalman): Move BindToGC out of messaging natives.
     RouteFunction("BindToGC",
                   base::Bind(&ExtensionImpl::BindToGC, base::Unretained(this)));
-
-    // Observe |context| so that port references to it can be cleared.
-    context->AddInvalidationObserver(base::Bind(
-        &ExtensionImpl::OnContextInvalidated, weak_ptr_factory_.GetWeakPtr()));
   }
 
   ~ExtensionImpl() override {}
 
  private:
-  void OnContextInvalidated() {
-    for (int port_id : g_port_tracker.Get().GetPortsForContext(context()))
-      ReleasePort(port_id);
-  }
-
-  void ClearPortDataAndNotifyDispatcher(int port_id) {
-    g_port_tracker.Get().DeletePort(port_id);
-    dispatcher_->ClearPortData(port_id);
-  }
-
   // Sends a message along the given channel.
   void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args) {
-    content::RenderFrame* render_frame = context()->GetRenderFrame();
-    if (!render_frame)
-      return;
-
     // Arguments are (int32_t port_id, string message).
     CHECK(args.Length() == 2 && args[0]->IsInt32() && args[1]->IsString());
 
     int port_id = args[0].As<v8::Int32>()->Value();
-    if (!g_port_tracker.Get().HasPort(port_id)) {
-      v8::Local<v8::String> error_message =
-          ToV8StringUnsafe(args.GetIsolate(), kPortClosedError);
-      args.GetIsolate()->ThrowException(v8::Exception::Error(error_message));
-      return;
-    }
 
-    render_frame->Send(new ExtensionHostMsg_PostMessage(
-        render_frame->GetRoutingID(), port_id,
-        Message(*v8::String::Utf8Value(args[1]),
-                blink::WebUserGestureIndicator::isProcessingUserGesture())));
+    content::RenderFrame* render_frame = context()->GetRenderFrame();
+    if (render_frame) {
+      render_frame->Send(new ExtensionHostMsg_PostMessage(
+          render_frame->GetRoutingID(), port_id,
+          Message(*v8::String::Utf8Value(args[1]),
+                  blink::WebUserGestureIndicator::isProcessingUserGesture())));
+    }
   }
 
-  // Forcefully disconnects a port.
+  // Close a port, optionally forcefully (i.e. close the whole channel instead
+  // of just the given port).
   void CloseChannel(const v8::FunctionCallbackInfo<v8::Value>& args) {
-    // Arguments are (int32_t port_id, boolean notify_browser).
+    // Arguments are (int32_t port_id, bool force_close).
     CHECK_EQ(2, args.Length());
     CHECK(args[0]->IsInt32());
     CHECK(args[1]->IsBoolean());
 
     int port_id = args[0].As<v8::Int32>()->Value();
-    if (!g_port_tracker.Get().HasPort(port_id))
-      return;
-
-    // Send via the RenderThread because the RenderFrame might be closing.
-    bool notify_browser = args[1].As<v8::Boolean>()->Value();
-    content::RenderFrame* render_frame = context()->GetRenderFrame();
-    if (notify_browser && render_frame) {
-      render_frame->Send(new ExtensionHostMsg_CloseMessagePort(
-          render_frame->GetRoutingID(), port_id, true));
-    }
-
-    ClearPortDataAndNotifyDispatcher(port_id);
-  }
-
-  // A new port has been created for a context.  This occurs both when script
-  // opens a connection, and when a connection is opened to this script.
-  void PortAddRef(const v8::FunctionCallbackInfo<v8::Value>& args) {
-    // Arguments are (int32_t port_id).
-    CHECK_EQ(1, args.Length());
-    CHECK(args[0]->IsInt32());
-
-    int port_id = args[0].As<v8::Int32>()->Value();
-    g_port_tracker.Get().AddReference(context(), port_id);
-  }
-
-  // The frame a port lived in has been destroyed.  When there are no more
-  // frames with a reference to a given port, we will disconnect it and notify
-  // the other end of the channel.
-  // TODO(robwu): Port lifetime management has moved to the browser, this is no
-  // longer needed. See .destroy_() inmessaging.js for more details.
-  void PortRelease(const v8::FunctionCallbackInfo<v8::Value>& args) {
-    // Arguments are (int32_t port_id).
-    CHECK(args.Length() == 1 && args[0]->IsInt32());
-    ReleasePort(args[0].As<v8::Int32>()->Value());
-  }
-
-  // Releases the reference to |port_id| for this context, and clears all port
-  // data if there are no more references.
-  void ReleasePort(int port_id) {
-    content::RenderFrame* render_frame = context()->GetRenderFrame();
-    if (g_port_tracker.Get().RemoveReference(context(), port_id) &&
-        !g_port_tracker.Get().HasPort(port_id) && render_frame) {
-      render_frame->Send(new ExtensionHostMsg_CloseMessagePort(
-          render_frame->GetRoutingID(), port_id, false));
-    }
+    bool force_close = args[1].As<v8::Boolean>()->Value();
+    ClosePort(port_id, force_close);
   }
 
   // void BindToGC(object, callback, port_id)
@@ -263,20 +121,55 @@
     int port_id = args[2].As<v8::Int32>()->Value();
     base::Closure fallback = base::Bind(&base::DoNothing);
     if (port_id >= 0) {
-      fallback = base::Bind(&ExtensionImpl::ReleasePort,
-                            weak_ptr_factory_.GetWeakPtr(), port_id);
+      // TODO(robwu): Falling back to closing the port shouldn't be needed. If
+      // the script context is destroyed, then the frame has navigated. But that
+      // is already detected by the browser, so this logic is redundant. Remove
+      // this fallback (and move BindToGC out of messaging because it is also
+      // used in other places that have nothing to do with messaging...).
+      fallback =
+          base::Bind(&ExtensionImpl::ClosePort, weak_ptr_factory_.GetWeakPtr(),
+                     port_id, false /* force_close */);
     }
     // Destroys itself when the object is GC'd or context is invalidated.
     new GCCallback(context(), args[0].As<v8::Object>(),
                    args[1].As<v8::Function>(), fallback);
   }
 
-  // Dispatcher handle. Not owned.
-  Dispatcher* dispatcher_;
+  // See ExtensionImpl::CloseChannel for documentation.
+  // TODO(robwu): Merge this logic with CloseChannel once the TODO in BindToGC
+  // has been addressed.
+  void ClosePort(int port_id, bool force_close) {
+    content::RenderFrame* render_frame = context()->GetRenderFrame();
+    if (render_frame) {
+      render_frame->Send(new ExtensionHostMsg_CloseMessagePort(
+          render_frame->GetRoutingID(), port_id, force_close));
+    }
+  }
 
   base::WeakPtrFactory<ExtensionImpl> weak_ptr_factory_;
 };
 
+void HasMessagePort(int port_id,
+                    bool* has_port,
+                    ScriptContext* script_context) {
+  if (*has_port)
+    return;  // Stop checking if the port was found.
+
+  v8::Isolate* isolate = script_context->isolate();
+  v8::HandleScope handle_scope(isolate);
+
+  v8::Local<v8::Value> port_id_handle = v8::Integer::New(isolate, port_id);
+  v8::Local<v8::Value> v8_has_port =
+      script_context->module_system()->CallModuleMethod("messaging", "hasPort",
+                                                        1, &port_id_handle);
+  if (IsEmptyOrUndefied(v8_has_port))
+    return;
+  CHECK(v8_has_port->IsBoolean());
+  if (!v8_has_port.As<v8::Boolean>()->Value())
+    return;
+  *has_port = true;
+}
+
 void DispatchOnConnectToScriptContext(
     int target_port_id,
     const std::string& channel_name,
@@ -435,9 +328,29 @@
 
 }  // namespace
 
-ObjectBackedNativeHandler* MessagingBindings::Get(Dispatcher* dispatcher,
-                                                  ScriptContext* context) {
-  return new ExtensionImpl(dispatcher, context);
+ObjectBackedNativeHandler* MessagingBindings::Get(ScriptContext* context) {
+  return new ExtensionImpl(context);
+}
+
+void MessagingBindings::ValidateMessagePort(
+    const ScriptContextSet& context_set,
+    int port_id,
+    content::RenderFrame* render_frame) {
+  int routing_id = render_frame->GetRoutingID();
+
+  bool has_port = false;
+  context_set.ForEach(render_frame,
+                      base::Bind(&HasMessagePort, port_id, &has_port));
+  // Note: HasMessagePort invokes a JavaScript function. If the runtime of the
+  // extension bindings in JS have been compromised, then |render_frame| may be
+  // invalid at this point.
+
+  // A reply is only sent if the port is missing, because the port is assumed to
+  // exist unless stated otherwise.
+  if (!has_port) {
+    content::RenderThread::Get()->Send(
+        new ExtensionHostMsg_CloseMessagePort(routing_id, port_id, false));
+  }
 }
 
 // static
diff --git a/extensions/renderer/messaging_bindings.h b/extensions/renderer/messaging_bindings.h
index a7a1c6fe..4c52c63 100644
--- a/extensions/renderer/messaging_bindings.h
+++ b/extensions/renderer/messaging_bindings.h
@@ -25,7 +25,6 @@
 }
 
 namespace extensions {
-class Dispatcher;
 struct Message;
 class ObjectBackedNativeHandler;
 class ScriptContextSet;
@@ -38,8 +37,13 @@
 class MessagingBindings {
  public:
   // Creates an instance of the extension.
-  static ObjectBackedNativeHandler* Get(Dispatcher* dispatcher,
-                                        ScriptContext* context);
+  static ObjectBackedNativeHandler* Get(ScriptContext* context);
+
+  // Checks whether the port exists in the given frame. If it does not, a reply
+  // is sent back to the browser.
+  static void ValidateMessagePort(const ScriptContextSet& context_set,
+                                  int port_id,
+                                  content::RenderFrame* render_frame);
 
   // Dispatches the onConnect content script messaging event to some contexts
   // in |context_set|. If |restrict_to_render_frame| is specified, only contexts
diff --git a/extensions/renderer/resources/messaging.js b/extensions/renderer/resources/messaging.js
index 8ca84ea..38ad944 100644
--- a/extensions/renderer/resources/messaging.js
+++ b/extensions/renderer/resources/messaging.js
@@ -21,6 +21,7 @@
   var kRequestChannel = "chrome.extension.sendRequest";
   var kMessageChannel = "chrome.runtime.sendMessage";
   var kNativeMessageChannel = "chrome.runtime.sendNativeMessage";
+  var kPortClosedError = 'Attempting to use a disconnected port object';
 
   // Map of port IDs to port object.
   var ports = {__proto__: null};
@@ -53,13 +54,15 @@
     };
     this.onDisconnect = new Event(null, [portSchema], options);
     this.onMessage = new Event(null, [messageSchema, portSchema], options);
-    this.onDestroy_ = null;
   }
   $Object.setPrototypeOf(PortImpl.prototype, null);
 
   // Sends a message asynchronously to the context on the other end of this
   // port.
   PortImpl.prototype.postMessage = function(msg) {
+    if (!$Object.hasOwnProperty(ports, this.portId_))
+      throw new Error(kPortClosedError);
+
     // JSON.stringify doesn't support a root object which is undefined.
     if (msg === undefined)
       msg = null;
@@ -80,28 +83,24 @@
 
   // Disconnects the port from the other end.
   PortImpl.prototype.disconnect = function() {
+    if (!$Object.hasOwnProperty(ports, this.portId_))
+      return;  // disconnect() on an already-closed port is a no-op.
     messagingNatives.CloseChannel(this.portId_, true);
     this.destroy_();
   };
 
+  // Close this specific port without forcing the channel to close. The channel
+  // will close if this was the only port at this end of the channel.
+  PortImpl.prototype.disconnectSoftly = function() {
+    if (!$Object.hasOwnProperty(ports, this.portId_))
+      return;
+    messagingNatives.CloseChannel(this.portId_, false);
+    this.destroy_();
+  };
+
   PortImpl.prototype.destroy_ = function() {
-    if (this.onDestroy_) {
-      this.onDestroy_();
-      this.onDestroy_ = null;
-    }
     privates(this.onDisconnect).impl.destroy_();
     privates(this.onMessage).impl.destroy_();
-    // TODO(robwu): Remove port lifetime management because it is completely
-    // handled in the browser. The renderer's only roles are
-    // 1) rejecting ports so that the browser knows that the renderer is not
-    //    interested in the port (this is merely an optimization)
-    // 2) acknowledging port creations, so that the browser knows that the port
-    //    was successfully created (from the perspective of the extension), but
-    //    then closed for some non-fatal reason.
-    // 3) notifying the browser of explicit port closure via .disconnect().
-    // In other cases (navigations), the browser automatically cleans up the
-    //    port.
-    messagingNatives.PortRelease(this.portId_);
     delete ports[this.portId_];
   };
 
@@ -109,7 +108,7 @@
   // the C++ to avoid creating the javascript message for all the contexts that
   // don't care about a particular message.
   function hasPort(portId) {
-    return portId in ports;
+    return $Object.hasOwnProperty(ports, portId);
   };
 
   // Hidden port creation function.  We don't want to expose an API that lets
@@ -119,7 +118,6 @@
       throw new Error("Port '" + portId + "' already exists.");
     var port = new Port(portId, opt_name);
     ports[portId] = port;
-    messagingNatives.PortAddRef(portId);
     return port;
   };
 
@@ -177,7 +175,11 @@
       var responseCallback = function(response) {
         if (port) {
           port.postMessage(response);
-          privates(port).impl.destroy_();
+          // TODO(robwu): This can be changed to disconnect() because there is
+          // no point in allowing other receivers at this end of the port to
+          // keep the channel alive because the opener port can only receive one
+          // message.
+          privates(port).impl.disconnectSoftly();
           port = null;
         } else {
           // We nulled out port when sending the response, and now the page
@@ -198,7 +200,7 @@
       // the context has been destroyed, so there isn't any JS state to clear.
       messagingNatives.BindToGC(responseCallback, function() {
         if (port) {
-          privates(port).impl.destroy_();
+          privates(port).impl.disconnectSoftly();
           port = null;
         }
       }, portId);
@@ -209,15 +211,12 @@
         if (!responseCallbackPreserved && port) {
           // If they didn't access the response callback, they're not
           // going to send a response, so clean up the port immediately.
-          privates(port).impl.destroy_();
+          privates(port).impl.disconnectSoftly();
           port = null;
         }
       }
     }
 
-    privates(port).impl.onDestroy_ = function() {
-      port.onMessage.removeListener(messageListener);
-    };
     port.onMessage.addListener(messageListener);
 
     var eventName = isSendMessage ? "runtime.onMessage" : "extension.onRequest";
@@ -314,8 +313,7 @@
   function dispatchOnDisconnect(portId, errorMessage) {
     var port = ports[portId];
     if (port) {
-      // Update the renderer's port bookkeeping, without notifying the browser.
-      messagingNatives.CloseChannel(portId, false);
+      delete ports[portId];
       if (errorMessage)
         lastError.set('Port', errorMessage, null, chrome);
       try {
@@ -398,10 +396,6 @@
       }
     }
 
-    privates(port).impl.onDestroy_ = function() {
-      port.onDisconnect.removeListener(disconnectListener);
-      port.onMessage.removeListener(messageListener);
-    };
     port.onDisconnect.addListener(disconnectListener);
     port.onMessage.addListener(messageListener);
   };
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 1790b26..1efa699 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -5227,35 +5227,6 @@
                (func.return_type, func.original_name,
                 func.MakeTypedOriginalArgString("")))
 
-  def WriteMojoGLES2ImplHeader(self, func, f):
-    """Writes the Mojo GLES2 implementation header."""
-    f.write("%s %s(%s) override;\n" %
-               (func.return_type, func.original_name,
-                func.MakeTypedOriginalArgString("")))
-
-  def WriteMojoGLES2Impl(self, func, f):
-    """Writes the Mojo GLES2 implementation."""
-    f.write("%s MojoGLES2Impl::%s(%s) {\n" %
-               (func.return_type, func.original_name,
-                func.MakeTypedOriginalArgString("")))
-    is_core_gl_func = func.IsCoreGLFunction()
-    is_ext = bool(func.GetInfo("extension"))
-    is_safe = not func.IsUnsafe()
-    if is_core_gl_func or (is_safe and is_ext):
-      f.write("MojoGLES2MakeCurrent(context_);");
-      func_return = "gl" + func.original_name + "(" + \
-          func.MakeOriginalArgString("") + ");"
-      if func.return_type == "void":
-        f.write(func_return);
-      else:
-        f.write("return " + func_return);
-    else:
-      f.write("NOTREACHED() << \"Unimplemented %s.\";\n" %
-                 func.original_name);
-      if func.return_type != "void":
-        f.write("return 0;")
-    f.write("}")
-
   def WriteGLES2InterfaceStub(self, func, f):
     """Writes the GLES2 Interface stub declaration."""
     f.write("%s %s(%s) override;\n" %
@@ -9758,14 +9729,6 @@
     """Writes the GLES2 Interface declaration."""
     self.type_handler.WriteGLES2InterfaceHeader(self, f)
 
-  def WriteMojoGLES2ImplHeader(self, f):
-    """Writes the Mojo GLES2 implementation header declaration."""
-    self.type_handler.WriteMojoGLES2ImplHeader(self, f)
-
-  def WriteMojoGLES2Impl(self, f):
-    """Writes the Mojo GLES2 implementation declaration."""
-    self.type_handler.WriteMojoGLES2Impl(self, f)
-
   def WriteGLES2InterfaceStub(self, f):
     """Writes the GLES2 Interface Stub declaration."""
     self.type_handler.WriteGLES2InterfaceStub(self, f)
@@ -10784,62 +10747,6 @@
         func.WriteGLES2InterfaceHeader(f)
     self.generated_cpp_filenames.append(filename)
 
-  def WriteMojoGLES2ImplHeader(self, filename):
-    """Writes the Mojo GLES2 implementation header."""
-    comment = ("// This file is included by gles2_interface.h to declare the\n"
-               "// GL api functions.\n")
-    code = """
-#include <memory>
-
-#include "gpu/command_buffer/client/gles2_interface.h"
-#include "mojo/public/c/gles2/gles2.h"
-
-namespace mojo {
-
-class MojoGLES2Impl : public gpu::gles2::GLES2Interface {
- public:
-  explicit MojoGLES2Impl(MojoGLES2Context context) {
-    context_ = context;
-  }
-  ~MojoGLES2Impl() override {}
-    """
-    with CHeaderWriter(filename, comment) as f:
-      f.write(code);
-      for func in self.original_functions:
-        func.WriteMojoGLES2ImplHeader(f)
-      code = """
- private:
-  MojoGLES2Context context_;
-};
-
-}  // namespace mojo
-      """
-      f.write(code);
-    self.generated_cpp_filenames.append(filename)
-
-  def WriteMojoGLES2Impl(self, filename):
-    """Writes the Mojo GLES2 implementation."""
-    code = """
-#include "mojo/gpu/mojo_gles2_impl_autogen.h"
-
-#include "base/logging.h"
-#include "mojo/public/c/gles2/chromium_extension.h"
-#include "mojo/public/c/gles2/gles2.h"
-
-namespace mojo {
-
-    """
-    with CWriter(filename) as f:
-      f.write(code);
-      for func in self.original_functions:
-        func.WriteMojoGLES2Impl(f)
-      code = """
-
-}  // namespace mojo
-    """
-      f.write(code);
-    self.generated_cpp_filenames.append(filename)
-
   def WriteGLES2InterfaceStub(self, filename):
     """Writes the GLES2 interface stub header."""
     comment = "// This file is included by gles2_interface_stub.h.\n"
@@ -11281,31 +11188,6 @@
         f.write("}\n\n")
     self.generated_cpp_filenames.append(filename)
 
-  def WriteMojoGLCallVisitor(self, filename):
-    """Provides the GL implementation for mojo"""
-    with CWriter(filename) as f:
-      for func in self.original_functions:
-        if not func.IsCoreGLFunction():
-          continue
-        f.write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
-                               (func.name, func.return_type,
-                                func.MakeTypedOriginalArgString(""),
-                                func.MakeOriginalArgString("")))
-    self.generated_cpp_filenames.append(filename)
-
-  def WriteMojoGLCallVisitorForExtension(self, filename):
-    """Provides the GL implementation for mojo for all extensions"""
-    with CWriter(filename) as f:
-      for func in self.original_functions:
-        if not func.GetInfo("extension"):
-          continue
-        if func.IsUnsafe():
-          continue
-        f.write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
-                               (func.name, func.return_type,
-                                func.MakeTypedOriginalArgString(""),
-                                func.MakeOriginalArgString("")))
-    self.generated_cpp_filenames.append(filename)
 
 def Format(generated_files):
   formatter = "clang-format"
@@ -11377,10 +11259,6 @@
     "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h")
   gen.WriteGLES2InterfaceHeader(
     "gpu/command_buffer/client/gles2_interface_autogen.h")
-  gen.WriteMojoGLES2ImplHeader(
-    "mojo/gpu/mojo_gles2_impl_autogen.h")
-  gen.WriteMojoGLES2Impl(
-    "mojo/gpu/mojo_gles2_impl_autogen.cc")
   gen.WriteGLES2InterfaceStub(
     "gpu/command_buffer/client/gles2_interface_stub_autogen.h")
   gen.WriteGLES2InterfaceStubImpl(
@@ -11425,9 +11303,6 @@
     "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h")
   gen.WriteGLES2Header("gpu/GLES2/gl2chromium_autogen.h")
   mojo_gles2_prefix = ("mojo/public/c/gles2/gles2_call_visitor")
-  gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h")
-  gen.WriteMojoGLCallVisitorForExtension(
-      mojo_gles2_prefix + "_chromium_extension_autogen.h")
 
   Format(gen.generated_cpp_filenames)
 
diff --git a/headless/lib/browser/headless_browser_context.cc b/headless/lib/browser/headless_browser_context.cc
index 59e50ae2..6d1a7cff 100644
--- a/headless/lib/browser/headless_browser_context.cc
+++ b/headless/lib/browser/headless_browser_context.cc
@@ -65,7 +65,7 @@
 }
 
 HeadlessBrowserContext::HeadlessBrowserContext(
-    const HeadlessBrowser::Options& options)
+    HeadlessBrowser::Options* options)
     : resource_context_(new HeadlessResourceContext), options_(options) {
   InitWhileIOAllowed();
 }
@@ -173,7 +173,7 @@
 }
 
 void HeadlessBrowserContext::SetOptionsForTesting(
-    const HeadlessBrowser::Options& options) {
+    HeadlessBrowser::Options* options) {
   options_ = options;
 }
 
diff --git a/headless/lib/browser/headless_browser_context.h b/headless/lib/browser/headless_browser_context.h
index 865b3c7..91bff65 100644
--- a/headless/lib/browser/headless_browser_context.h
+++ b/headless/lib/browser/headless_browser_context.h
@@ -19,7 +19,7 @@
 
 class HeadlessBrowserContext : public content::BrowserContext {
  public:
-  explicit HeadlessBrowserContext(const HeadlessBrowser::Options& options);
+  explicit HeadlessBrowserContext(HeadlessBrowser::Options* options);
   ~HeadlessBrowserContext() override;
 
   // BrowserContext implementation:
@@ -48,8 +48,8 @@
       const base::FilePath& partition_path,
       bool in_memory) override;
 
-  const HeadlessBrowser::Options& options() const { return options_; }
-  void SetOptionsForTesting(const HeadlessBrowser::Options& options);
+  HeadlessBrowser::Options* options() const { return options_; }
+  void SetOptionsForTesting(HeadlessBrowser::Options* options);
 
  private:
   // Performs initialization of the HeadlessBrowserContext while IO is still
@@ -58,7 +58,7 @@
 
   base::FilePath path_;
   std::unique_ptr<HeadlessResourceContext> resource_context_;
-  HeadlessBrowser::Options options_;
+  HeadlessBrowser::Options* options_;  // Not owned.
 
   DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContext);
 };
diff --git a/headless/lib/browser/headless_browser_impl.cc b/headless/lib/browser/headless_browser_impl.cc
index 06b3f14..3b19175 100644
--- a/headless/lib/browser/headless_browser_impl.cc
+++ b/headless/lib/browser/headless_browser_impl.cc
@@ -22,9 +22,9 @@
 
 HeadlessBrowserImpl::HeadlessBrowserImpl(
     const base::Callback<void(HeadlessBrowser*)>& on_start_callback,
-    const HeadlessBrowser::Options& options)
+    HeadlessBrowser::Options options)
     : on_start_callback_(on_start_callback),
-      options_(options),
+      options_(std::move(options)),
       browser_main_parts_(nullptr) {
   DCHECK(!on_start_callback_.is_null());
 }
@@ -112,24 +112,25 @@
 }
 
 void HeadlessBrowserImpl::SetOptionsForTesting(
-    const HeadlessBrowser::Options& options) {
-  options_ = options;
-  browser_context()->SetOptionsForTesting(options);
+    HeadlessBrowser::Options options) {
+  options_ = std::move(options);
+  browser_context()->SetOptionsForTesting(&options_);
 }
 
 int HeadlessBrowserMain(
-    const HeadlessBrowser::Options& options,
+    HeadlessBrowser::Options options,
     const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback) {
-  std::unique_ptr<HeadlessBrowserImpl> browser(
-      new HeadlessBrowserImpl(on_browser_start_callback, options));
+  content::ContentMainParams params(nullptr);
+  params.argc = options.argc;
+  params.argv = options.argv;
 
   // TODO(skyostil): Implement custom message pumps.
   DCHECK(!options.message_pump);
 
+  std::unique_ptr<HeadlessBrowserImpl> browser(
+      new HeadlessBrowserImpl(on_browser_start_callback, std::move(options)));
   headless::HeadlessContentMainDelegate delegate(std::move(browser));
-  content::ContentMainParams params(&delegate);
-  params.argc = options.argc;
-  params.argv = options.argv;
+  params.delegate = &delegate;
   return content::ContentMain(params);
 }
 
diff --git a/headless/lib/browser/headless_browser_impl.h b/headless/lib/browser/headless_browser_impl.h
index 53bcf13..95332ac 100644
--- a/headless/lib/browser/headless_browser_impl.h
+++ b/headless/lib/browser/headless_browser_impl.h
@@ -30,7 +30,7 @@
  public:
   HeadlessBrowserImpl(
       const base::Callback<void(HeadlessBrowser*)>& on_start_callback,
-      const HeadlessBrowser::Options& options);
+      HeadlessBrowser::Options options);
   ~HeadlessBrowserImpl() override;
 
   // HeadlessBrowser implementation:
@@ -50,7 +50,7 @@
 
   void RunOnStartCallback();
 
-  const HeadlessBrowser::Options& options() const { return options_; }
+  HeadlessBrowser::Options* options() { return &options_; }
 
   HeadlessWebContentsImpl* RegisterWebContents(
       std::unique_ptr<HeadlessWebContentsImpl> web_contents);
@@ -61,7 +61,7 @@
   // Customize the options used by this headless browser instance. Note that
   // options which take effect before the message loop has been started (e.g.,
   // custom message pumps) cannot be set via this method.
-  void SetOptionsForTesting(const HeadlessBrowser::Options& options);
+  void SetOptionsForTesting(HeadlessBrowser::Options options);
 
  protected:
   base::Callback<void(HeadlessBrowser*)> on_start_callback_;
diff --git a/headless/lib/browser/headless_browser_main_parts.cc b/headless/lib/browser/headless_browser_main_parts.cc
index 7a2ed47..9781e399 100644
--- a/headless/lib/browser/headless_browser_main_parts.cc
+++ b/headless/lib/browser/headless_browser_main_parts.cc
@@ -33,7 +33,7 @@
 
 void HeadlessBrowserMainParts::PreMainMessageLoopRun() {
   browser_context_.reset(new HeadlessBrowserContext(browser_->options()));
-  if (browser_->options().devtools_endpoint.address().IsValid()) {
+  if (browser_->options()->devtools_endpoint.address().IsValid()) {
     devtools_http_handler_ =
         CreateLocalDevToolsHttpHandler(browser_context_.get());
   }
diff --git a/headless/lib/browser/headless_devtools.cc b/headless/lib/browser/headless_devtools.cc
index 5945e3dd..e8c2915 100644
--- a/headless/lib/browser/headless_devtools.cc
+++ b/headless/lib/browser/headless_devtools.cc
@@ -93,13 +93,13 @@
 std::unique_ptr<DevToolsHttpHandler> CreateLocalDevToolsHttpHandler(
     HeadlessBrowserContext* browser_context) {
   const net::IPEndPoint& endpoint =
-      browser_context->options().devtools_endpoint;
+      browser_context->options()->devtools_endpoint;
   std::unique_ptr<DevToolsHttpHandler::ServerSocketFactory> socket_factory(
       new TCPServerSocketFactory(endpoint));
   return base::WrapUnique(new DevToolsHttpHandler(
       std::move(socket_factory), std::string(), new HeadlessDevToolsDelegate(),
       browser_context->GetPath(), base::FilePath(), std::string(),
-      browser_context->options().user_agent));
+      browser_context->options()->user_agent));
 }
 
 }  // namespace headless
diff --git a/headless/lib/browser/headless_url_request_context_getter.cc b/headless/lib/browser/headless_url_request_context_getter.cc
index 418b63f..2bd0d41 100644
--- a/headless/lib/browser/headless_url_request_context_getter.cc
+++ b/headless/lib/browser/headless_url_request_context_getter.cc
@@ -58,13 +58,15 @@
     content::ProtocolHandlerMap* protocol_handlers,
     content::URLRequestInterceptorScopedVector request_interceptors,
     net::NetLog* net_log,
-    const HeadlessBrowser::Options& options)
+    HeadlessBrowser::Options* options)
     : ignore_certificate_errors_(ignore_certificate_errors),
       base_path_(base_path),
       io_task_runner_(std::move(io_task_runner)),
       file_task_runner_(std::move(file_task_runner)),
       net_log_(net_log),
-      options_(options),
+      user_agent_(options->user_agent),
+      host_resolver_rules_(options->host_resolver_rules),
+      proxy_server_(options->proxy_server),
       request_interceptors_(std::move(request_interceptors)) {
   // Must first be created on the UI thread.
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -74,7 +76,7 @@
   // We must create the proxy config service on the UI loop on Linux because it
   // must synchronously run on the glib message loop. This will be passed to
   // the URLRequestContextStorage on the IO thread in GetURLRequestContext().
-  if (options_.proxy_server.IsEmpty())
+  if (proxy_server_.IsEmpty())
     proxy_config_service_ = GetProxyConfigService();
 }
 
@@ -93,8 +95,8 @@
 
 std::unique_ptr<net::ProxyService>
 HeadlessURLRequestContextGetter::GetProxyService() {
-  if (!options_.proxy_server.IsEmpty())
-    return net::ProxyService::CreateFixed(options_.proxy_server.ToString());
+  if (!proxy_server_.IsEmpty())
+    return net::ProxyService::CreateFixed(proxy_server_.ToString());
   return net::ProxyService::CreateUsingSystemProxyResolver(
       std::move(proxy_config_service_), 0, url_request_context_->net_log());
 }
@@ -117,7 +119,7 @@
                                   base::WorkerPool::GetTaskRunner(true))));
     // TODO(skyostil): Make language settings configurable.
     storage_->set_http_user_agent_settings(base::WrapUnique(
-        new net::StaticHttpUserAgentSettings("en-us,en", options_.user_agent)));
+        new net::StaticHttpUserAgentSettings("en-us,en", user_agent_)));
 
     std::unique_ptr<net::HostResolver> host_resolver(
         net::HostResolver::CreateDefaultResolver(
@@ -158,10 +160,10 @@
     network_session_params.net_log = url_request_context_->net_log();
     network_session_params.ignore_certificate_errors =
         ignore_certificate_errors_;
-    if (!options_.host_resolver_rules.empty()) {
+    if (!host_resolver_rules_.empty()) {
       std::unique_ptr<net::MappedHostResolver> mapped_host_resolver(
           new net::MappedHostResolver(std::move(host_resolver)));
-      mapped_host_resolver->SetRulesFromString(options_.host_resolver_rules);
+      mapped_host_resolver->SetRulesFromString(host_resolver_rules_);
       host_resolver = std::move(mapped_host_resolver);
     }
 
diff --git a/headless/lib/browser/headless_url_request_context_getter.h b/headless/lib/browser/headless_url_request_context_getter.h
index 99340a6c..d423b508 100644
--- a/headless/lib/browser/headless_url_request_context_getter.h
+++ b/headless/lib/browser/headless_url_request_context_getter.h
@@ -44,7 +44,7 @@
       content::ProtocolHandlerMap* protocol_handlers,
       content::URLRequestInterceptorScopedVector request_interceptors,
       net::NetLog* net_log,
-      const HeadlessBrowser::Options& options);
+      HeadlessBrowser::Options* options);
 
   // net::URLRequestContextGetter implementation:
   net::URLRequestContext* GetURLRequestContext() override;
@@ -66,7 +66,13 @@
   scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
   scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
   net::NetLog* net_log_;
-  HeadlessBrowser::Options options_;
+
+  // The |options| object given to the constructor is not guaranteed to outlive
+  // this class, so we make copies of the parts we need to access on the IO
+  // thread.
+  std::string user_agent_;
+  std::string host_resolver_rules_;
+  net::HostPortPair proxy_server_;
 
   std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
   std::unique_ptr<net::NetworkDelegate> network_delegate_;
diff --git a/headless/lib/headless_content_client.cc b/headless/lib/headless_content_client.cc
index f6c96e5e..377bc4aa 100644
--- a/headless/lib/headless_content_client.cc
+++ b/headless/lib/headless_content_client.cc
@@ -9,14 +9,13 @@
 
 namespace headless {
 
-HeadlessContentClient::HeadlessContentClient(
-    const HeadlessBrowser::Options& options)
+HeadlessContentClient::HeadlessContentClient(HeadlessBrowser::Options* options)
     : options_(options) {}
 
 HeadlessContentClient::~HeadlessContentClient() {}
 
 std::string HeadlessContentClient::GetUserAgent() const {
-  return options_.user_agent;
+  return options_->user_agent;
 }
 
 base::string16 HeadlessContentClient::GetLocalizedString(int message_id) const {
diff --git a/headless/lib/headless_content_client.h b/headless/lib/headless_content_client.h
index 2fc8163..be6ddba 100644
--- a/headless/lib/headless_content_client.h
+++ b/headless/lib/headless_content_client.h
@@ -12,7 +12,7 @@
 
 class HeadlessContentClient : public content::ContentClient {
  public:
-  explicit HeadlessContentClient(const HeadlessBrowser::Options& options);
+  explicit HeadlessContentClient(HeadlessBrowser::Options* options);
   ~HeadlessContentClient() override;
 
   // content::ContentClient implementation:
@@ -26,7 +26,7 @@
   gfx::Image& GetNativeImageNamed(int resource_id) const override;
 
  private:
-  HeadlessBrowser::Options options_;
+  HeadlessBrowser::Options* options_;  // Not owned.
 
   DISALLOW_COPY_AND_ASSIGN(HeadlessContentClient);
 };
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc
index e7ea8d769..97d0413 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -41,7 +41,7 @@
 bool HeadlessContentMainDelegate::BasicStartupComplete(int* exit_code) {
   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
 
-  if (browser_->options().single_process_mode)
+  if (browser_->options()->single_process_mode)
     command_line->AppendSwitch(switches::kSingleProcess);
 
   // The headless backend is automatically chosen for a headless build, but also
diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc
index 6ff0a0c3..07d2636 100644
--- a/headless/public/headless_browser.cc
+++ b/headless/public/headless_browser.cc
@@ -23,10 +23,12 @@
       message_pump(nullptr),
       single_process_mode(false) {}
 
-Options::Options(const Options& other) = default;
+Options::Options(Options&& options) = default;
 
 Options::~Options() {}
 
+Options& Options::operator=(Options&& options) = default;
+
 Builder::Builder(int argc, const char** argv) : options_(argc, argv) {}
 
 Builder::Builder() : options_(0, nullptr) {}
@@ -64,7 +66,7 @@
 }
 
 Options Builder::Build() {
-  return options_;
+  return std::move(options_);
 }
 
 }  // namespace headless
diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h
index de5f89b..4b36057 100644
--- a/headless/public/headless_browser.h
+++ b/headless/public/headless_browser.h
@@ -63,10 +63,12 @@
 
 // Embedding API overrides for the headless browser.
 struct HeadlessBrowser::Options {
-  Options(const Options& other);
+  class Builder;
+
+  Options(Options&& options);
   ~Options();
 
-  class Builder;
+  Options& operator=(Options&& options);
 
   // Command line options to be passed to browser.
   int argc;
@@ -97,6 +99,8 @@
 
  private:
   Options(int argc, const char** argv);
+
+  DISALLOW_COPY_AND_ASSIGN(Options);
 };
 
 class HeadlessBrowser::Options::Builder {
@@ -126,7 +130,7 @@
 // the main loop, it will only return after HeadlessBrowser::Shutdown() is
 // called, returning the exit code for the process.
 int HeadlessBrowserMain(
-    const HeadlessBrowser::Options& options,
+    HeadlessBrowser::Options options,
     const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback);
 
 }  // namespace headless
diff --git a/headless/test/headless_browser_test.cc b/headless/test/headless_browser_test.cc
index d81279ce..380ccd7 100644
--- a/headless/test/headless_browser_test.cc
+++ b/headless/test/headless_browser_test.cc
@@ -99,10 +99,9 @@
   }
 }
 
-void HeadlessBrowserTest::SetBrowserOptions(
-    const HeadlessBrowser::Options& options) {
+void HeadlessBrowserTest::SetBrowserOptions(HeadlessBrowser::Options options) {
   HeadlessContentMainDelegate::GetInstance()->browser()->SetOptionsForTesting(
-      options);
+      std::move(options));
 }
 
 HeadlessBrowser* HeadlessBrowserTest::browser() const {
diff --git a/headless/test/headless_browser_test.h b/headless/test/headless_browser_test.h
index f4875a2..0249cee 100644
--- a/headless/test/headless_browser_test.h
+++ b/headless/test/headless_browser_test.h
@@ -35,7 +35,7 @@
   // Customize the options used in this test. Note that options which take
   // effect before the message loop has been started (e.g., custom message
   // pumps) cannot be set via this method.
-  void SetBrowserOptions(const HeadlessBrowser::Options& options);
+  void SetBrowserOptions(HeadlessBrowser::Options options);
 
   // Run an asynchronous test in a nested run loop. The caller should call
   // FinishAsynchronousTest() to notify that the test should finish.
diff --git a/headless/test/headless_test_launcher.cc b/headless/test/headless_test_launcher.cc
index 13e4f6c9..da455005 100644
--- a/headless/test/headless_test_launcher.cc
+++ b/headless/test/headless_test_launcher.cc
@@ -18,10 +18,10 @@
 
 class HeadlessBrowserImplForTest : public HeadlessBrowserImpl {
  public:
-  explicit HeadlessBrowserImplForTest(const HeadlessBrowser::Options& options)
+  explicit HeadlessBrowserImplForTest(HeadlessBrowser::Options options)
       : HeadlessBrowserImpl(base::Bind(&HeadlessBrowserImplForTest::OnStart,
                                        base::Unretained(this)),
-                            options) {}
+                            std::move(options)) {}
 
   void OnStart(HeadlessBrowser* browser) { EXPECT_EQ(this, browser); }
 
diff --git a/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc b/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc
index e57b332..0afb768 100644
--- a/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc
+++ b/ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc
@@ -104,8 +104,9 @@
               base::SequencedWorkerPool::GetSequenceToken(),
               base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
   return base::WrapUnique(new ntp_snippets::NTPSnippetsService(
-      chrome_browser_state->GetPrefs(), sync_service, suggestions_service,
-      task_runner, GetApplicationContext()->GetApplicationLocale(), scheduler,
+      false /* enabled */, chrome_browser_state->GetPrefs(), sync_service,
+      suggestions_service, task_runner,
+      GetApplicationContext()->GetApplicationLocale(), scheduler,
       base::WrapUnique(new ntp_snippets::NTPSnippetsFetcher(
           signin_manager, token_service, request_context,
           base::Bind(&ParseJson),
diff --git a/ios/web/BUILD.gn b/ios/web/BUILD.gn
index b55ca09..e77799d 100644
--- a/ios/web/BUILD.gn
+++ b/ios/web/BUILD.gn
@@ -238,6 +238,8 @@
     "webui/crw_web_ui_page_builder.mm",
     "webui/mojo_facade.h",
     "webui/mojo_facade.mm",
+    "webui/mojo_js_constants.cc",
+    "webui/mojo_js_constants.h",
     "webui/shared_resources_data_source_ios.h",
     "webui/shared_resources_data_source_ios.mm",
     "webui/url_data_manager_ios.cc",
diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp
index 1a986c0..de416bee 100644
--- a/ios/web/ios_web.gyp
+++ b/ios/web/ios_web.gyp
@@ -272,6 +272,8 @@
         'webui/crw_web_ui_page_builder.mm',
         'webui/mojo_facade.h',
         'webui/mojo_facade.mm',
+        'webui/mojo_js_constants.cc',
+        'webui/mojo_js_constants.h',
         'webui/shared_resources_data_source_ios.h',
         'webui/shared_resources_data_source_ios.mm',
         'webui/url_data_manager_ios.cc',
diff --git a/ios/web/ios_web_resources.grd b/ios/web/ios_web_resources.grd
index 659f959e..5fc433f 100644
--- a/ios/web/ios_web_resources.grd
+++ b/ios/web/ios_web_resources.grd
@@ -17,6 +17,11 @@
       <include name="IDR_MOJO_ROUTER_JS" file="../../mojo/public/js/router.js" flattenhtml="true" type="BINDATA" />
       <include name="IDR_MOJO_UNICODE_JS" file="../../mojo/public/js/unicode.js" flattenhtml="true" type="BINDATA" />
       <include name="IDR_MOJO_VALIDATOR_JS" file="../../mojo/public/js/validator.js" flattenhtml="true" type="BINDATA" />
+      <include name="IDR_IOS_MOJO_SUPPORT_JS" file="webui/resources/support.js" flattenhtml="true" type="BINDATA" />
+      <include name="IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS" file="webui/resources/sync_message_channel.js" flattenhtml="true" type="BINDATA" />
+      <include name="IDR_IOS_MOJO_HANDLE_UTIL_JS" file="webui/resources/handle_util.js" flattenhtml="true" type="BINDATA" />
+      <include name="IDR_IOS_MOJO_CORE_JS" file="webui/resources/core.js" flattenhtml="true" type="BINDATA" />
+      <include name="IDR_IOS_MOJO_SERVICE_PROVIDER_JS" file="webui/resources/service_provider.js" flattenhtml="true" type="BINDATA" />
     </includes>
   </release>
 </grit>
diff --git a/ios/web/shell/test/web_shell_navigation_egtest.mm b/ios/web/shell/test/web_shell_navigation_egtest.mm
index e3a58281..26fad43 100644
--- a/ios/web/shell/test/web_shell_navigation_egtest.mm
+++ b/ios/web/shell/test/web_shell_navigation_egtest.mm
@@ -139,4 +139,11 @@
       assertWithMatcher:grey_notNil()];
 }
 
+// Tests that sometimes passing and failing makes the bots red.
+// TODO(crbug.com/614729): Remove this test once it is verified that
+// infrastructure is properly working.
+- (void)testCoinFlip {
+  GREYAssertTrue(arc4random_uniform(10) < 5, @"Failed coin flip.");
+}
+
 @end
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm
index b98c388e..e5520ff1 100644
--- a/ios/web/webui/crw_web_ui_manager.mm
+++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -20,6 +20,7 @@
 #import "ios/web/public/web_state/web_state_observer_bridge.h"
 #include "ios/web/web_state/web_state_impl.h"
 #import "ios/web/webui/crw_web_ui_page_builder.h"
+#include "ios/web/webui/mojo_js_constants.h"
 #include "ios/web/webui/url_fetcher_block_adapter.h"
 #include "mojo/public/js/constants.h"
 #import "net/base/mac/url_conversions.h"
@@ -251,6 +252,12 @@
       {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS},
       {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS},
       {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS},
+      {web::kSyncMessageChannelModuleName,
+       IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS},
+      {web::kHandleUtilModuleName, IDR_IOS_MOJO_HANDLE_UTIL_JS},
+      {web::kSupportModuleName, IDR_IOS_MOJO_SUPPORT_JS},
+      {web::kCoreModuleName, IDR_IOS_MOJO_CORE_JS},
+      {web::kServiceProviderModuleName, IDR_IOS_MOJO_SERVICE_PROVIDER_JS},
   };
   scoped_refptr<base::RefCountedStaticMemory> scriptData(
       web::GetWebClient()->GetDataResourceBytes(resource_map[moduleName]));
diff --git a/ios/web/webui/mojo_js_constants.cc b/ios/web/webui/mojo_js_constants.cc
new file mode 100644
index 0000000..711e73d
--- /dev/null
+++ b/ios/web/webui/mojo_js_constants.cc
@@ -0,0 +1,17 @@
+// Copyright 2016 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 "ios/web/webui/mojo_js_constants.h"
+
+namespace web {
+
+const char kSyncMessageChannelModuleName[] =
+    "ios/mojo/public/js/sync_message_channel";
+const char kHandleUtilModuleName[] = "ios/mojo/public/js/handle_util";
+const char kSupportModuleName[] = "mojo/public/js/support";
+const char kCoreModuleName[] = "mojo/public/js/core";
+const char kServiceProviderModuleName[] =
+    "content/public/renderer/service_provider";
+
+}  // namespace web
diff --git a/ios/web/webui/mojo_js_constants.h b/ios/web/webui/mojo_js_constants.h
new file mode 100644
index 0000000..81a21939
--- /dev/null
+++ b/ios/web/webui/mojo_js_constants.h
@@ -0,0 +1,18 @@
+// Copyright 2016 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 IOS_WEB_WEBUI_MOJO_JS_CONSTANTS_H_
+#define IOS_WEB_WEBUI_MOJO_JS_CONSTANTS_H_
+
+namespace web {
+
+extern const char kSyncMessageChannelModuleName[];
+extern const char kHandleUtilModuleName[];
+extern const char kSupportModuleName[];
+extern const char kCoreModuleName[];
+extern const char kServiceProviderModuleName[];
+
+}  // namespace web
+
+#endif  // IOS_WEB_WEBUI_MOJO_JS_CONSTANTS_H_
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index b342412..4fd8a9aa 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -318,23 +318,20 @@
   channel_.reset();
 }
 
-void ChannelProxy::Context::SendFromThisThread(Message* message) {
-  base::AutoLock l(channel_lifetime_lock_);
-  if (!channel_)
-    return;
-  DCHECK(channel_->IsSendThreadSafe());
-  channel_->Send(message);
-}
-
-void ChannelProxy::Context::Send(Message* message) {
-  if (channel_send_thread_safe_) {
-    SendFromThisThread(message);
-    return;
+bool ChannelProxy::Context::Send(std::unique_ptr<Message> message,
+                                 bool force_io_thread) {
+  if (channel_send_thread_safe_ && !force_io_thread) {
+    base::AutoLock l(channel_lifetime_lock_);
+    if (!channel_)
+      return false;
+    DCHECK(channel_->IsSendThreadSafe());
+    return channel_->Send(message.release());
   }
 
   ipc_task_runner()->PostTask(
       FROM_HERE, base::Bind(&ChannelProxy::Context::OnSendMessage, this,
-                            base::Passed(base::WrapUnique(message))));
+                            base::Passed(&message)));
+  return true;
 }
 
 bool ChannelProxy::Context::IsChannelSendThreadSafe() const {
@@ -377,11 +374,7 @@
 ChannelProxy::ChannelProxy(
     Listener* listener,
     const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
-    : context_(new Context(listener, ipc_task_runner)), did_init_(false) {
-#if defined(ENABLE_IPC_FUZZER)
-  outgoing_message_filter_ = NULL;
-#endif
-}
+    : ChannelProxy(new Context(listener, ipc_task_runner)) {}
 
 ChannelProxy::~ChannelProxy() {
   DCHECK(CalledOnValidThread());
@@ -444,25 +437,15 @@
 }
 
 bool ChannelProxy::Send(Message* message) {
-  DCHECK(did_init_);
+  return SendImpl(base::WrapUnique(message), true /* force_io_thread */);
+}
 
-  // TODO(alexeypa): add DCHECK(CalledOnValidThread()) here. Currently there are
-  // tests that call Send() from a wrong thread. See http://crbug.com/163523.
+bool ChannelProxy::SendNow(std::unique_ptr<Message> message) {
+  return SendImpl(std::move(message), false /* force_io_thread */);
+}
 
-#ifdef ENABLE_IPC_FUZZER
-  // In IPC fuzzing builds, it is possible to define a filter to apply to
-  // outgoing messages. It will either rewrite the message and return a new
-  // one, freeing the original, or return the message unchanged.
-  if (outgoing_message_filter())
-    message = outgoing_message_filter()->Rewrite(message);
-#endif
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
-  Logging::GetInstance()->OnSendMessage(message, context_->channel_id());
-#endif
-
-  context_->Send(message);
-  return true;
+bool ChannelProxy::SendOnIPCThread(std::unique_ptr<Message> message) {
+  return SendImpl(std::move(message), true /* force_io_thread */);
 }
 
 void ChannelProxy::AddFilter(MessageFilter* filter) {
@@ -519,6 +502,28 @@
 void ChannelProxy::OnChannelInit() {
 }
 
+bool ChannelProxy::SendImpl(std::unique_ptr<Message> message,
+                            bool force_io_thread) {
+  DCHECK(did_init_);
+
+  // TODO(alexeypa): add DCHECK(CalledOnValidThread()) here. Currently there are
+  // tests that call Send() from a wrong thread. See http://crbug.com/163523.
+
+#ifdef ENABLE_IPC_FUZZER
+  // In IPC fuzzing builds, it is possible to define a filter to apply to
+  // outgoing messages. It will either rewrite the message and return a new
+  // one, freeing the original, or return the message unchanged.
+  if (outgoing_message_filter())
+    message.reset(outgoing_message_filter()->Rewrite(message.release()));
+#endif
+
+#ifdef IPC_MESSAGE_LOG_ENABLED
+  Logging::GetInstance()->OnSendMessage(message.get(), context_->channel_id());
+#endif
+
+  return context_->Send(std::move(message), force_io_thread);
+}
+
 //-----------------------------------------------------------------------------
 
 }  // namespace IPC
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 0c93233..c28ba2f 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -123,10 +123,24 @@
   // with / allow for this possibility.
   void Close();
 
-  // Send a message asynchronously.  The message is routed to the background
-  // thread where it is passed to the IPC::Channel's Send method.
+  // DEPRECATED: Please use either SendNow or SendOnIPCThread to make ordering
+  // expectations explicit.
+  //
+  // This is an alias for for SendOnIPCThread.
   bool Send(Message* message) override;
 
+  // Send a message as soon as possible. This method may send the message
+  // immediately, or it may defer and send on the IPC thread. Use this when you
+  // you don't care about strict ordering of the send operation with respect to
+  // tasks on the IPC thread. This is most commonly what you want.
+  virtual bool SendNow(std::unique_ptr<Message> message);
+
+  // Send a message from the IPC thread. This immediately posts a task to the
+  // IPC thread task runner to send the message. Use this when you're posting
+  // other related tasks to the IPC thread and you need to guarantee that the
+  // send operation is ordered with respect to those tasks.
+  virtual bool SendOnIPCThread(std::unique_ptr<Message> message);
+
   // Used to intercept messages as they are received on the background thread.
   //
   // Ordinarily, messages sent to the ChannelProxy are routed to the matching
@@ -181,7 +195,7 @@
     void OnDispatchMessage(const Message& message);
 
     // Sends |message| from appropriate thread.
-    void Send(Message* message);
+    bool Send(std::unique_ptr<Message> message, bool force_io_thread);
 
     // Indicates if the underlying channel's Send is thread-safe.
     bool IsChannelSendThreadSafe() const;
@@ -235,7 +249,6 @@
     void OnDispatchError();
     void OnDispatchBadMessage(const Message& message);
 
-    void SendFromThisThread(Message* message);
     void ClearChannel();
 
     scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner_;
@@ -296,6 +309,8 @@
   // Always called once immediately after Init.
   virtual void OnChannelInit();
 
+  bool SendImpl(std::unique_ptr<Message> message, bool force_io_thread);
+
   // By maintaining this indirection (ref-counted) to our internal state, we
   // can safely be destroyed while the background thread continues to do stuff
   // that involves this data.
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index de54755..efc008a0 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -605,4 +605,36 @@
   pre_init_sync_message_filters_.clear();
 }
 
+bool SyncChannel::SendNow(std::unique_ptr<Message> message) {
+#ifdef IPC_MESSAGE_LOG_ENABLED
+  std::string name;
+  Logging::GetInstance()->GetMessageText(
+      message->type(), &name, message.get(), nullptr);
+  TRACE_EVENT1("ipc", "SyncChannel::SendNow", "name", name);
+#else
+  TRACE_EVENT2("ipc", "SyncChannel::SendNow",
+               "class", IPC_MESSAGE_ID_CLASS(message->type()),
+               "line", IPC_MESSAGE_ID_LINE(message->type()));
+#endif
+  if (!message->is_sync())
+    return ChannelProxy::SendNow(std::move(message));
+  return Send(message.release());
+}
+
+bool SyncChannel::SendOnIPCThread(std::unique_ptr<Message> message) {
+#ifdef IPC_MESSAGE_LOG_ENABLED
+  std::string name;
+  Logging::GetInstance()->GetMessageText(
+      message->type(), &name, message.get(), nullptr);
+  TRACE_EVENT1("ipc", "SyncChannel::SendOnIPCThread", "name", name);
+#else
+  TRACE_EVENT2("ipc", "SyncChannel::SendOnIPCThread",
+               "class", IPC_MESSAGE_ID_CLASS(message->type()),
+               "line", IPC_MESSAGE_ID_LINE(message->type()));
+#endif
+  if (!message->is_sync())
+    return ChannelProxy::SendOnIPCThread(std::move(message));
+  return Send(message.release());
+}
+
 }  // namespace IPC
diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index 103925a..bfa9b93 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -229,6 +229,8 @@
 
   // ChannelProxy overrides:
   void OnChannelInit() override;
+  bool SendNow(std::unique_ptr<Message> message) override;
+  bool SendOnIPCThread(std::unique_ptr<Message> message) override;
 
   // Used to signal events between the IPC and listener threads.
   base::WaitableEventWatcher dispatch_watcher_;
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc
index da883f6..6504aee 100644
--- a/ipc/ipc_sync_message_filter.cc
+++ b/ipc/ipc_sync_message_filter.cc
@@ -19,10 +19,7 @@
   if (!message->is_sync()) {
     {
       base::AutoLock auto_lock(lock_);
-      if (sender_ && is_channel_send_thread_safe_) {
-        sender_->Send(message);
-        return true;
-      } else if (!io_task_runner_.get()) {
+      if (!io_task_runner_.get()) {
         pending_messages_.push_back(message);
         return true;
       }
@@ -117,6 +114,19 @@
   return false;
 }
 
+bool SyncMessageFilter::SendNow(std::unique_ptr<Message> message) {
+  if (!message->is_sync()) {
+    base::AutoLock auto_lock(lock_);
+    if (sender_ && is_channel_send_thread_safe_) {
+      sender_->Send(message.release());
+      return true;
+    }
+  }
+
+  // Fall back on default Send behavior.
+  return Send(message.release());
+}
+
 SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event,
                                      bool is_channel_send_thread_safe)
     : sender_(NULL),
diff --git a/ipc/ipc_sync_message_filter.h b/ipc/ipc_sync_message_filter.h
index 27584359..d2ffe87 100644
--- a/ipc/ipc_sync_message_filter.h
+++ b/ipc/ipc_sync_message_filter.h
@@ -5,6 +5,7 @@
 #ifndef IPC_IPC_SYNC_MESSAGE_FILTER_H_
 #define IPC_IPC_SYNC_MESSAGE_FILTER_H_
 
+#include <memory>
 #include <set>
 
 #include "base/macros.h"
@@ -39,6 +40,10 @@
   void OnChannelClosing() override;
   bool OnMessageReceived(const Message& message) override;
 
+  // Like Send but may send immediately (instead of posting to the IPC thread)
+  // if the underlying Channel implements a thread-safe Send.
+  bool SendNow(std::unique_ptr<Message> message);
+
  protected:
   SyncMessageFilter(base::WaitableEvent* shutdown_event,
                     bool is_channel_send_thread_safe);
diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc
index 74fec87c..904e1e8 100644
--- a/ipc/mojo/ipc_channel_mojo.cc
+++ b/ipc/mojo/ipc_channel_mojo.cc
@@ -351,7 +351,7 @@
 }
 
 bool ChannelMojo::IsSendThreadSafe() const {
-  return false;
+  return true;
 }
 
 base::ProcessId ChannelMojo::GetPeerPID() const {
diff --git a/mash/wm/BUILD.gn b/mash/wm/BUILD.gn
index 24447636..81a5b8c4 100644
--- a/mash/wm/BUILD.gn
+++ b/mash/wm/BUILD.gn
@@ -187,7 +187,6 @@
     "//mojo/converters/geometry",
     "//mojo/converters/input_events",
     "//mojo/edk/system",
-    "//mojo/gles2",
     "//mojo/public/cpp/system",
     "//services/shell/public/cpp:shell_test_support",
     "//testing/gtest",
diff --git a/mash/wm/window_manager_application.cc b/mash/wm/window_manager_application.cc
index f9bbf44..d50cf40 100644
--- a/mash/wm/window_manager_application.cc
+++ b/mash/wm/window_manager_application.cc
@@ -24,7 +24,6 @@
 #include "services/tracing/public/cpp/tracing_impl.h"
 #include "ui/events/event.h"
 #include "ui/views/mus/aura_init.h"
-#include "ui/views/mus/display_converter.h"
 #include "ui/views/mus/screen_mus.h"
 
 namespace mash {
diff --git a/mojo/converters/surfaces/surfaces_type_converters.cc b/mojo/converters/surfaces/surfaces_type_converters.cc
index 684bdd9..57742a2 100644
--- a/mojo/converters/surfaces/surfaces_type_converters.cc
+++ b/mojo/converters/surfaces/surfaces_type_converters.cc
@@ -256,18 +256,16 @@
 SurfaceIdPtr TypeConverter<SurfaceIdPtr, cc::SurfaceId>::Convert(
     const cc::SurfaceId& input) {
   SurfaceIdPtr id(SurfaceId::New());
-  id->local = static_cast<uint32_t>(input.id);
-  id->id_namespace = cc::SurfaceIdAllocator::NamespaceForId(input);
+  id->id_namespace = input.id_namespace();
+  id->local_id = input.local_id();
+  id->nonce = input.nonce();
   return id;
 }
 
 // static
 cc::SurfaceId TypeConverter<cc::SurfaceId, SurfaceIdPtr>::Convert(
     const SurfaceIdPtr& input) {
-  uint64_t packed_id = input->id_namespace;
-  packed_id <<= 32ull;
-  packed_id |= input->local;
-  return cc::SurfaceId(packed_id);
+  return cc::SurfaceId(input->id_namespace, input->local_id, input->nonce);
 }
 
 // static
diff --git a/mojo/converters/surfaces/tests/surface_unittest.cc b/mojo/converters/surfaces/tests/surface_unittest.cc
index 4e961229..f8fae2d 100644
--- a/mojo/converters/surfaces/tests/surface_unittest.cc
+++ b/mojo/converters/surfaces/tests/surface_unittest.cc
@@ -70,7 +70,7 @@
 }
 
 TEST(SurfaceLibTest, SurfaceIdConverterValidId) {
-  cc::SurfaceId valid_id(7);
+  cc::SurfaceId valid_id(0, 7, 0);
   cc::SurfaceId round_trip = SurfaceId::From(valid_id).To<cc::SurfaceId>();
   EXPECT_FALSE(round_trip.is_null());
   EXPECT_EQ(valid_id, round_trip);
@@ -131,7 +131,7 @@
 TEST_F(SurfaceLibQuadTest, SurfaceQuad) {
   cc::SurfaceDrawQuad* surface_quad =
       pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
-  cc::SurfaceId arbitrary_id(5);
+  cc::SurfaceId arbitrary_id(0, 5, 0);
   surface_quad->SetAll(
       sqs, rect, opaque_rect, visible_rect, needs_blending, arbitrary_id);
 
@@ -295,7 +295,7 @@
 
   cc::SurfaceDrawQuad* surface_quad =
       pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
-  cc::SurfaceId arbitrary_id(5);
+  cc::SurfaceId arbitrary_id(0, 5, 0);
   surface_quad->SetAll(
       sqs, rect, opaque_rect, visible_rect, needs_blending, arbitrary_id);
 
diff --git a/mojo/gles2/BUILD.gn b/mojo/gles2/BUILD.gn
deleted file mode 100644
index 5cacc43..0000000
--- a/mojo/gles2/BUILD.gn
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-config("mojo_use_gles2") {
-  defines = [ "MOJO_USE_GLES2_IMPL" ]
-}
-
-config("gles2_use_mojo") {
-  defines = [ "GLES2_USE_MOJO" ]
-}
-
-component("gles2") {
-  output_name = "mojo_gles2_impl"
-  sources = [
-    "gles2_impl.cc",
-  ]
-
-  defines = [
-    "GL_GLEXT_PROTOTYPES",
-    "MOJO_GLES2_IMPLEMENTATION",
-  ]
-
-  configs += [
-    ":gles2_use_mojo",
-    ":mojo_use_gles2",
-  ]
-  public_configs = [
-    ":gles2_use_mojo",
-    "//third_party/khronos:khronos_headers",
-  ]
-  all_dependent_configs = [ ":mojo_use_gles2" ]
-
-  public_deps = [
-    "//mojo/public/c/gles2",
-  ]
-
-  deps = [
-    "//base",
-    "//base/third_party/dynamic_annotations",
-    "//components/mus/public/cpp",
-    "//gpu/command_buffer/client:gles2_interface",
-    "//mojo/public/c/system:for_component",
-  ]
-
-  include_dirs = [ ".." ]
-}
diff --git a/mojo/gles2/DEPS b/mojo/gles2/DEPS
deleted file mode 100644
index 492e5181..0000000
--- a/mojo/gles2/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-include_rules = [
-  "+components/mus/gles2",
-  "+components/mus/public",
-  "+gpu",
-]
diff --git a/mojo/gles2/README.md b/mojo/gles2/README.md
deleted file mode 100644
index d80cd8e..0000000
--- a/mojo/gles2/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-Mojo GLES2
-==========
-
-TODO(yzshen): move these files as well as mojo/public/c/gles2 to where they
-belong (likely components/mus).
diff --git a/mojo/gles2/gles2_impl.cc b/mojo/gles2/gles2_impl.cc
deleted file mode 100644
index c9522f7..0000000
--- a/mojo/gles2/gles2_impl.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdint.h>
-
-#include <utility>
-
-#include "base/lazy_instance.h"
-#include "base/threading/thread_local.h"
-#include "components/mus/public/cpp/gles2_context.h"
-#include "gpu/GLES2/gl2extchromium.h"
-#include "gpu/command_buffer/client/gles2_interface.h"
-// Even though this isn't used here, we need to include it to get the symbols to
-// be exported in component build.
-#include "mojo/public/c/gles2/chromium_extension.h"
-#include "mojo/public/c/gles2/gles2.h"
-
-using mus::GLES2Context;
-
-namespace {
-
-const int32_t kNone = 0x3038;  // EGL_NONE
-
-base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky
-    g_gpu_interface;
-
-}  // namespace
-
-extern "C" {
-MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle,
-                                        const int32_t* attrib_list,
-                                        MojoGLES2ContextLost lost_callback,
-                                        void* closure) {
-  mojo::MessagePipeHandle mph(handle);
-  mojo::ScopedMessagePipeHandle scoped_handle(mph);
-  std::vector<int32_t> attribs;
-  if (attrib_list) {
-    for (int32_t const* p = attrib_list; *p != kNone;) {
-      attribs.push_back(*p++);
-      attribs.push_back(*p++);
-    }
-  }
-  attribs.push_back(kNone);
-  std::unique_ptr<GLES2Context> client(new GLES2Context(
-      attribs, std::move(scoped_handle), lost_callback, closure));
-  if (!client->Initialize())
-    client.reset();
-  return client.release();
-}
-
-void MojoGLES2DestroyContext(MojoGLES2Context context) {
-  delete static_cast<GLES2Context*>(context);
-}
-
-void MojoGLES2MakeCurrent(MojoGLES2Context context) {
-  gpu::gles2::GLES2Interface* interface = NULL;
-  if (context) {
-    GLES2Context* client = static_cast<GLES2Context*>(context);
-    interface = client->interface();
-    DCHECK(interface);
-  }
-  g_gpu_interface.Get().Set(interface);
-}
-
-void MojoGLES2SwapBuffers() {
-  DCHECK(g_gpu_interface.Get().Get());
-  g_gpu_interface.Get().Get()->SwapBuffers();
-}
-
-void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) {
-  return static_cast<GLES2Context*>(context)->interface();
-}
-
-void* MojoGLES2GetContextSupport(MojoGLES2Context context) {
-  return static_cast<GLES2Context*>(context)->context_support();
-}
-
-#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
-  ReturnType GL_APIENTRY gl##Function PARAMETERS {                 \
-    DCHECK(g_gpu_interface.Get().Get());                           \
-    return g_gpu_interface.Get().Get()->Function ARGUMENTS;        \
-  }
-#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
-#include "mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h"
-#undef VISIT_GL_CALL
-
-}  // extern "C"
diff --git a/mojo/public/c/gles2/BUILD.gn b/mojo/public/c/gles2/BUILD.gn
deleted file mode 100644
index 538b3058..0000000
--- a/mojo/public/c/gles2/BUILD.gn
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-config("gles2_config") {
-  defines = [ "GLES2_USE_MOJO" ]
-}
-
-source_set("gles2") {
-  sources = [
-    "chromium_extension.h",
-    "gles2.h",
-    "gles2_call_visitor_autogen.h",
-    "gles2_call_visitor_chromium_extension_autogen.h",
-    "gles2_export.h",
-    "gles2_types.h",
-  ]
-
-  public_configs = [ ":gles2_config" ]
-
-  public_deps = [
-    "//mojo/public/c/system",
-  ]
-}
diff --git a/mojo/public/c/gles2/chromium_extension.h b/mojo/public/c/gles2/chromium_extension.h
deleted file mode 100644
index 3359c7e6..0000000
--- a/mojo/public/c/gles2/chromium_extension.h
+++ /dev/null
@@ -1,32 +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 MOJO_PUBLIC_C_GLES2_CHROMIUM_EXTENSION_H_
-#define MOJO_PUBLIC_C_GLES2_CHROMIUM_EXTENSION_H_
-
-// Note: This header should be compilable as C.
-
-#include <GLES2/gl2.h>
-#include <stdint.h>
-
-#include "mojo/public/c/gles2/gles2_export.h"
-#include "mojo/public/c/gles2/gles2_types.h"
-#include "mojo/public/c/system/types.h"
-
-extern "C" typedef struct _ClientBuffer* ClientBuffer;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
-  MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS;
-#include "mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h"
-#undef VISIT_GL_CALL
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // MOJO_PUBLIC_C_GLES2_CHROMIUM_EXTENSION_H_
diff --git a/mojo/public/c/gles2/gles2.h b/mojo/public/c/gles2/gles2.h
deleted file mode 100644
index 6c0b44e..0000000
--- a/mojo/public/c/gles2/gles2.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_C_GLES2_GLES2_H_
-#define MOJO_PUBLIC_C_GLES2_GLES2_H_
-
-// Note: This header should be compilable as C.
-
-#include <GLES2/gl2.h>
-#include <stdint.h>
-
-#include "mojo/public/c/gles2/gles2_export.h"
-#include "mojo/public/c/gles2/gles2_types.h"
-#include "mojo/public/c/system/types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-MOJO_GLES2_EXPORT MojoGLES2Context
-MojoGLES2CreateContext(MojoHandle handle,
-                       const int32_t* attrib_list,
-                       MojoGLES2ContextLost lost_callback,
-                       void* closure);
-MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context);
-MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context);
-MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers(void);
-
-// TODO(piman): We shouldn't have to leak this interface, especially in a
-// type-unsafe way.
-MOJO_GLES2_EXPORT void* MojoGLES2GetGLES2Interface(MojoGLES2Context context);
-
-#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
-  MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS;
-#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
-#undef VISIT_GL_CALL
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // MOJO_PUBLIC_C_GLES2_GLES2_H_
diff --git a/mojo/public/c/gles2/gles2_call_visitor_autogen.h b/mojo/public/c/gles2/gles2_call_visitor_autogen.h
deleted file mode 100644
index 64adecfd..0000000
--- a/mojo/public/c/gles2/gles2_call_visitor_autogen.h
+++ /dev/null
@@ -1,537 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is auto-generated from
-// gpu/command_buffer/build_gles2_cmd_buffer.py
-// It's formatted by clang-format using chromium coding style:
-//    clang-format -i -style=chromium filename
-// DO NOT EDIT!
-
-VISIT_GL_CALL(ActiveTexture, void, (GLenum texture), (texture))
-VISIT_GL_CALL(AttachShader,
-              void,
-              (GLuint program, GLuint shader),
-              (program, shader))
-VISIT_GL_CALL(BindAttribLocation,
-              void,
-              (GLuint program, GLuint index, const char* name),
-              (program, index, name))
-VISIT_GL_CALL(BindBuffer,
-              void,
-              (GLenum target, GLuint buffer),
-              (target, buffer))
-VISIT_GL_CALL(BindFramebuffer,
-              void,
-              (GLenum target, GLuint framebuffer),
-              (target, framebuffer))
-VISIT_GL_CALL(BindRenderbuffer,
-              void,
-              (GLenum target, GLuint renderbuffer),
-              (target, renderbuffer))
-VISIT_GL_CALL(BindTexture,
-              void,
-              (GLenum target, GLuint texture),
-              (target, texture))
-VISIT_GL_CALL(BlendColor,
-              void,
-              (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha),
-              (red, green, blue, alpha))
-VISIT_GL_CALL(BlendEquation, void, (GLenum mode), (mode))
-VISIT_GL_CALL(BlendEquationSeparate,
-              void,
-              (GLenum modeRGB, GLenum modeAlpha),
-              (modeRGB, modeAlpha))
-VISIT_GL_CALL(BlendFunc,
-              void,
-              (GLenum sfactor, GLenum dfactor),
-              (sfactor, dfactor))
-VISIT_GL_CALL(BlendFuncSeparate,
-              void,
-              (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha),
-              (srcRGB, dstRGB, srcAlpha, dstAlpha))
-VISIT_GL_CALL(BufferData,
-              void,
-              (GLenum target, GLsizeiptr size, const void* data, GLenum usage),
-              (target, size, data, usage))
-VISIT_GL_CALL(
-    BufferSubData,
-    void,
-    (GLenum target, GLintptr offset, GLsizeiptr size, const void* data),
-    (target, offset, size, data))
-VISIT_GL_CALL(CheckFramebufferStatus, GLenum, (GLenum target), (target))
-VISIT_GL_CALL(Clear, void, (GLbitfield mask), (mask))
-VISIT_GL_CALL(ClearColor,
-              void,
-              (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha),
-              (red, green, blue, alpha))
-VISIT_GL_CALL(ClearDepthf, void, (GLclampf depth), (depth))
-VISIT_GL_CALL(ClearStencil, void, (GLint s), (s))
-VISIT_GL_CALL(ColorMask,
-              void,
-              (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha),
-              (red, green, blue, alpha))
-VISIT_GL_CALL(CompileShader, void, (GLuint shader), (shader))
-VISIT_GL_CALL(
-    CompressedTexImage2D,
-    void,
-    (GLenum target,
-     GLint level,
-     GLenum internalformat,
-     GLsizei width,
-     GLsizei height,
-     GLint border,
-     GLsizei imageSize,
-     const void* data),
-    (target, level, internalformat, width, height, border, imageSize, data))
-VISIT_GL_CALL(
-    CompressedTexSubImage2D,
-    void,
-    (GLenum target,
-     GLint level,
-     GLint xoffset,
-     GLint yoffset,
-     GLsizei width,
-     GLsizei height,
-     GLenum format,
-     GLsizei imageSize,
-     const void* data),
-    (target, level, xoffset, yoffset, width, height, format, imageSize, data))
-VISIT_GL_CALL(CopyTexImage2D,
-              void,
-              (GLenum target,
-               GLint level,
-               GLenum internalformat,
-               GLint x,
-               GLint y,
-               GLsizei width,
-               GLsizei height,
-               GLint border),
-              (target, level, internalformat, x, y, width, height, border))
-VISIT_GL_CALL(CopyTexSubImage2D,
-              void,
-              (GLenum target,
-               GLint level,
-               GLint xoffset,
-               GLint yoffset,
-               GLint x,
-               GLint y,
-               GLsizei width,
-               GLsizei height),
-              (target, level, xoffset, yoffset, x, y, width, height))
-VISIT_GL_CALL(CreateProgram, GLuint, (), ())
-VISIT_GL_CALL(CreateShader, GLuint, (GLenum type), (type))
-VISIT_GL_CALL(CullFace, void, (GLenum mode), (mode))
-VISIT_GL_CALL(DeleteBuffers,
-              void,
-              (GLsizei n, const GLuint* buffers),
-              (n, buffers))
-VISIT_GL_CALL(DeleteFramebuffers,
-              void,
-              (GLsizei n, const GLuint* framebuffers),
-              (n, framebuffers))
-VISIT_GL_CALL(DeleteProgram, void, (GLuint program), (program))
-VISIT_GL_CALL(DeleteRenderbuffers,
-              void,
-              (GLsizei n, const GLuint* renderbuffers),
-              (n, renderbuffers))
-VISIT_GL_CALL(DeleteShader, void, (GLuint shader), (shader))
-VISIT_GL_CALL(DeleteTextures,
-              void,
-              (GLsizei n, const GLuint* textures),
-              (n, textures))
-VISIT_GL_CALL(DepthFunc, void, (GLenum func), (func))
-VISIT_GL_CALL(DepthMask, void, (GLboolean flag), (flag))
-VISIT_GL_CALL(DepthRangef, void, (GLclampf zNear, GLclampf zFar), (zNear, zFar))
-VISIT_GL_CALL(DetachShader,
-              void,
-              (GLuint program, GLuint shader),
-              (program, shader))
-VISIT_GL_CALL(Disable, void, (GLenum cap), (cap))
-VISIT_GL_CALL(DisableVertexAttribArray, void, (GLuint index), (index))
-VISIT_GL_CALL(DrawArrays,
-              void,
-              (GLenum mode, GLint first, GLsizei count),
-              (mode, first, count))
-VISIT_GL_CALL(DrawElements,
-              void,
-              (GLenum mode, GLsizei count, GLenum type, const void* indices),
-              (mode, count, type, indices))
-VISIT_GL_CALL(Enable, void, (GLenum cap), (cap))
-VISIT_GL_CALL(EnableVertexAttribArray, void, (GLuint index), (index))
-VISIT_GL_CALL(Finish, void, (), ())
-VISIT_GL_CALL(Flush, void, (), ())
-VISIT_GL_CALL(FramebufferRenderbuffer,
-              void,
-              (GLenum target,
-               GLenum attachment,
-               GLenum renderbuffertarget,
-               GLuint renderbuffer),
-              (target, attachment, renderbuffertarget, renderbuffer))
-VISIT_GL_CALL(FramebufferTexture2D,
-              void,
-              (GLenum target,
-               GLenum attachment,
-               GLenum textarget,
-               GLuint texture,
-               GLint level),
-              (target, attachment, textarget, texture, level))
-VISIT_GL_CALL(FrontFace, void, (GLenum mode), (mode))
-VISIT_GL_CALL(GenBuffers, void, (GLsizei n, GLuint* buffers), (n, buffers))
-VISIT_GL_CALL(GenerateMipmap, void, (GLenum target), (target))
-VISIT_GL_CALL(GenFramebuffers,
-              void,
-              (GLsizei n, GLuint* framebuffers),
-              (n, framebuffers))
-VISIT_GL_CALL(GenRenderbuffers,
-              void,
-              (GLsizei n, GLuint* renderbuffers),
-              (n, renderbuffers))
-VISIT_GL_CALL(GenTextures, void, (GLsizei n, GLuint* textures), (n, textures))
-VISIT_GL_CALL(GetActiveAttrib,
-              void,
-              (GLuint program,
-               GLuint index,
-               GLsizei bufsize,
-               GLsizei* length,
-               GLint* size,
-               GLenum* type,
-               char* name),
-              (program, index, bufsize, length, size, type, name))
-VISIT_GL_CALL(GetActiveUniform,
-              void,
-              (GLuint program,
-               GLuint index,
-               GLsizei bufsize,
-               GLsizei* length,
-               GLint* size,
-               GLenum* type,
-               char* name),
-              (program, index, bufsize, length, size, type, name))
-VISIT_GL_CALL(
-    GetAttachedShaders,
-    void,
-    (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders),
-    (program, maxcount, count, shaders))
-VISIT_GL_CALL(GetAttribLocation,
-              GLint,
-              (GLuint program, const char* name),
-              (program, name))
-VISIT_GL_CALL(GetBooleanv,
-              void,
-              (GLenum pname, GLboolean* params),
-              (pname, params))
-VISIT_GL_CALL(GetBufferParameteriv,
-              void,
-              (GLenum target, GLenum pname, GLint* params),
-              (target, pname, params))
-VISIT_GL_CALL(GetError, GLenum, (), ())
-VISIT_GL_CALL(GetFloatv, void, (GLenum pname, GLfloat* params), (pname, params))
-VISIT_GL_CALL(GetFramebufferAttachmentParameteriv,
-              void,
-              (GLenum target, GLenum attachment, GLenum pname, GLint* params),
-              (target, attachment, pname, params))
-VISIT_GL_CALL(GetIntegerv, void, (GLenum pname, GLint* params), (pname, params))
-VISIT_GL_CALL(GetProgramiv,
-              void,
-              (GLuint program, GLenum pname, GLint* params),
-              (program, pname, params))
-VISIT_GL_CALL(GetProgramInfoLog,
-              void,
-              (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog),
-              (program, bufsize, length, infolog))
-VISIT_GL_CALL(GetRenderbufferParameteriv,
-              void,
-              (GLenum target, GLenum pname, GLint* params),
-              (target, pname, params))
-VISIT_GL_CALL(GetShaderiv,
-              void,
-              (GLuint shader, GLenum pname, GLint* params),
-              (shader, pname, params))
-VISIT_GL_CALL(GetShaderInfoLog,
-              void,
-              (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog),
-              (shader, bufsize, length, infolog))
-VISIT_GL_CALL(
-    GetShaderPrecisionFormat,
-    void,
-    (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision),
-    (shadertype, precisiontype, range, precision))
-VISIT_GL_CALL(GetShaderSource,
-              void,
-              (GLuint shader, GLsizei bufsize, GLsizei* length, char* source),
-              (shader, bufsize, length, source))
-VISIT_GL_CALL(GetString, const GLubyte*, (GLenum name), (name))
-VISIT_GL_CALL(GetTexParameterfv,
-              void,
-              (GLenum target, GLenum pname, GLfloat* params),
-              (target, pname, params))
-VISIT_GL_CALL(GetTexParameteriv,
-              void,
-              (GLenum target, GLenum pname, GLint* params),
-              (target, pname, params))
-VISIT_GL_CALL(GetUniformfv,
-              void,
-              (GLuint program, GLint location, GLfloat* params),
-              (program, location, params))
-VISIT_GL_CALL(GetUniformiv,
-              void,
-              (GLuint program, GLint location, GLint* params),
-              (program, location, params))
-VISIT_GL_CALL(GetUniformLocation,
-              GLint,
-              (GLuint program, const char* name),
-              (program, name))
-VISIT_GL_CALL(GetVertexAttribfv,
-              void,
-              (GLuint index, GLenum pname, GLfloat* params),
-              (index, pname, params))
-VISIT_GL_CALL(GetVertexAttribiv,
-              void,
-              (GLuint index, GLenum pname, GLint* params),
-              (index, pname, params))
-VISIT_GL_CALL(GetVertexAttribPointerv,
-              void,
-              (GLuint index, GLenum pname, void** pointer),
-              (index, pname, pointer))
-VISIT_GL_CALL(Hint, void, (GLenum target, GLenum mode), (target, mode))
-VISIT_GL_CALL(IsBuffer, GLboolean, (GLuint buffer), (buffer))
-VISIT_GL_CALL(IsEnabled, GLboolean, (GLenum cap), (cap))
-VISIT_GL_CALL(IsFramebuffer, GLboolean, (GLuint framebuffer), (framebuffer))
-VISIT_GL_CALL(IsProgram, GLboolean, (GLuint program), (program))
-VISIT_GL_CALL(IsRenderbuffer, GLboolean, (GLuint renderbuffer), (renderbuffer))
-VISIT_GL_CALL(IsShader, GLboolean, (GLuint shader), (shader))
-VISIT_GL_CALL(IsTexture, GLboolean, (GLuint texture), (texture))
-VISIT_GL_CALL(LineWidth, void, (GLfloat width), (width))
-VISIT_GL_CALL(LinkProgram, void, (GLuint program), (program))
-VISIT_GL_CALL(PixelStorei, void, (GLenum pname, GLint param), (pname, param))
-VISIT_GL_CALL(PolygonOffset,
-              void,
-              (GLfloat factor, GLfloat units),
-              (factor, units))
-VISIT_GL_CALL(ReadPixels,
-              void,
-              (GLint x,
-               GLint y,
-               GLsizei width,
-               GLsizei height,
-               GLenum format,
-               GLenum type,
-               void* pixels),
-              (x, y, width, height, format, type, pixels))
-VISIT_GL_CALL(ReleaseShaderCompiler, void, (), ())
-VISIT_GL_CALL(
-    RenderbufferStorage,
-    void,
-    (GLenum target, GLenum internalformat, GLsizei width, GLsizei height),
-    (target, internalformat, width, height))
-VISIT_GL_CALL(SampleCoverage,
-              void,
-              (GLclampf value, GLboolean invert),
-              (value, invert))
-VISIT_GL_CALL(Scissor,
-              void,
-              (GLint x, GLint y, GLsizei width, GLsizei height),
-              (x, y, width, height))
-VISIT_GL_CALL(ShaderBinary,
-              void,
-              (GLsizei n,
-               const GLuint* shaders,
-               GLenum binaryformat,
-               const void* binary,
-               GLsizei length),
-              (n, shaders, binaryformat, binary, length))
-VISIT_GL_CALL(ShaderSource,
-              void,
-              (GLuint shader,
-               GLsizei count,
-               const GLchar* const* str,
-               const GLint* length),
-              (shader, count, str, length))
-VISIT_GL_CALL(StencilFunc,
-              void,
-              (GLenum func, GLint ref, GLuint mask),
-              (func, ref, mask))
-VISIT_GL_CALL(StencilFuncSeparate,
-              void,
-              (GLenum face, GLenum func, GLint ref, GLuint mask),
-              (face, func, ref, mask))
-VISIT_GL_CALL(StencilMask, void, (GLuint mask), (mask))
-VISIT_GL_CALL(StencilMaskSeparate,
-              void,
-              (GLenum face, GLuint mask),
-              (face, mask))
-VISIT_GL_CALL(StencilOp,
-              void,
-              (GLenum fail, GLenum zfail, GLenum zpass),
-              (fail, zfail, zpass))
-VISIT_GL_CALL(StencilOpSeparate,
-              void,
-              (GLenum face, GLenum fail, GLenum zfail, GLenum zpass),
-              (face, fail, zfail, zpass))
-VISIT_GL_CALL(TexImage2D,
-              void,
-              (GLenum target,
-               GLint level,
-               GLint internalformat,
-               GLsizei width,
-               GLsizei height,
-               GLint border,
-               GLenum format,
-               GLenum type,
-               const void* pixels),
-              (target,
-               level,
-               internalformat,
-               width,
-               height,
-               border,
-               format,
-               type,
-               pixels))
-VISIT_GL_CALL(TexParameterf,
-              void,
-              (GLenum target, GLenum pname, GLfloat param),
-              (target, pname, param))
-VISIT_GL_CALL(TexParameterfv,
-              void,
-              (GLenum target, GLenum pname, const GLfloat* params),
-              (target, pname, params))
-VISIT_GL_CALL(TexParameteri,
-              void,
-              (GLenum target, GLenum pname, GLint param),
-              (target, pname, param))
-VISIT_GL_CALL(TexParameteriv,
-              void,
-              (GLenum target, GLenum pname, const GLint* params),
-              (target, pname, params))
-VISIT_GL_CALL(
-    TexSubImage2D,
-    void,
-    (GLenum target,
-     GLint level,
-     GLint xoffset,
-     GLint yoffset,
-     GLsizei width,
-     GLsizei height,
-     GLenum format,
-     GLenum type,
-     const void* pixels),
-    (target, level, xoffset, yoffset, width, height, format, type, pixels))
-VISIT_GL_CALL(Uniform1f, void, (GLint location, GLfloat x), (location, x))
-VISIT_GL_CALL(Uniform1fv,
-              void,
-              (GLint location, GLsizei count, const GLfloat* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform1i, void, (GLint location, GLint x), (location, x))
-VISIT_GL_CALL(Uniform1iv,
-              void,
-              (GLint location, GLsizei count, const GLint* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform2f,
-              void,
-              (GLint location, GLfloat x, GLfloat y),
-              (location, x, y))
-VISIT_GL_CALL(Uniform2fv,
-              void,
-              (GLint location, GLsizei count, const GLfloat* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform2i,
-              void,
-              (GLint location, GLint x, GLint y),
-              (location, x, y))
-VISIT_GL_CALL(Uniform2iv,
-              void,
-              (GLint location, GLsizei count, const GLint* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform3f,
-              void,
-              (GLint location, GLfloat x, GLfloat y, GLfloat z),
-              (location, x, y, z))
-VISIT_GL_CALL(Uniform3fv,
-              void,
-              (GLint location, GLsizei count, const GLfloat* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform3i,
-              void,
-              (GLint location, GLint x, GLint y, GLint z),
-              (location, x, y, z))
-VISIT_GL_CALL(Uniform3iv,
-              void,
-              (GLint location, GLsizei count, const GLint* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform4f,
-              void,
-              (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w),
-              (location, x, y, z, w))
-VISIT_GL_CALL(Uniform4fv,
-              void,
-              (GLint location, GLsizei count, const GLfloat* v),
-              (location, count, v))
-VISIT_GL_CALL(Uniform4i,
-              void,
-              (GLint location, GLint x, GLint y, GLint z, GLint w),
-              (location, x, y, z, w))
-VISIT_GL_CALL(Uniform4iv,
-              void,
-              (GLint location, GLsizei count, const GLint* v),
-              (location, count, v))
-VISIT_GL_CALL(
-    UniformMatrix2fv,
-    void,
-    (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value),
-    (location, count, transpose, value))
-VISIT_GL_CALL(
-    UniformMatrix3fv,
-    void,
-    (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value),
-    (location, count, transpose, value))
-VISIT_GL_CALL(
-    UniformMatrix4fv,
-    void,
-    (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value),
-    (location, count, transpose, value))
-VISIT_GL_CALL(UseProgram, void, (GLuint program), (program))
-VISIT_GL_CALL(ValidateProgram, void, (GLuint program), (program))
-VISIT_GL_CALL(VertexAttrib1f, void, (GLuint indx, GLfloat x), (indx, x))
-VISIT_GL_CALL(VertexAttrib1fv,
-              void,
-              (GLuint indx, const GLfloat* values),
-              (indx, values))
-VISIT_GL_CALL(VertexAttrib2f,
-              void,
-              (GLuint indx, GLfloat x, GLfloat y),
-              (indx, x, y))
-VISIT_GL_CALL(VertexAttrib2fv,
-              void,
-              (GLuint indx, const GLfloat* values),
-              (indx, values))
-VISIT_GL_CALL(VertexAttrib3f,
-              void,
-              (GLuint indx, GLfloat x, GLfloat y, GLfloat z),
-              (indx, x, y, z))
-VISIT_GL_CALL(VertexAttrib3fv,
-              void,
-              (GLuint indx, const GLfloat* values),
-              (indx, values))
-VISIT_GL_CALL(VertexAttrib4f,
-              void,
-              (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w),
-              (indx, x, y, z, w))
-VISIT_GL_CALL(VertexAttrib4fv,
-              void,
-              (GLuint indx, const GLfloat* values),
-              (indx, values))
-VISIT_GL_CALL(VertexAttribPointer,
-              void,
-              (GLuint indx,
-               GLint size,
-               GLenum type,
-               GLboolean normalized,
-               GLsizei stride,
-               const void* ptr),
-              (indx, size, type, normalized, stride, ptr))
-VISIT_GL_CALL(Viewport,
-              void,
-              (GLint x, GLint y, GLsizei width, GLsizei height),
-              (x, y, width, height))
diff --git a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h b/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h
deleted file mode 100644
index 363a771..0000000
--- a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h
+++ /dev/null
@@ -1,564 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is auto-generated from
-// gpu/command_buffer/build_gles2_cmd_buffer.py
-// It's formatted by clang-format using chromium coding style:
-//    clang-format -i -style=chromium filename
-// DO NOT EDIT!
-
-VISIT_GL_CALL(ShallowFinishCHROMIUM, void, (), ())
-VISIT_GL_CALL(ShallowFlushCHROMIUM, void, (), ())
-VISIT_GL_CALL(OrderingBarrierCHROMIUM, void, (), ())
-VISIT_GL_CALL(
-    BlitFramebufferCHROMIUM,
-    void,
-    (GLint srcX0,
-     GLint srcY0,
-     GLint srcX1,
-     GLint srcY1,
-     GLint dstX0,
-     GLint dstY0,
-     GLint dstX1,
-     GLint dstY1,
-     GLbitfield mask,
-     GLenum filter),
-    (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter))
-VISIT_GL_CALL(RenderbufferStorageMultisampleCHROMIUM,
-              void,
-              (GLenum target,
-               GLsizei samples,
-               GLenum internalformat,
-               GLsizei width,
-               GLsizei height),
-              (target, samples, internalformat, width, height))
-VISIT_GL_CALL(RenderbufferStorageMultisampleEXT,
-              void,
-              (GLenum target,
-               GLsizei samples,
-               GLenum internalformat,
-               GLsizei width,
-               GLsizei height),
-              (target, samples, internalformat, width, height))
-VISIT_GL_CALL(FramebufferTexture2DMultisampleEXT,
-              void,
-              (GLenum target,
-               GLenum attachment,
-               GLenum textarget,
-               GLuint texture,
-               GLint level,
-               GLsizei samples),
-              (target, attachment, textarget, texture, level, samples))
-VISIT_GL_CALL(TexStorage2DEXT,
-              void,
-              (GLenum target,
-               GLsizei levels,
-               GLenum internalFormat,
-               GLsizei width,
-               GLsizei height),
-              (target, levels, internalFormat, width, height))
-VISIT_GL_CALL(GenQueriesEXT, void, (GLsizei n, GLuint* queries), (n, queries))
-VISIT_GL_CALL(DeleteQueriesEXT,
-              void,
-              (GLsizei n, const GLuint* queries),
-              (n, queries))
-VISIT_GL_CALL(QueryCounterEXT, void, (GLuint id, GLenum target), (id, target))
-VISIT_GL_CALL(IsQueryEXT, GLboolean, (GLuint id), (id))
-VISIT_GL_CALL(BeginQueryEXT, void, (GLenum target, GLuint id), (target, id))
-VISIT_GL_CALL(EndQueryEXT, void, (GLenum target), (target))
-VISIT_GL_CALL(GetQueryivEXT,
-              void,
-              (GLenum target, GLenum pname, GLint* params),
-              (target, pname, params))
-VISIT_GL_CALL(GetQueryObjectivEXT,
-              void,
-              (GLuint id, GLenum pname, GLint* params),
-              (id, pname, params))
-VISIT_GL_CALL(GetQueryObjectuivEXT,
-              void,
-              (GLuint id, GLenum pname, GLuint* params),
-              (id, pname, params))
-VISIT_GL_CALL(GetQueryObjecti64vEXT,
-              void,
-              (GLuint id, GLenum pname, GLint64* params),
-              (id, pname, params))
-VISIT_GL_CALL(GetQueryObjectui64vEXT,
-              void,
-              (GLuint id, GLenum pname, GLuint64* params),
-              (id, pname, params))
-VISIT_GL_CALL(SetDisjointValueSyncCHROMIUM, void, (), ())
-VISIT_GL_CALL(InsertEventMarkerEXT,
-              void,
-              (GLsizei length, const GLchar* marker),
-              (length, marker))
-VISIT_GL_CALL(PushGroupMarkerEXT,
-              void,
-              (GLsizei length, const GLchar* marker),
-              (length, marker))
-VISIT_GL_CALL(PopGroupMarkerEXT, void, (), ())
-VISIT_GL_CALL(GenVertexArraysOES,
-              void,
-              (GLsizei n, GLuint* arrays),
-              (n, arrays))
-VISIT_GL_CALL(DeleteVertexArraysOES,
-              void,
-              (GLsizei n, const GLuint* arrays),
-              (n, arrays))
-VISIT_GL_CALL(IsVertexArrayOES, GLboolean, (GLuint array), (array))
-VISIT_GL_CALL(BindVertexArrayOES, void, (GLuint array), (array))
-VISIT_GL_CALL(SwapBuffers, void, (), ())
-VISIT_GL_CALL(GetMaxValueInBufferCHROMIUM,
-              GLuint,
-              (GLuint buffer_id, GLsizei count, GLenum type, GLuint offset),
-              (buffer_id, count, type, offset))
-VISIT_GL_CALL(EnableFeatureCHROMIUM,
-              GLboolean,
-              (const char* feature),
-              (feature))
-VISIT_GL_CALL(MapBufferCHROMIUM,
-              void*,
-              (GLuint target, GLenum access),
-              (target, access))
-VISIT_GL_CALL(UnmapBufferCHROMIUM, GLboolean, (GLuint target), (target))
-VISIT_GL_CALL(MapBufferSubDataCHROMIUM,
-              void*,
-              (GLuint target, GLintptr offset, GLsizeiptr size, GLenum access),
-              (target, offset, size, access))
-VISIT_GL_CALL(UnmapBufferSubDataCHROMIUM, void, (const void* mem), (mem))
-VISIT_GL_CALL(
-    MapTexSubImage2DCHROMIUM,
-    void*,
-    (GLenum target,
-     GLint level,
-     GLint xoffset,
-     GLint yoffset,
-     GLsizei width,
-     GLsizei height,
-     GLenum format,
-     GLenum type,
-     GLenum access),
-    (target, level, xoffset, yoffset, width, height, format, type, access))
-VISIT_GL_CALL(UnmapTexSubImage2DCHROMIUM, void, (const void* mem), (mem))
-VISIT_GL_CALL(
-    ResizeCHROMIUM,
-    void,
-    (GLuint width, GLuint height, GLfloat scale_factor, GLboolean alpha),
-    (width, height, scale_factor, alpha))
-VISIT_GL_CALL(GetRequestableExtensionsCHROMIUM, const GLchar*, (), ())
-VISIT_GL_CALL(RequestExtensionCHROMIUM,
-              void,
-              (const char* extension),
-              (extension))
-VISIT_GL_CALL(GetProgramInfoCHROMIUM,
-              void,
-              (GLuint program, GLsizei bufsize, GLsizei* size, void* info),
-              (program, bufsize, size, info))
-VISIT_GL_CALL(
-    CreateImageCHROMIUM,
-    GLuint,
-    (ClientBuffer buffer, GLsizei width, GLsizei height, GLenum internalformat),
-    (buffer, width, height, internalformat))
-VISIT_GL_CALL(DestroyImageCHROMIUM, void, (GLuint image_id), (image_id))
-VISIT_GL_CALL(
-    CreateGpuMemoryBufferImageCHROMIUM,
-    GLuint,
-    (GLsizei width, GLsizei height, GLenum internalformat, GLenum usage),
-    (width, height, internalformat, usage))
-VISIT_GL_CALL(GetTranslatedShaderSourceANGLE,
-              void,
-              (GLuint shader, GLsizei bufsize, GLsizei* length, char* source),
-              (shader, bufsize, length, source))
-VISIT_GL_CALL(PostSubBufferCHROMIUM,
-              void,
-              (GLint x, GLint y, GLint width, GLint height),
-              (x, y, width, height))
-VISIT_GL_CALL(TexImageIOSurface2DCHROMIUM,
-              void,
-              (GLenum target,
-               GLsizei width,
-               GLsizei height,
-               GLuint ioSurfaceId,
-               GLuint plane),
-              (target, width, height, ioSurfaceId, plane))
-VISIT_GL_CALL(CopyTextureCHROMIUM,
-              void,
-              (GLenum source_id,
-               GLenum dest_id,
-               GLint internalformat,
-               GLenum dest_type,
-               GLboolean unpack_flip_y,
-               GLboolean unpack_premultiply_alpha,
-               GLboolean unpack_unmultiply_alpha),
-              (source_id,
-               dest_id,
-               internalformat,
-               dest_type,
-               unpack_flip_y,
-               unpack_premultiply_alpha,
-               unpack_unmultiply_alpha))
-VISIT_GL_CALL(CopySubTextureCHROMIUM,
-              void,
-              (GLenum source_id,
-               GLenum dest_id,
-               GLint xoffset,
-               GLint yoffset,
-               GLint x,
-               GLint y,
-               GLsizei width,
-               GLsizei height,
-               GLboolean unpack_flip_y,
-               GLboolean unpack_premultiply_alpha,
-               GLboolean unpack_unmultiply_alpha),
-              (source_id,
-               dest_id,
-               xoffset,
-               yoffset,
-               x,
-               y,
-               width,
-               height,
-               unpack_flip_y,
-               unpack_premultiply_alpha,
-               unpack_unmultiply_alpha))
-VISIT_GL_CALL(CompressedCopyTextureCHROMIUM,
-              void,
-              (GLenum source_id, GLenum dest_id),
-              (source_id, dest_id))
-VISIT_GL_CALL(DrawArraysInstancedANGLE,
-              void,
-              (GLenum mode, GLint first, GLsizei count, GLsizei primcount),
-              (mode, first, count, primcount))
-VISIT_GL_CALL(DrawElementsInstancedANGLE,
-              void,
-              (GLenum mode,
-               GLsizei count,
-               GLenum type,
-               const void* indices,
-               GLsizei primcount),
-              (mode, count, type, indices, primcount))
-VISIT_GL_CALL(VertexAttribDivisorANGLE,
-              void,
-              (GLuint index, GLuint divisor),
-              (index, divisor))
-VISIT_GL_CALL(GenMailboxCHROMIUM, void, (GLbyte * mailbox), (mailbox))
-VISIT_GL_CALL(ProduceTextureCHROMIUM,
-              void,
-              (GLenum target, const GLbyte* mailbox),
-              (target, mailbox))
-VISIT_GL_CALL(ProduceTextureDirectCHROMIUM,
-              void,
-              (GLuint texture, GLenum target, const GLbyte* mailbox),
-              (texture, target, mailbox))
-VISIT_GL_CALL(ConsumeTextureCHROMIUM,
-              void,
-              (GLenum target, const GLbyte* mailbox),
-              (target, mailbox))
-VISIT_GL_CALL(CreateAndConsumeTextureCHROMIUM,
-              GLuint,
-              (GLenum target, const GLbyte* mailbox),
-              (target, mailbox))
-VISIT_GL_CALL(BindUniformLocationCHROMIUM,
-              void,
-              (GLuint program, GLint location, const char* name),
-              (program, location, name))
-VISIT_GL_CALL(BindTexImage2DCHROMIUM,
-              void,
-              (GLenum target, GLint imageId),
-              (target, imageId))
-VISIT_GL_CALL(ReleaseTexImage2DCHROMIUM,
-              void,
-              (GLenum target, GLint imageId),
-              (target, imageId))
-VISIT_GL_CALL(TraceBeginCHROMIUM,
-              void,
-              (const char* category_name, const char* trace_name),
-              (category_name, trace_name))
-VISIT_GL_CALL(TraceEndCHROMIUM, void, (), ())
-VISIT_GL_CALL(DiscardFramebufferEXT,
-              void,
-              (GLenum target, GLsizei count, const GLenum* attachments),
-              (target, count, attachments))
-VISIT_GL_CALL(LoseContextCHROMIUM,
-              void,
-              (GLenum current, GLenum other),
-              (current, other))
-VISIT_GL_CALL(InsertFenceSyncCHROMIUM, GLuint64, (), ())
-VISIT_GL_CALL(GenSyncTokenCHROMIUM,
-              void,
-              (GLuint64 fence_sync, GLbyte* sync_token),
-              (fence_sync, sync_token))
-VISIT_GL_CALL(GenUnverifiedSyncTokenCHROMIUM,
-              void,
-              (GLuint64 fence_sync, GLbyte* sync_token),
-              (fence_sync, sync_token))
-VISIT_GL_CALL(VerifySyncTokensCHROMIUM,
-              void,
-              (GLbyte * *sync_tokens, GLsizei count),
-              (sync_tokens, count))
-VISIT_GL_CALL(WaitSyncTokenCHROMIUM,
-              void,
-              (const GLbyte* sync_token),
-              (sync_token))
-VISIT_GL_CALL(DrawBuffersEXT,
-              void,
-              (GLsizei count, const GLenum* bufs),
-              (count, bufs))
-VISIT_GL_CALL(DiscardBackbufferCHROMIUM, void, (), ())
-VISIT_GL_CALL(ScheduleOverlayPlaneCHROMIUM,
-              void,
-              (GLint plane_z_order,
-               GLenum plane_transform,
-               GLuint overlay_texture_id,
-               GLint bounds_x,
-               GLint bounds_y,
-               GLint bounds_width,
-               GLint bounds_height,
-               GLfloat uv_x,
-               GLfloat uv_y,
-               GLfloat uv_width,
-               GLfloat uv_height),
-              (plane_z_order,
-               plane_transform,
-               overlay_texture_id,
-               bounds_x,
-               bounds_y,
-               bounds_width,
-               bounds_height,
-               uv_x,
-               uv_y,
-               uv_width,
-               uv_height))
-VISIT_GL_CALL(ScheduleCALayerCHROMIUM,
-              void,
-              (GLuint contents_texture_id,
-               const GLfloat* contents_rect,
-               GLfloat opacity,
-               GLuint background_color,
-               GLuint edge_aa_mask,
-               const GLfloat* bounds_rect,
-               GLboolean is_clipped,
-               const GLfloat* clip_rect,
-               GLint sorting_context_id,
-               const GLfloat* transform,
-               GLuint filter),
-              (contents_texture_id,
-               contents_rect,
-               opacity,
-               background_color,
-               edge_aa_mask,
-               bounds_rect,
-               is_clipped,
-               clip_rect,
-               sorting_context_id,
-               transform,
-               filter))
-VISIT_GL_CALL(CommitOverlayPlanesCHROMIUM, void, (), ())
-VISIT_GL_CALL(SwapInterval, void, (GLint interval), (interval))
-VISIT_GL_CALL(FlushDriverCachesCHROMIUM, void, (), ())
-VISIT_GL_CALL(GetLastFlushIdCHROMIUM, GLuint, (), ())
-VISIT_GL_CALL(MatrixLoadfCHROMIUM,
-              void,
-              (GLenum matrixMode, const GLfloat* m),
-              (matrixMode, m))
-VISIT_GL_CALL(MatrixLoadIdentityCHROMIUM,
-              void,
-              (GLenum matrixMode),
-              (matrixMode))
-VISIT_GL_CALL(GenPathsCHROMIUM, GLuint, (GLsizei range), (range))
-VISIT_GL_CALL(DeletePathsCHROMIUM,
-              void,
-              (GLuint path, GLsizei range),
-              (path, range))
-VISIT_GL_CALL(IsPathCHROMIUM, GLboolean, (GLuint path), (path))
-VISIT_GL_CALL(PathCommandsCHROMIUM,
-              void,
-              (GLuint path,
-               GLsizei numCommands,
-               const GLubyte* commands,
-               GLsizei numCoords,
-               GLenum coordType,
-               const GLvoid* coords),
-              (path, numCommands, commands, numCoords, coordType, coords))
-VISIT_GL_CALL(PathParameterfCHROMIUM,
-              void,
-              (GLuint path, GLenum pname, GLfloat value),
-              (path, pname, value))
-VISIT_GL_CALL(PathParameteriCHROMIUM,
-              void,
-              (GLuint path, GLenum pname, GLint value),
-              (path, pname, value))
-VISIT_GL_CALL(PathStencilFuncCHROMIUM,
-              void,
-              (GLenum func, GLint ref, GLuint mask),
-              (func, ref, mask))
-VISIT_GL_CALL(StencilFillPathCHROMIUM,
-              void,
-              (GLuint path, GLenum fillMode, GLuint mask),
-              (path, fillMode, mask))
-VISIT_GL_CALL(StencilStrokePathCHROMIUM,
-              void,
-              (GLuint path, GLint reference, GLuint mask),
-              (path, reference, mask))
-VISIT_GL_CALL(CoverFillPathCHROMIUM,
-              void,
-              (GLuint path, GLenum coverMode),
-              (path, coverMode))
-VISIT_GL_CALL(CoverStrokePathCHROMIUM,
-              void,
-              (GLuint path, GLenum coverMode),
-              (path, coverMode))
-VISIT_GL_CALL(StencilThenCoverFillPathCHROMIUM,
-              void,
-              (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode),
-              (path, fillMode, mask, coverMode))
-VISIT_GL_CALL(StencilThenCoverStrokePathCHROMIUM,
-              void,
-              (GLuint path, GLint reference, GLuint mask, GLenum coverMode),
-              (path, reference, mask, coverMode))
-VISIT_GL_CALL(StencilFillPathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLenum fillMode,
-               GLuint mask,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               fillMode,
-               mask,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(StencilStrokePathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLint reference,
-               GLuint mask,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               reference,
-               mask,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(CoverFillPathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLenum coverMode,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               coverMode,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(CoverStrokePathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLenum coverMode,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               coverMode,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(StencilThenCoverFillPathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLenum fillMode,
-               GLuint mask,
-               GLenum coverMode,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               fillMode,
-               mask,
-               coverMode,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(StencilThenCoverStrokePathInstancedCHROMIUM,
-              void,
-              (GLsizei numPaths,
-               GLenum pathNameType,
-               const GLvoid* paths,
-               GLuint pathBase,
-               GLint reference,
-               GLuint mask,
-               GLenum coverMode,
-               GLenum transformType,
-               const GLfloat* transformValues),
-              (numPaths,
-               pathNameType,
-               paths,
-               pathBase,
-               reference,
-               mask,
-               coverMode,
-               transformType,
-               transformValues))
-VISIT_GL_CALL(BindFragmentInputLocationCHROMIUM,
-              void,
-              (GLuint program, GLint location, const char* name),
-              (program, location, name))
-VISIT_GL_CALL(ProgramPathFragmentInputGenCHROMIUM,
-              void,
-              (GLuint program,
-               GLint location,
-               GLenum genMode,
-               GLint components,
-               const GLfloat* coeffs),
-              (program, location, genMode, components, coeffs))
-VISIT_GL_CALL(CoverageModulationCHROMIUM,
-              void,
-              (GLenum components),
-              (components))
-VISIT_GL_CALL(GetGraphicsResetStatusKHR, GLenum, (), ())
-VISIT_GL_CALL(BlendBarrierKHR, void, (), ())
-VISIT_GL_CALL(ApplyScreenSpaceAntialiasingCHROMIUM, void, (), ())
-VISIT_GL_CALL(
-    BindFragDataLocationIndexedEXT,
-    void,
-    (GLuint program, GLuint colorNumber, GLuint index, const char* name),
-    (program, colorNumber, index, name))
-VISIT_GL_CALL(BindFragDataLocationEXT,
-              void,
-              (GLuint program, GLuint colorNumber, const char* name),
-              (program, colorNumber, name))
-VISIT_GL_CALL(GetFragDataIndexEXT,
-              GLint,
-              (GLuint program, const char* name),
-              (program, name))
-VISIT_GL_CALL(UniformMatrix4fvStreamTextureMatrixCHROMIUM,
-              void,
-              (GLint location,
-               GLboolean transpose,
-               const GLfloat* default_value),
-              (location, transpose, default_value))
diff --git a/mojo/public/c/gles2/gles2_export.h b/mojo/public/c/gles2/gles2_export.h
deleted file mode 100644
index 60667b1..0000000
--- a/mojo/public/c/gles2/gles2_export.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_C_GLES2_GLES2_EXPORT_H_
-#define MOJO_PUBLIC_C_GLES2_GLES2_EXPORT_H_
-
-#if defined(COMPONENT_BUILD) && defined(MOJO_USE_GLES2_IMPL)
-#if defined(WIN32)
-
-#if defined(MOJO_GLES2_IMPLEMENTATION)
-#define MOJO_GLES2_EXPORT __declspec(dllexport)
-#else
-#define MOJO_GLES2_EXPORT __declspec(dllimport)
-#endif
-
-#else  // !defined(WIN32)
-
-#if defined(MOJO_GLES2_IMPLEMENTATION)
-#define MOJO_GLES2_EXPORT __attribute__((visibility("default")))
-#else
-#define MOJO_GLES2_EXPORT
-#endif
-
-#endif  // defined(WIN32)
-
-#else  // !defined(COMPONENT_BUILD) || !defined(MOJO_USE_GLES2_IMPL)
-
-#define MOJO_GLES2_EXPORT
-
-#endif  // defined(COMPONENT_BUILD) && defined(MOJO_USE_GLES2_IMPL)
-
-#endif  // MOJO_PUBLIC_C_GLES2_GLES2_EXPORT_H_
diff --git a/mojo/public/c/gles2/gles2_types.h b/mojo/public/c/gles2/gles2_types.h
deleted file mode 100644
index 3ecf4db..0000000
--- a/mojo/public/c/gles2/gles2_types.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_
-#define MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_
-
-// Note: This header should be compilable as C.
-
-#include <stdint.h>
-
-#include "mojo/public/c/gles2/gles2_export.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct MojoGLES2ContextPrivate* MojoGLES2Context;
-typedef void (*MojoGLES2ContextLost)(void* closure);
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // MOJO_PUBLIC_C_GLES2_GLES2_TYPES_H_
diff --git a/net/disk_cache/blockfile/mapped_file.cc b/net/disk_cache/blockfile/mapped_file.cc
index 571f21fe..b2fedd2 100644
--- a/net/disk_cache/blockfile/mapped_file.cc
+++ b/net/disk_cache/blockfile/mapped_file.cc
@@ -21,20 +21,6 @@
   return Write(block->buffer(), block->size(), offset);
 }
 
-bool MappedFile::Load(const FileBlock* block,
-                      FileIOCallback* callback,
-                      bool* completed) {
-  size_t offset = block->offset() + view_size_;
-  return Read(block->buffer(), block->size(), offset, callback, completed);
-}
-
-bool MappedFile::Store(const FileBlock* block,
-                       FileIOCallback* callback,
-                       bool* completed) {
-  size_t offset = block->offset() + view_size_;
-  return Write(block->buffer(), block->size(), offset, callback, completed);
-}
-
 bool MappedFile::Preload() {
   size_t file_len = GetLength();
   std::unique_ptr<char[]> buf(new char[file_len]);
diff --git a/net/disk_cache/blockfile/mapped_file.h b/net/disk_cache/blockfile/mapped_file.h
index 7ae0941..f39955c 100644
--- a/net/disk_cache/blockfile/mapped_file.h
+++ b/net/disk_cache/blockfile/mapped_file.h
@@ -41,11 +41,6 @@
   bool Load(const FileBlock* block);
   bool Store(const FileBlock* block);
 
-  // Asynchronous versions of Load/Store, following the semantics of File::Read
-  // and File::Write.
-  bool Load(const FileBlock* block, FileIOCallback* callback, bool* completed);
-  bool Store(const FileBlock* block, FileIOCallback* callback, bool* completed);
-
   // Flush the memory-mapped section to disk (synchronously).
   void Flush();
 
diff --git a/net/disk_cache/blockfile/mapped_file_unittest.cc b/net/disk_cache/blockfile/mapped_file_unittest.cc
index bd8e913b..1c864513 100644
--- a/net/disk_cache/blockfile/mapped_file_unittest.cc
+++ b/net/disk_cache/blockfile/mapped_file_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "base/files/file_path.h"
 #include "base/strings/string_util.h"
-#include "net/disk_cache/blockfile/file_block.h"
 #include "net/disk_cache/blockfile/mapped_file.h"
 #include "net/disk_cache/disk_cache_test_base.h"
 #include "net/disk_cache/disk_cache_test_util.h"
@@ -39,22 +38,6 @@
   helper_->CallbackWasCalled();
 }
 
-class TestFileBlock : public disk_cache::FileBlock {
- public:
-  TestFileBlock() {
-    CacheTestFillBuffer(buffer_, sizeof(buffer_), false);
-  }
-  ~TestFileBlock() override {}
-
-  // FileBlock interface.
-  void* buffer() const override { return const_cast<char*>(buffer_); }
-  size_t size() const override { return sizeof(buffer_); }
-  int offset() const override { return 1024; }
-
- private:
-  char buffer_[20];
-};
-
 }  // namespace
 
 TEST_F(DiskCacheTest, MappedFile_SyncIO) {
@@ -105,36 +88,3 @@
   EXPECT_FALSE(helper.callback_reused_error());
   EXPECT_STREQ(buffer1, buffer2);
 }
-
-TEST_F(DiskCacheTest, MappedFile_AsyncLoadStore) {
-  base::FilePath filename = cache_path_.AppendASCII("a_test");
-  scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile);
-  ASSERT_TRUE(CreateCacheTestFile(filename));
-  ASSERT_TRUE(file->Init(filename, 8192));
-
-  int max_id = 0;
-  MessageLoopHelper helper;
-  FileCallbackTest callback(1, &helper, &max_id);
-
-  TestFileBlock file_block1;
-  TestFileBlock file_block2;
-  base::strlcpy(static_cast<char*>(file_block1.buffer()), "the data",
-                file_block1.size());
-  bool completed;
-  EXPECT_TRUE(file->Store(&file_block1, &callback, &completed));
-  int expected = completed ? 0 : 1;
-
-  max_id = 1;
-  helper.WaitUntilCacheIoFinished(expected);
-
-  EXPECT_TRUE(file->Load(&file_block2, &callback, &completed));
-  if (!completed)
-    expected++;
-
-  helper.WaitUntilCacheIoFinished(expected);
-
-  EXPECT_EQ(expected, helper.callbacks_called());
-  EXPECT_FALSE(helper.callback_reused_error());
-  EXPECT_STREQ(static_cast<char*>(file_block1.buffer()),
-               static_cast<char*>(file_block2.buffer()));
-}
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 4200926..f5f7d59 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1134,6 +1134,8 @@
     return OK;
   }
 
+  open_entry_last_used_ = entry_->disk_entry->GetLastUsed();
+
   if (result != OK) {
     NOTREACHED();
     return result;
@@ -2190,11 +2192,14 @@
                                             cache_->clock_->Now());
 
   if (validation_required_by_headers != VALIDATION_NONE) {
-    validation_cause_ =
-        response_.headers->GetFreshnessLifetimes(response_.response_time)
-                    .freshness == base::TimeDelta()
-            ? VALIDATION_CAUSE_ZERO_FRESHNESS
-            : VALIDATION_CAUSE_STALE;
+    HttpResponseHeaders::FreshnessLifetimes lifetimes =
+        response_.headers->GetFreshnessLifetimes(response_.response_time);
+    if (lifetimes.freshness == base::TimeDelta()) {
+      validation_cause_ = VALIDATION_CAUSE_ZERO_FRESHNESS;
+    } else {
+      validation_cause_ = VALIDATION_CAUSE_STALE;
+      stale_entry_freshness_ = lifetimes.freshness;
+    }
   }
 
   if (validation_required_by_headers == VALIDATION_ASYNCHRONOUS) {
@@ -2790,6 +2795,19 @@
     }
   }
 
+  if ((validation_request ||
+       transaction_pattern_ == PATTERN_ENTRY_CANT_CONDITIONALIZE) &&
+      validation_cause_ == VALIDATION_CAUSE_STALE) {
+    // For stale entries, record how many freshness periods have elapsed since
+    // the entry was last used.
+    DCHECK(!open_entry_last_used_.is_null());
+    DCHECK(!stale_entry_freshness_.is_zero());
+
+    base::TimeDelta time_since_use = base::Time::Now() - open_entry_last_used_;
+    UMA_HISTOGRAM_COUNTS("HttpCache.StaleEntry.FreshnessPeriodsSinceLastUsed",
+                         (time_since_use * 1000) / stale_entry_freshness_);
+  }
+
   UMA_HISTOGRAM_ENUMERATION(
       "HttpCache.Pattern", transaction_pattern_, PATTERN_MAX);
 
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index 8e26337..06f9bbf 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -484,6 +484,8 @@
   base::TimeTicks entry_lock_waiting_since_;
   base::TimeTicks first_cache_access_since_;
   base::TimeTicks send_request_since_;
+  base::Time open_entry_last_used_;
+  base::TimeDelta stale_entry_freshness_;
 
   int64_t total_received_bytes_;
   int64_t total_sent_bytes_;
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index 3f8cce4..682aff5 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -83,11 +83,11 @@
 }
 
 base::Time MockDiskEntry::GetLastUsed() const {
-  return base::Time::FromInternalValue(0);
+  return base::Time::Now();
 }
 
 base::Time MockDiskEntry::GetLastModified() const {
-  return base::Time::FromInternalValue(0);
+  return base::Time::Now();
 }
 
 int32_t MockDiskEntry::GetDataSize(int index) const {
diff --git a/net/quic/spdy_utils.cc b/net/quic/spdy_utils.cc
index 90e6537..14e7687 100644
--- a/net/quic/spdy_utils.cc
+++ b/net/quic/spdy_utils.cc
@@ -129,16 +129,18 @@
     auto iter = headers->find(name);
     if (iter == headers->end()) {
       (*headers)[name] = p.second;
-    } else if (name == "cookie") {
-      // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction.
-      headers->ReplaceOrAppendHeader(
-          name, base::StringPrintf("%s; %s", iter->second.as_string().c_str(),
-                                   p.second.c_str()));
     } else {
       // This header had multiple values, so it must be reconstructed.
-      string value = base::StringPrintf(
-          "%s%c%s", iter->second.as_string().c_str(), '\0', p.second.c_str());
-      headers->ReplaceOrAppendHeader(name, value);
+      StringPiece v = iter->second;
+      string s(v.data(), v.length());
+      if (name == "cookie") {
+        // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction.
+        s.append("; ");
+      } else {
+        StringPiece("\0", 1).AppendToString(&s);
+      }
+      s.append(p.second);
+      headers->ReplaceOrAppendHeader(name, s);
     }
   }
 
diff --git a/net/quic/spdy_utils_test.cc b/net/quic/spdy_utils_test.cc
index c4f0943..a64c3a7 100644
--- a/net/quic/spdy_utils_test.cc
+++ b/net/quic/spdy_utils_test.cc
@@ -202,6 +202,20 @@
   EXPECT_EQ(-1, content_length);
 }
 
+TEST(SpdyUtilsTest, CopyAndValidateHeadersMoreThanTwoValues) {
+  auto headers = FromList({{"set-cookie", "value1"},
+                           {"set-cookie", "value2"},
+                           {"set-cookie", "value3"}});
+  int64_t content_length = -1;
+  SpdyHeaderBlock block;
+  ASSERT_TRUE(
+      SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
+  EXPECT_THAT(block,
+              UnorderedElementsAre(Pair(
+                  "set-cookie", StringPiece("value1\0value2\0value3", 20))));
+  EXPECT_EQ(-1, content_length);
+}
+
 TEST(SpdyUtilsTest, CopyAndValidateHeadersCookie) {
   auto headers = FromList({{"foo", "foovalue"},
                            {"bar", "barvalue"},
diff --git a/sync/protocol/history_status.proto b/sync/protocol/history_status.proto
new file mode 100644
index 0000000..e0f5ac9
--- /dev/null
+++ b/sync/protocol/history_status.proto
@@ -0,0 +1,22 @@
+// Copyright 2016 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
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+option retain_unknown_fields = true;
+
+package sync_pb;
+
+message HistoryStatusRequest {
+}
+
+// Response to a history status request.
+message HistoryStatusResponse {
+  // Minimal time to wait before issuing another request.
+  optional int32 min_poll_interval_seconds = 1 [default = 3600];
+
+  // Indicates whether the history corpuses have any derived data for a user.
+  optional bool has_derived_data = 2;
+}
diff --git a/sync/protocol/protocol.gypi b/sync/protocol/protocol.gypi
index 183b7db0..f522c5f 100644
--- a/sync/protocol/protocol.gypi
+++ b/sync/protocol/protocol.gypi
@@ -34,6 +34,7 @@
       '<(sync_proto_sources_dir)/favicon_tracking_specifics.proto',
       '<(sync_proto_sources_dir)/get_updates_caller_info.proto',
       '<(sync_proto_sources_dir)/history_delete_directive_specifics.proto',
+      '<(sync_proto_sources_dir)/history_status.proto',
       '<(sync_proto_sources_dir)/nigori_specifics.proto',
       '<(sync_proto_sources_dir)/managed_user_setting_specifics.proto',
       '<(sync_proto_sources_dir)/managed_user_shared_setting_specifics.proto',
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json
index 365accf..6fabb58 100644
--- a/testing/buildbot/chromium.android.json
+++ b/testing/buildbot/chromium.android.json
@@ -487,6 +487,20 @@
         "test": "blimp_unittests"
       },
       {
+        "override_isolate_target": "blink_heap_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 60
+        },
+        "test": "blink_heap_unittests"
+      },
+      {
         "override_isolate_target": "breakpad_unittests",
         "swarming": {
           "can_use_on_swarming_builders": true,
@@ -656,6 +670,20 @@
         "test": "gl_tests"
       },
       {
+        "override_isolate_target": "gl_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "gl_unittests"
+      },
+      {
         "override_isolate_target": "gpu_ipc_service_unittests",
         "swarming": {
           "can_use_on_swarming_builders": true,
@@ -682,6 +710,20 @@
         "test": "gpu_unittests"
       },
       {
+        "override_isolate_target": "ipc_mojo_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "ipc_mojo_unittests"
+      },
+      {
         "override_isolate_target": "ipc_tests",
         "swarming": {
           "can_use_on_swarming_builders": true,
@@ -708,6 +750,104 @@
         "test": "media_unittests"
       },
       {
+        "override_isolate_target": "mojo_common_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_common_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_public_application_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_public_application_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_public_bindings_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_public_bindings_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_public_system_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_public_system_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_runner_host_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_runner_host_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_surfaces_lib_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 30
+        },
+        "test": "mojo_surfaces_lib_unittests"
+      },
+      {
+        "override_isolate_target": "mojo_system_unittests",
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "device_os": "KTU84P",
+              "device_type": "hammerhead"
+            }
+          ],
+          "hard_timeout": 60
+        },
+        "test": "mojo_system_unittests"
+      },
+      {
         "override_isolate_target": "net_unittests",
         "swarming": {
           "can_use_on_swarming_builders": true,
diff --git a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
index 7818f56..6e7ab3e 100644
--- a/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
+++ b/third_party/WebKit/LayoutTests/compositing/video/video-reflection.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src="../../media/media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="../../media/video-test.js"></script>
         <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html b/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html
index a4594b0..75be3f4 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html
@@ -1,24 +1,17 @@
 <!doctype HTML>
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<div><span id="start" style="-webkit-user-select:none;">0123</span><span id="anchor">45</span><span id="end" style="-webkit-user-select:none;">6789</span></div>
+<div><span id="start" style="-webkit-user-select:none;">0123</span><span id="anchor">45</span><span id="end">6789</span></div>
 <div id="log"></div>
 <script>
 test(function() {
-    if (!window.eventSender)
-        reutrn;
-    var start = document.getElementById('start');
+    assert_true(window.eventSender != null, 'Window should have eventSender');
+
     x1 = start.offsetParent.offsetLeft + start.offsetLeft + start.offsetWidth / 2;
     y1 = start.offsetParent.offsetTop + start.offsetTop + start.offsetHeight / 2;
     eventSender.mouseMoveTo(x1, y1);
     eventSender.mouseDown();
 
-    eventSender.leapForward(100);
-    eventSender.mouseMoveTo(x1 + 5, y1);
-    eventSender.leapForward(100);
-    eventSender.mouseMoveTo(x1 + 10, y1);
-
-    end = document.getElementById('end');
     x2 = end.offsetParent.offsetLeft + end.offsetLeft + end.offsetWidth / 2;
     y2 = end.offsetParent.offsetTop + end.offsetTop + end.offsetHeight / 2;
 
@@ -27,9 +20,10 @@
 
     var selection = window.getSelection();
     var anchor = document.getElementById('anchor').firstChild;
-    assert_equals(selection.anchorNode, anchor, 'anchorNode');
+    assert_equals(selection.type, 'None', 'type');
+    assert_equals(selection.anchorNode, null, 'anchorNode');
     assert_equals(selection.anchorOffset, 0, 'anchorOffset');
-    assert_equals(selection.focusNode, anchor, 'focusNode');
-    assert_equals(selection.focusOffset, 2, 'focusOffset');
+    assert_equals(selection.focusNode, null, 'focusNode');
+    assert_equals(selection.focusOffset, 0, 'focusOffset');
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/exceptions.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/exceptions.html
index b2389f0..38a2413 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/exceptions.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/exceptions.html
@@ -9,7 +9,7 @@
 
         var t = document.createElement('table');
 
-        // TODO(philipj): Setting caption/tHead/tFoot to null should not throw
+        // TODO(foolip): Setting caption/tHead/tFoot to null should not throw
         // an exception, it should just remove the old caption/thead/tfoot.
         shouldThrow("t.caption = null");
         shouldThrow("t.caption = document.body");
diff --git a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
index 78b50545..2197789 100644
--- a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
@@ -9,6 +9,9 @@
 compositionupdate
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
+compositionupdate
+PASS event.sourceCapabilities is non-null.
+PASS event.sourceCapabilities.firesTouchEvents is false
 compositionend
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt b/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
index 10f11ef28..c10a564 100644
--- a/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
@@ -11,10 +11,12 @@
 PASS event.data is "2"
 PASS event.type is "compositionupdate"
 PASS event.data is "3"
-PASS event.type is "compositionend"
+PASS event.type is "compositionupdate"
 PASS event.data is "4"
 PASS event.type is "textInput"
 PASS event.data is "4"
+PASS event.type is "compositionend"
+PASS event.data is "4"
 PASS event.type is "compositionstart"
 PASS event.data is ""
 PASS event.type is "compositionupdate"
@@ -23,6 +25,10 @@
 PASS event.data is "6"
 PASS event.type is "compositionupdate"
 PASS event.data is "7"
+PASS event.type is "compositionupdate"
+PASS event.data is ""
+PASS event.type is "textInput"
+PASS event.data is ""
 PASS event.type is "compositionend"
 PASS event.data is ""
 PASS event.type is "textInput"
@@ -31,19 +37,23 @@
 PASS event.data is ""
 PASS event.type is "compositionupdate"
 PASS event.data is "9"
-PASS event.type is "compositionend"
+PASS event.type is "compositionupdate"
 PASS event.data is "9"
 PASS event.type is "textInput"
 PASS event.data is "9"
+PASS event.type is "compositionend"
+PASS event.data is "9"
 PASS event.type is "compositionstart"
 PASS event.data is "have"
 PASS event.type is "compositionupdate"
 PASS event.data is "lost"
 PASS test.value is "I lost a pen"
-PASS event.type is "compositionend"
+PASS event.type is "compositionupdate"
 PASS event.data is "made"
 PASS event.type is "textInput"
 PASS event.data is "made"
+PASS event.type is "compositionend"
+PASS event.data is "made"
 PASS test.value is "I made a pen"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
index 6dcbdf9..a38cddf6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
+++ b/third_party/WebKit/LayoutTests/fast/events/media-focus-in-standalone-media-document.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src="../../media/media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="../../media/video-test.js"></script>
         <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
index e4996693..3390376 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
@@ -59,7 +59,7 @@
     height: { min: 30, max: 480, exact: 350 },
     aspectRatio: { ideal: 1.3333333, exact: 1.4444 },
     frameRate: { exact: 30.0 },
-    facingMode: { ideal: [ "user" ] }
+    facingMode: { exact: "user" }
   };
   // These constraints are syntactically valid, but may cause rejection.
   // They are included in an "advanced" constraint.
@@ -70,8 +70,8 @@
     echoCancellation: { exact: false },
     latency: { exact: 0.22 },
     channelCount: { exact: 2 },
-    deviceId: { exact: ["foo"] },
-    groupId: { exact: ["bar"] }
+    deviceId: { exact: ["foo", "fooz"] },
+    groupId: { exact: ["bar", "baz"] }
   };
   let complexConstraints = complexConstraintSet;
   complexConstraints.advanced = [ ignorableConstraintSet ];
@@ -80,10 +80,56 @@
       .then(function(s) {
     constraints = s.getVideoTracks()[0].getConstraints();
     assert_true(constraintElementsEqual(constraints, complexConstraints),
-      "Unexpected result:" + JSON.stringify(constraints, null, 2));
+      "Unexpected result: In: " + JSON.stringify(complexConstraints, null, 2) +
+      " Out: " + JSON.stringify(constraints, null, 2));
   });
 }, 'All valid keys are returned for complex constraints');
 
+// Syntax tests for constraints.
+
+function constraintSyntaxTestWithChange(name, constraints, expected_result) {
+  promise_test(function() {
+    return navigator.mediaDevices.getUserMedia(
+        {'video': { 'advanced': [ constraints ]}})
+      .then(function(s) {
+          var constraints_out = s.getVideoTracks()[0].getConstraints().advanced[0];
+          assert_true(constraintElementsEqual(expected_result, constraints_out),
+              "Unexpected result: Expected: " +
+              JSON.stringify(expected_result, null, 2) +
+              " Out: " + JSON.stringify(constraints_out, null, 2));
+        })
+   }, name);
+}
+
+function constraintSyntaxTest(name, constraints) {
+  constraintSyntaxTestWithChange(name, constraints, constraints);
+}
+
+constraintSyntaxTest('Simple integer', { height: 42 });
+constraintSyntaxTest('Exact integer', { height: { exact: 42 }});
+constraintSyntaxTest('Min/max integer', { height: { min: 42, max: 43 }});
+constraintSyntaxTestWithChange('Ideal unwrapped integer',
+    { height: { ideal: 42 } }, { height: 42 });
+
+constraintSyntaxTest('Simple double', { aspectRatio: 1.5 });
+constraintSyntaxTest('Exact double', { aspectRatio: { exact: 1.5 }});
+constraintSyntaxTest('Min/max double', { aspectRatio: { min: 1.5, max: 2.0 }});
+constraintSyntaxTestWithChange('Ideal unwrapped double',
+    { aspectRatio: { ideal: 1.5 } }, { aspectRatio: 1.5 });
+
+constraintSyntaxTest('Simple String', { facingMode: "user1" });
+constraintSyntaxTest('Exact String', { facingMode: { exact: "user2" }});
+constraintSyntaxTest('Multiple String in Brackets', { facingMode: { exact: ["user3", "left3"]}});
+constraintSyntaxTest('Multiple Bracketed Naked String', { facingMode: ["user4", "left4"] });
+constraintSyntaxTestWithChange('Single Bracketed string unwrapped',
+    { 'facingMode': ["user5"]}, { facingMode: "user5" });
+constraintSyntaxTest('Both Ideal and Exact string', { facingMode: { ideal: "user6", exact: "left6" }});
+
+constraintSyntaxTest('Simple boolean', { echoCancellation: true });
+constraintSyntaxTest('Exact boolean', { echoCancellation: { exact: true }});
+constraintSyntaxTestWithChange('Ideal unwrapped boolean',
+    { echoCancellation: { ideal: true } }, { echoCancellation: true });
+
 </script>
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/getusermedia-constraints.html b/third_party/WebKit/LayoutTests/fast/mediastream/getusermedia-constraints.html
index 6649d89..0f5fb696 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/getusermedia-constraints.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/getusermedia-constraints.html
@@ -56,8 +56,13 @@
 // The following set of tests verify behavior when trying to use the
 // dictionary form of constraints. The behaviors currently expected are:
 // - Unknown names in dictionary: ignored - which means Error
-// - Known names but illegal syntax for value: TypeError
-// - Known names and legal syntax for value: Error (no handler yet).
+// - Known names and legal syntax for value: Error
+// All constraints allow a primitive value (boolean, string or number),
+// and Javascript is capable of coercing just about anything into those values,
+// so we never get TypeError thrown here.
+//
+// Tests that the values are parsed and returned correctly are in
+// MediaStreamTrack-getConstraints.html.
 
 function check_constraints(name, constraints, expected_error) {
   promise_test(function() {
@@ -79,34 +84,32 @@
   'Constraint with exact Long value should be parsed',
   {'height': {exact: 47}}, 'Error');
 check_constraints(
-  'Constraint with naked value should fail with TypeError (until supported)',
-  {height: 47}, 'TypeError');
+  'Constraint with Long naked value should be parsed',
+  {height: 47}, 'Error');
 
 check_constraints(
   'Constraint with boolean value should be parsed',
   {'echoCancellation': {exact: true}}, 'Error');
 check_constraints(
-  'Constraint with boolean value should fail on naked value (until supported)',
-  {'echoCancellation': true}, 'TypeError');
+  'Constraint with boolean naked value should be parsed',
+  {'echoCancellation': true}, 'Error');
 
 check_constraints(
   'Constraint with string value should work on exact with array',
   {'facingMode': {exact: ['user']}}, 'Error');
+
 check_constraints(
-  'Constraint with exact string value should fail (until supported)',
-  {'facingMode': {exact: 'user'}}, 'TypeError');
+  'Constraint with exact string value should work',
+  {'facingMode': {exact: 'user'}}, 'Error');
+
 check_constraints(
-  'Constraint with naked string value should fail (until supported)',
-  {'facingMode': 'user'}, 'TypeError');
+  'Constraint with naked string value should be parsed',
+  {'facingMode': 'user'}, 'Error');
+
 check_constraints(
   'Using both mandatory and height should give TypeError',
   {'mandatory': {'height': '270'}, 'height': '270'}, 'TypeError');
 
-// Shows that the advanced element is not ignored.
-check_constraints(
-  'Advanced constraints with illegal content gives TypeError',
-  {'advanced': [{'height': 270}]}, 'TypeError');
-
 </script>
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
index 0bc01db..5e9c341 100644
--- a/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
+++ b/third_party/WebKit/LayoutTests/http/tests/appcache/video.html
@@ -6,7 +6,7 @@
             video { background-color: yellow; width: 320px; height: 240px; }
         </style>
         <script src=/media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=/media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
index 9ecf8b97..9269024 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-garbage-collection-before-sourceopen.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-garbage-collection-before-sourceopen.html
index 992f0a7..9832e42 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-garbage-collection-before-sourceopen.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-garbage-collection-before-sourceopen.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="/media-resources/video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-gc-after-decode-error-crash.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-gc-after-decode-error-crash.html
index dbd7cc47..6e8732b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-gc-after-decode-error-crash.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-gc-after-decode-error-crash.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
     <head>
-      <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+      <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
            (Please avoid writing new tests using video-test.js) -->
       <script src="../../media-resources/video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html
index 39d3c0b..7d9792f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html
@@ -2,7 +2,7 @@
 <html>
     <head>
       <script src="/js-test-resources/js-test.js"></script>
-      <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+      <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
            (Please avoid writing new tests using video-test.js) -->
       <script src="/media-resources/video-test.js"></script>
       <script src="/w3c/resources/testharness.js"></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist-crash.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist-crash.html
index 791c08d..e2193a8a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist-crash.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebufferlist-crash.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src="/js-test-resources/js-test.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="/media-resources/video-test.js"></script>
         <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
index e18c4f7..11c3b58d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/pdf-served-as-pdf.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>PDF file served as 'application/pdf'</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
index 8012108..0b7bfc2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/progress-events-generated-correctly.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <p>Test that progress events are generated during loading of media resource.</p>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
index 39619a9..fda0149 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/reload-after-dialog.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../../media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
index 3aa7e0b..27f23d5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html
@@ -1,7 +1,7 @@
 <video></video>
 <p>Test that removing a media element from the tree while loading does not crash.</p>
 <script src=../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
index 1b3571d..d60dde5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>text file served as 'text/plain'</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
index a708f80..d2802d8b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading-2.html
@@ -1,6 +1,6 @@
 <!doctype html>
 <title>Slow loading WebVTT file interrupted in the middle of a timestamp line</title>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=/media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
index e886482..949f19b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/track/track-webvtt-slow-loading.html
@@ -1,6 +1,6 @@
 <!doctype html>
 <title>Slow loading WebVTT file interrupted just after a cue text linebreak</title>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=/media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
index 314645ea..ff27ded 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html
@@ -1,7 +1,7 @@
 <html>
   <head>
       <script src=../../media-resources/media-file.js></script>
-      <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+      <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
            (Please avoid writing new tests using video-test.js) -->
       <script src=../../media-resources/video-test.js></script>
       <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
index a34ab5b..d9903eb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
@@ -5,7 +5,7 @@
 <p>Start playing a video with preloading enabled, do a seek near the
   end and check multiple buffered timeranges have been created.</p>
 <video id="video" preload="auto" autobuffer></video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
index 70e34cd..123bb22 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cancel-load.html
@@ -8,7 +8,7 @@
   This test should finish without crashing.
 
   <script src=../../media-resources/media-file.js></script>
-  <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+  <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
        (Please avoid writing new tests using video-test.js) -->
   <script src=../../media-resources/video-test.js></script>
   <video controls id="video"></video>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
index d7c80a1..41a5d77d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html
@@ -3,7 +3,7 @@
 </head>
 <body onload="loadCookie()">
 <video id="video"></video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
index 08128d8..687437e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-error-abort.html
@@ -3,7 +3,7 @@
     <head>
         <title>'abort' event test</title>
         <script src=../../media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-in-iframe-crash.html b/third_party/WebKit/LayoutTests/http/tests/media/video-in-iframe-crash.html
index e42dafb..bd53d42e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-in-iframe-crash.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-in-iframe-crash.html
@@ -1,6 +1,6 @@
 <!doctype html>
 <html>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src="../../media-resources/video-test.js"></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
index f2e67fa..ca566a3e 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
@@ -2,7 +2,7 @@
 <head>
     <title>Loading corrupted video with proper metadata</title>
     <script src=../../../media-resources/media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=../../../media-resources/video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
index a8f870e..1f531d89 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-suspend.html
@@ -1,7 +1,7 @@
 <html>
 <head>
 <script src=../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
index 5a432216..6a636ee 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-twice.html
@@ -1,7 +1,7 @@
 <html>
 <head>
 <script src=../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
index 3a7661f..9014541 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
index 893898e..1aef38a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-progress.html
@@ -1,7 +1,7 @@
 <html>
   <head>
       <script src=../../media-resources/media-file.js></script>
-      <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+      <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
            (Please avoid writing new tests using video-test.js) -->
       <script src=../../media-resources/video-test.js></script>
       <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
index 72c619a9..50d7fe8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
@@ -1,7 +1,7 @@
 <video></video>
 <p>Test that stalling very early, while loading meta-data, stops delaying the load event.</p>
 <script src=../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
index 5590025ee..7f6a9a1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
@@ -1,7 +1,7 @@
 <video></video>
 <p>Test that stalled, timeupdate and waiting events are sent when media load stalls in the middle.</p>
 <script src=../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
index 758e76b..688f712c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
index 4ba02c3..d6796ba 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-referer.html
@@ -5,7 +5,7 @@
 <video id="video">
     <source id="source">
 </video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../media-resources/video-test.js></script>
 <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
index b8428c3..75baddb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-duration.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=../../media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
index 96fe35f..26caf8b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-seek-to-middle.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=../../media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
index 232a5de..3c2e553 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
@@ -3,7 +3,7 @@
     <head>
         <title>media file served as 'text/plain'</title>
         <script src=../../media-resources/media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-throttled-load-metadata.html b/third_party/WebKit/LayoutTests/http/tests/media/video-throttled-load-metadata.html
index b2158e19..046e8eee 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-throttled-load-metadata.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-throttled-load-metadata.html
@@ -2,7 +2,7 @@
 <head>
     <title>throttled loading metadata</title>
     <script src="../../media-resources/media-file.js"></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src="../../media-resources/video-test.js"></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
index 55d6f52..57bc0ef 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-useragent.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../../media-resources/video-test.js></script>
         <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-allowed.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-allowed.html
index baa4ad5a..a18deca 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-allowed.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-allowed.html
@@ -1,7 +1,7 @@
 <meta http-equiv="Content-Security-Policy" content="media-src http://127.0.0.1:8000">
 <video></video>
 <script src=../../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../../media-resources/video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-blocked.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-blocked.html
index b0a2ed8..011b547 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-blocked.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/media-src-blocked.html
@@ -1,7 +1,7 @@
 <meta http-equiv="Content-Security-Policy" content="media-src 'none'">
 <video></video>
 <script src=../../../media-resources/media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../../../media-resources/video-test.js></script>
 <p>This test passes if it doesn't alert failure.</p>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
index 75b580d..78f8e8f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-readback.html
@@ -1,6 +1,6 @@
 <html>
   <body onload="start()">
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=../../media-resources/video-test.js></script>
     <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
index 8d14309..4dcca7f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/video-cross-origin-via-dom.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
   <body onload="start()">
-      <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+      <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
            (Please avoid writing new tests using video-test.js) -->
     <script src=../../media-resources/video-test.js></script>
     <script src=../../media-resources/media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/audio-autoplay-experiment-modes.html b/third_party/WebKit/LayoutTests/media/audio-autoplay-experiment-modes.html
index d79ae418..f94a4b4 100644
--- a/third_party/WebKit/LayoutTests/media/audio-autoplay-experiment-modes.html
+++ b/third_party/WebKit/LayoutTests/media/audio-autoplay-experiment-modes.html
@@ -1,7 +1,7 @@
 <html>
 <video autoplay controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=autoplay-experiment-helper.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
index e162d1d6..5f1aa080 100644
--- a/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
+++ b/third_party/WebKit/LayoutTests/media/audio-concurrent-supported.html
@@ -4,7 +4,7 @@
 
     <p>Test that multiple audio elements can play concurrently.</p>
 
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-captions-expected.txt b/third_party/WebKit/LayoutTests/media/audio-controls-captions-expected.txt
deleted file mode 100644
index c1d103a..0000000
--- a/third_party/WebKit/LayoutTests/media/audio-controls-captions-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Tests that the closed captions button is not visible.
-
-
-** Caption button should not be visible.
-EXPECTED (captionsButtonCoordinates[0] <= '0') OK
-EXPECTED (captionsButtonCoordinates[1] <= '0') OK
-END OF TEST
-
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
index 1d608f2..cdfd5e3 100644
--- a/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-captions.html
@@ -1,27 +1,18 @@
 <!DOCTYPE html>
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>Test closed caption button visbility.</title>
-    <script src=media-file.js></script>
-    <script src=media-controls.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
-         (Please avoid writing new tests using video-test.js) -->
-    <script src=video-test.js></script>
-</head>
-<body>
-    <p>Tests that the closed captions button is not visible.</p>
-    <audio controls>
-        <track src="track/captions-webvtt/captions-fast.vtt">
-    </audio>
-    <script>
-        findMediaElement();
-        audio.src = findMediaFile('audio', 'content/test');
-        audio.addEventListener('loadedmetadata', function()
-        {
-            testClosedCaptionsButtonVisibility(false);
-            endTest();
-        });
-    </script>
-</body>
-</html>
+<title>Tests that the closed captions button is not visible.</title>
+<script src="media-file.js"></script>
+<script src="media-controls.js"></script>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<audio controls>
+    <track src="track/captions-webvtt/captions-fast.vtt" default>
+</audio>
+<script>
+async_test(function(t) {
+    var audio = document.querySelector('audio');
+    audio.src = findMediaFile('audio', 'content/test');
+    audio.onloadedmetadata = t.step_func_done(function() {
+        assert_false(isClosedCaptionsButtonVisible(audio));
+    });
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out-expected.txt b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out-expected.txt
deleted file mode 100644
index 42dd7fb95..0000000
--- a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-This tests that audio controls do not fade out when the audio is playing.
-
-EXPECTED (getComputedStyle(controls).opacity == '1') OK
-
-END OF TEST
-
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
index 1a44956..920ae6792 100644
--- a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html
@@ -1,31 +1,21 @@
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
-     (Please avoid writing new tests using video-test.js) -->
-<script src="video-test.js"></script>
+<!DOCTYPE html>
+<title>This tests that audio controls do not fade out when the audio is playing.</title>
+<script src="media-file.js"></script>
 <script src="media-controls.js"></script>
-<body>
-<p>
-    This tests that audio controls do not fade out when the audio is playing.
-</p>
-<audio id="audio" controls autoplay src="content/test.oga"></audio>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<audio controls autoplay></audio>
 <script>
-    var controls;
-
-    if (window.testRunner) {
-        testRunner.waitUntilDone();
-        testRunner.dumpAsText();
-    }
-
-    var audio = document.getElementById("audio");
-    audio.addEventListener("playing", function()
-    {
-        runAfterHideMediaControlsTimerFired(function()
-        {
-            controls = mediaControlsButton(audio, "panel");
-            testExpected("getComputedStyle(controls).opacity", 1);
-
-            consoleWrite("");
-            endTest();
-        }, audio);
+async_test(function(t) {
+    var audio = document.querySelector("audio");
+    audio.src = findMediaFile("audio", "content/test");
+    audio.onplaying = t.step_func(function() {
+        runAfterHideMediaControlsTimerFired(t.step_func_done(controlsTimerFired), audio);
     });
-</script>
-</body>
+
+    function controlsTimerFired() {
+        var controls = mediaControlsButton(audio, "panel");
+        assert_equals(getComputedStyle(controls).opacity, "1");
+    }
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-data-url.html b/third_party/WebKit/LayoutTests/media/audio-data-url.html
index 5357c20..c3010bf 100644
--- a/third_party/WebKit/LayoutTests/media/audio-data-url.html
+++ b/third_party/WebKit/LayoutTests/media/audio-data-url.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked-expected.txt b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked-expected.txt
deleted file mode 100644
index 4d8bd2d8..0000000
--- a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing. 
- 
-
-
-clicking in controller
-clicking on thumb
-
-deleting audio element
-
-clicking button
-button click!
-
diff --git a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
index 331fbd7..3f8a1f8 100644
--- a/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
+++ b/third_party/WebKit/LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
@@ -1,111 +1,53 @@
 <!DOCTYPE html>
-<html>
-    <head>
-        <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
-             (Please avoid writing new tests using video-test.js) -->
-        <script src=video-test.js></script>
-        <script src=media-controls.js></script>
-        <script>
-            if (window.testRunner) {
-                testRunner.dumpAsText();
-                testRunner.waitUntilDone();
-            }
+<title>This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.</title>
+<script src="media-file.js"></script>
+<script src="media-controls.js"></script>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<input type="button" value="Click Me!">
+<audio autoplay controls></audio>
+<script>
+async_test(function(t) {
+    var audio = document.querySelector("audio");
+    audio.src = findMediaFile("audio", "content/test");
+    audio.onplaying = t.step_func(function() {
+        var seekCoords = mediaControlsButtonCoordinates(audio, "timeline");
+        var x = seekCoords[0];
+        var y = seekCoords[1];
 
-            function log(msg)
-            {
-                var console = document.getElementById('console');
-                console.innerHTML = console.innerHTML + msg + "<br>";
-            }
+        // Click in the slider to get the thumb under the mouse.
+        // clicking in controller.
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
 
-            function forceGC()
-            {
-                if (window.GCController)
-                    return GCController.collect();
+        // Click slider to scrub, leave the mouse down.
+        // clicking on thumb.
+        eventSender.mouseDown();
+        eventSender.mouseMoveTo(x, y + 20);
 
-                // Force garbage collection
-                for (var ndx = 0; ndx < 99000; ndx++)
-                    var str = new String("1234");
-            }
+        // Remove the element after seeking started
+        audio.onseeking = t.step_func(deleteAudio);
+    });
 
-            function buttonClick()
-            {
-                forceGC();
+    function deleteAudio() {
+        // deleting audio element.
+        audio.parentNode.removeChild(audio);
 
-                if (document.getElementById('audio'))
-                    log("<br>FAIL: audio element not deleted!!");
+        setTimeout(t.step_func(buttonClick), 10);
+    }
 
-                log("<br>clicking button");
+    function buttonClick() {
+        gc();
 
-                // click the button
-                var button = document.getElementById('button');
-                eventSender.mouseMoveTo(button.offsetLeft + 20, button.offsetTop + 7);
-                eventSender.mouseDown();
-                eventSender.mouseUp();
+        assert_equals(document.querySelector("audio"), null);
 
-                testRunner.notifyDone();
-            }
-
-            function deleteAudio()
-            {
-                var audio = document.getElementById('audio');
-                if (!audio)
-                    return;
-
-                log("<br>deleting audio element");
-                audio.parentNode.removeChild(audio);
-
-                setTimeout(buttonClick, 10);
-            }
-
-            function drag()
-            {
-                if (!window.testRunner)
-                    return;
-
-                testRunner.dumpAsText();
-                testRunner.waitUntilDone();
-
-                var audio = document.getElementById('audio');
-                var seekCoords;
-                try {
-                    seekCoords = mediaControlsButtonCoordinates(audio, "timeline");
-                } catch (exception) {
-                    failTest(exception.description);
-                    return;
-                }
-                var x = seekCoords[0];
-                var y = seekCoords[1];
-
-                // Click in the slider to get the thumb under the mouse.
-                log("clicking in controller");
-                eventSender.mouseMoveTo(x, y);
-                eventSender.mouseDown();
-                eventSender.mouseUp();
-
-                // Click slider to scrub, leave the mouse down.
-                log("clicking on thumb");
-                eventSender.mouseDown();
-                eventSender.mouseMoveTo(x, y + 20);
-
-                // Remove the element after seeking started
-                audio.addEventListener("seeking", deleteAudio);
-            }
-
-
-            function start()
-            {
-                setSrcByTagName("audio", findMediaFile("audio", "content/test"));
-            }
-
-        </script>
-    </head>
-    <body onload="start()">
-        This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.
-        <br>
-        <input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
-        <br>
-        <audio id="audio" autoplay onplaying="drag()" controls></audio><br><br>
-        <div id="console"></div>
-    </body>
-</html>
+        // click the button
+        var button = document.querySelector("input");
+        button.onmouseup = t.step_func_done();
+        eventSender.mouseMoveTo(button.offsetLeft + 20, button.offsetTop + 7);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
index e3cf99b..942f437 100644
--- a/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
+++ b/third_party/WebKit/LayoutTests/media/audio-garbage-collect.html
@@ -16,7 +16,7 @@
 
 <script src=../resources/gc.js></script>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/media/audio-play-event.html b/third_party/WebKit/LayoutTests/media/audio-play-event.html
index 30ca507..d20c908 100644
--- a/third_party/WebKit/LayoutTests/media/audio-play-event.html
+++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
@@ -2,7 +2,7 @@
     <head>
         <title>'play' event</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/before-load-member-access.html b/third_party/WebKit/LayoutTests/media/before-load-member-access.html
index 88446daa..cbb3b08 100644
--- a/third_party/WebKit/LayoutTests/media/before-load-member-access.html
+++ b/third_party/WebKit/LayoutTests/media/before-load-member-access.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <title>Test that accessing member of a non loaded video works.</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/broken-video.html b/third_party/WebKit/LayoutTests/media/broken-video.html
index a0ede20..9fecca3 100644
--- a/third_party/WebKit/LayoutTests/media/broken-video.html
+++ b/third_party/WebKit/LayoutTests/media/broken-video.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that an invalid video file generates a MEDIA_ERR_SRC_NOT_SUPPORTED error and sets networkState to NETWORK_NO_SOURCE.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/constructors.html b/third_party/WebKit/LayoutTests/media/constructors.html
index 2f13e31..c4f70da3 100644
--- a/third_party/WebKit/LayoutTests/media/constructors.html
+++ b/third_party/WebKit/LayoutTests/media/constructors.html
@@ -2,7 +2,7 @@
 <p>Test that media constructors behave consistently.</p>
 <video></video>
 <audio></audio>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls-cast-button-narrow.html
index 59a50e0..dda2db0 100644
--- a/third_party/WebKit/LayoutTests/media/controls-cast-button-narrow.html
+++ b/third_party/WebKit/LayoutTests/media/controls-cast-button-narrow.html
@@ -6,7 +6,7 @@
         <script src="../resources/testharnessreport.js"></script>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-button.html b/third_party/WebKit/LayoutTests/media/controls-cast-button.html
index 70ccec4..2a47930 100644
--- a/third_party/WebKit/LayoutTests/media/controls-cast-button.html
+++ b/third_party/WebKit/LayoutTests/media/controls-cast-button.html
@@ -6,7 +6,7 @@
         <script src="../resources/testharnessreport.js"></script>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
index 940c2bd5..d63926e 100644
--- a/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
+++ b/third_party/WebKit/LayoutTests/media/controls-cast-do-not-fade-out.html
@@ -6,7 +6,7 @@
         <script src="../resources/testharnessreport.js"></script>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-cast-overlay-slow-fade.html b/third_party/WebKit/LayoutTests/media/controls-cast-overlay-slow-fade.html
index a5a4215..096f3db 100644
--- a/third_party/WebKit/LayoutTests/media/controls-cast-overlay-slow-fade.html
+++ b/third_party/WebKit/LayoutTests/media/controls-cast-overlay-slow-fade.html
@@ -6,7 +6,7 @@
         <script src="../resources/testharnessreport.js"></script>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-css-overload.html b/third_party/WebKit/LayoutTests/media/controls-css-overload.html
index 2b17718..cd66186d 100644
--- a/third_party/WebKit/LayoutTests/media/controls-css-overload.html
+++ b/third_party/WebKit/LayoutTests/media/controls-css-overload.html
@@ -12,7 +12,7 @@
                 display:none;
             }
         </style>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
index dd3c9d90..2b58e97 100644
--- a/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
+++ b/third_party/WebKit/LayoutTests/media/controls-drag-timebar.html
@@ -4,7 +4,7 @@
         <title>drag timebar test</title>
         <script src=media-controls.js></script>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/controls-overlay-cast-button.html b/third_party/WebKit/LayoutTests/media/controls-overlay-cast-button.html
index 9eeca21..99330aa4 100644
--- a/third_party/WebKit/LayoutTests/media/controls-overlay-cast-button.html
+++ b/third_party/WebKit/LayoutTests/media/controls-overlay-cast-button.html
@@ -6,7 +6,7 @@
         <script src="../resources/testharnessreport.js"></script>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
index a1eea31..a6009c5 100644
--- a/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
+++ b/third_party/WebKit/LayoutTests/media/controls-right-click-on-timebar.html
@@ -3,7 +3,7 @@
         <title>right click on timebar test</title>
         <script src=media-controls.js></script>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/controls-timeline.html b/third_party/WebKit/LayoutTests/media/controls-timeline.html
index 485da52c..f214c5d 100644
--- a/third_party/WebKit/LayoutTests/media/controls-timeline.html
+++ b/third_party/WebKit/LayoutTests/media/controls-timeline.html
@@ -4,7 +4,7 @@
         <title>media controls timeline</title>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
index f5e5f57..74f556f4 100644
--- a/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
+++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider-keynav.html
@@ -4,7 +4,7 @@
         <title>media controls volume slider keyboard navigation</title>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
index 3f5d61c..964ff75 100644
--- a/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
+++ b/third_party/WebKit/LayoutTests/media/controls-volume-slider.html
@@ -4,7 +4,7 @@
         <title>media controls volume slider</title>
         <script src="media-file.js"></script>
         <script src="media-controls.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
index e25b68a98..aa6eea8 100644
--- a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
+++ b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
@@ -1,7 +1,7 @@
 <meta http-equiv="Content-Security-Policy" content="media-src 'none'">
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <p>This test passes if it doesn't alert failure.</p>
diff --git a/third_party/WebKit/LayoutTests/media/event-attributes.html b/third_party/WebKit/LayoutTests/media/event-attributes.html
index 52262410..3f871a4 100644
--- a/third_party/WebKit/LayoutTests/media/event-attributes.html
+++ b/third_party/WebKit/LayoutTests/media/event-attributes.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/invalid-media-url-crash.html b/third_party/WebKit/LayoutTests/media/invalid-media-url-crash.html
index a32ab1f..7931f70 100644
--- a/third_party/WebKit/LayoutTests/media/invalid-media-url-crash.html
+++ b/third_party/WebKit/LayoutTests/media/invalid-media-url-crash.html
@@ -1,7 +1,7 @@
 <html>
     <body>
         <p>Tests that invalid media src url does not result in crash.</p>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
index acd5cd5..0d9912e7 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-load-when-hidden.html
@@ -11,7 +11,7 @@
         <p>Test HTMLMediaElement to be sure that the video is getting loaded even if the element
         is hidden.</p>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-flac-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-flac-audio.html
index a100558..8f32086b 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-flac-audio.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-flac-audio.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
index f95ce2e3..ed53e6285 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg-audio.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
index 1c23a23d..57a455a 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-mpeg4-video.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
index d69e6a9..1cd108a6 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-octet-stream.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
index 72cf280..f3cd8f8 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-ogg.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-type.html b/third_party/WebKit/LayoutTests/media/media-can-play-type.html
index f71697c..3eb3dbc4 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-type.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-type.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
index 63bc651e..954beb6a 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-wav-audio.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
index 74f8d68..3b195de 100644
--- a/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
+++ b/third_party/WebKit/LayoutTests/media/media-can-play-webm.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
index 7f2b4e4c..594efaf 100644
--- a/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
+++ b/third_party/WebKit/LayoutTests/media/media-captions-no-controls.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-constants.html b/third_party/WebKit/LayoutTests/media/media-constants.html
index 8b27bb5..c4b5858 100644
--- a/third_party/WebKit/LayoutTests/media/media-constants.html
+++ b/third_party/WebKit/LayoutTests/media/media-constants.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
index 87e23893..f1ede32 100644
--- a/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
+++ b/third_party/WebKit/LayoutTests/media/media-continues-playing-after-replace-source.html
@@ -4,7 +4,7 @@
 
     <p>Test that media keeps playing when the source element is replaced.</p>
 
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
index 527681fe..366de2d 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
+++ b/third_party/WebKit/LayoutTests/media/media-controls-invalid-url.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-controls.js b/third_party/WebKit/LayoutTests/media/media-controls.js
index ca52cb1..b923623 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls.js
+++ b/third_party/WebKit/LayoutTests/media/media-controls.js
@@ -99,6 +99,20 @@
     return displayElement;
 }
 
+function isClosedCaptionsButtonVisible(currentMediaElement)
+{
+    var captionsButtonElement = mediaControlsButton(currentMediaElement, "toggle-closed-captions-button");
+    var captionsButtonCoordinates = mediaControlsButtonCoordinates(currentMediaElement, "toggle-closed-captions-button");
+
+    if (!captionsButtonElement.disabled
+        && captionsButtonCoordinates[0] > 0
+        && captionsButtonCoordinates[1] > 0) {
+        return true;
+    }
+
+    return false;
+}
+
 function testClosedCaptionsButtonVisibility(expected)
 {
     try {
diff --git a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
index 04d0de6..91c52fd 100644
--- a/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
+++ b/third_party/WebKit/LayoutTests/media/media-element-play-after-eos.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-ended.html b/third_party/WebKit/LayoutTests/media/media-ended.html
index 995b7fe0..640906e 100644
--- a/third_party/WebKit/LayoutTests/media/media-ended.html
+++ b/third_party/WebKit/LayoutTests/media/media-ended.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
index 93b2420..361baf5 100644
--- a/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
+++ b/third_party/WebKit/LayoutTests/media/media-extension-with-fragment.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0001.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0001.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0001.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0001.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0002.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0002.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0002.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0002.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0003.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0003.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0003.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0003.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0004.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0004.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0004.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0004.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0005.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0005.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0005.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0005.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0006.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0006.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0006.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0006.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0009.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0009.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0009.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0009.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0011.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0011.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0011.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0011.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0012.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0012.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0012.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0012.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0014.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0014.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0014.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0014.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0015.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0015.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0015.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0015.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0017.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0017.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0017.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0017.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0024.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0024.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0024.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0024.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0027.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0027.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0027.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0027.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0028.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0028.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0028.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0028.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0029.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0029.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0029.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0029.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0030.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0030.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0030.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0030.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0031.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0031.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0031.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0031.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0032.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0032.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0032.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0032.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0033.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0033.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0033.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0033.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0034.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0034.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0034.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0034.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0035.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0035.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0035.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0035.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0036.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0036.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0036.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0036.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0037.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0037.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0037.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0037.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0038.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0038.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0038.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0038.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0039.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0039.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0039.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0039.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0044.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0044.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0044.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0044.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0051.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0051.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0051.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0051.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0052.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0052.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0052.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0052.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0053.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0053.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0053.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0053.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0054.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0054.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0054.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0054.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0055.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0055.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0055.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0055.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0058.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0058.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0058.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0058.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0059.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0059.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0059.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0059.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0061.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0061.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0061.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0061.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0062.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0062.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0062.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0062.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0063.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0063.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0063.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0063.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0064.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0064.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0064.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0064.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0065.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0065.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0065.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0065.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0066.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0066.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0066.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0066.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0067.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0067.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0067.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0067.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0068.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0068.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0068.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0068.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0069.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0069.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0069.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0069.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0070.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0070.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0070.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0070.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0071.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0071.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0071.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0071.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0072.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0072.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0072.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0072.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0073.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0073.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0073.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0073.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0074.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0074.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0074.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0074.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0075.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0075.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0075.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0075.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0076.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0076.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0076.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0076.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0077.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0077.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0077.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0077.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0078.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0078.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0078.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0078.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0079.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0079.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0079.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0079.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0080.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0080.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0080.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0080.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0081.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0081.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0081.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0081.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0082.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0082.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0082.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0082.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0083.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0083.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0083.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0083.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0084.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0084.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0084.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0084.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0085.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0085.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0085.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0085.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0086.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0086.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0086.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0086.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0087.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0087.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0087.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0087.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0088.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0088.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0088.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0088.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0089.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0089.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0089.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0089.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0090.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0090.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0090.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0090.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0091.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0091.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0091.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0091.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0092.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0092.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0092.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0092.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0093.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0093.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0093.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0093.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-fragments/TC0094.html b/third_party/WebKit/LayoutTests/media/media-fragments/TC0094.html
index 38aaf7d..d899143 100644
--- a/third_party/WebKit/LayoutTests/media/media-fragments/TC0094.html
+++ b/third_party/WebKit/LayoutTests/media/media-fragments/TC0094.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=media-fragments.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/media-load-event.html b/third_party/WebKit/LayoutTests/media/media-load-event.html
index 02a3344..af0ecaa 100644
--- a/third_party/WebKit/LayoutTests/media/media-load-event.html
+++ b/third_party/WebKit/LayoutTests/media/media-load-event.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/media-reparent.html b/third_party/WebKit/LayoutTests/media/media-reparent.html
index 59a6c81..5a42a927b 100644
--- a/third_party/WebKit/LayoutTests/media/media-reparent.html
+++ b/third_party/WebKit/LayoutTests/media/media-reparent.html
@@ -1,5 +1,5 @@
 Test that reparenting a removed media tag doesn't crash the process.
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
index a70efcf..0b7a2ff6 100644
--- a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
+++ b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
index 895e4ba..a25c4a3 100644
--- a/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
+++ b/third_party/WebKit/LayoutTests/media/no-autoplay-with-user-gesture-requirement.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test that media autoplay should not work if user gesture is required for playback</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/remove-from-document-no-load.html b/third_party/WebKit/LayoutTests/media/remove-from-document-no-load.html
index c6249245..0929fe0 100644
--- a/third_party/WebKit/LayoutTests/media/remove-from-document-no-load.html
+++ b/third_party/WebKit/LayoutTests/media/remove-from-document-no-load.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that removing a media element from the tree when no media has been loaded does not generate a loadstart event.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/remove-from-document.html b/third_party/WebKit/LayoutTests/media/remove-from-document.html
index f827e80..3eb5fde 100644
--- a/third_party/WebKit/LayoutTests/media/remove-from-document.html
+++ b/third_party/WebKit/LayoutTests/media/remove-from-document.html
@@ -2,7 +2,7 @@
 <html>
 <head>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script type="text/javascript" charset="utf-8">
diff --git a/third_party/WebKit/LayoutTests/media/resources/auto-play-in-sandbox-with-allow-scripts-iframe.html b/third_party/WebKit/LayoutTests/media/resources/auto-play-in-sandbox-with-allow-scripts-iframe.html
index 18b2ddb..e5457109 100644
--- a/third_party/WebKit/LayoutTests/media/resources/auto-play-in-sandbox-with-allow-scripts-iframe.html
+++ b/third_party/WebKit/LayoutTests/media/resources/auto-play-in-sandbox-with-allow-scripts-iframe.html
@@ -2,7 +2,7 @@
 <video autoplay controls></video>
 <p>Test that play event fires when "src" set with an autoplay attribute in a sandbox with allows-scripts.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/sources-fallback-codecs.html b/third_party/WebKit/LayoutTests/media/sources-fallback-codecs.html
index ce4a050..03bc677 100644
--- a/third_party/WebKit/LayoutTests/media/sources-fallback-codecs.html
+++ b/third_party/WebKit/LayoutTests/media/sources-fallback-codecs.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
index 17fb239..a7cea1f 100644
--- a/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/media-element-enqueue-event-crash.html
@@ -3,7 +3,7 @@
     <head>
         <script src=../media-file.js></script>
         <script src=../media-controls.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onaddtrack.html b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onaddtrack.html
index 7c0a8a9d..f6fc311 100644
--- a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onaddtrack.html
+++ b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onaddtrack.html
@@ -5,7 +5,7 @@
 <div id=log></div>
 <script>
 setup(function(){
-    // TODO(philipj): Remove this test in favor of those in web-platform-tests
+    // TODO(foolip): Remove this test in favor of those in web-platform-tests
     // once Oilpan has shipped. https://crbug.com/503852
     window.video = document.createElement('video');
     window.tracks = video.textTracks;
diff --git a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onremovetrack.html b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onremovetrack.html
index 922bf78..cc95c67 100644
--- a/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onremovetrack.html
+++ b/third_party/WebKit/LayoutTests/media/track/opera/interfaces/TextTrackList/onremovetrack.html
@@ -5,7 +5,7 @@
 <div id=log></div>
 <script>
 setup(function(){
-    // TODO(philipj): Remove this test in favor of those in web-platform-tests
+    // TODO(foolip): Remove this test in favor of those in web-platform-tests
     // once Oilpan has shipped. https://crbug.com/503852
     window.video = document.createElement('video');
     window.tracks = video.textTracks;
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
index 91fe721..0ff60be 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-gc-wrapper.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
index 54be3f16..c1619bf4 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-horizontal.html
@@ -24,7 +24,7 @@
 
         </script>
 
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
index c12c1b34..42d6ba5 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-vertical.html
@@ -25,7 +25,7 @@
 
         </script>
 
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
index 689ba12..6a28b426 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
index 15d10ce6..a27e3567 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
index 432bde5..8c6df18 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
index b974282..ba497bd4 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html
@@ -15,7 +15,7 @@
 <script></script>
 <script>setTimeout("try { var v = document.querySelector('video'); v.parentNode.removeChild(v); } catch(e) {}", 61);</script>
 <meta>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
index 7e7bc0c..2712279e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-quickly.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
index 7c8ad83f..3ff51f3 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
index 3ed29fd..113d15f 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
index 48d7bfe..a8b1863 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
index fad220f..9ac839b 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc013-settings.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html
index 2cc96da..381e783e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc015-positioning.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc015-positioning.html
index ab9c029..12f1bd4 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc015-positioning.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc015-positioning.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc016-align-positioning.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc016-align-positioning.html
index e567e013..5291c8a 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc016-align-positioning.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc016-align-positioning.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc017-line-position.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc017-line-position.html
index 4c7be7f..31654a31 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc017-line-position.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc017-line-position.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc018-align-text-line-position.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc018-align-text-line-position.html
index 917490f2..784292b1 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc018-align-text-line-position.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc018-align-text-line-position.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
index 8453244..aea7817 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc020-cue-size-align.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc020-cue-size-align.html
index 87be96b5..070b16b 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc020-cue-size-align.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc020-cue-size-align.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc021-valign.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc021-valign.html
index 926df2e..77f51da 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc021-valign.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc021-valign.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc022-entities.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc022-entities.html
index 902f39e1..1202e9c 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc022-entities.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc022-entities.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc023-markup.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc023-markup.html
index 9887e8e..abd2b65e 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc023-markup.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc023-markup.html
@@ -3,7 +3,7 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc024-timestamp.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc024-timestamp.html
index 53bce1e..d45fee55 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc024-timestamp.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc024-timestamp.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc025-class-markup.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc025-class-markup.html
index f04db0a..d69943d 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc025-class-markup.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc025-class-markup.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc026-voice.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc026-voice.html
index 1d999a1..5afa967 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc026-voice.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc026-voice.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc027-empty-cue.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc027-empty-cue.html
index 9162e9ed..b023a751 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc027-empty-cue.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc027-empty-cue.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html
index 186ed7b1..70422b7 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html
index c2bdb87f..5bf1429 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue.html
index 972a367..c3f941ef 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc030-interspersed-non-cue.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html
index 991e677..f78adb4 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc032-degenerate-cues.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc032-degenerate-cues.html
index 5d99ada..48afe0f9 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc032-degenerate-cues.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc032-degenerate-cues.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
index 086bb52..12fc37b 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-word-breaking.html
@@ -11,7 +11,7 @@
         }
         </script>
         <script src=../media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../video-test.js></script>
         <script src=../media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/unsupported-rtsp.html b/third_party/WebKit/LayoutTests/media/unsupported-rtsp.html
index ed5e82a6..f83f9ddf 100644
--- a/third_party/WebKit/LayoutTests/media/unsupported-rtsp.html
+++ b/third_party/WebKit/LayoutTests/media/unsupported-rtsp.html
@@ -3,7 +3,7 @@
 
 <p>Test that QuickTime file with RTSP URL generates a load error.<p>
 
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
index 0d9cda6..77ed01c3 100644
--- a/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
+++ b/third_party/WebKit/LayoutTests/media/unsupported-tracks.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that QuickTime file with unsupported track types only generates an error.<p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-append-source.html b/third_party/WebKit/LayoutTests/media/video-append-source.html
index 0477140..5dbcb0cb 100644
--- a/third_party/WebKit/LayoutTests/media/video-append-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-append-source.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
index 78715ce..5012642 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-just-once.html
@@ -1,5 +1,5 @@
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html
index a1f930e54..0d64292 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay-experiment-modes.html
@@ -1,7 +1,7 @@
 <html>
 <video autoplay controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=autoplay-experiment-helper.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-autoplay.html b/third_party/WebKit/LayoutTests/media/video-autoplay.html
index 8e6d2a76..a151039 100644
--- a/third_party/WebKit/LayoutTests/media/video-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-autoplay.html
@@ -1,6 +1,6 @@
 <video autoplay controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
index d7bc14b..aa2e5fb9e 100644
--- a/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-black-bg-in-media-document.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
index 9d3e39b..7de11ae 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered-unknown-duration.html
@@ -4,7 +4,7 @@
 <p>Load a video with an infinite duration. Start playback and ensure
 video.currentTime &lt; video.buffered.end(0) upon first timeupdate.</p>
 <video></video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src="video-test.js"></script>
 <script src="media-file.js"></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered.html b/third_party/WebKit/LayoutTests/media/video-buffered.html
index 20b3f5e..edc02f4 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas-source.html b/third_party/WebKit/LayoutTests/media/video-canvas-source.html
index 25a2ff7..ae6a2da 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-canvas-source.html
@@ -2,7 +2,7 @@
     <head>
         <title>Drawing to canvas using video with source element does not taint canvas</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src="../resources/js-test.js"></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-canvas.html-disabled b/third_party/WebKit/LayoutTests/media/video-canvas.html-disabled
index 31ea5f4ba..4d64cc8e 100644
--- a/third_party/WebKit/LayoutTests/media/video-canvas.html-disabled
+++ b/third_party/WebKit/LayoutTests/media/video-canvas.html-disabled
@@ -1,7 +1,7 @@
 <html>
     <head>
         <title>drawing &lt;video&gt; to &lt;canvas&gt;</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=../http/tests/media/video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-capture-canvas.html b/third_party/WebKit/LayoutTests/media/video-capture-canvas.html
index 85226aa..4eff21c1 100644
--- a/third_party/WebKit/LayoutTests/media/video-capture-canvas.html
+++ b/third_party/WebKit/LayoutTests/media/video-capture-canvas.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=video-played.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-capture-preview.html b/third_party/WebKit/LayoutTests/media/video-capture-preview.html
index 93fdfff..c1ce6ff 100644
--- a/third_party/WebKit/LayoutTests/media/video-capture-preview.html
+++ b/third_party/WebKit/LayoutTests/media/video-capture-preview.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=video-played.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
index 340bfd1..f2af987 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-always-visible-when-control-hovered.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
index 9d3dacc..63af219 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-attribute-fullscreen.html
@@ -3,7 +3,7 @@
     <head>
         <title>Test that the controls attribute is not affected by fullscreen</title>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
index 48cb5828..61709d0 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-auto-hide-after-play-by-touch.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-captions-on-off.html b/third_party/WebKit/LayoutTests/media/video-controls-captions-on-off.html
index b6a729f..062f74d 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-captions-on-off.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-captions-on-off.html
@@ -5,7 +5,7 @@
     <title>Test closed caption track selection on and off.</title>
     <script src=media-file.js></script>
     <script src=media-controls.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-captions.html b/third_party/WebKit/LayoutTests/media/video-controls-captions.html
index 71ae2022..9f9dfa5 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-captions.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-captions.html
@@ -5,7 +5,7 @@
     <title>Test closed caption track selection functionality.</title>
     <script src=media-file.js></script>
     <script src=media-controls.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
index 7d23d0d..b2cc112 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test visibiblity of controls when focusing of &lt;video></title>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
index 1e79124..eb9de74 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-focus-movement-on-hide.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test focus movement when controls fade out with a button focused</title>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
index 70affce..1c621a0 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hidden-audio.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that hiding volume / mute buttons works as expected.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
index 48c15eb..60397f9f 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-after-touch-on-control.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
index 2c4ff9e5..4e4dc55 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-hide-on-move-outside-controls.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
index 137b679..498e9b2 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-in-media-document.html
@@ -1,7 +1,7 @@
 <p>Test that controls don't increase the size of the container (i.e. are
 rendered overlapping with the video canvas).<p>
 <script src="media-file.js" type="text/javascript"></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src="video-test.js" type="text/javascript"></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
index 9c8a221..d85411a 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-mouse-events-captured.html
@@ -8,7 +8,7 @@
     <p>This tests that a mouse events on the controls will not be seen by the video element.</p>
     <p>Also tests keyboard input.</p>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
index 9875abf..fdf9035 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-muted-video-can-unmute.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that muted video has an unmute button.<p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-no-scripting.html b/third_party/WebKit/LayoutTests/media/video-controls-no-scripting.html
index 9c0b6b4e..68c45b5 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-no-scripting.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-no-scripting.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js" type="text/javascript"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button.html
index 708a380f..63f3378 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overlay-play-button.html
@@ -4,7 +4,7 @@
         <title>Test that the overlay play button respects the controls attribute</title>
         <script src="media-controls.js"></script>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
index d1b8fe4..e6f6cd5 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <title>Test visibiblity of controls when focusing of &lt;video></title>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
index 81dd5ca..e897db8 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-toggling.html
@@ -3,7 +3,7 @@
     <title>Test rendering of volume slider of video tag</title>
     <script src=media-file.js></script>
     <script src=media-controls.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
index a3492f4..46b3169e 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-touch-events-captured.html
@@ -7,7 +7,7 @@
     <video controls></video>
     <p>This tests that touch events on the controls will not be seen by the video element.</p>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
index e25557b..63ae802 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-transformed.html
@@ -13,7 +13,7 @@
     <p>Test controls on transformed video.</p>
     <p>This test only runs in DRT!</p>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=media-controls.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
index ac6c4c1..a3d83fc4 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-mouse-after-touch.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
index 3ed390ae..0e601bb 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visibility-multimodal-touch-after-mouse.html
@@ -6,7 +6,7 @@
   height: 240px;
 }
 </style>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-visible-exiting-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-controls-visible-exiting-fullscreen.html
index d28dce60..33ff8d7 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-visible-exiting-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-visible-exiting-fullscreen.html
@@ -3,7 +3,7 @@
     <title>Test rendering of video control after exiting fullscreen</title>
     <script src=media-file.js></script>
     <script src=media-controls.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script src=../fullscreen/full-screen-test.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
index 7717babe..ce33016 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-zoomed.html
@@ -49,7 +49,7 @@
     <video controls></video>
     <p>Test controls on zoomed video.</p>
     <p>This test only runs in DRT!</p>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-controls.html b/third_party/WebKit/LayoutTests/media/video-controls.html
index 98ae3068..e048c8e9 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test 'controls' attribute<p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
index f3b0e3b..870bd6a6 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata-media-fragment-uri.html
@@ -6,7 +6,7 @@
     <body>
         <video id="video"></video>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
index 89dc6e8e..2d10b85 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-before-have-metadata.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
index b81a59f..2307eec1 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-delay.html
@@ -6,7 +6,7 @@
     <p>Test a delay in playing the movie results in a canPlay event.</p>
 
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
index 5f9d3ff..d8689ad 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set.html
@@ -6,7 +6,7 @@
     <p>Test that setting currentTime changes the time, and that 'ended' event is fired in a reasonable amount of time</p>
 
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
index f8dbcfd..f55a9c2 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime-set2.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-currentTime.html b/third_party/WebKit/LayoutTests/media/video-currentTime.html
index ff271324..df46d6a 100644
--- a/third_party/WebKit/LayoutTests/media/video-currentTime.html
+++ b/third_party/WebKit/LayoutTests/media/video-currentTime.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
index 381c94a..f58e5ce8 100644
--- a/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
+++ b/third_party/WebKit/LayoutTests/media/video-defaultmuted.html
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
index 5f5e715..7de7b4b2 100644
--- a/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
+++ b/third_party/WebKit/LayoutTests/media/video-delay-load-event.html
@@ -3,7 +3,7 @@
     <head>
         <title>delay document 'load' event test</title>
         <style> video { border: 3px solid red; } </style>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
index 161dc70e..feabaa8 100644
--- a/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
+++ b/third_party/WebKit/LayoutTests/media/video-display-aspect-ratio.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
index 74297984..8ed48a4 100644
--- a/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
+++ b/third_party/WebKit/LayoutTests/media/video-display-none-crash.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that pause() after changing display to "none" doesn't cause a crash.</p>
 <script src="media-file.js"></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src="video-test.js"></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
index c042053..1f52077 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-autoplay.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-preload.html b/third_party/WebKit/LayoutTests/media/video-dom-preload.html
index a9713a3a..08385d4 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-preload.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-preload.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-src.html b/third_party/WebKit/LayoutTests/media/video-dom-src.html
index 2b681cf..cd5d364 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-src.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
index a23ca13..b125afdc 100644
--- a/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
+++ b/third_party/WebKit/LayoutTests/media/video-double-seek-currentTime.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
index bbfa940..a34f285 100644
--- a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
+++ b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
@@ -5,7 +5,7 @@
         <title>local video</title>
 
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-durationchange-on-ended.html b/third_party/WebKit/LayoutTests/media/video-durationchange-on-ended.html
index 70dd97b..e8b94bc5 100644
--- a/third_party/WebKit/LayoutTests/media/video-durationchange-on-ended.html
+++ b/third_party/WebKit/LayoutTests/media/video-durationchange-on-ended.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
index 6aa985af..4c1c942 100644
--- a/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
+++ b/third_party/WebKit/LayoutTests/media/video-enter-fullscreen-without-user-gesture.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test webkitRequestFullscreen() without any user gesture.</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html b/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
index 6577382..777ac8e 100644
--- a/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
+++ b/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
@@ -1,6 +1,6 @@
 <p>Test that the media element is in correct state after load fails.</p>
 <video controls></video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-load-networkState.html b/third_party/WebKit/LayoutTests/media/video-load-networkState.html
index bcd7e95..a607f3de 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-networkState.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-networkState.html
@@ -9,7 +9,7 @@
      </p>
 
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
index a2eb3f8..dc6184f9 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-load-readyState.html b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
index 03471ba4..26c0fcf 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-readyState.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
index f802273..bc4b771 100644
--- a/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
+++ b/third_party/WebKit/LayoutTests/media/video-loop-from-ended.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-loop.html b/third_party/WebKit/LayoutTests/media/video-loop.html
index dafcfc9..3cdfbda3 100644
--- a/third_party/WebKit/LayoutTests/media/video-loop.html
+++ b/third_party/WebKit/LayoutTests/media/video-loop.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-mouse-focus.html b/third_party/WebKit/LayoutTests/media/video-mouse-focus.html
index 43fae70..0cb7212 100644
--- a/third_party/WebKit/LayoutTests/media/video-mouse-focus.html
+++ b/third_party/WebKit/LayoutTests/media/video-mouse-focus.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-muted.html b/third_party/WebKit/LayoutTests/media/video-muted.html
index a2c8ef14..f7a8f099 100644
--- a/third_party/WebKit/LayoutTests/media/video-muted.html
+++ b/third_party/WebKit/LayoutTests/media/video-muted.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test 'muted' attribute<p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
index 24550f2a..cc91fcc 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-autoplay.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that play event does not fire when "src" set with no autoplay attribute.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
index d3f99a9..2d0fa8c 100644
--- a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
+++ b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html
@@ -4,7 +4,7 @@
     <p>Test that no timeupdate event fires during loading.</p>
     <video></video>
     <script src="media-file.js"></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src="video-test.js"></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
index 4e22d80..ba3cf88 100644
--- a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that pause() from EMPTY network state triggers load()</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
index 27cb556..93373f0 100644
--- a/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
+++ b/third_party/WebKit/LayoutTests/media/video-pause-immediately.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test pause() pauses the clock immediately</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
index e9c896dc..6f08f9b 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
@@ -4,7 +4,7 @@
     <video controls></video>
     <p>Test that play() from EMPTY network state triggers load() and async play event.</p>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
index cedc26b..9b86f65c 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-pause-events.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test that calling play() and pause() triggers async play, timeupdate and pause events.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html b/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
index 88f43de..e88ad5e 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
@@ -4,7 +4,7 @@
 
 <p>Video has no src. Test that the playing event is not dispatched.</p>
 
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
index 87a7116b..8d6109d 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html
@@ -3,7 +3,7 @@
         <title>Test that video play does not work unless a user gesture is involved in playing a video</title>
         <script src=media-controls.js></script>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-playbackrate.html b/third_party/WebKit/LayoutTests/media/video-playbackrate.html
index 4ba5cb0..abe071a 100644
--- a/third_party/WebKit/LayoutTests/media/video-playbackrate.html
+++ b/third_party/WebKit/LayoutTests/media/video-playbackrate.html
@@ -3,7 +3,7 @@
     <head>
         <title>test playbackRate and defaultPlaybackRate</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-played-collapse.html b/third_party/WebKit/LayoutTests/media/video-played-collapse.html
index 4688534..3a84193 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-collapse.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-collapse.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test of 'played' attribute</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=video-played.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
index 17406f8..46481f6 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-ranges-1.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test of 'played' attribute</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=video-played.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-played-reset.html b/third_party/WebKit/LayoutTests/media/video-played-reset.html
index f2ce0b0..f0e71747 100644
--- a/third_party/WebKit/LayoutTests/media/video-played-reset.html
+++ b/third_party/WebKit/LayoutTests/media/video-played-reset.html
@@ -2,7 +2,7 @@
     <head>
         <title>Test of 'played' attribute</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=video-played.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
index cb7033c..3a8656c 100644
--- a/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
+++ b/third_party/WebKit/LayoutTests/media/video-plays-past-end-of-test.html
@@ -3,7 +3,7 @@
 
 <video autoplay id="video"></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script type="text/javascript">
diff --git a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
index 5989c9b..c3b622c9 100644
--- a/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
+++ b/third_party/WebKit/LayoutTests/media/video-poster-delayed.html
@@ -3,7 +3,7 @@
 <html>
     <head>
         <title>Delayed load of poster should not overwrite intrinsic size of video</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-poster-scale.html b/third_party/WebKit/LayoutTests/media/video-poster-scale.html
index effc082..fc19161d 100644
--- a/third_party/WebKit/LayoutTests/media/video-poster-scale.html
+++ b/third_party/WebKit/LayoutTests/media/video-poster-scale.html
@@ -3,7 +3,7 @@
 <html>
     <head>
         <title>'poster' aspect ratio test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <style>
diff --git a/third_party/WebKit/LayoutTests/media/video-poster.html b/third_party/WebKit/LayoutTests/media/video-poster.html
index fd8f50f..8e12e19f 100644
--- a/third_party/WebKit/LayoutTests/media/video-poster.html
+++ b/third_party/WebKit/LayoutTests/media/video-poster.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <title>&lt;video&gt; element with poster size test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
index 34c7597..0c6eb6c 100644
--- a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
+++ b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html
@@ -3,7 +3,7 @@
     <head>
         <title>Test the prefixed HTMLVideoElement fullscreen API</title>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
index e6ba067..49d8f4f 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-preload.html b/third_party/WebKit/LayoutTests/media/video-preload.html
index 4beaad5f..c02767aa 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload.html
@@ -3,7 +3,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
index faa4964..3c15e96 100644
--- a/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
+++ b/third_party/WebKit/LayoutTests/media/video-replaces-poster.html
@@ -2,7 +2,7 @@
 <html>
 <head>
     <script src="media-file.js"></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src="video-test.js"></script>
     <script type="text/javascript" charset="utf-8">
diff --git a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
index d7e43ed8..e3854c69 100644
--- a/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/video-scales-in-media-document.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
index a282b639..e10ff67 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-by-small-increment.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-no-src.html b/third_party/WebKit/LayoutTests/media/video-seek-no-src.html
index 24040ed9..e6662f1 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-no-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-no-src.html
@@ -5,7 +5,7 @@
 
     <p>Test that seeking video with no 'src' attribute sets default playback start position to that time.</p>
 
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
index 98fc70f9..f00d58d 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-paused.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
index 0586477..a2656c302 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-past-end-playing.html
@@ -4,7 +4,7 @@
 <video loop controls></video>
 <p>Test that seeking video with 'loop' past it's end rewinds to the beginning and continues playback.</p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
index 3af1929..5590140 100644
--- a/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
+++ b/third_party/WebKit/LayoutTests/media/video-seek-to-duration-with-playbackrate-zero.html
@@ -3,7 +3,7 @@
     <head>
         <title>Test behavior when seeking to the duration and the playback rate equals 0.</title>
         <script src="media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="video-test.js"></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-seekable.html b/third_party/WebKit/LayoutTests/media/video-seekable.html
index fb394afe..87d4ce7 100644
--- a/third_party/WebKit/LayoutTests/media/video-seekable.html
+++ b/third_party/WebKit/LayoutTests/media/video-seekable.html
@@ -1,6 +1,6 @@
 <video controls></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-seeking.html b/third_party/WebKit/LayoutTests/media/video-seeking.html
index ff2afdd..1cceb14 100644
--- a/third_party/WebKit/LayoutTests/media/video-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/video-seeking.html
@@ -4,7 +4,7 @@
  is fired for each seek
  </p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
index 7bca5c1..b076cbe 100644
--- a/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
+++ b/third_party/WebKit/LayoutTests/media/video-set-rate-from-pause.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
index 1b40c47..44b40253 100644
--- a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-size.html b/third_party/WebKit/LayoutTests/media/video-size.html
index 198dc6b3..9446d96d 100644
--- a/third_party/WebKit/LayoutTests/media/video-size.html
+++ b/third_party/WebKit/LayoutTests/media/video-size.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <title>&lt;video&gt; element size and resize test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
index b98976d..7ab852c 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>Add &lt;source> after removing failed candidate</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html b/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html
index a175ee92..487c647 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-error-no-candidate.html
@@ -2,7 +2,7 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <title>&lt;video&gt; and &lt;source&gt; error test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-source-error.html b/third_party/WebKit/LayoutTests/media/video-source-error.html
index 7231532..8febec3b 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-error.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-error.html
@@ -3,7 +3,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <title>&lt;video&gt; and &lt;source&gt; error test</title>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-source-inserted.html b/third_party/WebKit/LayoutTests/media/video-source-inserted.html
index d1ef2a1..7c93d32 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-inserted.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-inserted.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>networkState after inserting &lt;source&gt; test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
     </head>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-load.html b/third_party/WebKit/LayoutTests/media/video-source-load.html
index bdf78f3..8239532 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-load.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-load.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>load() and the &lt;source&gt; element</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-media.html b/third_party/WebKit/LayoutTests/media/video-source-media.html
index 10b29d9..819bde6 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-media.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-media.html
@@ -1,5 +1,5 @@
 <body>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-moved.html b/third_party/WebKit/LayoutTests/media/video-source-moved.html
index 39c2579f..d497015 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-moved.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-moved.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>moving &lt;source&gt; element test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-none-supported.html b/third_party/WebKit/LayoutTests/media/video-source-none-supported.html
index 76ac192..07e0d36 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-none-supported.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-none-supported.html
@@ -2,7 +2,7 @@
 <html>
 <head>
     <title>no usable &lt;source&gt; test</title>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-removed.html b/third_party/WebKit/LayoutTests/media/video-source-removed.html
index 339d405c..50485d4 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-removed.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-removed.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <title>crash after removing &lt;source&gt; test</title>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type-params.html b/third_party/WebKit/LayoutTests/media/video-source-type-params.html
index f4c8837..fede3ed 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-type-params.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-type-params.html
@@ -1,6 +1,6 @@
 <body>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source-type.html b/third_party/WebKit/LayoutTests/media/video-source-type.html
index 073ae9e70..b501d28b 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-type.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-type.html
@@ -4,7 +4,7 @@
     <title> &lt;source&gt; @type attribute</title>
 
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-source.html b/third_party/WebKit/LayoutTests/media/video-source.html
index 216d932..93413461 100644
--- a/third_party/WebKit/LayoutTests/media/video-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-source.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-blob.html b/third_party/WebKit/LayoutTests/media/video-src-blob.html
index a9882de..aed91db 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-blob.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-blob.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-change.html b/third_party/WebKit/LayoutTests/media/video-src-change.html
index 624ce21..1b0f82e 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-change.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-change.html
@@ -1,6 +1,6 @@
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-empty.html b/third_party/WebKit/LayoutTests/media/video-src-empty.html
index 19ff7c9..06d62385 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-empty.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-empty.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script src=media-file.js></script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html b/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html
index 2c9c2037..fa1e0f8 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-invalid-poster.html
@@ -1,4 +1,4 @@
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <video poster="content/abe.png">
diff --git a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
index c7d4171..790522dd 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-invalid-remove.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-src-none.html b/third_party/WebKit/LayoutTests/media/video-src-none.html
index 33d57d3..753b30f4 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-none.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-none.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
index 4b81eba..7dfcd639 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
@@ -1,6 +1,6 @@
 <html>
 <body>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
 
diff --git a/third_party/WebKit/LayoutTests/media/video-src-remove.html b/third_party/WebKit/LayoutTests/media/video-src-remove.html
index a0a3f9b..730aa81 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-remove.html
@@ -1,7 +1,7 @@
 <html>
 <body>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <div id=panel></div>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-set.html b/third_party/WebKit/LayoutTests/media/video-src-set.html
index dfb1a17..3b095f9 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-set.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-set.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <div>Test that setting src attribute triggers load</div>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src-source.html b/third_party/WebKit/LayoutTests/media/video-src-source.html
index 6cf9496..3df59b53 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-source.html
@@ -1,7 +1,7 @@
 <body>
 <video><source></source></video>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-src.html b/third_party/WebKit/LayoutTests/media/video-src.html
index 0d460ef..d5704de 100644
--- a/third_party/WebKit/LayoutTests/media/video-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-src.html
@@ -1,7 +1,7 @@
 <html>
     <head>
         <script src=media-file.js></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src=video-test.js></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
index 80ae2d5..9d3c06914 100644
--- a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
+++ b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
@@ -7,7 +7,7 @@
     Test 'timeupdate' events are posted while playing but not while paused.
     </p>
     <script src=media-file.js></script>
-    <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+    <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
          (Please avoid writing new tests using video-test.js) -->
     <script src=video-test.js></script>
     <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-volume.html b/third_party/WebKit/LayoutTests/media/video-volume.html
index c63b81b..7e2dc8d 100644
--- a/third_party/WebKit/LayoutTests/media/video-volume.html
+++ b/third_party/WebKit/LayoutTests/media/video-volume.html
@@ -1,7 +1,7 @@
 <video controls></video>
 <p>Test 'volume' attribute<p>
 <script src=media-file.js></script>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/video-width-height.html b/third_party/WebKit/LayoutTests/media/video-width-height.html
index 01342fc..56d63350 100644
--- a/third_party/WebKit/LayoutTests/media/video-width-height.html
+++ b/third_party/WebKit/LayoutTests/media/video-width-height.html
@@ -1,5 +1,5 @@
 <video width=100 height=50 controls></video>
-<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
      (Please avoid writing new tests using video-test.js) -->
 <script src=video-test.js></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
index 7869365d..a2fb4e9a 100644
--- a/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
+++ b/third_party/WebKit/LayoutTests/media/viewport-in-standalone-media-document.html
@@ -2,7 +2,7 @@
 <html>
     <head>
         <script src="../media/media-file.js"></script>
-        <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
+        <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
              (Please avoid writing new tests using video-test.js) -->
         <script src="../media/video-test.js"></script>
         <script>
diff --git a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-expected.txt b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-expected.txt
index db9481e..2e3c5b83e 100644
--- a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-expected.txt
+++ b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-expected.txt
@@ -1,2 +1,2 @@
-CONSOLE WARNING: SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
+CONSOLE WARNING: line 62: SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
 PASS
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
index af4597f..bfded48 100644
--- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
@@ -17,13 +17,13 @@
 PASS context.createBuffer(new ArrayBuffer(100), true) threw exception TypeError: Failed to execute 'createBuffer' on 'AudioContext': 3 arguments required, but only 2 present..
 PASS context.createMediaElementSource(null) threw exception TypeError: Failed to execute 'createMediaElementSource' on 'AudioContext': parameter 1 is not of type 'HTMLMediaElement'..
 PASS context.createMediaStreamSource(null) threw exception TypeError: Failed to execute 'createMediaStreamSource' on 'AudioContext': parameter 1 is not of type 'MediaStream'..
-PASS context.createScriptProcessor(1, 1, 1) threw exception IndexSizeError: Failed to execute 'createScriptProcessor' on 'AudioContext': buffer size (1) must be a power of two between 256 and 16384..
+PASS context.createScriptProcessor(1, 1, 1) threw exception IndexSizeError: Failed to execute 'createScriptProcessor' on 'AudioContext': buffer size (1) must be 0 or a power of two between 256 and 16384..
 PASS context.createScriptProcessor(4096, 100, 1) threw exception IndexSizeError: Failed to execute 'createScriptProcessor' on 'AudioContext': number of input channels (100) exceeds maximum (32)..
 PASS context.createScriptProcessor(4096, 1, 100) threw exception IndexSizeError: Failed to execute 'createScriptProcessor' on 'AudioContext': number of output channels (1) exceeds maximum (32)..
 PASS context.createScriptProcessor() did not throw exception.
 PASS context.createScriptProcessor(0) did not throw exception.
-PASS context.createChannelSplitter(0) threw exception IndexSizeError: Failed to execute 'createChannelSplitter' on 'AudioContext': number of outputs (0) must be between 1 and 32..
-PASS context.createChannelSplitter(99) threw exception IndexSizeError: Failed to execute 'createChannelSplitter' on 'AudioContext': number of outputs (99) must be between 1 and 32..
+PASS context.createChannelSplitter(0) threw exception IndexSizeError: Failed to execute 'createChannelSplitter' on 'AudioContext': The number of outputs provided (0) is outside the range [1, 32]..
+PASS context.createChannelSplitter(99) threw exception IndexSizeError: Failed to execute 'createChannelSplitter' on 'AudioContext': The number of outputs provided (99) is outside the range [1, 32]..
 PASS context.createChannelMerger(0) threw exception IndexSizeError: Failed to execute 'createChannelMerger' on 'AudioContext': The number of inputs provided (0) is outside the range [1, 32]..
 PASS context.createChannelMerger(99) threw exception IndexSizeError: Failed to execute 'createChannelMerger' on 'AudioContext': The number of inputs provided (99) is outside the range [1, 32]..
 PASS context.createPeriodicWave(null, null) threw exception TypeError: Failed to execute 'createPeriodicWave' on 'AudioContext': parameter 1 is not of type 'Float32Array'..
diff --git a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp
index 12ae195..e821aa3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp
@@ -99,4 +99,9 @@
     value->endArray();
 }
 
+PassOwnPtr<SourceLocation> SourceLocation::clone() const
+{
+    return adoptPtr(new SourceLocation(m_url, m_lineNumber, m_columnNumber, m_stackTrace ? m_stackTrace->clone() : nullptr, m_scriptId));
+}
+
 } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
index d15f1c94..d29eb1f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
@@ -28,12 +28,14 @@
     static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0);
     ~SourceLocation();
 
+    bool isEmpty() const { return m_url.isNull(); }
     String url() const { return m_url; }
     unsigned lineNumber() const { return m_lineNumber; }
     unsigned columnNumber() const { return m_columnNumber; }
     std::unique_ptr<V8StackTrace> takeStackTrace() { return std::move(m_stackTrace); }
     int scriptId() const { return m_scriptId; }
     void toTracedValue(TracedValue*, const char* name) const;
+    PassOwnPtr<SourceLocation> clone() const;
 
 private:
     SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId);
diff --git a/third_party/WebKit/Source/bindings/modules/v8/generated.gni b/third_party/WebKit/Source/bindings/modules/v8/generated.gni
index e8a0f03c..514f228 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/generated.gni
+++ b/third_party/WebKit/Source/bindings/modules/v8/generated.gni
@@ -48,16 +48,22 @@
   "$bindings_modules_v8_output_dir/ArrayBufferOrArrayBufferViewOrUSVString.h",
   "$bindings_modules_v8_output_dir/ArrayBufferViewOrBlobOrStringOrFormData.cpp",
   "$bindings_modules_v8_output_dir/ArrayBufferViewOrBlobOrStringOrFormData.h",
+  "$bindings_modules_v8_output_dir/BooleanOrConstrainBooleanParameters.cpp",
+  "$bindings_modules_v8_output_dir/BooleanOrConstrainBooleanParameters.h",
   "$bindings_modules_v8_output_dir/BooleanOrMediaTrackConstraints.cpp",
   "$bindings_modules_v8_output_dir/BooleanOrMediaTrackConstraints.h",
   "$bindings_modules_v8_output_dir/ClientOrServiceWorkerOrMessagePort.cpp",
   "$bindings_modules_v8_output_dir/ClientOrServiceWorkerOrMessagePort.h",
   "$bindings_modules_v8_output_dir/DictionaryOrString.cpp",
   "$bindings_modules_v8_output_dir/DictionaryOrString.h",
+  "$bindings_modules_v8_output_dir/DoubleOrConstrainDoubleRange.cpp",
+  "$bindings_modules_v8_output_dir/DoubleOrConstrainDoubleRange.h",
   "$bindings_modules_v8_output_dir/FormDataOrURLSearchParams.cpp",
   "$bindings_modules_v8_output_dir/FormDataOrURLSearchParams.h",
   "$bindings_modules_v8_output_dir/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap.cpp",
   "$bindings_modules_v8_output_dir/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap.h",
+  "$bindings_modules_v8_output_dir/LongOrConstrainLongRange.cpp",
+  "$bindings_modules_v8_output_dir/LongOrConstrainLongRange.h",
   "$bindings_modules_v8_output_dir/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.cpp",
   "$bindings_modules_v8_output_dir/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.h",
   "$bindings_modules_v8_output_dir/RTCIceCandidateInitOrRTCIceCandidate.cpp",
@@ -74,6 +80,8 @@
   "$bindings_modules_v8_output_dir/StringOrCanvasGradientOrCanvasPattern.h",
   "$bindings_modules_v8_output_dir/StringOrStringSequence.cpp",
   "$bindings_modules_v8_output_dir/StringOrStringSequence.h",
+  "$bindings_modules_v8_output_dir/StringOrStringSequenceOrConstrainDOMStringParameters.cpp",
+  "$bindings_modules_v8_output_dir/StringOrStringSequenceOrConstrainDOMStringParameters.h",
   "$bindings_modules_v8_output_dir/StringOrStringSequenceOrDOMStringList.cpp",
   "$bindings_modules_v8_output_dir/StringOrStringSequenceOrDOMStringList.h",
   "$bindings_modules_v8_output_dir/StringOrUnsignedLong.cpp",
diff --git a/third_party/WebKit/Source/bindings/modules/v8/generated.gypi b/third_party/WebKit/Source/bindings/modules/v8/generated.gypi
index d78ce7d..00ea1ae2 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/generated.gypi
+++ b/third_party/WebKit/Source/bindings/modules/v8/generated.gypi
@@ -12,16 +12,22 @@
       '<(bindings_modules_v8_output_dir)/ArrayBufferOrArrayBufferViewOrUSVString.h',
       '<(bindings_modules_v8_output_dir)/ArrayBufferViewOrBlobOrStringOrFormData.cpp',
       '<(bindings_modules_v8_output_dir)/ArrayBufferViewOrBlobOrStringOrFormData.h',
+      '<(bindings_modules_v8_output_dir)/BooleanOrConstrainBooleanParameters.cpp',
+      '<(bindings_modules_v8_output_dir)/BooleanOrConstrainBooleanParameters.h',
       '<(bindings_modules_v8_output_dir)/BooleanOrMediaTrackConstraints.cpp',
       '<(bindings_modules_v8_output_dir)/BooleanOrMediaTrackConstraints.h',
       '<(bindings_modules_v8_output_dir)/ClientOrServiceWorkerOrMessagePort.cpp',
       '<(bindings_modules_v8_output_dir)/ClientOrServiceWorkerOrMessagePort.h',
       '<(bindings_modules_v8_output_dir)/DictionaryOrString.cpp',
       '<(bindings_modules_v8_output_dir)/DictionaryOrString.h',
+      '<(bindings_modules_v8_output_dir)/DoubleOrConstrainDoubleRange.cpp',
+      '<(bindings_modules_v8_output_dir)/DoubleOrConstrainDoubleRange.h',
       '<(bindings_modules_v8_output_dir)/FormDataOrURLSearchParams.cpp',
       '<(bindings_modules_v8_output_dir)/FormDataOrURLSearchParams.h',
       '<(bindings_modules_v8_output_dir)/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap.cpp',
       '<(bindings_modules_v8_output_dir)/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap.h',
+      '<(bindings_modules_v8_output_dir)/LongOrConstrainLongRange.cpp',
+      '<(bindings_modules_v8_output_dir)/LongOrConstrainLongRange.h',
       '<(bindings_modules_v8_output_dir)/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.cpp',
       '<(bindings_modules_v8_output_dir)/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.h',
       '<(bindings_modules_v8_output_dir)/RTCIceCandidateInitOrRTCIceCandidate.cpp',
@@ -38,6 +44,8 @@
       '<(bindings_modules_v8_output_dir)/StringOrCanvasGradientOrCanvasPattern.h',
       '<(bindings_modules_v8_output_dir)/StringOrStringSequence.cpp',
       '<(bindings_modules_v8_output_dir)/StringOrStringSequence.h',
+      '<(bindings_modules_v8_output_dir)/StringOrStringSequenceOrConstrainDOMStringParameters.cpp',
+      '<(bindings_modules_v8_output_dir)/StringOrStringSequenceOrConstrainDOMStringParameters.h',
       '<(bindings_modules_v8_output_dir)/StringOrStringSequenceOrDOMStringList.cpp',
       '<(bindings_modules_v8_output_dir)/StringOrStringSequenceOrDOMStringList.h',
       '<(bindings_modules_v8_output_dir)/StringOrUnsignedLong.cpp',
diff --git a/third_party/WebKit/Source/build/scripts/make_css_primitive_value_unit_trie.py b/third_party/WebKit/Source/build/scripts/make_css_primitive_value_unit_trie.py
new file mode 100755
index 0000000..bd07ff1
--- /dev/null
+++ b/third_party/WebKit/Source/build/scripts/make_css_primitive_value_unit_trie.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+
+import in_generator
+import trie_builder
+import template_expander
+
+
+class UnitTrieWriter(in_generator.Writer):
+    defaults = {
+        'unit_type': None
+    }
+
+    def __init__(self, in_file_paths):
+        super(UnitTrieWriter, self).__init__(in_file_paths)
+
+        self._units = {entry['name']: entry['unit_type'] for entry in self.in_file.name_dictionaries}
+
+        self._outputs = {
+            'CSSPrimitiveValueUnitTrie.cpp': self.generate_implementation
+        }
+
+    @template_expander.use_jinja('CSSPrimitiveValueUnitTrie.cpp.tmpl')
+    def generate_implementation(self):
+        return {
+            'length_tries': trie_builder.trie_list_by_str_length(self._units)
+        }
+
+
+if __name__ == '__main__':
+    in_generator.Maker(UnitTrieWriter).main(sys.argv)
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl
new file mode 100644
index 0000000..3b34842e
--- /dev/null
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl
@@ -0,0 +1,35 @@
+{% from 'macros.tmpl' import trie_length_switch %}
+// Copyright 2016 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 "core/css/CSSPrimitiveValueUnitTrie.h"
+
+namespace blink {
+
+namespace {
+
+template<typename CharacterType>
+CSSPrimitiveValue::UnitType cssPrimitiveValueUnitFromTrie(const CharacterType* data, unsigned length)
+{
+    DCHECK(data);
+    DCHECK(length);
+    {% macro trie_return_statement(unit_name) %}CSSPrimitiveValue::UnitType::{{unit_name}}{% endmacro %}
+    {{ trie_length_switch(length_tries, trie_return_statement, True) | indent(4) }}
+    return CSSPrimitiveValue::UnitType::Unknown;
+}
+
+} // namespace
+
+CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const LChar* characters8, unsigned length)
+{
+    return cssPrimitiveValueUnitFromTrie(characters8, length);
+}
+
+CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const UChar* characters16, unsigned length)
+{
+    return cssPrimitiveValueUnitFromTrie(characters16, length);
+}
+
+} // namespace blink
+
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 65e1288..3e39dcc 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -9,6 +9,7 @@
 #include "StyleBuilderFunctions.h"
 
 #include "CSSValueKeywords.h"
+#include "core/animation/css/CSSAnimationData.h"
 #include "core/css/BasicShapeFunctions.h"
 #include "core/css/CSSContentDistributionValue.h"
 #include "core/css/CSSCustomIdentValue.h"
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn
index 5f63435..9c12e17e 100644
--- a/third_party/WebKit/Source/core/BUILD.gn
+++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -343,6 +343,7 @@
     "$blink_core_output_dir/CSSValueKeywords.cpp",
 
     # Additional .cpp files from make_core_generated actions.
+    "$blink_core_output_dir/CSSPrimitiveValueUnitTrie.cpp",
     "$blink_core_output_dir/Event.cpp",
     "$blink_core_output_dir/EventHeaders.h",
     "$blink_core_output_dir/EventNames.cpp",
@@ -556,6 +557,7 @@
 group("make_core_generated") {
   public_deps = [
     ":make_core_generated_bison",
+    ":make_core_generated_css_primitive_value_unit_trie",
     ":make_core_generated_css_property_metadata",
     ":make_core_generated_css_property_names",
     ":make_core_generated_css_tokenizer_codepoints",
@@ -961,6 +963,30 @@
   deps = make_core_generated_deps
 }
 
+# "CSSPrimitiveValueUnitTrie" in make_core_generated from GYP.
+action("make_core_generated_css_primitive_value_unit_trie") {
+  visibility = []  # Allow re-assignment of list.
+  visibility = [ ":make_core_generated" ]
+  script = "../build/scripts/make_css_primitive_value_unit_trie.py"
+
+  input_file = "css/CSSPrimitiveValueUnits.in"
+  inputs = make_trie_helpers_files + [
+             input_file,
+             "../build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl",
+           ]
+  outputs = [
+    "$blink_core_output_dir/CSSPrimitiveValueUnitTrie.cpp",
+  ]
+
+  args = [
+    rebase_path(input_file, root_build_dir),
+    "--output_dir",
+    rel_blink_core_gen_dir,
+  ]
+
+  deps = make_core_generated_deps
+}
+
 # "HTMLElementLookupTrie" in make_core_generated from GYP.
 action("make_core_generated_html_element_lookup_trie") {
   visibility = []  # Allow re-assignment of list.
diff --git a/third_party/WebKit/Source/core/CoreInitializer.cpp b/third_party/WebKit/Source/core/CoreInitializer.cpp
index 3c1c384..367010d 100644
--- a/third_party/WebKit/Source/core/CoreInitializer.cpp
+++ b/third_party/WebKit/Source/core/CoreInitializer.cpp
@@ -123,7 +123,6 @@
     MediaFeatureNames::init();
     MediaTypeNames::init();
 
-    CSSPrimitiveValue::initUnitTable();
     CSSParserTokenRange::initStaticEOFToken();
 
     StyleChangeExtraData::init();
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferItem.idl b/third_party/WebKit/Source/core/clipboard/DataTransferItem.idl
index b0fe40d1..db186a15 100644
--- a/third_party/WebKit/Source/core/clipboard/DataTransferItem.idl
+++ b/third_party/WebKit/Source/core/clipboard/DataTransferItem.idl
@@ -34,8 +34,8 @@
 ] interface DataTransferItem {
     readonly attribute DOMString kind;
     readonly attribute DOMString type;
-    // TODO(philipj): The callback argument should be a FunctionStringCallback.
+    // TODO(foolip): The callback argument should be a FunctionStringCallback.
     [CallWith=ExecutionContext] void getAsString(StringCallback? callback);
-    // TODO(philipj): getAsFile() should return a File object. crbug.com/361145
+    // TODO(foolip): getAsFile() should return a File object. crbug.com/361145
     Blob? getAsFile();
 };
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferItemList.idl b/third_party/WebKit/Source/core/clipboard/DataTransferItemList.idl
index cc2f6e2..3a95551 100644
--- a/third_party/WebKit/Source/core/clipboard/DataTransferItemList.idl
+++ b/third_party/WebKit/Source/core/clipboard/DataTransferItemList.idl
@@ -35,7 +35,7 @@
     readonly attribute unsigned long length;
     [ImplementedAs=item] getter DataTransferItem (unsigned long index);
     [RaisesException] DataTransferItem? add(DOMString data, DOMString type);
-    // TODO(philipj): The file argument should not be nullable.
+    // TODO(foolip): The file argument should not be nullable.
     DataTransferItem? add(File? file);
     [RaisesException, ImplementedAs=deleteItem] void remove(unsigned long index);
     void clear();
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index b0a92e2..81a86f2 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -1194,7 +1194,9 @@
             'css/CSSPathValue.cpp',
             'css/CSSPathValue.h',
             'css/CSSPrimitiveValue.cpp',
+            'css/CSSPrimitiveValue.h',
             'css/CSSPrimitiveValueMappings.h',
+            'css/CSSPrimitiveValueUnitTrie.h',
             'css/CSSProperty.cpp',
             'css/CSSPropertyEquality.cpp',
             'css/CSSPropertyEquality.h',
diff --git a/third_party/WebKit/Source/core/core_generated.gyp b/third_party/WebKit/Source/core/core_generated.gyp
index 565d535..17e9e2e 100644
--- a/third_party/WebKit/Source/core/core_generated.gyp
+++ b/third_party/WebKit/Source/core/core_generated.gyp
@@ -730,6 +730,25 @@
           ],
         },
         {
+          'action_name': 'CSSPrimitiveValueUnitTrie',
+          'inputs': [
+            '<@(make_trie_helpers_files)',
+            '../build/scripts/make_css_primitive_value_unit_trie.py',
+            '../build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl',
+            'css/CSSPrimitiveValueUnits.in',
+          ],
+          'outputs': [
+            '<(blink_core_output_dir)/CSSPrimitiveValueUnitTrie.cpp',
+          ],
+          'action': [
+            'python',
+            '../build/scripts/make_css_primitive_value_unit_trie.py',
+            'css/CSSPrimitiveValueUnits.in',
+            '--output_dir',
+            '<(blink_core_output_dir)',
+          ],
+        },
+        {
           'action_name': 'HTMLElementLookupTrie',
           'inputs': [
             '<@(make_trie_helpers_files)',
diff --git a/third_party/WebKit/Source/core/core_generated.gypi b/third_party/WebKit/Source/core/core_generated.gypi
index 5f66658..10452f31 100644
--- a/third_party/WebKit/Source/core/core_generated.gypi
+++ b/third_party/WebKit/Source/core/core_generated.gypi
@@ -61,6 +61,7 @@
       '<(blink_core_output_dir)/CSSValueKeywords.cpp',
 
       # Additional .cpp files from make_core_generated actions.
+      '<(blink_core_output_dir)/CSSPrimitiveValueUnitTrie.cpp',
       '<(blink_core_output_dir)/Event.cpp',
       '<(blink_core_output_dir)/EventHeaders.h',
       '<(blink_core_output_dir)/EventNames.cpp',
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl b/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl
index cc71dcd..93eee8f 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl
@@ -24,7 +24,7 @@
 // http://dev.w3.org/csswg/css-fonts/#om-fontface
 //
 // The interface from DOM Level 2 Style is implemented here.
-// TODO(philipj): Implement the interface from CSS Fonts.
+// TODO(foolip): Implement the interface from CSS Fonts.
 
 interface CSSFontFaceRule : CSSRule {
     [Measure] readonly attribute CSSStyleDeclaration style;
diff --git a/third_party/WebKit/Source/core/css/CSSImportRule.idl b/third_party/WebKit/Source/core/css/CSSImportRule.idl
index e845ca2..c8e779f 100644
--- a/third_party/WebKit/Source/core/css/CSSImportRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSImportRule.idl
@@ -22,7 +22,7 @@
 
 interface CSSImportRule : CSSRule {
     readonly attribute DOMString href;
-    // TODO(philipj): media should have [PutForwards=mediaText].
+    // TODO(foolip): media should have [PutForwards=mediaText].
     [SameObject] readonly attribute MediaList media;
     [SameObject] readonly attribute CSSStyleSheet styleSheet;
 };
diff --git a/third_party/WebKit/Source/core/css/CSSMediaRule.idl b/third_party/WebKit/Source/core/css/CSSMediaRule.idl
index 1e6c85ae..53021c3f 100644
--- a/third_party/WebKit/Source/core/css/CSSMediaRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSMediaRule.idl
@@ -21,6 +21,6 @@
 // http://dev.w3.org/csswg/cssom/#the-cssmediarule-interface
 
 interface CSSMediaRule : CSSGroupingRule {
-    // TODO(philipj): media should have [PutForwards=mediaText].
+    // TODO(foolip): media should have [PutForwards=mediaText].
     [SameObject] readonly attribute MediaList media;
 };
diff --git a/third_party/WebKit/Source/core/css/CSSPageRule.idl b/third_party/WebKit/Source/core/css/CSSPageRule.idl
index 5e04b6c..e21f83ad 100644
--- a/third_party/WebKit/Source/core/css/CSSPageRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSPageRule.idl
@@ -20,13 +20,13 @@
 
 // http://dev.w3.org/csswg/cssom/#the-csspagerule-interface
 
-// TODO(philipj): CSSPageRule should inherit from CSSGroupingRule.
+// TODO(foolip): CSSPageRule should inherit from CSSGroupingRule.
 // crbug.com/496381. To internally implement this as grouping rule,
 // margin at-rules should be implemented crbug.com/320370, since the
 // spec http://dev.w3.org/csswg/css-page/#at-page-rule allows only
 // margin at-rules inside @page.
 interface CSSPageRule : CSSRule {
     attribute DOMString selectorText;
-    // TODO(philipj): style should have [PutForwards=cssText].
+    // TODO(foolip): style should have [PutForwards=cssText].
     [SameObject] readonly attribute CSSStyleDeclaration style;
 };
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
index deb1d2d..a919e46 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -44,47 +44,6 @@
 const int maxValueForCssLength = INT_MAX / kFixedPointDenominator - 2;
 const int minValueForCssLength = INT_MIN / kFixedPointDenominator + 2;
 
-using StringToUnitTable = HashMap<String, CSSPrimitiveValue::UnitType>;
-
-StringToUnitTable createStringToUnitTable()
-{
-    StringToUnitTable table;
-    table.set(String("em"), CSSPrimitiveValue::UnitType::Ems);
-    table.set(String("ex"), CSSPrimitiveValue::UnitType::Exs);
-    table.set(String("px"), CSSPrimitiveValue::UnitType::Pixels);
-    table.set(String("cm"), CSSPrimitiveValue::UnitType::Centimeters);
-    table.set(String("mm"), CSSPrimitiveValue::UnitType::Millimeters);
-    table.set(String("in"), CSSPrimitiveValue::UnitType::Inches);
-    table.set(String("pt"), CSSPrimitiveValue::UnitType::Points);
-    table.set(String("pc"), CSSPrimitiveValue::UnitType::Picas);
-    table.set(String("deg"), CSSPrimitiveValue::UnitType::Degrees);
-    table.set(String("rad"), CSSPrimitiveValue::UnitType::Radians);
-    table.set(String("grad"), CSSPrimitiveValue::UnitType::Gradians);
-    table.set(String("ms"), CSSPrimitiveValue::UnitType::Milliseconds);
-    table.set(String("s"), CSSPrimitiveValue::UnitType::Seconds);
-    table.set(String("hz"), CSSPrimitiveValue::UnitType::Hertz);
-    table.set(String("khz"), CSSPrimitiveValue::UnitType::Kilohertz);
-    table.set(String("dpi"), CSSPrimitiveValue::UnitType::DotsPerInch);
-    table.set(String("dpcm"), CSSPrimitiveValue::UnitType::DotsPerCentimeter);
-    table.set(String("dppx"), CSSPrimitiveValue::UnitType::DotsPerPixel);
-    table.set(String("vw"), CSSPrimitiveValue::UnitType::ViewportWidth);
-    table.set(String("vh"), CSSPrimitiveValue::UnitType::ViewportHeight);
-    table.set(String("vmin"), CSSPrimitiveValue::UnitType::ViewportMin);
-    table.set(String("vmax"), CSSPrimitiveValue::UnitType::ViewportMax);
-    table.set(String("rem"), CSSPrimitiveValue::UnitType::Rems);
-    table.set(String("fr"), CSSPrimitiveValue::UnitType::Fraction);
-    table.set(String("turn"), CSSPrimitiveValue::UnitType::Turns);
-    table.set(String("ch"), CSSPrimitiveValue::UnitType::Chs);
-    table.set(String("__qem"), CSSPrimitiveValue::UnitType::QuirkyEms);
-    return table;
-}
-
-StringToUnitTable& unitTable()
-{
-    DEFINE_STATIC_LOCAL(StringToUnitTable, unitTable, (createStringToUnitTable()));
-    return unitTable;
-}
-
 } // namespace
 
 float CSSPrimitiveValue::clampToCSSLengthRange(double value)
@@ -92,18 +51,6 @@
     return clampTo<float>(value, minValueForCssLength, maxValueForCssLength);
 }
 
-void CSSPrimitiveValue::initUnitTable()
-{
-    // Make sure we initialize this during blink initialization
-    // to avoid racy static local initialization.
-    unitTable();
-}
-
-CSSPrimitiveValue::UnitType CSSPrimitiveValue::fromName(const String& unit)
-{
-    return unitTable().get(unit.lower());
-}
-
 CSSPrimitiveValue::UnitCategory CSSPrimitiveValue::unitTypeToUnitCategory(UnitType type)
 {
     switch (type) {
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnitTrie.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnitTrie.h
new file mode 100644
index 0000000..1f39064
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnitTrie.h
@@ -0,0 +1,17 @@
+// Copyright 2016 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 CSSPrimitiveValueUnitTrie_h
+#define CSSPrimitiveValueUnitTrie_h
+
+#include "core/css/CSSPrimitiveValue.h"
+
+namespace blink {
+
+CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const LChar* characters8, unsigned length);
+CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const UChar* characters16, unsigned length);
+
+} // namespace blink
+
+#endif
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.in b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.in
new file mode 100644
index 0000000..9f6573d
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.in
@@ -0,0 +1,29 @@
+// This file specifies the unit strings used in CSSPrimitiveValues.
+
+em unit_type=Ems
+ex unit_type=Exs
+px unit_type=Pixels
+cm unit_type=Centimeters
+mm unit_type=Millimeters
+in unit_type=Inches
+pt unit_type=Points
+pc unit_type=Picas
+deg unit_type=Degrees
+rad unit_type=Radians
+grad unit_type=Gradians
+ms unit_type=Milliseconds
+s unit_type=Seconds
+hz unit_type=Hertz
+khz unit_type=Kilohertz
+dpi unit_type=DotsPerInch
+dpcm unit_type=DotsPerCentimeter
+dppx unit_type=DotsPerPixel
+vw unit_type=ViewportWidth
+vh unit_type=ViewportHeight
+vmin unit_type=ViewportMin
+vmax unit_type=ViewportMax
+rem unit_type=Rems
+fr unit_type=Fraction
+turn unit_type=Turns
+ch unit_type=Chs
+__qem unit_type=QuirkyEms
diff --git a/third_party/WebKit/Source/core/css/CSSRule.idl b/third_party/WebKit/Source/core/css/CSSRule.idl
index 0735573..18bde3d7 100644
--- a/third_party/WebKit/Source/core/css/CSSRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSRule.idl
@@ -29,7 +29,7 @@
     const unsigned short MEDIA_RULE = 4;
     const unsigned short FONT_FACE_RULE = 5;
     const unsigned short PAGE_RULE = 6;
-    // TODO(philipj): Implement CSSMarginRule.
+    // TODO(foolip): Implement CSSMarginRule.
     // const unsigned short MARGIN_RULE = 9;
     const unsigned short NAMESPACE_RULE = 10;
     readonly attribute unsigned short type;
diff --git a/third_party/WebKit/Source/core/css/CSSRuleList.idl b/third_party/WebKit/Source/core/css/CSSRuleList.idl
index 5934377d..dcc989f 100644
--- a/third_party/WebKit/Source/core/css/CSSRuleList.idl
+++ b/third_party/WebKit/Source/core/css/CSSRuleList.idl
@@ -25,7 +25,7 @@
 
 // http://dev.w3.org/csswg/cssom/#the-cssrulelist-interface
 
-// TODO(philipj): CSSRuleList should be an [ArrayClass].
+// TODO(foolip): CSSRuleList should be an [ArrayClass].
 [
     DependentLifetime,
 ] interface CSSRuleList {
diff --git a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl
index e9cae2b..9386183 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl
+++ b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl
@@ -29,7 +29,7 @@
     getter DOMString item(unsigned long index);
     DOMString getPropertyValue(DOMString property);
     DOMString getPropertyPriority(DOMString property);
-    // TODO(philipj): The value and priority arguments should have
+    // TODO(foolip): The value and priority arguments should have
     // [TreatNullAs=EmptyString] and should not be nullable.
     [RaisesException] void setProperty(DOMString property, DOMString? value, optional DOMString? priority = null);
     // void setPropertyValue(DOMString property, [TreatNullAs=EmptyString] DOMString value);
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.idl b/third_party/WebKit/Source/core/css/CSSStyleSheet.idl
index 0f9254a5..7a3a1a8d 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.idl
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.idl
@@ -25,7 +25,7 @@
 ] interface CSSStyleSheet : StyleSheet {
     readonly attribute CSSRule? ownerRule;
     [SameObject] readonly attribute CSSRuleList cssRules;
-    // TODO(philipj): The index argument should not be optional. crbug.com/319695
+    // TODO(foolip): The index argument should not be optional. crbug.com/319695
     [RaisesException] unsigned long insertRule(DOMString rule, optional unsigned long index);
     [RaisesException] void deleteRule(unsigned long index);
 
diff --git a/third_party/WebKit/Source/core/css/CSSSupportsRule.idl b/third_party/WebKit/Source/core/css/CSSSupportsRule.idl
index d06a7796..ce57469 100644
--- a/third_party/WebKit/Source/core/css/CSSSupportsRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSSupportsRule.idl
@@ -28,7 +28,7 @@
 
 // http://dev.w3.org/csswg/css-conditional/#the-csssupportsrule-interface
 
-// TODO(philipj): CSSSupportsRule should inherit from CSSConditionRule and
+// TODO(foolip): CSSSupportsRule should inherit from CSSConditionRule and
 // inherit all members.
 interface CSSSupportsRule : CSSRule {
     // http://dev.w3.org/csswg/css-conditional/#the-cssconditionrule-interface
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index ec34824a..6fddfd1 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -25,6 +25,8 @@
 #include "core/css/ComputedStyleCSSValueMapping.h"
 
 #include "core/StylePropertyShorthand.h"
+#include "core/animation/css/CSSAnimationData.h"
+#include "core/animation/css/CSSTransitionData.h"
 #include "core/css/BasicShapeFunctions.h"
 #include "core/css/CSSBasicShapeValues.h"
 #include "core/css/CSSBorderImage.h"
@@ -53,6 +55,7 @@
 #include "core/layout/LayoutObject.h"
 #include "core/style/ComputedStyle.h"
 #include "core/style/ContentData.h"
+#include "core/style/CursorData.h"
 #include "core/style/QuotesData.h"
 #include "core/style/ShadowList.h"
 #include "core/style/StyleVariableData.h"
diff --git a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl
index b1f217e5..e07bfb7 100644
--- a/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl
+++ b/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl
@@ -30,7 +30,7 @@
 
 // http://dev.w3.org/csswg/css-font-loading/#font-face-source
 
-// TODO(philipj): This should be a FontFaceSource interface implemented by
+// TODO(foolip): This should be a FontFaceSource interface implemented by
 // Document and WorkerGlobalScope.
 partial interface Document {
     [MeasureAs=DocumentFonts] readonly attribute FontFaceSet fonts;
diff --git a/third_party/WebKit/Source/core/css/FontFace.idl b/third_party/WebKit/Source/core/css/FontFace.idl
index c6b10f3..2625f19 100644
--- a/third_party/WebKit/Source/core/css/FontFace.idl
+++ b/third_party/WebKit/Source/core/css/FontFace.idl
@@ -37,7 +37,7 @@
     "error"
 };
 
-// TODO(philipj): This interface should be [Exposed=Window,Worker].
+// TODO(foolip): This interface should be [Exposed=Window,Worker].
 [
     ActiveScriptWrappable,
     DependentLifetime,
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.idl b/third_party/WebKit/Source/core/css/FontFaceSet.idl
index 9f7480e..f82c949a 100644
--- a/third_party/WebKit/Source/core/css/FontFaceSet.idl
+++ b/third_party/WebKit/Source/core/css/FontFaceSet.idl
@@ -32,7 +32,7 @@
 
 enum FontFaceSetLoadStatus { "loading", "loaded" };
 
-// TODO(philipj): This interface should be [Exposed=Window,Worker] and should
+// TODO(foolip): This interface should be [Exposed=Window,Worker] and should
 // have a constructor, and thus not have [NoInterfaceObject].
 [
     DependentLifetime,
diff --git a/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.idl b/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.idl
index 303c3c8..6e4fb67 100644
--- a/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.idl
+++ b/third_party/WebKit/Source/core/css/FontFaceSetLoadEvent.idl
@@ -30,7 +30,7 @@
 
 // http://dev.w3.org/csswg/css-font-loading/#fontfacesetloadevent
 
-// TODO(philipj): This interface should have a constructor and
+// TODO(foolip): This interface should have a constructor and
 // [Exposed=Window,Worker], and thus not [NoInterfaceObject].
 [
     NoInterfaceObject,
diff --git a/third_party/WebKit/Source/core/css/MediaList.idl b/third_party/WebKit/Source/core/css/MediaList.idl
index 70dedb6..36767b5 100644
--- a/third_party/WebKit/Source/core/css/MediaList.idl
+++ b/third_party/WebKit/Source/core/css/MediaList.idl
@@ -25,14 +25,14 @@
 
 // http://dev.w3.org/csswg/cssom/#the-medialist-interface
 
-// TODO(philipj): MediaList should be an [ArrayClass].
+// TODO(foolip): MediaList should be an [ArrayClass].
 [
 ] interface MediaList {
-    // TODO(philipj): [TreatNullAs=EmptyString] stringifier attribute DOMString mediaText;
+    // TODO(foolip): [TreatNullAs=EmptyString] stringifier attribute DOMString mediaText;
     attribute DOMString? mediaText;
     readonly attribute unsigned long length;
     [Measure] getter DOMString? item(unsigned long index);
-    // TODO(philipj): appendMedium() and deleteMedium() should never throw.
+    // TODO(foolip): appendMedium() and deleteMedium() should never throw.
     [RaisesException] void appendMedium(DOMString medium);
     [RaisesException] void deleteMedium(DOMString medium);
 };
diff --git a/third_party/WebKit/Source/core/css/StyleMedia.idl b/third_party/WebKit/Source/core/css/StyleMedia.idl
index 7d40d7f7..d50a3d2e 100644
--- a/third_party/WebKit/Source/core/css/StyleMedia.idl
+++ b/third_party/WebKit/Source/core/css/StyleMedia.idl
@@ -29,7 +29,7 @@
 // http://www.w3.org/TR/2009/WD-cssom-view-20090804/#the-media-interface
 // http://web.archive.org/web/20100206142043/http://dev.w3.org/csswg/cssom-view#the-stylemedia-interface
 //
-// TODO(philipj): Remove this interface.
+// TODO(foolip): Remove this interface.
 
 [
     NoInterfaceObject,
diff --git a/third_party/WebKit/Source/core/css/StyleSheet.idl b/third_party/WebKit/Source/core/css/StyleSheet.idl
index 62a9a33..d8abd9c 100644
--- a/third_party/WebKit/Source/core/css/StyleSheet.idl
+++ b/third_party/WebKit/Source/core/css/StyleSheet.idl
@@ -25,11 +25,11 @@
 ] interface StyleSheet {
     readonly attribute DOMString type;
     readonly attribute DOMString? href;
-    // TODO(philipj): ownerNode should be (Element or ProcessingInstruction).
+    // TODO(foolip): ownerNode should be (Element or ProcessingInstruction).
     readonly attribute Node? ownerNode;
     readonly attribute StyleSheet? parentStyleSheet;
     readonly attribute DOMString? title;
-    // TODO(philipj): media should have [PutForwards=mediaText].
+    // TODO(foolip): media should have [PutForwards=mediaText].
     [SameObject] readonly attribute MediaList media;
     attribute boolean disabled;
 };
diff --git a/third_party/WebKit/Source/core/css/StyleSheetList.idl b/third_party/WebKit/Source/core/css/StyleSheetList.idl
index 4289147f..68fdc935 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetList.idl
+++ b/third_party/WebKit/Source/core/css/StyleSheetList.idl
@@ -20,7 +20,7 @@
 
 // http://dev.w3.org/csswg/cssom/#the-stylesheetlist-interface
 
-// TODO(philipj): StyleSheetList should be an [ArrayClass].
+// TODO(foolip): StyleSheetList should be an [ArrayClass].
 [
     SetWrapperReferenceFrom=document,
 ] interface StyleSheetList {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
index f9821b7..81865a39 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
@@ -6,13 +6,18 @@
 
 #include "bindings/core/v8/ExceptionState.h"
 #include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSPrimitiveValueUnitTrie.h"
 #include "wtf/MathExtras.h"
 
 namespace blink {
 
 CSSAngleValue* CSSAngleValue::create(double value, const String& unit, ExceptionState& exceptionState)
 {
-    CSSPrimitiveValue::UnitType primitiveUnit = CSSPrimitiveValue::fromName(unit);
+    CSSPrimitiveValue::UnitType primitiveUnit;
+    if (unit.is8Bit())
+        primitiveUnit = lookupCSSPrimitiveValueUnit(unit.characters8(), unit.length());
+    else
+        primitiveUnit = lookupCSSPrimitiveValueUnit(unit.characters16(), unit.length());
     DCHECK(CSSPrimitiveValue::isAngle(primitiveUnit));
     return new CSSAngleValue(value, primitiveUnit);
 }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
index 8db5b55..1acad10 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp
@@ -5,6 +5,7 @@
 #include "core/css/cssom/CSSLengthValue.h"
 
 #include "bindings/core/v8/ExceptionState.h"
+#include "core/css/CSSPrimitiveValueUnitTrie.h"
 #include "core/css/cssom/CSSSimpleLength.h"
 #include "core/css/cssom/CalcDictionary.h"
 #include "core/css/cssom/StyleCalcLength.h"
@@ -17,7 +18,9 @@
     if (equalIgnoringASCIICase(name, "percent") || name == "%") {
         return CSSPrimitiveValue::UnitType::Percentage;
     }
-    return CSSPrimitiveValue::fromName(name);
+    if (name.is8Bit())
+        return lookupCSSPrimitiveValueUnit(name.characters8(), name.length());
+    return lookupCSSPrimitiveValueUnit(name.characters16(), name.length());
 }
 
 CSSLengthValue* CSSLengthValue::from(const String& cssString, ExceptionState& exceptionState)
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
index b84458ac..7f1cde9 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp
@@ -5,6 +5,7 @@
 #include "core/css/parser/CSSParserToken.h"
 
 #include "core/css/CSSMarkup.h"
+#include "core/css/CSSPrimitiveValueUnitTrie.h"
 #include "core/css/parser/CSSPropertyParser.h"
 #include "wtf/HashMap.h"
 #include "wtf/text/StringBuilder.h"
@@ -68,7 +69,11 @@
     ASSERT(m_type == NumberToken);
     m_type = DimensionToken;
     initValueFromCSSParserString(unit);
-    m_unit = static_cast<unsigned>(CSSPrimitiveValue::fromName(unit));
+
+    if (unit.is8Bit())
+        m_unit = static_cast<unsigned>(lookupCSSPrimitiveValueUnit(unit.characters8(), unit.length()));
+    else
+        m_unit = static_cast<unsigned>(lookupCSSPrimitiveValueUnit(unit.characters16(), unit.length()));
 }
 
 void CSSParserToken::convertToPercentage()
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
index 381a8ba..4df038a98 100644
--- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
@@ -32,6 +32,7 @@
 #include "core/layout/svg/ReferenceFilterBuilder.h"
 #include "core/style/ComputedStyle.h"
 #include "core/style/ContentData.h"
+#include "core/style/CursorData.h"
 #include "core/style/FillLayer.h"
 #include "core/style/StyleFetchedImage.h"
 #include "core/style/StyleFetchedImageSet.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp
index e0ac5067..f10791f5 100644
--- a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp
@@ -27,7 +27,6 @@
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/Settings.h"
-#include "core/layout/LayoutTheme.h"
 #include "core/layout/TextAutosizer.h"
 #include "core/style/ComputedStyle.h"
 #include "platform/FontFamilyNames.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index 27e5b85..5d36384 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -41,7 +41,6 @@
 #include "core/html/HTMLPlugInElement.h"
 #include "core/html/HTMLTableCellElement.h"
 #include "core/html/HTMLTextAreaElement.h"
-#include "core/layout/LayoutReplaced.h"
 #include "core/layout/LayoutTheme.h"
 #include "core/style/ComputedStyle.h"
 #include "core/style/ComputedStyleConstants.h"
diff --git a/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.idl b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.idl
index 40d4b77..a348066 100644
--- a/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.idl
+++ b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.idl
@@ -13,7 +13,7 @@
     Selection? getSelection();
     // CSSOM View Module
     // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
-    // TODO(philipj): The x and y arguments should be of type double.
+    // TODO(foolip): The x and y arguments should be of type double.
     Element? elementFromPoint(long x, long y);
     sequence<Element> elementsFromPoint(long x, long y);
     readonly attribute Element? activeElement;
diff --git a/third_party/WebKit/Source/core/dom/FrameRequestCallback.idl b/third_party/WebKit/Source/core/dom/FrameRequestCallback.idl
index ddf7cda..1e3e8a48 100644
--- a/third_party/WebKit/Source/core/dom/FrameRequestCallback.idl
+++ b/third_party/WebKit/Source/core/dom/FrameRequestCallback.idl
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): FrameRequestCallback should not be a callback interface.
+// TODO(foolip): FrameRequestCallback should not be a callback interface.
 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28152
 callback interface FrameRequestCallback {
     // highResTime is passed as high resolution timestamp, see
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
index deca6e0..9ab6211 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -8,8 +8,6 @@
 #include "core/dom/IntersectionObserver.h"
 #include "core/frame/FrameView.h"
 #include "core/layout/LayoutBox.h"
-#include "core/layout/LayoutPart.h"
-#include "core/layout/LayoutText.h"
 #include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 8ac672a..9565e1f7 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -973,9 +973,10 @@
 
     if (layoutObject()) {
         const ComputedStyle& style = layoutObject()->styleRef();
-        // We allow selections to begin within an element that has -webkit-user-select: none set,
-        // but if the element is draggable then dragging should take priority over selection.
-        if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NONE)
+        // We don't allow selections to begin within an element that has
+        // -webkit-user-select: none set,
+        // https://drafts.csswg.org/css-ui-4/#valdef-user-select-none
+        if (style.userSelect() == SELECT_NONE)
             return false;
     }
     ContainerNode* parent = FlatTreeTraversal::parent(*this);
diff --git a/third_party/WebKit/Source/core/dom/NodeRareData.cpp b/third_party/WebKit/Source/core/dom/NodeRareData.cpp
index 86f630b9..9b60294 100644
--- a/third_party/WebKit/Source/core/dom/NodeRareData.cpp
+++ b/third_party/WebKit/Source/core/dom/NodeRareData.cpp
@@ -34,7 +34,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/ElementRareData.h"
 #include "core/frame/FrameHost.h"
-#include "core/layout/LayoutObject.h"
 #include "platform/heap/Handle.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
index d8650f8..110cb2d 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -42,7 +42,7 @@
 #include "core/events/ScopedEventQueue.h"
 #include "core/html/HTMLBodyElement.h"
 #include "core/html/HTMLElement.h"
-#include "core/layout/LayoutBoxModelObject.h"
+#include "core/layout/LayoutObject.h"
 #include "core/layout/LayoutText.h"
 #include "core/svg/SVGSVGElement.h"
 #include "platform/geometry/FloatQuad.h"
@@ -1551,10 +1551,10 @@
     for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
         if (node->isElementNode()) {
             if (!nodeSet.contains(node->parentNode())) {
-                if (LayoutBoxModelObject* layoutBoxModelObject = toElement(node)->layoutBoxModelObject()) {
+                if (LayoutObject* layoutObject = toElement(node)->layoutObject()) {
                     Vector<FloatQuad> elementQuads;
-                    layoutBoxModelObject->absoluteQuads(elementQuads);
-                    m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(elementQuads, *layoutBoxModelObject);
+                    layoutObject->absoluteQuads(elementQuads);
+                    m_ownerDocument->adjustFloatQuadsForScrollAndAbsoluteZoom(elementQuads, *layoutObject);
 
                     quads.appendVector(elementQuads);
                 }
diff --git a/third_party/WebKit/Source/core/dom/URL.idl b/third_party/WebKit/Source/core/dom/URL.idl
index 1ffce796..ef4edae 100644
--- a/third_party/WebKit/Source/core/dom/URL.idl
+++ b/third_party/WebKit/Source/core/dom/URL.idl
@@ -32,7 +32,7 @@
     ImplementedAs=DOMURL,
     RaisesException=Constructor,
 ] interface URL {
-    // TODO(philipj): Implement domainToASCII() and domainToUnicode().
+    // TODO(foolip): Implement domainToASCII() and domainToUnicode().
     // crbug.com/493908
     // static USVString domainToASCII(USVString domain);
     // static USVString domainToUnicode(USVString domain);
diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl
index b2a1872..55f5141 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl
+++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl
@@ -33,7 +33,7 @@
     [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerHTML;
     [RuntimeEnabled=ShadowDOMV1] readonly attribute boolean delegatesFocus;
 
-    // TODO(philipj): The spec does not override cloneNode() on the ShadowRoot
+    // TODO(foolip): The spec does not override cloneNode() on the ShadowRoot
     // interface. Here, it's used to implement "Invoking the cloneNode() method
     // on a ShadowRoot instance must always throw a DATA_CLONE_ERR exception" as
     // Node.cloneNode() does not have [RaisesException].
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index cb18baab..7417544f 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -1746,13 +1746,13 @@
     return target->dispatchEvent(beforeInputEvent);
 }
 
-DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, InputEvent::InputType inputType, const String& data)
+DispatchEventResult dispatchBeforeInputFromComposition(EventTarget* target, InputEvent::InputType inputType, const String& data, InputEvent::EventCancelable cancelable)
 {
     if (!RuntimeEnabledFeatures::inputEventEnabled())
         return DispatchEventResult::NotCanceled;
     if (!target)
         return DispatchEventResult::NotCanceled;
-    InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data, InputEvent::EventCancelable::NotCancelable, InputEvent::EventIsComposing::IsComposing);
+    InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data, cancelable, InputEvent::EventIsComposing::IsComposing);
     return target->dispatchEvent(beforeInputEvent);
 }
 
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.h b/third_party/WebKit/Source/core/editing/EditingUtilities.h
index 5cec6b5..65fdc4f 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.h
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.h
@@ -353,7 +353,7 @@
 
 // Functions dispatch InputEvent
 DispatchEventResult dispatchBeforeInputInsertText(EventTarget*, const String& data);
-DispatchEventResult dispatchBeforeInputFromComposition(EventTarget*, InputEvent::InputType, const String& data);
+DispatchEventResult dispatchBeforeInputFromComposition(EventTarget*, InputEvent::InputType, const String& data, InputEvent::EventCancelable);
 DispatchEventResult dispatchBeforeInputEditorCommand(EventTarget*, InputEvent::InputType, const String& data = "");
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index b70befe..bce455e 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -44,6 +44,80 @@
 
 namespace blink {
 
+namespace {
+
+void dispatchCompositionUpdateEvent(LocalFrame& frame, const String& text)
+{
+    Element* target = frame.document()->focusedElement();
+    if (!target)
+        return;
+
+    CompositionEvent* event = CompositionEvent::create(EventTypeNames::compositionupdate, frame.domWindow(), text);
+    target->dispatchEvent(event);
+}
+
+void dispatchCompositionEndEvent(LocalFrame& frame, const String& text)
+{
+    Element* target = frame.document()->focusedElement();
+    if (!target)
+        return;
+
+    CompositionEvent* event = CompositionEvent::create(EventTypeNames::compositionend, frame.domWindow(), text);
+    target->dispatchEvent(event);
+}
+
+// Used to insert/replace text during composition update and confirm composition.
+// Procedure:
+//   1. Fire 'beforeinput' event for (TODO(chongz): deleted composed text) and inserted text
+//   2. Fire 'compositionupdate' event
+//   3. Fire TextEvent and modify DOM
+//   TODO(chongz): 4. Fire 'input' event
+void insertTextDuringCompositionWithEvents(LocalFrame& frame, const String& text, TypingCommand::Options options, TypingCommand::TextCompositionType compositionType)
+{
+    DCHECK(compositionType == TypingCommand::TextCompositionType::TextCompositionUpdate || compositionType == TypingCommand::TextCompositionType::TextCompositionConfirm)
+        << "compositionType should be TextCompositionUpdate or TextCompositionConfirm, but got " << static_cast<int>(compositionType);
+    if (!frame.document())
+        return;
+
+    Element* target = frame.document()->focusedElement();
+    if (!target)
+        return;
+
+    // TODO(chongz): Fire 'beforeinput' for the composed text being replaced/deleted.
+
+    // Only the last confirmed text is cancelable.
+    InputEvent::EventCancelable beforeInputCancelable = (compositionType == TypingCommand::TextCompositionType::TextCompositionUpdate) ? InputEvent::EventCancelable::NotCancelable : InputEvent::EventCancelable::IsCancelable;
+    DispatchEventResult result = dispatchBeforeInputFromComposition(target, InputEvent::InputType::InsertText, text, beforeInputCancelable);
+
+    if (beforeInputCancelable == InputEvent::EventCancelable::IsCancelable && result != DispatchEventResult::NotCanceled)
+        return;
+
+    // 'beforeinput' event handler may destroy document.
+    if (!frame.document())
+        return;
+
+    dispatchCompositionUpdateEvent(frame, text);
+    // 'compositionupdate' event handler may destroy document.
+    if (!frame.document())
+        return;
+
+    switch (compositionType) {
+    case TypingCommand::TextCompositionType::TextCompositionUpdate:
+        TypingCommand::insertText(*frame.document(), text, options, compositionType);
+        break;
+    case TypingCommand::TextCompositionType::TextCompositionConfirm:
+        // TODO(chongz): Use TypingCommand::insertText after TextEvent was removed. (Removed from spec since 2012)
+        // See TextEvent.idl.
+        frame.eventHandler().handleTextInputEvent(text, 0, TextEventInputComposition);
+        break;
+    default:
+        NOTREACHED();
+    }
+    // TODO(chongz): Fire 'input' event.
+}
+
+} // anonymous namespace
+
 InputMethodController::SelectionOffsetsScope::SelectionOffsetsScope(InputMethodController* inputMethodController)
     : m_inputMethodController(inputMethodController)
     , m_offsets(inputMethodController->getSelectionOffsets())
@@ -96,11 +170,6 @@
     m_compositionRange = nullptr;
 }
 
-bool InputMethodController::insertTextForConfirmedComposition(const String& text)
-{
-    return frame().eventHandler().handleTextInputEvent(text, 0, TextEventInputComposition);
-}
-
 void InputMethodController::selectComposition() const
 {
     const EphemeralRange range = compositionEphemeralRange();
@@ -119,19 +188,6 @@
     return confirmComposition(composingText());
 }
 
-static void dispatchCompositionEndEvent(LocalFrame& frame, const String& text)
-{
-    // We should send this event before sending a TextEvent as written in
-    // Section 6.2.2 and 6.2.3 of the DOM Event specification.
-    Element* target = frame.document()->focusedElement();
-    if (!target)
-        return;
-
-    CompositionEvent* event =
-        CompositionEvent::create(EventTypeNames::compositionend, frame.domWindow(), text);
-    target->dispatchEvent(event);
-}
-
 bool InputMethodController::confirmComposition(const String& text, ConfirmCompositionBehavior confirmBehavior)
 {
     if (!hasComposition())
@@ -155,8 +211,6 @@
     if (frame().selection().isNone())
         return false;
 
-    dispatchCompositionEndEvent(frame(), text);
-
     if (!frame().document())
         return false;
 
@@ -168,12 +222,13 @@
 
     clear();
 
-    // TODO(chongz): DOM update should happen before 'compositionend' and along with 'compositionupdate'.
-    // https://crbug.com/575294
-    if (dispatchBeforeInputInsertText(frame().document()->focusedElement(), text) != DispatchEventResult::NotCanceled)
+    insertTextDuringCompositionWithEvents(frame(), text, 0, TypingCommand::TextCompositionType::TextCompositionConfirm);
+    // Event handler might destroy document.
+    if (!frame().document())
         return false;
 
-    insertTextForConfirmedComposition(text);
+    // No DOM update after 'compositionend'.
+    dispatchCompositionEndEvent(frame(), text);
 
     return true;
 }
@@ -213,13 +268,22 @@
     if (frame().selection().isNone())
         return;
 
-    dispatchCompositionEndEvent(frame(), emptyString());
     clear();
-    insertTextForConfirmedComposition(emptyString());
+
+    // TODO(chongz): Update InputType::DeleteComposedCharacter with latest discussion.
+    dispatchBeforeInputFromComposition(frame().document()->focusedElement(), InputEvent::InputType::DeleteComposedCharacter, emptyString(), InputEvent::EventCancelable::NotCancelable);
+    dispatchCompositionUpdateEvent(frame(), emptyString());
+    insertTextDuringCompositionWithEvents(frame(), emptyString(), 0, TypingCommand::TextCompositionType::TextCompositionConfirm);
+    // Event handler might destroy document.
+    if (!frame().document())
+        return;
 
     // An open typing command that disagrees about current selection would cause
     // issues with typing later on.
     TypingCommand::closeTyping(m_frame);
+
+    // No DOM update after 'compositionend'.
+    dispatchCompositionEndEvent(frame(), emptyString());
 }
 
 void InputMethodController::cancelCompositionIfSelectionIsInvalid()
@@ -253,58 +317,52 @@
     if (frame().selection().isNone())
         return;
 
-    if (Element* target = frame().document()->focusedElement()) {
-        // Dispatch an appropriate composition event to the focused node.
-        // We check the composition status and choose an appropriate composition event since this
-        // function is used for three purposes:
-        // 1. Starting a new composition.
-        //    Send a compositionstart and a compositionupdate event when this function creates
-        //    a new composition node, i.e.
-        //    !hasComposition() && !text.isEmpty().
-        //    Sending a compositionupdate event at this time ensures that at least one
-        //    compositionupdate event is dispatched.
-        // 2. Updating the existing composition node.
-        //    Send a compositionupdate event when this function updates the existing composition
-        //    node, i.e. hasComposition() && !text.isEmpty().
-        // 3. Canceling the ongoing composition.
-        //    Send a compositionend event when function deletes the existing composition node, i.e.
-        //    !hasComposition() && test.isEmpty().
-        CompositionEvent* event = nullptr;
-        if (!hasComposition()) {
-            // We should send a compositionstart event only when the given text is not empty because this
-            // function doesn't create a composition node when the text is empty.
-            if (!text.isEmpty()) {
-                target->dispatchEvent(CompositionEvent::create(EventTypeNames::compositionstart, frame().domWindow(), frame().selectedText()));
-                event = CompositionEvent::create(EventTypeNames::compositionupdate, frame().domWindow(), text);
-            }
-        } else {
-            if (!text.isEmpty())
-                event = CompositionEvent::create(EventTypeNames::compositionupdate, frame().domWindow(), text);
-            else
-                event = CompositionEvent::create(EventTypeNames::compositionend, frame().domWindow(), text);
+    Element* target = frame().document()->focusedElement();
+    if (!target)
+        return;
+
+    // Dispatch an appropriate composition event to the focused node.
+    // We check the composition status and choose an appropriate composition event since this
+    // function is used for three purposes:
+    // 1. Starting a new composition.
+    //    Send a compositionstart and a compositionupdate event when this function creates
+    //    a new composition node, i.e.
+    //    !hasComposition() && !text.isEmpty().
+    //    Sending a compositionupdate event at this time ensures that at least one
+    //    compositionupdate event is dispatched.
+    // 2. Updating the existing composition node.
+    //    Send a compositionupdate event when this function updates the existing composition
+    //    node, i.e. hasComposition() && !text.isEmpty().
+    // 3. Canceling the ongoing composition.
+    //    Send a compositionend event when function deletes the existing composition node, i.e.
+    //    !hasComposition() && test.isEmpty().
+    if (text.isEmpty()) {
+        if (hasComposition()) {
+            confirmComposition(emptyString());
+            return;
         }
-        if (event) {
-            // TODO(chongz): Support canceling IME composition.
-            // TODO(chongz): Should fire InsertText or DeleteComposedCharacter based on action.
-            if (event->type() == EventTypeNames::compositionupdate)
-                dispatchBeforeInputFromComposition(target, InputEvent::InputType::InsertText, text);
-            target->dispatchEvent(event);
-        }
+        // It's weird to call |setComposition()| with empty text outside composition, however some IME
+        // (e.g. Japanese IBus-Anthy) did this, so we simply delete selection without sending extra events.
+        TypingCommand::deleteSelection(*frame().document(), TypingCommand::PreventSpellChecking);
+        return;
     }
 
-    // If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input
-    // will delete the old composition with an optimized replace operation.
-    if (text.isEmpty()) {
-        DCHECK(frame().document());
-        TypingCommand::deleteSelection(*frame().document(), TypingCommand::PreventSpellChecking);
+    // We should send a 'compositionstart' event only when the given text is not empty because this
+    // function doesn't create a composition node when the text is empty.
+    if (!hasComposition()) {
+        target->dispatchEvent(CompositionEvent::create(EventTypeNames::compositionstart, frame().domWindow(), frame().selectedText()));
+        if (!frame().document())
+            return;
     }
 
+    DCHECK(!text.isEmpty());
+
     clear();
 
-    if (text.isEmpty())
+    insertTextDuringCompositionWithEvents(frame(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate);
+    // Event handlers might destroy document.
+    if (!frame().document())
         return;
-    DCHECK(frame().document());
-    TypingCommand::insertText(*frame().document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate);
 
     // Find out what node has the composition now.
     Position base = mostForwardCaretPosition(frame().selection().base());
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.h b/third_party/WebKit/Source/core/editing/InputMethodController.h
index f5ce71d..bf7e152c 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.h
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.h
@@ -107,7 +107,6 @@
     }
 
     String composingText() const;
-    bool insertTextForConfirmedComposition(const String& text);
     void selectComposition() const;
     bool setSelectionOffsets(const PlainTextRange&);
 };
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
index 541c84e..b176244 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -372,7 +372,8 @@
 
     document().setTitle(emptyString());
     controller().confirmComposition();
-    EXPECT_STREQ("beforeinput.isComposing:false", document().title().utf8().data());
+    // Last 'beforeinput' should also be inside composition scope.
+    EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data());
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/PositionIterator.h b/third_party/WebKit/Source/core/editing/PositionIterator.h
index 6469ba1..a083700 100644
--- a/third_party/WebKit/Source/core/editing/PositionIterator.h
+++ b/third_party/WebKit/Source/core/editing/PositionIterator.h
@@ -30,7 +30,6 @@
 #include "core/editing/EditingStrategy.h"
 #include "core/editing/EditingUtilities.h"
 #include "core/html/HTMLHtmlElement.h"
-#include "core/layout/LayoutBlock.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/editing/Selection.idl b/third_party/WebKit/Source/core/editing/Selection.idl
index b6f216f..2f8b61c 100644
--- a/third_party/WebKit/Source/core/editing/Selection.idl
+++ b/third_party/WebKit/Source/core/editing/Selection.idl
@@ -51,7 +51,7 @@
     [MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart();
     [MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd();
     [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional long offset = 0);
-    // TODO(philipj): The arguments should be anchorNode, anchorOffset,
+    // TODO(foolip): The arguments should be anchorNode, anchorOffset,
     // focusNode and focusOffset, and none of them are nullable in the spec.
     [MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent(Node? baseNode, long baseOffset,
                                                                                  Node? extentNode, long extentOffset);
diff --git a/third_party/WebKit/Source/core/editing/VisiblePosition.cpp b/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
index 89ce9975..d05bfcc 100644
--- a/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
+++ b/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
@@ -35,8 +35,6 @@
 #include "core/editing/TextAffinity.h"
 #include "core/editing/VisibleUnits.h"
 #include "core/html/HTMLElement.h"
-#include "core/layout/LayoutBlock.h"
-#include "core/layout/line/RootInlineBox.h"
 #include "platform/geometry/FloatQuad.h"
 #include "wtf/text/CString.h"
 #include <ostream> // NOLINT
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index f3bfbde7..cf6e0e1 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -60,9 +60,7 @@
 #include "core/layout/api/LineLayoutItem.h"
 #include "core/layout/line/InlineIterator.h"
 #include "core/layout/line/InlineTextBox.h"
-#include "core/paint/PaintLayer.h"
 #include "platform/Logging.h"
-#include "platform/RuntimeEnabledFeatures.h"
 #include "platform/heap/Handle.h"
 #include "platform/text/TextBoundaries.h"
 #include "platform/text/TextBreakIterator.h"
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
index e8eb5cb..8837a3f 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -35,7 +35,6 @@
 #include "core/editing/VisibleUnits.h"
 #include "core/html/HTMLBRElement.h"
 #include "core/html/HTMLElement.h"
-#include "core/layout/LayoutObject.h"
 #include "core/style/ComputedStyle.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
index 6b6edabd..aff0f6a 100644
--- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -40,7 +40,6 @@
 #include "core/html/HTMLStyleElement.h"
 #include "core/html/HTMLTableRowElement.h"
 #include "core/layout/LayoutTableCell.h"
-#include "core/layout/LayoutText.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
index e5ff33e..314701b 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
@@ -26,6 +26,8 @@
 
 #include "core/editing/iterators/TextIteratorTextState.h"
 
+#include "core/layout/LayoutText.h"
+
 namespace blink {
 
 TextIteratorTextState::TextIteratorTextState(bool emitsOriginalText)
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h
index ebd4907b..e71e41c6 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.h
@@ -29,11 +29,12 @@
 #include "core/CoreExport.h"
 #include "core/dom/Range.h"
 #include "core/editing/iterators/ForwardsTextBuffer.h"
-#include "core/layout/LayoutText.h"
 #include "wtf/text/WTFString.h"
 
 namespace blink {
 
+class LayoutText;
+
 class CORE_EXPORT TextIteratorTextState {
     STACK_ALLOCATED();
 public:
diff --git a/third_party/WebKit/Source/core/events/AnimationEvent.idl b/third_party/WebKit/Source/core/events/AnimationEvent.idl
index 8b0b7945..174c55f 100644
--- a/third_party/WebKit/Source/core/events/AnimationEvent.idl
+++ b/third_party/WebKit/Source/core/events/AnimationEvent.idl
@@ -29,7 +29,7 @@
     Constructor(DOMString type, optional AnimationEventInit eventInitDict),
 ] interface AnimationEvent : Event {
     readonly attribute DOMString animationName;
-    // TODO(philipj): elapsedTime should be float.
+    // TODO(foolip): elapsedTime should be float.
     readonly attribute double elapsedTime;
-    // TODO(philipj): readonly attribute DOMString pseudoElement;
+    // TODO(foolip): readonly attribute DOMString pseudoElement;
 };
diff --git a/third_party/WebKit/Source/core/events/AnimationEventInit.idl b/third_party/WebKit/Source/core/events/AnimationEventInit.idl
index ae6c9b9c9..141b8b6 100644
--- a/third_party/WebKit/Source/core/events/AnimationEventInit.idl
+++ b/third_party/WebKit/Source/core/events/AnimationEventInit.idl
@@ -6,7 +6,7 @@
 
 dictionary AnimationEventInit : EventInit {
     DOMString animationName = "";
-    // TODO(philipj): elapsedTime should be float.
+    // TODO(foolip): elapsedTime should be float.
     double elapsedTime = 0.0;
-    // TODO(philipj): DOMString pseudoElement = "";
+    // TODO(foolip): DOMString pseudoElement = "";
 };
diff --git a/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.idl b/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.idl
index debc4a0..faeec2b 100644
--- a/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.idl
+++ b/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.idl
@@ -5,7 +5,7 @@
 // ApplicationCache Error Detail Proposal:
 // https://docs.google.com/document/d/1nlk7WgRD3d0ZcfK1xrwBFVZ3DI_e44j7QoMd5gAJC4E/edit
 
-// TODO(philipj): Update the spec link once this is in the HTML spec:
+// TODO(foolip): Update the spec link once this is in the HTML spec:
 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22702
 
 [
diff --git a/third_party/WebKit/Source/core/events/ClipboardEvent.idl b/third_party/WebKit/Source/core/events/ClipboardEvent.idl
index 0b10b27..61a744c 100644
--- a/third_party/WebKit/Source/core/events/ClipboardEvent.idl
+++ b/third_party/WebKit/Source/core/events/ClipboardEvent.idl
@@ -4,7 +4,7 @@
 
 // https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces
 
-// TODO(philipj): There should be a constructor which takes a ClipboardEventInit
+// TODO(foolip): There should be a constructor which takes a ClipboardEventInit
 // dictionary. crbug.com/496394
 interface ClipboardEvent : Event {
     readonly attribute DataTransfer clipboardData;
diff --git a/third_party/WebKit/Source/core/events/CompositionEvent.idl b/third_party/WebKit/Source/core/events/CompositionEvent.idl
index 3d2a209..a73b738 100644
--- a/third_party/WebKit/Source/core/events/CompositionEvent.idl
+++ b/third_party/WebKit/Source/core/events/CompositionEvent.idl
@@ -31,7 +31,7 @@
     readonly attribute DOMString data;
 
     // https://w3c.github.io/uievents/#idl-interface-CompositionEvent-initializers
-    // TODO(philipj): None of the initCompositionEvent() arguments should be
+    // TODO(foolip): None of the initCompositionEvent() arguments should be
     // optional, and the spec has a locale argument after data.
     [Measure] void initCompositionEvent([Default=Undefined] optional DOMString type,
                                         [Default=Undefined] optional boolean bubbles,
diff --git a/third_party/WebKit/Source/core/events/ErrorEvent.idl b/third_party/WebKit/Source/core/events/ErrorEvent.idl
index a26bac62..b35a17a 100644
--- a/third_party/WebKit/Source/core/events/ErrorEvent.idl
+++ b/third_party/WebKit/Source/core/events/ErrorEvent.idl
@@ -32,7 +32,7 @@
 
 [
     Constructor(DOMString type, optional ErrorEventInit eventInitDict),
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface ErrorEvent : Event {
     readonly attribute DOMString message;
     readonly attribute DOMString filename;
diff --git a/third_party/WebKit/Source/core/events/HashChangeEvent.idl b/third_party/WebKit/Source/core/events/HashChangeEvent.idl
index 40d4ec3..f3e20ed 100644
--- a/third_party/WebKit/Source/core/events/HashChangeEvent.idl
+++ b/third_party/WebKit/Source/core/events/HashChangeEvent.idl
@@ -21,7 +21,7 @@
 
 [
     Constructor(DOMString type, optional HashChangeEventInit eventInitDict),
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface HashChangeEvent : Event {
     readonly attribute DOMString oldURL;
     readonly attribute DOMString newURL;
diff --git a/third_party/WebKit/Source/core/events/KeyboardEvent.idl b/third_party/WebKit/Source/core/events/KeyboardEvent.idl
index 3b3cb1f..7266a87e 100644
--- a/third_party/WebKit/Source/core/events/KeyboardEvent.idl
+++ b/third_party/WebKit/Source/core/events/KeyboardEvent.idl
@@ -37,7 +37,7 @@
     readonly attribute boolean          altKey;
     readonly attribute boolean          metaKey;
     readonly attribute boolean          repeat;
-    // TODO(philipj): readonly attribute boolean isComposing;
+    // TODO(foolip): readonly attribute boolean isComposing;
     boolean getModifierState(DOMString keyArg);
 
     // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers
diff --git a/third_party/WebKit/Source/core/events/KeyboardEventInit.idl b/third_party/WebKit/Source/core/events/KeyboardEventInit.idl
index 3f8e08f8..dc705fd 100644
--- a/third_party/WebKit/Source/core/events/KeyboardEventInit.idl
+++ b/third_party/WebKit/Source/core/events/KeyboardEventInit.idl
@@ -9,7 +9,7 @@
     DOMString code = "";
     unsigned long location = 0;
     boolean repeat = false;
-    // TODO(philipj): boolean isComposing = false;
+    // TODO(foolip): boolean isComposing = false;
 
     // Non-standard APIs
     DOMString keyIdentifier = "";
diff --git a/third_party/WebKit/Source/core/events/MessageEvent.idl b/third_party/WebKit/Source/core/events/MessageEvent.idl
index 536ba1f..b8a5265 100644
--- a/third_party/WebKit/Source/core/events/MessageEvent.idl
+++ b/third_party/WebKit/Source/core/events/MessageEvent.idl
@@ -40,7 +40,7 @@
     readonly attribute MessagePort[]? ports;
     [RuntimeEnabled=suborigins] readonly attribute DOMString suborigin;
 
-    // TODO(philipj): None of the initMessageEvent() arguments should be
+    // TODO(foolip): None of the initMessageEvent() arguments should be
     // optional, and |sourceArg| and |portsArg| are of the wrong type.
     [Custom, MeasureAs=InitMessageEvent] void initMessageEvent([Default=Undefined] optional DOMString typeArg,
                                    [Default=Undefined] optional boolean canBubbleArg,
diff --git a/third_party/WebKit/Source/core/events/MouseEvent.idl b/third_party/WebKit/Source/core/events/MouseEvent.idl
index 5d8696c4..9917232 100644
--- a/third_party/WebKit/Source/core/events/MouseEvent.idl
+++ b/third_party/WebKit/Source/core/events/MouseEvent.idl
@@ -37,7 +37,7 @@
     boolean getModifierState(DOMString keyArg);
 
     // https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
-    // TODO(philipj): None of the initMouseEvent() arguments should be optional.
+    // TODO(foolip): None of the initMouseEvent() arguments should be optional.
     [CallWith=ScriptState, Measure] void initMouseEvent([Default=Undefined] optional DOMString type,
                                                         [Default=Undefined] optional boolean bubbles,
                                                         [Default=Undefined] optional boolean cancelable,
@@ -56,7 +56,7 @@
 
     // CSSOM View Module
     // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-mouseevent-interface
-    // TODO(philipj): These attributes should be of type double, and the spec
+    // TODO(foolip): These attributes should be of type double, and the spec
     // also redefines screenX/Y and clientX/Y as double.
     readonly attribute long pageX;
     readonly attribute long pageY;
diff --git a/third_party/WebKit/Source/core/events/MutationEvent.idl b/third_party/WebKit/Source/core/events/MutationEvent.idl
index d3607a4..c377ae5 100644
--- a/third_party/WebKit/Source/core/events/MutationEvent.idl
+++ b/third_party/WebKit/Source/core/events/MutationEvent.idl
@@ -30,7 +30,7 @@
     readonly attribute DOMString      newValue;
     readonly attribute DOMString      attrName;
     readonly attribute unsigned short attrChange;
-    // TODO(philipj): None of the initMutationEvent() arguments should be optional.
+    // TODO(foolip): None of the initMutationEvent() arguments should be optional.
     [Measure] void initMutationEvent([Default=Undefined] optional DOMString type,
                                      [Default=Undefined] optional boolean bubbles,
                                      [Default=Undefined] optional boolean cancelable,
diff --git a/third_party/WebKit/Source/core/events/PageTransitionEvent.idl b/third_party/WebKit/Source/core/events/PageTransitionEvent.idl
index 7dc109e..35778686 100644
--- a/third_party/WebKit/Source/core/events/PageTransitionEvent.idl
+++ b/third_party/WebKit/Source/core/events/PageTransitionEvent.idl
@@ -27,7 +27,7 @@
 
 [
     Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface PageTransitionEvent : Event {
     readonly attribute boolean persisted;
 };
diff --git a/third_party/WebKit/Source/core/events/PopStateEvent.idl b/third_party/WebKit/Source/core/events/PopStateEvent.idl
index 5d051637..3c368e7 100644
--- a/third_party/WebKit/Source/core/events/PopStateEvent.idl
+++ b/third_party/WebKit/Source/core/events/PopStateEvent.idl
@@ -28,7 +28,7 @@
 
 [
     Constructor(DOMString type, optional PopStateEventInit eventInitDict),
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface PopStateEvent : Event {
     [Custom=Getter] readonly attribute any state;
 };
diff --git a/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl b/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl
index 2ae1dbf..2b5ae44 100644
--- a/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl
+++ b/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl
@@ -27,10 +27,10 @@
 [
     Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
 ] interface SecurityPolicyViolationEvent : Event {
-    // TODO(philipj): The spec says "documentURL".
+    // TODO(foolip): The spec says "documentURL".
     [Measure] readonly attribute DOMString documentURI;
     readonly attribute DOMString referrer;
-    // TODO(philipj): The spec says "blockedURL".
+    // TODO(foolip): The spec says "blockedURL".
     [Measure] readonly attribute DOMString blockedURI;
     readonly attribute DOMString violatedDirective;
     readonly attribute DOMString effectiveDirective;
diff --git a/third_party/WebKit/Source/core/events/SecurityPolicyViolationEventInit.idl b/third_party/WebKit/Source/core/events/SecurityPolicyViolationEventInit.idl
index 77d3db3f..ad892039 100644
--- a/third_party/WebKit/Source/core/events/SecurityPolicyViolationEventInit.idl
+++ b/third_party/WebKit/Source/core/events/SecurityPolicyViolationEventInit.idl
@@ -5,10 +5,10 @@
 // http://w3c.github.io/webappsec/specs/content-security-policy/#securitypolicyviolationevent-interface
 
 dictionary SecurityPolicyViolationEventInit : EventInit {
-    // TODO(philipj): The spec says "documentURL".
+    // TODO(foolip): The spec says "documentURL".
     DOMString documentURI;
     DOMString referrer;
-    // TODO(philipj): The spec says "blockedURL".
+    // TODO(foolip): The spec says "blockedURL".
     DOMString blockedURI;
     DOMString violatedDirective;
     DOMString effectiveDirective;
diff --git a/third_party/WebKit/Source/core/events/TextEvent.idl b/third_party/WebKit/Source/core/events/TextEvent.idl
index b49c98f..84d278a 100644
--- a/third_party/WebKit/Source/core/events/TextEvent.idl
+++ b/third_party/WebKit/Source/core/events/TextEvent.idl
@@ -25,7 +25,7 @@
 
 // http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/#webidl-events-TextEvent
 
-// TODO(philipj): Remove the textinput event and the TextEvent interface. They
+// TODO(foolip): Remove the textinput event and the TextEvent interface. They
 // were removed from the spec in 2012:
 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=12958
 // https://github.com/w3c/uievents/commit/1a2aa02b474fd4feaf43fdced06e6fd7214196a4
diff --git a/third_party/WebKit/Source/core/events/TransitionEvent.idl b/third_party/WebKit/Source/core/events/TransitionEvent.idl
index 2cf9480..e1cebacf 100644
--- a/third_party/WebKit/Source/core/events/TransitionEvent.idl
+++ b/third_party/WebKit/Source/core/events/TransitionEvent.idl
@@ -30,7 +30,7 @@
     Constructor(DOMString type, optional TransitionEventInit eventInitDict),
 ] interface TransitionEvent : Event {
     readonly attribute DOMString propertyName;
-    // TODO(philipj): elapsedTime should be float.
+    // TODO(foolip): elapsedTime should be float.
     readonly attribute double elapsedTime;
     readonly attribute DOMString pseudoElement;
 };
diff --git a/third_party/WebKit/Source/core/events/UIEvent.idl b/third_party/WebKit/Source/core/events/UIEvent.idl
index c0ae319..235ec54d3e 100644
--- a/third_party/WebKit/Source/core/events/UIEvent.idl
+++ b/third_party/WebKit/Source/core/events/UIEvent.idl
@@ -27,7 +27,7 @@
     [RuntimeEnabled=InputDeviceCapabilities] readonly attribute InputDeviceCapabilities? sourceCapabilities;
 
     // https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
-    // TODO(philipj): None of the initUIEvent() arguments should be optional.
+    // TODO(foolip): None of the initUIEvent() arguments should be optional.
     [Measure] void initUIEvent([Default=Undefined] optional DOMString type,
                                [Default=Undefined] optional boolean bubbles,
                                [Default=Undefined] optional boolean cancelable,
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index 81db1364..b8e74a1c 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -202,7 +202,7 @@
         m_image = nullptr;
         setDecodedSize(0);
     } else if (m_image && !errorOccurred()) {
-        m_image->destroyDecodedData(true);
+        m_image->destroyDecodedData();
     }
 }
 
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
index a63095f..eadcca3 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
@@ -126,7 +126,7 @@
     cachedImage->load(fetcher);
     Platform::current()->getURLLoaderMockFactory()->unregisterURL(testURL);
 
-    MockImageResourceClient client(cachedImage);
+    Persistent<MockImageResourceClient> client = new MockImageResourceClient(cachedImage);
     EXPECT_EQ(Resource::Pending, cachedImage->getStatus());
 
     // Send the multipart response. No image or data buffer is created.
@@ -137,8 +137,8 @@
     cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(multipartResponse), nullptr);
     ASSERT_FALSE(cachedImage->resourceBuffer());
     ASSERT_FALSE(cachedImage->hasImage());
-    ASSERT_EQ(client.imageChangedCount(), 0);
-    ASSERT_FALSE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 0);
+    ASSERT_FALSE(client->notifyFinishedCalled());
     EXPECT_EQ("multipart/x-mixed-replace", cachedImage->response().mimeType());
 
     const char firstPart[] =
@@ -148,8 +148,8 @@
     // Send the response for the first real part. No image or data buffer is created.
     ASSERT_FALSE(cachedImage->resourceBuffer());
     ASSERT_FALSE(cachedImage->hasImage());
-    ASSERT_EQ(client.imageChangedCount(), 0);
-    ASSERT_FALSE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 0);
+    ASSERT_FALSE(client->notifyFinishedCalled());
     EXPECT_EQ("image/svg+xml", cachedImage->response().mimeType());
 
     const char secondPart[] = "<svg xmlns='http://www.w3.org/2000/svg' width='1' height='1'><rect width='1' height='1' fill='green'/></svg>\n";
@@ -157,8 +157,8 @@
     cachedImage->appendData(secondPart, strlen(secondPart));
     ASSERT_TRUE(cachedImage->resourceBuffer());
     ASSERT_FALSE(cachedImage->hasImage());
-    ASSERT_EQ(client.imageChangedCount(), 0);
-    ASSERT_FALSE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 0);
+    ASSERT_FALSE(client->notifyFinishedCalled());
 
     const char thirdPart[] = "--boundary";
     cachedImage->appendData(thirdPart, strlen(thirdPart));
@@ -173,8 +173,8 @@
     ASSERT_FALSE(cachedImage->getImage()->isNull());
     ASSERT_EQ(cachedImage->getImage()->width(), 1);
     ASSERT_EQ(cachedImage->getImage()->height(), 1);
-    ASSERT_EQ(client.imageChangedCount(), 1);
-    ASSERT_TRUE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 1);
+    ASSERT_TRUE(client->notifyFinishedCalled());
 }
 
 TEST(ImageResourceTest, CancelOnDetach)
@@ -191,11 +191,11 @@
     cachedImage->load(fetcher);
     memoryCache()->add(cachedImage);
 
-    MockImageResourceClient client(cachedImage);
+    Persistent<MockImageResourceClient> client = new MockImageResourceClient(cachedImage);
     EXPECT_EQ(Resource::Pending, cachedImage->getStatus());
 
     // The load should still be alive, but a timer should be started to cancel the load inside removeClient().
-    client.removeAsClient();
+    client->removeAsClient();
     EXPECT_EQ(Resource::Pending, cachedImage->getStatus());
     EXPECT_NE(reinterpret_cast<Resource*>(0), memoryCache()->resourceForURL(testURL));
 
@@ -212,7 +212,7 @@
     ImageResource* cachedImage = ImageResource::create(ResourceRequest());
     cachedImage->setStatus(Resource::Pending);
 
-    MockImageResourceClient client(cachedImage);
+    Persistent<MockImageResourceClient> client = new MockImageResourceClient(cachedImage);
 
     // Send the image response.
     cachedImage->responseReceived(ResourceResponse(KURL(), "multipart/x-mixed-replace", 0, nullAtom, String()), nullptr);
@@ -224,7 +224,7 @@
     ASSERT_FALSE(cachedImage->errorOccurred());
     ASSERT_TRUE(cachedImage->hasImage());
     ASSERT_FALSE(cachedImage->getImage()->isNull());
-    ASSERT_TRUE(client.notifyFinishedCalled());
+    ASSERT_TRUE(client->notifyFinishedCalled());
 
     // The prune comes when the ImageResource still has clients. The image should not be deleted.
     cachedImage->prune();
@@ -233,7 +233,7 @@
     ASSERT_FALSE(cachedImage->getImage()->isNull());
 
     // The ImageResource no longer has clients. The image should be deleted by prune.
-    client.removeAsClient();
+    client->removeAsClient();
     cachedImage->prune();
     ASSERT_FALSE(cachedImage->hasClientsOrObservers());
     ASSERT_FALSE(cachedImage->hasImage());
@@ -245,7 +245,7 @@
     ImageResource* cachedImage = ImageResource::create(ResourceRequest());
     cachedImage->setStatus(Resource::Pending);
 
-    MockImageResourceClient client(cachedImage);
+    Persistent<MockImageResourceClient> client = new MockImageResourceClient(cachedImage);
 
     // Send the image response.
     Vector<unsigned char> jpeg = jpegImage();
@@ -255,8 +255,8 @@
     ASSERT_FALSE(cachedImage->errorOccurred());
     ASSERT_TRUE(cachedImage->hasImage());
     ASSERT_FALSE(cachedImage->getImage()->isNull());
-    ASSERT_EQ(client.imageChangedCount(), 2);
-    ASSERT_TRUE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 2);
+    ASSERT_TRUE(client->notifyFinishedCalled());
     ASSERT_TRUE(cachedImage->getImage()->isBitmapImage());
 }
 
@@ -267,7 +267,7 @@
     ImageResource* cachedImage = ImageResource::create(ResourceRequest(testURL));
     cachedImage->setStatus(Resource::Pending);
 
-    MockImageResourceClient client(cachedImage);
+    Persistent<MockImageResourceClient> client = new MockImageResourceClient(cachedImage);
     ResourceFetcher* fetcher = ResourceFetcher::create(ImageResourceTestMockFetchContext::create());
 
     // Send the image response.
@@ -281,15 +281,15 @@
     ASSERT_FALSE(cachedImage->errorOccurred());
     ASSERT_TRUE(cachedImage->hasImage());
     ASSERT_FALSE(cachedImage->getImage()->isNull());
-    ASSERT_EQ(client.imageChangedCount(), 2);
-    ASSERT_TRUE(client.notifyFinishedCalled());
+    ASSERT_EQ(client->imageChangedCount(), 2);
+    ASSERT_TRUE(client->notifyFinishedCalled());
     ASSERT_TRUE(cachedImage->getImage()->isBitmapImage());
 
     cachedImage->reloadIfLoFi(fetcher);
     ASSERT_FALSE(cachedImage->errorOccurred());
     ASSERT_FALSE(cachedImage->resourceBuffer());
     ASSERT_TRUE(cachedImage->hasImage());
-    ASSERT_EQ(client.imageChangedCount(), 3);
+    ASSERT_EQ(client->imageChangedCount(), 3);
 
     cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(resourceResponse), nullptr);
     cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>(jpeg.data()), jpeg.size(), jpeg.size());
@@ -297,7 +297,7 @@
     ASSERT_FALSE(cachedImage->errorOccurred());
     ASSERT_TRUE(cachedImage->hasImage());
     ASSERT_FALSE(cachedImage->getImage()->isNull());
-    ASSERT_TRUE(client.notifyFinishedCalled());
+    ASSERT_TRUE(client->notifyFinishedCalled());
     ASSERT_TRUE(cachedImage->getImage()->isBitmapImage());
 }
 
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp b/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp
index 8d6631f..a66426a3 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp
@@ -133,7 +133,7 @@
     ASSERT_EQ(cachedResource->size(), memoryCache()->deadSize());
     ASSERT_EQ(0u, memoryCache()->liveSize());
 
-    MockResourceClient client(cachedResource);
+    Persistent<MockResourceClient> client = new MockResourceClient(cachedResource);
     ASSERT_EQ(0u, memoryCache()->deadSize());
     ASSERT_EQ(cachedResource->size(), memoryCache()->liveSize());
 
@@ -237,7 +237,7 @@
     const char data[6] = "abcde";
     cachedDeadResource->appendData(data, 3u);
     cachedDeadResource->finish();
-    MockResourceClient client(cachedLiveResource);
+    Persistent<MockResourceClient> client = new MockResourceClient(cachedLiveResource);
     cachedLiveResource->appendData(data, 4u);
     cachedLiveResource->finish();
 
@@ -294,9 +294,9 @@
 static void TestClientRemoval(Resource* resource1, Resource* resource2)
 {
     const char data[6] = "abcde";
-    MockResourceClient client1(resource1);
+    Persistent<MockResourceClient> client1 = new MockResourceClient(resource1);
     resource1->appendData(data, 4u);
-    MockResourceClient client2(resource2);
+    Persistent<MockResourceClient> client2 = new MockResourceClient(resource2);
     resource2->appendData(data, 4u);
 
     const unsigned minDeadCapacity = 0;
@@ -315,7 +315,7 @@
 
     // Removing the client from resource1 should result in all resources
     // remaining in cache since the prune is deferred.
-    client1.removeAsClient();
+    client1->removeAsClient();
     ASSERT_GT(resource1->decodedSize(), 0u);
     ASSERT_GT(resource2->decodedSize(), 0u);
     ASSERT_EQ(memoryCache()->deadSize(), resource1->size());
@@ -325,7 +325,7 @@
 
     // Removing the client from resource2 should result in immediate
     // eviction of resource2 because we are over the prune deferral limit.
-    client2.removeAsClient();
+    client2->removeAsClient();
     ASSERT_GT(resource1->decodedSize(), 0u);
     ASSERT_GT(resource2->decodedSize(), 0u);
     ASSERT_EQ(memoryCache()->deadSize(), resource1->size());
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
index ffe8072..463c6ea 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
@@ -13,14 +13,12 @@
     : m_resource(resource)
     , m_notifyFinishedCalled(false)
 {
+    ThreadState::current()->registerPreFinalizer(this);
     m_resource->addClient(this);
 }
 
-MockResourceClient::~MockResourceClient()
-{
-    if (m_resource)
-        m_resource->removeClient(this);
-}
+MockResourceClient::~MockResourceClient() {}
+
 void MockResourceClient::notifyFinished(Resource*)
 {
     ASSERT_FALSE(m_notifyFinishedCalled);
@@ -33,6 +31,19 @@
     m_resource = nullptr;
 }
 
+void MockResourceClient::dispose()
+{
+    if (m_resource) {
+        m_resource->removeClient(this);
+        m_resource = nullptr;
+    }
+}
+
+DEFINE_TRACE(MockResourceClient)
+{
+    visitor->trace(m_resource);
+}
+
 MockImageResourceClient::MockImageResourceClient(ImageResource* resource)
     : MockResourceClient(resource)
     , m_imageChangedCount(0)
@@ -41,11 +52,7 @@
     toImageResource(m_resource.get())->addObserver(this);
 }
 
-MockImageResourceClient::~MockImageResourceClient()
-{
-    if (m_resource)
-        toImageResource(m_resource.get())->removeObserver(this);
-}
+MockImageResourceClient::~MockImageResourceClient() {}
 
 void MockImageResourceClient::removeAsClient()
 {
@@ -53,6 +60,13 @@
     MockResourceClient::removeAsClient();
 }
 
+void MockImageResourceClient::dispose()
+{
+    if (m_resource)
+        toImageResource(m_resource.get())->removeObserver(this);
+    MockResourceClient::dispose();
+}
+
 void MockImageResourceClient::imageChanged(ImageResource*, const IntRect*)
 {
     m_imageChangedCount++;
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.h b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
index 49d0bb3..4710a7f 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.h
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
@@ -38,7 +38,8 @@
 
 namespace blink {
 
-class MockResourceClient : public ResourceClient {
+class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>, public ResourceClient {
+    USING_PRE_FINALIZER(MockResourceClient, dispose);
 public:
     explicit MockResourceClient(Resource*);
     ~MockResourceClient() override;
@@ -48,10 +49,12 @@
     virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
 
     virtual void removeAsClient();
+    virtual void dispose();
+
+    DECLARE_TRACE();
 
 protected:
-    // TODO(Oilpan): properly trace when ResourceClient is on the heap.
-    UntracedMember<Resource> m_resource;
+    Member<Resource> m_resource;
     bool m_notifyFinishedCalled;
 };
 
@@ -68,6 +71,7 @@
     bool notifyFinishedCalled() const override;
 
     void removeAsClient() override;
+    void dispose() override;
 
     int imageChangedCount() const { return m_imageChangedCount; }
 
diff --git a/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp b/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp
index a405dd7..6de25852 100644
--- a/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp
@@ -33,6 +33,7 @@
 #include "core/fetch/MemoryCache.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "platform/SharedBuffer.h"
+#include "platform/heap/Handle.h"
 #include "platform/testing/UnitTestHelpers.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebURL.h"
@@ -54,7 +55,7 @@
     ASSERT_FALSE(jpegResource->canReuse(pngRequest));
 }
 
-class DummyClient final : public RawResourceClient {
+class DummyClient final : public GarbageCollectedFinalized<DummyClient>, public RawResourceClient {
 public:
     DummyClient() : m_called(false) {}
     ~DummyClient() override {}
@@ -73,13 +74,15 @@
 
     bool called() { return m_called; }
     const Vector<char>& data() { return m_data; }
+    DEFINE_INLINE_TRACE() {}
+
 private:
     bool m_called;
     Vector<char> m_data;
 };
 
 // This client adds another client when notified.
-class AddingClient : public RawResourceClient {
+class AddingClient final : public GarbageCollectedFinalized<AddingClient>, public RawResourceClient {
 public:
     AddingClient(DummyClient* client, Resource* resource)
         : m_dummyClient(client)
@@ -102,9 +105,16 @@
     {
         m_resource->removeClient(m_dummyClient);
     }
+
+    DEFINE_INLINE_VIRTUAL_TRACE()
+    {
+        visitor->trace(m_dummyClient);
+        visitor->trace(m_resource);
+    }
+
 private:
-    DummyClient* m_dummyClient;
-    Persistent<Resource> m_resource;
+    Member<DummyClient> m_dummyClient;
+    Member<Resource> m_resource;
     Timer<AddingClient> m_removeClientTimer;
 };
 
@@ -122,8 +132,8 @@
     // Simulate a successful revalidation.
     resource->setRevalidatingRequest(ResourceRequest("data:text/html,"));
 
-    OwnPtr<DummyClient> client = adoptPtr(new DummyClient);
-    resource->addClient(client.get());
+    Persistent<DummyClient> client = new DummyClient;
+    resource->addClient(client);
 
     ResourceResponse revalidatingResponse;
     revalidatingResponse.setHTTPStatusCode(304);
@@ -134,7 +144,7 @@
     EXPECT_EQ(memoryCache()->resourceForURL(KURL(ParsedURLString, "data:text/html,")), resource);
     memoryCache()->remove(resource);
 
-    resource->removeClient(client.get());
+    resource->removeClient(client);
     EXPECT_FALSE(resource->hasClientsOrObservers());
     EXPECT_FALSE(client->called());
     EXPECT_EQ("abcd", String(client->data().data(), client->data().size()));
@@ -152,8 +162,8 @@
     // Simulate a successful revalidation.
     resource->setRevalidatingRequest(ResourceRequest("data:text/html,"));
 
-    OwnPtr<DummyClient> client = adoptPtr(new DummyClient);
-    resource->addClient(client.get());
+    Persistent<DummyClient> client = new DummyClient;
+    resource->addClient(client);
 
     ResourceResponse revalidatingResponse;
     revalidatingResponse.setHTTPStatusCode(304);
@@ -164,7 +174,7 @@
     EXPECT_EQ(memoryCache()->resourceForURL(KURL(ParsedURLString, "data:text/html,")), resource);
     memoryCache()->remove(resource);
 
-    resource->removeClient(client.get());
+    resource->removeClient(client);
     EXPECT_FALSE(resource->hasClientsOrObservers());
     EXPECT_FALSE(client->called());
     EXPECT_EQ(0u, client->data().size());
@@ -197,7 +207,7 @@
     EXPECT_EQ("proxy-connection value", resource->response().httpHeaderField("proxy-connection"));
     EXPECT_EQ("custom value", resource->response().httpHeaderField("x-custom"));
 
-    OwnPtr<DummyClient> client = adoptPtr(new DummyClient);
+    Persistent<DummyClient> client = new DummyClient;
     resource->addClient(client.get());
 
     // Perform a revalidation step.
@@ -227,7 +237,7 @@
 
     memoryCache()->remove(resource);
 
-    resource->removeClient(client.get());
+    resource->removeClient(client);
     EXPECT_FALSE(resource->hasClientsOrObservers());
     EXPECT_FALSE(client->called());
     EXPECT_EQ(0u, client->data().size());
@@ -244,17 +254,17 @@
     raw->finish();
     EXPECT_FALSE(raw->response().isNull());
 
-    OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient());
-    OwnPtr<AddingClient> addingClient = adoptPtr(new AddingClient(dummyClient.get(), raw));
-    raw->addClient(addingClient.get());
+    Persistent<DummyClient> dummyClient = new DummyClient();
+    Persistent<AddingClient> addingClient = new AddingClient(dummyClient.get(), raw);
+    raw->addClient(addingClient);
     testing::runPendingTasks();
-    raw->removeClient(addingClient.get());
+    raw->removeClient(addingClient);
     EXPECT_FALSE(dummyClient->called());
     EXPECT_FALSE(raw->hasClientsOrObservers());
 }
 
 // This client removes another client when notified.
-class RemovingClient : public RawResourceClient {
+class RemovingClient : public GarbageCollectedFinalized<RemovingClient>, public RawResourceClient {
 public:
     RemovingClient(DummyClient* client)
         : m_dummyClient(client) {}
@@ -268,8 +278,13 @@
         resource->removeClient(this);
     }
     String debugName() const override { return "RemovingClient"; }
+    DEFINE_INLINE_TRACE()
+    {
+        visitor->trace(m_dummyClient);
+    }
+
 private:
-    DummyClient* m_dummyClient;
+    Member<DummyClient> m_dummyClient;
 };
 
 TEST(RawResourceTest, RemoveClientDuringCallback)
@@ -283,10 +298,10 @@
     raw->finish();
     EXPECT_FALSE(raw->response().isNull());
 
-    OwnPtr<DummyClient> dummyClient = adoptPtr(new DummyClient());
-    OwnPtr<RemovingClient> removingClient = adoptPtr(new RemovingClient(dummyClient.get()));
-    raw->addClient(dummyClient.get());
-    raw->addClient(removingClient.get());
+    Persistent<DummyClient> dummyClient = new DummyClient();
+    Persistent<RemovingClient> removingClient = new RemovingClient(dummyClient.get());
+    raw->addClient(dummyClient);
+    raw->addClient(removingClient);
     testing::runPendingTasks();
     EXPECT_FALSE(raw->hasClientsOrObservers());
 }
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
index 264588a..69571fd 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
@@ -215,7 +215,7 @@
     Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
 }
 
-class RequestSameResourceOnComplete : public RawResourceClient {
+class RequestSameResourceOnComplete : public GarbageCollectedFinalized<RequestSameResourceOnComplete>, public RawResourceClient {
 public:
     explicit RequestSameResourceOnComplete(Resource* resource)
         : m_resource(resource)
@@ -236,10 +236,15 @@
     }
     bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
 
+    DEFINE_INLINE_TRACE()
+    {
+        visitor->trace(m_resource);
+    }
+
     String debugName() const override { return "RequestSameResourceOnComplete"; }
 
 private:
-    Persistent<Resource> m_resource;
+    Member<Resource> m_resource;
     bool m_notifyFinishedCalled;
 };
 
@@ -258,12 +263,12 @@
     request1.setHTTPHeaderField(HTTPNames::Cache_Control, "no-cache");
     FetchRequest fetchRequest1 = FetchRequest(request1, FetchInitiatorInfo());
     Resource* resource1 = fetcher1->requestResource(fetchRequest1, TestResourceFactory(Resource::Image));
-    RequestSameResourceOnComplete client(resource1);
-    resource1->addClient(&client);
+    Persistent<RequestSameResourceOnComplete> client = new RequestSameResourceOnComplete(resource1);
+    resource1->addClient(client);
     Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
     Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
-    EXPECT_TRUE(client.notifyFinishedCalled());
-    resource1->removeClient(&client);
+    EXPECT_TRUE(client->notifyFinishedCalled());
+    resource1->removeClient(client);
     memoryCache()->remove(resource1);
 }
 
@@ -280,7 +285,7 @@
     memoryCache()->remove(resource2);
 }
 
-class ServeRequestsOnCompleteClient : public RawResourceClient {
+class ServeRequestsOnCompleteClient final : public GarbageCollectedFinalized<ServeRequestsOnCompleteClient>, public RawResourceClient {
 public:
     void notifyFinished(Resource*) override
     {
@@ -297,6 +302,8 @@
     void dataDownloaded(Resource*, int) override { ASSERT_TRUE(false); }
     void didReceiveResourceTiming(Resource*, const ResourceTimingInfo&) override { ASSERT_TRUE(false); }
 
+    DEFINE_INLINE_TRACE() {}
+
     String debugName() const override { return "ServeRequestsOnCompleteClient"; }
 };
 
@@ -316,9 +323,10 @@
     ResourceFetcher* fetcher = ResourceFetcher::create(ResourceFetcherTestMockFetchContext::create());
     FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo());
     Resource* resource = fetcher->requestResource(fetchRequest, TestResourceFactory(Resource::Raw));
-    ServeRequestsOnCompleteClient client;
-    resource->addClient(&client);
+    Persistent<ServeRequestsOnCompleteClient> client = new ServeRequestsOnCompleteClient();
+    resource->addClient(client);
     resource->loader()->cancel();
+    resource->removeClient(client);
     Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
 }
 
diff --git a/third_party/WebKit/Source/core/fileapi/Blob.idl b/third_party/WebKit/Source/core/fileapi/Blob.idl
index 32f1acc..013b055f 100644
--- a/third_party/WebKit/Source/core/fileapi/Blob.idl
+++ b/third_party/WebKit/Source/core/fileapi/Blob.idl
@@ -42,7 +42,7 @@
     [RuntimeEnabled=FileAPIBlobClose] readonly attribute boolean isClosed;
 
     // TODO(jsbell): start and end arguments should be [Clamp]
-    // TODO(philipj): contentType should not be nullable.
+    // TODO(foolip): contentType should not be nullable.
     [RaisesException] Blob slice(optional long long start, optional long long end, [TreatUndefinedAs=NullString] optional DOMString? contentType);
     [RaisesException, CallWith=ExecutionContext, RuntimeEnabled=FileAPIBlobClose] void close();
 };
diff --git a/third_party/WebKit/Source/core/fileapi/FileError.idl b/third_party/WebKit/Source/core/fileapi/FileError.idl
index 90224899..b8c29045 100644
--- a/third_party/WebKit/Source/core/fileapi/FileError.idl
+++ b/third_party/WebKit/Source/core/fileapi/FileError.idl
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): Remove the FileError interface. crbug.com/496901
+// TODO(foolip): Remove the FileError interface. crbug.com/496901
 [Exposed=(Window,Worker)]
 interface FileError : DOMError {
     const unsigned short NOT_FOUND_ERR = 1;
diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.idl b/third_party/WebKit/Source/core/fileapi/FileReader.idl
index a0e8345b..f3bb0f1 100644
--- a/third_party/WebKit/Source/core/fileapi/FileReader.idl
+++ b/third_party/WebKit/Source/core/fileapi/FileReader.idl
@@ -40,7 +40,7 @@
 ] interface FileReader : EventTarget {
     // async read methods
     [RaisesException] void readAsArrayBuffer(Blob blob);
-    // TODO(philipj): readAsBinaryString() was removed from the spec in 2012:
+    // TODO(foolip): readAsBinaryString() was removed from the spec in 2012:
     // https://github.com/w3c/FileAPI/commit/8cce54559dc27bf8b8244f3f0ca9fb3e4d96efdb
     [RaisesException, Measure] void readAsBinaryString(Blob blob);
     [RaisesException] void readAsText(Blob blob, optional DOMString label);
@@ -58,7 +58,7 @@
     // File or Blob data
     readonly attribute (DOMString or ArrayBuffer)? result;
 
-    // TODO(philipj): error should be DOMError. crbug.com/496901
+    // TODO(foolip): error should be DOMError. crbug.com/496901
     [Measure] readonly attribute FileError? error;
 
     // event handler attributes
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl b/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl
index 88c1149..8e9037e 100644
--- a/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl
+++ b/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl
@@ -35,7 +35,7 @@
     Constructor,
 ] interface FileReaderSync {
     [CallWith=ExecutionContext, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
-    // TODO(philipj): readAsBinaryString() was removed from the spec in 2012:
+    // TODO(foolip): readAsBinaryString() was removed from the spec in 2012:
     // https://github.com/w3c/FileAPI/commit/8cce54559dc27bf8b8244f3f0ca9fb3e4d96efdb
     [CallWith=ExecutionContext, RaisesException, Measure] DOMString readAsBinaryString(Blob blob);
     [CallWith=ExecutionContext, RaisesException] DOMString readAsText(Blob blob, optional DOMString label);
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index ffa4af4..cff7ed8 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -55,11 +55,9 @@
 #include "core/layout/LayoutAnalyzer.h"
 #include "core/layout/LayoutCounter.h"
 #include "core/layout/LayoutEmbeddedObject.h"
-#include "core/layout/LayoutInline.h"
 #include "core/layout/LayoutPart.h"
 #include "core/layout/LayoutScrollbar.h"
 #include "core/layout/LayoutScrollbarPart.h"
-#include "core/layout/LayoutTheme.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/ScrollAlignment.h"
 #include "core/layout/TextAutosizer.h"
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h
index c46ee1d..09d8c976 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.h
+++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -30,7 +30,6 @@
 #include "core/frame/FrameViewAutoSizeInfo.h"
 #include "core/frame/LayoutSubtreeRootList.h"
 #include "core/frame/RootFrameViewport.h"
-#include "core/layout/LayoutAnalyzer.h"
 #include "core/layout/ScrollAnchor.h"
 #include "core/layout/api/LayoutViewItem.h"
 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
@@ -68,6 +67,7 @@
 class LocalFrame;
 class KURL;
 class Node;
+class LayoutAnalyzer;
 class LayoutBox;
 class LayoutEmbeddedObject;
 class LayoutObject;
diff --git a/third_party/WebKit/Source/core/frame/History.idl b/third_party/WebKit/Source/core/frame/History.idl
index 02f53a3b..7cdc6fd 100644
--- a/third_party/WebKit/Source/core/frame/History.idl
+++ b/third_party/WebKit/Source/core/frame/History.idl
@@ -31,13 +31,13 @@
 ] interface History {
     readonly attribute unsigned long length;
     [RuntimeEnabled=ScrollRestoration, Measure] attribute ScrollRestoration scrollRestoration;
-    // TODO(philipj): The SerializedScriptValue type should be any.
+    // TODO(foolip): The SerializedScriptValue type should be any.
     [CachedAttribute=stateChanged] readonly attribute SerializedScriptValue state;
     [CallWith=ExecutionContext] void go(optional long delta = 0);
     [CallWith=ExecutionContext] void back();
     [CallWith=ExecutionContext] void forward();
-    // TODO(philipj): The SerializedScriptValue types should be any.
-    // TODO(philipj): The title arguments should simply be 'DOMString title'.
+    // TODO(foolip): The SerializedScriptValue types should be any.
+    // TODO(foolip): 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);
 };
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
index 2e13d67..57d1309 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
@@ -34,7 +34,6 @@
 #include "core/dom/Document.h"
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/MemoryCache.h"
-#include "core/fetch/MockResourceClients.h"
 #include "core/html/HTMLCanvasElement.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLVideoElement.h"
diff --git a/third_party/WebKit/Source/core/frame/Location.idl b/third_party/WebKit/Source/core/frame/Location.idl
index efdba728..7f541ab 100644
--- a/third_party/WebKit/Source/core/frame/Location.idl
+++ b/third_party/WebKit/Source/core/frame/Location.idl
@@ -41,11 +41,11 @@
     [CallWith=(CurrentWindow,EnteredWindow), DoNotCheckSecurity, RaisesException] void replace(DOMString url);
     [CallWith=CurrentWindow] void reload();
 
-    // TODO(philipj): ancestorOrigins should have [SameObject] and be of type
+    // TODO(foolip): ancestorOrigins should have [SameObject] and be of type
     // DOMString[], i.e. it should return the same array every time.
     [Measure] readonly attribute DOMStringList ancestorOrigins;
 
-    // TODO(philipj): Per spec, Location implements URLUtils. The below is
+    // TODO(foolip): Per spec, Location implements URLUtils. The below is
     // mostly like the URLUtils interface, but with some members missing and
     // using DOMString instead of USVString.
     [SetterCallWith=(CurrentWindow,EnteredWindow), DoNotCheckSecurity=Setter] attribute DOMString href;
@@ -60,7 +60,7 @@
     [SetterCallWith=(CurrentWindow,EnteredWindow)] attribute DOMString search;
     [SetterCallWith=(CurrentWindow,EnteredWindow)] attribute DOMString hash;
 
-    // TODO(philipj): Location does not have a valueOf() override in the spec.
+    // TODO(foolip): Location does not have a valueOf() override in the spec.
     // See the comment in Location.h for the purpose of this.
     [NotEnumerable, CallWith=ThisValue] any valueOf();
 };
diff --git a/third_party/WebKit/Source/core/frame/Navigator.idl b/third_party/WebKit/Source/core/frame/Navigator.idl
index 2a298d8a..5782e6e 100644
--- a/third_party/WebKit/Source/core/frame/Navigator.idl
+++ b/third_party/WebKit/Source/core/frame/Navigator.idl
@@ -23,10 +23,10 @@
 ] interface Navigator {
     // objects implementing this interface also implement the interfaces given below
 
-    // TODO(philipj): vendorSub should be on NavigatorID.
+    // TODO(foolip): vendorSub should be on NavigatorID.
     [MeasureAs=NavigatorVendorSub] readonly attribute DOMString vendorSub;
 
-    // TODO(philipj): productSub and vendor are not yet in the spec:
+    // TODO(foolip): productSub and vendor are not yet in the spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27954
     [MeasureAs=NavigatorProductSub] readonly attribute DOMString productSub;
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27786
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
index 7635c39..ad01706 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
@@ -12,7 +12,6 @@
 #include "core/frame/RemoteFrameClient.h"
 #include "core/frame/RemoteFrameView.h"
 #include "core/html/HTMLFrameOwnerElement.h"
-#include "core/layout/LayoutPart.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/paint/PaintLayer.h"
 #include "platform/PluginScriptForbiddenScope.h"
diff --git a/third_party/WebKit/Source/core/html/FormData.idl b/third_party/WebKit/Source/core/html/FormData.idl
index 90a995e7..271db17b 100644
--- a/third_party/WebKit/Source/core/html/FormData.idl
+++ b/third_party/WebKit/Source/core/html/FormData.idl
@@ -30,7 +30,7 @@
 
 // https://xhr.spec.whatwg.org/#interface-formdata
 
-// TODO(philipj): The FormDataEntryValue typedef should use Blob, not File.
+// TODO(foolip): The FormDataEntryValue typedef should use Blob, not File.
 typedef (File or USVString) FormDataEntryValue;
 
 [
@@ -38,7 +38,7 @@
     Exposed=(Window,Worker),
     LegacyInterfaceTypeChecking,
 ] interface FormData {
-    // TODO(philipj): The value argument should be FormDataEntryValue and there
+    // TODO(foolip): The value argument should be FormDataEntryValue and there
     // should be no optional filename argument. crbug.com/498790
     [CallWith=ExecutionContext] void append(USVString name, Blob value, optional USVString filename);
     void append(USVString name, USVString value);
@@ -47,7 +47,7 @@
     [RuntimeEnabled=FormDataNewMethods] FormDataEntryValue? get(USVString name);
     [RuntimeEnabled=FormDataNewMethods] sequence<FormDataEntryValue> getAll(USVString name);
     [RuntimeEnabled=FormDataNewMethods] boolean has(USVString name);
-    // TODO(philipj): The value argument should be FormDataEntryValue and there
+    // TODO(foolip): The value argument should be FormDataEntryValue and there
     // should be no optional filename argument.
     [RuntimeEnabled=FormDataNewMethods] void set(USVString name, Blob value, optional USVString filename);
     [RuntimeEnabled=FormDataNewMethods] void set(USVString name, USVString value);
diff --git a/third_party/WebKit/Source/core/html/HTMLBodyElement.idl b/third_party/WebKit/Source/core/html/HTMLBodyElement.idl
index 51f03084..7a42319 100644
--- a/third_party/WebKit/Source/core/html/HTMLBodyElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLBodyElement.idl
@@ -30,7 +30,7 @@
     [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
     [Reflect] attribute DOMString background;
 
-    // TODO(philipj): These event handler attributes should be inherited from
+    // TODO(foolip): These event handler attributes should be inherited from
     // HTMLElement (which implements GlobalEventHandlers), but have different
     // behavior. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28166
     attribute EventHandler onblur;
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl
index 21caf79..569daea 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl
@@ -27,7 +27,7 @@
     [Reflect] attribute DOMString cols;
     [Reflect] attribute DOMString rows;
 
-    // TODO(philipj): These event handler attributes should be inherited from
+    // TODO(foolip): These event handler attributes should be inherited from
     // HTMLElement (which implements GlobalEventHandlers), but have different
     // behavior. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28166
     attribute EventHandler onblur;
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.idl b/third_party/WebKit/Source/core/html/HTMLImageElement.idl
index 9166b85..9f045ae 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.idl
@@ -20,7 +20,7 @@
 
 // https://html.spec.whatwg.org/#the-img-element
 
-// TODO(philipj): All long types in this interfaces should be unsigned long.
+// TODO(foolip): All long types in this interfaces should be unsigned long.
 [
     ActiveScriptWrappable, 
     ConstructorCallWith=Document,
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index c7e6fe7..a2136d9 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -788,7 +788,7 @@
 
         cueTimeline().updateActiveCues(0);
     } else if (!m_paused) {
-        // TODO(philipj): There is a proposal to always reset the paused state
+        // TODO(foolip): There is a proposal to always reset the paused state
         // in the media element load algorithm, to avoid a bogus play() promise
         // rejection: https://github.com/whatwg/html/issues/869
         // This is where that change would have an effect, and it is measured to
@@ -1993,7 +1993,7 @@
     // The spec does not define an invalid value default:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28950
 
-    // TODO(philipj): Try to make "metadata" the default preload state:
+    // TODO(foolip): Try to make "metadata" the default preload state:
     // https://crbug.com/310450
     UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadDefault);
     return WebMediaPlayer::PreloadAuto;
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.idl b/third_party/WebKit/Source/core/html/HTMLObjectElement.idl
index d0f62615..68f5847a 100644
--- a/third_party/WebKit/Source/core/html/HTMLObjectElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.idl
@@ -27,14 +27,14 @@
 ] interface HTMLObjectElement : HTMLElement {
     [Reflect, URL] attribute DOMString data;
     [Reflect] attribute DOMString type;
-    // TODO(philipj): attribute boolean typeMustMatch;
+    // TODO(foolip): attribute boolean typeMustMatch;
     [Reflect] attribute DOMString name;
     [Reflect] attribute DOMString useMap;
     [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
     [Reflect] attribute DOMString width;
     [Reflect] attribute DOMString height;
     [CheckSecurity=ReturnValue] readonly attribute Document? contentDocument;
-    // TODO(philipj): readonly attribute WindowProxy? contentWindow;
+    // TODO(foolip): readonly attribute WindowProxy? contentWindow;
     [CheckSecurity=ReturnValue, RaisesException] Document? getSVGDocument();
 
     readonly attribute boolean willValidate;
@@ -44,7 +44,7 @@
     boolean reportValidity();
     void setCustomValidity(DOMString error);
 
-    // TODO(philipj): legacycaller any (any... arguments); crbug.com/465009
+    // TODO(foolip): legacycaller any (any... arguments); crbug.com/465009
 
     // obsolete members
     // https://html.spec.whatwg.org/#HTMLObjectElement-partial
@@ -52,7 +52,7 @@
     [Reflect] attribute DOMString archive;
     [Reflect] attribute DOMString code;
     [Reflect] attribute boolean declare;
-    // TODO(philipj): hspace and vspace should be unsigned long.
+    // TODO(foolip): hspace and vspace should be unsigned long.
     [Reflect] attribute long hspace;
     [Reflect] attribute DOMString standby;
     [Reflect] attribute long vspace;
@@ -61,7 +61,7 @@
 
     [Reflect, TreatNullAs=EmptyString] attribute DOMString border;
 
-    // TODO(philipj): These getters and setters are not in the spec.
+    // TODO(foolip): These getters and setters are not in the spec.
     [Custom, NotEnumerable] getter boolean (unsigned long index);
     [Custom] setter boolean (unsigned long index, Node value);
     [Custom, NotEnumerable] getter Node (DOMString name);
diff --git a/third_party/WebKit/Source/core/html/HTMLOptionElement.idl b/third_party/WebKit/Source/core/html/HTMLOptionElement.idl
index 92a23236..263ac8b 100644
--- a/third_party/WebKit/Source/core/html/HTMLOptionElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLOptionElement.idl
@@ -35,7 +35,7 @@
     [ImplementedAs=selectedForBinding] attribute boolean selected;
     attribute DOMString value;
 
-    // TODO(philipj): The text setter should never throw.
+    // TODO(foolip): The text setter should never throw.
     [RaisesException=Setter] attribute DOMString text;
     readonly attribute long index;
 };
diff --git a/third_party/WebKit/Source/core/html/HTMLScriptElement.idl b/third_party/WebKit/Source/core/html/HTMLScriptElement.idl
index 064e63ae..9b75e1ed 100644
--- a/third_party/WebKit/Source/core/html/HTMLScriptElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLScriptElement.idl
@@ -30,7 +30,7 @@
 
     // obsolete members
     // https://html.spec.whatwg.org/#HTMLScriptElement-partial
-    // TODO(philipj): The event and htmlFor attributes should return the empty
+    // TODO(foolip): The event and htmlFor attributes should return the empty
     // string on getting, and do nothing on setting.
     [Reflect] attribute DOMString event;
     [Reflect=for] attribute DOMString htmlFor;
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.idl b/third_party/WebKit/Source/core/html/HTMLSelectElement.idl
index 01e27f78..1a72fc49 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.idl
@@ -22,7 +22,7 @@
 // https://html.spec.whatwg.org/#the-select-element
 
 interface HTMLSelectElement : HTMLElement {
-    // TODO(philipj): attribute DOMString autocomplete;
+    // TODO(foolip): attribute DOMString autocomplete;
     [Reflect] attribute boolean autofocus;
     [Reflect] attribute boolean disabled;
     [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
@@ -34,7 +34,7 @@
     readonly attribute DOMString type;
 
     readonly attribute HTMLOptionsCollection options;
-    // TODO(philipj): The length setter should never throw.
+    // TODO(foolip): The length setter should never throw.
     [RaisesException=Setter] attribute unsigned long length;
     getter Element? item(unsigned long index);
     HTMLOptionElement? namedItem(DOMString name);
diff --git a/third_party/WebKit/Source/core/html/HTMLStyleElement.idl b/third_party/WebKit/Source/core/html/HTMLStyleElement.idl
index 8c035ff..7c74316e7 100644
--- a/third_party/WebKit/Source/core/html/HTMLStyleElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLStyleElement.idl
@@ -21,7 +21,7 @@
 // https://html.spec.whatwg.org/#the-style-element
 
 interface HTMLStyleElement : HTMLElement {
-    // TODO(philipj): The disabled attribute has been removed from the spec:
+    // TODO(foolip): The disabled attribute has been removed from the spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
     [Measure] attribute boolean disabled;
     [Reflect] attribute DOMString media;
diff --git a/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl b/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl
index 933fedb..eb53196 100644
--- a/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl
@@ -23,7 +23,7 @@
 interface HTMLTableCellElement : HTMLElement {
     attribute unsigned long colSpan;
     attribute unsigned long rowSpan;
-    // TODO(philipj): headers should be a [PutForwards=value] readonly attribute
+    // TODO(foolip): headers should be a [PutForwards=value] readonly attribute
     // DOMTokenList.
     [Reflect, TreatNullAs=NullString] attribute DOMString headers;
     readonly attribute long cellIndex;
@@ -42,7 +42,7 @@
 
     [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
 
-    // TODO(philipj): The spec has HTMLTableHeaderCellElement and
+    // TODO(foolip): The spec has HTMLTableHeaderCellElement and
     // HTMLTableDataCellElement interfaces for the th and td elements
     // respectively. HTMLTableHeaderCellElement has the abbr and scope
     // attributes, while HTMLTableDataCellElement has only abbr.
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.idl b/third_party/WebKit/Source/core/html/HTMLTableElement.idl
index b36de85c..94a8c53 100644
--- a/third_party/WebKit/Source/core/html/HTMLTableElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLTableElement.idl
@@ -21,7 +21,7 @@
 // https://html.spec.whatwg.org/#the-table-element
 
 interface HTMLTableElement : HTMLElement {
-    // TODO(philipj): The caption, tHead and tFoot setters should never throw.
+    // TODO(foolip): The caption, tHead and tFoot setters should never throw.
     [RaisesException=Setter] attribute HTMLTableCaptionElement? caption;
     HTMLTableCaptionElement createCaption();
     void deleteCaption();
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl
index ea7ca76..832ac3cb 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl
@@ -53,7 +53,7 @@
     readonly attribute NodeList labels;
 
     void select();
-    // TODO(philipj): selectionStart and selectionEnd should be unsigned long.
+    // TODO(foolip): selectionStart and selectionEnd should be unsigned long.
     attribute long selectionStart;
     attribute long selectionEnd;
     attribute DOMString selectionDirection;
@@ -62,7 +62,7 @@
                                         unsigned long start,
                                         unsigned long end,
                                         optional SelectionMode selectionMode = "preserve");
-    // TODO(philipj): The start and end arguments should be unsigned long and
+    // TODO(foolip): The start and end arguments should be unsigned long and
     // should not be optional.
     void setSelectionRange([Default=Undefined] optional long start,
                            [Default=Undefined] optional long end,
diff --git a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
index d0fc1db..48fe21d 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -202,7 +202,7 @@
     if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode))
         mode = SkXfermode::kSrcOver_Mode;
 
-    // TODO(junov, philipj): crbug.com/456529 Pass the whole SkPaint instead of only alpha and xfermode
+    // TODO(junov, foolip): crbug.com/456529 Pass the whole SkPaint instead of only alpha and xfermode
     webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF, mode);
 }
 
diff --git a/third_party/WebKit/Source/core/html/ImageData.idl b/third_party/WebKit/Source/core/html/ImageData.idl
index a8a6e2a..d52d253 100644
--- a/third_party/WebKit/Source/core/html/ImageData.idl
+++ b/third_party/WebKit/Source/core/html/ImageData.idl
@@ -36,6 +36,6 @@
 ] interface ImageData {
     readonly attribute unsigned long width;
     readonly attribute unsigned long height;
-    // TODO(philipj): Expose data.
+    // TODO(foolip): Expose data.
     // readonly attribute Uint8ClampedArray data;
 };
diff --git a/third_party/WebKit/Source/core/html/RadioNodeList.idl b/third_party/WebKit/Source/core/html/RadioNodeList.idl
index d1be414c6..148d563 100644
--- a/third_party/WebKit/Source/core/html/RadioNodeList.idl
+++ b/third_party/WebKit/Source/core/html/RadioNodeList.idl
@@ -28,6 +28,6 @@
 interface RadioNodeList : NodeList {
     attribute DOMString value;
 
-    // TODO(philipj): This should be inherited from NodeList.
+    // TODO(foolip): This should be inherited from NodeList.
     [ImplementedAs=item] getter Node? (unsigned long index);
 };
diff --git a/third_party/WebKit/Source/core/html/TextMetrics.idl b/third_party/WebKit/Source/core/html/TextMetrics.idl
index dea30b9fe..1872cf2 100644
--- a/third_party/WebKit/Source/core/html/TextMetrics.idl
+++ b/third_party/WebKit/Source/core/html/TextMetrics.idl
@@ -25,9 +25,9 @@
 
 // https://html.spec.whatwg.org/#textmetrics
 
-// TODO(philipj): All float types in this interface should be double.
+// TODO(foolip): All float types in this interface should be double.
 [
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface TextMetrics {
     // x-direction
     readonly attribute float width; // advance width
diff --git a/third_party/WebKit/Source/core/html/VoidCallback.idl b/third_party/WebKit/Source/core/html/VoidCallback.idl
index daf58ab..3b43682 100644
--- a/third_party/WebKit/Source/core/html/VoidCallback.idl
+++ b/third_party/WebKit/Source/core/html/VoidCallback.idl
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): This callback interface was added for HTMLMediaElement's
+// TODO(foolip): This callback interface was added for HTMLMediaElement's
 // addCuePoint() and removeCuePoint(), which briefly existed in 2007. It is no
 // longer used in HTML and should be moved to where it is used.
 
diff --git a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
index d04ab99..57469e8 100644
--- a/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
@@ -40,7 +40,6 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/input/EventHandler.h"
-#include "core/layout/LayoutFlexibleBox.h"
 #include "core/layout/LayoutSlider.h"
 #include "core/layout/LayoutSliderContainer.h"
 #include "core/layout/LayoutSliderThumb.h"
diff --git a/third_party/WebKit/Source/core/html/track/TextTrack.idl b/third_party/WebKit/Source/core/html/track/TextTrack.idl
index 6132433..ba606252 100644
--- a/third_party/WebKit/Source/core/html/track/TextTrack.idl
+++ b/third_party/WebKit/Source/core/html/track/TextTrack.idl
@@ -48,7 +48,7 @@
 
     attribute EventHandler oncuechange;
 
-    // TODO(philipj): These WebVTT extensions have been removed from the spec:
+    // TODO(foolip): These WebVTT extensions have been removed from the spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
     [RuntimeEnabled=WebVTTRegions] readonly attribute VTTRegionList regions;
     [RuntimeEnabled=WebVTTRegions] void addRegion(VTTRegion region);
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
index c5415401..38e749e 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -192,7 +192,7 @@
     // text alignment:
     setInlineStyleProperty(CSSPropertyTextAlign, displayParameters.textAlign);
 
-    // TODO(philipj): The position adjustment for non-snap-to-lines cues has
+    // TODO(foolip): The position adjustment for non-snap-to-lines cues has
     // been removed from the spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19178
     if (std::isnan(displayParameters.snapToLinesPosition)) {
@@ -820,7 +820,7 @@
     m_cueBackgroundBox->removeChildren();
     m_vttNodeTree->cloneChildNodes(m_cueBackgroundBox.get());
 
-    // TODO(philipj): The region identifier may be non-empty without there being
+    // TODO(foolip): The region identifier may be non-empty without there being
     // a corresponding region, in which case this VTTCueBox will be added
     // directly to the text track container in updateDisplay().
     if (regionId().isEmpty()) {
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl
index 93c903b5..f484db49 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl
@@ -40,7 +40,7 @@
     ConstructorCallWith=Document,
     SetWrapperReferenceFrom=owner,
 ] interface VTTCue : TextTrackCue {
-    // TODO(philipj): regionId has been replaced by a region attribute.
+    // TODO(foolip): regionId has been replaced by a region attribute.
     [RuntimeEnabled=WebVTTRegions] attribute DOMString regionId;
     attribute DirectionSetting vertical;
     attribute boolean snapToLines;
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl
index ee44cb4..75d68f8 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl
@@ -30,7 +30,7 @@
     RuntimeEnabled=WebVTTRegions,
 ] interface VTTRegion {
     [RaisesException=Setter] attribute double width;
-    // TODO(philipj): height should be called lines.
+    // TODO(foolip): height should be called lines.
     [RaisesException=Setter] attribute long height;
     [RaisesException=Setter] attribute double regionAnchorX;
     [RaisesException=Setter] attribute double regionAnchorY;
@@ -39,7 +39,7 @@
     // TODO(philip): scroll should be of type ScrollSetting.
     [RaisesException=Setter] attribute DOMString scroll;
 
-    // TODO(philipj): The track/id attributes are gone from the spec:
+    // TODO(foolip): The track/id attributes are gone from the spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
     readonly attribute TextTrack track;
     attribute DOMString id;
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl b/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl
index 4af022c..bb647ef0 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): The VTTRegionList interface has been removed from the spec:
+// TODO(foolip): The VTTRegionList interface has been removed from the spec:
 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
 
 [
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 29f59a87..c9cf758 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -88,6 +88,7 @@
 #include "core/page/scrolling/ScrollState.h"
 #include "core/paint/PaintLayer.h"
 #include "core/style/ComputedStyle.h"
+#include "core/style/CursorData.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 63a656f9..ffc1e537 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -28,6 +28,7 @@
 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
 #include "core/CSSPropertyNames.h"
 #include "core/StylePropertyShorthand.h"
+#include "core/animation/css/CSSAnimationData.h"
 #include "core/css/CSSColorValue.h"
 #include "core/css/CSSComputedStyleDeclaration.h"
 #include "core/css/CSSDefaultStyleSheets.h"
diff --git a/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp b/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
index 8cb26e61..3bc0179 100644
--- a/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
@@ -52,7 +52,7 @@
     bool maybeAnimated() override { return true; }
     bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
     IntSize size() const override { return IntSize(); }
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
     void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override { }
     PassRefPtr<SkImage> imageForCurrentFrame() override { return nullptr; }
 };
@@ -71,7 +71,7 @@
     bool maybeAnimated() override { return true; }
     bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
     IntSize size() const override { return IntSize(); }
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
     void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override { }
 
     bool isBitmapImage() const override { return true; }
@@ -92,7 +92,7 @@
     bool maybeAnimated() override { return true; }
     bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
     IntSize size() const override { return IntSize(1, 1); }
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
     void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override { }
 
     bool isBitmapImage() const override { return true; }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index c953553..71361e64 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -47,7 +47,6 @@
 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
 #include "core/layout/LayoutPart.h"
 #include "core/layout/LayoutReplica.h"
-#include "core/layout/LayoutScrollbarPart.h"
 #include "core/layout/LayoutTableCell.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LineLayoutBox.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index 07533af..af6cea6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -28,7 +28,6 @@
 #include "core/layout/OverflowModel.h"
 #include "core/layout/ScrollEnums.h"
 #include "platform/scroll/ScrollTypes.h"
-#include "platform/scroll/ScrollableArea.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
index 4051d71..f6179cca 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
@@ -28,7 +28,6 @@
 #include "core/layout/BackgroundBleedAvoidance.h"
 #include "core/layout/LayoutObject.h"
 #include "core/page/scrolling/StickyPositionScrollingConstraints.h"
-#include "core/style/ShadowData.h"
 #include "platform/geometry/LayoutRect.h"
 
 namespace blink {
@@ -49,7 +48,6 @@
 // Modes for some of the line-related functions.
 enum LinePositionMode { PositionOnContainingLine, PositionOfInteriorLineBoxes };
 enum LineDirectionMode { HorizontalLine, VerticalLine };
-typedef unsigned BorderEdgeFlags;
 
 enum ContentChangeType {
     ImageChanged,
diff --git a/third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp b/third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp
index eeb53e2..9ea3719 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp
@@ -27,7 +27,6 @@
 #include "core/editing/PositionWithAffinity.h"
 #include "core/fileapi/FileList.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/layout/LayoutButton.h"
 #include "core/layout/LayoutTheme.h"
 #include "core/layout/TextRunConstructor.h"
 #include "core/paint/FileUploadControlPainter.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index 559ff53..8f80193 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1575,7 +1575,8 @@
 
 void LayoutGrid::layoutGridItems(GridSizingData& sizingData)
 {
-    populateGridPositions(sizingData);
+    populateGridPositionsForDirection(sizingData, ForColumns);
+    populateGridPositionsForDirection(sizingData, ForRows);
     m_gridItemsOverflowingGridArea.resize(0);
 
     for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
@@ -1789,7 +1790,7 @@
     return finalTrackPosition - initialTrackPosition + tracks[span.endLine() - 1].baseSize();
 }
 
-void LayoutGrid::populateGridPositions(GridSizingData& sizingData)
+void LayoutGrid::populateGridPositionsForDirection(GridSizingData& sizingData, GridTrackSizingDirection direction)
 {
     // Since we add alignment offsets and track gutters, grid lines are not always adjacent. Hence we will have to
     // assume from now on that we just store positions of the initial grid lines of each track,
@@ -1798,31 +1799,23 @@
     // The grid container's frame elements (border, padding and <content-position> offset) are sensible to the
     // inline-axis flow direction. However, column lines positions are 'direction' unaware. This simplification
     // allows us to use the same indexes to identify the columns independently on the inline-axis direction.
-    unsigned numberOfTracks = sizingData.columnTracks.size();
-    unsigned numberOfLines = numberOfTracks + 1;
-    unsigned lastLine = numberOfLines - 1;
-    unsigned nextToLastLine = numberOfLines - 2;
-    ContentAlignmentData offset = computeContentPositionAndDistributionOffset(ForColumns, sizingData.freeSpaceForDirection(ForColumns), numberOfTracks);
-    LayoutUnit trackGap = guttersSize(ForColumns, 2);
-    m_columnPositions.resize(numberOfLines);
-    m_columnPositions[0] = borderAndPaddingLogicalLeft() + offset.positionOffset;
-    for (unsigned i = 0; i < nextToLastLine; ++i)
-        m_columnPositions[i + 1] = m_columnPositions[i] + offset.distributionOffset + sizingData.columnTracks[i].baseSize() + trackGap;
-    m_columnPositions[lastLine] = m_columnPositions[nextToLastLine] + sizingData.columnTracks[nextToLastLine].baseSize();
-    m_offsetBetweenColumns = offset.distributionOffset;
-
-    numberOfTracks = sizingData.rowTracks.size();
-    numberOfLines = numberOfTracks + 1;
-    lastLine = numberOfLines - 1;
-    nextToLastLine = numberOfLines - 2;
-    offset = computeContentPositionAndDistributionOffset(ForRows, sizingData.freeSpaceForDirection(ForRows), numberOfTracks);
-    trackGap = guttersSize(ForRows, 2);
-    m_rowPositions.resize(numberOfLines);
-    m_rowPositions[0] = borderAndPaddingBefore() + offset.positionOffset;
-    for (unsigned i = 0; i < nextToLastLine; ++i)
-        m_rowPositions[i + 1] = m_rowPositions[i] + offset.distributionOffset + sizingData.rowTracks[i].baseSize() + trackGap;
-    m_rowPositions[lastLine] = m_rowPositions[nextToLastLine] + sizingData.rowTracks[nextToLastLine].baseSize();
-    m_offsetBetweenRows = offset.distributionOffset;
+    bool isRowAxis = direction == ForColumns;
+    auto& tracks = isRowAxis ? sizingData.columnTracks : sizingData.rowTracks;
+    size_t numberOfTracks = tracks.size();
+    size_t numberOfLines = numberOfTracks + 1;
+    size_t lastLine = numberOfLines - 1;
+    size_t nextToLastLine = numberOfLines - 2;
+    ContentAlignmentData offset = computeContentPositionAndDistributionOffset(direction, sizingData.freeSpaceForDirection(direction), numberOfTracks);
+    LayoutUnit trackGap = guttersSize(direction, 2);
+    auto& positions = isRowAxis ? m_columnPositions : m_rowPositions;
+    positions.resize(numberOfLines);
+    auto borderAndPadding = isRowAxis ? borderAndPaddingLogicalLeft() : borderAndPaddingBefore();
+    positions[0] = borderAndPadding + offset.positionOffset;
+    for (size_t i = 0; i < nextToLastLine; ++i)
+        positions[i + 1] = positions[i] + offset.distributionOffset + tracks[i].baseSize() + trackGap;
+    positions[lastLine] = positions[nextToLastLine] + tracks[nextToLastLine].baseSize();
+    auto& offsetBetweenTracks = isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows;
+    offsetBetweenTracks = offset.distributionOffset;
 }
 
 static LayoutUnit computeOverflowAlignmentOffset(OverflowAlignment overflow, LayoutUnit trackBreadth, LayoutUnit childBreadth)
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.h b/third_party/WebKit/Source/core/layout/LayoutGrid.h
index f1b8b66..b566d0c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.h
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.h
@@ -147,7 +147,7 @@
     void prepareChildForPositionedLayout(LayoutBox&);
     void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout);
     void offsetAndBreadthForPositionedChild(const LayoutBox&, GridTrackSizingDirection, LayoutUnit& offset, LayoutUnit& breadth);
-    void populateGridPositions(GridSizingData&);
+    void populateGridPositionsForDirection(GridSizingData&, GridTrackSizingDirection);
 
     typedef struct GridItemsSpanGroupRange GridItemsSpanGroupRange;
     LayoutUnit currentItemSizeForTrackSizeComputationPhase(TrackSizeComputationPhase, LayoutBox&, GridTrackSizingDirection, GridSizingData&);
diff --git a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
index b6bc794..f8a4e3a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
@@ -78,7 +78,7 @@
 
         LayoutBox* layoutBox = toLayoutBox(child);
         layoutBox->setLocation(newRect.location());
-        // TODO(philipj): Remove the mutableStyleRef() and depend on CSS
+        // TODO(foolip): Remove the mutableStyleRef() and depend on CSS
         // width/height: inherit to match the media element size.
         layoutBox->mutableStyleRef().setHeight(Length(newRect.height(), Fixed));
         layoutBox->mutableStyleRef().setWidth(Length(newRect.width(), Fixed));
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index d617c11c7..1b5a5a6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -81,6 +81,7 @@
 #include "core/paint/PaintInfo.h"
 #include "core/paint/PaintLayer.h"
 #include "core/style/ContentData.h"
+#include "core/style/CursorData.h"
 #include "core/style/ShadowList.h"
 #include "platform/HostWindow.h"
 #include "platform/RuntimeEnabledFeatures.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 46d9cf3c..846391e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -29,12 +29,8 @@
 #include "core/CoreExport.h"
 #include "core/dom/Document.h"
 #include "core/dom/DocumentLifecycle.h"
-#include "core/dom/Element.h"
 #include "core/editing/PositionWithAffinity.h"
 #include "core/fetch/ImageResourceObserver.h"
-#include "core/html/HTMLElement.h"
-#include "core/inspector/InspectorTraceEvents.h"
-#include "core/layout/HitTestRequest.h"
 #include "core/layout/LayoutObjectChildList.h"
 #include "core/layout/PaintInvalidationState.h"
 #include "core/layout/ScrollAlignment.h"
@@ -42,9 +38,7 @@
 #include "core/layout/api/HitTestAction.h"
 #include "core/layout/api/SelectionState.h"
 #include "core/layout/compositing/CompositingState.h"
-#include "core/layout/compositing/CompositingTriggers.h"
 #include "core/style/ComputedStyle.h"
-#include "core/style/StyleInheritedData.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/LayoutRect.h"
 #include "platform/graphics/CompositingReasons.h"
@@ -56,8 +50,8 @@
 
 class AffineTransform;
 class Cursor;
-class Document;
 class HitTestLocation;
+class HitTestRequest;
 class HitTestResult;
 class InlineBox;
 class LayoutBoxModelObject;
diff --git a/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp b/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
index f07ea44..4a0d70e3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutSliderContainer.cpp
@@ -36,7 +36,6 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/html/shadow/SliderThumbElement.h"
-#include "core/layout/LayoutFlexibleBox.h"
 #include "core/layout/LayoutSlider.h"
 #include "core/layout/LayoutTheme.h"
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMobile.cpp b/third_party/WebKit/Source/core/layout/LayoutThemeMobile.cpp
index ed6b6b8f..5169a1f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutThemeMobile.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutThemeMobile.cpp
@@ -28,7 +28,6 @@
 #include "core/CSSValueKeywords.h"
 #include "core/InputTypeNames.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/LayoutSlider.h"
 #include "platform/LayoutTestSupport.h"
 #include "platform/PlatformResourceLoader.h"
 #include "platform/graphics/Color.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 85719079..46c2cfd 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -35,7 +35,6 @@
 #include "core/layout/LayoutMedia.h"
 #include "core/layout/LayoutPart.h"
 #include "core/layout/LayoutQuote.h"
-#include "core/layout/LayoutScrollbarPart.h"
 #include "core/layout/ViewFragmentationContext.h"
 #include "core/layout/compositing/PaintLayerCompositor.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
index 6459fe8..0265282 100644
--- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
+++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
@@ -27,7 +27,7 @@
 
 [
     DoNotCheckConstants,
-    // TODO(philipj): Exposed=(Window,SharedWorker)
+    // TODO(foolip): Exposed=(Window,SharedWorker)
 ] interface ApplicationCache : EventTarget {
     // update status
     const unsigned short UNCACHED = 0;
diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h
index b9063e6..aca6905 100644
--- a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h
+++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h
@@ -5,14 +5,17 @@
 #ifndef SnapCoordinator_h
 #define SnapCoordinator_h
 
-#include "core/layout/LayoutBox.h"
+#include "core/CoreExport.h"
+#include "core/css/CSSPrimitiveValueMappings.h"
 #include "platform/heap/Handle.h"
 #include "wtf/Vector.h"
 
 namespace blink {
 
 class ComputedStyle;
+class ContainerNode;
 class Element;
+class LayoutBox;
 struct LengthPoint;
 
 // Snap Coordinator keeps track of snap containers and all of their associated
diff --git a/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp b/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
index 78113f9d..3c1123e 100644
--- a/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
@@ -7,6 +7,7 @@
 #include "core/paint/BoxPainter.h"
 #include "core/paint/PaintInfo.h"
 #include "core/style/BorderEdge.h"
+#include "core/style/ComputedStyle.h"
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsContextStateSaver.h"
diff --git a/third_party/WebKit/Source/core/paint/BoxBorderPainter.h b/third_party/WebKit/Source/core/paint/BoxBorderPainter.h
index 9103b61..cf163379 100644
--- a/third_party/WebKit/Source/core/paint/BoxBorderPainter.h
+++ b/third_party/WebKit/Source/core/paint/BoxBorderPainter.h
@@ -5,18 +5,21 @@
 #ifndef BoxBorderPainter_h
 #define BoxBorderPainter_h
 
-#include "core/layout/LayoutBoxModelObject.h"
+#include "core/layout/BackgroundBleedAvoidance.h"
 #include "core/style/BorderEdge.h"
 #include "platform/geometry/FloatRoundedRect.h"
-#include "platform/heap/Heap.h"
 
 namespace blink {
 
 class ComputedStyle;
+class GraphicsContext;
 class IntRect;
 class LayoutBox;
 class LayoutRect;
 struct PaintInfo;
+class Path;
+
+typedef unsigned BorderEdgeFlags;
 
 class BoxBorderPainter {
     STACK_ALLOCATED();
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.h b/third_party/WebKit/Source/core/paint/BoxPainter.h
index 7ba1303..47c8b90c 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.h
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.h
@@ -7,6 +7,7 @@
 
 #include "core/layout/LayoutBoxModelObject.h"
 #include "core/paint/ObjectPainter.h"
+#include "core/style/ShadowData.h"
 #include "wtf/Allocator.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 0c2035c..066bd02 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -62,7 +62,6 @@
 #include "core/layout/LayoutPart.h"
 #include "core/layout/LayoutReplica.h"
 #include "core/layout/LayoutScrollbar.h"
-#include "core/layout/LayoutScrollbarPart.h"
 #include "core/layout/LayoutTreeAsText.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/compositing/CompositedLayerMapping.h"
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 71680c8..09e6023 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -22,6 +22,8 @@
 
 #include "core/style/ComputedStyle.h"
 
+#include "core/animation/css/CSSAnimationData.h"
+#include "core/animation/css/CSSTransitionData.h"
 #include "core/css/CSSPaintValue.h"
 #include "core/css/CSSPropertyEquality.h"
 #include "core/css/resolver/StyleResolver.h"
@@ -32,6 +34,7 @@
 #include "core/style/ContentData.h"
 #include "core/style/DataEquivalency.h"
 #include "core/style/ComputedStyleConstants.h"
+#include "core/style/CursorData.h"
 #include "core/style/QuotesData.h"
 #include "core/style/ShadowList.h"
 #include "core/style/StyleImage.h"
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 929b742..83609724 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -27,8 +27,6 @@
 
 #include "core/CSSPropertyNames.h"
 #include "core/CoreExport.h"
-#include "core/animation/css/CSSAnimationData.h"
-#include "core/animation/css/CSSTransitionData.h"
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/style/BorderValue.h"
 #include "core/style/CounterDirectives.h"
@@ -36,9 +34,7 @@
 #include "core/style/ComputedStyleConstants.h"
 #include "core/style/LineClampValue.h"
 #include "core/style/NinePieceImage.h"
-#include "core/style/OutlineValue.h"
 #include "core/style/SVGComputedStyle.h"
-#include "core/style/ShapeValue.h"
 #include "core/style/StyleBackgroundData.h"
 #include "core/style/StyleBoxData.h"
 #include "core/style/StyleContentAlignmentData.h"
@@ -54,7 +50,6 @@
 #include "core/style/StyleRareInheritedData.h"
 #include "core/style/StyleRareNonInheritedData.h"
 #include "core/style/StyleReflection.h"
-#include "core/style/StyleScrollSnapData.h"
 #include "core/style/StyleSelfAlignmentData.h"
 #include "core/style/StyleSurroundData.h"
 #include "core/style/StyleTransformData.h"
@@ -66,22 +61,18 @@
 #include "platform/LengthPoint.h"
 #include "platform/LengthSize.h"
 #include "platform/ThemeTypes.h"
-#include "platform/fonts/FontBaseline.h"
 #include "platform/fonts/FontDescription.h"
 #include "platform/geometry/FloatRoundedRect.h"
 #include "platform/geometry/LayoutRectOutsets.h"
 #include "platform/graphics/Color.h"
-#include "platform/graphics/GraphicsTypes.h"
 #include "platform/scroll/ScrollableArea.h"
 #include "platform/text/TextDirection.h"
-#include "platform/text/TextRun.h"
 #include "platform/text/UnicodeBidi.h"
 #include "platform/transforms/TransformOperations.h"
 #include "wtf/Forward.h"
 #include "wtf/LeakAnnotations.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/RefCounted.h"
-#include "wtf/StdLibExtras.h"
 #include "wtf/Vector.h"
 
 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
@@ -111,12 +102,15 @@
 class AppliedTextDecoration;
 class BorderData;
 struct BorderEdge;
+class CSSAnimationData;
+class CSSTransitionData;
 class CSSVariableData;
 class Font;
 class FontMetrics;
 class RotateTransformOperation;
 class ScaleTransformOperation;
 class ShadowList;
+class ShapeValue;
 class StyleImage;
 class StyleInheritedData;
 class StylePath;
diff --git a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
index 69facab3..1e63714f 100644
--- a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
@@ -25,7 +25,6 @@
 
 #include "core/css/CSSImageGeneratorValue.h"
 #include "core/css/resolver/StyleResolver.h"
-#include "core/layout/LayoutObject.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/style/StyleInheritedData.h b/third_party/WebKit/Source/core/style/StyleInheritedData.h
index 4e3fbb4..81e6680 100644
--- a/third_party/WebKit/Source/core/style/StyleInheritedData.h
+++ b/third_party/WebKit/Source/core/style/StyleInheritedData.h
@@ -31,7 +31,6 @@
 #include "platform/graphics/Color.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/style/StyleMultiColData.h b/third_party/WebKit/Source/core/style/StyleMultiColData.h
index a81b03f..61493f1e 100644
--- a/third_party/WebKit/Source/core/style/StyleMultiColData.h
+++ b/third_party/WebKit/Source/core/style/StyleMultiColData.h
@@ -27,7 +27,6 @@
 
 #include "core/style/BorderValue.h"
 #include "core/style/ComputedStyleConstants.h"
-#include "platform/Length.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 
diff --git a/third_party/WebKit/Source/core/style/StyleRareInheritedData.h b/third_party/WebKit/Source/core/style/StyleRareInheritedData.h
index 796c670..a319cc6bf 100644
--- a/third_party/WebKit/Source/core/style/StyleRareInheritedData.h
+++ b/third_party/WebKit/Source/core/style/StyleRareInheritedData.h
@@ -27,7 +27,6 @@
 
 #include "core/CoreExport.h"
 #include "core/css/StyleColor.h"
-#include "core/style/DataRef.h"
 #include "platform/Length.h"
 #include "platform/graphics/Color.h"
 #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp
index 2cb5c1a..e9e60c9e 100644
--- a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp
+++ b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp
@@ -21,6 +21,8 @@
 
 #include "core/style/StyleRareNonInheritedData.h"
 
+#include "core/animation/css/CSSAnimationData.h"
+#include "core/animation/css/CSSTransitionData.h"
 #include "core/style/ContentData.h"
 #include "core/style/DataEquivalency.h"
 #include "core/style/ComputedStyle.h"
diff --git a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h
index 5555c86..5f6563a7 100644
--- a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h
+++ b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h
@@ -28,9 +28,7 @@
 #include "core/CoreExport.h"
 #include "core/css/StyleColor.h"
 #include "core/layout/ClipPathOperation.h"
-#include "core/style/BasicShapes.h"
 #include "core/style/CounterDirectives.h"
-#include "core/style/CursorData.h"
 #include "core/style/DataPersistent.h"
 #include "core/style/DataRef.h"
 #include "core/style/FillLayer.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
index 1d63484..f758ed80 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
@@ -28,7 +28,7 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
 ] interface SVGAnimatedRect {
-    // TODO(philipj): SVGRect should be DOMRectReadOnly.
+    // TODO(foolip): SVGRect should be DOMRectReadOnly.
     readonly attribute SVGRect baseVal;
     readonly attribute SVGRect animVal;
 };
diff --git a/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl b/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl
index 543feac1..0f4ba1b3 100644
--- a/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl
@@ -26,7 +26,7 @@
 
 // http://www.w3.org/TR/css-masking/#InterfaceSVGClipPathElement
 
-// TODO(philipj): SVGClipPathElement should inherit from SVGElement and
+// TODO(foolip): SVGClipPathElement should inherit from SVGElement and
 // implement SVGUnitTypes. The transform attribute (which is on
 // SVGGraphicsElement) should also be on SVGClipPathElement.
 interface SVGClipPathElement : SVGGraphicsElement {
diff --git a/third_party/WebKit/Source/core/svg/SVGCursorElement.idl b/third_party/WebKit/Source/core/svg/SVGCursorElement.idl
index d61be40..c8dee77a 100644
--- a/third_party/WebKit/Source/core/svg/SVGCursorElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGCursorElement.idl
@@ -32,6 +32,6 @@
 
 SVGCursorElement implements SVGURIReference;
 
-// TODO(philipj): The following was part of SVG 1.1:
+// TODO(foolip): The following was part of SVG 1.1:
 // http://www.w3.org/TR/SVG11/interact.html#InterfaceSVGCursorElement
 SVGCursorElement implements SVGTests;
diff --git a/third_party/WebKit/Source/core/svg/SVGDiscardElement.idl b/third_party/WebKit/Source/core/svg/SVGDiscardElement.idl
index 72b8939..7e91219 100644
--- a/third_party/WebKit/Source/core/svg/SVGDiscardElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGDiscardElement.idl
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): The SVGDiscardElement interface does not exist in the spec
+// TODO(foolip): The SVGDiscardElement interface does not exist in the spec
 // yet: http://www.w3.org/Graphics/SVG/WG/track/actions/3727
 
 [RuntimeEnabled=smil]
diff --git a/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl b/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl
index 0c9edfd8..7114c72f 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl
@@ -46,7 +46,7 @@
     [MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
     [MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
 
-    // TODO(philipj): The following was part of SVG 1.1:
+    // TODO(foolip): The following was part of SVG 1.1:
     // http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFEConvolveMatrixElement
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=28703
     [Measure] readonly attribute SVGAnimatedBoolean preserveAlpha;
diff --git a/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl b/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl
index 8f1619af..0977d57 100644
--- a/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl
@@ -31,7 +31,7 @@
 // http://www.w3.org/TR/SVG2/types.html#InterfaceSVGGeometryElement
 
 interface SVGGeometryElement : SVGGraphicsElement {
-    // TODO(philipj): SVGPoint should be DOMPoint.
+    // TODO(foolip): SVGPoint should be DOMPoint.
     boolean isPointInFill(SVGPoint point);
     boolean isPointInStroke(SVGPoint point);
 };
diff --git a/third_party/WebKit/Source/core/svg/SVGMaskElement.idl b/third_party/WebKit/Source/core/svg/SVGMaskElement.idl
index 0045a16..92a630a5c 100644
--- a/third_party/WebKit/Source/core/svg/SVGMaskElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGMaskElement.idl
@@ -36,5 +36,5 @@
 
 // SVGMaskElement implements SVGUnitTypes;
 
-// TODO(philipj): The following is not part of any spec:
+// TODO(foolip): The following is not part of any spec:
 SVGMaskElement implements SVGTests;
diff --git a/third_party/WebKit/Source/core/svg/SVGMatrix.idl b/third_party/WebKit/Source/core/svg/SVGMatrix.idl
index 8d0d7e4..6048a9ee 100644
--- a/third_party/WebKit/Source/core/svg/SVGMatrix.idl
+++ b/third_party/WebKit/Source/core/svg/SVGMatrix.idl
@@ -22,7 +22,7 @@
 
 // http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix
 
-// TODO(philipj): SVGMatrix is gone from SVG 2, replaced by DOMMatrix.
+// TODO(foolip): SVGMatrix is gone from SVG 2, replaced by DOMMatrix.
 [
     ImplementedAs=SVGMatrixTearOff,
     SetWrapperReferenceTo(SVGTransform contextTransform),
diff --git a/third_party/WebKit/Source/core/svg/SVGPathElement.idl b/third_party/WebKit/Source/core/svg/SVGPathElement.idl
index c5bb32f2..4b0d41a 100644
--- a/third_party/WebKit/Source/core/svg/SVGPathElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPathElement.idl
@@ -30,7 +30,7 @@
     [Measure] readonly attribute SVGAnimatedNumber pathLength;
 
     float getTotalLength();
-    // TODO(philipj): SVGPoint should be DOMPoint.
+    // TODO(foolip): SVGPoint should be DOMPoint.
     SVGPoint getPointAtLength(float distance);
     unsigned long getPathSegAtLength(float distance);
 };
diff --git a/third_party/WebKit/Source/core/svg/SVGPatternElement.idl b/third_party/WebKit/Source/core/svg/SVGPatternElement.idl
index 76fd7bf..67f4976 100644
--- a/third_party/WebKit/Source/core/svg/SVGPatternElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPatternElement.idl
@@ -39,6 +39,6 @@
 SVGPatternElement implements SVGURIReference;
 // SVGPatternElement implements SVGUnitTypes;
 
-// TODO(philipj): The following was part of SVG 1.1:
+// TODO(foolip): The following was part of SVG 1.1:
 // http://www.w3.org/TR/SVG11/pservers.html#InterfaceSVGPatternElement
 SVGPatternElement implements SVGTests;
diff --git a/third_party/WebKit/Source/core/svg/SVGPoint.idl b/third_party/WebKit/Source/core/svg/SVGPoint.idl
index 8bb8b45..ddb46d3 100644
--- a/third_party/WebKit/Source/core/svg/SVGPoint.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPoint.idl
@@ -22,7 +22,7 @@
 
 // http://www.w3.org/TR/SVG11/coords.html#InterfaceSVGPoint
 
-// TODO(philipj): SVGPoint is gone from SVG 2, replaced by DOMPoint.
+// TODO(foolip): SVGPoint is gone from SVG 2, replaced by DOMPoint.
 [
     ImplementedAs=SVGPointTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
diff --git a/third_party/WebKit/Source/core/svg/SVGPointList.idl b/third_party/WebKit/Source/core/svg/SVGPointList.idl
index e8f69dbf..bed84f8 100644
--- a/third_party/WebKit/Source/core/svg/SVGPointList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPointList.idl
@@ -33,7 +33,7 @@
     [ImplementedAs=length] readonly attribute unsigned long numberOfItems;
 
     [RaisesException] void clear();
-    // TODO(philipj): SVGPoint should be DOMPoint.
+    // TODO(foolip): SVGPoint should be DOMPoint.
     [RaisesException] SVGPoint initialize(SVGPoint newItem);
     [RaisesException] getter SVGPoint getItem(unsigned long index);
     [RaisesException] SVGPoint insertItemBefore(SVGPoint newItem, unsigned long index);
diff --git a/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl b/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl
index 75e87c3..c78312f 100644
--- a/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl
@@ -26,7 +26,7 @@
 // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolygonElement
 
 interface SVGPolygonElement : SVGGeometryElement {
-    // TODO(philipj): points and animatedPoints be on the SVGAnimatedPoints
+    // TODO(foolip): points and animatedPoints be on the SVGAnimatedPoints
     // interface which SVGPolygonElement should implement:
     // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
     [MeasureAs=SVG1DOMShape, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
diff --git a/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl b/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl
index fae6f4e..7e57bdf 100644
--- a/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl
@@ -26,7 +26,7 @@
 // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGPolylineElement
 
 interface SVGPolylineElement : SVGGeometryElement {
-    // TODO(philipj): points and animatedPoints should be on the
+    // TODO(foolip): points and animatedPoints should be on the
     // SVGAnimatedPoints interface which SVGPolylineElement should implement:
     // http://www.w3.org/TR/SVG2/shapes.html#InterfaceSVGAnimatedPoints
     [MeasureAs=SVG1DOMShape, ImplementedAs=pointsFromJavascript] readonly attribute SVGPointList points;
diff --git a/third_party/WebKit/Source/core/svg/SVGRect.idl b/third_party/WebKit/Source/core/svg/SVGRect.idl
index 244bd33a..b416da5 100644
--- a/third_party/WebKit/Source/core/svg/SVGRect.idl
+++ b/third_party/WebKit/Source/core/svg/SVGRect.idl
@@ -22,7 +22,7 @@
 
 // http://www.w3.org/TR/SVG11/types.html#InterfaceSVGRect
 
-// TODO(philipj): SVGRect is gone from SVG 2, replaced by DOMRect.
+// TODO(foolip): SVGRect is gone from SVG 2, replaced by DOMRect.
 [
     ImplementedAs=SVGRectTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.idl b/third_party/WebKit/Source/core/svg/SVGSVGElement.idl
index b05a259..cf6a094c 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.idl
@@ -27,14 +27,14 @@
     [MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength y;
     [MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength width;
     [MeasureAs=SVG1DOMSVGElement] readonly attribute SVGAnimatedLength height;
-    // TODO(philipj): viewport should be a DOMRectReadOnly.
+    // TODO(foolip): viewport should be a DOMRectReadOnly.
     [Measure] readonly attribute SVGRect viewport;
-    // TODO(philipj): useCurrentView and currentView have been removed:
+    // TODO(foolip): useCurrentView and currentView have been removed:
     // https://github.com/w3c/svgwg/commit/4c26fd36937a65192024208d85c144a21071b057
     [Measure] readonly attribute boolean useCurrentView;
     [Measure] readonly attribute SVGViewSpec currentView;
              attribute float currentScale;
-    // TODO(philipj): currentTranslate should be a DOMPointReadOnly.
+    // TODO(foolip): currentTranslate should be a DOMPointReadOnly.
     [ImplementedAs=currentTranslateFromJavascript] readonly attribute SVGPoint currentTranslate;
 
     [MeasureAs=SVGSVGElementSuspendRedraw] unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
@@ -48,7 +48,7 @@
     [RuntimeEnabled=smil] float getCurrentTime();
     [RuntimeEnabled=smil] void setCurrentTime(float seconds);
 
-    // TODO(philipj): The rect arguments should be DOMRectReadOnly.
+    // TODO(foolip): The rect arguments should be DOMRectReadOnly.
     NodeList getIntersectionList(SVGRect rect, SVGElement? referenceElement);
     NodeList getEnclosureList(SVGRect rect, SVGElement? referenceElement);
     boolean checkIntersection(SVGElement element, SVGRect rect);
@@ -57,14 +57,14 @@
     [Measure] SVGNumber createSVGNumber();
     [Measure] SVGLength createSVGLength();
     [Measure] SVGAngle createSVGAngle();
-    // TODO(philipj): SVGPoint/Matrix/Rect should be DOMPoint/Matrix/Rect.
+    // TODO(foolip): SVGPoint/Matrix/Rect should be DOMPoint/Matrix/Rect.
     [Measure] SVGPoint createSVGPoint();
     [Measure] SVGMatrix createSVGMatrix();
     [Measure] SVGRect createSVGRect();
     [Measure] SVGTransform createSVGTransform();
     [Measure] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
 
-    // TODO(philipj): The following was part of SVG 1.1:
+    // TODO(foolip): The following was part of SVG 1.1:
     // http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
     [Measure] Element getElementById(DOMString elementId);
 };
diff --git a/third_party/WebKit/Source/core/svg/SVGStyleElement.idl b/third_party/WebKit/Source/core/svg/SVGStyleElement.idl
index afd2a331..7c41dfe 100644
--- a/third_party/WebKit/Source/core/svg/SVGStyleElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGStyleElement.idl
@@ -35,7 +35,7 @@
     // http://dev.w3.org/csswg/cssom/#the-linkstyle-interface
     readonly attribute StyleSheet? sheet;
 
-    // TODO(philipj): The disabled attribute was not in SVG 1.1 and has been
+    // TODO(foolip): The disabled attribute was not in SVG 1.1 and has been
     // removed from HTMLLinkElement and HTMLStyleElement in the HTML spec:
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
     [Measure] attribute boolean disabled;
diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
index 8dce9a7..1ec25c5b 100644
--- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
@@ -30,8 +30,6 @@
 #include "core/editing/FrameSelection.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/UseCounter.h"
-#include "core/layout/LayoutObject.h"
-#include "core/layout/api/LineLayoutAPIShim.h"
 #include "core/layout/svg/SVGTextQuery.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl b/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl
index 77a7baa..b2cc96f 100644
--- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl
+++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl
@@ -37,7 +37,7 @@
     long getNumberOfChars();
     float getComputedTextLength();
     [RaisesException] float getSubStringLength(unsigned long charnum, unsigned long nchars);
-    // TODO(philipj): SVGPoint/SVGRect should be DOMPoint/DOMRect.
+    // TODO(foolip): SVGPoint/SVGRect should be DOMPoint/DOMRect.
     [RaisesException] SVGPoint getStartPositionOfChar(unsigned long charnum);
     [RaisesException] SVGPoint getEndPositionOfChar(unsigned long charnum);
     [RaisesException] SVGRect getExtentOfChar(unsigned long charnum);
diff --git a/third_party/WebKit/Source/core/svg/SVGTransform.idl b/third_party/WebKit/Source/core/svg/SVGTransform.idl
index 2c6d31b0..43f113a 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransform.idl
+++ b/third_party/WebKit/Source/core/svg/SVGTransform.idl
@@ -35,7 +35,7 @@
     const unsigned short SVG_TRANSFORM_SKEWY = 6;
 
     [ImplementedAs=transformType] readonly attribute unsigned short type;
-    // TODO(philipj): SVGMatrix should be DOMMatrixReadOnly.
+    // TODO(foolip): SVGMatrix should be DOMMatrixReadOnly.
     readonly attribute SVGMatrix matrix;
     readonly attribute float angle;
 
diff --git a/third_party/WebKit/Source/core/svg/SVGTransformList.idl b/third_party/WebKit/Source/core/svg/SVGTransformList.idl
index 6101794..8f287647 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransformList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGTransformList.idl
@@ -40,7 +40,7 @@
     [RaisesException] SVGTransform replaceItem(SVGTransform newItem, unsigned long index);
     [RaisesException] SVGTransform removeItem(unsigned long index);
     [RaisesException] SVGTransform appendItem(SVGTransform newItem);
-    // TODO(philipj): SVGMatrix should be DOMMatrix.
+    // TODO(foolip): SVGMatrix should be DOMMatrix.
     SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
     [RaisesException, MeasureAs=SVGTransformListConsolidate] SVGTransform? consolidate();
     [RaisesException] setter void (unsigned long index, SVGTransform newItem);
diff --git a/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl b/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl
index ca6ee412..85fa751 100644
--- a/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl
+++ b/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl
@@ -28,7 +28,7 @@
 [
     DependentLifetime,
 ] interface SVGZoomEvent : UIEvent {
-    // TODO(philipj): SVGRect/SVGPoint should be DOMRectReadOnly/DOMPointReadOnly.
+    // TODO(foolip): SVGRect/SVGPoint should be DOMRectReadOnly/DOMPointReadOnly.
     readonly attribute SVGRect zoomRectScreen;
     readonly attribute float previousScale;
     readonly attribute SVGPoint previousTranslate;
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 525ee8c..28a3b54 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -406,14 +406,6 @@
     rootElement->unpauseAnimations();
 }
 
-void SVGImage::stopAnimation()
-{
-    SVGSVGElement* rootElement = svgRootElement(m_page.get());
-    if (!rootElement)
-        return;
-    rootElement->pauseAnimations();
-}
-
 void SVGImage::resetAnimation()
 {
     SVGSVGElement* rootElement = svgRootElement(m_page.get());
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
index ea98cf2..cc30344b 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
@@ -59,7 +59,6 @@
     bool currentFrameHasSingleSecurityOrigin() const override;
 
     void startAnimation(CatchUpAnimation = CatchUp) override;
-    void stopAnimation() override;
     void resetAnimation() override;
 
     // Advances an animated image. This will trigger an animation update for CSS
@@ -99,7 +98,7 @@
 
     // FIXME: SVGImages are underreporting decoded sizes and will be unable
     // to prune because these functions are not implemented yet.
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
 
     // FIXME: Implement this to be less conservative.
     bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h b/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
index 05ea96c..40ba819 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
@@ -68,7 +68,7 @@
     {
     }
 
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
 
     SVGImage* m_image;
     const FloatSize m_containerSize;
diff --git a/third_party/WebKit/Source/core/timing/MemoryInfo.idl b/third_party/WebKit/Source/core/timing/MemoryInfo.idl
index cbe50b5..2af4ab2 100644
--- a/third_party/WebKit/Source/core/timing/MemoryInfo.idl
+++ b/third_party/WebKit/Source/core/timing/MemoryInfo.idl
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+// TODO(foolip): There is no spec for the Memory Info API, see blink-dev:
 // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
 
 [
diff --git a/third_party/WebKit/Source/core/timing/Performance.idl b/third_party/WebKit/Source/core/timing/Performance.idl
index b7341ad..5950cfb6 100644
--- a/third_party/WebKit/Source/core/timing/Performance.idl
+++ b/third_party/WebKit/Source/core/timing/Performance.idl
@@ -31,9 +31,9 @@
 
 // https://w3c.github.io/hr-time/#the-performance-interface
 
-// TODO(philipj): This interface should be [Exposed=(Window,Worker)]. Doing that
+// TODO(foolip): This interface should be [Exposed=(Window,Worker)]. Doing that
 // would allow the WorkerPerformance interface to be merged into this.
-// TODO(philipj): None of the optional DOMString arguments in this interface
+// TODO(foolip): None of the optional DOMString arguments in this interface
 // should have a default value.
 [
 ] interface Performance : EventTarget {
@@ -41,7 +41,7 @@
 
     // Performance Timeline
     // https://w3c.github.io/performance-timeline/#the-performance-interface
-    // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+    // TODO(foolip): getEntries() should take an optional FilterOptions argument.
     [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntries();
     [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByType(DOMString entryType);
     [MeasureAs=UnprefixedPerformanceTimeline] PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
@@ -76,7 +76,7 @@
     [RuntimeEnabled=FrameTimingSupport, MeasureAs=PerformanceFrameTiming] void setFrameTimingBufferSize(unsigned long maxSize);
     [RuntimeEnabled=FrameTimingSupport] attribute EventHandler onframetimingbufferfull;
 
-    // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+    // TODO(foolip): There is no spec for the Memory Info API, see blink-dev:
     // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
     [Measure] readonly attribute MemoryInfo memory;
 };
diff --git a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.idl b/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.idl
index 60eb075..1279af11 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.idl
@@ -33,7 +33,7 @@
 [
     RuntimeEnabled=FrameTimingSupport  // Experimental flag
 ] interface PerformanceCompositeTiming : PerformanceEntry {
-    // TODO(philipj): This is named |sourceFrameNumber| in the spec.
+    // TODO(foolip): This is named |sourceFrameNumber| in the spec.
     readonly attribute unsigned long sourceFrame;
-    // TODO(philipj): serializer = {inherit, attribute};
+    // TODO(foolip): serializer = {inherit, attribute};
 };
diff --git a/third_party/WebKit/Source/core/timing/PerformanceEntry.idl b/third_party/WebKit/Source/core/timing/PerformanceEntry.idl
index abb1b67a..72c6101 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceEntry.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceEntry.idl
@@ -31,7 +31,7 @@
 // https://w3c.github.io/performance-timeline/#the-performanceentry-interface
 
 [
-    // TODO(philipj): Exposed=(Window,Worker)
+    // TODO(foolip): Exposed=(Window,Worker)
 ] interface PerformanceEntry {
     readonly attribute DOMString name;
     readonly attribute DOMString entryType;
diff --git a/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl b/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl
index 0819c5b..fa827d7 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl
@@ -39,5 +39,5 @@
     const unsigned short TYPE_RESERVED = 255;
     readonly attribute unsigned short type;
     readonly attribute unsigned short redirectCount;
-    // TODO(philipj): serializer = {attribute};
+    // TODO(foolip): serializer = {attribute};
 };
diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserverEntryList.idl b/third_party/WebKit/Source/core/timing/PerformanceObserverEntryList.idl
index 0974971..d0f58ac 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceObserverEntryList.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceObserverEntryList.idl
@@ -8,7 +8,7 @@
     RuntimeEnabled=PerformanceObserver,
     Exposed=(Window,Worker),
 ] interface PerformanceObserverEntryList {
-    // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+    // TODO(foolip): getEntries() should take an optional FilterOptions argument.
     sequence<PerformanceEntry> getEntries();
     sequence<PerformanceEntry> getEntriesByType(DOMString entryType);
     sequence<PerformanceEntry> getEntriesByName(DOMString name, optional DOMString entryType = null);
diff --git a/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.idl b/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.idl
index eafd490..50d5894 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.idl
@@ -33,7 +33,7 @@
 [
     RuntimeEnabled=FrameTimingSupport  // Experimental flag
 ] interface PerformanceRenderTiming : PerformanceEntry {
-    // TODO(philipj): This is named |sourceFrameNumber| in the spec.
+    // TODO(foolip): This is named |sourceFrameNumber| in the spec.
     readonly attribute unsigned long sourceFrame;
-    // TODO(philipj): serializer = {inherit, attribute};
+    // TODO(foolip): serializer = {inherit, attribute};
 };
diff --git a/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl b/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl
index 2369022..3dfd18e 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl
+++ b/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl
@@ -30,10 +30,10 @@
 
 // https://w3c.github.io/resource-timing/#performanceresourcetiming
 
-// TODO(philipj): This interface should be [Exposed=(Window,Worker)].
+// TODO(foolip): This interface should be [Exposed=(Window,Worker)].
 interface PerformanceResourceTiming : PerformanceEntry {
     readonly attribute DOMString initiatorType;
-    // TODO(philipj): readonly attribute DOMString nextHopProtocol;
+    // TODO(foolip): readonly attribute DOMString nextHopProtocol;
     readonly attribute DOMHighResTimeStamp workerStart;
     readonly attribute DOMHighResTimeStamp redirectStart;
     readonly attribute DOMHighResTimeStamp redirectEnd;
@@ -46,7 +46,7 @@
     readonly attribute DOMHighResTimeStamp requestStart;
     readonly attribute DOMHighResTimeStamp responseStart;
     readonly attribute DOMHighResTimeStamp responseEnd;
-    // TODO(philipj): The spec has tranferSize/encodedBodySize/decodedBodySize
+    // TODO(foolip): The spec has tranferSize/encodedBodySize/decodedBodySize
     // and a serializer:
     // readonly attribute unsigned short transferSize;
     // readonly attribute unsigned short encodedBodySize;
diff --git a/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.idl b/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.idl
index 8010681..eee0102 100644
--- a/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.idl
+++ b/third_party/WebKit/Source/core/timing/SharedWorkerPerformance.idl
@@ -27,7 +27,7 @@
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// TODO(philipj): SharedWorker.workerStart was in the High Resolution Time spec,
+// TODO(foolip): SharedWorker.workerStart was in the High Resolution Time spec,
 // but was removed in favor of Performance.translateTime():
 // https://github.com/w3c/hr-time/commit/39aaf81e1ea206fdf0fde4f49604ddd64d4f5b13
 
diff --git a/third_party/WebKit/Source/core/timing/WindowPerformance.idl b/third_party/WebKit/Source/core/timing/WindowPerformance.idl
index 209a4cdc..0cdd4a44 100644
--- a/third_party/WebKit/Source/core/timing/WindowPerformance.idl
+++ b/third_party/WebKit/Source/core/timing/WindowPerformance.idl
@@ -4,7 +4,7 @@
 
 // https://w3c.github.io/hr-time/#the-performance-interface
 
-// TODO(philipj): This should be a GlobalPerformance interface implemented by
+// TODO(foolip): This should be a GlobalPerformance interface implemented by
 // Window and WorkerGlobalScope.
 [
     ImplementedAs=DOMWindowPerformance,
diff --git a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.idl b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.idl
index d283fd88..e15ac7b 100644
--- a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.idl
+++ b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.idl
@@ -30,7 +30,7 @@
 
 // https://w3c.github.io/hr-time/#the-performance-interface
 
-// TODO(philipj): This should be a GlobalPerformance interface implemented by
+// TODO(foolip): This should be a GlobalPerformance interface implemented by
 // Window and WorkerGlobalScope.
 partial interface WorkerGlobalScope {
     readonly attribute WorkerPerformance performance;
diff --git a/third_party/WebKit/Source/core/timing/WorkerPerformance.idl b/third_party/WebKit/Source/core/timing/WorkerPerformance.idl
index 8508394..c362538 100644
--- a/third_party/WebKit/Source/core/timing/WorkerPerformance.idl
+++ b/third_party/WebKit/Source/core/timing/WorkerPerformance.idl
@@ -30,8 +30,8 @@
 
 // https://w3c.github.io/hr-time/#the-performance-interface
 
-// TODO(philipj): This interface should be merged into Performance.
-// TODO(philipj): None of the optional DOMString arguments in this interface
+// TODO(foolip): This interface should be merged into Performance.
+// TODO(foolip): None of the optional DOMString arguments in this interface
 // should have a default value.
 [
     NoInterfaceObject
@@ -40,7 +40,7 @@
 
     // Performance Timeline
     // https://w3c.github.io/performance-timeline/#the-performance-interface
-    // TODO(philipj): getEntries() should take an optional FilterOptions argument.
+    // TODO(foolip): getEntries() should take an optional FilterOptions argument.
     PerformanceEntryList getEntries();
     PerformanceEntryList getEntriesByType(DOMString entryType);
     PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType = null);
@@ -59,7 +59,7 @@
     [RaisesException] void measure(DOMString measureName, optional DOMString startMark = null, optional DOMString endMark = null);
     void clearMeasures(optional DOMString measureName = null);
 
-    // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+    // TODO(foolip): There is no spec for the Memory Info API, see blink-dev:
     // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
     [RuntimeEnabled=MemoryInfoInWorkers] readonly attribute MemoryInfo memory;
 };
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.idl b/third_party/WebKit/Source/core/workers/SharedWorker.idl
index 1dc1347..84ae8fba 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorker.idl
+++ b/third_party/WebKit/Source/core/workers/SharedWorker.idl
@@ -33,11 +33,11 @@
 
 [
     ActiveScriptWrappable,
-    // TODO(philipj): The name argument should not have a default null value.
+    // TODO(foolip): The name argument should not have a default null value.
     Constructor(DOMString scriptURL, optional DOMString name = null),
     ConstructorCallWith=ExecutionContext,
     DependentLifetime,
-    // TODO(philipj): Exposed=(Window,Worker),
+    // TODO(foolip): Exposed=(Window,Worker),
     RaisesException=Constructor,
     RuntimeEnabled=SharedWorker,
 ] interface SharedWorker : EventTarget {
diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
index f8c2a51..66e9eef6 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
@@ -35,7 +35,7 @@
     Exposed=SharedWorker,
 ] interface SharedWorkerGlobalScope : WorkerGlobalScope {
     readonly attribute DOMString name;
-    // TODO(philipj): readonly attribute ApplicationCache applicationCache;
+    // TODO(foolip): readonly attribute ApplicationCache applicationCache;
 
     void close();
 
diff --git a/third_party/WebKit/Source/core/workers/Worker.idl b/third_party/WebKit/Source/core/workers/Worker.idl
index 3955d0c..bfff2d9 100644
--- a/third_party/WebKit/Source/core/workers/Worker.idl
+++ b/third_party/WebKit/Source/core/workers/Worker.idl
@@ -32,12 +32,12 @@
     DependentLifetime,
     Constructor(DOMString scriptUrl),
     ConstructorCallWith=ExecutionContext,
-    // TODO(philipj): Exposed=(Window,Worker),
+    // TODO(foolip): Exposed=(Window,Worker),
     RaisesException=Constructor,
 ] interface Worker : EventTarget {
     void terminate();
 
-    // TODO(philipj): The SerializedScriptValue type should be any.
+    // TODO(foolip): The SerializedScriptValue type should be any.
     [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
     attribute EventHandler onmessage;
 };
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
index 4554a14..3cc18b3 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
@@ -32,7 +32,7 @@
     readonly attribute WorkerGlobalScope self;
     readonly attribute WorkerLocation location;
 
-    // TODO(philipj): onerror should be an OnErrorEventHandler.
+    // TODO(foolip): onerror should be an OnErrorEventHandler.
     attribute EventHandler onerror;
     // attribute EventHandler onlanguagechange;
     // attribute EventHandler onoffline;
diff --git a/third_party/WebKit/Source/core/workers/WorkerNavigator.idl b/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
index 092bc1f..d73eec48 100644
--- a/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
@@ -35,5 +35,5 @@
 
 WorkerNavigator implements NavigatorCPU;
 WorkerNavigator implements NavigatorID;
-// TODO(philipj): WorkerNavigator implements NavigatorLanguage;
+// TODO(foolip): WorkerNavigator implements NavigatorLanguage;
 WorkerNavigator implements NavigatorOnLine;
diff --git a/third_party/WebKit/Source/core/xml/XPathNSResolver.idl b/third_party/WebKit/Source/core/xml/XPathNSResolver.idl
index 8f71a31..cb45d03 100644
--- a/third_party/WebKit/Source/core/xml/XPathNSResolver.idl
+++ b/third_party/WebKit/Source/core/xml/XPathNSResolver.idl
@@ -20,7 +20,7 @@
 
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
 
-// TODO(philipj): XPathNSResolver should be a callback interface. The spec
+// TODO(foolip): XPathNSResolver should be a callback interface. The spec
 // doesn't say so, but doing so would allow the custom bindings to be removed.
 // createNSResolver(Node nodeResolver) could simply return its argument, which
 // is what Gecko does. crbug.com/345529
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessor.idl b/third_party/WebKit/Source/core/xml/XSLTProcessor.idl
index 5fa1516..23ea6587 100644
--- a/third_party/WebKit/Source/core/xml/XSLTProcessor.idl
+++ b/third_party/WebKit/Source/core/xml/XSLTProcessor.idl
@@ -38,12 +38,12 @@
 ] interface XSLTProcessor {
 
     void importStylesheet(Node style);
-    // TODO(philipj): In Gecko, the transformTo*() methods throw an exception in
+    // TODO(foolip): In Gecko, the transformTo*() methods throw an exception in
     // case of error instead of returning null.
     [CustomElementCallbacks] DocumentFragment? transformToFragment(Node source, Document output);
     [CustomElementCallbacks] Document? transformToDocument(Node source);
 
-    // TODO(philipj): In Gecko, it's possible to set and get back any parameter
+    // TODO(foolip): In Gecko, it's possible to set and get back any parameter
     // value, not just DOMString.
     void setParameter(DOMString? namespaceURI, DOMString localName, DOMString value);
     DOMString? getParameter(DOMString? namespaceURI, DOMString localName);
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
index 9fe557c..3ac91db 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
@@ -38,7 +38,7 @@
     "legacystream",
 };
 
-// TODO(philipj): Most DOMString types in the XMLHttpRequest interface should be
+// TODO(foolip): Most DOMString types in the XMLHttpRequest interface should be
 // either ByteString or USVString.
 [
     ActiveScriptWrappable,
@@ -65,7 +65,7 @@
     [RaisesException=Setter] attribute unsigned long timeout;
     [RaisesException=Setter] attribute boolean withCredentials;
     readonly attribute XMLHttpRequestUpload upload;
-    // TODO(philipj): The data argument should be of type
+    // TODO(foolip): The data argument should be of type
     // (Document or BodyInit)?
     [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob or Document or DOMString or FormData)? body = null);
     void abort();
@@ -80,6 +80,6 @@
     [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
     [Custom=Getter, RaisesException=Getter] readonly attribute any response;
     [Custom=Getter, RaisesException=Getter] readonly attribute DOMString responseText;
-    // TODO(philipj): responseXML should be [Exposed=Window].
+    // TODO(foolip): responseXML should be [Exposed=Window].
     [RaisesException=Getter] readonly attribute Document? responseXML;
 };
diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
index 45b81e7..3bec9c3 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
@@ -28,7 +28,6 @@
 
 #include "modules/accessibility/AXARIAGrid.h"
 
-#include "core/layout/LayoutObject.h"
 #include "modules/accessibility/AXObjectCacheImpl.h"
 #include "modules/accessibility/AXTableColumn.h"
 #include "modules/accessibility/AXTableRow.h"
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index a3c5f57..42cdc55a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -60,9 +60,7 @@
 #include "core/layout/LayoutInline.h"
 #include "core/layout/LayoutListMarker.h"
 #include "core/layout/LayoutMenuList.h"
-#include "core/layout/LayoutPart.h"
 #include "core/layout/LayoutTextControl.h"
-#include "core/layout/LayoutTextFragment.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LineLayoutAPIShim.h"
 #include "core/loader/ProgressTracker.h"
diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
index 9756b66..b111fbf8 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp
@@ -30,6 +30,7 @@
 
 #include "core/html/HTMLOptionElement.h"
 #include "core/html/HTMLSelectElement.h"
+#include "core/layout/LayoutObject.h"
 #include "modules/accessibility/AXObjectCacheImpl.h"
 
 
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h
index f5fb820..a8ed70a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h
@@ -30,7 +30,6 @@
 #define AXObjectCacheImpl_h
 
 #include "core/dom/AXObjectCache.h"
-#include "core/layout/LayoutText.h"
 #include "modules/ModulesExport.h"
 #include "modules/accessibility/AXObject.h"
 #include "platform/Timer.h"
diff --git a/third_party/WebKit/Source/modules/accessibility/AXRadioInput.cpp b/third_party/WebKit/Source/modules/accessibility/AXRadioInput.cpp
index 8e6b7c1..6e803ec 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXRadioInput.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXRadioInput.cpp
@@ -8,6 +8,7 @@
 #include "core/InputTypeNames.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/forms/RadioInputType.h"
+#include "core/layout/LayoutObject.h"
 #include "modules/accessibility/AXObjectCacheImpl.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
index 18a59e8..49e0273 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
@@ -28,7 +28,7 @@
 
 #include "modules/accessibility/AXTableRow.h"
 
-#include "core/layout/LayoutTableRow.h"
+#include "core/layout/LayoutObject.h"
 #include "modules/accessibility/AXObjectCacheImpl.h"
 #include "modules/accessibility/AXTableCell.h"
 
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
index 4bc0c04..f6152032 100644
--- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
@@ -337,7 +337,7 @@
 
 void CacheStorage::dispose()
 {
-    m_webCacheStorage.clear();
+    m_webCacheStorage.reset();
 }
 
 DEFINE_TRACE(CacheStorage)
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
index a51049f..e048949 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -715,7 +715,7 @@
     EXPECT_EQ(400, getGlobalGPUMemoryUsage());
 
     // Tear down the second image buffer
-    imageBuffer2.clear();
+    imageBuffer2.reset();
     EXPECT_EQ(0, getGlobalGPUMemoryUsage());
 }
 
diff --git a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp
index 55300b0..dc1d08bc 100644
--- a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp
@@ -5,7 +5,6 @@
 #include "modules/canvas2d/HitRegion.h"
 
 #include "core/dom/AXObjectCache.h"
-#include "core/layout/LayoutBoxModelObject.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
index dd55032..fa458706 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -90,7 +90,7 @@
 
     void TearDown() override
     {
-        m_page.clear();
+        m_page.reset();
         CompositorWorkerThread::resetSharedBackingThreadForTest();
     }
 
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
index 43612f8..368ab9a4 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
@@ -69,7 +69,7 @@
     ASSERT(!handle.isEmpty());
 
     // Delete the page & associated objects.
-    m_page.clear();
+    m_page.reset();
 
     // Run a GC, the persistent should have been collected.
     ThreadHeap::collectAllGarbage();
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl
index 138f704..95281806 100644
--- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl
+++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl
@@ -25,14 +25,14 @@
 
 // http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
 
-// TODO(philipj): DeviceMotionEvent should have a constructor.
+// TODO(foolip): DeviceMotionEvent should have a constructor.
 interface DeviceMotionEvent : Event {
     readonly attribute DeviceAcceleration? acceleration;
     readonly attribute DeviceAcceleration? accelerationIncludingGravity;
     readonly attribute DeviceRotationRate? rotationRate;
     readonly attribute double? interval;
 
-    // TODO(philipj): The init*Event() methods are not in the spec:
+    // TODO(foolip): The init*Event() methods are not in the spec:
     // https://github.com/w3c/deviceorientation/issues/18
     [Custom, Measure] void initDeviceMotionEvent([Default=Undefined] optional DOMString type,
                                                  [Default=Undefined] optional boolean bubbles,
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl
index e3d1b19e..35ec3f4 100644
--- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl
+++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl
@@ -25,14 +25,14 @@
 
 // http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientation
 
-// TODO(philipj): DeviceOrientationEvent should have a constructor.
+// TODO(foolip): DeviceOrientationEvent should have a constructor.
 interface DeviceOrientationEvent : Event {
     readonly attribute double? alpha;
     readonly attribute double? beta;
     readonly attribute double? gamma;
     readonly attribute boolean absolute;
 
-    // TODO(philipj): The init*Event() methods are not in the spec:
+    // TODO(foolip): The init*Event() methods are not in the spec:
     // https://github.com/w3c/deviceorientation/issues/18
     [Measure] void initDeviceOrientationEvent([Default=Undefined] optional DOMString type,
                                               [Default=Undefined] optional boolean bubbles,
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
index fb3d232..a8c49763 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -374,7 +374,7 @@
 {
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
-    m_session.clear();
+    m_session.reset();
 }
 
 String MediaKeySession::sessionId() const
@@ -912,7 +912,7 @@
 void MediaKeySession::stop()
 {
     // Stop the CDM from firing any more events for this session.
-    m_session.clear();
+    m_session.reset();
     m_isClosed = true;
 
     if (m_actionTimer.isActive())
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
index aefb7f2..104fd80 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
@@ -248,7 +248,7 @@
 
     // We don't need the CDM anymore. Only destroyed after all related
     // ActiveDOMObjects have been stopped.
-    m_cdm.clear();
+    m_cdm.reset();
 }
 
 bool MediaKeys::hasPendingActivity() const
diff --git a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
index f56dd20..9492ba1f 100644
--- a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
+++ b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h
@@ -141,7 +141,7 @@
             // We have to destruct |*m_obj| here because destructing |*m_obj|
             // in ~Bridge() might be too late when |executionContext| is
             // stopped.
-            m_obj.clear();
+            m_obj.reset();
         }
 
 
diff --git a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
index 92ced98d..9a86008 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
@@ -75,7 +75,7 @@
             m_updater->update(createUnexpectedErrorDataConsumerHandle());
         if (m_loader) {
             m_loader->cancel();
-            m_loader.clear();
+            m_loader.reset();
         }
     }
 
@@ -133,14 +133,14 @@
 
     void didFinishLoading(unsigned long, double) override
     {
-        m_loader.clear();
+        m_loader.reset();
     }
 
     void didFail(const ResourceError&) override
     {
         if (!m_receivedResponse)
             m_updater->update(createUnexpectedErrorDataConsumerHandle());
-        m_loader.clear();
+        m_loader.reset();
     }
 
     void didFailRedirectCheck() override
diff --git a/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp b/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp
index 31967fe3..ea21ae5 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp
@@ -39,7 +39,7 @@
         RefPtr<BlobDataHandle> blobHandle = m_reader->drainAsBlobDataHandle();
         if (blobHandle) {
             ASSERT(blobHandle->size() != UINT64_MAX);
-            m_reader.clear();
+            m_reader.reset();
             if (blobHandle->type() != m_mimeType) {
                 // A new BlobDataHandle is created to override the Blob's type.
                 m_client->didFetchDataLoadedBlobHandle(BlobDataHandle::create(blobHandle->uuid(), m_mimeType, blobHandle->size()));
@@ -72,7 +72,7 @@
                 break;
 
             case WebDataConsumerHandle::Done: {
-                m_reader.clear();
+                m_reader.reset();
                 long long size = m_blobData->length();
                 m_client->didFetchDataLoadedBlobHandle(BlobDataHandle::create(std::move(m_blobData), size));
                 m_client.clear();
@@ -85,8 +85,8 @@
             case WebDataConsumerHandle::Busy:
             case WebDataConsumerHandle::ResourceExhausted:
             case WebDataConsumerHandle::UnexpectedError:
-                m_reader.clear();
-                m_blobData.clear();
+                m_reader.reset();
+                m_blobData.reset();
                 m_client->didFetchDataLoadFailed();
                 m_client.clear();
                 return;
@@ -96,8 +96,8 @@
 
     void cancel() override
     {
-        m_reader.clear();
-        m_blobData.clear();
+        m_reader.reset();
+        m_blobData.reset();
         m_client.clear();
     }
 
@@ -158,9 +158,9 @@
                 break;
 
             case WebDataConsumerHandle::Done:
-                m_reader.clear();
+                m_reader.reset();
                 m_client->didFetchDataLoadedArrayBuffer(DOMArrayBuffer::create(m_rawData->toArrayBuffer()));
-                m_rawData.clear();
+                m_rawData.reset();
                 m_client.clear();
                 return;
 
@@ -178,16 +178,16 @@
 
     void error()
     {
-        m_reader.clear();
-        m_rawData.clear();
+        m_reader.reset();
+        m_rawData.reset();
         m_client->didFetchDataLoadFailed();
         m_client.clear();
     }
 
     void cancel() override
     {
-        m_reader.clear();
-        m_rawData.clear();
+        m_reader.reset();
+        m_rawData.reset();
         m_client.clear();
     }
 
@@ -240,11 +240,11 @@
                 break;
 
             case WebDataConsumerHandle::Done:
-                m_reader.clear();
+                m_reader.reset();
                 m_builder.append(m_decoder->flush());
                 m_client->didFetchDataLoadedString(m_builder.toString());
                 m_builder.clear();
-                m_decoder.clear();
+                m_decoder.reset();
                 m_client.clear();
                 return;
 
@@ -262,18 +262,18 @@
 
     void error()
     {
-        m_reader.clear();
+        m_reader.reset();
         m_builder.clear();
-        m_decoder.clear();
+        m_decoder.reset();
         m_client->didFetchDataLoadFailed();
         m_client.clear();
     }
 
     void cancel() override
     {
-        m_reader.clear();
+        m_reader.reset();
         m_builder.clear();
-        m_decoder.clear();
+        m_decoder.reset();
         m_client.clear();
     }
 
@@ -327,7 +327,7 @@
                 break;
 
             case WebDataConsumerHandle::Done:
-                m_reader.clear();
+                m_reader.reset();
                 if (needToFlush)
                     m_outStream->flush();
                 m_outStream->finalize();
@@ -348,7 +348,7 @@
                 // notice the error and continue waiting forever.
                 // FIXME: Add new message to report the error to the browser
                 // process.
-                m_reader.clear();
+                m_reader.reset();
                 m_outStream->abort();
                 m_client->didFetchDataLoadFailed();
                 cleanup();
@@ -364,7 +364,7 @@
 
     void cleanup()
     {
-        m_reader.clear();
+        m_reader.reset();
         m_client.clear();
         m_outStream.clear();
     }
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index 7f59a051..482e116 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -521,7 +521,7 @@
     m_fetchManager = nullptr;
     if (m_loader) {
         m_loader->cancel();
-        m_loader.clear();
+        m_loader.reset();
     }
     m_executionContext = nullptr;
 }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
index 1889964..f0a5cfab 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
@@ -296,7 +296,7 @@
 {
     m_value.clear();
     m_request.clear();
-    m_backend.clear();
+    m_backend.reset();
 }
 
 ScriptValue IDBCursor::key(ScriptState* scriptState)
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
index 47419767..e4af669 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
@@ -52,7 +52,7 @@
     static IDBCursor* create(PassOwnPtr<WebIDBCursor>, WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
     virtual ~IDBCursor();
     DECLARE_TRACE();
-    void contextWillBeDestroyed() { m_backend.clear(); }
+    void contextWillBeDestroyed() { m_backend.reset(); }
 
     v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeInfo*, v8::Local<v8::Object> wrapper) override WARN_UNUSED_RETURN;
 
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
index 14108129..48c1da54 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
@@ -343,7 +343,7 @@
 
     if (m_backend) {
         m_backend->close();
-        m_backend.clear();
+        m_backend.reset();
     }
 
     if (m_contextStopped || !getExecutionContext())
@@ -432,7 +432,7 @@
     // round trip to the back-end to abort.
     if (m_backend) {
         m_backend->close();
-        m_backend.clear();
+        m_backend.reset();
     }
 }
 
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
index 36e56a3..c7dd954 100644
--- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -280,7 +280,7 @@
 
     m_stopped = true;
     m_stream.clear();
-    m_recorderHandler.clear();
+    m_recorderHandler.reset();
 }
 
 void MediaRecorder::writeData(const char* data, size_t length, bool lastInSlice)
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
index 73fff60..dc49fa5 100644
--- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -450,7 +450,7 @@
     DVLOG(MEDIA_SOURCE_LOG_LEVEL) << __FUNCTION__ << " : " << oldState << " -> " << state << " " << this;
 
     if (state == closedKeyword()) {
-        m_webMediaSource.clear();
+        m_webMediaSource.reset();
     }
 
     if (oldState == state)
@@ -574,7 +574,7 @@
     m_asyncEventQueue->close();
     if (!isClosed())
         setReadyState(closedKeyword());
-    m_webMediaSource.clear();
+    m_webMediaSource.reset();
 }
 
 PassOwnPtr<WebSourceBuffer> MediaSource::createWebSourceBuffer(const String& type, const String& codecs, ExceptionState& exceptionState)
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
index 263f854..4dbe8df 100644
--- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -143,7 +143,7 @@
 {
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
-    m_webSourceBuffer.clear();
+    m_webSourceBuffer.reset();
 }
 
 const AtomicString& SourceBuffer::segmentsKeyword()
@@ -493,7 +493,7 @@
     }
 
     m_webSourceBuffer->removedFromMediaSource();
-    m_webSourceBuffer.clear();
+    m_webSourceBuffer.reset();
     m_source = nullptr;
     m_asyncEventQueue = nullptr;
 }
@@ -945,7 +945,7 @@
 {
     m_streamMaxSizeValid = false;
     m_streamMaxSize = 0;
-    m_loader.clear();
+    m_loader.reset();
     m_stream = nullptr;
 }
 
diff --git a/third_party/WebKit/Source/modules/mediastream/ConstrainDOMStringParameters.idl b/third_party/WebKit/Source/modules/mediastream/ConstrainDOMStringParameters.idl
index 93bc42e..35e4a8fe 100644
--- a/third_party/WebKit/Source/modules/mediastream/ConstrainDOMStringParameters.idl
+++ b/third_party/WebKit/Source/modules/mediastream/ConstrainDOMStringParameters.idl
@@ -5,10 +5,6 @@
 // https://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-ConstrainLongRange
 
 dictionary ConstrainDOMStringParameters {
-  sequence<DOMString> exact;
-  sequence<DOMString> ideal;
-  // The spec says that the members should be:
-  //  (DOMString or sequence<DOMString>) exact;
-  //  (DOMString or sequence<DOMString>) ideal;
-  // This is blocked on https://crbug.com/524424
+    (DOMString or sequence<DOMString>) exact;
+    (DOMString or sequence<DOMString>) ideal;
 };
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
index c1af99f..360f7b4 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
@@ -453,8 +453,13 @@
     return createFromNamedConstraints(context, mandatory, optional, errorState);
 }
 
-void copyLongConstraint(const ConstrainLongRange& blinkForm, LongConstraint& webForm)
+void copyLongConstraint(const LongOrConstrainLongRange& blinkUnionForm, LongConstraint& webForm)
 {
+    if (blinkUnionForm.isLong()) {
+        webForm.setIdeal(blinkUnionForm.getAsLong());
+        return;
+    }
+    const auto& blinkForm = blinkUnionForm.getAsConstrainLongRange();
     if (blinkForm.hasMin()) {
         webForm.setMin(blinkForm.min());
     }
@@ -469,8 +474,13 @@
     }
 }
 
-void copyDoubleConstraint(const ConstrainDoubleRange& blinkForm, DoubleConstraint& webForm)
+void copyDoubleConstraint(const DoubleOrConstrainDoubleRange& blinkUnionForm, DoubleConstraint& webForm)
 {
+    if (blinkUnionForm.isDouble()) {
+        webForm.setIdeal(blinkUnionForm.getAsDouble());
+        return;
+    }
+    const auto& blinkForm = blinkUnionForm.getAsConstrainDoubleRange();
     if (blinkForm.hasMin()) {
         webForm.setMin(blinkForm.min());
     }
@@ -485,18 +495,40 @@
     }
 }
 
-void copyStringConstraint(const ConstrainDOMStringParameters& blinkForm, StringConstraint& webForm)
+void copyStringConstraint(const StringOrStringSequenceOrConstrainDOMStringParameters& blinkUnionForm, StringConstraint& webForm)
 {
+    if (blinkUnionForm.isString()) {
+        webForm.setIdeal(Vector<String>(1, blinkUnionForm.getAsString()));
+        return;
+    }
+    if (blinkUnionForm.isStringSequence()) {
+        webForm.setIdeal(blinkUnionForm.getAsStringSequence());
+        return;
+    }
+    const auto& blinkForm = blinkUnionForm.getAsConstrainDOMStringParameters();
     if (blinkForm.hasIdeal()) {
-        webForm.setIdeal(WebVector<WebString>(blinkForm.ideal()));
+        if (blinkForm.ideal().isStringSequence()) {
+            webForm.setIdeal(blinkForm.ideal().getAsStringSequence());
+        } else if (blinkForm.ideal().isString()) {
+            webForm.setIdeal(Vector<String>(1, blinkForm.ideal().getAsString()));
+        }
     }
     if (blinkForm.hasExact()) {
-        webForm.setExact(WebVector<WebString>(blinkForm.exact()));
+        if (blinkForm.exact().isStringSequence()) {
+            webForm.setExact(blinkForm.exact().getAsStringSequence());
+        } else if (blinkForm.exact().isString()) {
+            webForm.setExact(Vector<String>(1, blinkForm.exact().getAsString()));
+        }
     }
 }
 
-void copyBooleanConstraint(const ConstrainBooleanParameters& blinkForm, BooleanConstraint& webForm)
+void copyBooleanConstraint(const BooleanOrConstrainBooleanParameters& blinkUnionForm, BooleanConstraint& webForm)
 {
+    if (blinkUnionForm.isBoolean()) {
+        webForm.setIdeal(blinkUnionForm.getAsBoolean());
+        return;
+    }
+    const auto& blinkForm = blinkUnionForm.getAsConstrainBooleanParameters();
     if (blinkForm.hasIdeal()) {
         webForm.setIdeal(blinkForm.ideal());
     }
@@ -505,7 +537,7 @@
     }
 }
 
-void copyConstraints(const MediaTrackConstraintSet& constraintsIn, WebMediaTrackConstraintSet& constraintBuffer)
+void copyConstraintSet(const MediaTrackConstraintSet& constraintsIn, WebMediaTrackConstraintSet& constraintBuffer)
 {
     if (constraintsIn.hasWidth()) {
         copyLongConstraint(constraintsIn.width(), constraintBuffer.width);
@@ -548,23 +580,28 @@
     }
 }
 
-WebMediaConstraints create(ExecutionContext* context, const MediaTrackConstraints& constraintsIn, MediaErrorState& errorState)
+WebMediaConstraints convertConstraintsToWeb(const MediaTrackConstraints& constraintsIn)
 {
     WebMediaConstraints constraints;
     WebMediaTrackConstraintSet constraintBuffer;
     Vector<WebMediaTrackConstraintSet> advancedBuffer;
-    copyConstraints(constraintsIn, constraintBuffer);
+    copyConstraintSet(constraintsIn, constraintBuffer);
     if (constraintsIn.hasAdvanced()) {
         for (const auto& element : constraintsIn.advanced()) {
             WebMediaTrackConstraintSet advancedElement;
-            copyConstraints(element, advancedElement);
+            copyConstraintSet(element, advancedElement);
             advancedBuffer.append(advancedElement);
         }
     }
-    // TODO(hta): Add initialization of advanced constraints once present.
-    // https://crbug.com/253412
+    constraints.initialize(constraintBuffer, advancedBuffer);
+    return constraints;
+}
+
+WebMediaConstraints create(ExecutionContext* context, const MediaTrackConstraints& constraintsIn, MediaErrorState& errorState)
+{
+    WebMediaConstraints standardForm = convertConstraintsToWeb(constraintsIn);
     if (constraintsIn.hasOptional() || constraintsIn.hasMandatory()) {
-        if (!constraintBuffer.isEmpty() || constraintsIn.hasAdvanced()) {
+        if (!standardForm.isEmpty()) {
             errorState.throwTypeError("Malformed constraint: Cannot use both optional/mandatory and specific or advanced constraints.");
             return WebMediaConstraints();
         }
@@ -578,8 +615,7 @@
         return createFromNamedConstraints(context, mandatory, optional, errorState);
     }
     UseCounter::count(context, UseCounter::MediaStreamConstraintsConformant);
-    constraints.initialize(constraintBuffer, advancedBuffer);
-    return constraints;
+    return standardForm;
 }
 
 WebMediaConstraints create()
@@ -589,63 +625,101 @@
     return constraints;
 }
 
-ConstrainLongRange convertLong(const LongConstraint& input)
+LongOrConstrainLongRange convertLong(const LongConstraint& input)
 {
-
-    ConstrainLongRange output;
-    if (input.hasExact())
-        output.setExact(input.exact());
-    if (input.hasIdeal())
-        output.setIdeal(input.ideal());
-    if (input.hasMin())
-        output.setMin(input.min());
-    if (input.hasMax())
-        output.setMax(input.max());
-    return output;
-}
-
-ConstrainDoubleRange convertDouble(const DoubleConstraint& input)
-{
-
-    ConstrainDoubleRange output;
-    if (input.hasExact())
-        output.setExact(input.exact());
-    if (input.hasIdeal())
-        output.setIdeal(input.ideal());
-    if (input.hasMin())
-        output.setMin(input.min());
-    if (input.hasMax())
-        output.setMax(input.max());
-    return output;
-}
-
-ConstrainDOMStringParameters convertString(const StringConstraint& input)
-{
-    ConstrainDOMStringParameters output;
-    if (input.hasIdeal()) {
-        Vector<String> buffer;
-        for (const auto& scanner : input.ideal())
-            buffer.append(scanner);
-        output.setIdeal(buffer);
+    LongOrConstrainLongRange outputUnion;
+    if (input.hasExact() || input.hasMin() || input.hasMax()) {
+        ConstrainLongRange output;
+        if (input.hasExact())
+            output.setExact(input.exact());
+        if (input.hasMin())
+            output.setMin(input.min());
+        if (input.hasMax())
+            output.setMax(input.max());
+        if (input.hasIdeal())
+            output.setIdeal(input.ideal());
+        outputUnion.setConstrainLongRange(output);
+    } else {
+        if (input.hasIdeal()) {
+            outputUnion.setLong(input.ideal());
+        }
     }
+    return outputUnion;
+}
+
+DoubleOrConstrainDoubleRange convertDouble(const DoubleConstraint& input)
+{
+    DoubleOrConstrainDoubleRange outputUnion;
+    if (input.hasExact() || input.hasMin() || input.hasMax()) {
+        ConstrainDoubleRange output;
+        if (input.hasExact())
+            output.setExact(input.exact());
+        if (input.hasIdeal())
+            output.setIdeal(input.ideal());
+        if (input.hasMin())
+            output.setMin(input.min());
+        if (input.hasMax())
+            output.setMax(input.max());
+        outputUnion.setConstrainDoubleRange(output);
+    } else {
+        if (input.hasIdeal()) {
+            outputUnion.setDouble(input.ideal());
+        }
+    }
+    return outputUnion;
+}
+
+StringOrStringSequence convertStringSequence(const WebVector<WebString>& input)
+{
+    StringOrStringSequence theStrings;
+    if (input.size() > 1) {
+        Vector<String> buffer;
+        for (const auto& scanner : input)
+            buffer.append(scanner);
+        theStrings.setStringSequence(buffer);
+    } else if (input.size() > 0) {
+        theStrings.setString(input[0]);
+    }
+    return theStrings;
+}
+
+StringOrStringSequenceOrConstrainDOMStringParameters convertString(const StringConstraint& input)
+{
+    StringOrStringSequenceOrConstrainDOMStringParameters outputUnion;
     if (input.hasExact()) {
-        Vector<String> buffer;
-        for (const auto& scanner : input.exact())
-            buffer.append(scanner);
-        output.setExact(buffer);
+        ConstrainDOMStringParameters output;
+        output.setExact(convertStringSequence(input.exact()));
+        if (input.hasIdeal()) {
+            output.setIdeal(convertStringSequence(input.ideal()));
+        }
+        outputUnion.setConstrainDOMStringParameters(output);
+    } else if (input.hasIdeal()) {
+        if (input.ideal().size() > 1) {
+            Vector<String> buffer;
+            for (const auto& scanner : input.ideal())
+                buffer.append(scanner);
+            outputUnion.setStringSequence(buffer);
+        } else if (input.ideal().size() == 1) {
+            outputUnion.setString(input.ideal()[0]);
+        }
     }
-    return output;
+    return outputUnion;
 }
 
-ConstrainBooleanParameters convertBoolean(const BooleanConstraint& input)
+BooleanOrConstrainBooleanParameters convertBoolean(const BooleanConstraint& input)
 {
-
-    ConstrainBooleanParameters output;
-    if (input.hasExact())
-        output.setExact(input.exact());
-    if (input.hasIdeal())
-        output.setIdeal(input.ideal());
-    return output;
+    BooleanOrConstrainBooleanParameters outputUnion;
+    if (input.hasExact()) {
+        ConstrainBooleanParameters output;
+        if (input.hasExact())
+            output.setExact(input.exact());
+        if (input.hasIdeal())
+            output.setIdeal(input.ideal());
+        outputUnion.setConstrainBooleanParameters(output);
+    } else if (input.hasIdeal()) {
+        outputUnion.setBoolean(input.ideal());
+    }
+    return outputUnion;
 }
 
 void convertConstraintSet(const WebMediaTrackConstraintSet& input, MediaTrackConstraintSet& output)
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.h b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.h
index 02c46a2..615ee09 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.h
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.h
@@ -31,6 +31,7 @@
 #ifndef MediaConstraintsImpl_h
 #define MediaConstraintsImpl_h
 
+#include "modules/ModulesExport.h"
 #include "modules/mediastream/MediaErrorState.h"
 #include "public/platform/WebMediaConstraints.h"
 #include "wtf/text/WTFString.h"
@@ -38,7 +39,6 @@
 namespace blink {
 
 class Dictionary;
-class ExceptionState;
 class MediaTrackConstraints;
 
 namespace MediaConstraintsImpl {
@@ -47,7 +47,10 @@
 WebMediaConstraints create(ExecutionContext*, const Dictionary&, MediaErrorState&);
 WebMediaConstraints create(ExecutionContext*, const MediaTrackConstraints&, MediaErrorState&);
 
-void convertConstraints(const WebMediaConstraints& input, MediaTrackConstraints& output);
+// Exported with MODULES_EXPORT for testing
+MODULES_EXPORT void convertConstraints(const WebMediaConstraints& input, MediaTrackConstraints& output);
+// Exported for testing only.
+MODULES_EXPORT WebMediaConstraints convertConstraintsToWeb(const MediaTrackConstraints&);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
index adc9554..1d5724b 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
@@ -2,21 +2,25 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "modules/mediastream/MediaConstraintsImpl.h"
+#include "modules/mediastream/MediaTrackConstraints.h"
 #include "public/platform/WebMediaConstraints.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+namespace blink {
+
 // The MediaTrackConstraintsTest group tests the types declared in
 // WebKit/public/platform/WebMediaConstraints.h
 TEST(MediaTrackConstraintsTest, LongConstraint)
 {
-    blink::LongConstraint rangeConstraint(nullptr);
+    LongConstraint rangeConstraint(nullptr);
     rangeConstraint.setMin(5);
     rangeConstraint.setMax(6);
     EXPECT_TRUE(rangeConstraint.matches(5));
     EXPECT_TRUE(rangeConstraint.matches(6));
     EXPECT_FALSE(rangeConstraint.matches(4));
     EXPECT_FALSE(rangeConstraint.matches(7));
-    blink::LongConstraint exactConstraint(nullptr);
+    LongConstraint exactConstraint(nullptr);
     exactConstraint.setExact(5);
     EXPECT_FALSE(exactConstraint.matches(4));
     EXPECT_TRUE(exactConstraint.matches(5));
@@ -25,27 +29,27 @@
 
 TEST(MediaTrackConstraintsTest, DoubleConstraint)
 {
-    blink::DoubleConstraint rangeConstraint(nullptr);
+    DoubleConstraint rangeConstraint(nullptr);
     EXPECT_TRUE(rangeConstraint.isEmpty());
     rangeConstraint.setMin(5.0);
     rangeConstraint.setMax(6.5);
     EXPECT_FALSE(rangeConstraint.isEmpty());
     // Matching within epsilon
-    EXPECT_TRUE(rangeConstraint.matches(5.0 - blink::DoubleConstraint::kConstraintEpsilon / 2));
-    EXPECT_TRUE(rangeConstraint.matches(6.5 + blink::DoubleConstraint::kConstraintEpsilon / 2));
-    blink::DoubleConstraint exactConstraint(nullptr);
+    EXPECT_TRUE(rangeConstraint.matches(5.0 - DoubleConstraint::kConstraintEpsilon / 2));
+    EXPECT_TRUE(rangeConstraint.matches(6.5 + DoubleConstraint::kConstraintEpsilon / 2));
+    DoubleConstraint exactConstraint(nullptr);
     exactConstraint.setExact(5.0);
     EXPECT_FALSE(rangeConstraint.isEmpty());
     EXPECT_FALSE(exactConstraint.matches(4.9));
     EXPECT_TRUE(exactConstraint.matches(5.0));
-    EXPECT_TRUE(exactConstraint.matches(5.0 - blink::DoubleConstraint::kConstraintEpsilon / 2));
-    EXPECT_TRUE(exactConstraint.matches(5.0 + blink::DoubleConstraint::kConstraintEpsilon / 2));
+    EXPECT_TRUE(exactConstraint.matches(5.0 - DoubleConstraint::kConstraintEpsilon / 2));
+    EXPECT_TRUE(exactConstraint.matches(5.0 + DoubleConstraint::kConstraintEpsilon / 2));
     EXPECT_FALSE(exactConstraint.matches(5.1));
 }
 
 TEST(MediaTrackConstraintsTest, BooleanConstraint)
 {
-    blink::BooleanConstraint boolConstraint(nullptr);
+    BooleanConstraint boolConstraint(nullptr);
     EXPECT_TRUE(boolConstraint.isEmpty());
     EXPECT_TRUE(boolConstraint.matches(false));
     EXPECT_TRUE(boolConstraint.matches(true));
@@ -60,7 +64,7 @@
 
 TEST(MediaTrackConstraintsTest, ConstraintSetEmpty)
 {
-    blink::WebMediaTrackConstraintSet theSet;
+    WebMediaTrackConstraintSet theSet;
     EXPECT_TRUE(theSet.isEmpty());
     theSet.echoCancellation.setExact(false);
     EXPECT_FALSE(theSet.isEmpty());
@@ -69,13 +73,13 @@
 TEST(MediaTrackConstraintsTest, ConstraintName)
 {
     const char* theName = "name";
-    blink::BooleanConstraint boolConstraint(theName);
+    BooleanConstraint boolConstraint(theName);
     EXPECT_EQ(theName, boolConstraint.name());
 }
 
 TEST(MediaTrackConstraintsTest, MandatoryChecks)
 {
-    blink::WebMediaTrackConstraintSet theSet;
+    WebMediaTrackConstraintSet theSet;
     std::string foundName;
     EXPECT_FALSE(theSet.hasMandatory());
     EXPECT_FALSE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
@@ -93,7 +97,7 @@
 
 TEST(MediaTrackConstraintsTest, SetToString)
 {
-    blink::WebMediaTrackConstraintSet theSet;
+    WebMediaTrackConstraintSet theSet;
     EXPECT_EQ("", theSet.toString());
     theSet.width.setMax(240);
     EXPECT_EQ("width: {max: 240}", theSet.toString().utf8());
@@ -103,14 +107,98 @@
 
 TEST(MediaTrackConstraintsTest, ConstraintsToString)
 {
-    blink::WebMediaConstraints theConstraints;
-    blink::WebMediaTrackConstraintSet basic;
-    blink::WebVector<blink::WebMediaTrackConstraintSet> advanced(static_cast<size_t>(1));
+    WebMediaConstraints theConstraints;
+    WebMediaTrackConstraintSet basic;
+    WebVector<WebMediaTrackConstraintSet> advanced(static_cast<size_t>(1));
     basic.width.setMax(240);
     advanced[0].echoCancellation.setExact(true);
     theConstraints.initialize(basic, advanced);
     EXPECT_EQ("{width: {max: 240}, advanced: [{echoCancellation: {exact: true}}]}", theConstraints.toString().utf8());
 
-    blink::WebMediaConstraints nullConstraints;
+    WebMediaConstraints nullConstraints;
     EXPECT_EQ("", nullConstraints.toString().utf8());
 }
+
+TEST(MediaTrackConstraintsTest, ConvertWebConstraintsBasic)
+{
+    WebMediaConstraints input;
+    MediaTrackConstraints output;
+
+    MediaConstraintsImpl::convertConstraints(input, output);
+}
+
+TEST(MediaTrackConstraintsTest, ConvertWebSingleStringConstraint)
+{
+    WebMediaConstraints input;
+    MediaTrackConstraints output;
+
+    WebMediaTrackConstraintSet basic;
+    WebVector<WebMediaTrackConstraintSet> advanced;
+
+    basic.facingMode.setIdeal(WebVector<WebString>(&"foo", 1));
+    input.initialize(basic, advanced);
+    MediaConstraintsImpl::convertConstraints(input, output);
+    ASSERT_TRUE(output.hasFacingMode());
+    ASSERT_TRUE(output.facingMode().isString());
+    EXPECT_EQ("foo", output.facingMode().getAsString());
+}
+
+TEST(MediaTrackConstraintsTest, ConvertWebDoubleStringConstraint)
+{
+    WebMediaConstraints input;
+    MediaTrackConstraints output;
+
+    WebVector<WebString> buffer(static_cast<size_t>(2u));
+    buffer[0] = "foo";
+    buffer[1] = "bar";
+
+    WebMediaTrackConstraintSet basic;
+    std::vector<WebMediaTrackConstraintSet> advanced;
+    basic.facingMode.setIdeal(buffer);
+    input.initialize(basic, advanced);
+    MediaConstraintsImpl::convertConstraints(input, output);
+    ASSERT_TRUE(output.hasFacingMode());
+    ASSERT_TRUE(output.facingMode().isStringSequence());
+    auto outBuffer = output.facingMode().getAsStringSequence();
+    EXPECT_EQ("foo", outBuffer[0]);
+    EXPECT_EQ("bar", outBuffer[1]);
+}
+
+TEST(MediaTrackConstraintsTest, ConvertBlinkStringConstraint)
+{
+    MediaTrackConstraints input;
+    WebMediaConstraints output;
+    StringOrStringSequenceOrConstrainDOMStringParameters parameter;
+    parameter.setString("foo");
+    input.setFacingMode(parameter);
+    output = MediaConstraintsImpl::convertConstraintsToWeb(input);
+    ASSERT_TRUE(output.basic().facingMode.hasIdeal());
+    ASSERT_EQ(1U, output.basic().facingMode.ideal().size());
+    ASSERT_EQ("foo", output.basic().facingMode.ideal()[0]);
+}
+
+TEST(MediaTrackConstraintsTest, ConvertBlinkComplexStringConstraint)
+{
+    MediaTrackConstraints input;
+    WebMediaConstraints output;
+    StringOrStringSequenceOrConstrainDOMStringParameters parameter;
+    ConstrainDOMStringParameters subparameter;
+    StringOrStringSequence innerString;
+    innerString.setString("foo");
+    subparameter.setIdeal(innerString);
+    parameter.setConstrainDOMStringParameters(subparameter);
+    input.setFacingMode(parameter);
+    output = MediaConstraintsImpl::convertConstraintsToWeb(input);
+    ASSERT_TRUE(output.basic().facingMode.hasIdeal());
+    ASSERT_EQ(1U, output.basic().facingMode.ideal().size());
+    ASSERT_EQ("foo", output.basic().facingMode.ideal()[0]);
+
+    // Convert this back, and see that it appears as a single string.
+    MediaTrackConstraints recycled;
+    MediaConstraintsImpl::convertConstraints(output, recycled);
+    ASSERT_TRUE(recycled.hasFacingMode());
+    ASSERT_TRUE(recycled.facingMode().isString());
+    ASSERT_EQ("foo", recycled.facingMode().getAsString());
+}
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaTrackConstraintSet.idl b/third_party/WebKit/Source/modules/mediastream/MediaTrackConstraintSet.idl
index 04a3f33f..b90448b 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaTrackConstraintSet.idl
+++ b/third_party/WebKit/Source/modules/mediastream/MediaTrackConstraintSet.idl
@@ -4,16 +4,10 @@
 
 // https://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-MediaTrackConstraintSet
 
-typedef ConstrainLongRange ConstrainLong;
-typedef ConstrainDoubleRange ConstrainDouble;
-typedef ConstrainBooleanParameters ConstrainBoolean;
-typedef ConstrainDOMStringParameters ConstrainDOMString;
-// The spec says that the typedefs should be:
-// typedef (long or ConstrainLongRange) ConstrainLong;
-// typedef (double or ConstrainDoubleRange) ConstrainDouble;
-// typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
-// typedef (DOMString or sequence<DOMString> or ConstrainDomStringParameters) ConstrainDomString;
-// This is blocked on https://crbug.com/524424
+typedef (long or ConstrainLongRange) ConstrainLong;
+typedef (double or ConstrainDoubleRange) ConstrainDouble;
+typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
+typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
 
 dictionary MediaTrackConstraintSet {
     [RuntimeEnabled=MediaConstraints] ConstrainLong width;
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
index df073bc..fcde7c0 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp
@@ -78,7 +78,7 @@
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
     m_handler->setClient(nullptr);
-    m_handler.clear();
+    m_handler.reset();
 }
 
 bool RTCDTMFSender::canInsertDTMF() const
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
index 208fd69..e054159b 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
@@ -99,7 +99,7 @@
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
     m_handler->setClient(nullptr);
-    m_handler.clear();
+    m_handler.reset();
 }
 
 RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const
@@ -329,7 +329,7 @@
 
     m_stopped = true;
     m_handler->setClient(nullptr);
-    m_handler.clear();
+    m_handler.reset();
 }
 
 // ActiveScriptWrappable
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 4e01dc0..8239e30 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -467,7 +467,7 @@
 {
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
-    m_peerHandler.clear();
+    m_peerHandler.reset();
 }
 
 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTCOfferOptions& options)
@@ -1134,7 +1134,7 @@
 
     m_dispatchScheduledEventRunner->stop();
 
-    m_peerHandler.clear();
+    m_peerHandler.reset();
 }
 
 void RTCPeerConnection::changeSignalingState(SignalingState signalingState)
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
index c8cbc89..41f05f7 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -68,7 +68,7 @@
         // ExecutionContext it received in |create|. Kill it to prevent
         // reference cycles involving a mix of GC and non-GC types that fail to
         // clear in ThreadState::cleanup.
-        m_threadableLoader.clear();
+        m_threadableLoader.reset();
     }
 }
 
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
index 3b3b8f8..96c8a22 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -87,7 +87,7 @@
     RefPtr<SkImage> skImage = m_imageBuffer->newSkImageSnapshot(PreferNoAcceleration, SnapshotReasonUnknown);
     RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(skImage.release());
     image->setOriginClean(this->originClean());
-    m_imageBuffer.clear(); // "Transfer" means no retained buffer
+    m_imageBuffer.reset(); // "Transfer" means no retained buffer
     return ImageBitmap::create(image.release());
 }
 
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
index bcccc7a..fbc9c84 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
@@ -154,7 +154,7 @@
 
     ~ServiceWorkerContainerTest()
     {
-        m_page.clear();
+        m_page.reset();
         V8GCController::collectAllGarbageForTesting(isolate());
     }
 
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index d567e00..6572f6d 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -116,7 +116,7 @@
 {
     // Promptly clears a raw reference from content/ to an on-heap object
     // so that content/ doesn't access it in a lazy sweeping phase.
-    m_handle.clear();
+    m_handle.reset();
 }
 
 DEFINE_TRACE(ServiceWorkerRegistration)
diff --git a/third_party/WebKit/Source/modules/storage/Storage.idl b/third_party/WebKit/Source/modules/storage/Storage.idl
index 0aded16c..8e88534 100644
--- a/third_party/WebKit/Source/modules/storage/Storage.idl
+++ b/third_party/WebKit/Source/modules/storage/Storage.idl
@@ -27,7 +27,7 @@
 
 [
 ] interface Storage {
-    // TODO(philipj): [NotEnumerable] should not be used anywhere in this interface.
+    // TODO(foolip): [NotEnumerable] should not be used anywhere in this interface.
     [NotEnumerable, RaisesException=Getter] readonly attribute unsigned long length;
     [NotEnumerable, RaisesException] DOMString? key(unsigned long index);
     [LogActivity, NotEnumerable, RaisesException] DOMString? getItem(DOMString key);
@@ -35,7 +35,7 @@
     [LogActivity, NotEnumerable, RaisesException] void removeItem(DOMString key);
     [LogActivity, NotEnumerable, RaisesException] void clear();
 
-    // TODO(philipj): Merge these into getItem/setItem/removeItem.
+    // TODO(foolip): Merge these into getItem/setItem/removeItem.
     [RaisesException] getter DOMString (DOMString name);
     [RaisesException] setter DOMString (DOMString name, DOMString value);
     [RaisesException] deleter boolean (DOMString name);
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp
index fcfa28d9..de36a35 100644
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp
@@ -253,12 +253,7 @@
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    AudioBufferSourceNode* node = AudioBufferSourceNode::create(*this, sampleRate());
+    AudioBufferSourceNode* node = AudioBufferSourceNode::create(*this, exceptionState);
 
     // Do not add a reference to this source node now. The reference will be added when start() is
     // called.
@@ -270,418 +265,183 @@
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    // First check if this media element already has a source node.
-    if (mediaElement->audioSourceNode()) {
-        exceptionState.throwDOMException(
-            InvalidStateError,
-            "HTMLMediaElement already connected previously to a different MediaElementSourceNode.");
-        return nullptr;
-    }
-
-    MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(*this, *mediaElement);
-
-    mediaElement->setAudioSourceNode(node);
-
-    notifySourceNodeStartedProcessing(node); // context keeps reference until node is disconnected
-    return node;
+    return MediaElementAudioSourceNode::create(*this, *mediaElement, exceptionState);
 }
 
 MediaStreamAudioSourceNode* AbstractAudioContext::createMediaStreamSource(MediaStream* mediaStream, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks();
-    if (audioTracks.isEmpty()) {
-        exceptionState.throwDOMException(
-            InvalidStateError,
-            "MediaStream has no audio track");
-        return nullptr;
-    }
-
-    // Use the first audio track in the media stream.
-    MediaStreamTrack* audioTrack = audioTracks[0];
-    OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource();
-    MediaStreamAudioSourceNode* node = MediaStreamAudioSourceNode::create(*this, *mediaStream, audioTrack, std::move(provider));
-
-    // FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams.
-    node->setFormat(2, sampleRate());
-
-    notifySourceNodeStartedProcessing(node); // context keeps reference until node is disconnected
-    return node;
+    return MediaStreamAudioSourceNode::create(*this, *mediaStream, exceptionState);
 }
 
 MediaStreamAudioDestinationNode* AbstractAudioContext::createMediaStreamDestination(ExceptionState& exceptionState)
 {
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
+    DCHECK(isMainThread());
 
     // Set number of output channels to stereo by default.
-    return MediaStreamAudioDestinationNode::create(*this, 2);
+    return MediaStreamAudioDestinationNode::create(*this, 2, exceptionState);
 }
 
 ScriptProcessorNode* AbstractAudioContext::createScriptProcessor(ExceptionState& exceptionState)
 {
-    // Set number of input/output channels to stereo by default.
-    return createScriptProcessor(0, 2, 2, exceptionState);
+    DCHECK(isMainThread());
+
+    return ScriptProcessorNode::create(*this, exceptionState);
 }
 
 ScriptProcessorNode* AbstractAudioContext::createScriptProcessor(size_t bufferSize, ExceptionState& exceptionState)
 {
-    // Set number of input/output channels to stereo by default.
-    return createScriptProcessor(bufferSize, 2, 2, exceptionState);
+    DCHECK(isMainThread());
+
+    return ScriptProcessorNode::create(*this, bufferSize, exceptionState);
 }
 
 ScriptProcessorNode* AbstractAudioContext::createScriptProcessor(size_t bufferSize, size_t numberOfInputChannels, ExceptionState& exceptionState)
 {
-    // Set number of output channels to stereo by default.
-    return createScriptProcessor(bufferSize, numberOfInputChannels, 2, exceptionState);
+    DCHECK(isMainThread());
+
+    return ScriptProcessorNode::create(*this, bufferSize, numberOfInputChannels, exceptionState);
 }
 
 ScriptProcessorNode* AbstractAudioContext::createScriptProcessor(size_t bufferSize, size_t numberOfInputChannels, size_t numberOfOutputChannels, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    ScriptProcessorNode* node = ScriptProcessorNode::create(*this, sampleRate(), bufferSize, numberOfInputChannels, numberOfOutputChannels);
-
-    if (!node) {
-        if (!numberOfInputChannels && !numberOfOutputChannels) {
-            exceptionState.throwDOMException(
-                IndexSizeError,
-                "number of input channels and output channels cannot both be zero.");
-        } else if (numberOfInputChannels > AbstractAudioContext::maxNumberOfChannels()) {
-            exceptionState.throwDOMException(
-                IndexSizeError,
-                "number of input channels (" + String::number(numberOfInputChannels)
-                + ") exceeds maximum ("
-                + String::number(AbstractAudioContext::maxNumberOfChannels()) + ").");
-        } else if (numberOfOutputChannels > AbstractAudioContext::maxNumberOfChannels()) {
-            exceptionState.throwDOMException(
-                IndexSizeError,
-                "number of output channels (" + String::number(numberOfInputChannels)
-                + ") exceeds maximum ("
-                + String::number(AbstractAudioContext::maxNumberOfChannels()) + ").");
-        } else {
-            exceptionState.throwDOMException(
-                IndexSizeError,
-                "buffer size (" + String::number(bufferSize)
-                + ") must be a power of two between 256 and 16384.");
-        }
-        return nullptr;
-    }
-
-    notifySourceNodeStartedProcessing(node); // context keeps reference until we stop making javascript rendering callbacks
-    return node;
+    return ScriptProcessorNode::create(
+        *this,
+        bufferSize,
+        numberOfInputChannels,
+        numberOfOutputChannels,
+        exceptionState);
 }
 
 StereoPannerNode* AbstractAudioContext::createStereoPanner(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return StereoPannerNode::create(*this, sampleRate());
+    return StereoPannerNode::create(*this, exceptionState);
 }
 
 BiquadFilterNode* AbstractAudioContext::createBiquadFilter(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return BiquadFilterNode::create(*this, sampleRate());
+    return BiquadFilterNode::create(*this, exceptionState);
 }
 
 WaveShaperNode* AbstractAudioContext::createWaveShaper(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return WaveShaperNode::create(*this);
+    return WaveShaperNode::create(*this, exceptionState);
 }
 
 PannerNode* AbstractAudioContext::createPanner(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return PannerNode::create(*this, sampleRate());
+    return PannerNode::create(*this, exceptionState);
 }
 
 ConvolverNode* AbstractAudioContext::createConvolver(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return ConvolverNode::create(*this, sampleRate());
+    return ConvolverNode::create(*this, exceptionState);
 }
 
 DynamicsCompressorNode* AbstractAudioContext::createDynamicsCompressor(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return DynamicsCompressorNode::create(*this, sampleRate());
+    return DynamicsCompressorNode::create(*this, exceptionState);
 }
 
 AnalyserNode* AbstractAudioContext::createAnalyser(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return AnalyserNode::create(*this, sampleRate());
+    return AnalyserNode::create(*this, exceptionState);
 }
 
 GainNode* AbstractAudioContext::createGain(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return GainNode::create(*this, sampleRate());
+    return GainNode::create(*this, exceptionState);
 }
 
 DelayNode* AbstractAudioContext::createDelay(ExceptionState& exceptionState)
 {
-    const double defaultMaxDelayTime = 1;
-    return createDelay(defaultMaxDelayTime, exceptionState);
+    DCHECK(isMainThread());
+
+    return DelayNode::create(*this, exceptionState);
 }
 
 DelayNode* AbstractAudioContext::createDelay(double maxDelayTime, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    return DelayNode::create(*this, sampleRate(), maxDelayTime, exceptionState);
+    return DelayNode::create(*this, maxDelayTime, exceptionState);
 }
 
 ChannelSplitterNode* AbstractAudioContext::createChannelSplitter(ExceptionState& exceptionState)
 {
-    const unsigned ChannelSplitterDefaultNumberOfOutputs = 6;
-    return createChannelSplitter(ChannelSplitterDefaultNumberOfOutputs, exceptionState);
+    DCHECK(isMainThread());
+
+    return ChannelSplitterNode::create(*this, exceptionState);
 }
 
 ChannelSplitterNode* AbstractAudioContext::createChannelSplitter(size_t numberOfOutputs, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    ChannelSplitterNode* node = ChannelSplitterNode::create(*this, sampleRate(), numberOfOutputs);
-
-    if (!node) {
-        exceptionState.throwDOMException(
-            IndexSizeError,
-            "number of outputs (" + String::number(numberOfOutputs)
-            + ") must be between 1 and "
-            + String::number(AbstractAudioContext::maxNumberOfChannels()) + ".");
-        return nullptr;
-    }
-
-    return node;
+    return ChannelSplitterNode::create(*this, numberOfOutputs, exceptionState);
 }
 
 ChannelMergerNode* AbstractAudioContext::createChannelMerger(ExceptionState& exceptionState)
 {
-    const unsigned ChannelMergerDefaultNumberOfInputs = 6;
-    return createChannelMerger(ChannelMergerDefaultNumberOfInputs, exceptionState);
+    DCHECK(isMainThread());
+
+    return ChannelMergerNode::create(*this, exceptionState);
 }
 
 ChannelMergerNode* AbstractAudioContext::createChannelMerger(size_t numberOfInputs, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    ChannelMergerNode* node = ChannelMergerNode::create(*this, sampleRate(), numberOfInputs);
-
-    if (!node) {
-        exceptionState.throwDOMException(
-            IndexSizeError,
-            ExceptionMessages::indexOutsideRange<size_t>(
-                "number of inputs",
-                numberOfInputs,
-                1,
-                ExceptionMessages::InclusiveBound,
-                AbstractAudioContext::maxNumberOfChannels(),
-                ExceptionMessages::InclusiveBound));
-        return nullptr;
-    }
-
-    return node;
+    return ChannelMergerNode::create(*this, numberOfInputs, exceptionState);
 }
 
 OscillatorNode* AbstractAudioContext::createOscillator(ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
 
-    OscillatorNode* node = OscillatorNode::create(*this, sampleRate());
-
-    // Do not add a reference to this source node now. The reference will be added when start() is
-    // called.
-
-    return node;
+    return OscillatorNode::create(*this, exceptionState);
 }
 
 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DOMFloat32Array* imag, ExceptionState& exceptionState)
 {
-    return PeriodicWave::create(sampleRate(), real, imag, false);
+    DCHECK(isMainThread());
+
+    return PeriodicWave::create(*this, real, imag, false, exceptionState);
 }
 
 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DOMFloat32Array* imag, const PeriodicWaveConstraints& options, ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    if (real->length() != imag->length()) {
-        exceptionState.throwDOMException(
-            IndexSizeError,
-            "length of real array (" + String::number(real->length())
-            + ") and length of imaginary array (" +  String::number(imag->length())
-            + ") must match.");
-        return nullptr;
-    }
-
     bool disable = options.hasDisableNormalization() ? options.disableNormalization() : false;
 
-    return PeriodicWave::create(sampleRate(), real, imag, disable);
+    return PeriodicWave::create(*this, real, imag, disable, exceptionState);
 }
 
 IIRFilterNode* AbstractAudioContext::createIIRFilter(Vector<double> feedforwardCoef, Vector<double> feedbackCoef,  ExceptionState& exceptionState)
 {
     ASSERT(isMainThread());
 
-    if (isContextClosed()) {
-        throwExceptionForClosedState(exceptionState);
-        return nullptr;
-    }
-
-    if (feedbackCoef.size() == 0 || (feedbackCoef.size() > IIRFilter::kMaxOrder + 1)) {
-        exceptionState.throwDOMException(
-            NotSupportedError,
-            ExceptionMessages::indexOutsideRange<size_t>(
-                "number of feedback coefficients",
-                feedbackCoef.size(),
-                1,
-                ExceptionMessages::InclusiveBound,
-                IIRFilter::kMaxOrder + 1,
-                ExceptionMessages::InclusiveBound));
-        return nullptr;
-    }
-
-    if (feedforwardCoef.size() == 0 || (feedforwardCoef.size() > IIRFilter::kMaxOrder + 1)) {
-        exceptionState.throwDOMException(
-            NotSupportedError,
-            ExceptionMessages::indexOutsideRange<size_t>(
-                "number of feedforward coefficients",
-                feedforwardCoef.size(),
-                1,
-                ExceptionMessages::InclusiveBound,
-                IIRFilter::kMaxOrder + 1,
-                ExceptionMessages::InclusiveBound));
-        return nullptr;
-    }
-
-    if (feedbackCoef[0] == 0) {
-        exceptionState.throwDOMException(
-            InvalidStateError,
-            "First feedback coefficient cannot be zero.");
-        return nullptr;
-    }
-
-    bool hasNonZeroCoef = false;
-
-    for (size_t k = 0; k < feedforwardCoef.size(); ++k) {
-        if (feedforwardCoef[k] != 0) {
-            hasNonZeroCoef = true;
-            break;
-        }
-    }
-
-    if (!hasNonZeroCoef) {
-        exceptionState.throwDOMException(
-            InvalidStateError,
-            "At least one feedforward coefficient must be non-zero.");
-        return nullptr;
-    }
-
-    // Make sure all coefficents are finite.
-    for (size_t k = 0; k < feedforwardCoef.size(); ++k) {
-        double c = feedforwardCoef[k];
-        if (!std::isfinite(c)) {
-            String name = "feedforward coefficient " + String::number(k);
-            exceptionState.throwDOMException(
-                InvalidStateError,
-                ExceptionMessages::notAFiniteNumber(c, name.ascii().data()));
-            return nullptr;
-        }
-    }
-
-    for (size_t k = 0; k < feedbackCoef.size(); ++k) {
-        double c = feedbackCoef[k];
-        if (!std::isfinite(c)) {
-            String name = "feedback coefficient " + String::number(k);
-            exceptionState.throwDOMException(
-                InvalidStateError,
-                ExceptionMessages::notAFiniteNumber(c, name.ascii().data()));
-            return nullptr;
-        }
-    }
-
-    return IIRFilterNode::create(*this, sampleRate(), feedforwardCoef, feedbackCoef);
+    return IIRFilterNode::create(*this, feedforwardCoef, feedbackCoef, exceptionState);
 }
 
 PeriodicWave* AbstractAudioContext::periodicWave(int type)
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
index df197dd..53c158f 100644
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
@@ -135,6 +135,7 @@
 
     String state() const;
     AudioContextState contextState() const { return m_contextState; }
+    void throwExceptionForClosedState(ExceptionState&);
 
     AudioBuffer* createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState&);
 
@@ -293,8 +294,6 @@
     bool m_isCleared;
     void clear();
 
-    void throwExceptionForClosedState(ExceptionState&);
-
     // When the context goes away, there might still be some sources which
     // haven't finished playing.  Make sure to release them here.
     void releaseActiveSourceNodes();
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
index d98f25cd..4340364 100644
--- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
@@ -113,15 +113,22 @@
 
 // ----------------------------------------------------------------
 
-AnalyserNode::AnalyserNode(AbstractAudioContext& context, float sampleRate)
+AnalyserNode::AnalyserNode(AbstractAudioContext& context)
     : AudioBasicInspectorNode(context)
 {
-    setHandler(AnalyserHandler::create(*this, sampleRate));
+    setHandler(AnalyserHandler::create(*this, context.sampleRate()));
 }
 
-AnalyserNode* AnalyserNode::create(AbstractAudioContext& context, float sampleRate)
+AnalyserNode* AnalyserNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new AnalyserNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new AnalyserNode(context);
 }
 
 AnalyserHandler& AnalyserNode::analyserHandler() const
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h
index ef52682..dd373b1 100644
--- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h
@@ -76,7 +76,7 @@
 class AnalyserNode final : public AudioBasicInspectorNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static AnalyserNode* create(AbstractAudioContext&, float sampleRate);
+    static AnalyserNode* create(AbstractAudioContext&, ExceptionState&);
 
     unsigned fftSize() const;
     void setFftSize(unsigned size, ExceptionState&);
@@ -93,7 +93,7 @@
     void getByteTimeDomainData(DOMUint8Array*);
 
 private:
-    AnalyserNode(AbstractAudioContext&, float sampleRate);
+    AnalyserNode(AbstractAudioContext&);
     AnalyserHandler& analyserHandler() const;
 };
 
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp
index ed24376..c1ff657 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -581,17 +581,28 @@
 }
 
 // ----------------------------------------------------------------
-AudioBufferSourceNode::AudioBufferSourceNode(AbstractAudioContext& context, float sampleRate)
+AudioBufferSourceNode::AudioBufferSourceNode(AbstractAudioContext& context)
     : AudioScheduledSourceNode(context)
     , m_playbackRate(AudioParam::create(context, ParamTypeAudioBufferSourcePlaybackRate, 1.0))
     , m_detune(AudioParam::create(context, ParamTypeAudioBufferSourceDetune, 0.0))
 {
-    setHandler(AudioBufferSourceHandler::create(*this, sampleRate, m_playbackRate->handler(), m_detune->handler()));
+    setHandler(AudioBufferSourceHandler::create(
+        *this,
+        context.sampleRate(),
+        m_playbackRate->handler(),
+        m_detune->handler()));
 }
 
-AudioBufferSourceNode* AudioBufferSourceNode::create(AbstractAudioContext& context, float sampleRate)
+AudioBufferSourceNode* AudioBufferSourceNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new AudioBufferSourceNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new AudioBufferSourceNode(context);
 }
 
 DEFINE_TRACE(AudioBufferSourceNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
index 8b355ba1..35f1c1e4 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h
@@ -141,7 +141,7 @@
 class AudioBufferSourceNode final : public AudioScheduledSourceNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static AudioBufferSourceNode* create(AbstractAudioContext&, float sampleRate);
+    static AudioBufferSourceNode* create(AbstractAudioContext&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
     AudioBufferSourceHandler& audioBufferSourceHandler() const;
 
@@ -162,7 +162,7 @@
     void start(double when, double grainOffset, double grainDuration, ExceptionState&);
 
 private:
-    AudioBufferSourceNode(AbstractAudioContext&, float sampleRate);
+    AudioBufferSourceNode(AbstractAudioContext&);
 
     Member<AudioParam> m_playbackRate;
     Member<AudioParam> m_detune;
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
index 9d6fda8..f534842 100644
--- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
@@ -27,20 +27,42 @@
 
 namespace blink {
 
-BiquadFilterNode::BiquadFilterNode(AbstractAudioContext& context, float sampleRate)
+BiquadFilterNode::BiquadFilterNode(AbstractAudioContext& context)
     : AudioNode(context)
-    , m_frequency(AudioParam::create(context, ParamTypeBiquadFilterFrequency, 350.0, 0, sampleRate / 2))
+    , m_frequency(AudioParam::create(context, ParamTypeBiquadFilterFrequency, 350.0, 0, context.sampleRate() / 2))
     , m_q(AudioParam::create(context, ParamTypeBiquadFilterQ, 1.0))
     , m_gain(AudioParam::create(context, ParamTypeBiquadFilterGain, 0.0))
     , m_detune(AudioParam::create(context, ParamTypeBiquadFilterDetune, 0.0))
 {
-    setHandler(AudioBasicProcessorHandler::create(AudioHandler::NodeTypeBiquadFilter, *this, sampleRate, adoptPtr(new BiquadProcessor(sampleRate, 1, m_frequency->handler(), m_q->handler(), m_gain->handler(), m_detune->handler()))));
+    setHandler(AudioBasicProcessorHandler::create(
+        AudioHandler::NodeTypeBiquadFilter,
+        *this,
+        context.sampleRate(),
+        adoptPtr(new BiquadProcessor(
+            context.sampleRate(),
+            1,
+            m_frequency->handler(),
+            m_q->handler(),
+            m_gain->handler(),
+            m_detune->handler()))));
 
     // Explicitly set the filter type so that any histograms get updated with the default value.
     // Otherwise, the histogram won't ever show it.
     setType("lowpass");
 }
 
+BiquadFilterNode* BiquadFilterNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new BiquadFilterNode(context);
+}
+
 DEFINE_TRACE(BiquadFilterNode)
 {
     visitor->trace(m_frequency);
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h
index 1119629..f75c80c 100644
--- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h
@@ -49,10 +49,8 @@
         ALLPASS = 7
     };
 
-    static BiquadFilterNode* create(AbstractAudioContext& context, float sampleRate)
-    {
-        return new BiquadFilterNode(context, sampleRate);
-    }
+    static BiquadFilterNode* create(AbstractAudioContext&, ExceptionState&);
+
     DECLARE_VIRTUAL_TRACE();
 
     String type() const;
@@ -68,7 +66,7 @@
     void getFrequencyResponse(const DOMFloat32Array* frequencyHz, DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse);
 
 private:
-    BiquadFilterNode(AbstractAudioContext&, float sampleRate);
+    BiquadFilterNode(AbstractAudioContext&);
 
     BiquadProcessor* getBiquadProcessor() const;
     bool setType(unsigned); // Returns true on success.
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp
index b2f54ce..ecdecdb 100644
--- a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.cpp
@@ -119,17 +119,43 @@
 
 // ----------------------------------------------------------------
 
-ChannelMergerNode::ChannelMergerNode(AbstractAudioContext& context, float sampleRate, unsigned numberOfInputs)
+ChannelMergerNode::ChannelMergerNode(AbstractAudioContext& context, unsigned numberOfInputs)
     : AudioNode(context)
 {
-    setHandler(ChannelMergerHandler::create(*this, sampleRate, numberOfInputs));
+    setHandler(ChannelMergerHandler::create(*this, context.sampleRate(), numberOfInputs));
 }
 
-ChannelMergerNode* ChannelMergerNode::create(AbstractAudioContext& context, float sampleRate, unsigned numberOfInputs)
+ChannelMergerNode* ChannelMergerNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    if (!numberOfInputs || numberOfInputs > AbstractAudioContext::maxNumberOfChannels())
+    DCHECK(isMainThread());
+
+    // The default number of inputs for the merger node is 6.
+    return create(context, 6, exceptionState);
+}
+
+ChannelMergerNode* ChannelMergerNode::create(AbstractAudioContext& context, unsigned numberOfInputs, ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
         return nullptr;
-    return new ChannelMergerNode(context, sampleRate, numberOfInputs);
+    }
+
+    if (!numberOfInputs || numberOfInputs > AbstractAudioContext::maxNumberOfChannels()) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            ExceptionMessages::indexOutsideRange<size_t>(
+                "number of inputs",
+                numberOfInputs,
+                1,
+                ExceptionMessages::InclusiveBound,
+                AbstractAudioContext::maxNumberOfChannels(),
+                ExceptionMessages::InclusiveBound));
+        return nullptr;
+    }
+
+    return new ChannelMergerNode(context, numberOfInputs);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h
index eaab17e..009ba99 100644
--- a/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.h
@@ -51,10 +51,11 @@
 class ChannelMergerNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static ChannelMergerNode* create(AbstractAudioContext&, float sampleRate, unsigned numberOfInputs);
+    static ChannelMergerNode* create(AbstractAudioContext&, ExceptionState&);
+    static ChannelMergerNode* create(AbstractAudioContext&, unsigned numberOfInputs, ExceptionState&);
 
 private:
-    ChannelMergerNode(AbstractAudioContext&, float sampleRate, unsigned numberOfInputs);
+    ChannelMergerNode(AbstractAudioContext&, unsigned numberOfInputs);
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp
index 046aa7c..0b6d715 100644
--- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp
@@ -23,6 +23,9 @@
  */
 
 #include "modules/webaudio/ChannelSplitterNode.h"
+#include "bindings/core/v8/ExceptionMessages.h"
+#include "bindings/core/v8/ExceptionState.h"
+#include "core/dom/ExceptionCode.h"
 #include "modules/webaudio/AbstractAudioContext.h"
 #include "modules/webaudio/AudioNodeInput.h"
 #include "modules/webaudio/AudioNodeOutput.h"
@@ -71,17 +74,43 @@
 
 // ----------------------------------------------------------------
 
-ChannelSplitterNode::ChannelSplitterNode(AbstractAudioContext& context, float sampleRate, unsigned numberOfOutputs)
+ChannelSplitterNode::ChannelSplitterNode(AbstractAudioContext& context, unsigned numberOfOutputs)
     : AudioNode(context)
 {
-    setHandler(ChannelSplitterHandler::create(*this, sampleRate, numberOfOutputs));
+    setHandler(ChannelSplitterHandler::create(*this, context.sampleRate(), numberOfOutputs));
 }
 
-ChannelSplitterNode* ChannelSplitterNode::create(AbstractAudioContext& context, float sampleRate, unsigned numberOfOutputs)
+ChannelSplitterNode* ChannelSplitterNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    if (!numberOfOutputs || numberOfOutputs > AbstractAudioContext::maxNumberOfChannels())
+    DCHECK(isMainThread());
+
+    // Default number of outputs for the splitter node is 6.
+    return create(context, 6, exceptionState);
+}
+
+ChannelSplitterNode* ChannelSplitterNode::create(AbstractAudioContext& context, unsigned numberOfOutputs, ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
         return nullptr;
-    return new ChannelSplitterNode(context, sampleRate, numberOfOutputs);
+    }
+
+    if (!numberOfOutputs || numberOfOutputs > AbstractAudioContext::maxNumberOfChannels()) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            ExceptionMessages::indexOutsideRange<size_t>(
+                "number of outputs",
+                numberOfOutputs,
+                1,
+                ExceptionMessages::InclusiveBound,
+                AbstractAudioContext::maxNumberOfChannels(),
+                ExceptionMessages::InclusiveBound));
+        return nullptr;
+    }
+
+    return new ChannelSplitterNode(context, numberOfOutputs);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h
index 5548eca..d210c89 100644
--- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h
@@ -46,10 +46,11 @@
 class ChannelSplitterNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static ChannelSplitterNode* create(AbstractAudioContext&, float sampleRate, unsigned numberOfOutputs);
+    static ChannelSplitterNode* create(AbstractAudioContext&, ExceptionState&);
+    static ChannelSplitterNode* create(AbstractAudioContext&, unsigned numberOfOutputs, ExceptionState&);
 
 private:
-    ChannelSplitterNode(AbstractAudioContext&, float sampleRate, unsigned numberOfOutputs);
+    ChannelSplitterNode(AbstractAudioContext&, unsigned numberOfOutputs);
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
index 3f714f3..3413e7a 100644
--- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
@@ -165,15 +165,22 @@
 
 // ----------------------------------------------------------------
 
-ConvolverNode::ConvolverNode(AbstractAudioContext& context, float sampleRate)
+ConvolverNode::ConvolverNode(AbstractAudioContext& context)
     : AudioNode(context)
 {
-    setHandler(ConvolverHandler::create(*this, sampleRate));
+    setHandler(ConvolverHandler::create(*this, context.sampleRate()));
 }
 
-ConvolverNode* ConvolverNode::create(AbstractAudioContext& context, float sampleRate)
+ConvolverNode* ConvolverNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new ConvolverNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new ConvolverNode(context);
 }
 
 ConvolverHandler& ConvolverNode::convolverHandler() const
diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h
index 7ad656e..294fde6 100644
--- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.h
@@ -75,7 +75,7 @@
 class MODULES_EXPORT ConvolverNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static ConvolverNode* create(AbstractAudioContext&, float sampleRate);
+    static ConvolverNode* create(AbstractAudioContext&, ExceptionState&);
 
     AudioBuffer* buffer() const;
     void setBuffer(AudioBuffer*, ExceptionState&);
@@ -83,7 +83,7 @@
     void setNormalize(bool);
 
 private:
-    ConvolverNode(AbstractAudioContext&, float sampleRate);
+    ConvolverNode(AbstractAudioContext&);
     ConvolverHandler& convolverHandler() const;
 
     FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime);
diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
index bbe233fa5..b8d530f 100644
--- a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
@@ -34,15 +34,38 @@
 
 const double maximumAllowedDelayTime = 180;
 
-DelayNode::DelayNode(AbstractAudioContext& context, float sampleRate, double maxDelayTime)
+DelayNode::DelayNode(AbstractAudioContext& context, double maxDelayTime)
     : AudioNode(context)
     , m_delayTime(AudioParam::create(context, ParamTypeDelayDelayTime, 0.0, 0.0, maxDelayTime))
 {
-    setHandler(AudioBasicProcessorHandler::create(AudioHandler::NodeTypeDelay, *this, sampleRate, adoptPtr(new DelayProcessor(sampleRate, 1, m_delayTime->handler(), maxDelayTime))));
+    setHandler(AudioBasicProcessorHandler::create(
+        AudioHandler::NodeTypeDelay,
+        *this,
+        context.sampleRate(),
+        adoptPtr(new DelayProcessor(
+            context.sampleRate(),
+            1,
+            m_delayTime->handler(),
+            maxDelayTime))));
 }
 
-DelayNode* DelayNode::create(AbstractAudioContext& context, float sampleRate, double maxDelayTime, ExceptionState& exceptionState)
+DelayNode* DelayNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
+    DCHECK(isMainThread());
+
+    // The default maximum delay time for the delay node is 1 sec.
+    return create(context, 1, exceptionState);
+}
+
+DelayNode* DelayNode::create(AbstractAudioContext& context, double maxDelayTime, ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
     if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) {
         exceptionState.throwDOMException(
             NotSupportedError,
@@ -55,7 +78,8 @@
                 ExceptionMessages::ExclusiveBound));
         return nullptr;
     }
-    return new DelayNode(context, sampleRate, maxDelayTime);
+
+    return new DelayNode(context, maxDelayTime);
 }
 
 AudioParam* DelayNode::delayTime()
diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.h b/third_party/WebKit/Source/modules/webaudio/DelayNode.h
index 03d0188..a697871a 100644
--- a/third_party/WebKit/Source/modules/webaudio/DelayNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.h
@@ -35,12 +35,13 @@
 class DelayNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static DelayNode* create(AbstractAudioContext&, float sampleRate, double maxDelayTime, ExceptionState&);
+    static DelayNode* create(AbstractAudioContext&, ExceptionState&);
+    static DelayNode* create(AbstractAudioContext&, double maxDelayTime, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
     AudioParam* delayTime();
 
 private:
-    DelayNode(AbstractAudioContext&, float sampleRate, double maxDelayTime);
+    DelayNode(AbstractAudioContext&, double maxDelayTime);
 
     Member<AudioParam> m_delayTime;
 };
diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp
index 63b5dad..b259ddb 100644
--- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp
@@ -125,7 +125,7 @@
 
 // ----------------------------------------------------------------
 
-DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context, float sampleRate)
+DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context)
     : AudioNode(context)
     , m_threshold(AudioParam::create(context, ParamTypeDynamicsCompressorThreshold, -24, -100, 0))
     , m_knee(AudioParam::create(context, ParamTypeDynamicsCompressorKnee, 30, 0, 40))
@@ -135,7 +135,7 @@
 {
     setHandler(DynamicsCompressorHandler::create(
         *this,
-        sampleRate,
+        context.sampleRate(),
         m_threshold->handler(),
         m_knee->handler(),
         m_ratio->handler(),
@@ -143,9 +143,16 @@
         m_release->handler()));
 }
 
-DynamicsCompressorNode* DynamicsCompressorNode::create(AbstractAudioContext& context, float sampleRate)
+DynamicsCompressorNode* DynamicsCompressorNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new DynamicsCompressorNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new DynamicsCompressorNode(context);
 }
 
 DEFINE_TRACE(DynamicsCompressorNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h
index a098272..6eb63ca 100644
--- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.h
@@ -81,7 +81,7 @@
 class MODULES_EXPORT DynamicsCompressorNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static DynamicsCompressorNode* create(AbstractAudioContext&, float sampleRate);
+    static DynamicsCompressorNode* create(AbstractAudioContext&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
 
     AudioParam* threshold() const;
@@ -92,7 +92,7 @@
     AudioParam* release() const;
 
 private:
-    DynamicsCompressorNode(AbstractAudioContext&, float sampleRate);
+    DynamicsCompressorNode(AbstractAudioContext&);
     DynamicsCompressorHandler& dynamicsCompressorHandler() const;
 
     Member<AudioParam> m_threshold;
diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
index 6c8ad44..bada5970 100644
--- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
@@ -114,16 +114,23 @@
 
 // ----------------------------------------------------------------
 
-GainNode::GainNode(AbstractAudioContext& context, float sampleRate)
+GainNode::GainNode(AbstractAudioContext& context)
     : AudioNode(context)
     , m_gain(AudioParam::create(context, ParamTypeGainGain, 1.0))
 {
-    setHandler(GainHandler::create(*this, sampleRate, m_gain->handler()));
+    setHandler(GainHandler::create(*this, context.sampleRate(), m_gain->handler()));
 }
 
-GainNode* GainNode::create(AbstractAudioContext& context, float sampleRate)
+GainNode* GainNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new GainNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new GainNode(context);
 }
 
 AudioParam* GainNode::gain() const
diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.h b/third_party/WebKit/Source/modules/webaudio/GainNode.h
index da401a65..7fea960 100644
--- a/third_party/WebKit/Source/modules/webaudio/GainNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/GainNode.h
@@ -59,13 +59,13 @@
 class GainNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static GainNode* create(AbstractAudioContext&, float sampleRate);
+    static GainNode* create(AbstractAudioContext&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
 
     AudioParam* gain() const;
 
 private:
-    GainNode(AbstractAudioContext&, float sampleRate);
+    GainNode(AbstractAudioContext&);
 
     Member<AudioParam> m_gain;
 };
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
index 401e199..bde304df 100644
--- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
@@ -7,17 +7,18 @@
 #include "bindings/core/v8/ExceptionMessages.h"
 #include "bindings/core/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
+#include "modules/webaudio/AbstractAudioContext.h"
 #include "modules/webaudio/AudioBasicProcessorHandler.h"
 #include "platform/Histogram.h"
 
 namespace blink {
 
-IIRFilterNode::IIRFilterNode(AbstractAudioContext& context, float sampleRate, const Vector<double> feedforwardCoef, const Vector<double> feedbackCoef)
+IIRFilterNode::IIRFilterNode(AbstractAudioContext& context, const Vector<double> feedforwardCoef, const Vector<double> feedbackCoef)
     : AudioNode(context)
 {
     setHandler(AudioBasicProcessorHandler::create(
-        AudioHandler::NodeTypeIIRFilter, *this, sampleRate,
-        adoptPtr(new IIRProcessor(sampleRate, 1, feedforwardCoef, feedbackCoef))));
+        AudioHandler::NodeTypeIIRFilter, *this, context.sampleRate(),
+        adoptPtr(new IIRProcessor(context.sampleRate(), 1, feedforwardCoef, feedbackCoef))));
 
     // Histogram of the IIRFilter order.  createIIRFilter ensures that the length of |feedbackCoef|
     // is in the range [1, IIRFilter::kMaxOrder + 1].  The order is one less than the length of this
@@ -27,6 +28,94 @@
     filterOrderHistogram.sample(feedbackCoef.size() - 1);
 }
 
+IIRFilterNode* IIRFilterNode::create(
+    AbstractAudioContext& context,
+    const Vector<double> feedforwardCoef,
+    const Vector<double> feedbackCoef,
+    ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    if (feedbackCoef.size() == 0 || (feedbackCoef.size() > IIRFilter::kMaxOrder + 1)) {
+        exceptionState.throwDOMException(
+            NotSupportedError,
+            ExceptionMessages::indexOutsideRange<size_t>(
+                "number of feedback coefficients",
+                feedbackCoef.size(),
+                1,
+                ExceptionMessages::InclusiveBound,
+                IIRFilter::kMaxOrder + 1,
+                ExceptionMessages::InclusiveBound));
+        return nullptr;
+    }
+
+    if (feedforwardCoef.size() == 0 || (feedforwardCoef.size() > IIRFilter::kMaxOrder + 1)) {
+        exceptionState.throwDOMException(
+            NotSupportedError,
+            ExceptionMessages::indexOutsideRange<size_t>(
+                "number of feedforward coefficients",
+                feedforwardCoef.size(),
+                1,
+                ExceptionMessages::InclusiveBound,
+                IIRFilter::kMaxOrder + 1,
+                ExceptionMessages::InclusiveBound));
+        return nullptr;
+    }
+
+    if (feedbackCoef[0] == 0) {
+        exceptionState.throwDOMException(
+            InvalidStateError,
+            "First feedback coefficient cannot be zero.");
+        return nullptr;
+    }
+
+    bool hasNonZeroCoef = false;
+
+    for (size_t k = 0; k < feedforwardCoef.size(); ++k) {
+        if (feedforwardCoef[k] != 0) {
+            hasNonZeroCoef = true;
+            break;
+        }
+    }
+
+    if (!hasNonZeroCoef) {
+        exceptionState.throwDOMException(
+            InvalidStateError,
+            "At least one feedforward coefficient must be non-zero.");
+        return nullptr;
+    }
+
+    // Make sure all coefficents are finite.
+    for (size_t k = 0; k < feedforwardCoef.size(); ++k) {
+        double c = feedforwardCoef[k];
+        if (!std::isfinite(c)) {
+            String name = "feedforward coefficient " + String::number(k);
+            exceptionState.throwDOMException(
+                InvalidStateError,
+                ExceptionMessages::notAFiniteNumber(c, name.ascii().data()));
+            return nullptr;
+        }
+    }
+
+    for (size_t k = 0; k < feedbackCoef.size(); ++k) {
+        double c = feedbackCoef[k];
+        if (!std::isfinite(c)) {
+            String name = "feedback coefficient " + String::number(k);
+            exceptionState.throwDOMException(
+                InvalidStateError,
+                ExceptionMessages::notAFiniteNumber(c, name.ascii().data()));
+            return nullptr;
+        }
+    }
+
+    return new IIRFilterNode(context, feedforwardCoef, feedbackCoef);
+}
+
 DEFINE_TRACE(IIRFilterNode)
 {
     AudioNode::trace(visitor);
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h
index b25f058..761e7e3 100644
--- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h
@@ -17,10 +17,12 @@
 class IIRFilterNode : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static IIRFilterNode* create(AbstractAudioContext& context, float sampleRate, const Vector<double> feedforward, const Vector<double> feedback)
-    {
-        return new IIRFilterNode(context, sampleRate, feedforward, feedback);
-    }
+    static IIRFilterNode* create(
+        AbstractAudioContext&,
+        const Vector<double> feedforward,
+        const Vector<double> feedback,
+        ExceptionState&);
+
     DECLARE_VIRTUAL_TRACE();
 
     // Get the magnitude and phase response of the filter at the given
@@ -28,7 +30,7 @@
     void getFrequencyResponse(const DOMFloat32Array* frequencyHz, DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse, ExceptionState&);
 
 private:
-    IIRFilterNode(AbstractAudioContext&, float sampleRate, const Vector<double> denominator, const Vector<double> numerator);
+    IIRFilterNode(AbstractAudioContext&, const Vector<double> denominator, const Vector<double> numerator);
 
     IIRProcessor* iirProcessor() const;
 };
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index a469186..c1fb73a 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -93,7 +93,7 @@
             m_multiChannelResampler = adoptPtr(new MultiChannelResampler(scaleFactor, numberOfChannels));
         } else {
             // Bypass resampling.
-            m_multiChannelResampler.clear();
+            m_multiChannelResampler.reset();
         }
 
         {
@@ -206,9 +206,32 @@
     setHandler(MediaElementAudioSourceHandler::create(*this, mediaElement));
 }
 
-MediaElementAudioSourceNode* MediaElementAudioSourceNode::create(AbstractAudioContext& context, HTMLMediaElement& mediaElement)
+MediaElementAudioSourceNode* MediaElementAudioSourceNode::create(AbstractAudioContext& context, HTMLMediaElement& mediaElement, ExceptionState& exceptionState)
 {
-    return new MediaElementAudioSourceNode(context, mediaElement);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    // First check if this media element already has a source node.
+    if (mediaElement.audioSourceNode()) {
+        exceptionState.throwDOMException(
+            InvalidStateError,
+            "HTMLMediaElement already connected previously to a different MediaElementSourceNode.");
+        return nullptr;
+    }
+
+    MediaElementAudioSourceNode* node = new MediaElementAudioSourceNode(context, mediaElement);
+
+    if (node) {
+        mediaElement.setAudioSourceNode(node);
+        // context keeps reference until node is disconnected
+        context.notifySourceNodeStartedProcessing(node);
+    }
+
+    return node;
 }
 
 DEFINE_TRACE(MediaElementAudioSourceNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
index 63e8a8d..c0181005 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
@@ -100,7 +100,7 @@
     DEFINE_WRAPPERTYPEINFO();
     USING_GARBAGE_COLLECTED_MIXIN(MediaElementAudioSourceNode);
 public:
-    static MediaElementAudioSourceNode* create(AbstractAudioContext&, HTMLMediaElement&);
+    static MediaElementAudioSourceNode* create(AbstractAudioContext&, HTMLMediaElement&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
     MediaElementAudioSourceHandler& mediaElementAudioSourceHandler() const;
 
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp
index 1579cf3..efa097e7 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp
@@ -122,8 +122,15 @@
     setHandler(MediaStreamAudioDestinationHandler::create(*this, numberOfChannels));
 }
 
-MediaStreamAudioDestinationNode* MediaStreamAudioDestinationNode::create(AbstractAudioContext& context, size_t numberOfChannels)
+MediaStreamAudioDestinationNode* MediaStreamAudioDestinationNode::create(AbstractAudioContext& context, size_t numberOfChannels, ExceptionState& exceptionState)
 {
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
     return new MediaStreamAudioDestinationNode(context, numberOfChannels);
 }
 
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h
index 0f034ab..cf4989d 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.h
@@ -65,7 +65,7 @@
 class MediaStreamAudioDestinationNode final : public AudioBasicInspectorNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static MediaStreamAudioDestinationNode* create(AbstractAudioContext&, size_t numberOfChannels);
+    static MediaStreamAudioDestinationNode* create(AbstractAudioContext&, size_t numberOfChannels, ExceptionState&);
     MediaStream* stream() const;
 
 private:
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
index a1b62a1..0a911f61 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
@@ -23,6 +23,8 @@
  */
 
 #include "modules/webaudio/MediaStreamAudioSourceNode.h"
+
+#include "core/dom/ExceptionCode.h"
 #include "modules/webaudio/AbstractAudioContext.h"
 #include "modules/webaudio/AudioNodeOutput.h"
 #include "platform/Logging.h"
@@ -114,9 +116,39 @@
     setHandler(MediaStreamAudioSourceHandler::create(*this, mediaStream, audioTrack, std::move(audioSourceProvider)));
 }
 
-MediaStreamAudioSourceNode* MediaStreamAudioSourceNode::create(AbstractAudioContext& context, MediaStream& mediaStream, MediaStreamTrack* audioTrack, PassOwnPtr<AudioSourceProvider> audioSourceProvider)
+MediaStreamAudioSourceNode* MediaStreamAudioSourceNode::create(AbstractAudioContext& context, MediaStream& mediaStream, ExceptionState& exceptionState)
 {
-    return new MediaStreamAudioSourceNode(context, mediaStream, audioTrack, std::move(audioSourceProvider));
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    MediaStreamTrackVector audioTracks = mediaStream.getAudioTracks();
+    if (audioTracks.isEmpty()) {
+        exceptionState.throwDOMException(
+            InvalidStateError,
+            "MediaStream has no audio track");
+        return nullptr;
+    }
+
+    // Use the first audio track in the media stream.
+    MediaStreamTrack* audioTrack = audioTracks[0];
+    OwnPtr<AudioSourceProvider> provider = audioTrack->createWebAudioSource();
+
+    MediaStreamAudioSourceNode* node = new MediaStreamAudioSourceNode(context, mediaStream, audioTrack, std::move(provider));
+
+    if (!node)
+        return nullptr;
+
+    // TODO(hongchan): Only stereo streams are supported right now. We should be
+    // able to accept multi-channel streams.
+    node->setFormat(2, context.sampleRate());
+    // context keeps reference until node is disconnected
+    context.notifySourceNodeStartedProcessing(node);
+
+    return node;
 }
 
 DEFINE_TRACE(MediaStreamAudioSourceNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h
index 4786ec4..da461bc 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h
@@ -73,7 +73,7 @@
     DEFINE_WRAPPERTYPEINFO();
     USING_GARBAGE_COLLECTED_MIXIN(MediaStreamAudioSourceNode);
 public:
-    static MediaStreamAudioSourceNode* create(AbstractAudioContext&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>);
+    static MediaStreamAudioSourceNode* create(AbstractAudioContext&, MediaStream&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
     MediaStreamAudioSourceHandler& mediaStreamAudioSourceHandler() const;
 
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index 04edef24..c89d97b 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -81,7 +81,7 @@
         return;
 
     if (m_renderThread)
-        m_renderThread.clear();
+        m_renderThread.reset();
 
     AudioHandler::uninitialize();
 }
diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
index 3dc83b3..e9deeba 100644
--- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
@@ -330,19 +330,26 @@
 
 // ----------------------------------------------------------------
 
-OscillatorNode::OscillatorNode(AbstractAudioContext& context, float sampleRate)
+OscillatorNode::OscillatorNode(AbstractAudioContext& context)
     : AudioScheduledSourceNode(context)
     // Use musical pitch standard A440 as a default.
-    , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440, 0, sampleRate / 2))
+    , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440, 0, context.sampleRate() / 2))
     // Default to no detuning.
     , m_detune(AudioParam::create(context, ParamTypeOscillatorDetune, 0))
 {
-    setHandler(OscillatorHandler::create(*this, sampleRate, m_frequency->handler(), m_detune->handler()));
+    setHandler(OscillatorHandler::create(*this, context.sampleRate(), m_frequency->handler(), m_detune->handler()));
 }
 
-OscillatorNode* OscillatorNode::create(AbstractAudioContext& context, float sampleRate)
+OscillatorNode* OscillatorNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new OscillatorNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new OscillatorNode(context);
 }
 
 DEFINE_TRACE(OscillatorNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h
index d80f27dc8..841bad2 100644
--- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.h
@@ -100,7 +100,7 @@
 class OscillatorNode final : public AudioScheduledSourceNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static OscillatorNode* create(AbstractAudioContext&, float sampleRate);
+    static OscillatorNode* create(AbstractAudioContext&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
 
     String type() const;
@@ -110,7 +110,7 @@
     void setPeriodicWave(PeriodicWave*);
 
 private:
-    OscillatorNode(AbstractAudioContext&, float sampleRate);
+    OscillatorNode(AbstractAudioContext&);
     OscillatorHandler& oscillatorHandler() const;
 
     Member<AudioParam> m_frequency;
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
index fe27df43..3318bed2d 100644
--- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
@@ -250,7 +250,7 @@
     if (!isInitialized())
         return;
 
-    m_panner.clear();
+    m_panner.reset();
     listener()->removePanner(*this);
 
     AudioHandler::uninitialize();
@@ -632,7 +632,7 @@
 }
 // ----------------------------------------------------------------
 
-PannerNode::PannerNode(AbstractAudioContext& context, float sampleRate)
+PannerNode::PannerNode(AbstractAudioContext& context)
     : AudioNode(context)
     , m_positionX(AudioParam::create(context, ParamTypePannerPositionX, 0.0))
     , m_positionY(AudioParam::create(context, ParamTypePannerPositionY, 0.0))
@@ -643,7 +643,7 @@
 {
     setHandler(PannerHandler::create(
         *this,
-        sampleRate,
+        context.sampleRate(),
         m_positionX->handler(),
         m_positionY->handler(),
         m_positionZ->handler(),
@@ -652,9 +652,16 @@
         m_orientationZ->handler()));
 }
 
-PannerNode* PannerNode::create(AbstractAudioContext& context, float sampleRate)
+PannerNode* PannerNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new PannerNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new PannerNode(context);
 }
 
 PannerHandler& PannerNode::pannerHandler() const
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.h b/third_party/WebKit/Source/modules/webaudio/PannerNode.h
index 920f0ea..e360a27 100644
--- a/third_party/WebKit/Source/modules/webaudio/PannerNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.h
@@ -206,7 +206,7 @@
 class PannerNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static PannerNode* create(AbstractAudioContext&, float sampleRate);
+    static PannerNode* create(AbstractAudioContext&, ExceptionState&);
     PannerHandler& pannerHandler() const;
 
     DECLARE_VIRTUAL_TRACE();
@@ -241,7 +241,7 @@
     void setConeOuterGain(double);
 
 private:
-    PannerNode(AbstractAudioContext&, float sampleRate);
+    PannerNode(AbstractAudioContext&);
 
     Member<AudioParam> m_positionX;
     Member<AudioParam> m_positionY;
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
index f630e8f..cbe3d43 100644
--- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
@@ -27,6 +27,10 @@
  */
 
 #include "modules/webaudio/PeriodicWave.h"
+#include "bindings/core/v8/ExceptionMessages.h"
+#include "bindings/core/v8/ExceptionState.h"
+#include "core/dom/ExceptionCode.h"
+#include "modules/webaudio/AbstractAudioContext.h"
 #include "modules/webaudio/OscillatorNode.h"
 #include "platform/audio/FFTFrame.h"
 #include "platform/audio/VectorMath.h"
@@ -45,17 +49,33 @@
 
 using namespace VectorMath;
 
-PeriodicWave* PeriodicWave::create(float sampleRate, DOMFloat32Array* real, DOMFloat32Array* imag, bool disableNormalization)
+PeriodicWave* PeriodicWave::create(
+    AbstractAudioContext& context,
+    DOMFloat32Array* real,
+    DOMFloat32Array* imag,
+    bool disableNormalization,
+    ExceptionState& exceptionState)
 {
-    bool isGood = real && imag && real->length() == imag->length();
-    ASSERT(isGood);
-    if (isGood) {
-        PeriodicWave* periodicWave = new PeriodicWave(sampleRate);
-        size_t numberOfComponents = real->length();
-        periodicWave->createBandLimitedTables(real->data(), imag->data(), numberOfComponents, disableNormalization);
-        return periodicWave;
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
     }
-    return nullptr;
+
+    if (real->length() != imag->length()) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            "length of real array (" + String::number(real->length())
+            + ") and length of imaginary array (" +  String::number(imag->length())
+            + ") must match.");
+        return nullptr;
+    }
+
+    PeriodicWave* periodicWave = new PeriodicWave(context.sampleRate());
+    size_t numberOfComponents = real->length();
+    periodicWave->createBandLimitedTables(real->data(), imag->data(), numberOfComponents, disableNormalization);
+    return periodicWave;
 }
 
 PeriodicWave* PeriodicWave::createSine(float sampleRate)
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
index 0fb51be..17a7844 100644
--- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
+++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
@@ -37,6 +37,9 @@
 
 namespace blink {
 
+class AbstractAudioContext;
+class ExceptionState;
+
 class PeriodicWave final : public GarbageCollectedFinalized<PeriodicWave>, public ScriptWrappable {
     DEFINE_WRAPPERTYPEINFO();
 public:
@@ -46,7 +49,12 @@
     static PeriodicWave* createTriangle(float sampleRate);
 
     // Creates an arbitrary periodic wave given the frequency components (Fourier coefficients).
-    static PeriodicWave* create(float sampleRate, DOMFloat32Array* real, DOMFloat32Array* imag, bool normalize);
+    static PeriodicWave* create(
+        AbstractAudioContext&,
+        DOMFloat32Array* real,
+        DOMFloat32Array* imag,
+        bool normalize,
+        ExceptionState&);
 
     virtual ~PeriodicWave();
 
diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
index 45ec9f6..35604ca 100644
--- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -259,8 +259,79 @@
     return bufferSize;
 }
 
-ScriptProcessorNode* ScriptProcessorNode::create(AbstractAudioContext& context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
+ScriptProcessorNode* ScriptProcessorNode::create(
+    AbstractAudioContext& context,
+    ExceptionState& exceptionState)
 {
+    DCHECK(isMainThread());
+
+    // Default buffer size is 0 (let WebAudio choose) with 2 inputs and 2
+    // outputs.
+    return create(context, 0, 2, 2, exceptionState);
+}
+
+ScriptProcessorNode* ScriptProcessorNode::create(
+    AbstractAudioContext& context,
+    size_t bufferSize,
+    ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    // Default is 2 inputs and 2 outputs.
+    return create(context, bufferSize, 2, 2, exceptionState);
+}
+
+ScriptProcessorNode* ScriptProcessorNode::create(
+    AbstractAudioContext& context,
+    size_t bufferSize,
+    unsigned numberOfInputChannels,
+    ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    // Default is 2 outputs.
+    return create(context, bufferSize, numberOfInputChannels, 2, exceptionState);
+}
+
+ScriptProcessorNode* ScriptProcessorNode::create(
+    AbstractAudioContext& context,
+    size_t bufferSize,
+    unsigned numberOfInputChannels,
+    unsigned numberOfOutputChannels,
+    ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    if (numberOfInputChannels == 0 && numberOfOutputChannels == 0) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            "number of input channels and output channels cannot both be zero.");
+        return nullptr;
+    }
+
+    if (numberOfInputChannels > AbstractAudioContext::maxNumberOfChannels()) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            "number of input channels (" + String::number(numberOfInputChannels)
+            + ") exceeds maximum ("
+            + String::number(AbstractAudioContext::maxNumberOfChannels()) + ").");
+        return nullptr;
+    }
+
+    if (numberOfOutputChannels > AbstractAudioContext::maxNumberOfChannels()) {
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            "number of output channels (" + String::number(numberOfInputChannels)
+            + ") exceeds maximum ("
+            + String::number(AbstractAudioContext::maxNumberOfChannels()) + ").");
+        return nullptr;
+    }
+
     // Check for valid buffer size.
     switch (bufferSize) {
     case 0:
@@ -275,19 +346,22 @@
     case 16384:
         break;
     default:
+        exceptionState.throwDOMException(
+            IndexSizeError,
+            "buffer size (" + String::number(bufferSize)
+            + ") must be 0 or a power of two between 256 and 16384.");
         return nullptr;
     }
 
-    if (!numberOfInputChannels && !numberOfOutputChannels)
+    ScriptProcessorNode* node =  new ScriptProcessorNode(context, context.sampleRate(), bufferSize, numberOfInputChannels, numberOfOutputChannels);
+
+    if (!node)
         return nullptr;
 
-    if (numberOfInputChannels > AbstractAudioContext::maxNumberOfChannels())
-        return nullptr;
+    // context keeps reference until we stop making javascript rendering callbacks
+    context.notifySourceNodeStartedProcessing(node);
 
-    if (numberOfOutputChannels > AbstractAudioContext::maxNumberOfChannels())
-        return nullptr;
-
-    return new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels);
+    return node;
 }
 
 size_t ScriptProcessorNode::bufferSize() const
diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h
index a77b52e..28a186c 100644
--- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.h
@@ -103,7 +103,10 @@
     // latency. Higher numbers will be necessary to avoid audio breakup and
     // glitches.
     // The value chosen must carefully balance between latency and audio quality.
-    static ScriptProcessorNode* create(AbstractAudioContext&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
+    static ScriptProcessorNode* create(AbstractAudioContext&, ExceptionState&);
+    static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, ExceptionState&);
+    static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, unsigned numberOfInputChannels, ExceptionState&);
+    static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, ExceptionState&);
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess);
     size_t bufferSize() const;
diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
index b410eb46..b957b8fe 100644
--- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
@@ -134,16 +134,23 @@
 
 // ----------------------------------------------------------------
 
-StereoPannerNode::StereoPannerNode(AbstractAudioContext& context, float sampleRate)
+StereoPannerNode::StereoPannerNode(AbstractAudioContext& context)
     : AudioNode(context)
     , m_pan(AudioParam::create(context, ParamTypeStereoPannerPan, 0, -1, 1))
 {
-    setHandler(StereoPannerHandler::create(*this, sampleRate, m_pan->handler()));
+    setHandler(StereoPannerHandler::create(*this, context.sampleRate(), m_pan->handler()));
 }
 
-StereoPannerNode* StereoPannerNode::create(AbstractAudioContext& context, float sampleRate)
+StereoPannerNode* StereoPannerNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
 {
-    return new StereoPannerNode(context, sampleRate);
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new StereoPannerNode(context);
 }
 
 DEFINE_TRACE(StereoPannerNode)
diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h
index 16283e62..32f1d9b1 100644
--- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.h
@@ -42,13 +42,13 @@
 class StereoPannerNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static StereoPannerNode* create(AbstractAudioContext&, float sampleRate);
+    static StereoPannerNode* create(AbstractAudioContext&, ExceptionState&);
     DECLARE_VIRTUAL_TRACE();
 
     AudioParam* pan() const;
 
 private:
-    StereoPannerNode(AbstractAudioContext&, float sampleRate);
+    StereoPannerNode(AbstractAudioContext&);
 
     Member<AudioParam> m_pan;
 };
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
index 783e2cf..6247608 100644
--- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
@@ -39,6 +39,18 @@
     handler().initialize();
 }
 
+WaveShaperNode* WaveShaperNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
+{
+    DCHECK(isMainThread());
+
+    if (context.isContextClosed()) {
+        context.throwExceptionForClosedState(exceptionState);
+        return nullptr;
+    }
+
+    return new WaveShaperNode(context);
+}
+
 WaveShaperProcessor* WaveShaperNode::getWaveShaperProcessor() const
 {
     return static_cast<WaveShaperProcessor*>(static_cast<AudioBasicProcessorHandler&>(handler()).processor());
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h
index 740af6d..bfaf39f9 100644
--- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h
@@ -37,10 +37,7 @@
 class WaveShaperNode final : public AudioNode {
     DEFINE_WRAPPERTYPEINFO();
 public:
-    static WaveShaperNode* create(AbstractAudioContext& context)
-    {
-        return new WaveShaperNode(context);
-    }
+    static WaveShaperNode* create(AbstractAudioContext&, ExceptionState&);
 
     // setCurve() is called on the main thread.
     void setCurve(DOMFloat32Array*, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
index 8d55428..c73e968 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
@@ -89,7 +89,7 @@
     // The WebThread destructor blocks until all the tasks of the database
     // thread are processed. However, it shouldn't block at all because
     // the database thread has already finished processing the cleanup task.
-    m_thread.clear();
+    m_thread.reset();
 }
 
 void DatabaseThread::cleanupDatabaseThread()
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp
index 24dd8750..6d400e6f 100644
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp
@@ -392,7 +392,7 @@
         // m_sqliteTransaction invokes SQLiteTransaction's destructor which does
         // just that. We might as well do this unconditionally and free up its
         // resources because we're already terminating.
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
     }
 
     // Release the lock on this database
@@ -499,7 +499,7 @@
     // The current SQLite transaction should be stopped, as well
     if (m_sqliteTransaction) {
         m_sqliteTransaction->stop();
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
     }
 
     // Terminate the frontend state machine. This also gets the frontend to
@@ -572,7 +572,7 @@
         m_database->reportStartTransactionResult(2, SQLError::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_transactionError = SQLErrorData::create(SQLError::DATABASE_ERR, "unable to begin transaction",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
         return nextStateForTransactionError();
     }
 
@@ -585,7 +585,7 @@
         m_transactionError = SQLErrorData::create(SQLError::DATABASE_ERR, "unable to read version",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         m_database->disableAuthorizer();
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
         m_database->enableAuthorizer();
         return nextStateForTransactionError();
     }
@@ -594,7 +594,7 @@
     // Spec 4.3.2.3: Perform preflight steps, jumping to the error callback if they fail
     if (m_wrapper && !m_wrapper->performPreflight(this)) {
         m_database->disableAuthorizer();
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
         m_database->enableAuthorizer();
         if (m_wrapper->sqlError()) {
             m_transactionError = SQLErrorData::create(*m_wrapper->sqlError());
@@ -788,7 +788,7 @@
         m_sqliteTransaction->rollback();
 
         ASSERT(!m_database->sqliteDatabase().transactionInProgress());
-        m_sqliteTransaction.clear();
+        m_sqliteTransaction.reset();
     }
     m_database->enableAuthorizer();
 
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index f8311fa..7c7fd6a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1155,7 +1155,7 @@
     if (!drawingBuffer())
         return;
 
-    m_extensionsUtil.clear();
+    m_extensionsUtil.reset();
 
     drawingBuffer()->contextProvider()->setLostContextCallback(WebClosure());
     drawingBuffer()->contextProvider()->setErrorMessageCallback(WebFunction<void(const char*, int32_t)>());
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp
index 342fd3f..4fdf4f1 100644
--- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp
+++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp
@@ -72,7 +72,7 @@
 
 void MIDIAccess::dispose()
 {
-    m_accessor.clear();
+    m_accessor.reset();
 }
 
 EventListener* MIDIAccess::onstatechange()
@@ -203,7 +203,7 @@
 
 void MIDIAccess::stop()
 {
-    m_accessor.clear();
+    m_accessor.reset();
 }
 
 DEFINE_TRACE(MIDIAccess)
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
index 5a23b1d..48a9ab4 100644
--- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -510,7 +510,7 @@
         return;
     if (m_state == CONNECTING) {
         m_state = CLOSING;
-        m_channel->fail("WebSocket is closed before the connection is established.", WarningMessageLevel, String(), 0);
+        m_channel->fail("WebSocket is closed before the connection is established.", WarningMessageLevel, nullptr);
         return;
     }
     m_state = CLOSING;
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
index 3ff23ec..eb5851e 100644
--- a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
@@ -62,7 +62,11 @@
     }
     MOCK_CONST_METHOD0(bufferedAmount, unsigned());
     MOCK_METHOD2(close, void(int, const String&));
-    MOCK_METHOD4(fail, void(const String&, MessageLevel, const String&, unsigned));
+    MOCK_METHOD3(failMock, void(const String&, MessageLevel, SourceLocation*));
+    void fail(const String& reason, MessageLevel level, PassOwnPtr<SourceLocation> location)
+    {
+        failMock(reason, level, location.get());
+    }
     MOCK_METHOD0(disconnect, void());
 
     MockWebSocketChannel()
@@ -335,7 +339,7 @@
     {
         InSequence s;
         EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
-        EXPECT_CALL(channel(), fail(_, _, _, _));
+        EXPECT_CALL(channel(), failMock(_, _, _));
     }
     String reason;
     for (size_t i = 0; i < 123; ++i)
@@ -378,7 +382,7 @@
     {
         InSequence s;
         EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
-        EXPECT_CALL(channel(), fail(String("WebSocket is closed before the connection is established."), WarningMessageLevel, String(), 0));
+        EXPECT_CALL(channel(), failMock(String("WebSocket is closed before the connection is established."), WarningMessageLevel, _));
     }
     m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
 
@@ -526,7 +530,7 @@
     {
         InSequence s;
         EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
-        EXPECT_CALL(channel(), fail(_, _, _, _));
+        EXPECT_CALL(channel(), failMock(_, _, _));
     }
     m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
 
@@ -629,7 +633,7 @@
     {
         InSequence s;
         EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
-        EXPECT_CALL(channel(), fail(_, _, _, _));
+        EXPECT_CALL(channel(), failMock(_, _, _));
     }
     m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
 
@@ -717,7 +721,7 @@
     {
         InSequence s;
         EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
-        EXPECT_CALL(channel(), fail(_, _, _, _));
+        EXPECT_CALL(channel(), failMock(_, _, _));
     }
     m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
 
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
index 1c16de2..ca91d4b9 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -134,7 +134,7 @@
     // |this| is deleted here.
 }
 
-DocumentWebSocketChannel::DocumentWebSocketChannel(Document* document, WebSocketChannelClient* client, const String& sourceURL, unsigned lineNumber, WebSocketHandle *handle)
+DocumentWebSocketChannel::DocumentWebSocketChannel(Document* document, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location, WebSocketHandle *handle)
     : ContextLifecycleObserver(document)
     , m_handle(adoptPtr(handle ? handle : Platform::current()->createWebSocketHandle()))
     , m_client(client)
@@ -142,8 +142,7 @@
     , m_sendingQuota(0)
     , m_receivedDataSizeForFlowControl(receivedDataSizeForFlowControlHighWaterMark * 2) // initial quota
     , m_sentSizeOfTopMessage(0)
-    , m_sourceURLAtConstruction(sourceURL)
-    , m_lineNumberAtConstruction(lineNumber)
+    , m_locationAtConstruction(std::move(location))
 {
 }
 
@@ -256,14 +255,14 @@
     processSendQueue();
 }
 
-void DocumentWebSocketChannel::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
+void DocumentWebSocketChannel::fail(const String& reason, MessageLevel level, PassOwnPtr<SourceLocation> location)
 {
     WTF_LOG(Network, "DocumentWebSocketChannel %p fail(%s)", this, reason.utf8().data());
     // m_handle and m_client can be null here.
 
     InspectorInstrumentation::didReceiveWebSocketFrameError(document(), m_identifier, reason);
     const String message = "WebSocket connection to '" + m_url.elidedString() + "' failed: " + reason;
-    getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, level, message, sourceURL, lineNumber, 0));
+    getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, level, message, std::move(location)));
 
     if (m_client)
         m_client->didError();
@@ -281,7 +280,7 @@
         InspectorInstrumentation::didCloseWebSocket(document(), m_identifier);
     }
     abortAsyncOperations();
-    m_handle.clear();
+    m_handle.reset();
     m_client = nullptr;
     m_identifier = 0;
 }
@@ -391,7 +390,7 @@
 
 void DocumentWebSocketChannel::handleDidClose(bool wasClean, unsigned short code, const String& reason)
 {
-    m_handle.clear();
+    m_handle.reset();
     abortAsyncOperations();
     if (!m_client) {
         return;
@@ -519,7 +518,7 @@
     ASSERT(m_handle);
     ASSERT(handle == m_handle);
 
-    m_handle.clear();
+    m_handle.reset();
 
     if (m_identifier) {
         TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketDestroy", TRACE_EVENT_SCOPE_THREAD, "data", InspectorWebSocketEvent::data(document(), m_identifier));
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
index 8ab836e..ae655665 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -31,6 +31,7 @@
 #ifndef DocumentWebSocketChannel_h
 #define DocumentWebSocketChannel_h
 
+#include "bindings/core/v8/SourceLocation.h"
 #include "core/dom/ContextLifecycleObserver.h"
 #include "core/fileapi/Blob.h"
 #include "core/fileapi/FileError.h"
@@ -68,9 +69,9 @@
     // In the usual case, they are set automatically and you don't have to
     // pass it.
     // Specify handle explicitly only in tests.
-    static DocumentWebSocketChannel* create(Document* document, WebSocketChannelClient* client, const String& sourceURL = String(), unsigned lineNumber = 0, WebSocketHandle *handle = 0)
+    static DocumentWebSocketChannel* create(Document* document, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location, WebSocketHandle *handle = 0)
     {
-        return new DocumentWebSocketChannel(document, client, sourceURL, lineNumber, handle);
+        return new DocumentWebSocketChannel(document, client, std::move(location), handle);
     }
     ~DocumentWebSocketChannel() override;
 
@@ -84,7 +85,7 @@
     // Start closing handshake. Use the CloseEventCodeNotSpecified for the code
     // argument to omit payload.
     void close(int code, const String& reason) override;
-    void fail(const String& reason, MessageLevel, const String&, unsigned lineNumber) override;
+    void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>) override;
     void disconnect() override;
 
     DECLARE_VIRTUAL_TRACE();
@@ -107,11 +108,11 @@
         Vector<char> data;
     };
 
-    DocumentWebSocketChannel(Document*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*);
+    DocumentWebSocketChannel(Document*, WebSocketChannelClient*, PassOwnPtr<SourceLocation>, WebSocketHandle*);
     void sendInternal(WebSocketHandle::MessageType, const char* data, size_t totalSize, uint64_t* consumedBufferedAmount);
     void processSendQueue();
     void flowControlIfNecessary();
-    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
+    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_locationAtConstruction->clone()); }
     void abortAsyncOperations();
     void handleDidClose(bool wasClean, unsigned short code, const String& reason);
     Document* document();
@@ -149,8 +150,7 @@
     uint64_t m_receivedDataSizeForFlowControl;
     size_t m_sentSizeOfTopMessage;
 
-    String m_sourceURLAtConstruction;
-    unsigned m_lineNumberAtConstruction;
+    OwnPtr<SourceLocation> m_locationAtConstruction;
     RefPtr<WebSocketHandshakeRequest> m_handshakeRequest;
 
     static const uint64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15;
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
index bc5d273..14df233 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
@@ -92,7 +92,7 @@
         : m_pageHolder(DummyPageHolder::create())
         , m_channelClient(MockWebSocketChannelClient::create())
         , m_handle(MockWebSocketHandle::create())
-        , m_channel(DocumentWebSocketChannel::create(&m_pageHolder->document(), m_channelClient.get(), String(), 0, handle()))
+        , m_channel(DocumentWebSocketChannel::create(&m_pageHolder->document(), m_channelClient.get(), SourceLocation::capture(), handle()))
         , m_sumOfConsumedBufferedAmount(0)
     {
         ON_CALL(*channelClient(), didConsumeBufferedAmount(_)).WillByDefault(Invoke(this, &DocumentWebSocketChannelTest::didConsumeBufferedAmount));
@@ -680,7 +680,7 @@
         EXPECT_CALL(*channelClient(), didClose(WebSocketChannelClient::ClosingHandshakeIncomplete, WebSocketChannel::CloseEventCodeAbnormalClosure, String()));
     }
 
-    channel()->fail("fail message from WebSocket", ErrorMessageLevel, "sourceURL", 1234);
+    channel()->fail("fail message from WebSocket", ErrorMessageLevel, nullptr);
 }
 
 } // namespace
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
index 70f0d7b..49e46a1 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.cpp
@@ -30,7 +30,7 @@
 
 #include "modules/websockets/WebSocketChannel.h"
 
-#include "bindings/core/v8/ScriptCallStack.h"
+#include "bindings/core/v8/SourceLocation.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/workers/WorkerGlobalScope.h"
@@ -46,21 +46,15 @@
     ASSERT(context);
     ASSERT(client);
 
-    String sourceURL;
-    unsigned lineNumber = 0;
-    RefPtr<ScriptCallStack> callStack = ScriptCallStack::capture(1);
-    if (callStack && !callStack->isEmpty()) {
-        sourceURL = callStack->topSourceURL();
-        lineNumber = callStack->topLineNumber();
-    }
+    OwnPtr<SourceLocation> location = SourceLocation::capture(context);
 
     if (context->isWorkerGlobalScope()) {
         WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
-        return WorkerWebSocketChannel::create(*workerGlobalScope, client, sourceURL, lineNumber);
+        return WorkerWebSocketChannel::create(*workerGlobalScope, client, std::move(location));
     }
 
     Document* document = toDocument(context);
-    return DocumentWebSocketChannel::create(document, client, sourceURL, lineNumber);
+    return DocumentWebSocketChannel::create(document, client, std::move(location));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h
index 4f2b70b..51bf3be 100644
--- a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h
@@ -31,6 +31,7 @@
 #ifndef WebSocketChannel_h
 #define WebSocketChannel_h
 
+#include "bindings/core/v8/SourceLocation.h"
 #include "modules/ModulesExport.h"
 #include "platform/heap/Handle.h"
 #include "platform/v8_inspector/public/ConsoleTypes.h"
@@ -84,16 +85,13 @@
 
     // Log the reason text and close the connection. Will call didClose().
     // The MessageLevel parameter will be used for the level of the message
-    // shown at the devtool console.
-    // sourceURL and lineNumber parameters may be shown with the reason text
-    // at the devtool console.
-    // Even if sourceURL and lineNumber are specified, they may be ignored
-    // and the "current" url and the line number in the sense of
-    // JavaScript execution may be shown if this method is called in
-    // a JS execution context.
-    // You can specify String() and 0 for sourceURL and lineNumber
-    // respectively, if you can't / needn't provide the information.
-    virtual void fail(const String& reason, MessageLevel, const String& sourceURL, unsigned lineNumber) = 0;
+    // shown at the devtools console.
+    // SourceLocation parameter may be shown with the reason text
+    // at the devtools console. Even if location is specified, it may be ignored
+    // and the "current" location in the sense of JavaScript execution
+    // may be shown if this method is called in a JS execution context.
+    // You can pass null location if unknown.
+    virtual void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>) = 0;
 
     // Do not call any methods after calling this method.
     virtual void disconnect() = 0; // Will suppress didClose().
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
index 80ef3fb..24854f9 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp
@@ -30,7 +30,6 @@
 
 #include "modules/websockets/WorkerWebSocketChannel.h"
 
-#include "bindings/core/v8/ScriptCallStack.h"
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/DOMArrayBuffer.h"
 #include "core/dom/Document.h"
@@ -104,12 +103,11 @@
     bool m_connectRequestResult;
 };
 
-WorkerWebSocketChannel::WorkerWebSocketChannel(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, const String& sourceURL, unsigned lineNumber)
+WorkerWebSocketChannel::WorkerWebSocketChannel(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location)
     : m_bridge(new Bridge(client, workerGlobalScope))
-    , m_sourceURLAtConnection(sourceURL)
-    , m_lineNumberAtConnection(lineNumber)
+    , m_locationAtConnection(std::move(location))
 {
-    m_bridge->initialize(sourceURL, lineNumber);
+    m_bridge->initialize(m_locationAtConnection->clone());
 }
 
 WorkerWebSocketChannel::~WorkerWebSocketChannel()
@@ -147,24 +145,23 @@
     m_bridge->close(code, reason);
 }
 
-void WorkerWebSocketChannel::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
+void WorkerWebSocketChannel::fail(const String& reason, MessageLevel level, PassOwnPtr<SourceLocation> location)
 {
     if (!m_bridge)
         return;
 
-    RefPtr<ScriptCallStack> callStack = ScriptCallStack::capture(1);
-    if (callStack && !callStack->isEmpty())  {
-        // In order to emulate the ConsoleMessage behavior,
-        // we should ignore the specified url and line number if
-        // we can get the JavaScript context.
-        m_bridge->fail(reason, level, callStack->topSourceURL(), callStack->topLineNumber());
-    } else if (sourceURL.isEmpty() && !lineNumber) {
+    OwnPtr<SourceLocation> capturedLocation = SourceLocation::capture();
+    if (!capturedLocation->isEmpty()) {
+        // If we are in JavaScript context, use the current location instead
+        // of passed one - it's more precise.
+        m_bridge->fail(reason, level, std::move(capturedLocation));
+    } else if (!location || location->isEmpty()) {
         // No information is specified by the caller - use the url
         // and the line number at the connection.
-        m_bridge->fail(reason, level, m_sourceURLAtConnection, m_lineNumberAtConnection);
+        m_bridge->fail(reason, level, m_locationAtConnection->clone());
     } else {
         // Use the specified information.
-        m_bridge->fail(reason, level, sourceURL, lineNumber);
+        m_bridge->fail(reason, level, std::move(location));
     }
 }
 
@@ -194,11 +191,11 @@
     ASSERT(!isMainThread());
 }
 
-void Peer::initialize(const String& sourceURL, unsigned lineNumber, ExecutionContext* context)
+void Peer::initialize(PassOwnPtr<SourceLocation> location, ExecutionContext* context)
 {
     ASSERT(isMainThread());
     Document* document = toDocument(context);
-    m_mainWebSocketChannel = DocumentWebSocketChannel::create(document, this, sourceURL, lineNumber);
+    m_mainWebSocketChannel = DocumentWebSocketChannel::create(document, this, std::move(location));
     m_syncHelper->signalWorkerThread();
 }
 
@@ -245,13 +242,13 @@
     m_mainWebSocketChannel->close(code, reason);
 }
 
-void Peer::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
+void Peer::fail(const String& reason, MessageLevel level, PassOwnPtr<SourceLocation> location)
 {
     ASSERT(isMainThread());
     ASSERT(m_syncHelper);
     if (!m_mainWebSocketChannel)
         return;
-    m_mainWebSocketChannel->fail(reason, level, sourceURL, lineNumber);
+    m_mainWebSocketChannel->fail(reason, level, std::move(location));
 }
 
 void Peer::disconnect()
@@ -382,9 +379,9 @@
     ASSERT(!m_peer);
 }
 
-void Bridge::initialize(const String& sourceURL, unsigned lineNumber)
+void Bridge::initialize(PassOwnPtr<SourceLocation> location)
 {
-    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::initialize, wrapCrossThreadPersistent(m_peer.get()), sourceURL, lineNumber))) {
+    if (!waitForMethodCompletion(createCrossThreadTask(&Peer::initialize, wrapCrossThreadPersistent(m_peer.get()), passed(std::move(location))))) {
         // The worker thread has been signalled to shutdown before method completion.
         disconnect();
     }
@@ -434,10 +431,10 @@
     m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::close, wrapCrossThreadPersistent(m_peer.get()), code, reason));
 }
 
-void Bridge::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
+void Bridge::fail(const String& reason, MessageLevel level, PassOwnPtr<SourceLocation> location)
 {
     ASSERT(m_peer);
-    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::fail, wrapCrossThreadPersistent(m_peer.get()), reason, level, sourceURL, lineNumber));
+    m_loaderProxy->postTaskToLoader(createCrossThreadTask(&Peer::fail, wrapCrossThreadPersistent(m_peer.get()), reason, level, passed(std::move(location))));
 }
 
 void Bridge::disconnect()
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
index 8b2137c..2e9cf96 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
@@ -31,6 +31,7 @@
 #ifndef WorkerWebSocketChannel_h
 #define WorkerWebSocketChannel_h
 
+#include "bindings/core/v8/SourceLocation.h"
 #include "modules/websockets/WebSocketChannel.h"
 #include "modules/websockets/WebSocketChannelClient.h"
 #include "platform/heap/Handle.h"
@@ -56,9 +57,9 @@
 class WorkerWebSocketChannel final : public WebSocketChannel {
     WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel);
 public:
-    static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, const String& sourceURL, unsigned lineNumber)
+    static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location)
     {
-        return new WorkerWebSocketChannel(workerGlobalScope, client, sourceURL, lineNumber);
+        return new WorkerWebSocketChannel(workerGlobalScope, client, std::move(location));
     }
     ~WorkerWebSocketChannel() override;
 
@@ -76,7 +77,7 @@
         ASSERT_NOT_REACHED();
     }
     void close(int code, const String& reason) override;
-    void fail(const String& reason, MessageLevel, const String&, unsigned) override;
+    void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>) override;
     void disconnect() override; // Will suppress didClose().
 
     DECLARE_VIRTUAL_TRACE();
@@ -90,16 +91,15 @@
         Peer(Bridge*, PassRefPtr<WorkerLoaderProxy>, WebSocketChannelSyncHelper*);
         ~Peer() override;
 
-        // sourceURLAtConnection and lineNumberAtConnection parameters may
-        // be shown when the connection fails.
-        void initialize(const String& sourceURLAtConnection, unsigned lineNumberAtConnection, ExecutionContext*);
+        // SourceLocation parameter may be shown when the connection fails.
+        void initialize(PassOwnPtr<SourceLocation>, ExecutionContext*);
 
         void connect(const KURL&, const String& protocol);
         void sendTextAsCharVector(PassOwnPtr<Vector<char>>);
         void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>);
         void sendBlob(PassRefPtr<BlobDataHandle>);
         void close(int code, const String& reason);
-        void fail(const String& reason, MessageLevel, const String& sourceURL, unsigned lineNumber);
+        void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>);
         void disconnect();
 
         DECLARE_VIRTUAL_TRACE();
@@ -126,15 +126,14 @@
     public:
         Bridge(WebSocketChannelClient*, WorkerGlobalScope&);
         ~Bridge();
-        // sourceURLAtConnection and lineNumberAtConnection parameters may
-        // be shown when the connection fails.
-        void initialize(const String& sourceURLAtConnection, unsigned lineNumberAtConnection);
+        // SourceLocation parameter may be shown when the connection fails.
+        void initialize(PassOwnPtr<SourceLocation>);
         bool connect(const KURL&, const String& protocol);
         void send(const CString& message);
         void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength);
         void send(PassRefPtr<BlobDataHandle>);
         void close(int code, const String& reason);
-        void fail(const String& reason, MessageLevel, const String& sourceURL, unsigned lineNumber);
+        void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>);
         void disconnect();
 
         // Returns null when |disconnect| has already been called.
@@ -154,11 +153,10 @@
     };
 
 private:
-    WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, const String& sourceURL, unsigned lineNumber);
+    WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, PassOwnPtr<SourceLocation>);
 
     Member<Bridge> m_bridge;
-    String m_sourceURLAtConnection;
-    unsigned m_lineNumberAtConnection;
+    OwnPtr<SourceLocation> m_locationAtConnection;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/DragImageTest.cpp b/third_party/WebKit/Source/platform/DragImageTest.cpp
index d71bf51..f46e549 100644
--- a/third_party/WebKit/Source/platform/DragImageTest.cpp
+++ b/third_party/WebKit/Source/platform/DragImageTest.cpp
@@ -78,7 +78,7 @@
         return false;
     }
 
-    void destroyDecodedData(bool) override
+    void destroyDecodedData() override
     {
         // Image pure virtual stub.
     }
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index 2432bb0..2ee3e6e 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -57,6 +57,7 @@
 BitmapImage::BitmapImage(ImageObserver* observer)
     : Image(observer)
     , m_currentFrame(0)
+    , m_cachedFrameIndex(0)
     , m_repetitionCount(cAnimationNone)
     , m_repetitionCountStatus(Unknown)
     , m_repetitionsComplete(0)
@@ -75,6 +76,8 @@
     : Image(observer)
     , m_size(bitmap.width(), bitmap.height())
     , m_currentFrame(0)
+    , m_cachedFrame(adoptRef(SkImage::NewFromBitmap(bitmap)))
+    , m_cachedFrameIndex(0)
     , m_repetitionCount(cAnimationNone)
     , m_repetitionCountStatus(Unknown)
     , m_repetitionsComplete(0)
@@ -92,7 +95,6 @@
 
     m_frames.grow(1);
     m_frames[0].m_hasAlpha = !bitmap.isOpaque();
-    m_frames[0].m_frame = adoptRef(SkImage::NewFromBitmap(bitmap));
     m_frames[0].m_haveMetadata = true;
 }
 
@@ -106,31 +108,13 @@
     return true;
 }
 
-void BitmapImage::destroyDecodedData(bool destroyAll)
+void BitmapImage::destroyDecodedData()
 {
-    for (size_t i = 0; i < m_frames.size(); ++i) {
-        // The underlying frame isn't actually changing (we're just trying to
-        // save the memory for the framebuffer data), so we don't need to clear
-        // the metadata.
-        m_frames[i].clear(false);
-    }
-
-    m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame);
-    notifyMemoryChanged();
-}
-
-void BitmapImage::destroyDecodedDataIfNecessary()
-{
-    // Animated images >5MB are considered large enough that we'll only hang on
-    // to one frame at a time.
-    static const size_t cLargeAnimationCutoff = 5242880;
-    size_t allFrameBytes = 0;
+    m_cachedFrame.clear();
     for (size_t i = 0; i < m_frames.size(); ++i)
-        allFrameBytes += m_frames[i].m_frameBytes;
-
-    if (allFrameBytes > cLargeAnimationCutoff) {
-        destroyDecodedData(false);
-    }
+        m_frames[i].clear(true);
+    m_source.clearCacheExceptFrame(kNotFound);
+    notifyMemoryChanged();
 }
 
 void BitmapImage::notifyMemoryChanged()
@@ -148,7 +132,7 @@
     return totalBytes;
 }
 
-void BitmapImage::cacheFrame(size_t index)
+PassRefPtr<SkImage> BitmapImage::decodeAndCacheFrame(size_t index)
 {
     size_t numFrames = frameCount();
     if (m_frames.size() < numFrames)
@@ -156,7 +140,9 @@
 
     // We are caching frame snapshots.  This is OK even for partially decoded frames,
     // as they are cleared by dataChanged() when new data arrives.
-    m_frames[index].m_frame = m_source.createFrameAtIndex(index);
+    RefPtr<SkImage> image = m_source.createFrameAtIndex(index);
+    m_cachedFrame = image;
+    m_cachedFrameIndex = index;
 
     m_frames[index].m_orientation = m_source.orientationAtIndex(index);
     m_frames[index].m_haveMetadata = true;
@@ -167,6 +153,7 @@
     m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index);
 
     notifyMemoryChanged();
+    return image.release();
 }
 
 void BitmapImage::updateSize() const
@@ -221,8 +208,11 @@
         // NOTE: Don't call frameIsCompleteAtIndex() here, that will try to
         // decode any uncached (i.e. never-decoded or
         // cleared-on-a-previous-pass) frames!
-        if (m_frames[i].m_haveMetadata && !m_frames[i].m_isComplete)
+        if (m_frames[i].m_haveMetadata && !m_frames[i].m_isComplete) {
             m_frames[i].clear(true);
+            if (i == m_cachedFrameIndex)
+                m_cachedFrame.clear();
+        }
     }
 
     // Feed all the data we've seen so far to the image decoder.
@@ -283,7 +273,7 @@
     canvas->drawImageRect(image.get(), adjustedSrcRect, adjustedDstRect, &paint,
         WebCoreClampingModeToSkiaRectConstraint(clampMode));
 
-    if (currentFrameIsLazyDecoded())
+    if (image->isLazyGenerated())
         PlatformInstrumentation::didDrawLazyPixelRef(image->uniqueID());
 
     if (ImageObserver* observer = getImageObserver())
@@ -325,23 +315,15 @@
     return m_sizeAvailable;
 }
 
-bool BitmapImage::ensureFrameIsCached(size_t index)
-{
-    if (index >= frameCount())
-        return false;
-
-    if (index >= m_frames.size() || !m_frames[index].m_frame)
-        cacheFrame(index);
-
-    return true;
-}
-
 PassRefPtr<SkImage> BitmapImage::frameAtIndex(size_t index)
 {
-    if (!ensureFrameIsCached(index))
+    if (index >= frameCount())
         return nullptr;
 
-    return m_frames[index].m_frame;
+    if (index == m_cachedFrameIndex && m_cachedFrame)
+        return m_cachedFrame;
+
+    return decodeAndCacheFrame(index);
 }
 
 bool BitmapImage::frameIsCompleteAtIndex(size_t index)
@@ -557,9 +539,7 @@
     m_repetitionsComplete = 0;
     m_desiredFrameStartTime = 0;
     m_animationFinished = false;
-
-    // For extremely large animations, when the animation is reset, we just throw everything away.
-    destroyDecodedDataIfNecessary();
+    m_cachedFrame.clear();
 }
 
 bool BitmapImage::maybeAnimated()
@@ -617,12 +597,12 @@
         } else
             m_currentFrame = 0;
     }
-    destroyDecodedDataIfNecessary();
 
     // We need to draw this frame if we advanced to it while not skipping, or if
     // while trying to skip frames we hit the last frame and thus had to stop.
     if (skippingFrames != advancedAnimation)
         getImageObserver()->animationAdvanced(this);
+
     return advancedAnimation;
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
index 3c46113..c237257 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -44,8 +44,9 @@
 template <typename T> class Timer;
 
 class PLATFORM_EXPORT BitmapImage final : public Image {
-    friend class GeneratedImage;
+    friend class BitmapImageTest;
     friend class CrossfadeGeneratedImage;
+    friend class GeneratedImage;
     friend class GradientGeneratedImage;
     friend class GraphicsContext;
 public:
@@ -69,11 +70,6 @@
     bool isAllDataReceived() const { return m_allDataReceived; }
     bool hasColorProfile() const;
 
-    // It may look unusual that there's no start animation call as public API.
-    // This because we start and stop animating lazily. Animation starts when
-    // the image is rendered, and automatically pauses once all observers no
-    // longer want to render the image.
-    void stopAnimation() override;
     void resetAnimation() override;
     bool maybeAnimated() override;
 
@@ -96,11 +92,6 @@
     void advanceAnimationForTesting() override { internalAdvanceAnimation(false); }
 
 private:
-    friend class BitmapImageTest;
-
-    void updateSize() const;
-
-private:
     enum RepetitionCountStatus {
       Unknown,    // We haven't checked the source's repetition count.
       Uncertain,  // We have a repetition count, but it might be wrong (some GIFs have a count after the image data, and will report "loop once" until all data has been decoded).
@@ -122,27 +113,17 @@
     bool frameHasAlphaAtIndex(size_t);
     ImageOrientation frameOrientationAtIndex(size_t);
 
-    // Decodes and caches a frame. Never accessed except internally.
-    void cacheFrame(size_t index);
-
-    // Called before accessing m_frames[index]. Returns false on index out of bounds.
-    bool ensureFrameIsCached(size_t index);
+    PassRefPtr<SkImage> decodeAndCacheFrame(size_t index);
+    void updateSize() const;
 
     // Returns the total number of bytes allocated for all framebuffers, i.e.
     // the sum of m_source.frameBytesAtIndex(...) for all frames.
     size_t totalFrameBytes();
 
-    // Called to invalidate cached data. When |destroyAll| is true, we wipe out
-    // the entire frame buffer cache and tell the image source to destroy
-    // everything; this is used when e.g. we want to free some room in the image
-    // cache. If |destroyAll| is false, we delete frames except the current
-    // frame; this is used while animating large images to keep memory footprint
-    // low; the decoder should preserve the current frame and may preserve some
-    // other frames to avoid redecoding the whole image on every frame.
-    void destroyDecodedData(bool destroyAll) override;
-
-    // If the image is large enough, calls destroyDecodedData().
-    void destroyDecodedDataIfNecessary();
+    // Called to wipe out the entire frame buffer cache and tell the image
+    // source to destroy everything; this is used when e.g. we want to free
+    // some room in the image cache.
+    void destroyDecodedData() override;
 
     // Notifies observers that the memory footprint has changed.
     void notifyMemoryChanged();
@@ -151,9 +132,13 @@
     bool isSizeAvailable();
 
     // Animation.
+    // We start and stop animating lazily.  Animation starts when the image is
+    // rendered, and automatically stops once no observer wants to render the
+    // image.
     int repetitionCount(bool imageKnownToBeComplete);  // |imageKnownToBeComplete| should be set if the caller knows the entire image has been decoded.
     bool shouldAnimate();
     void startAnimation(CatchUpAnimation = CatchUp) override;
+    void stopAnimation();
     void advanceAnimation(Timer<BitmapImage>*);
 
     // Function that does the real work of advancing the animation.  When
@@ -170,6 +155,9 @@
     size_t m_currentFrame; // The index of the current frame of animation.
     Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
 
+    RefPtr<SkImage> m_cachedFrame; // A cached copy of the most recently-accessed frame.
+    size_t m_cachedFrameIndex; // Index of the frame that is cached.
+
     OwnPtr<Timer<BitmapImage>> m_frameTimer;
     int m_repetitionCount; // How many total animation loops we should do.  This will be cAnimationNone if this image type is incapable of animation.
     RepetitionCountStatus m_repetitionCountStatus;
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
index 5f86d32..86b0e4d 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
@@ -77,11 +77,11 @@
     }
 
     // Accessors to BitmapImage's protected methods.
-    void destroyDecodedData(bool destroyAll) { m_image->destroyDecodedData(destroyAll); }
+    void destroyDecodedData() { m_image->destroyDecodedData(); }
     size_t frameCount() { return m_image->frameCount(); }
-    void frameAtIndex(size_t index)
+    PassRefPtr<SkImage> frameAtIndex(size_t index)
     {
-        m_image->frameAtIndex(index);
+        return m_image->frameAtIndex(index);
     }
     void setCurrentFrame(size_t frame) { m_image->m_currentFrame = frame; }
     size_t frameDecodedSize(size_t frame) { return m_image->m_frames[frame].m_frameBytes; }
@@ -138,6 +138,11 @@
         return m_image->imageForDefaultFrame();
     }
 
+    int lastDecodedSizeChange()
+    {
+        return m_imageObserver->m_lastDecodedSizeChangedDelta;
+    }
+
 protected:
     void SetUp() override
     {
@@ -153,25 +158,13 @@
     bool m_enableDeferredDecoding;
 };
 
-TEST_F(BitmapImageTest, destroyDecodedDataExceptCurrentFrame)
-{
-    loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
-    size_t totalSize = decodedSize();
-    size_t frame = frameCount() / 2;
-    setCurrentFrame(frame);
-    size_t size = frameDecodedSize(frame);
-    destroyDecodedData(false);
-    EXPECT_LT(m_imageObserver->m_lastDecodedSizeChangedDelta, 0);
-    EXPECT_GE(m_imageObserver->m_lastDecodedSizeChangedDelta, -static_cast<int>(totalSize - size));
-}
-
-TEST_F(BitmapImageTest, destroyAllDecodedData)
+TEST_F(BitmapImageTest, destroyDecodedData)
 {
     loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
     size_t totalSize = decodedSize();
     EXPECT_GT(totalSize, 0u);
-    destroyDecodedData(true);
-    EXPECT_EQ(-static_cast<int>(totalSize), m_imageObserver->m_lastDecodedSizeChangedDelta);
+    destroyDecodedData();
+    EXPECT_EQ(-static_cast<int>(totalSize), lastDecodedSizeChange());
     EXPECT_EQ(0u, decodedSize());
 }
 
@@ -273,30 +266,23 @@
     loadImage("/LayoutTests/fast/images/resources/anim_none.gif", false);
     frameAtIndex(1);
     int frameSize = static_cast<int>(m_image->size().area() * sizeof(ImageFrame::PixelData));
-    EXPECT_EQ(frameSize * 2, m_imageObserver->m_lastDecodedSizeChangedDelta);
-
-    // Trying to destroy all data except an undecoded frame should cause the
-    // decoder to seek backwards and preserve the most recent previous frame
-    // necessary to decode that undecoded frame, and destroy all other frames.
-    setCurrentFrame(2);
-    destroyDecodedData(false);
-    EXPECT_EQ(-frameSize, m_imageObserver->m_lastDecodedSizeChangedDelta);
+    EXPECT_EQ(frameSize * 2, lastDecodedSizeChange());
 }
 
 TEST_F(BitmapImageTest, recachingFrameAfterDataChanged)
 {
     loadImage("/LayoutTests/fast/images/resources/green.jpg");
     setFirstFrameNotComplete();
-    EXPECT_GT(m_imageObserver->m_lastDecodedSizeChangedDelta, 0);
+    EXPECT_GT(lastDecodedSizeChange(), 0);
     m_imageObserver->m_lastDecodedSizeChangedDelta = 0;
 
     // Calling dataChanged causes the cache to flush, but doesn't affect the
     // source's decoded frames. It shouldn't affect decoded size.
     m_image->dataChanged(true);
-    EXPECT_EQ(0, m_imageObserver->m_lastDecodedSizeChangedDelta);
+    EXPECT_EQ(0, lastDecodedSizeChange());
     // Recaching the first frame also shouldn't affect decoded size.
     m_image->imageForCurrentFrame();
-    EXPECT_EQ(0, m_imageObserver->m_lastDecodedSizeChangedDelta);
+    EXPECT_EQ(0, lastDecodedSizeChange());
 }
 
 class BitmapImageDeferredDecodingTest : public BitmapImageTest {
@@ -311,14 +297,7 @@
     loadImage("/LayoutTests/fast/images/resources/anim_none.gif", false);
     frameAtIndex(1);
     int frameSize = static_cast<int>(m_image->size().area() * sizeof(ImageFrame::PixelData));
-    EXPECT_EQ(frameSize, m_imageObserver->m_lastDecodedSizeChangedDelta);
-    frameAtIndex(0);
-
-    // Trying to destroy all data except an undecoded frame should go ahead and
-    // destroy all other frames.
-    setCurrentFrame(2);
-    destroyDecodedData(false);
-    EXPECT_EQ(-frameSize * 2, m_imageObserver->m_lastDecodedSizeChangedDelta);
+    EXPECT_EQ(frameSize, lastDecodedSizeChange());
 }
 
 template <typename HistogramEnumType>
diff --git a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
index 82cccab9..48e61ea 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
@@ -7,7 +7,6 @@
 
 #include "platform/PlatformExport.h"
 #include "wtf/Allocator.h"
-#include "wtf/MathExtras.h"
 #include <stdint.h>
 
 namespace blink {
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
index 8e0eb43..b7f8c45 100644
--- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
@@ -35,8 +35,8 @@
 
 namespace blink {
 
-DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkImageInfo& info, PassRefPtr<SegmentReader> data, bool allDataReceived, size_t index)
-    : SkImageGenerator(info)
+DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkImageInfo& info, PassRefPtr<SegmentReader> data, bool allDataReceived, size_t index, uint32_t uniqueID)
+    : SkImageGenerator(info, uniqueID)
     , m_frameGenerator(frameGenerator)
     , m_data(data)
     , m_allDataReceived(allDataReceived)
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
index 74ba6cab..28f04711 100644
--- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
@@ -48,9 +48,14 @@
     USING_FAST_MALLOC(DecodingImageGenerator);
     WTF_MAKE_NONCOPYABLE(DecodingImageGenerator);
 public:
+    // Make SkImageGenerator::kNeedNewImageUniqueID accessible.
+    enum {
+        kNeedNewImageUniqueID = SkImageGenerator::kNeedNewImageUniqueID
+    };
+
     static SkImageGenerator* create(SkData*);
 
-    DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&, PassRefPtr<SegmentReader>, bool allDataReceived, size_t index);
+    DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&, PassRefPtr<SegmentReader>, bool allDataReceived, size_t index, uint32_t uniqueID = kNeedNewImageUniqueID);
     ~DecodingImageGenerator() override;
 
     void setCanYUVDecode(bool yes) { m_canYUVDecode = yes; }
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index c8041a9..1db14bf 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -28,7 +28,6 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/SharedBuffer.h"
 #include "platform/graphics/DecodingImageGenerator.h"
-#include "platform/graphics/FrameData.h"
 #include "platform/graphics/ImageDecodingStore.h"
 #include "platform/graphics/ImageFrameGenerator.h"
 #include "platform/image-decoders/SegmentReader.h"
@@ -37,6 +36,25 @@
 
 namespace blink {
 
+struct DeferredFrameData {
+    DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
+    WTF_MAKE_NONCOPYABLE(DeferredFrameData);
+public:
+    DeferredFrameData()
+        : m_orientation(DefaultImageOrientation)
+        , m_duration(0)
+        , m_isComplete(false)
+        , m_frameBytes(0)
+        , m_uniqueID(DecodingImageGenerator::kNeedNewImageUniqueID)
+    {}
+
+    ImageOrientation m_orientation;
+    float m_duration;
+    bool m_isComplete;
+    size_t m_frameBytes;
+    uint32_t m_uniqueID;
+};
+
 bool DeferredImageDecoder::s_enabled = true;
 
 PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageDecoder::AlphaOption alphaOption, ImageDecoder::GammaAndColorProfileOption colorOptions)
@@ -90,16 +108,15 @@
     prepareLazyDecodedFrames();
 
     if (index < m_frameData.size()) {
-        FrameData* frameData = &m_frameData[index];
-        // ImageFrameGenerator has the latest known alpha state. There will be a
-        // performance boost if this frame is opaque.
-        ASSERT(m_frameGenerator);
-        frameData->m_hasAlpha = m_frameGenerator->hasAlpha(index);
+        DeferredFrameData* frameData = &m_frameData[index];
         if (m_actualDecoder)
             frameData->m_frameBytes = m_actualDecoder->frameBytesAtIndex(index);
         else
             frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData);
-        return createFrameImageAtIndex(index, !frameData->m_hasAlpha);
+        // ImageFrameGenerator has the latest known alpha state. There will be a
+        // performance boost if this frame is opaque.
+        DCHECK(m_frameGenerator);
+        return createFrameImageAtIndex(index, !m_frameGenerator->hasAlpha(index));
     }
 
     if (!m_actualDecoder || m_actualDecoder->failed())
@@ -258,7 +275,6 @@
         return;
 
     for (size_t i = previousSize; i < m_frameData.size(); ++i) {
-        m_frameData[i].m_haveMetadata = true;
         m_frameData[i].m_duration = m_actualDecoder->frameDurationAtIndex(i);
         m_frameData[i].m_orientation = m_actualDecoder->orientation();
         m_frameData[i].m_isComplete = m_actualDecoder->frameIsCompleteAtIndex(i);
@@ -283,7 +299,7 @@
     return SkImageInfo::MakeN32(decodedSize.width(), decodedSize.height(), knownToBeOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
 }
 
-PassRefPtr<SkImage> DeferredImageDecoder::createFrameImageAtIndex(size_t index, bool knownToBeOpaque) const
+PassRefPtr<SkImage> DeferredImageDecoder::createFrameImageAtIndex(size_t index, bool knownToBeOpaque)
 {
     const SkISize& decodedSize = m_frameGenerator->getFullSize();
     ASSERT(decodedSize.width() > 0);
@@ -291,11 +307,19 @@
 
     RefPtr<SkROBuffer> roBuffer = adoptRef(m_rwBuffer->newRBufferSnapshot());
     RefPtr<SegmentReader> segmentReader = SegmentReader::createFromSkROBuffer(roBuffer.release());
-    DecodingImageGenerator* generator = new DecodingImageGenerator(m_frameGenerator, imageInfoFrom(decodedSize, knownToBeOpaque), segmentReader.release(), m_allDataReceived, index);
+    DecodingImageGenerator* generator = new DecodingImageGenerator(m_frameGenerator, imageInfoFrom(decodedSize, knownToBeOpaque), segmentReader.release(), m_allDataReceived, index, m_frameData[index].m_uniqueID);
     RefPtr<SkImage> image = adoptRef(SkImage::NewFromGenerator(generator)); // SkImage takes ownership of the generator.
     if (!image)
         return nullptr;
 
+    // We can consider decoded bitmap constant and reuse uniqueID only after all
+    // data is received.  We reuse it also for multiframe images when image data
+    // is partially received but the frame data is fully received.
+    if (m_allDataReceived || m_frameData[index].m_isComplete) {
+        DCHECK(m_frameData[index].m_uniqueID == DecodingImageGenerator::kNeedNewImageUniqueID || m_frameData[index].m_uniqueID == image->uniqueID());
+        m_frameData[index].m_uniqueID = image->uniqueID();
+    }
+
     generator->setCanYUVDecode(m_canYUVDecode);
 
     return image.release();
@@ -308,3 +332,10 @@
 }
 
 } // namespace blink
+
+namespace WTF {
+template<> struct VectorTraits<blink::DeferredFrameData> : public SimpleClassVectorTraits<blink::DeferredFrameData> {
+    STATIC_ONLY(VectorTraits);
+    static const bool canInitializeWithMemset = false; // Not all DeferredFrameData members initialize to 0.
+};
+}
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
index f27bb669..72988c2 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
@@ -41,7 +41,7 @@
 
 class ImageFrameGenerator;
 class SharedBuffer;
-struct FrameData;
+struct DeferredFrameData;
 
 class PLATFORM_EXPORT DeferredImageDecoder final {
     WTF_MAKE_NONCOPYABLE(DeferredImageDecoder);
@@ -85,7 +85,7 @@
     void activateLazyDecoding();
     void prepareLazyDecodedFrames();
 
-    PassRefPtr<SkImage> createFrameImageAtIndex(size_t index, bool knownToBeOpaque) const;
+    PassRefPtr<SkImage> createFrameImageAtIndex(size_t index, bool knownToBeOpaque);
 
     // Copy of the data that is passed in, used by deferred decoding.
     // Allows creating readonly snapshots that may be read in another thread.
@@ -99,8 +99,8 @@
     bool m_hasColorProfile;
     bool m_canYUVDecode;
 
-    // Carries only frame state and other information. Does not carry bitmap.
-    Vector<FrameData> m_frameData;
+    // Caches frame state information.
+    Vector<DeferredFrameData> m_frameData;
     RefPtr<ImageFrameGenerator> m_frameGenerator;
 
     static bool s_enabled;
diff --git a/third_party/WebKit/Source/platform/graphics/FrameData.cpp b/third_party/WebKit/Source/platform/graphics/FrameData.cpp
index 8f3f36b..473af735 100644
--- a/third_party/WebKit/Source/platform/graphics/FrameData.cpp
+++ b/third_party/WebKit/Source/platform/graphics/FrameData.cpp
@@ -44,19 +44,13 @@
     clear(true);
 }
 
-bool FrameData::clear(bool clearMetadata)
+void FrameData::clear(bool clearMetadata)
 {
     if (clearMetadata)
         m_haveMetadata = false;
 
     m_orientation = DefaultImageOrientation;
     m_frameBytes = 0;
-
-    if (m_frame) {
-        m_frame.clear();
-        return true;
-    }
-    return false;
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/FrameData.h b/third_party/WebKit/Source/platform/graphics/FrameData.h
index 8b785b8d..eca09d2 100644
--- a/third_party/WebKit/Source/platform/graphics/FrameData.h
+++ b/third_party/WebKit/Source/platform/graphics/FrameData.h
@@ -47,9 +47,8 @@
 
     // Clear the cached image data on the frame, and (optionally) the metadata.
     // Returns whether there was cached image data to clear.
-    bool clear(bool clearMetadata);
+    void clear(bool clearMetadata);
 
-    RefPtr<SkImage> m_frame;
     ImageOrientation m_orientation;
     float m_duration;
     bool m_haveMetadata : 1;
diff --git a/third_party/WebKit/Source/platform/graphics/GeneratedImage.h b/third_party/WebKit/Source/platform/graphics/GeneratedImage.h
index de9cb392..fadc755 100644
--- a/third_party/WebKit/Source/platform/graphics/GeneratedImage.h
+++ b/third_party/WebKit/Source/platform/graphics/GeneratedImage.h
@@ -42,7 +42,7 @@
     IntSize size() const override { return m_size; }
 
     // Assume that generated content has no decoded data we need to worry about
-    void destroyDecodedData(bool) override { }
+    void destroyDecodedData() override { }
 
     PassRefPtr<SkImage> imageForCurrentFrame() override;
 
diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h
index e5ee444..e281591 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.h
+++ b/third_party/WebKit/Source/platform/graphics/Image.h
@@ -106,7 +106,7 @@
 
     virtual String filenameExtension() const { return String(); } // null string if unknown
 
-    virtual void destroyDecodedData(bool destroyAll) = 0;
+    virtual void destroyDecodedData() = 0;
 
     SharedBuffer* data() { return m_encodedImageData.get(); }
 
@@ -114,7 +114,6 @@
     // It will automatically pause once all observers no longer want to render the image anywhere.
     enum CatchUpAnimation { DoNotCatchUp, CatchUp };
     virtual void startAnimation(CatchUpAnimation = CatchUp) { }
-    virtual void stopAnimation() {}
     virtual void resetAnimation() {}
 
     // True if this image can potentially animate.
diff --git a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
index d9a0fa50..064ddf9 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
@@ -58,7 +58,7 @@
         return m_image;
     }
 
-    void destroyDecodedData(bool) override
+    void destroyDecodedData() override
     {
         // Image pure virtual stub.
     }
diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
index 562bd2a..001e3b01 100644
--- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
@@ -18,7 +18,7 @@
 
     static PassRefPtr<StaticBitmapImage> create(PassRefPtr<SkImage>);
     static PassRefPtr<StaticBitmapImage> create(WebExternalTextureMailbox&);
-    virtual void destroyDecodedData(bool destroyAll) { }
+    virtual void destroyDecodedData() { }
     virtual bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata);
     virtual IntSize size() const;
     void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override;
diff --git a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h
index a064a9f..64f47ad 100644
--- a/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h
+++ b/third_party/WebKit/Source/platform/transforms/TransformationMatrix.h
@@ -29,7 +29,6 @@
 #include "SkMatrix44.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatPoint3D.h"
-#include "platform/geometry/IntPoint.h"
 #include "wtf/Alignment.h"
 #include "wtf/Allocator.h"
 #include "wtf/CPU.h"
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Console.h b/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
index bd5fb8c..1080baa6 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.h
@@ -43,7 +43,7 @@
     static void timeCallback(const v8::FunctionCallbackInfo<v8::Value>&);
     static void timeEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
     static void timeStampCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-    // TODO(philipj): There is no spec for the Memory Info API, see blink-dev:
+    // TODO(foolip): There is no spec for the Memory Info API, see blink-dev:
     // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
     static void memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
     static void memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/web/WebPepperSocketImpl.cpp b/third_party/WebKit/Source/web/WebPepperSocketImpl.cpp
index f424a56..460456b9 100644
--- a/third_party/WebKit/Source/web/WebPepperSocketImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPepperSocketImpl.cpp
@@ -54,7 +54,7 @@
     , m_bufferedAmountAfterClose(0)
 {
     Document* coreDocument = document;
-    m_private = DocumentWebSocketChannel::create(coreDocument, m_channelProxy.get());
+    m_private = DocumentWebSocketChannel::create(coreDocument, m_channelProxy.get(), SourceLocation::capture());
 }
 
 WebPepperSocketImpl::~WebPepperSocketImpl()
@@ -140,7 +140,7 @@
 
 void WebPepperSocketImpl::fail(const WebString& reason)
 {
-    m_private->fail(reason, ErrorMessageLevel, String(), 0);
+    m_private->fail(reason, ErrorMessageLevel, nullptr);
 }
 
 void WebPepperSocketImpl::disconnect()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/config/builders.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/config/builders.py
new file mode 100644
index 0000000..1d4a20b
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/config/builders.py
@@ -0,0 +1,44 @@
+# Copyright (c) 2016, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Builders on the chromium.webkit continuous waterfall.
+WEBKIT_BUILDERS = {
+    "WebKit Win7": {"port_name": "win-win7", "specifiers": ['Win7', 'Release']},
+    "WebKit Win7 (dbg)": {"port_name": "win-win7", "specifiers": ['Win7', 'Debug']},
+    "WebKit Win10": {"port_name": "win-win10", "specifiers": ['Win10', 'Release']},
+    # FIXME: Rename this to 'WebKit Linux Precise'
+    "WebKit Linux": {"port_name": "linux-precise", "specifiers": ['Precise', 'Release']},
+    "WebKit Linux Trusty": {"port_name": "linux-trusty", "specifiers": ['Trusty', 'Release']},
+    "WebKit Linux (dbg)": {"port_name": "linux-precise", "specifiers": ['Precise', 'Debug']},
+    "WebKit Mac10.9": {"port_name": "mac-mac10.9", "specifiers": ['Mac10.9', 'Release']},
+    "WebKit Mac10.10": {"port_name": "mac-mac10.10", "specifiers": ['Mac10.10', 'Release']},
+    "WebKit Mac10.11": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Release']},
+    "WebKit Mac10.11 (dbg)": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Debug']},
+    "WebKit Mac10.11 (retina)": {"port_name": "mac-retina", "specifiers": ['Retina', 'Release']},
+    "WebKit Android (Nexus4)": {"port_name": "android", "specifiers": ['Android', 'Release']},
+}
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py
index 186714d..9eabd44e 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py
@@ -32,11 +32,12 @@
 import sys
 
 from webkitpy.common.checkout.scm.detection import SCMDetector
+from webkitpy.common.config.builders import WEBKIT_BUILDERS
 from webkitpy.common.memoized import memoized
 from webkitpy.common.net.buildbot import BuildBot
 from webkitpy.common.net import web
 from webkitpy.common.system.systemhost import SystemHost
-from webkitpy.layout_tests.builders import Builders
+from webkitpy.layout_tests.builder_list import BuilderList
 from webkitpy.layout_tests.port.factory import PortFactory
 
 
@@ -62,7 +63,7 @@
 
         self._engage_awesome_locale_hacks()
 
-        self.builders = Builders()
+        self.builders = BuilderList(WEBKIT_BUILDERS)
 
     # We call this from the Host constructor, as it's one of the
     # earliest calls made for all webkitpy-based programs.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py
index 1863337..9420762 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py
@@ -26,13 +26,14 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+from webkitpy.common.config.builders import WEBKIT_BUILDERS
 from webkitpy.common.checkout.scm.scm_mock import MockSCM
 from webkitpy.common.net.buildbot_mock import MockBuildBot
 from webkitpy.common.net.web_mock import MockWeb
 from webkitpy.common.system.systemhost_mock import MockSystemHost
 
 # New-style ports need to move down into webkitpy.common.
-from webkitpy.layout_tests.builders import Builders
+from webkitpy.layout_tests.builder_list import BuilderList
 from webkitpy.layout_tests.port.factory import PortFactory
 from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem
 
@@ -55,7 +56,7 @@
         # on the list of known ports should override this with a MockPortFactory.
         self.port_factory = PortFactory(self)
 
-        self.builders = Builders()
+        self.builders = BuilderList(WEBKIT_BUILDERS)
 
     def initialize_scm(self, patch_directories=None):
         if not self._scm:
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
index 2beb0c4..d22ec83 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
@@ -296,10 +296,6 @@
             _log.error("Error decoding json data from %s: %s" % (build_url, err))
             return None
 
-    def _fetch_one_box_per_builder(self):
-        build_status_url = "%s/one_box_per_builder" % self.buildbot_url
-        return urllib2.urlopen(build_status_url)
-
     def _file_cell_text(self, file_cell):
         """Traverses down through firstChild elements until one containing a string is found, then returns that string"""
         element = file_cell
@@ -330,9 +326,10 @@
     def builders(self):
         return [self.builder_with_name(status["name"]) for status in self.builder_statuses()]
 
-    # This method pulls from /one_box_per_builder as an efficient way to get information about
     def builder_statuses(self):
-        soup = BeautifulSoup(self._fetch_one_box_per_builder())
+        builders_page_url = "%s/builders" % self.buildbot_url
+        builders_page_content = urllib2.urlopen(builders_page_url)
+        soup = BeautifulSoup(builders_page_content)
         return [self._parse_builder_status_from_row(status_row) for status_row in soup.find('table').findAll('tr')]
 
     def builder_with_name(self, name):
@@ -342,9 +339,15 @@
             self._builder_by_name[name] = builder
         return builder
 
-    # This makes fewer requests than calling Builder.latest_build would.  It grabs all builder
-    # statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
     def _latest_builds_from_builders(self):
+        """Fetches a list of latest builds.
+
+        This is for the chromium.webkit waterfall by default.
+
+        This makes fewer requests than calling Builder.latest_build would.
+        It grabs all builder statuses in one request by fetching from .../builders
+        instead of builder pages.
+        """
         builder_statuses = self.builder_statuses()
         return [self.builder_with_name(status["name"]).build(status["build_number"]) for status in builder_statuses]
 
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list.py
similarity index 60%
rename from third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders.py
rename to third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list.py
index bc0a39f..714a72c6 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list.py
@@ -28,46 +28,36 @@
 
 import re
 
-"""Represents builder bots running layout tests.
+"""Represents a set of builder bots running layout tests.
 
-This class is used to keep a list of all builder bots running layout tests on
-the Chromium waterfall. There are other waterfalls that run layout tests but
-this list is the one we care about in the context of TestExpectations. The
-builders are hard coded in the constructor but can be overridden for unit tests.
+This class is used to hold a list of builder bots running layout tests and their
+corresponding port names and TestExpectations specifiers.
 
+The actual constants are in webkitpy.common.config.builders.
 """
-class Builders(object):
 
-    def __init__(self):
-        """ In this dictionary, each item stores:
 
-            * port_name -- a fully qualified port name
-            * rebaseline_override_dir -- (optional) directory to put baselines in instead of where
+class BuilderList(object):
+
+    def __init__(self, builders_dict):
+        """The given dictionary maps builder names to dicts with the keys:
+
+            port_name: A fully qualified port name.
+            specifiers: TestExpectations specifiers for that config. Valid values are found in
+                  TestExpectationsParser._configuration_tokens_list.
+            TODO(qyearsley): Remove rebaseline_override_dir if it's not used.
+            rebaseline_override_dir (optional): Directory to put baselines in instead of where
                   you would normally put them. This is useful when we don't have bots that cover
                   particular configurations; so, e.g., you might support mac-mountainlion but not
                   have a mac-mountainlion bot yet, so you'd want to put the mac-lion results into
                   platform/mac temporarily.
-            * specifiers -- TestExpectation specifiers for that config. Valid values are found in
-                 TestExpectationsParser._configuration_tokens_list
-        """
-        self._exact_matches = {
-            "WebKit Win7": {"port_name": "win-win7", "specifiers": ['Win7', 'Release']},
-            "WebKit Win7 (dbg)": {"port_name": "win-win7", "specifiers": ['Win7', 'Debug']},
-            "WebKit Win10": {"port_name": "win-win10", "specifiers": ['Win10', 'Release']},
-            # FIXME: Rename this to 'WebKit Linux Precise'
-            "WebKit Linux": {"port_name": "linux-precise", "specifiers": ['Precise', 'Release']},
-            "WebKit Linux Trusty": {"port_name": "linux-trusty", "specifiers": ['Trusty', 'Release']},
-            "WebKit Linux (dbg)": {"port_name": "linux-precise", "specifiers": ['Precise', 'Debug']},
-            "WebKit Mac10.9": {"port_name": "mac-mac10.9", "specifiers": ['Mac10.9', 'Release']},
-            "WebKit Mac10.10": {"port_name": "mac-mac10.10", "specifiers": ['Mac10.10', 'Release']},
-            "WebKit Mac10.11": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Release']},
-            "WebKit Mac10.11 (dbg)": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Debug']},
-            "WebKit Mac10.11 (retina)": {"port_name": "mac-retina", "specifiers": ['Retina', 'Release']},
-            "WebKit Android (Nexus4)": {"port_name": "android", "specifiers": ['Android', 'Release']},
-        }
 
-        self._ports_without_builders = [
-        ]
+        Possible refactoring note: Potentially, it might make sense to use
+        webkitpy.common.buildbot.Builder and add port_name and specifiers
+        properties to that class.
+        """
+        self._exact_matches = builders_dict
+        self._ports_without_builders = []
 
     def builder_path_from_name(self, builder_name):
         return re.sub(r'[\s().]', '_', builder_name)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list_unittest.py
similarity index 88%
rename from third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders_unittest.py
rename to third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list_unittest.py
index b514212..d240644 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builder_list_unittest.py
@@ -28,10 +28,10 @@
 
 import unittest
 
-from builders import Builders
+from webkitpy.layout_tests.builder_list import BuilderList
 
 
-class BuildersTest(unittest.TestCase):
+class BuilderListTest(unittest.TestCase):
 
     def test_path_from_name(self):
         tests = {
@@ -39,6 +39,6 @@
             'Mac 10.6 (dbg)(1)': 'Mac_10_6__dbg__1_',
             '(.) ': '____',
         }
-        builders = Builders()
+        builder_list = BuilderList({})
         for name, expected in tests.items():
-            self.assertEqual(expected, builders.builder_path_from_name(name))
+            self.assertEqual(expected, builder_list.builder_path_from_name(name))
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
index 70750c9..a0b6c6c 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
@@ -35,7 +35,6 @@
 import urllib
 import urllib2
 
-from webkitpy.layout_tests.builders import Builders
 from webkitpy.layout_tests.models.test_expectations import TestExpectations, PASS
 from webkitpy.layout_tests.models.test_expectations import TestExpectationLine
 
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py
index 3310ccf..a04d31d 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py
@@ -28,33 +28,30 @@
 
 import unittest
 
+from webkitpy.common.config.builders import WEBKIT_BUILDERS
 from webkitpy.layout_tests.layout_package import bot_test_expectations
 from webkitpy.layout_tests.models import test_expectations
-from webkitpy.layout_tests.builders import Builders
-
-
-class FakeBuilders(Builders):
-
-    def __init__(self):
-        super(FakeBuilders, self).__init__()
-        self._exact_matches = {
-            "Dummy builder name": {"port_name": "dummy-port", "specifiers": []},
-        }
+from webkitpy.layout_tests.builder_list import BuilderList
 
 
 class BotTestExpectationsFactoryTest(unittest.TestCase):
 
+    def fake_builder_list(self):
+        return BuilderList({
+            "Dummy builder name": {"port_name": "dummy-port", "specifiers": []},
+        })
+
     def fake_results_json_for_builder(self, builder):
         return bot_test_expectations.ResultsJSON(builder, 'Dummy content')
 
     def test_expectations_for_builder(self):
-        factory = bot_test_expectations.BotTestExpectationsFactory(FakeBuilders())
+        factory = bot_test_expectations.BotTestExpectationsFactory(self.fake_builder_list())
         factory._results_json_for_builder = self.fake_results_json_for_builder
 
         self.assertIsNotNone(factory.expectations_for_builder('Dummy builder name'))
 
     def test_expectations_for_port(self):
-        factory = bot_test_expectations.BotTestExpectationsFactory(FakeBuilders())
+        factory = bot_test_expectations.BotTestExpectationsFactory(self.fake_builder_list())
         factory._results_json_for_builder = self.fake_results_json_for_builder
 
         self.assertIsNotNone(factory.expectations_for_port('dummy-port'))
@@ -70,7 +67,7 @@
 
     def _assert_is_flaky(self, results_string, should_be_flaky, only_ignore_very_flaky, expected=None):
         results_json = self._results_json_from_test_data({})
-        expectations = bot_test_expectations.BotTestExpectations(results_json, Builders(), set('test'))
+        expectations = bot_test_expectations.BotTestExpectations(results_json, BuilderList(WEBKIT_BUILDERS), set('test'))
 
         results_entry = self._results_from_string(results_string)
         if expected:
@@ -113,12 +110,12 @@
 
     def _assert_expectations(self, test_data, expectations_string, only_ignore_very_flaky):
         results_json = self._results_json_from_test_data(test_data)
-        expectations = bot_test_expectations.BotTestExpectations(results_json, Builders(), set('test'))
+        expectations = bot_test_expectations.BotTestExpectations(results_json, BuilderList(WEBKIT_BUILDERS), set('test'))
         self.assertEqual(expectations.flakes_by_path(only_ignore_very_flaky), expectations_string)
 
     def _assert_unexpected_results(self, test_data, expectations_string):
         results_json = self._results_json_from_test_data(test_data)
-        expectations = bot_test_expectations.BotTestExpectations(results_json, Builders(), set('test'))
+        expectations = bot_test_expectations.BotTestExpectations(results_json, BuilderList(WEBKIT_BUILDERS), set('test'))
         self.assertEqual(expectations.unexpected_results_by_path(), expectations_string)
 
     def test_basic(self):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
index c251b78..a1929dc5 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
@@ -6,21 +6,11 @@
 
 from webkitpy.common.checkout.scm.scm_mock import MockSCM
 from webkitpy.layout_tests.layout_package import bot_test_expectations
-from webkitpy.layout_tests.builders import Builders
+from webkitpy.layout_tests.builder_list import BuilderList
 from webkitpy.tool.commands.commandtest import CommandsTest
 from webkitpy.tool.mocktool import MockTool, MockOptions
 
 
-class FakeBuilders(Builders):
-
-    def __init__(self):
-        super(FakeBuilders, self).__init__()
-        self._exact_matches = {
-            "foo-builder": {"port_name": "dummy-port", "specifiers": ['Linux', 'Release']},
-            "bar-builder": {"port_name": "dummy-port", "specifiers": ['Mac', 'Debug']},
-        }
-
-
 class FakeBotTestExpectations(object):
 
     def expectation_lines(self, only_ignore_very_flaky=False):
@@ -63,9 +53,16 @@
 
 class FlakyTestsTest(CommandsTest):
 
+    @staticmethod
+    def fake_builders_list():
+        return BuilderList({
+            "foo-builder": {"port_name": "dummy-port", "specifiers": ['Linux', 'Release']},
+            "bar-builder": {"port_name": "dummy-port", "specifiers": ['Mac', 'Debug']},
+        })
+
     def test_merge_lines(self):
         command = flakytests.FlakyTests()
-        factory = FakeBotTestExpectationsFactory(FakeBuilders())
+        factory = FakeBotTestExpectationsFactory(self.fake_builders_list())
 
         lines = command._collect_expectation_lines(['foo-builder', 'bar-builder'], factory)
         self.assertEqual(len(lines), 1)
@@ -75,7 +72,7 @@
     def test_integration(self):
         command = flakytests.FlakyTests()
         tool = MockTool()
-        tool.builders = FakeBuilders()
+        tool.builders = self.fake_builders_list()
         command.expectations_factory = FakeBotTestExpectationsFactory
         options = MockOptions(upload=True)
         expected_stdout = flakytests.FlakyTests.OUTPUT % (
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index 8622a71..c0f6802 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -45,7 +45,6 @@
 from webkitpy.layout_tests.models import test_failures
 from webkitpy.layout_tests.models.test_expectations import TestExpectations, BASELINE_SUFFIX_LIST, SKIP
 from webkitpy.layout_tests.port import factory
-from webkitpy.layout_tests.builders import Builders
 from webkitpy.tool.commands.command import Command
 
 
@@ -58,7 +57,8 @@
 
 
 class AbstractRebaseliningCommand(Command):
-    # not overriding execute() - pylint: disable=W0223
+    """Base class for rebaseline-related commands."""
+    # Not overriding execute() - pylint: disable=abstract-method
 
     no_optimize_option = optparse.make_option('--no-optimize', dest='optimize', action='store_false', default=True,
                                               help=('Do not optimize/de-dup the expectations after rebaselining (default is to de-dup automatically). '
@@ -66,10 +66,10 @@
 
     platform_options = factory.platform_options(use_globs=True)
 
-    results_directory_option = optparse.make_option("--results-directory", help="Local results directory to use")
+    results_directory_option = optparse.make_option("--results-directory", help="Local results directory to use.")
 
     suffixes_option = optparse.make_option("--suffixes", default=','.join(BASELINE_SUFFIX_LIST), action="store",
-                                           help="Comma-separated-list of file types to rebaseline")
+                                           help="Comma-separated-list of file types to rebaseline.")
 
     def __init__(self, options=None):
         super(AbstractRebaseliningCommand, self).__init__(options=options)
@@ -84,13 +84,15 @@
 
 
 class BaseInternalRebaselineCommand(AbstractRebaseliningCommand):
+    """Base class for rebaseline-related commands that are intended to be used by other commands."""
+    # Not overriding execute() - pylint: disable=abstract-method
 
     def __init__(self):
         super(BaseInternalRebaselineCommand, self).__init__(options=[
             self.results_directory_option,
             self.suffixes_option,
-            optparse.make_option("--builder", help="Builder to pull new baselines from"),
-            optparse.make_option("--test", help="Test to rebaseline"),
+            optparse.make_option("--builder", help="Builder to pull new baselines from."),
+            optparse.make_option("--test", help="Test to rebaseline."),
         ])
 
     def _baseline_directory(self, builder_name):
@@ -128,7 +130,7 @@
                 if index:
                     immediate_predecessors_in_fallback.append(self._tool.filesystem.basename(baseline_search_path[index - 1]))
             except ValueError:
-                # index throw's a ValueError if the item isn't in the list.
+                # baseline_search_path.index() throws a ValueError if the item isn't in the list.
                 pass
         return immediate_predecessors_in_fallback
 
@@ -245,7 +247,7 @@
         super(OptimizeBaselines, self).__init__(options=[
             self.suffixes_option,
             optparse.make_option('--no-modify-scm', action='store_true', default=False,
-                                 help='Dump SCM commands as JSON instead of '),
+                                 help='Dump SCM commands as JSON instead of actually committing changes.'),
         ] + self.platform_options)
 
     def _optimize_baseline(self, optimizer, test_name):
@@ -288,7 +290,7 @@
     def __init__(self):
         super(AnalyzeBaselines, self).__init__(options=[
             self.suffixes_option,
-            optparse.make_option('--missing', action='store_true', default=False, help='show missing baselines as well'),
+            optparse.make_option('--missing', action='store_true', default=False, help='Show missing baselines as well.'),
         ] + self.platform_options)
         self._optimizer_class = BaselineOptimizer  # overridable for testing
         self._baseline_optimizer = None
@@ -320,7 +322,8 @@
 
 
 class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand):
-    # not overriding execute() - pylint: disable=W0223
+    """Base class for rebaseline commands that do some tasks in parallel."""
+    # Not overriding execute() - pylint: disable=abstract-method
 
     def __init__(self, options=None):
         super(AbstractParallelRebaselineCommand, self).__init__(options=options)
@@ -359,10 +362,16 @@
             traceback.print_exc(file=sys.stderr)
 
     def _builders_to_fetch_from(self, builders_to_check):
-        # This routine returns the subset of builders that will cover all of the baseline search paths
-        # used in the input list. In particular, if the input list contains both Release and Debug
-        # versions of a configuration, we *only* return the Release version (since we don't save
-        # debug versions of baselines).
+        """Returns the subset of builders that will cover all of the baseline search paths
+        used in the input list.
+
+        In particular, if the input list contains both Release and Debug
+        versions of a configuration, we *only* return the Release version
+        (since we don't save debug versions of baselines).
+
+        Args:
+          builders_to_check: List of builder names.
+        """
         release_builders = set()
         debug_builders = set()
         builders_to_fallback_paths = {}
@@ -624,7 +633,7 @@
 
 class Rebaseline(AbstractParallelRebaselineCommand):
     name = "rebaseline"
-    help_text = "Rebaseline tests with results from the build bots. Shows the list of failing tests on the builders if no test names are provided."
+    help_text = "Rebaseline tests with results from the build bots."
     show_in_main_help = True
     argument_names = "[TEST_NAMES]"
 
@@ -635,7 +644,7 @@
             self.suffixes_option,
             self.results_directory_option,
             optparse.make_option("--builders", default=None, action="append",
-                                 help="Comma-separated-list of builders to pull new baselines from (can also be provided multiple times)"),
+                                 help="Comma-separated-list of builders to pull new baselines from (can also be provided multiple times)."),
         ])
 
     def _builders_to_pull_from(self):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index 11b573e7..aa3a1da 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -37,18 +37,11 @@
 from webkitpy.common.system.executive_mock import MockExecutive
 from webkitpy.common.system.executive_mock import MockExecutive2
 from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.layout_tests.builders import Builders
+from webkitpy.layout_tests.builder_list import BuilderList
 from webkitpy.tool.commands.rebaseline import *
 from webkitpy.tool.mocktool import MockTool, MockOptions
 
 
-class FakeBuilders(Builders):
-
-    def __init__(self, builders_dict):
-        super(FakeBuilders, self).__init__()
-        self._exact_matches = builders_dict
-
-
 class _BaseTestCase(unittest.TestCase):
     MOCK_WEB_RESULT = 'MOCK Web result, convert 404 to None=True'
     WEB_PREFIX = 'http://example.com/f/builders/WebKit Mac10.11/results/layout-test-results'
@@ -123,7 +116,7 @@
         self._write(port._filesystem.join(port.layout_tests_dir(),
                                           'platform/test-mac-mac10.10/failures/expected/image-expected.txt'), 'original mac10.11 result')
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -152,7 +145,7 @@
         self._write(port._filesystem.join(port.layout_tests_dir(),
                                           'platform/test-win-win7/failures/expected/image-expected.txt'), 'original win7 result')
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Trusty": {"port_name": "test-linux-trusty", "specifiers": set(["mock-specifier"])},
             "MOCK Precise": {"port_name": "test-linux-precise", "specifiers": set(["mock-specifier"])},
@@ -185,7 +178,7 @@
         self._write(port._filesystem.join(port.layout_tests_dir(),
                                           'platform/test-win-win7/failures/expected/image-expected.txt'), 'original win7 result')
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Trusty": {"port_name": "test-linux-trusty", "specifiers": set(["mock-specifier"])},
             "MOCK Win7": {"port_name": "test-win-win7", "specifiers": set(["mock-specifier"])},
@@ -217,7 +210,7 @@
         self._write(expectations_path, (
             "[ Win ] failures/expected/image.html [ Failure ]\n"
             "[ Linux ] failures/expected/image.html [ Skip ]\n"))
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Trusty": {"port_name": "test-linux-trusty", "specifiers": set(["mock-specifier"])},
             "MOCK Precise": {"port_name": "test-linux-precise", "specifiers": set(["mock-specifier"])},
@@ -320,7 +313,7 @@
         self._write(port._filesystem.join(port.layout_tests_dir(),
                                           'platform/test-win-win10/failures/expected/image-expected.txt'), 'original win10 result')
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Win7": {"port_name": "test-win-win7"},
             "MOCK Win10": {"port_name": "test-win-win10"},
         })
@@ -346,7 +339,7 @@
     command_constructor = AbstractParallelRebaselineCommand
 
     def test_builders_to_fetch_from(self):
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Win10": {"port_name": "test-win-win10"},
             "MOCK Win7": {"port_name": "test-win-win7"},
             "MOCK Win7 (dbg)(1)": {"port_name": "test-win-win7"},
@@ -364,7 +357,7 @@
     def setUp(self):
         super(TestRebaselineJson, self).setUp()
         self.tool.executive = MockExecutive2()
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK builder": {"port_name": "test-mac-mac10.11"},
             "MOCK builder (Debug)": {"port_name": "test-mac-mac10.11"},
         })
@@ -568,7 +561,7 @@
         self._zero_out_test_expectations()
         self._setup_mock_builder_data()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK builder": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
         })
         self.command.execute(MockOptions(results_directory=False, optimize=False, builders=None,
@@ -587,7 +580,7 @@
 
         self._setup_mock_builder_data()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK builder": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
         })
         self.command.execute(MockOptions(results_directory=False, optimize=False, builders=None,
@@ -678,7 +671,7 @@
             'userscripts/not-actually-failing.html': set(['txt', 'png', 'wav']),
         }
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -746,7 +739,7 @@
             'userscripts/reftest-image-text.html': set(['png', 'txt']),
         }
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -835,7 +828,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -877,7 +870,7 @@
         self._write_test_file(test_port, 'platform/mac/another/test-expected.txt', "result A")
         self._write_test_file(test_port, 'another/test-expected.txt', "result A")
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10 Debug": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
         })
         OutputCapture().assert_outputs(self, self.command.execute, args=[
@@ -897,7 +890,7 @@
         self._write_test_file(test_port, 'platform/mac-mac10.10/another/test-expected.txt', "result A")
         self._write_test_file(test_port, 'another/test-expected.txt', "result A")
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10 Debug": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
         })
         OutputCapture().assert_outputs(self, self.command.execute, args=[
@@ -919,7 +912,7 @@
         self._write_test_file(test_port, 'another/test-expected.txt', "result A")
         self._write_test_file(test_port, 'another/test-expected.png', "result A png")
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10 Debug": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
         })
         try:
@@ -1001,7 +994,7 @@
         self.command.bot_revision_data = lambda: [{"builder": "Mock builder", "revision": "9000"}]
 
     def test_release_builders(self):
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11 Debug": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11 ASAN": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
@@ -1147,7 +1140,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -1240,7 +1233,7 @@
 
         self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents")
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
 
@@ -1300,7 +1293,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
@@ -1356,7 +1349,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["mock-specifier"])},
         })
         old_branch_name = self.tool.scm().current_branch_or_ref
@@ -1414,7 +1407,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["mock-specifier"])},
         })
 
@@ -1473,7 +1466,7 @@
 
         self.tool.executive = MockLineRemovingExecutive()
 
-        self.tool.builders = FakeBuilders({
+        self.tool.builders = BuilderList({
             "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": set(["mock-specifier"])},
             "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": set(["mock-specifier"])},
         })
diff --git a/third_party/brotli/BUILD.gn b/third_party/brotli/BUILD.gn
index 5b13e6f..e08f23d 100644
--- a/third_party/brotli/BUILD.gn
+++ b/third_party/brotli/BUILD.gn
@@ -2,6 +2,10 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+if (is_win) {
+  import("//build/config/win/visual_studio_version.gni")
+}
+
 source_set("brotli") {
   sources = [
     "dec/bit_reader.c",
@@ -85,15 +89,16 @@
       ":brotli",
     ]
 
+    if (is_win && visual_studio_version == "2015") {
+      # Disabling "result of 32-bit shift implicitly converted to 64 bits",
+      # caused by code like: foo |= (1 << i);   // warning 4334
+      cflags = [ "/wd4334" ]
+    }
+
     # Always build release since this is a build tool.
     if (is_debug) {
       configs -= [ "//build/config:debug" ]
       configs += [ "//build/config:release" ]
     }
-    if (is_posix) {
-      configs -= [ "//build/config/gcc:no_exceptions" ]
-    } else if (is_win) {
-      cflags_cc = [ "/EHsc" ]
-    }
   }
 }
diff --git a/third_party/brotli/README.chromium b/third_party/brotli/README.chromium
index 7b3f4896..15478026 100644
--- a/third_party/brotli/README.chromium
+++ b/third_party/brotli/README.chromium
@@ -16,6 +16,8 @@
   tools.
 - Lines 659 of enc/hash.h and 66 of enc/cluster.h were modified to eliminate
   build errors that appeared on Windows.
+- Lines 290 - 304 from tools/bro.cc were adjusted to remove a try/catch block,
+  which are disabled by default in Chromium.
 - BUILD.gn: Added.
 - brotli.gyp: Added.
 - brotli.gni: Added.
diff --git a/third_party/brotli/bro.gypi b/third_party/brotli/bro.gypi
index 5daecda..a416b92 100644
--- a/third_party/brotli/bro.gypi
+++ b/third_party/brotli/bro.gypi
@@ -41,6 +41,6 @@
     '<(output_file)',
   ],
   'dependencies': [
-    '<(DEPTH)/third_party/brotli/brotli.gyp:bro',
+    '<(DEPTH)/third_party/brotli/brotli.gyp:bro#host',
   ],
 }
diff --git a/third_party/brotli/brotli.gyp b/third_party/brotli/brotli.gyp
index 6001acb..59d6b7e 100644
--- a/third_party/brotli/brotli.gyp
+++ b/third_party/brotli/brotli.gyp
@@ -33,6 +33,7 @@
           'cflags': ['-O2'],
         }],
       ],
+      'toolsets': ['host', 'target'],
     },
     {
       'target_name': 'bro',
@@ -88,16 +89,12 @@
         'enc/write_bits.h',
         'tools/bro.cc',
       ],
+      'toolsets': ['host'],
       'conditions': [
-        ['OS=="win"', {
-          'msvs_settings': {
-            'VCCLCompilerTool': {
-              'AdditionalOptions': [ '/EHsc', ],
-            },
-          },
-        }],
-        ['os_posix==1', {
-          'cflags_cc!': [ '-fno-exceptions', ],
+        ['OS=="win" and MSVS_VERSION == "2015"', {
+          # Disabling "result of 32-bit shift implicitly converted to 64 bits",
+          # caused by code like: foo |= (1 << i);   // warning 4334
+          'msvs_disabled_warnings': [ 4334, ],
         }],
       ],
     }
diff --git a/third_party/brotli/tools/bro.cc b/third_party/brotli/tools/bro.cc
index b254f0f..0c2ec76 100644
--- a/third_party/brotli/tools/bro.cc
+++ b/third_party/brotli/tools/bro.cc
@@ -287,16 +287,10 @@
       brotli::BrotliParams params;
       params.lgwin = lgwin;
       params.quality = quality;
-      try {
-        brotli::BrotliFileIn in(fin, 1 << 16);
-        brotli::BrotliFileOut out(fout);
-        if (!BrotliCompress(params, &in, &out)) {
-          fprintf(stderr, "compression failed\n");
-          unlink(output_path);
-          exit(1);
-        }
-      } catch (std::bad_alloc&) {
-        fprintf(stderr, "not enough memory\n");
+      brotli::BrotliFileIn in(fin, 1 << 16);
+      brotli::BrotliFileOut out(fout);
+      if (!BrotliCompress(params, &in, &out)) {
+        fprintf(stderr, "compression failed\n");
         unlink(output_path);
         exit(1);
       }
diff --git a/third_party/expat/BUILD.gn b/third_party/expat/BUILD.gn
index 533296e55..e70f31b 100644
--- a/third_party/expat/BUILD.gn
+++ b/third_party/expat/BUILD.gn
@@ -3,6 +3,7 @@
 # found in the LICENSE file.
 
 import("//build/config/chromecast_build.gni")
+import("//testing/libfuzzer/fuzzer_test.gni")
 
 # Chromecast doesn't ship expat as a system library
 if (is_linux && !is_chromecast) {
@@ -37,3 +38,13 @@
     }
   }
 }
+
+fuzzer_test("expat_xml_parse_fuzzer") {
+  sources = [
+    "fuzz/expat_xml_parse_fuzzer.cc",
+  ]
+  deps = [
+    ":expat",
+  ]
+  dict = "//testing/libfuzzer/fuzzers/dicts/xml.dict"
+}
diff --git a/third_party/expat/fuzz/expat_xml_parse_fuzzer.cc b/third_party/expat/fuzz/expat_xml_parse_fuzzer.cc
new file mode 100644
index 0000000..78b6a2d
--- /dev/null
+++ b/third_party/expat/fuzz/expat_xml_parse_fuzzer.cc
@@ -0,0 +1,63 @@
+// Copyright 2016 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 <stddef.h>
+#include <stdint.h>
+
+#include "third_party/expat/files/lib/expat.h"
+
+#include <array>
+
+static void XMLCALL
+startElement(void* userData, const char* name, const char** atts) {
+  int* depthPtr = static_cast<int*>(userData);
+  (void)atts;
+
+  for (int i = 0; i < *depthPtr; i++)
+    (void)name;
+
+  *depthPtr += 1;
+}
+
+
+static void XMLCALL
+endElement(void* userData, const char* name) {
+  int* depthPtr = static_cast<int*>(userData);
+  (void)name;
+
+  *depthPtr -= 1;
+}
+
+
+std::array<const char*, 7> kEncodings = {{ "UTF-16", "UTF-8", "ISO_8859_1",
+                                           "US_ASCII", "UTF_16BE", "UTF_16LE",
+                                            nullptr }};
+
+
+// Entry point for LibFuzzer.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  for (auto enc : kEncodings) {
+    XML_Parser parser = XML_ParserCreate(enc);
+    if (!parser)
+      return 0;
+
+    int depth = 0;
+    XML_SetUserData(parser, &depth);
+    XML_SetElementHandler(parser, startElement, endElement);
+
+    const char* dataPtr = reinterpret_cast<const char*>(data);
+
+    // Feed the data with two different values of |isFinal| for better coverage.
+    for (int isFinal = 0; isFinal <= 1; ++isFinal) {
+      if (XML_Parse(parser, dataPtr, size, isFinal) == XML_STATUS_ERROR) {
+        XML_ErrorString(XML_GetErrorCode(parser));
+        XML_GetCurrentLineNumber(parser);
+      }
+    }
+
+    XML_ParserFree(parser);
+  }
+
+  return 0;
+}
diff --git a/third_party/google_toolbox_for_mac/BUILD.gn b/third_party/google_toolbox_for_mac/BUILD.gn
index b0461d0a..42f04a6 100644
--- a/third_party/google_toolbox_for_mac/BUILD.gn
+++ b/third_party/google_toolbox_for_mac/BUILD.gn
@@ -23,6 +23,8 @@
     "src/DebugUtils/GTMMethodCheck.m",
     "src/Foundation/GTMLightweightProxy.h",
     "src/Foundation/GTMLightweightProxy.m",
+    "src/Foundation/GTMLogger.h",
+    "src/Foundation/GTMLogger.m",
     "src/Foundation/GTMNSDictionary+URLArguments.h",
     "src/Foundation/GTMNSDictionary+URLArguments.m",
     "src/Foundation/GTMNSObject+KeyValueObserving.h",
@@ -112,8 +114,6 @@
       "src/Foundation/GTMLocalizedString.h",
       "src/Foundation/GTMLogger+ASL.h",
       "src/Foundation/GTMLogger+ASL.m",
-      "src/Foundation/GTMLogger.h",
-      "src/Foundation/GTMLogger.m",
       "src/Foundation/GTMLoggerRingBufferWriter.h",
       "src/Foundation/GTMLoggerRingBufferWriter.m",
       "src/Foundation/GTMNSAppleEventDescriptor+Foundation.h",
diff --git a/tools/android/checkstyle/chromium-style-5.0.xml b/tools/android/checkstyle/chromium-style-5.0.xml
index 6557f61..700f449a 100644
--- a/tools/android/checkstyle/chromium-style-5.0.xml
+++ b/tools/android/checkstyle/chromium-style-5.0.xml
@@ -7,6 +7,9 @@
 <module name="Checker">
   <property name="severity" value="warning"/>
   <property name="charset" value="UTF-8"/>
+  <module name="SuppressionFilter">
+    <property name="file" value="tools/android/checkstyle/suppressions.xml"/>
+  </module>
   <module name="TreeWalker">
     <module name="AvoidStarImport">
       <property name="severity" value="error"/>
@@ -208,6 +211,13 @@
       <property name="ignoreComments" value="true"/>
       <property name="message" value="Avoid android.app.AlertDialog; if possible, use android.support.v7.app.AlertDialog instead, which has a Material look on all devices. (Some parts of the codebase can’t depend on the support library, in which case android.app.AlertDialog is the only option)"/>
     </module>
+    <module name="RegexpSinglelineJava">
+      <property name="id" value="SharedPreferencesCheck"/>
+      <property name="severity" value="error"/>
+      <property name="format" value="getDefaultSharedPreferences"/>
+      <property name="ignoreComments" value="true"/>
+      <property name="message" value="Use ContextUtils.getAppSharedPreferences() instead to access app-wide SharedPreferences."/>
+    </module>
   </module>
 
   <!-- Non-TreeWalker modules -->
diff --git a/tools/android/checkstyle/suppressions.xml b/tools/android/checkstyle/suppressions.xml
new file mode 100644
index 0000000..850d7d4
--- /dev/null
+++ b/tools/android/checkstyle/suppressions.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+
+<suppressions>
+  <suppress id="SharedPreferencesCheck" files="ContextUtils.java"/>
+</suppressions>
diff --git a/tools/android/loading/activity_lens.py b/tools/android/loading/activity_lens.py
index 7fdd9af..3e3a98ef 100644
--- a/tools/android/loading/activity_lens.py
+++ b/tools/android/loading/activity_lens.py
@@ -182,8 +182,24 @@
     assert end_msec - start_msec >= 0.
     events = self._OverlappingMainRendererThreadEvents(start_msec, end_msec)
     result = {'edge_cost': end_msec - start_msec,
-              'busy': self._ThreadBusyness(events, start_msec, end_msec),
-              'parsing': self._Parsing(events, start_msec, end_msec),
+              'busy': self._ThreadBusyness(events, start_msec, end_msec)}
+    result.update(self.ComputeActivity(start_msec, end_msec))
+    return result
+
+  def ComputeActivity(self, start_msec, end_msec):
+    """Returns a breakdown of the main renderer thread activity between two
+    timestamps.
+
+    Args:
+      start_msec: (float)
+      end_msec: (float)
+
+    Returns:
+       {'parsing': {'url' -> time_ms}, 'script': {'url' -> time_ms}}.
+    """
+    assert end_msec - start_msec >= 0.
+    events = self._OverlappingMainRendererThreadEvents(start_msec, end_msec)
+    result = {'parsing': self._Parsing(events, start_msec, end_msec),
               'script': self._ScriptsExecuting(events, start_msec, end_msec)}
     return result
 
diff --git a/tools/android/loading/cloud/backend/report_task_handler.py b/tools/android/loading/cloud/backend/report_task_handler.py
index 0081139..f0f4cf75f 100644
--- a/tools/android/loading/cloud/backend/report_task_handler.py
+++ b/tools/android/loading/cloud/backend/report_task_handler.py
@@ -70,6 +70,15 @@
     self._ad_rules_filename = ad_rules_filename
     self._tracking_rules_filename = tracking_rules_filename
 
+  def _IsBigQueryValueValid(self, value):
+    """Returns whether a value is valid and can be uploaded to BigQuery."""
+    if value is None:
+      return False
+    # BigQuery rejects NaN.
+    if type(value) is float and (math.isnan(value) or math.isinf(value)):
+      return False
+    return True
+
   def _StreamRowsToBigQuery(self, rows, table_id):
     """Uploads a list of rows to the BigQuery table associated with the given
     table_id.
@@ -144,9 +153,10 @@
         continue
       # Filter out bad values.
       for key, value in report.items():
-        if type(value) is float and (math.isnan(value) or math.isinf(value)):
-          self._logger.error('Invalid %s for URL:%s' % (key, report.get('url')))
-          self._failure_database.AddFailure('invalid_bigquery_value', key)
+        if not self._IsBigQueryValueValid(value):
+          url = report.get('url')
+          self._logger.error('Invalid %s for URL:%s' % (key, url))
+          self._failure_database.AddFailure('invalid_bigquery_value', url)
           del report[key]
       rows.append(report)
 
diff --git a/tools/android/loading/cloud/backend/trace_task_handler.py b/tools/android/loading/cloud/backend/trace_task_handler.py
index 1a9cf9a..c127fd9 100644
--- a/tools/android/loading/cloud/backend/trace_task_handler.py
+++ b/tools/android/loading/cloud/backend/trace_task_handler.py
@@ -5,9 +5,12 @@
 import multiprocessing
 import os
 import re
+import resource
 import sys
 import traceback
 
+import psutil
+
 import common.clovis_paths
 from common.clovis_task import ClovisTask
 from common.loading_trace_database import LoadingTraceDatabase
@@ -18,6 +21,18 @@
 import xvfb_helper
 
 
+def LimitMemory(memory_share):
+  """Limits the memory available to this process, to avoid OOM issues.
+
+  Args:
+    memory_share: (float) Share coefficient of the total physical memory that
+                          the process can use.
+  """
+  total_memory = psutil.virtual_memory().total
+  memory_limit = memory_share * total_memory
+  resource.setrlimit(resource.RLIMIT_AS, (memory_limit, -1L))
+
+
 def GenerateTrace(url, emulate_device, emulate_network, filename, log_filename):
   """ Generates a trace.
 
@@ -150,25 +165,35 @@
     See the GenerateTrace() documentation for a description of the parameters
     and return values.
     """
-    self._logger.info('Starting external process for trace generation')
+    self._logger.info('Starting external process for trace generation.')
     failed_metadata = {'succeeded':False, 'url':url}
-    pool = multiprocessing.Pool(1)
+    failed = False
+    pool = multiprocessing.Pool(1, initializer=LimitMemory, initargs=(0.9,))
 
     apply_result = pool.apply_async(
         GenerateTrace,
         (url, emulate_device, emulate_network, filename, log_filename))
-    apply_result.wait(timeout=300)
+    pool.close()
+    apply_result.wait(timeout=180)
 
     if not apply_result.ready():
       self._logger.error('Process timeout for trace generation of URL: ' + url)
       self._failure_database.AddFailure('trace_process_timeout', url)
-      return failed_metadata
+      # Explicitly kill Chrome now, or pool.terminate() will hang.
+      controller.LocalChromeController.KillChromeProcesses()
+      pool.terminate()
+      failed = True
 
     if not apply_result.successful():
       self._logger.error('Process failure for trace generation of URL: ' + url)
       self._failure_database.AddFailure('trace_process_error', url)
-      return failed_metadata
+      failed = True
 
+    self._logger.info('Cleaning up external process.')
+    pool.join()
+
+    if failed:
+      return failed_metadata
     return apply_result.get()
 
   def _HandleTraceGenerationResults(self, local_filename, log_filename,
@@ -204,6 +229,7 @@
       self._logger.debug('Uploading: %s' % remote_trace_location)
       self._google_storage_accessor.UploadFile(local_filename,
                                                remote_trace_location)
+      os.remove(local_filename)  # The trace may be very large.
     else:
       self._logger.warning('No trace found at: ' + local_filename)
 
diff --git a/tools/android/loading/controller.py b/tools/android/loading/controller.py
index 7ea59a0e..3311db2 100644
--- a/tools/android/loading/controller.py
+++ b/tools/android/loading/controller.py
@@ -24,6 +24,8 @@
 import time
 import traceback
 
+import psutil
+
 import chrome_cache
 import common_util
 import device_setup
@@ -420,6 +422,29 @@
     if self._using_temp_profile_dir:
       shutil.rmtree(self._profile_dir)
 
+  @staticmethod
+  def KillChromeProcesses():
+    """Kills all the running instances of Chrome.
+
+    Returns: (int) The number of processes that were killed.
+    """
+    killed_count = 0
+    chrome_path = OPTIONS.LocalBinary('chrome')
+    for process in psutil.process_iter():
+      try:
+        if process.exe() == chrome_path:
+          process.terminate()
+          killed_count += 1
+          try:
+            process.wait(timeout=10)
+          except psutil.TimeoutExpired:
+            process.kill()
+      except psutil.AccessDenied:
+        pass
+      except psutil.NoSuchProcess:
+        pass
+    return killed_count
+
   def SetChromeEnvOverride(self, env):
     """Set the environment for Chrome.
 
@@ -431,6 +456,11 @@
   @contextlib.contextmanager
   def Open(self):
     """Overridden connection creation."""
+    # Kill all existing Chrome instances.
+    killed_count = LocalChromeController.KillChromeProcesses()
+    if killed_count > 0:
+      logging.warning('Killed existing Chrome instance.')
+
     chrome_cmd = [OPTIONS.LocalBinary('chrome')]
     chrome_cmd.extend(self._GetChromeArguments())
     # Force use of simple cache.
@@ -445,7 +475,7 @@
         tempfile.NamedTemporaryFile(prefix="chrome_controller_", suffix='.log')
     chrome_process = None
     try:
-      chrome_env_override = self._chrome_env_override or {}
+      chrome_env_override = self._chrome_env_override.copy() or {}
       if self._wpr_attributes:
         chrome_env_override.update(self._wpr_attributes.chrome_env_override)
 
@@ -490,7 +520,10 @@
         sys.stderr.write(open(tmp_log.name).read())
       del tmp_log
       if chrome_process:
-        chrome_process.kill()
+        try:
+          chrome_process.kill()
+        except OSError:
+          pass  # Chrome is already dead.
 
   def ResetBrowserState(self):
     """Override for chrome state reseting."""
diff --git a/tools/android/loading/report.py b/tools/android/loading/report.py
index 0004d06..5ace49e 100644
--- a/tools/android/loading/report.py
+++ b/tools/android/loading/report.py
@@ -51,8 +51,6 @@
     else:
       self._contentful_byte_frac = float('Nan')
       self._significant_byte_frac = float('Nan')
-    self._ad_report = self._AdRequestsReport(
-        trace, ad_rules or [], tracking_rules or [])
 
     graph = LoadingGraphView.FromTrace(trace)
     self._contentful_inversion = graph.GetInversionsAtTime(
@@ -60,25 +58,19 @@
     self._significant_inversion = graph.GetInversionsAtTime(
         self._significant_paint_msec)
     self._transfer_size = metrics.TotalTransferSize(trace)[1]
-    self._cpu_busyness = self._ComputeCpuBusyness(trace)
 
-  def _ComputeCpuBusyness(self, trace):
     activity = ActivityLens(trace)
-    load_start = self._navigation_start_msec
-    load_end = self._load_end_msec
-    contentful = self._contentful_paint_msec
-    significant = self._significant_paint_msec
+    self._cpu_busyness = self._ComputeCpuBusyness(activity)
 
-    return {
-        'activity_load_frac': (
-            activity.MainRendererThreadBusyness(load_start, load_end)
-            / float(load_end - load_start)),
-        'activity_contentful_paint_frac': (
-            activity.MainRendererThreadBusyness(load_start, contentful)
-            / float(contentful - load_start)),
-        'activity_significant_paint_frac': (
-            activity.MainRendererThreadBusyness(load_start, significant)
-            / float(significant - load_start))}
+    content_lens = ContentClassificationLens(
+        trace, ad_rules or [], tracking_rules or [])
+    has_ad_rules = bool(ad_rules)
+    has_tracking_rules = bool(tracking_rules)
+    self._ad_report = self._AdRequestsReport(
+        trace, content_lens, has_ad_rules, has_tracking_rules)
+    self._ads_cost = self._AdsAndTrackingCpuCost(
+        self._navigation_start_msec, self._load_end_msec, content_lens,
+        activity, has_tracking_rules or has_ad_rules)
 
   def GenerateReport(self):
     """Returns a report as a dict."""
@@ -103,6 +95,7 @@
         'transfer_size': self._transfer_size}
     report.update(self._ad_report)
     report.update(self._cpu_busyness)
+    report.update(self._ads_cost)
     return report
 
   @classmethod
@@ -113,29 +106,28 @@
     return LoadingReport(trace, ad_rules_filename, tracking_rules_filename)
 
   @classmethod
-  def _AdRequestsReport(cls, trace, ad_rules, tracking_rules):
-    has_rules = bool(ad_rules) or bool(tracking_rules)
+  def _AdRequestsReport(
+      cls, trace, content_lens, has_ad_rules, has_tracking_rules):
     requests = trace.request_track.GetEvents()
+    has_rules = has_ad_rules or has_tracking_rules
     result = {
         'request_count': len(requests),
-        'ad_requests': 0 if ad_rules else None,
-        'tracking_requests': 0 if tracking_rules else None,
+        'ad_requests': 0 if has_ad_rules else None,
+        'tracking_requests': 0 if has_tracking_rules else None,
         'ad_or_tracking_requests': 0 if has_rules else None,
         'ad_or_tracking_initiated_requests': 0 if has_rules else None,
         'ad_or_tracking_initiated_transfer_size': 0 if has_rules else None}
-    content_classification_lens = ContentClassificationLens(
-        trace, ad_rules, tracking_rules)
     if not has_rules:
       return result
-    for request in trace.request_track.GetEvents():
-      is_ad = content_classification_lens.IsAdRequest(request)
-      is_tracking = content_classification_lens.IsTrackingRequest(request)
-      if ad_rules:
+    for request in requests:
+      is_ad = content_lens.IsAdRequest(request)
+      is_tracking = content_lens.IsTrackingRequest(request)
+      if has_ad_rules:
         result['ad_requests'] += int(is_ad)
-      if tracking_rules:
+      if has_tracking_rules:
         result['tracking_requests'] += int(is_tracking)
       result['ad_or_tracking_requests'] += int(is_ad or is_tracking)
-    ad_tracking_requests = content_classification_lens.AdAndTrackingRequests()
+    ad_tracking_requests = content_lens.AdAndTrackingRequests()
     result['ad_or_tracking_initiated_requests'] = len(ad_tracking_requests)
     result['ad_or_tracking_initiated_transfer_size'] = metrics.TransferSize(
         ad_tracking_requests)[1]
@@ -154,6 +146,80 @@
     # request.
     return max(r.end_msec or -1 for r in trace.request_track.GetEvents())
 
+  def _ComputeCpuBusyness(self, activity):
+    load_start = self._navigation_start_msec
+    load_end = self._load_end_msec
+    contentful = self._contentful_paint_msec
+    significant = self._significant_paint_msec
+
+    load_time = float(load_end - load_start)
+    contentful_time = float(contentful - load_start)
+    significant_time = float(significant - load_start)
+
+    result = {
+        'activity_load_frac': (
+            activity.MainRendererThreadBusyness(load_start, load_end)
+            / load_time),
+        'activity_contentful_paint_frac': (
+            activity.MainRendererThreadBusyness(load_start, contentful)
+            / contentful_time),
+        'activity_significant_paint_frac': (
+            activity.MainRendererThreadBusyness(load_start, significant)
+            / significant_time)}
+
+    activity_load = activity.ComputeActivity(load_start, load_end)
+    activity_contentful = activity.ComputeActivity(load_start, contentful)
+    activity_significant = activity.ComputeActivity(load_start, significant)
+
+    result['parsing_load_frac'] = (
+        sum(activity_load['parsing'].values()) / load_time)
+    result['script_load_frac'] = (
+        sum(activity_load['script'].values()) / load_time)
+    result['parsing_contentful_frac'] = (
+        sum(activity_contentful['parsing'].values()) / contentful_time)
+    result['script_contentful_frac'] = (
+        sum(activity_contentful['script'].values()) / contentful_time)
+    result['parsing_significant_frac'] = (
+        sum(activity_significant['parsing'].values()) / significant_time)
+    result['script_significant_frac'] = (
+        sum(activity_significant['script'].values()) / significant_time)
+    return result
+
+  @classmethod
+  def _AdsAndTrackingCpuCost(
+      cls, start_msec, end_msec, content_lens, activity, has_rules):
+    """Returns the CPU cost associated with Ads and tracking between timestamps.
+
+    Can return an overestimate, as execution slices are tagged by URL, and not
+    by requests.
+
+    Args:
+      start_msec: (float)
+      end_msec: (float)
+      content_lens: (ContentClassificationLens)
+      activity: (ActivityLens)
+
+    Returns:
+      {'ad_and_tracking_script_frac': float,
+       'ad_and_tracking_parsing_frac': float}
+    """
+    result = {'ad_or_tracking_script_frac': None,
+              'ad_or_tracking_parsing_frac': None}
+    if not has_rules:
+      return result
+
+    duration = float(end_msec - start_msec)
+    requests = content_lens.AdAndTrackingRequests()
+    urls = {r.url for r in requests}
+    cpu_breakdown = activity.ComputeActivity(start_msec, end_msec)
+    result['ad_or_tracking_script_frac'] = sum(
+            value for (url, value) in cpu_breakdown['script'].items()
+            if url in urls) / duration
+    result['ad_or_tracking_parsing_frac'] = sum(
+            value for (url, value) in cpu_breakdown['parsing'].items()
+            if url in urls) / duration
+    return result
+
 
 def _Main(args):
   assert len(args) == 4, 'Usage: report.py trace.json ad_rules tracking_rules'
diff --git a/tools/android/loading/report_unittest.py b/tools/android/loading/report_unittest.py
index 03cdc9a..5338e07 100644
--- a/tools/android/loading/report_unittest.py
+++ b/tools/android/loading/report_unittest.py
@@ -25,6 +25,8 @@
   _SECOND_REQUEST_DATA_LENGTH = 1024
   _TOPLEVEL_EVENT_OFFSET = 10
   _TOPLEVEL_EVENT_DURATION = 100
+  _SCRIPT_EVENT_DURATION = 50
+  _PARSING_EVENT_DURATION = 60
 
   def setUp(self):
     self.trace_creator = test_utils.TraceCreator()
@@ -37,6 +39,10 @@
     self.requests[0].encoded_data_length = self._FIRST_REQUEST_DATA_LENGTH
     self.requests[1].encoded_data_length = self._SECOND_REQUEST_DATA_LENGTH
 
+    self.ad_domain = 'i-ve-got-the-best-ads.com'
+    self.ad_url = 'http://www.' + self.ad_domain + '/i-m-really-rich.js'
+    self.requests[0].url = self.ad_url
+
     self.trace_events = [
         {'args': {'name': 'CrRendererMain'}, 'cat': '__metadata',
          'name': 'thread_name', 'ph': 'M', 'pid': 1, 'tid': 1, 'ts': 0},
@@ -67,7 +73,17 @@
          * self.MILLI_TO_MICRO,
          'pid': 1, 'tid': 1, 'ph': 'X',
          'dur': self._TOPLEVEL_EVENT_DURATION * self.MILLI_TO_MICRO,
-         'cat': 'toplevel', 'name': 'MessageLoop::RunTask'}]
+         'cat': 'toplevel', 'name': 'MessageLoop::RunTask'},
+        {'ts': self._NAVIGATION_START_TIME * self.MILLI_TO_MICRO,
+         'pid': 1, 'tid': 1, 'ph': 'X',
+         'dur': self._PARSING_EVENT_DURATION * self.MILLI_TO_MICRO,
+         'cat': 'devtools.timeline', 'name': 'ParseHTML',
+         'args': {'beginData': {'url': ''}}},
+        {'ts': self._NAVIGATION_START_TIME * self.MILLI_TO_MICRO,
+         'pid': 1, 'tid': 1, 'ph': 'X',
+         'dur': self._SCRIPT_EVENT_DURATION * self.MILLI_TO_MICRO,
+         'cat': 'devtools.timeline', 'name': 'EvaluateScript',
+         'args': {'data': {'scriptName': ''}}}]
 
   def _MakeTrace(self):
     trace = self.trace_creator.CreateTrace(
@@ -94,6 +110,8 @@
     self.assertIsNone(loading_report['ad_or_tracking_requests'])
     self.assertIsNone(loading_report['ad_or_tracking_initiated_requests'])
     self.assertIsNone(loading_report['ad_or_tracking_initiated_transfer_size'])
+    self.assertIsNone(loading_report['ad_or_tracking_script_frac'])
+    self.assertIsNone(loading_report['ad_or_tracking_parsing_frac'])
     self.assertEqual(
         self._FIRST_REQUEST_DATA_LENGTH + self._SECOND_REQUEST_DATA_LENGTH
         + metrics.HTTP_OK_LENGTH * 2,
@@ -126,11 +144,9 @@
                            loading_report['plt_ms'])
 
   def testAdTrackingRules(self):
-    ad_domain = 'i-ve-got-the-best-ads.com'
-    self.requests[0].url = 'http://www.' + ad_domain
     trace = self._MakeTrace()
     loading_report = report.LoadingReport(
-        trace, [ad_domain], []).GenerateReport()
+        trace, [self.ad_domain], []).GenerateReport()
     self.assertEqual(1, loading_report['ad_requests'])
     self.assertEqual(1, loading_report['ad_or_tracking_requests'])
     self.assertEqual(1, loading_report['ad_or_tracking_initiated_requests'])
@@ -152,6 +168,41 @@
         / (self._LOAD_END_TIME - self._NAVIGATION_START_TIME),
         loading_report['activity_load_frac'])
 
+  def testActivityBreakdown(self):
+    loading_report = report.LoadingReport(self._MakeTrace()).GenerateReport()
+    load_time = float(self._LOAD_END_TIME - self._NAVIGATION_START_TIME)
+    contentful_time = float(
+        self._CONTENTFUL_PAINT - self._NAVIGATION_START_TIME)
+
+    self.assertAlmostEqual(self._SCRIPT_EVENT_DURATION / load_time,
+                           loading_report['script_load_frac'])
+    self.assertAlmostEqual(
+        (self._PARSING_EVENT_DURATION - self._SCRIPT_EVENT_DURATION)
+        / load_time,
+        loading_report['parsing_load_frac'])
+
+    self.assertAlmostEqual(1., loading_report['script_significant_frac'])
+    self.assertAlmostEqual(0., loading_report['parsing_significant_frac'])
+
+    self.assertAlmostEqual(self._SCRIPT_EVENT_DURATION / contentful_time,
+                           loading_report['script_contentful_frac'])
+    self.assertAlmostEqual(
+        (self._PARSING_EVENT_DURATION - self._SCRIPT_EVENT_DURATION)
+        / contentful_time, loading_report['parsing_contentful_frac'])
+
+  def testAdsAndTrackingCost(self):
+    load_time = float(self._LOAD_END_TIME - self._NAVIGATION_START_TIME)
+    self.trace_events.append(
+       {'ts':  load_time / 3. * self.MILLI_TO_MICRO,
+        'pid': 1, 'tid': 1, 'ph': 'X',
+        'dur': load_time / 2. * self.MILLI_TO_MICRO,
+        'cat': 'devtools.timeline', 'name': 'EvaluateScript',
+        'args': {'data': {'scriptName': self.ad_url}}})
+    loading_report = report.LoadingReport(
+        self._MakeTrace(), [self.ad_domain]).GenerateReport()
+    self.assertAlmostEqual(.5, loading_report['ad_or_tracking_script_frac'])
+    self.assertAlmostEqual(0., loading_report['ad_or_tracking_parsing_frac'])
+
 
 if __name__ == '__main__':
   unittest.main()
diff --git a/tools/android/loading/sandwich_task_builder.py b/tools/android/loading/sandwich_task_builder.py
index 26dba8c..61a48284 100644
--- a/tools/android/loading/sandwich_task_builder.py
+++ b/tools/android/loading/sandwich_task_builder.py
@@ -3,6 +3,7 @@
 # found in the LICENSE file.
 
 import csv
+import logging
 import json
 import os
 import shutil
@@ -95,7 +96,7 @@
 
     self._patched_wpr_task = None
     self._reference_cache_task = None
-    self._subresources_for_urls_run_task = None
+    self._trace_from_grabbing_reference_cache = None
     self._subresources_for_urls_task = None
     self._PopulateCommonPipelines()
 
@@ -112,8 +113,7 @@
           depends on: common/webpages-patched.wpr
             depends on: common/webpages.wpr
       depends on: common/urls-resources.json
-        depends on: common/urls-resources-run/
-          depends on: common/webpages.wpr
+        depends on: common/original-cache.zip
     """
     @self.RegisterTask('common/webpages-patched.wpr',
                        dependencies=[self._common_builder.original_wpr_task])
@@ -140,31 +140,28 @@
       sandwich_misc.PatchCacheArchive(BuildOriginalCache.path,
           original_cache_trace_path, BuildPatchedCache.path)
 
-    @self.RegisterTask('common/subresources-for-urls-run/',
-                       dependencies=[self._common_builder.original_wpr_task])
-    def UrlsResourcesRun():
-      runner = self._common_builder.CreateSandwichRunner()
-      runner.wpr_archive_path = self._common_builder.original_wpr_task.path
-      runner.cache_operation = sandwich_runner.CacheOperation.CLEAR
-      runner.output_dir = UrlsResourcesRun.path
-      runner.Run()
-
-    @self.RegisterTask('common/subresources-for-urls.json', [UrlsResourcesRun])
+    @self.RegisterTask('common/subresources-for-urls.json',
+                       [BuildOriginalCache])
     def ListUrlsResources():
       url_resources = sandwich_misc.ReadSubresourceFromRunnerOutputDir(
-          UrlsResourcesRun.path)
+          BuildOriginalCache.run_path)
       with open(ListUrlsResources.path, 'w') as output:
         json.dump(url_resources, output)
 
     @self.RegisterTask('common/patched-cache-validation.log',
                        [BuildPatchedCache])
     def ValidatePatchedCache():
-      sandwich_misc.ValidateCacheArchiveContent(
-          original_cache_trace_path, BuildPatchedCache.path)
+      handler = logging.FileHandler(ValidatePatchedCache.path)
+      logging.getLogger().addHandler(handler)
+      try:
+        sandwich_misc.ValidateCacheArchiveContent(
+            original_cache_trace_path, BuildPatchedCache.path)
+      finally:
+        logging.getLogger().removeHandler(handler)
 
     self._patched_wpr_task = BuildPatchedWpr
+    self._trace_from_grabbing_reference_cache = original_cache_trace_path
     self._reference_cache_task = BuildPatchedCache
-    self._subresources_for_urls_run_task = UrlsResourcesRun
     self._subresources_for_urls_task = ListUrlsResources
 
     self._common_builder.default_final_tasks.append(ValidatePatchedCache)
@@ -197,10 +194,8 @@
     @self.RegisterTask(shared_task_prefix + '-setup.json', merge=True,
                        dependencies=[self._subresources_for_urls_task])
     def SetupBenchmark():
-      trace_path = os.path.join(self._subresources_for_urls_run_task.path, '0',
-                                sandwich_runner.TRACE_FILENAME)
       whitelisted_urls = sandwich_misc.ExtractDiscoverableUrls(
-          trace_path, subresource_discoverer)
+          self._trace_from_grabbing_reference_cache, subresource_discoverer)
 
       url_resources = json.load(open(self._subresources_for_urls_task.path))
       common_util.EnsureParentDirectoryExists(SetupBenchmark.path)
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 58e7a6dc..8ee35d7 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -11946,6 +11946,24 @@
   </summary>
 </histogram>
 
+<histogram name="Event.Latency.BlockingTime.TouchMoveDefaultAllowed"
+    units="microseconds">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    Time between the renderer main thread receiving a touchmove event and acking
+    it, for events which were not preventDefaulted.
+  </summary>
+</histogram>
+
+<histogram name="Event.Latency.BlockingTime.TouchMoveDefaultPrevented"
+    units="microseconds">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    Time between the renderer main thread receiving a touchmove event and acking
+    it, for events which were preventDefaulted.
+  </summary>
+</histogram>
+
 <histogram name="Event.Latency.Browser" units="microseconds">
   <owner>rbyers@chromium.org</owner>
   <summary>
@@ -12277,6 +12295,26 @@
   </summary>
 </histogram>
 
+<histogram name="Event.Latency.QueueingTime.TouchMoveDefaultAllowed"
+    units="microseconds">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    Time between sending a touchmove event to the renderer main thread and when
+    the renderer begins to process that event, for events which were not
+    preventDefaulted.
+  </summary>
+</histogram>
+
+<histogram name="Event.Latency.QueueingTime.TouchMoveDefaultPrevented"
+    units="microseconds">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    Time between sending a touchmove event to the renderer main thread and when
+    the renderer begins to process that event, for events which were
+    preventDefaulted.
+  </summary>
+</histogram>
+
 <histogram name="Event.Latency.Renderer" units="microseconds">
   <owner>rbyers@chromium.org</owner>
   <summary>
@@ -17836,6 +17874,15 @@
   <summary>Net error results from restartable cache read errors.</summary>
 </histogram>
 
+<histogram name="HttpCache.StaleEntry.FreshnessPeriodsSinceLastUsed">
+  <owner>jkarlin@chromium.org</owner>
+  <summary>
+    For each http cache transaction for which a cache entry exists but it cannot
+    be used because the entry's age is beyond its freshness: counts how many
+    freshness periods have elapsed since the entry was last used (x1000).
+  </summary>
+</histogram>
+
 <histogram name="HttpCache.ValidationCause" enum="HttpCacheValidationCause">
   <owner>jkarlin@chromium.org</owner>
   <summary>For each validation attempt, the cause for the validation.</summary>
diff --git a/tools/perf/benchmarks/memory_infra.py b/tools/perf/benchmarks/memory_infra.py
index a09e8ac..22ee079 100644
--- a/tools/perf/benchmarks/memory_infra.py
+++ b/tools/perf/benchmarks/memory_infra.py
@@ -59,16 +59,21 @@
     return tbm_options
 
 
-# TODO(crbug.com/606361): Remove benchmark when replaced by the TBMv2 version.
-@benchmark.Disabled('all')
-class MemoryHealthPlan(_MemoryInfra):
-  """Timeline based benchmark for the Memory Health Plan."""
-  page_set = page_sets.MemoryHealthStory
+# TODO(bashi): Workaround for http://crbug.com/532075.
+# @benchmark.Enabled('android') shouldn't be needed.
+@benchmark.Enabled('android')
+class MemoryBenchmarkTop10Mobile(_MemoryInfra):
+  """Measure foreground/background memory on top 10 mobile page set.
+
+  This metric provides memory measurements for the System Health Plan of
+  Chrome on Android.
+  """
+  page_set = page_sets.MemoryTop10Mobile
   options = {'pageset_repeat': 5}
 
   @classmethod
   def Name(cls):
-    return 'memory.memory_health_plan'
+    return 'memory.top_10_mobile'
 
   @classmethod
   def ShouldDisable(cls, possible_browser):
@@ -77,9 +82,11 @@
         'com.google.android.deskclock')
 
 
+# TODO(bashi): Workaround for http://crbug.com/532075.
+# @benchmark.Enabled('android') shouldn't be needed.
 @benchmark.Enabled('android')
-class TBMv2MemoryBenchmarkTop10Mobile(MemoryHealthPlan):
-  """Timeline based benchmark for the Memory Health Plan based on TBMv2.
+class TBMv2MemoryBenchmarkTop10Mobile(MemoryBenchmarkTop10Mobile):
+  """Measure foreground/background memory on top 10 mobile page set (TBMv2).
 
   This is a temporary benchmark to compare the new TBMv2 memory metric
   (memory_metric.html) with the existing TBMv1 one (memory_timeline.py). Once
diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py
index ba1e31f..1539dd6 100644
--- a/tools/perf/benchmarks/smoothness.py
+++ b/tools/perf/benchmarks/smoothness.py
@@ -514,21 +514,6 @@
     return 'smoothness.scrolling_tough_ad_cases'
 
 
-@benchmark.Disabled('android-reference')  # crbug.com/588786
-@benchmark.Disabled('mac', 'win')  # crbug.com/522619 (mac/win)
-class SmoothnessBidirectionallyScrollingToughAdCases(_Smoothness):
-  """Measures rendering statistics while scrolling advertisements."""
-  page_set = page_sets.BidirectionallyScrollingToughAdCasesPageSet
-
-  def SetExtraBrowserOptions(self, options):
-    # Don't accidentally reload the page while scrolling.
-    options.AppendExtraBrowserArgs('--disable-pull-to-refresh-effect')
-
-  @classmethod
-  def Name(cls):
-    return 'smoothness.bidirectionally_scrolling_tough_ad_cases'
-
-
 class SmoothnessToughWebGLAdCases(_Smoothness):
   """Measures rendering statistics while scrolling advertisements."""
   page_set = page_sets.SyntheticToughWebglAdCasesPageSet
diff --git a/tools/perf/measurements/page_cycler.py b/tools/perf/measurements/page_cycler.py
index ff2bfbd..c224557 100644
--- a/tools/perf/measurements/page_cycler.py
+++ b/tools/perf/measurements/page_cycler.py
@@ -119,6 +119,12 @@
                     'are the times when the page is loaded cold, i.e. without '
                     'loading it before, and warm times are times when the '
                     'page is loaded after being loaded previously.'))
+    results.AddValue(scalar.ScalarValue(
+        results.current_page, '%stimes.time_to_onload' % chart_name_prefix,
+        'ms', tab.EvaluateJavaScript('performance.timing.loadEventStart'
+                                     '- performance.timing.navigationStart'),
+        description='Time to onload. This is temporary metric to check that '
+                    'PCv1 and PCv2 emit similar results'))
 
     self._has_loaded_page[page.url] += 1
 
diff --git a/tools/perf/measurements/page_cycler_unittest.py b/tools/perf/measurements/page_cycler_unittest.py
index bbd27b66..5fa0dee 100644
--- a/tools/perf/measurements/page_cycler_unittest.py
+++ b/tools/perf/measurements/page_cycler_unittest.py
@@ -256,7 +256,7 @@
 
         # On Mac, there is an additional measurement: the number of keychain
         # accesses.
-        value_count = 3
+        value_count = 4
         if sys.platform == 'darwin':
           value_count += 1
         self.assertEqual(value_count, len(values))
@@ -265,9 +265,11 @@
         chart_name = 'cold_times' if i == 0 else 'warm_times'
         self.assertEqual(values[0].name, '%s.page_load_time' % chart_name)
         self.assertEqual(values[0].units, 'ms')
+        self.assertEqual(values[1].name, '%s.time_to_onload' % chart_name)
+        self.assertEqual(values[1].units, 'ms')
 
         expected_values = ['gpu', 'browser']
-        for value, expected in zip(values[1:len(expected_values) + 1],
+        for value, expected in zip(values[2:len(expected_values) + 1],
                                    expected_values):
           self.assertEqual(value.page, page)
           self.assertEqual(value.name,
diff --git a/tools/perf/page_sets/data/memory_health_plan.json b/tools/perf/page_sets/data/memory_health_plan.json
deleted file mode 100644
index 6538b28..0000000
--- a/tools/perf/page_sets/data/memory_health_plan.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-    "description": "Describes the Web Page Replay archives for a user story set. Don't edit by hand! Use record_wpr for updating.", 
-    "archives": {
-        "memory_health_plan_000.wpr": [
-            "http://yahoo.co.jp", 
-            "http://bing.com", 
-            "http://amazon.com", 
-            "http://cnn.com", 
-            "http://ebay.com", 
-            "http://yandex.ru", 
-            "http://google.com", 
-            "http://vimeo.com", 
-            "http://yahoo.com", 
-            "http://baidu.com"
-        ]
-    }
-}
\ No newline at end of file
diff --git a/tools/perf/page_sets/data/memory_health_plan_000.wpr.sha1 b/tools/perf/page_sets/data/memory_health_plan_000.wpr.sha1
deleted file mode 100644
index 57b2e9a..0000000
--- a/tools/perf/page_sets/data/memory_health_plan_000.wpr.sha1
+++ /dev/null
@@ -1 +0,0 @@
-256ffb3af778a9cf8774f766d07170376e655d62
\ No newline at end of file
diff --git a/tools/perf/page_sets/data/memory_top_10_mobile.json b/tools/perf/page_sets/data/memory_top_10_mobile.json
new file mode 100644
index 0000000..c300ea3
--- /dev/null
+++ b/tools/perf/page_sets/data/memory_top_10_mobile.json
@@ -0,0 +1,27 @@
+{
+    "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.", 
+    "archives": {
+        "memory_top_10_mobile_000.wpr": [
+            "after_http_en_m_wikipedia_org_wiki_Science", 
+            "after_https_mobile_twitter_com_justinbieber_skip_interstitial_true", 
+            "after_http_yandex_ru_touchsearch_text_science", 
+            "https_www_google_com_hl_en_q_science", 
+            "http_search_yahoo_com_search__ylt_p_google", 
+            "after_http_m_youtube_com_results_q_science", 
+            "https_mobile_twitter_com_justinbieber_skip_interstitial_true", 
+            "https_m_facebook_com_rihanna", 
+            "after_http_www_amazon_com_gp_aw_s_k_nexus", 
+            "after_http_search_yahoo_com_search__ylt_p_google", 
+            "after_https_www_google_com_hl_en_q_science", 
+            "http_en_m_wikipedia_org_wiki_Science", 
+            "http_www_baidu_com_s_word_google", 
+            "after_http_www_baidu_com_s_word_google", 
+            "after_https_m_facebook_com_rihanna", 
+            "http_www_amazon_com_gp_aw_s_k_nexus", 
+            "after_http_m_taobao_com_channel_act_mobile_20131111_women_html", 
+            "http_yandex_ru_touchsearch_text_science", 
+            "http_m_youtube_com_results_q_science", 
+            "http_m_taobao_com_channel_act_mobile_20131111_women_html"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/tools/perf/page_sets/data/memory_top_10_mobile_000.wpr.sha1 b/tools/perf/page_sets/data/memory_top_10_mobile_000.wpr.sha1
new file mode 100644
index 0000000..4896a53
--- /dev/null
+++ b/tools/perf/page_sets/data/memory_top_10_mobile_000.wpr.sha1
@@ -0,0 +1 @@
+a5969278ce59e9a68c0384adf8dd239cbf71fb23
\ No newline at end of file
diff --git a/tools/perf/page_sets/memory_health_story.py b/tools/perf/page_sets/memory_top_10_mobile.py
similarity index 76%
rename from tools/perf/page_sets/memory_health_story.py
rename to tools/perf/page_sets/memory_top_10_mobile.py
index 0bd5236..5f91d70 100644
--- a/tools/perf/page_sets/memory_health_story.py
+++ b/tools/perf/page_sets/memory_top_10_mobile.py
@@ -12,46 +12,39 @@
 from devil.android.sdk import intent # pylint: disable=import-error
 from devil.android.sdk import keyevent # pylint: disable=import-error
 
+from page_sets import top_10_mobile
+
 
 DUMP_WAIT_TIME = 3
 
-URL_LIST = [
-    'http://google.com',
-    'http://vimeo.com',
-    'http://yahoo.com',
-    'http://baidu.com',
-    'http://cnn.com',
-    'http://yandex.ru',
-    'http://yahoo.co.jp',
-    'http://amazon.com',
-    'http://ebay.com',
-    'http://bing.com',
-]
 
-
-class MemoryHealthPage(page_module.Page):
-  """Abstract page class for measuring memory."""
+class MemoryMeasurementPage(page_module.Page):
+  """Abstract class for measuring memory on a story unit."""
 
   _PHASE = NotImplemented
 
   def __init__(self, story_set, name, url):
-    super(MemoryHealthPage, self).__init__(
+    super(MemoryMeasurementPage, self).__init__(
         page_set=story_set, name=name, url=url,
         shared_page_state_class=shared_page_state.SharedMobilePageState,
         grouping_keys={'phase': self._PHASE})
 
   def _TakeMemoryMeasurement(self, action_runner):
+    platform = action_runner.tab.browser.platform
     action_runner.Wait(1)  # See crbug.com/540022#c17.
+    if not platform.tracing_controller.is_tracing_running:
+      logging.warning('Tracing is off. No memory dumps are being recorded.')
+      return  # Tracing is not running, e.g., when recording a WPR archive.
     with action_runner.CreateInteraction(self._PHASE):
       action_runner.Wait(DUMP_WAIT_TIME)
       action_runner.ForceGarbageCollection()
-      action_runner.tab.browser.platform.FlushEntireSystemCache()
+      platform.FlushEntireSystemCache()
       action_runner.Wait(DUMP_WAIT_TIME)
       if not action_runner.tab.browser.DumpMemory():
         logging.error('Unable to get a memory dump for %s.', self.name)
 
 
-class ForegroundPage(MemoryHealthPage):
+class ForegroundPage(MemoryMeasurementPage):
   """Take a measurement after loading a regular webpage."""
 
   _PHASE = 'foreground'
@@ -64,7 +57,7 @@
     self._TakeMemoryMeasurement(action_runner)
 
 
-class BackgroundPage(MemoryHealthPage):
+class BackgroundPage(MemoryMeasurementPage):
   """Take a measurement while Chrome is in the background."""
 
   _PHASE = 'background'
@@ -89,15 +82,15 @@
     android_platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_BACK)
 
 
-class MemoryHealthStory(story.StorySet):
-  """User story for the Memory Health Plan."""
+class MemoryTop10Mobile(story.StorySet):
+  """User story to measure foreground/background memory in top 10 mobile."""
 
   def __init__(self):
-    super(MemoryHealthStory, self).__init__(
-        archive_data_file='data/memory_health_plan.json',
+    super(MemoryTop10Mobile, self).__init__(
+        archive_data_file='data/memory_top_10_mobile.json',
         cloud_storage_bucket=story.PARTNER_BUCKET)
 
-    for url in URL_LIST:
+    for url in top_10_mobile.URL_LIST:
       # We name pages so their foreground/background counterparts are easy
       # to identify. For example 'http://google.com' becomes
       # 'http_google_com' and 'after_http_google_com' respectively.
diff --git a/tools/perf/page_sets/tough_ad_cases.py b/tools/perf/page_sets/tough_ad_cases.py
index 2d73f3ca..f076f6a 100644
--- a/tools/perf/page_sets/tough_ad_cases.py
+++ b/tools/perf/page_sets/tough_ad_cases.py
@@ -36,7 +36,7 @@
 class AdPage(page_module.Page):
 
   def __init__(self, url, page_set, make_javascript_deterministic=True,
-               y_scroll_distance_multiplier=0.5, bidirectional_scroll=False,
+               y_scroll_distance_multiplier=0.5,
                scroll=False,
                wait_for_interactive_or_better=False):
     super(AdPage, self).__init__(
@@ -48,7 +48,6 @@
                 RepeatableSynthesizeScrollGestureSharedState))
     self._y_scroll_distance_multiplier = y_scroll_distance_multiplier
     self._scroll = scroll
-    self._bidirectional_scroll = bidirectional_scroll
     self._wait_for_interactive_or_better = wait_for_interactive_or_better
 
   def RunNavigateSteps(self, action_runner):
@@ -82,13 +81,6 @@
     if not self._scroll:
       with action_runner.CreateInteraction('ToughAd'):
         action_runner.Wait(30)
-    elif self._bidirectional_scroll:
-      action_runner.RepeatableBrowserDrivenScroll(
-          y_scroll_distance_ratio=self._y_scroll_distance_multiplier,
-          repeat_count=4)
-      action_runner.RepeatableBrowserDrivenScroll(
-          y_scroll_distance_ratio=-self._y_scroll_distance_multiplier * .5,
-          repeat_count=4)
     else:
       action_runner.RepeatableBrowserDrivenScroll(
           y_scroll_distance_ratio=self._y_scroll_distance_multiplier,
@@ -97,14 +89,13 @@
 
 class ForbesAdPage(AdPage):
 
-  def __init__(self, url, page_set, scroll=False, bidirectional_scroll=False):
+  def __init__(self, url, page_set, scroll=False):
     # forbes.com uses a strange dynamic transform on the body element,
     # which occasionally causes us to try scrolling from outside the
     # screen. Start at the very top of the viewport to avoid this.
     super(ForbesAdPage, self).__init__(
         url=url, page_set=page_set, make_javascript_deterministic=False,
         scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll,
         wait_for_interactive_or_better=True)
 
   def RunNavigateSteps(self, action_runner):
@@ -177,50 +168,40 @@
 class ToughAdCasesPageSet(story.StorySet):
   """Pages for measuring performance with advertising content."""
 
-  def __init__(self, scroll=False, bidirectional_scroll=False):
+  def __init__(self, scroll=False):
     super(ToughAdCasesPageSet, self).__init__(
         archive_data_file='data/tough_ad_cases.json',
         cloud_storage_bucket=story.INTERNAL_BUCKET)
 
     self.AddStory(AdPage('file://tough_ad_cases/'
         'swiffy_collection.html', self, make_javascript_deterministic=False,
-        y_scroll_distance_multiplier=0.25, scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll))
+        y_scroll_distance_multiplier=0.25, scroll=scroll))
     self.AddStory(AdPage('file://tough_ad_cases/'
         'swiffy_webgl_collection.html',
-        self, make_javascript_deterministic=False, scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll))
-    self.AddStory(AdPage('http://www.latimes.com', self,
-        bidirectional_scroll=bidirectional_scroll, scroll=scroll,
+        self, make_javascript_deterministic=False, scroll=scroll))
+    self.AddStory(AdPage('http://www.latimes.com', self, scroll=scroll,
         wait_for_interactive_or_better=True))
     self.AddStory(ForbesAdPage('http://www.forbes.com/sites/parmyolson/'
         '2015/07/29/jana-mobile-data-facebook-internet-org/',
-        self, scroll=scroll, bidirectional_scroll=bidirectional_scroll))
+        self, scroll=scroll))
     self.AddStory(AdPage('http://androidcentral.com', self, scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll,
         wait_for_interactive_or_better=True))
     self.AddStory(AdPage('http://mashable.com', self, scroll=scroll,
-        y_scroll_distance_multiplier=0.25,
-        bidirectional_scroll=bidirectional_scroll))
+        y_scroll_distance_multiplier=0.25))
     self.AddStory(AdPage('http://www.androidauthority.com/'
         'reduce-data-use-turn-on-data-compression-in-chrome-630064/', self,
-        scroll=scroll, bidirectional_scroll=bidirectional_scroll))
+        scroll=scroll))
     self.AddStory(AdPage(('http://www.cnn.com/2015/01/09/politics/'
                           'nebraska-keystone-pipeline/index.html'),
-                         self, scroll=scroll,
-                         bidirectional_scroll=bidirectional_scroll))
+                         self, scroll=scroll))
     # Disabled: crbug.com/520509
     #self.AddStory(AdPage('http://time.com/3977891/'
-    #    'donald-trump-debate-republican/', self, scroll=scroll,
-    #    bidirectional_scroll=bidirectional_scroll))
-    self.AddStory(AdPage('http://www.theguardian.com/uk', self, scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll))
+    #    'donald-trump-debate-republican/', self, scroll=scroll))
+    self.AddStory(AdPage('http://www.theguardian.com/uk', self, scroll=scroll))
     # Disabled: http://crbug.com/597656
     # self.AddStory(AdPage('http://m.tmz.com', self, scroll=scroll,
-    #     y_scroll_distance_multiplier=0.25,
-    #     bidirectional_scroll=bidirectional_scroll))
+    #     y_scroll_distance_multiplier=0.25))
     self.AddStory(AdPage('http://androidpolice.com', self, scroll=scroll,
-        bidirectional_scroll=bidirectional_scroll,
         wait_for_interactive_or_better=True))
 
 
@@ -230,11 +211,3 @@
   def __init__(self):
     super(ScrollingToughAdCasesPageSet, self).__init__(
         scroll=True)
-
-
-class BidirectionallyScrollingToughAdCasesPageSet(ToughAdCasesPageSet):
-  """Same as ScrollingToughAdCasesPageSet except we scroll in two directions."""
-
-  def __init__(self):
-    super(BidirectionallyScrollingToughAdCasesPageSet, self).__init__(
-        bidirectional_scroll=True)
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index 9dfe573d..4d63a479 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -699,23 +699,21 @@
   // check as the code may simply want to find the placeholders rather than
   // actually replacing them.
   if (!offsets) {
-    std::string utf8_string = base::UTF16ToUTF8(format_string);
-
     // $9 is the highest allowed placeholder.
     for (size_t i = 0; i < 9; ++i) {
       bool placeholder_should_exist = replacements.size() > i;
 
-      std::string placeholder =
-          base::StringPrintf("$%d", static_cast<int>(i + 1));
-      size_t pos = utf8_string.find(placeholder.c_str());
+      base::string16 placeholder = base::ASCIIToUTF16("$");
+      placeholder += (L'1' + i);
+      size_t pos = format_string.find(placeholder);
       if (placeholder_should_exist) {
-        DCHECK_NE(std::string::npos, pos) <<
-            " Didn't find a " << placeholder << " placeholder in " <<
-            utf8_string;
+        DCHECK_NE(std::string::npos, pos) << " Didn't find a " << placeholder
+                                          << " placeholder in "
+                                          << format_string;
       } else {
-        DCHECK_EQ(std::string::npos, pos) <<
-            " Unexpectedly found a " << placeholder << " placeholder in " <<
-            utf8_string;
+        DCHECK_EQ(std::string::npos, pos) << " Unexpectedly found a "
+                                          << placeholder << " placeholder in "
+                                          << format_string;
       }
     }
   }
@@ -865,10 +863,11 @@
                                  std::vector<std::string>* locale_codes) {
   for (size_t i = 0; i < arraysize(kAcceptLanguageList); ++i) {
     if (!l10n_util::IsLocaleNameTranslated(kAcceptLanguageList[i],
-                                           display_locale))
-      // TODO(jungshik) : Put them at the of the list with language codes
+                                           display_locale)) {
+      // TODO(jungshik) : Put them at the end of the list with language codes
       // enclosed by brackets instead of skipping.
-        continue;
+      continue;
+    }
     locale_codes->push_back(kAcceptLanguageList[i]);
   }
 }
diff --git a/ui/message_center/message_center_style.cc b/ui/message_center/message_center_style.cc
index 3c98bd4..a4425f5 100644
--- a/ui/message_center/message_center_style.cc
+++ b/ui/message_center/message_center_style.cc
@@ -8,24 +8,8 @@
 
 namespace message_center {
 
-// Exported values /////////////////////////////////////////////////////////////
-
-// Colors.
-const SkColor kMessageCenterBorderColor = SkColorSetRGB(0xC7, 0xCA, 0xCE);
-const SkColor kMessageCenterShadowColor = SkColorSetARGB(0.5 * 255, 0, 0, 0);
-
 // Within a notification ///////////////////////////////////////////////////////
 
-// Colors.
-const SkColor kNotificationBackgroundColor = SkColorSetRGB(255, 255, 255);
-const SkColor kIconBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5);
-const SkColor kImageBackgroundColor = SkColorSetRGB(0x22, 0x22, 0x22);
-const SkColor kRegularTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
-const SkColor kDimTextColor = SkColorSetRGB(0x7f, 0x7f, 0x7f);
-const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
-const SkColor kSmallImageMaskForegroundColor = SK_ColorWHITE;
-const SkColor kSmallImageMaskBackgroundColor = SkColorSetRGB(0xa3, 0xa3, 0xa3);
-
 // Limits.
 
 gfx::Size GetImageSizeForContainerSize(const gfx::Size& container_size,
@@ -49,22 +33,4 @@
   return scaled_size;
 }
 
-const size_t kNotificationMaximumItems = 5;
-
-// Timing.
-const int kAutocloseDefaultDelaySeconds = 8;
-const int kAutocloseHighPriorityDelaySeconds = 25;
-// Web notifications use a larger timeout for now, which improves re-engagement.
-// TODO(johnme): Use Finch to experiment with different values, then consider
-// replacing kAutocloseDefaultDelaySeconds with this (https://crbug.com/530697).
-const int kAutocloseWebPageDelaySeconds = 20;
-
-// Colors.
-const SkColor kBackgroundLightColor = SkColorSetRGB(0xf1, 0xf1, 0xf1);
-const SkColor kBackgroundDarkColor = SkColorSetRGB(0xe7, 0xe7, 0xe7);
-const SkColor kShadowColor = SkColorSetARGB(0.3 * 255, 0, 0, 0);
-const SkColor kMessageCenterBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee);
-const SkColor kFooterDelimiterColor = SkColorSetRGB(0xcc, 0xcc, 0xcc);
-const SkColor kFooterTextColor = SkColorSetRGB(0x7b, 0x7b, 0x7b);
-
 }  // namespace message_center
diff --git a/ui/message_center/message_center_style.h b/ui/message_center/message_center_style.h
index 6a04938c..ab2965d 100644
--- a/ui/message_center/message_center_style.h
+++ b/ui/message_center/message_center_style.h
@@ -35,8 +35,8 @@
 const int kMinScrollViewHeight = 100;
 
 // Colors.
-MESSAGE_CENTER_EXPORT extern const SkColor kMessageCenterBorderColor;
-MESSAGE_CENTER_EXPORT extern const SkColor kMessageCenterShadowColor;
+const SkColor kMessageCenterBorderColor = SkColorSetRGB(0xC7, 0xCA, 0xCE);
+const SkColor kMessageCenterShadowColor = SkColorSetARGB(0.5 * 255, 0, 0, 0);
 
 // Settings dialog constants.
 namespace settings {
@@ -77,18 +77,21 @@
 const int kMessageLineHeight = 18;         // In DIPs.
 
 // Colors.
-extern const SkColor kNotificationBackgroundColor; // Background of the card.
+// Background of the card.
+const SkColor kNotificationBackgroundColor = SkColorSetRGB(255, 255, 255);
 // Background of the image.
-MESSAGE_CENTER_EXPORT extern const SkColor kImageBackgroundColor;
-extern const SkColor kIconBackgroundColor;         // Used behind icons smaller
-                                                   // than the icon view.
-extern const SkColor kRegularTextColor;            // Title, message, ...
-extern const SkColor kDimTextColor;
-extern const SkColor kFocusBorderColor;  // The focus border.
-MESSAGE_CENTER_EXPORT extern const SkColor
-    kSmallImageMaskForegroundColor;  // Foreground of small icon image.
-MESSAGE_CENTER_EXPORT extern const SkColor
-    kSmallImageMaskBackgroundColor;  // Background of small icon image.
+const SkColor kImageBackgroundColor = SkColorSetRGB(0x22, 0x22, 0x22);
+// Used behind icons smaller than the icon view.
+const SkColor kIconBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5);
+// Title, message, ...
+const SkColor kRegularTextColor = SkColorSetRGB(0x33, 0x33, 0x33);
+const SkColor kDimTextColor = SkColorSetRGB(0x7f, 0x7f, 0x7f);
+// The focus border.
+const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
+// Foreground of small icon image.
+const SkColor kSmallImageMaskForegroundColor = SK_ColorWHITE;
+// Background of small icon image.
+const SkColor kSmallImageMaskBackgroundColor = SkColorSetRGB(0xa3, 0xa3, 0xa);
 
 // Limits.
 
@@ -98,14 +101,15 @@
     const gfx::Size& container_size,
     const gfx::Size& image_size);
 
-extern const int kNotificationMaximumImageHeight;  // For image notifications.
-MESSAGE_CENTER_EXPORT extern const size_t
-    kNotificationMaximumItems;     // For list notifications.
+const size_t kNotificationMaximumItems = 5;     // For list notifications.
 
 // Timing.
-extern const int kAutocloseDefaultDelaySeconds;
-extern const int kAutocloseHighPriorityDelaySeconds;
-extern const int kAutocloseWebPageDelaySeconds;
+const int kAutocloseDefaultDelaySeconds = 8;
+const int kAutocloseHighPriorityDelaySeconds = 25;
+// Web notifications use a larger timeout for now, which improves re-engagement.
+// TODO(johnme): Use Finch to experiment with different values, then consider
+// replacing kAutocloseDefaultDelaySeconds with this (https://crbug.com/530697)
+const int kAutocloseWebPageDelaySeconds = 20;
 
 // Buttons.
 const int kButtonHeight = 38;              // In DIPs.
@@ -138,14 +142,19 @@
                                      // notifications.
 
 // Colors.
-extern const SkColor kBackgroundLightColor;  // Behind notifications, gradient
-extern const SkColor kBackgroundDarkColor;   // from light to dark.
+// Behind notifications, gradient
+const SkColor kBackgroundLightColor = SkColorSetRGB(0xf1, 0xf1, 0xf1);
+// from light to dark.
+const SkColor kBackgroundDarkColor = SkColorSetRGB(0xe7, 0xe7, 0xe7);
 
-extern const SkColor kShadowColor;           // Shadow in the tray.
+// Shadow in the tray.
+const SkColor kShadowColor = SkColorSetARGB(0.3 * 255, 0, 0, 0);
 
-extern const SkColor kMessageCenterBackgroundColor;
-extern const SkColor kFooterDelimiterColor;  // Separator color for the tray.
-extern const SkColor kFooterTextColor;       // Text color for tray labels.
+const SkColor kMessageCenterBackgroundColor = SkColorSetRGB(0xee, 0xee, 0xee);
+// Separator color for the tray.
+const SkColor kFooterDelimiterColor = SkColorSetRGB(0xcc, 0xcc, 0xcc);
+// Text color for tray labels.
+const SkColor kFooterTextColor = SkColorSetRGB(0x7b, 0x7b, 0x7b);
 
 }  // namespace message_center
 
diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd
index 36712c8..bfe59ee3 100644
--- a/ui/strings/ui_strings.grd
+++ b/ui/strings/ui_strings.grd
@@ -660,6 +660,9 @@
         <message name="IDS_MESSAGE_CENTER_NOTIFICATION_BUTTON_COPY_SCREENSHOT_TO_CLIPBOARD" desc="The button label for the screenshot notification which copies the screenshot image to clipboard on click.">
           Copy to clipboard
         </message>
+        <message name="IDS_MESSAGE_CENTER_NOTIFIER_HATS_NAME" desc="The name of hats notifier that is a system component">
+          Hats
+        </message>
       </if>
 
       <!-- App list -->
diff --git a/ui/views/mus/BUILD.gn b/ui/views/mus/BUILD.gn
index dd67361..3e9ce23 100644
--- a/ui/views/mus/BUILD.gn
+++ b/ui/views/mus/BUILD.gn
@@ -15,8 +15,6 @@
   sources = [
     "aura_init.cc",
     "aura_init.h",
-    "display_converter.cc",
-    "display_converter.h",
     "display_list.cc",
     "display_list.h",
     "input_method_mus.cc",
@@ -121,11 +119,6 @@
   public_deps = [
     ":mus",
   ]
-  if (!is_component_build) {
-    deps = [
-      "//mojo/gles2",
-    ]
-  }
 }
 
 source_set("test_support") {
@@ -306,7 +299,4 @@
   public_deps = [
     ":mus",
   ]
-  deps = [
-    "//mojo/gles2",
-  ]
 }
diff --git a/ui/views/mus/display_converter.cc b/ui/views/mus/display_converter.cc
deleted file mode 100644
index 0a66aa6..0000000
--- a/ui/views/mus/display_converter.cc
+++ /dev/null
@@ -1,26 +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 "ui/views/mus/display_converter.h"
-
-#include <stdint.h>
-
-#include "components/mus/public/cpp/window.h"
-#include "mojo/converters/geometry/geometry_type_converters.h"
-
-namespace views {
-
-std::vector<display::Display> GetDisplaysFromWindow(mus::Window* window) {
-  static int64_t synthesized_display_id = 2000;
-  display::Display display;
-  display.set_id(synthesized_display_id++);
-  display.SetScaleAndBounds(
-      window->viewport_metrics().device_pixel_ratio,
-      gfx::Rect(window->viewport_metrics().size_in_pixels.To<gfx::Size>()));
-  std::vector<display::Display> displays;
-  displays.push_back(display);
-  return displays;
-}
-
-}  // namespace views
diff --git a/ui/views/mus/display_converter.h b/ui/views/mus/display_converter.h
deleted file mode 100644
index 74de33d..0000000
--- a/ui/views/mus/display_converter.h
+++ /dev/null
@@ -1,24 +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 UI_VIEWS_MUS_DISPLAY_CONVERTER_H_
-#define UI_VIEWS_MUS_DISPLAY_CONVERTER_H_
-
-#include <vector>
-
-#include "ui/display/display.h"
-#include "ui/views/mus/mus_export.h"
-
-namespace mus {
-class Window;
-}
-
-namespace views {
-
-std::vector<display::Display> VIEWS_MUS_EXPORT
-GetDisplaysFromWindow(mus::Window* window);
-
-}  // namespace views
-
-#endif  // UI_VIEWS_MUS_DISPLAY_CONVERTER_H_